#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ displayChoices();
int /*<<< orphan*/ emptyConsole();
int /*<<< orphan*/ gameMangerMain(int);
int getUserChoice();
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ sleepTime();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  int userChoice;
  char loopBreak;
  srand(time(0));
  while (1) {
    userChoice = -1;
    while (userChoice == -1) {
      sleepTime();
      emptyConsole();
      displayChoices();
      userChoice = getUserChoice();
    }
    gameMangerMain(userChoice);
    printf("Do you want to continue? (Y/N) ");
    scanf("\n%c", &loopBreak);
    if (!(loopBreak == 'Y' || loopBreak == 'y')) {
      break;
    }
  }
  printf("\nPress the Enter or Return key to exit\n");
  getchar();
  getchar();
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
call   10a0 <time@plt>
mov    %eax,%edi
call   1070 <srand@plt>
movl   $0xffffffff,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    11f9 <main+0x59>
mov    $0x0,%al
call   1090 <sleepTime@plt>
mov    $0x0,%al
call   1060 <emptyConsole@plt>
mov    $0x0,%al
call   10c0 <displayChoices@plt>
mov    $0x0,%al
call   1040 <getUserChoice@plt>
mov    %eax,-0x14(%rbp)
jmp    11cb <main+0x2b>
mov    -0x14(%rbp),%edi
call   1030 <gameMangerMain@plt>
lea    0xdf8(%rip),%rdi
call   1050 <printf@plt>
lea    0xe0c(%rip),%rdi
lea    -0x15(%rbp),%rsi
call   10b0 <scanf@plt>
movsbl -0x15(%rbp),%eax
cmp    $0x59,%eax
je     123c <main+0x9c>
movsbl -0x15(%rbp),%eax
cmp    $0x79,%eax
je     123c <main+0x9c>
jmp    1241 <main+0xa1>
jmp    11c4 <main+0x24>
lea    0xddc(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1080 <getchar@plt>
mov    $0x0,%al
call   1080 <getchar@plt>
mov    0x2d7e(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
xor    %edi,%edi
call   10b0 <time@plt>
mov    %eax,%edi
call   1080 <srand@plt>
lea    0xe32(%rip),%r14
lea    0xe4b(%rip),%r15
lea    0xf(%rsp),%rbx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   10a0 <sleepTime@plt>
xor    %eax,%eax
call   1070 <emptyConsole@plt>
xor    %eax,%eax
call   10d0 <displayChoices@plt>
xor    %eax,%eax
call   1050 <getUserChoice@plt>
cmp    $0xffffffff,%eax
je     11e0 <main+0x30>
mov    %eax,%edi
call   1040 <gameMangerMain@plt>
mov    %r14,%rdi
call   1060 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   10c0 <scanf@plt>
movzbl 0xf(%rsp),%eax
and    $0xdf,%al
cmp    $0x59,%al
je     11e0 <main+0x30>
lea    0xdf7(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1090 <getchar@plt>
xor    %eax,%eax
call   1090 <getchar@plt>
mov    0x2d99(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Do you want to continue? (Y/N) \00"
@.str.1 = [4 x i8] c"\0A%c\00"
@.str.2 = [40 x i8] c"\0APress the Enter or Return key to exit\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 @time(i32 0)
%9 = call i32 @srand(i32 %8)
br label %10
10: ; preds = %2, %32
store i32 -1, i32* %6
br label %11
11: ; preds = %14, %10
%12 = load i32, i32* %6
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %19
14: ; preds = %11
%15 = call i32 (...) @sleepTime()
%16 = call i32 (...) @emptyConsole()
%17 = call i32 (...) @displayChoices()
%18 = call i32 (...) @getUserChoice()
store i32 %18, i32* %6
br label %11
19: ; preds = %11
%20 = load i32, i32* %6
%21 = call i32 @gameMangerMain(i32 %20)
%22 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%23 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%24 = load i8, i8* %7
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 89
br i1 %26, label %32, label %27
27: ; preds = %19
%28 = load i8, i8* %7
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %29, 121
br i1 %30, label %32, label %31
31: ; preds = %27
br label %33
32: ; preds = %27, %19
br label %10
33: ; preds = %31
%34 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
%35 = call i32 (...) @getchar()
%36 = call i32 (...) @getchar()
%37 = load i32, i32* @EXIT_SUCCESS
ret i32 %37
}

LLVM IR (-O2):
@.str = [32 x i8] c"Do you want to continue? (Y/N) \00"
@.str.1 = [4 x i8] c"\0A%c\00"
@EXIT_SUCCESS = global i32 0
@str = [39 x i8] c"\0APress the Enter or Return key to exit\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i8
%4 = tail call i32 @time(i32 0)
%5 = tail call i32 @srand(i32 %4)
br label %6
6: ; preds = %12, %2
%7 = call i32 (...) @sleepTime()
%8 = call i32 (...) @emptyConsole()
%9 = call i32 (...) @displayChoices()
%10 = call i32 (...) @getUserChoice()
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %13
12: ; preds = %6, %13
br label %6
13: ; preds = %6
%14 = call i32 @gameMangerMain(i32 %10)
%15 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%17 = load i8, i8* %3
%18 = and i8 %17, -33
%19 = icmp eq i8 %18, 89
br i1 %19, label %12, label %20
20: ; preds = %13
%21 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%22 = call i32 (...) @getchar()
%23 = call i32 (...) @getchar()
%24 = load i32, i32* @EXIT_SUCCESS
ret i32 %24
}