#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*/ cbreak();
int /*<<< orphan*/ endwin();
scalar_t__ game();
int /*<<< orphan*/ getch();
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ mvprintw(int, int, char *);
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ register_colors();
int /*<<< orphan*/ register_pair();
int /*<<< orphan*/ srand(int);
int main(void) {
  srand(9);
  initscr();
  cbreak();
  noecho();
  register_colors();
  register_pair();
  for (; game();) {
    mvprintw(6, 6, "Game Over");
    getch();
  }
  endwin();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x9,%edi
call   1060 <srand@plt>
mov    $0x0,%al
call   1050 <initscr@plt>
mov    $0x0,%al
call   1030 <cbreak@plt>
mov    $0x0,%al
call   10b0 <noecho@plt>
mov    $0x0,%al
call   1040 <register_colors@plt>
mov    $0x0,%al
call   1080 <register_pair@plt>
mov    $0x0,%al
call   10a0 <game@plt>
cmp    $0x0,%rax
je     120c <main+0x6c>
mov    $0x6,%esi
lea    0xe07(%rip),%rdx
mov    %esi,%edi
call   10c0 <mvprintw@plt>
mov    $0x0,%al
call   1070 <getch@plt>
jmp    11dc <main+0x3c>
mov    $0x0,%al
call   1090 <endwin@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x9,%edi
call   1060 <srand@plt>
xor    %eax,%eax
call   1050 <initscr@plt>
xor    %eax,%eax
call   1030 <cbreak@plt>
xor    %eax,%eax
call   10b0 <noecho@plt>
xor    %eax,%eax
call   1040 <register_colors@plt>
xor    %eax,%eax
call   1080 <register_pair@plt>
xor    %eax,%eax
call   10a0 <game@plt>
test   %rax,%rax
je     1215 <main+0x75>
lea    0xe1f(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x6,%edi
mov    $0x6,%esi
mov    %rbx,%rdx
call   10c0 <mvprintw@plt>
xor    %eax,%eax
call   1070 <getch@plt>
xor    %eax,%eax
call   10a0 <game@plt>
test   %rax,%rax
jne    11f0 <main+0x50>
xor    %eax,%eax
call   1090 <endwin@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Game Over\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @srand(i32 9)
%3 = call i32 (...) @initscr()
%4 = call i32 (...) @cbreak()
%5 = call i32 (...) @noecho()
%6 = call i32 (...) @register_colors()
%7 = call i32 (...) @register_pair()
br label %8
8: ; preds = %11, %0
%9 = call i64 (...) @game()
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = call i32 @mvprintw(i32 6, i32 6, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%13 = call i32 (...) @getch()
br label %8
14: ; preds = %8
%15 = call i32 (...) @endwin()
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"Game Over\00"
define i32 @main() {
%1 = tail call i32 @srand(i32 9)
%2 = tail call i32 (...) @initscr()
%3 = tail call i32 (...) @cbreak()
%4 = tail call i32 (...) @noecho()
%5 = tail call i32 (...) @register_colors()
%6 = tail call i32 (...) @register_pair()
%7 = tail call i64 (...) @game()
%8 = icmp eq i64 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %0, %9
%10 = tail call i32 @mvprintw(i32 6, i32 6, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%11 = tail call i32 (...) @getch()
%12 = tail call i64 (...) @game()
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %9
14: ; preds = %9, %0
%15 = tail call i32 (...) @endwin()
ret i32 0
}