#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*/ COLOR_BLACK;
int /*<<< orphan*/ COLOR_BLUE;
int /*<<< orphan*/ COLOR_GREEN;
int /*<<< orphan*/ COLOR_MAGENTA;
int /*<<< orphan*/ COLOR_RED;
int /*<<< orphan*/ COLOR_WHITE;
int /*<<< orphan*/ COLOR_YELLOW;
int /*<<< orphan*/ TRUE;
int /*<<< orphan*/ clear();
int /*<<< orphan*/ init_pair(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ keypad(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ start_color();
int /*<<< orphan*/ stdscr;
void startNcurses() {
  initscr();
  clear();
  noecho();
  keypad(stdscr, TRUE);
  start_color();
  init_pair(1, COLOR_WHITE, COLOR_BLACK);
  init_pair(2, COLOR_YELLOW, COLOR_BLACK);
  init_pair(3, COLOR_YELLOW, COLOR_BLACK);
  init_pair(4, COLOR_RED, COLOR_BLACK);
  init_pair(5, COLOR_RED, COLOR_BLACK);
  init_pair(6, COLOR_MAGENTA, COLOR_BLACK);
  init_pair(7, COLOR_MAGENTA, COLOR_BLACK);
  init_pair(8, COLOR_BLUE, COLOR_BLACK);
  init_pair(9, COLOR_BLUE, COLOR_BLACK);
  init_pair(10, COLOR_GREEN, COLOR_BLACK);
  init_pair(11, COLOR_GREEN, COLOR_BLACK);
}


x86 assembly (clang, -O0):
<startNcurses>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <initscr@plt>
mov    $0x0,%al
call   1080 <clear@plt>
mov    $0x0,%al
call   1070 <noecho@plt>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
mov    0x2e57(%rip),%rax
mov    (%rax),%esi
call   1040 <keypad@plt>
mov    $0x0,%al
call   1060 <start_color@plt>
mov    0x2e1a(%rip),%rax
mov    (%rax),%esi
mov    0x2e31(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%edi
call   1030 <init_pair@plt>
mov    0x2df6(%rip),%rax
mov    (%rax),%esi
mov    0x2e15(%rip),%rax
mov    (%rax),%edx
mov    $0x2,%edi
call   1030 <init_pair@plt>
mov    0x2dda(%rip),%rax
mov    (%rax),%esi
mov    0x2df9(%rip),%rax
mov    (%rax),%edx
mov    $0x3,%edi
call   1030 <init_pair@plt>
mov    0x2dae(%rip),%rax
mov    (%rax),%esi
mov    0x2ddd(%rip),%rax
mov    (%rax),%edx
mov    $0x4,%edi
call   1030 <init_pair@plt>
mov    0x2d92(%rip),%rax
mov    (%rax),%esi
mov    0x2dc1(%rip),%rax
mov    (%rax),%edx
mov    $0x5,%edi
call   1030 <init_pair@plt>
mov    0x2d96(%rip),%rax
mov    (%rax),%esi
mov    0x2da5(%rip),%rax
mov    (%rax),%edx
mov    $0x6,%edi
call   1030 <init_pair@plt>
mov    0x2d7a(%rip),%rax
mov    (%rax),%esi
mov    0x2d89(%rip),%rax
mov    (%rax),%edx
mov    $0x7,%edi
call   1030 <init_pair@plt>
mov    0x2d46(%rip),%rax
mov    (%rax),%esi
mov    0x2d6d(%rip),%rax
mov    (%rax),%edx
mov    $0x8,%edi
call   1030 <init_pair@plt>
mov    0x2d2a(%rip),%rax
mov    (%rax),%esi
mov    0x2d51(%rip),%rax
mov    (%rax),%edx
mov    $0x9,%edi
call   1030 <init_pair@plt>
mov    0x2d36(%rip),%rax
mov    (%rax),%esi
mov    0x2d35(%rip),%rax
mov    (%rax),%edx
mov    $0xa,%edi
call   1030 <init_pair@plt>
mov    0x2d1a(%rip),%rax
mov    (%rax),%esi
mov    0x2d19(%rip),%rax
mov    (%rax),%edx
mov    $0xb,%edi
call   1030 <init_pair@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<startNcurses>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <initscr@plt>
xor    %eax,%eax
call   1080 <clear@plt>
xor    %eax,%eax
call   1070 <noecho@plt>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
mov    0x2e57(%rip),%rax
mov    (%rax),%esi
call   1040 <keypad@plt>
xor    %eax,%eax
call   1060 <start_color@plt>
mov    0x2e1a(%rip),%rax
mov    (%rax),%esi
mov    0x2e31(%rip),%rbx
mov    (%rbx),%edx
mov    $0x1,%edi
call   1030 <init_pair@plt>
mov    0x2df6(%rip),%r14
mov    (%r14),%esi
mov    (%rbx),%edx
mov    $0x2,%edi
call   1030 <init_pair@plt>
mov    (%r14),%esi
mov    (%rbx),%edx
mov    $0x3,%edi
call   1030 <init_pair@plt>
mov    0x2dc1(%rip),%r14
mov    (%r14),%esi
mov    (%rbx),%edx
mov    $0x4,%edi
call   1030 <init_pair@plt>
mov    (%r14),%esi
mov    (%rbx),%edx
mov    $0x5,%edi
call   1030 <init_pair@plt>
mov    0x2dbc(%rip),%r14
mov    (%r14),%esi
mov    (%rbx),%edx
mov    $0x6,%edi
call   1030 <init_pair@plt>
mov    (%r14),%esi
mov    (%rbx),%edx
mov    $0x7,%edi
call   1030 <init_pair@plt>
mov    0x2d7f(%rip),%r14
mov    (%r14),%esi
mov    (%rbx),%edx
mov    $0x8,%edi
call   1030 <init_pair@plt>
mov    (%r14),%esi
mov    (%rbx),%edx
mov    $0x9,%edi
call   1030 <init_pair@plt>
mov    0x2d82(%rip),%r14
mov    (%r14),%esi
mov    (%rbx),%edx
mov    $0xa,%edi
call   1030 <init_pair@plt>
mov    (%r14),%esi
mov    (%rbx),%edx
mov    $0xb,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <init_pair@plt>

LLVM IR (-O0):
@stdscr = global i32 0
@TRUE = global i32 0
@COLOR_WHITE = global i32 0
@COLOR_BLACK = global i32 0
@COLOR_YELLOW = global i32 0
@COLOR_RED = global i32 0
@COLOR_MAGENTA = global i32 0
@COLOR_BLUE = global i32 0
@COLOR_GREEN = global i32 0
define void @startNcurses() {
%1 = call i32 (...) @initscr()
%2 = call i32 (...) @clear()
%3 = call i32 (...) @noecho()
%4 = load i32, i32* @stdscr
%5 = load i32, i32* @TRUE
%6 = call i32 @keypad(i32 %4, i32 %5)
%7 = call i32 (...) @start_color()
%8 = load i32, i32* @COLOR_WHITE
%9 = load i32, i32* @COLOR_BLACK
%10 = call i32 @init_pair(i32 1, i32 %8, i32 %9)
%11 = load i32, i32* @COLOR_YELLOW
%12 = load i32, i32* @COLOR_BLACK
%13 = call i32 @init_pair(i32 2, i32 %11, i32 %12)
%14 = load i32, i32* @COLOR_YELLOW
%15 = load i32, i32* @COLOR_BLACK
%16 = call i32 @init_pair(i32 3, i32 %14, i32 %15)
%17 = load i32, i32* @COLOR_RED
%18 = load i32, i32* @COLOR_BLACK
%19 = call i32 @init_pair(i32 4, i32 %17, i32 %18)
%20 = load i32, i32* @COLOR_RED
%21 = load i32, i32* @COLOR_BLACK
%22 = call i32 @init_pair(i32 5, i32 %20, i32 %21)
%23 = load i32, i32* @COLOR_MAGENTA
%24 = load i32, i32* @COLOR_BLACK
%25 = call i32 @init_pair(i32 6, i32 %23, i32 %24)
%26 = load i32, i32* @COLOR_MAGENTA
%27 = load i32, i32* @COLOR_BLACK
%28 = call i32 @init_pair(i32 7, i32 %26, i32 %27)
%29 = load i32, i32* @COLOR_BLUE
%30 = load i32, i32* @COLOR_BLACK
%31 = call i32 @init_pair(i32 8, i32 %29, i32 %30)
%32 = load i32, i32* @COLOR_BLUE
%33 = load i32, i32* @COLOR_BLACK
%34 = call i32 @init_pair(i32 9, i32 %32, i32 %33)
%35 = load i32, i32* @COLOR_GREEN
%36 = load i32, i32* @COLOR_BLACK
%37 = call i32 @init_pair(i32 10, i32 %35, i32 %36)
%38 = load i32, i32* @COLOR_GREEN
%39 = load i32, i32* @COLOR_BLACK
%40 = call i32 @init_pair(i32 11, i32 %38, i32 %39)
ret void
}

LLVM IR (-O2):
@stdscr = global i32 0
@TRUE = global i32 0
@COLOR_WHITE = global i32 0
@COLOR_BLACK = global i32 0
@COLOR_YELLOW = global i32 0
@COLOR_RED = global i32 0
@COLOR_MAGENTA = global i32 0
@COLOR_BLUE = global i32 0
@COLOR_GREEN = global i32 0
define void @startNcurses() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 (...) @clear()
%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 (...) @start_color()
%8 = load i32, i32* @COLOR_WHITE
%9 = load i32, i32* @COLOR_BLACK
%10 = tail call i32 @init_pair(i32 1, i32 %8, i32 %9)
%11 = load i32, i32* @COLOR_YELLOW
%12 = load i32, i32* @COLOR_BLACK
%13 = tail call i32 @init_pair(i32 2, i32 %11, i32 %12)
%14 = load i32, i32* @COLOR_YELLOW
%15 = load i32, i32* @COLOR_BLACK
%16 = tail call i32 @init_pair(i32 3, i32 %14, i32 %15)
%17 = load i32, i32* @COLOR_RED
%18 = load i32, i32* @COLOR_BLACK
%19 = tail call i32 @init_pair(i32 4, i32 %17, i32 %18)
%20 = load i32, i32* @COLOR_RED
%21 = load i32, i32* @COLOR_BLACK
%22 = tail call i32 @init_pair(i32 5, i32 %20, i32 %21)
%23 = load i32, i32* @COLOR_MAGENTA
%24 = load i32, i32* @COLOR_BLACK
%25 = tail call i32 @init_pair(i32 6, i32 %23, i32 %24)
%26 = load i32, i32* @COLOR_MAGENTA
%27 = load i32, i32* @COLOR_BLACK
%28 = tail call i32 @init_pair(i32 7, i32 %26, i32 %27)
%29 = load i32, i32* @COLOR_BLUE
%30 = load i32, i32* @COLOR_BLACK
%31 = tail call i32 @init_pair(i32 8, i32 %29, i32 %30)
%32 = load i32, i32* @COLOR_BLUE
%33 = load i32, i32* @COLOR_BLACK
%34 = tail call i32 @init_pair(i32 9, i32 %32, i32 %33)
%35 = load i32, i32* @COLOR_GREEN
%36 = load i32, i32* @COLOR_BLACK
%37 = tail call i32 @init_pair(i32 10, i32 %35, i32 %36)
%38 = load i32, i32* @COLOR_GREEN
%39 = load i32, i32* @COLOR_BLACK
%40 = tail call i32 @init_pair(i32 11, i32 %38, i32 %39)
ret void
}