#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_GREEN;
int /*<<< orphan*/ COLOR_MAGENTA;
int /*<<< orphan*/ COLOR_RED;
int /*<<< orphan*/ COLOR_WHITE;
int /*<<< orphan*/ TRUE;
int /*<<< orphan*/ cbreak();
int /*<<< orphan*/ curs_set(int /*<<< orphan*/);
scalar_t__ has_colors();
int /*<<< orphan*/ init_pair(int /*<<< orphan*/, int /*<<< orphan*/,
                             int /*<<< orphan*/);
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ keypad(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ start_color();
int /*<<< orphan*/ stdscr;
int InitCurses(void) {
  initscr();
  curs_set(0);
  noecho();
  cbreak();
  keypad(stdscr, TRUE);
  start_color();
  if (has_colors()) {
    init_pair(COLOR_BLUE, COLOR_WHITE, COLOR_BLUE);
    init_pair(COLOR_GREEN, COLOR_BLACK, COLOR_GREEN);
    init_pair(COLOR_RED, COLOR_WHITE, COLOR_RED);
    init_pair(COLOR_CYAN, COLOR_BLACK, COLOR_CYAN);
    init_pair(COLOR_MAGENTA, COLOR_WHITE, COLOR_MAGENTA);
  }
  return 0;
}


x86 assembly (clang, -O0):
<InitCurses>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1070 <initscr@plt>
xor    %edi,%edi
call   10a0 <curs_set@plt>
mov    $0x0,%al
call   1090 <noecho@plt>
mov    $0x0,%al
call   1040 <cbreak@plt>
mov    0x2e41(%rip),%rax
mov    (%rax),%edi
mov    0x2e30(%rip),%rax
mov    (%rax),%esi
call   1060 <keypad@plt>
mov    $0x0,%al
call   1080 <start_color@plt>
mov    $0x0,%al
call   1030 <has_colors@plt>
cmp    $0x0,%rax
je     126f <InitCurses+0xef>
mov    0x2dd2(%rip),%rax
mov    (%rax),%edi
mov    0x2dd1(%rip),%rax
mov    (%rax),%esi
mov    0x2dc0(%rip),%rax
mov    (%rax),%edx
call   1050 <init_pair@plt>
mov    0x2dd2(%rip),%rax
mov    (%rax),%edi
mov    0x2dd9(%rip),%rax
mov    (%rax),%esi
mov    0x2dc0(%rip),%rax
mov    (%rax),%edx
call   1050 <init_pair@plt>
mov    0x2d8a(%rip),%rax
mov    (%rax),%edi
mov    0x2d91(%rip),%rax
mov    (%rax),%esi
mov    0x2d78(%rip),%rax
mov    (%rax),%edx
call   1050 <init_pair@plt>
mov    0x2d9a(%rip),%rax
mov    (%rax),%edi
mov    0x2d99(%rip),%rax
mov    (%rax),%esi
mov    0x2d88(%rip),%rax
mov    (%rax),%edx
call   1050 <init_pair@plt>
mov    0x2d62(%rip),%rax
mov    (%rax),%edi
mov    0x2d51(%rip),%rax
mov    (%rax),%esi
mov    0x2d50(%rip),%rax
mov    (%rax),%edx
call   1050 <init_pair@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<InitCurses>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1070 <initscr@plt>
xor    %edi,%edi
call   10a0 <curs_set@plt>
xor    %eax,%eax
call   1090 <noecho@plt>
xor    %eax,%eax
call   1040 <cbreak@plt>
mov    0x2e41(%rip),%rax
mov    (%rax),%edi
mov    0x2e30(%rip),%rax
mov    (%rax),%esi
call   1060 <keypad@plt>
xor    %eax,%eax
call   1080 <start_color@plt>
xor    %eax,%eax
call   1030 <has_colors@plt>
test   %rax,%rax
je     1235 <InitCurses+0xb5>
mov    0x2dd7(%rip),%rax
mov    (%rax),%edi
mov    0x2dd6(%rip),%r14
mov    (%r14),%esi
mov    %edi,%edx
call   1050 <init_pair@plt>
mov    0x2ddd(%rip),%rax
mov    (%rax),%edi
mov    0x2de4(%rip),%rbx
mov    (%rbx),%esi
mov    %edi,%edx
call   1050 <init_pair@plt>
mov    0x2d9c(%rip),%rax
mov    (%rax),%edi
mov    (%r14),%esi
mov    %edi,%edx
call   1050 <init_pair@plt>
mov    0x2db9(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%esi
mov    %edi,%edx
call   1050 <init_pair@plt>
mov    0x2d8f(%rip),%rax
mov    (%rax),%edi
mov    (%r14),%esi
mov    %edi,%edx
call   1050 <init_pair@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stdscr = global i32 0
@TRUE = global i32 0
@COLOR_BLUE = global i32 0
@COLOR_WHITE = global i32 0
@COLOR_GREEN = global i32 0
@COLOR_BLACK = global i32 0
@COLOR_RED = global i32 0
@COLOR_CYAN = global i32 0
@COLOR_MAGENTA = global i32 0
define i32 @InitCurses() {
%1 = call i32 (...) @initscr()
%2 = call i32 @curs_set(i32 0)
%3 = call i32 (...) @noecho()
%4 = call i32 (...) @cbreak()
%5 = load i32, i32* @stdscr
%6 = load i32, i32* @TRUE
%7 = call i32 @keypad(i32 %5, i32 %6)
%8 = call i32 (...) @start_color()
%9 = call i64 (...) @has_colors()
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %32
11: ; preds = %0
%12 = load i32, i32* @COLOR_BLUE
%13 = load i32, i32* @COLOR_WHITE
%14 = load i32, i32* @COLOR_BLUE
%15 = call i32 @init_pair(i32 %12, i32 %13, i32 %14)
%16 = load i32, i32* @COLOR_GREEN
%17 = load i32, i32* @COLOR_BLACK
%18 = load i32, i32* @COLOR_GREEN
%19 = call i32 @init_pair(i32 %16, i32 %17, i32 %18)
%20 = load i32, i32* @COLOR_RED
%21 = load i32, i32* @COLOR_WHITE
%22 = load i32, i32* @COLOR_RED
%23 = call i32 @init_pair(i32 %20, i32 %21, i32 %22)
%24 = load i32, i32* @COLOR_CYAN
%25 = load i32, i32* @COLOR_BLACK
%26 = load i32, i32* @COLOR_CYAN
%27 = call i32 @init_pair(i32 %24, i32 %25, i32 %26)
%28 = load i32, i32* @COLOR_MAGENTA
%29 = load i32, i32* @COLOR_WHITE
%30 = load i32, i32* @COLOR_MAGENTA
%31 = call i32 @init_pair(i32 %28, i32 %29, i32 %30)
br label %32
32: ; preds = %11, %0
ret i32 0
}

LLVM IR (-O2):
@stdscr = global i32 0
@TRUE = global i32 0
@COLOR_BLUE = global i32 0
@COLOR_WHITE = global i32 0
@COLOR_GREEN = global i32 0
@COLOR_BLACK = global i32 0
@COLOR_RED = global i32 0
@COLOR_CYAN = global i32 0
@COLOR_MAGENTA = global i32 0
define i32 @InitCurses() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 @curs_set(i32 0)
%3 = tail call i32 (...) @noecho()
%4 = tail call i32 (...) @cbreak()
%5 = load i32, i32* @stdscr
%6 = load i32, i32* @TRUE
%7 = tail call i32 @keypad(i32 %5, i32 %6)
%8 = tail call i32 (...) @start_color()
%9 = tail call i64 (...) @has_colors()
%10 = icmp eq i64 %9, 0
br i1 %10, label %27, label %11
11: ; preds = %0
%12 = load i32, i32* @COLOR_BLUE
%13 = load i32, i32* @COLOR_WHITE
%14 = tail call i32 @init_pair(i32 %12, i32 %13, i32 %12)
%15 = load i32, i32* @COLOR_GREEN
%16 = load i32, i32* @COLOR_BLACK
%17 = tail call i32 @init_pair(i32 %15, i32 %16, i32 %15)
%18 = load i32, i32* @COLOR_RED
%19 = load i32, i32* @COLOR_WHITE
%20 = tail call i32 @init_pair(i32 %18, i32 %19, i32 %18)
%21 = load i32, i32* @COLOR_CYAN
%22 = load i32, i32* @COLOR_BLACK
%23 = tail call i32 @init_pair(i32 %21, i32 %22, i32 %21)
%24 = load i32, i32* @COLOR_MAGENTA
%25 = load i32, i32* @COLOR_WHITE
%26 = tail call i32 @init_pair(i32 %24, i32 %25, i32 %24)
br label %27
27: ; preds = %11, %0
ret i32 0
}