#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*/ endwin();
int /*<<< orphan*/ game();
int /*<<< orphan*/ get_options(int, int);
int /*<<< orphan*/ getmaxyx(int /*<<< orphan*/, int, int);
int /*<<< orphan*/ initscr();
int print_menu(int, int);
int /*<<< orphan*/ stdscr;
int main() {
  int rows, cols;
  initscr();
  getmaxyx(stdscr, rows, cols);
  endwin();
_LOOP:
  switch (print_menu(rows, cols)) {
  case 1:
    game();
    break;
  case 2:
    get_options(rows, cols);
    break;
  default:
    goto _END;
  }
  goto _LOOP;
_END:
  endwin();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <initscr@plt>
mov    0x2e6b(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1040 <getmaxyx@plt>
mov    $0x0,%al
call   1060 <endwin@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <print_menu@plt>
mov    %eax,%ecx
mov    %ecx,-0x10(%rbp)
sub    $0x1,%eax
je     11c0 <main+0x60>
jmp    11af <main+0x4f>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     11cc <main+0x6c>
jmp    11dc <main+0x7c>
mov    $0x0,%al
call   1070 <game@plt>
jmp    11e1 <main+0x81>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1080 <get_options@plt>
jmp    11e1 <main+0x81>
jmp    11e6 <main+0x86>
jmp    1191 <main+0x31>
mov    $0x0,%al
call   1060 <endwin@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <initscr@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
call   1040 <getmaxyx@plt>
xor    %eax,%eax
call   1060 <endwin@plt>
jmp    1185 <main+0x25>
nop
call   1080 <get_options@plt>
call   1050 <print_menu@plt>
cmp    $0x2,%eax
je     1180 <main+0x20>
cmp    $0x1,%eax
jne    119d <main+0x3d>
xor    %eax,%eax
call   1070 <game@plt>
jmp    1185 <main+0x25>
xor    %eax,%eax
call   1060 <endwin@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdscr = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @initscr()
%5 = load i32, i32* @stdscr
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call i32 @getmaxyx(i32 %5, i32 %6, i32 %7)
%9 = call i32 (...) @endwin()
br label %10
10: ; preds = %21, %0
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = call i32 @print_menu(i32 %11, i32 %12)
switch i32 %13, label %20 [
i32 1, label %14
i32 2, label %16
]
14: ; preds = %10
%15 = call i32 (...) @game()
br label %21
16: ; preds = %10
%17 = load i32, i32* %2
%18 = load i32, i32* %3
%19 = call i32 @get_options(i32 %17, i32 %18)
br label %21
20: ; preds = %10
br label %22
21: ; preds = %16, %14
br label %10
22: ; preds = %20
%23 = call i32 (...) @endwin()
ret i32 0
}

LLVM IR (-O2):
@stdscr = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @initscr()
%2 = load i32, i32* @stdscr
%3 = tail call i32 @getmaxyx(i32 %2, i32 undef, i32 undef)
%4 = tail call i32 (...) @endwin()
br label %5
5: ; preds = %11, %0
%6 = tail call i32 @print_menu(i32 undef, i32 undef)
switch i32 %6, label %12 [
i32 1, label %7
i32 2, label %9
]
7: ; preds = %5
%8 = tail call i32 (...) @game()
br label %11
9: ; preds = %5
%10 = tail call i32 @get_options(i32 undef, i32 undef)
br label %11
11: ; preds = %9, %7
br label %5
12: ; preds = %5
%13 = tail call i32 (...) @endwin()
ret i32 0
}