#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*/ TRUE;
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ generate(int);
int /*<<< orphan*/ getch();
int /*<<< orphan*/ initPlayer();
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ keypad(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ parseChar();
int /*<<< orphan*/ printMap(int);
int /*<<< orphan*/ printPlayerPosition();
int /*<<< orphan*/ raw();
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ stdscr;
int main(void) {
  initscr();
  raw();
  noecho();
  keypad(stdscr, TRUE);
  int gameSize = 20;
  generate(gameSize);
  printMap(gameSize);
  refresh();
  getch();
  initPlayer();
  printMap(gameSize);
  printPlayerPosition();
  refresh();
  parseChar();
  printMap(gameSize);
  printPlayerPosition();
  refresh();
  getch();
  endwin();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1070 <initscr@plt>
mov    $0x0,%al
call   1080 <raw@plt>
mov    $0x0,%al
call   10d0 <noecho@plt>
mov    0x2dfd(%rip),%rax
mov    (%rax),%edi
mov    0x2dec(%rip),%rax
mov    (%rax),%esi
call   1060 <keypad@plt>
movl   $0x14,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   10e0 <generate@plt>
mov    -0x8(%rbp),%edi
call   1050 <printMap@plt>
mov    $0x0,%al
call   10a0 <refresh@plt>
mov    $0x0,%al
call   10b0 <getch@plt>
mov    $0x0,%al
call   1030 <initPlayer@plt>
mov    -0x8(%rbp),%edi
call   1050 <printMap@plt>
mov    $0x0,%al
call   1090 <printPlayerPosition@plt>
mov    $0x0,%al
call   10a0 <refresh@plt>
mov    $0x0,%al
call   1040 <parseChar@plt>
mov    -0x8(%rbp),%edi
call   1050 <printMap@plt>
mov    $0x0,%al
call   1090 <printPlayerPosition@plt>
mov    $0x0,%al
call   10a0 <refresh@plt>
mov    $0x0,%al
call   10b0 <getch@plt>
mov    $0x0,%al
call   10c0 <endwin@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <initscr@plt>
xor    %eax,%eax
call   1080 <raw@plt>
xor    %eax,%eax
call   10d0 <noecho@plt>
mov    0x2e0b(%rip),%rax
mov    (%rax),%edi
mov    0x2dfa(%rip),%rax
mov    (%rax),%esi
call   1060 <keypad@plt>
mov    $0x14,%edi
call   10e0 <generate@plt>
mov    $0x14,%edi
call   1050 <printMap@plt>
xor    %eax,%eax
call   10a0 <refresh@plt>
xor    %eax,%eax
call   10b0 <getch@plt>
xor    %eax,%eax
call   1030 <initPlayer@plt>
mov    $0x14,%edi
call   1050 <printMap@plt>
xor    %eax,%eax
call   1090 <printPlayerPosition@plt>
xor    %eax,%eax
call   10a0 <refresh@plt>
xor    %eax,%eax
call   1040 <parseChar@plt>
mov    $0x14,%edi
call   1050 <printMap@plt>
xor    %eax,%eax
call   1090 <printPlayerPosition@plt>
xor    %eax,%eax
call   10a0 <refresh@plt>
xor    %eax,%eax
call   10b0 <getch@plt>
xor    %eax,%eax
call   10c0 <endwin@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdscr = global i32 0
@TRUE = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @initscr()
%4 = call i32 (...) @raw()
%5 = call i32 (...) @noecho()
%6 = load i32, i32* @stdscr
%7 = load i32, i32* @TRUE
%8 = call i32 @keypad(i32 %6, i32 %7)
store i32 20, i32* %2
%9 = load i32, i32* %2
%10 = call i32 @generate(i32 %9)
%11 = load i32, i32* %2
%12 = call i32 @printMap(i32 %11)
%13 = call i32 (...) @refresh()
%14 = call i32 (...) @getch()
%15 = call i32 (...) @initPlayer()
%16 = load i32, i32* %2
%17 = call i32 @printMap(i32 %16)
%18 = call i32 (...) @printPlayerPosition()
%19 = call i32 (...) @refresh()
%20 = call i32 (...) @parseChar()
%21 = load i32, i32* %2
%22 = call i32 @printMap(i32 %21)
%23 = call i32 (...) @printPlayerPosition()
%24 = call i32 (...) @refresh()
%25 = call i32 (...) @getch()
%26 = call i32 (...) @endwin()
ret i32 0
}

LLVM IR (-O2):
@stdscr = global i32 0
@TRUE = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 (...) @raw()
%3 = tail call i32 (...) @noecho()
%4 = load i32, i32* @stdscr
%5 = load i32, i32* @TRUE
%6 = tail call i32 @keypad(i32 %4, i32 %5)
%7 = tail call i32 @generate(i32 20)
%8 = tail call i32 @printMap(i32 20)
%9 = tail call i32 (...) @refresh()
%10 = tail call i32 (...) @getch()
%11 = tail call i32 (...) @initPlayer()
%12 = tail call i32 @printMap(i32 20)
%13 = tail call i32 (...) @printPlayerPosition()
%14 = tail call i32 (...) @refresh()
%15 = tail call i32 (...) @parseChar()
%16 = tail call i32 @printMap(i32 20)
%17 = tail call i32 (...) @printPlayerPosition()
%18 = tail call i32 (...) @refresh()
%19 = tail call i32 (...) @getch()
%20 = tail call i32 (...) @endwin()
ret i32 0
}