#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 ActionCenter();
int Anew();
int Load();
int ReadN();
int /*<<< orphan*/ Space(int);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
int main() {
  int input, output;
  do {
    printf("0 - Create new game\n");
    printf("1 - Load game\n");
    Space(21);
    printf("Choose, write and ENTER: ");
    input = ReadN();
    if (input == 0)
      output = Anew();
    else
      output = Load();
    if (output == 1) {
      printf("\nTry again.");
      getchar();
    }
  } while (output == 1);
  do {
    output = ActionCenter();
  } while (output == 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe7a(%rip),%rdi
call   1050 <printf@plt>
lea    0xe83(%rip),%rdi
call   1050 <printf@plt>
mov    $0x15,%edi
call   1070 <Space@plt>
lea    0xe7c(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1040 <ReadN@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    11d0 <main+0x60>
mov    $0x0,%al
call   1090 <Anew@plt>
mov    %eax,-0xc(%rbp)
jmp    11da <main+0x6a>
mov    $0x0,%al
call   1030 <Load@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    11f7 <main+0x87>
lea    0xe53(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
jmp    11fc <main+0x8c>
cmpl   $0x1,-0xc(%rbp)
je     117f <main+0xf>
jmp    120b <main+0x9b>
mov    $0x0,%al
call   1080 <ActionCenter@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
je     120b <main+0x9b>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xe97(%rip),%r14
lea    0xea4(%rip),%r15
lea    0xe63(%rip),%rbx
lea    0xe76(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
mov    $0x15,%edi
call   1080 <Space@plt>
mov    %rbx,%rdi
call   1060 <printf@plt>
xor    %eax,%eax
call   1050 <ReadN@plt>
test   %eax,%eax
je     11f0 <main+0x70>
xor    %eax,%eax
call   1040 <Load@plt>
cmp    $0x1,%eax
je     11fc <main+0x7c>
jmp    1210 <main+0x90>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   10a0 <Anew@plt>
cmp    $0x1,%eax
jne    1210 <main+0x90>
mov    %r12,%rdi
call   1060 <printf@plt>
xor    %eax,%eax
call   1070 <getchar@plt>
jmp    11b0 <main+0x30>
nopl   (%rax)
xor    %eax,%eax
call   1090 <ActionCenter@plt>
cmp    $0x1,%eax
je     1210 <main+0x90>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [21 x i8] c"0 - Create new game\0A\00"
@.str.1 = [15 x i8] c"1 - Load game\0A\00"
@.str.2 = [26 x i8] c"Choose, write and ENTER: \00"
@.str.3 = [12 x i8] c"\0ATry again.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
br label %4
4: ; preds = %23, %0
%5 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @Space(i32 21)
%8 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 (...) @ReadN()
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %4
%13 = call i32 (...) @Anew()
store i32 %13, i32* %3
br label %16
14: ; preds = %4
%15 = call i32 (...) @Load()
store i32 %15, i32* %3
br label %16
16: ; preds = %14, %12
%17 = load i32, i32* %3
%18 = icmp eq i32 %17, 1
br i1 %18, label %19, label %22
19: ; preds = %16
%20 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%21 = call i32 (...) @getchar()
br label %22
22: ; preds = %19, %16
br label %23
23: ; preds = %22
%24 = load i32, i32* %3
%25 = icmp eq i32 %24, 1
br i1 %25, label %4, label %26
26: ; preds = %23
br label %27
27: ; preds = %29, %26
%28 = call i32 (...) @ActionCenter()
store i32 %28, i32* %3
br label %29
29: ; preds = %27
%30 = load i32, i32* %3
%31 = icmp eq i32 %30, 1
br i1 %31, label %27, label %32
32: ; preds = %29
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [26 x i8] c"Choose, write and ENTER: \00"
@.str.3 = [12 x i8] c"\0ATry again.\00"
@str = [20 x i8] c"0 - Create new game\00"
@str.4 = [14 x i8] c"1 - Load game\00"
define i32 @main() {
br label %1
1: ; preds = %15, %0
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.4, i64 0, i64 0))
%4 = tail call i32 @Space(i32 21)
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 (...) @ReadN()
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = tail call i32 (...) @Anew()
br label %12
10: ; preds = %1
%11 = tail call i32 (...) @Load()
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
%14 = icmp eq i32 %13, 1
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%17 = tail call i32 (...) @getchar()
br label %1
18: ; preds = %12, %18
%19 = tail call i32 (...) @ActionCenter()
%20 = icmp eq i32 %19, 1
br i1 %20, label %18, label %21
21: ; preds = %18
ret i32 0
}