#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 */
typedef char chtype;
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ COLOR_BLACK;
int /*<<< orphan*/ COLOR_CYAN;
int /*<<< orphan*/ COLOR_GREEN;
int /*<<< orphan*/ COLOR_PAIR(int);
int /*<<< orphan*/ COLOR_WHITE;
int /*<<< orphan*/ COLOR_YELLOW;
int /*<<< orphan*/ box(int /*<<< orphan*/ *, int /*<<< orphan*/,
                       int /*<<< orphan*/);
int /*<<< orphan*/ delwin(int /*<<< orphan*/ *);
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ has_colors();
int /*<<< orphan*/ init_pair(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ mvwaddch(int /*<<< orphan*/ *, int, int, char);
int /*<<< orphan*/ *newwin(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ start_color();
int /*<<< orphan*/ wattrset(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ wgetch(int /*<<< orphan*/ *);
int /*<<< orphan*/ wrefresh(int /*<<< orphan*/ *);
void startGame() {
  chtype pacman = 'C';
  chtype food = 248;
  chtype monster = 232;
  chtype wall = 176;
  WINDOW *win = newwin(0, 0, 0, 0);
  wrefresh(win);
  box(win, 0, 0);
  wrefresh(win);
  if (has_colors()) {
    start_color();
    init_pair(1, COLOR_YELLOW, COLOR_BLACK);
    init_pair(2, COLOR_GREEN, COLOR_BLACK);
    init_pair(3, COLOR_CYAN, COLOR_BLACK);
    init_pair(4, COLOR_WHITE, COLOR_BLACK);
  }
  wattrset(win, COLOR_PAIR(1));
  mvwaddch(win, 2, 2, pacman);
  wgetch(win);
  delwin(win);
  endwin();
  exit(0);
}


x86 assembly (clang, -O0):
<startGame>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movb   $0x43,-0x1(%rbp)
movb   $0xf8,-0x2(%rbp)
movb   $0xe8,-0x3(%rbp)
movb   $0xb0,-0x4(%rbp)
xor    %ecx,%ecx
mov    %ecx,%edi
mov    %ecx,%esi
mov    %ecx,%edx
call   1080 <newwin@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <wrefresh@plt>
mov    -0x10(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1090 <box@plt>
mov    -0x10(%rbp),%rdi
call   1060 <wrefresh@plt>
mov    $0x0,%al
call   1030 <has_colors@plt>
cmp    $0x0,%rax
je     12a0 <startGame+0xd0>
mov    $0x0,%al
call   1070 <start_color@plt>
mov    0x2d89(%rip),%rax
mov    (%rax),%esi
mov    0x2da8(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%edi
call   1050 <init_pair@plt>
mov    0x2d85(%rip),%rax
mov    (%rax),%esi
mov    0x2d8c(%rip),%rax
mov    (%rax),%edx
mov    $0x2,%edi
call   1050 <init_pair@plt>
mov    0x2d71(%rip),%rax
mov    (%rax),%esi
mov    0x2d70(%rip),%rax
mov    (%rax),%edx
mov    $0x3,%edi
call   1050 <init_pair@plt>
mov    0x2d3d(%rip),%rax
mov    (%rax),%esi
mov    0x2d54(%rip),%rax
mov    (%rax),%edx
mov    $0x4,%edi
call   1050 <init_pair@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x1,%edi
call   10b0 <COLOR_PAIR@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1040 <wattrset@plt>
mov    -0x10(%rbp),%rdi
mov    $0x2,%edx
mov    %edx,%esi
movsbl -0x1(%rbp),%ecx
call   10e0 <mvwaddch@plt>
mov    -0x10(%rbp),%rdi
call   10d0 <wgetch@plt>
mov    -0x10(%rbp),%rdi
call   10a0 <delwin@plt>
mov    $0x0,%al
call   10c0 <endwin@plt>
xor    %edi,%edi
call   10f0 <exit@plt>

x86 assembly (clang, -O2):
<startGame>:
push   %r14
push   %rbx
push   %rax
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1080 <newwin@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1060 <wrefresh@plt>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1090 <box@plt>
mov    %rbx,%rdi
call   1060 <wrefresh@plt>
xor    %eax,%eax
call   1030 <has_colors@plt>
test   %rax,%rax
je     1272 <startGame+0xa2>
xor    %eax,%eax
call   1070 <start_color@plt>
mov    0x2da6(%rip),%rax
mov    (%rax),%esi
mov    0x2dc5(%rip),%r14
mov    (%r14),%edx
mov    $0x1,%edi
call   1050 <init_pair@plt>
mov    0x2da1(%rip),%rax
mov    (%rax),%esi
mov    (%r14),%edx
mov    $0x2,%edi
call   1050 <init_pair@plt>
mov    0x2d93(%rip),%rax
mov    (%rax),%esi
mov    (%r14),%edx
mov    $0x3,%edi
call   1050 <init_pair@plt>
mov    0x2d65(%rip),%rax
mov    (%rax),%esi
mov    (%r14),%edx
mov    $0x4,%edi
call   1050 <init_pair@plt>
mov    $0x1,%edi
call   10b0 <COLOR_PAIR@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <wattrset@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x2,%edx
mov    $0x43,%ecx
call   10e0 <mvwaddch@plt>
mov    %rbx,%rdi
call   10d0 <wgetch@plt>
mov    %rbx,%rdi
call   10a0 <delwin@plt>
xor    %eax,%eax
call   10c0 <endwin@plt>
xor    %edi,%edi
call   10f0 <exit@plt>

LLVM IR (-O0):
@COLOR_YELLOW = global i32 0
@COLOR_BLACK = global i32 0
@COLOR_GREEN = global i32 0
@COLOR_CYAN = global i32 0
@COLOR_WHITE = global i32 0
define void @startGame() {
%1 = alloca i8
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32*
store i8 67, i8* %1
store i8 -8, i8* %2
store i8 -24, i8* %3
store i8 -80, i8* %4
%6 = call i32* @newwin(i32 0, i32 0, i32 0, i32 0)
store i32* %6, i32** %5
%7 = load i32*, i32** %5
%8 = call i32 @wrefresh(i32* %7)
%9 = load i32*, i32** %5
%10 = call i32 @box(i32* %9, i32 0, i32 0)
%11 = load i32*, i32** %5
%12 = call i32 @wrefresh(i32* %11)
%13 = call i64 (...) @has_colors()
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %29
15: ; preds = %0
%16 = call i32 (...) @start_color()
%17 = load i32, i32* @COLOR_YELLOW
%18 = load i32, i32* @COLOR_BLACK
%19 = call i32 @init_pair(i32 1, i32 %17, i32 %18)
%20 = load i32, i32* @COLOR_GREEN
%21 = load i32, i32* @COLOR_BLACK
%22 = call i32 @init_pair(i32 2, i32 %20, i32 %21)
%23 = load i32, i32* @COLOR_CYAN
%24 = load i32, i32* @COLOR_BLACK
%25 = call i32 @init_pair(i32 3, i32 %23, i32 %24)
%26 = load i32, i32* @COLOR_WHITE
%27 = load i32, i32* @COLOR_BLACK
%28 = call i32 @init_pair(i32 4, i32 %26, i32 %27)
br label %29
29: ; preds = %15, %0
%30 = load i32*, i32** %5
%31 = call i32 @COLOR_PAIR(i32 1)
%32 = call i32 @wattrset(i32* %30, i32 %31)
%33 = load i32*, i32** %5
%34 = load i8, i8* %1
%35 = call i32 @mvwaddch(i32* %33, i32 2, i32 2, i8 signext %34)
%36 = load i32*, i32** %5
%37 = call i32 @wgetch(i32* %36)
%38 = load i32*, i32** %5
%39 = call i32 @delwin(i32* %38)
%40 = call i32 (...) @endwin()
%41 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@COLOR_YELLOW = global i32 0
@COLOR_BLACK = global i32 0
@COLOR_GREEN = global i32 0
@COLOR_CYAN = global i32 0
@COLOR_WHITE = global i32 0
define void @startGame() {
%1 = tail call i32* @newwin(i32 0, i32 0, i32 0, i32 0)
%2 = tail call i32 @wrefresh(i32* %1)
%3 = tail call i32 @box(i32* %1, i32 0, i32 0)
%4 = tail call i32 @wrefresh(i32* %1)
%5 = tail call i64 (...) @has_colors()
%6 = icmp eq i64 %5, 0
br i1 %6, label %21, label %7
7: ; preds = %0
%8 = tail call i32 (...) @start_color()
%9 = load i32, i32* @COLOR_YELLOW
%10 = load i32, i32* @COLOR_BLACK
%11 = tail call i32 @init_pair(i32 1, i32 %9, i32 %10)
%12 = load i32, i32* @COLOR_GREEN
%13 = load i32, i32* @COLOR_BLACK
%14 = tail call i32 @init_pair(i32 2, i32 %12, i32 %13)
%15 = load i32, i32* @COLOR_CYAN
%16 = load i32, i32* @COLOR_BLACK
%17 = tail call i32 @init_pair(i32 3, i32 %15, i32 %16)
%18 = load i32, i32* @COLOR_WHITE
%19 = load i32, i32* @COLOR_BLACK
%20 = tail call i32 @init_pair(i32 4, i32 %18, i32 %19)
br label %21
21: ; preds = %7, %0
%22 = tail call i32 @COLOR_PAIR(i32 1)
%23 = tail call i32 @wattrset(i32* %1, i32 %22)
%24 = tail call i32 @mvwaddch(i32* %1, i32 2, i32 2, i8 signext 67)
%25 = tail call i32 @wgetch(i32* %1)
%26 = tail call i32 @delwin(i32* %1)
%27 = tail call i32 (...) @endwin()
%28 = tail call i32 @exit(i32 0)
unreachable
}