int __cdecl main(int argc, const char **argv, const char **envp)
{
int choice; // [rsp+Ch] [rbp-4h] BYREF
setvbuf(stdout, 0LL, 2, 0LL);
setvbuf(stdin, 0LL, 1, 0LL);
puts("Welcome to the Adventure!");
puts("You find yourself standing at a crossroad.");
puts("What do you do?");
puts("1. Go left");
puts("2. Go right");
puts("3. Stay where you are");
printf("Enter your choice: ");
__isoc99_scanf("%d", &choice);
if ( choice == 3 )
stayWhereYouAre();
if ( choice > 3 )
goto LABEL_9;
if ( choice == 1 )
{
exploreLeft();
}
else
{
if ( choice != 2 )
{
LABEL_9:
puts("Invalid choice.");
return 0;
}
exploreRight();
}
return 0;
}
void __cdecl exploreRight()
{
int choice; // [rsp+Ch] [rbp-4h] BYREF
puts("You chose to go right.");
puts("You find a hidden treasure chest!");
puts("This treasure chest contains a dragon egg!");
puts("Do you want to hatch it?");
puts("1. Yes");
puts("2. No");
__isoc99_scanf("%d", &choice);
if ( choice == 1 )
{
hatchEgg();
}
else
{
if ( choice == 2 )
{
puts("You do not wish to hatch the egg!");
puts("You leave the treasure chest......");
puts("You get transported out by a mysterious power.");
exit(0);
}
puts("Invalid choice.");
}
}
void __cdecl hatchEgg()
{
char name[20]; // [rsp+0h] [rbp-20h] BYREF
puts("You wish to hatch the egg!");
puts("Give the baby dragon a name");
getchar();
fflush(stdin);
gets(name);
printf("Your dragon is now called %s\n", name);
printf("You leave the area with %s\n", name);
}
__int64 __fastcall main(int a1, char **a2, char **a3)
{
unsigned int details; // [rsp+Ch] [rbp-34h] BYREF
char travel_dest[24]; // [rsp+10h] [rbp-30h] BYREF
int age; // [rsp+28h] [rbp-18h] BYREF
char last_name[10]; // [rsp+2Ch] [rbp-14h] BYREF
char first_name[10]; // [rsp+36h] [rbp-Ah] BYREF
details = 0;
puts("-------------------------------------------------------------");
puts("Welcome to the Ticketing Service of Dhanbad Railaway Station");
puts("-------------------------------------------------------------");
puts("Please fill up your details below:");
printf("First Name: ");
__isoc99_scanf("%s", first_name);
printf("Last Name: ");
__isoc99_scanf("%s", last_name);
printf("Age: ");
__isoc99_scanf("%d", &age);
puts("Please select the destination you want to travel to: ");
puts("Delhi");
puts("Mumbai");
puts("Kolkata");
puts("Chennai");
puts("Bangalore");
__isoc99_scanf("%s", travel_dest);
puts("-------------------------------------------------------------");
printf("Would you like to confirm the details? (1/0): ");
__isoc99_scanf("%d", &details);
if ( details >= 2 )
{
puts("Please fill up the details again");
details = 0;
exit(0);
}
puts("-------------------------------------------------------------");
puts("Thank you for confirming the details");
puts("-------------------------------------------------------------");
puts("Your ticket has been booked successfully");
puts("Your ticket details are as follows:");
printf("First Name: %s Last Name %s \n", first_name, last_name);
printf("Origin: Dhanbad Destination: %s\n", travel_dest);
puts("-------------------------------------------------------------");
puts("Thank you for visiting Dhanbad");
puts("Please give us a review based on your experience");
review();
return 0LL;
}
int review()
{
int rate; // [rsp+Ch] [rbp-24h] BYREF
char v2[32]; // [rsp+10h] [rbp-20h] BYREF
printf("Rate your ticket booking experience from 1 to 5: ");
__isoc99_scanf("%d", &rate);
if ( rate == 5 )
{
puts("Thank you for the rating");
puts("We hope you have a great journey");
exit(0);
}
if ( rate > 4 )
{
puts("Invalid rating");
return puts("Please try again");
}
else
{
puts("We are sorry for the inconvenience");
puts("Please help us to improve your future experience");
getchar();
fflush(stdin);
return gets(v2); // bof
}
}