#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_CYAN;
int /*<<< orphan*/ COLOR_RED;
int /*<<< orphan*/ COLOR_WHITE;
int /*<<< orphan*/ COLOR_YELLOW;
int /*<<< orphan*/ TRUE;
int /*<<< orphan*/ init_color(int /*<<< orphan*/, int, int, int);
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 curses_init() {
  initscr();
  noecho();
  keypad(stdscr, TRUE);
  start_color();
  init_pair(1, COLOR_BLACK, COLOR_WHITE);
  init_pair(2, COLOR_RED, COLOR_WHITE);
  init_pair(3, COLOR_WHITE, COLOR_BLACK);
  init_pair(4, COLOR_CYAN, COLOR_WHITE);
  init_pair(5, COLOR_YELLOW, COLOR_BLACK);
  init_pair(2, COLOR_BLUE, COLOR_WHITE);
  init_color(COLOR_BLUE, 0, 0, 700);
  init_color(COLOR_WHITE, 1000, 1000, 1000);
  init_color(COLOR_BLACK, 0, 0, 0);
  init_color(COLOR_RED, 1000, 0, 0);
}


x86 assembly (clang, -O0):
<curses_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <initscr@plt>
mov    $0x0,%al
call   1080 <noecho@plt>
mov    0x2e6f(%rip),%rax
mov    (%rax),%edi
mov    0x2e5e(%rip),%rax
mov    (%rax),%esi
call   1050 <keypad@plt>
mov    $0x0,%al
call   1070 <start_color@plt>
mov    0x2e41(%rip),%rax
mov    (%rax),%esi
mov    0x2e20(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%edi
call   1040 <init_pair@plt>
mov    0x2df5(%rip),%rax
mov    (%rax),%esi
mov    0x2e04(%rip),%rax
mov    (%rax),%edx
mov    $0x2,%edi
call   1040 <init_pair@plt>
mov    0x2df1(%rip),%rax
mov    (%rax),%esi
mov    0x2e00(%rip),%rax
mov    (%rax),%edx
mov    $0x3,%edi
call   1040 <init_pair@plt>
mov    0x2de5(%rip),%rax
mov    (%rax),%esi
mov    0x2dcc(%rip),%rax
mov    (%rax),%edx
mov    $0x4,%edi
call   1040 <init_pair@plt>
mov    0x2db1(%rip),%rax
mov    (%rax),%esi
mov    0x2dc8(%rip),%rax
mov    (%rax),%edx
mov    $0x5,%edi
call   1040 <init_pair@plt>
mov    0x2d8d(%rip),%rax
mov    (%rax),%esi
mov    0x2d94(%rip),%rax
mov    (%rax),%edx
mov    $0x2,%edi
call   1040 <init_pair@plt>
mov    0x2d71(%rip),%rax
mov    (%rax),%edi
xor    %edx,%edx
mov    $0x2bc,%ecx
mov    %edx,%esi
call   1030 <init_color@plt>
mov    0x2d6a(%rip),%rax
mov    (%rax),%edi
mov    $0x3e8,%ecx
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <init_color@plt>
mov    0x2d6b(%rip),%rax
mov    (%rax),%edi
xor    %ecx,%ecx
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <init_color@plt>
mov    0x2d27(%rip),%rax
mov    (%rax),%edi
mov    $0x3e8,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <init_color@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<curses_init>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
xor    %eax,%eax
call   1060 <initscr@plt>
xor    %eax,%eax
call   1080 <noecho@plt>
mov    0x2e6b(%rip),%rax
mov    (%rax),%edi
mov    0x2e5a(%rip),%rax
mov    (%rax),%esi
call   1050 <keypad@plt>
xor    %eax,%eax
call   1070 <start_color@plt>
mov    0x2e3d(%rip),%r15
mov    (%r15),%esi
mov    0x2e1b(%rip),%r12
mov    (%r12),%edx
mov    $0x1,%edi
call   1040 <init_pair@plt>
mov    0x2dee(%rip),%r14
mov    (%r14),%esi
mov    (%r12),%edx
mov    $0x2,%edi
call   1040 <init_pair@plt>
mov    (%r12),%esi
mov    (%r15),%edx
mov    $0x3,%edi
call   1040 <init_pair@plt>
mov    0x2ded(%rip),%rax
mov    (%rax),%esi
mov    (%r12),%edx
mov    $0x4,%edi
call   1040 <init_pair@plt>
mov    0x2dbe(%rip),%rax
mov    (%rax),%esi
mov    (%r15),%edx
mov    $0x5,%edi
call   1040 <init_pair@plt>
mov    0x2da0(%rip),%rbx
mov    (%rbx),%esi
mov    (%r12),%edx
mov    $0x2,%edi
call   1040 <init_pair@plt>
mov    (%rbx),%edi
xor    %esi,%esi
xor    %edx,%edx
mov    $0x2bc,%ecx
call   1030 <init_color@plt>
mov    (%r12),%edi
mov    $0x3e8,%esi
mov    $0x3e8,%edx
mov    $0x3e8,%ecx
call   1030 <init_color@plt>
mov    (%r15),%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <init_color@plt>
mov    (%r14),%edi
mov    $0x3e8,%esi
xor    %edx,%edx
xor    %ecx,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <init_color@plt>

LLVM IR (-O0):
@stdscr = global i32 0
@TRUE = global i32 0
@COLOR_BLACK = global i32 0
@COLOR_WHITE = global i32 0
@COLOR_RED = global i32 0
@COLOR_CYAN = global i32 0
@COLOR_YELLOW = global i32 0
@COLOR_BLUE = global i32 0
define void @curses_init() {
%1 = call i32 (...) @initscr()
%2 = call i32 (...) @noecho()
%3 = load i32, i32* @stdscr
%4 = load i32, i32* @TRUE
%5 = call i32 @keypad(i32 %3, i32 %4)
%6 = call i32 (...) @start_color()
%7 = load i32, i32* @COLOR_BLACK
%8 = load i32, i32* @COLOR_WHITE
%9 = call i32 @init_pair(i32 1, i32 %7, i32 %8)
%10 = load i32, i32* @COLOR_RED
%11 = load i32, i32* @COLOR_WHITE
%12 = call i32 @init_pair(i32 2, i32 %10, i32 %11)
%13 = load i32, i32* @COLOR_WHITE
%14 = load i32, i32* @COLOR_BLACK
%15 = call i32 @init_pair(i32 3, i32 %13, i32 %14)
%16 = load i32, i32* @COLOR_CYAN
%17 = load i32, i32* @COLOR_WHITE
%18 = call i32 @init_pair(i32 4, i32 %16, i32 %17)
%19 = load i32, i32* @COLOR_YELLOW
%20 = load i32, i32* @COLOR_BLACK
%21 = call i32 @init_pair(i32 5, i32 %19, i32 %20)
%22 = load i32, i32* @COLOR_BLUE
%23 = load i32, i32* @COLOR_WHITE
%24 = call i32 @init_pair(i32 2, i32 %22, i32 %23)
%25 = load i32, i32* @COLOR_BLUE
%26 = call i32 @init_color(i32 %25, i32 0, i32 0, i32 700)
%27 = load i32, i32* @COLOR_WHITE
%28 = call i32 @init_color(i32 %27, i32 1000, i32 1000, i32 1000)
%29 = load i32, i32* @COLOR_BLACK
%30 = call i32 @init_color(i32 %29, i32 0, i32 0, i32 0)
%31 = load i32, i32* @COLOR_RED
%32 = call i32 @init_color(i32 %31, i32 1000, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
@stdscr = global i32 0
@TRUE = global i32 0
@COLOR_BLACK = global i32 0
@COLOR_WHITE = global i32 0
@COLOR_RED = global i32 0
@COLOR_CYAN = global i32 0
@COLOR_YELLOW = global i32 0
@COLOR_BLUE = global i32 0
define void @curses_init() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 (...) @noecho()
%3 = load i32, i32* @stdscr
%4 = load i32, i32* @TRUE
%5 = tail call i32 @keypad(i32 %3, i32 %4)
%6 = tail call i32 (...) @start_color()
%7 = load i32, i32* @COLOR_BLACK
%8 = load i32, i32* @COLOR_WHITE
%9 = tail call i32 @init_pair(i32 1, i32 %7, i32 %8)
%10 = load i32, i32* @COLOR_RED
%11 = load i32, i32* @COLOR_WHITE
%12 = tail call i32 @init_pair(i32 2, i32 %10, i32 %11)
%13 = load i32, i32* @COLOR_WHITE
%14 = load i32, i32* @COLOR_BLACK
%15 = tail call i32 @init_pair(i32 3, i32 %13, i32 %14)
%16 = load i32, i32* @COLOR_CYAN
%17 = load i32, i32* @COLOR_WHITE
%18 = tail call i32 @init_pair(i32 4, i32 %16, i32 %17)
%19 = load i32, i32* @COLOR_YELLOW
%20 = load i32, i32* @COLOR_BLACK
%21 = tail call i32 @init_pair(i32 5, i32 %19, i32 %20)
%22 = load i32, i32* @COLOR_BLUE
%23 = load i32, i32* @COLOR_WHITE
%24 = tail call i32 @init_pair(i32 2, i32 %22, i32 %23)
%25 = load i32, i32* @COLOR_BLUE
%26 = tail call i32 @init_color(i32 %25, i32 0, i32 0, i32 700)
%27 = load i32, i32* @COLOR_WHITE
%28 = tail call i32 @init_color(i32 %27, i32 1000, i32 1000, i32 1000)
%29 = load i32, i32* @COLOR_BLACK
%30 = tail call i32 @init_color(i32 %29, i32 0, i32 0, i32 0)
%31 = load i32, i32* @COLOR_RED
%32 = tail call i32 @init_color(i32 %31, i32 1000, i32 0, i32 0)
ret void
}