#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 /*<<< orphan*/ chooseMode();
int /*<<< orphan*/ menuSelection(int *, char *, char **, int);
int /*<<< orphan*/ printLogo();
int /*<<< orphan*/ printf(char *);
int main(void) {
  printLogo();
  int menuChoice;
  char *mainMenuOptions[] = {"1. Play", "2. Quit"};
  menuSelection(&menuChoice, "MAIN MENU", mainMenuOptions, 2);
  if (menuChoice == 1)
    chooseMode();
  else
    printf("   |                                                               "
           "         |\n"
           "   "
           "==================================================================="
           "=======\n\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <printLogo@plt>
mov    0x2cb3(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2cb0(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rdx
lea    -0x8(%rbp),%rdi
lea    0xe95(%rip),%rsi
mov    $0x2,%ecx
call   1050 <menuSelection@plt>
cmpl   $0x1,-0x8(%rbp)
jne    119b <main+0x5b>
mov    $0x0,%al
call   1060 <chooseMode@plt>
jmp    11a7 <main+0x67>
lea    0xe78(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
xor    %eax,%eax
call   1040 <printLogo@plt>
movaps 0x2cbe(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0xeb2(%rip),%rsi
lea    0xc(%rsp),%rdi
lea    0x10(%rsp),%rdx
mov    $0x2,%ecx
call   1050 <menuSelection@plt>
cmpl   $0x1,0xc(%rsp)
jne    1182 <main+0x42>
xor    %eax,%eax
call   1060 <chooseMode@plt>
jmp    118e <main+0x4e>
lea    0xe91(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"1. Play\00"
@.str.1 = [8 x i8] c"2. Quit\00"
@__const.main.mainMenuOptions = [2 x i8*] [i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i32 0, i32 0)]
@.str.2 = [10 x i8] c"MAIN MENU\00"
@.str.3 = [158 x i8] c" | |\0A ==========================================================================\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [2 x i8*]
store i32 0, i32* %1
%4 = call i32 (...) @printLogo()
%5 = bitcast [2 x i8*]* %3 to i8*
%6 = getelementptr inbounds [2 x i8*], [2 x i8*]* %3, i64 0, i64 0
%7 = call i32 @menuSelection(i32* %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8** %6, i32 2)
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 (...) @chooseMode()
br label %14
12: ; preds = %0
%13 = call i32 @printf(i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.3, i64 0, i64 0))
br label %14
14: ; preds = %12, %10
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"1. Play\00"
@.str.1 = [8 x i8] c"2. Quit\00"
@__const.main.mainMenuOptions = [2 x i8*] [i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i32 0, i32 0)]
@.str.2 = [10 x i8] c"MAIN MENU\00"
@str = [157 x i8] c" | |\0A ==========================================================================\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x i8*]
%3 = tail call i32 (...) @printLogo()
%4 = bitcast i32* %1 to i8*
%5 = bitcast [2 x i8*]* %2 to i8*
%6 = getelementptr inbounds [2 x i8*], [2 x i8*]* %2, i64 0, i64 0
%7 = call i32 @menuSelection(i32* %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8** %6, i32 2)
%8 = load i32, i32* %1
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 (...) @chooseMode()
br label %14
12: ; preds = %0
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([157 x i8], [157 x i8]* @str, i64 0, i64 0))
br label %14
14: ; preds = %12, %10
ret i32 0
}