#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 ESCDELAY;
int /*<<< orphan*/ FALSE;
int /*<<< orphan*/ TRUE;
int /*<<< orphan*/ cbreak();
int /*<<< orphan*/ init_pair(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ intrflush(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ keypad(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ nonl();
int /*<<< orphan*/ start_color();
int /*<<< orphan*/ stdscr;
void initcurses() {
  initscr();
  cbreak();
  noecho();
  nonl();
  intrflush(stdscr, FALSE);
  keypad(stdscr, TRUE);
  ESCDELAY = 25;
  start_color();
  init_pair(1, COLOR_CYAN, COLOR_BLACK);
  init_pair(2, COLOR_BLUE, COLOR_BLACK);
  init_pair(3, COLOR_BLACK, COLOR_GREEN);
}


x86 assembly (clang, -O0):
<initcurses>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <initscr@plt>
mov    $0x0,%al
call   1030 <cbreak@plt>
mov    $0x0,%al
call   10a0 <noecho@plt>
mov    $0x0,%al
call   1090 <nonl@plt>
mov    0x2e41(%rip),%rax
mov    (%rax),%edi
mov    0x2df8(%rip),%rax
mov    (%rax),%esi
call   1070 <intrflush@plt>
mov    0x2e2a(%rip),%rax
mov    (%rax),%edi
mov    0x2e19(%rip),%rax
mov    (%rax),%esi
call   1050 <keypad@plt>
mov    0x2de3(%rip),%rax
movl   $0x19,(%rax)
mov    $0x0,%al
call   1080 <start_color@plt>
mov    0x2de7(%rip),%rax
mov    (%rax),%esi
mov    0x2de6(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%edi
call   1040 <init_pair@plt>
mov    0x2dab(%rip),%rax
mov    (%rax),%esi
mov    0x2dca(%rip),%rax
mov    (%rax),%edx
mov    $0x2,%edi
call   1040 <init_pair@plt>
mov    0x2db7(%rip),%rax
mov    (%rax),%esi
mov    0x2d9e(%rip),%rax
mov    (%rax),%edx
mov    $0x3,%edi
call   1040 <init_pair@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initcurses>:
push   %rbx
xor    %eax,%eax
call   1060 <initscr@plt>
xor    %eax,%eax
call   1030 <cbreak@plt>
xor    %eax,%eax
call   10a0 <noecho@plt>
xor    %eax,%eax
call   1090 <nonl@plt>
mov    0x2e44(%rip),%rbx
mov    (%rbx),%edi
mov    0x2dfb(%rip),%rax
mov    (%rax),%esi
call   1070 <intrflush@plt>
mov    (%rbx),%edi
mov    0x2e23(%rip),%rax
mov    (%rax),%esi
call   1050 <keypad@plt>
mov    0x2ded(%rip),%rax
movl   $0x19,(%rax)
xor    %eax,%eax
call   1080 <start_color@plt>
mov    0x2df1(%rip),%rax
mov    (%rax),%esi
mov    0x2df0(%rip),%rbx
mov    (%rbx),%edx
mov    $0x1,%edi
call   1040 <init_pair@plt>
mov    0x2db5(%rip),%rax
mov    (%rax),%esi
mov    (%rbx),%edx
mov    $0x2,%edi
call   1040 <init_pair@plt>
mov    (%rbx),%esi
mov    0x2db6(%rip),%rax
mov    (%rax),%edx
mov    $0x3,%edi
pop    %rbx
jmp    1040 <init_pair@plt>

LLVM IR (-O0):
@stdscr = global i32 0
@FALSE = global i32 0
@TRUE = global i32 0
@ESCDELAY = global i32 0
@COLOR_CYAN = global i32 0
@COLOR_BLACK = global i32 0
@COLOR_BLUE = global i32 0
@COLOR_GREEN = global i32 0
define void @initcurses() {
%1 = call i32 (...) @initscr()
%2 = call i32 (...) @cbreak()
%3 = call i32 (...) @noecho()
%4 = call i32 (...) @nonl()
%5 = load i32, i32* @stdscr
%6 = load i32, i32* @FALSE
%7 = call i32 @intrflush(i32 %5, i32 %6)
%8 = load i32, i32* @stdscr
%9 = load i32, i32* @TRUE
%10 = call i32 @keypad(i32 %8, i32 %9)
store i32 25, i32* @ESCDELAY
%11 = call i32 (...) @start_color()
%12 = load i32, i32* @COLOR_CYAN
%13 = load i32, i32* @COLOR_BLACK
%14 = call i32 @init_pair(i32 1, i32 %12, i32 %13)
%15 = load i32, i32* @COLOR_BLUE
%16 = load i32, i32* @COLOR_BLACK
%17 = call i32 @init_pair(i32 2, i32 %15, i32 %16)
%18 = load i32, i32* @COLOR_BLACK
%19 = load i32, i32* @COLOR_GREEN
%20 = call i32 @init_pair(i32 3, i32 %18, i32 %19)
ret void
}

LLVM IR (-O2):
@stdscr = global i32 0
@FALSE = global i32 0
@TRUE = global i32 0
@ESCDELAY = global i32 0
@COLOR_CYAN = global i32 0
@COLOR_BLACK = global i32 0
@COLOR_BLUE = global i32 0
@COLOR_GREEN = global i32 0
define void @initcurses() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 (...) @cbreak()
%3 = tail call i32 (...) @noecho()
%4 = tail call i32 (...) @nonl()
%5 = load i32, i32* @stdscr
%6 = load i32, i32* @FALSE
%7 = tail call i32 @intrflush(i32 %5, i32 %6)
%8 = load i32, i32* @stdscr
%9 = load i32, i32* @TRUE
%10 = tail call i32 @keypad(i32 %8, i32 %9)
store i32 25, i32* @ESCDELAY
%11 = tail call i32 (...) @start_color()
%12 = load i32, i32* @COLOR_CYAN
%13 = load i32, i32* @COLOR_BLACK
%14 = tail call i32 @init_pair(i32 1, i32 %12, i32 %13)
%15 = load i32, i32* @COLOR_BLUE
%16 = load i32, i32* @COLOR_BLACK
%17 = tail call i32 @init_pair(i32 2, i32 %15, i32 %16)
%18 = load i32, i32* @COLOR_BLACK
%19 = load i32, i32* @COLOR_GREEN
%20 = tail call i32 @init_pair(i32 3, i32 %18, i32 %19)
ret void
}