#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*/ ALL_MOUSE_EVENTS;
int /*<<< orphan*/ COLOR_BLACK;
int /*<<< orphan*/ COLOR_GREEN;
int /*<<< orphan*/ COLOR_RED;
int /*<<< orphan*/ COLOR_WHITE;
int /*<<< orphan*/ TRUE;
int /*<<< orphan*/ curs_set(int /*<<< orphan*/);
int /*<<< orphan*/ init_pair(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ keypad(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ mousemask(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ nodelay(int /*<<< orphan*/, int);
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ nonl();
int /*<<< orphan*/ raw();
int /*<<< orphan*/ start_color();
int /*<<< orphan*/ stdscr;
void init_curses() {
  initscr();
  raw();
  keypad(stdscr, TRUE);
  noecho();
  nodelay(stdscr, 1);
  curs_set(0);
  nonl();
  mousemask(ALL_MOUSE_EVENTS, NULL);
  start_color();
  init_pair(2, COLOR_RED, COLOR_RED);
  init_pair(1, COLOR_GREEN, COLOR_GREEN);
  init_pair(3, COLOR_BLACK, COLOR_GREEN);
  init_pair(4, COLOR_BLACK, COLOR_RED);
  init_pair(5, COLOR_BLACK, COLOR_WHITE);
}


x86 assembly (clang, -O0):
<init_curses>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <initscr@plt>
mov    $0x0,%al
call   1070 <raw@plt>
mov    0x2e27(%rip),%rax
mov    (%rax),%edi
mov    0x2e16(%rip),%rax
mov    (%rax),%esi
call   1050 <keypad@plt>
mov    $0x0,%al
call   10b0 <noecho@plt>
mov    0x2e09(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   10a0 <nodelay@plt>
xor    %edi,%edi
call   10c0 <curs_set@plt>
mov    $0x0,%al
call   1090 <nonl@plt>
mov    0x2df0(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <mousemask@plt>
mov    $0x0,%al
call   1080 <start_color@plt>
mov    0x2d9f(%rip),%rax
mov    (%rax),%esi
mov    0x2d96(%rip),%rax
mov    (%rax),%edx
mov    $0x2,%edi
call   1040 <init_pair@plt>
mov    0x2d9b(%rip),%rax
mov    (%rax),%esi
mov    0x2d92(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%edi
call   1040 <init_pair@plt>
mov    0x2d87(%rip),%rax
mov    (%rax),%esi
mov    0x2d76(%rip),%rax
mov    (%rax),%edx
mov    $0x3,%edi
call   1040 <init_pair@plt>
mov    0x2d6b(%rip),%rax
mov    (%rax),%esi
mov    0x2d42(%rip),%rax
mov    (%rax),%edx
mov    $0x4,%edi
call   1040 <init_pair@plt>
mov    0x2d4f(%rip),%rax
mov    (%rax),%esi
mov    0x2d2e(%rip),%rax
mov    (%rax),%edx
mov    $0x5,%edi
call   1040 <init_pair@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_curses>:
push   %r15
push   %r14
push   %rbx
xor    %eax,%eax
call   1060 <initscr@plt>
xor    %eax,%eax
call   1070 <raw@plt>
mov    0x2e26(%rip),%rbx
mov    (%rbx),%edi
mov    0x2e15(%rip),%rax
mov    (%rax),%esi
call   1050 <keypad@plt>
xor    %eax,%eax
call   10b0 <noecho@plt>
mov    (%rbx),%edi
mov    $0x1,%esi
call   10a0 <nodelay@plt>
xor    %edi,%edi
call   10c0 <curs_set@plt>
xor    %eax,%eax
call   1090 <nonl@plt>
mov    0x2df6(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1030 <mousemask@plt>
xor    %eax,%eax
call   1080 <start_color@plt>
mov    0x2da7(%rip),%r14
mov    (%r14),%edx
mov    $0x2,%edi
mov    %edx,%esi
call   1040 <init_pair@plt>
mov    0x2da9(%rip),%r15
mov    (%r15),%edx
mov    $0x1,%edi
mov    %edx,%esi
call   1040 <init_pair@plt>
mov    0x2d9b(%rip),%rbx
mov    (%rbx),%esi
mov    (%r15),%edx
mov    $0x3,%edi
call   1040 <init_pair@plt>
mov    (%rbx),%esi
mov    (%r14),%edx
mov    $0x4,%edi
call   1040 <init_pair@plt>
mov    (%rbx),%esi
mov    0x2d5c(%rip),%rax
mov    (%rax),%edx
mov    $0x5,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <init_pair@plt>

LLVM IR (-O0):
@stdscr = global i32 0
@TRUE = global i32 0
@ALL_MOUSE_EVENTS = global i32 0
@COLOR_RED = global i32 0
@COLOR_GREEN = global i32 0
@COLOR_BLACK = global i32 0
@COLOR_WHITE = global i32 0
define void @init_curses() {
%1 = call i32 (...) @initscr()
%2 = call i32 (...) @raw()
%3 = load i32, i32* @stdscr
%4 = load i32, i32* @TRUE
%5 = call i32 @keypad(i32 %3, i32 %4)
%6 = call i32 (...) @noecho()
%7 = load i32, i32* @stdscr
%8 = call i32 @nodelay(i32 %7, i32 1)
%9 = call i32 @curs_set(i32 0)
%10 = call i32 (...) @nonl()
%11 = load i32, i32* @ALL_MOUSE_EVENTS
%12 = call i32 @mousemask(i32 %11, i32* null)
%13 = call i32 (...) @start_color()
%14 = load i32, i32* @COLOR_RED
%15 = load i32, i32* @COLOR_RED
%16 = call i32 @init_pair(i32 2, i32 %14, i32 %15)
%17 = load i32, i32* @COLOR_GREEN
%18 = load i32, i32* @COLOR_GREEN
%19 = call i32 @init_pair(i32 1, i32 %17, i32 %18)
%20 = load i32, i32* @COLOR_BLACK
%21 = load i32, i32* @COLOR_GREEN
%22 = call i32 @init_pair(i32 3, i32 %20, i32 %21)
%23 = load i32, i32* @COLOR_BLACK
%24 = load i32, i32* @COLOR_RED
%25 = call i32 @init_pair(i32 4, i32 %23, i32 %24)
%26 = load i32, i32* @COLOR_BLACK
%27 = load i32, i32* @COLOR_WHITE
%28 = call i32 @init_pair(i32 5, i32 %26, i32 %27)
ret void
}

LLVM IR (-O2):
@stdscr = global i32 0
@TRUE = global i32 0
@ALL_MOUSE_EVENTS = global i32 0
@COLOR_RED = global i32 0
@COLOR_GREEN = global i32 0
@COLOR_BLACK = global i32 0
@COLOR_WHITE = global i32 0
define void @init_curses() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 (...) @raw()
%3 = load i32, i32* @stdscr
%4 = load i32, i32* @TRUE
%5 = tail call i32 @keypad(i32 %3, i32 %4)
%6 = tail call i32 (...) @noecho()
%7 = load i32, i32* @stdscr
%8 = tail call i32 @nodelay(i32 %7, i32 1)
%9 = tail call i32 @curs_set(i32 0)
%10 = tail call i32 (...) @nonl()
%11 = load i32, i32* @ALL_MOUSE_EVENTS
%12 = tail call i32 @mousemask(i32 %11, i32* null)
%13 = tail call i32 (...) @start_color()
%14 = load i32, i32* @COLOR_RED
%15 = tail call i32 @init_pair(i32 2, i32 %14, i32 %14)
%16 = load i32, i32* @COLOR_GREEN
%17 = tail call i32 @init_pair(i32 1, i32 %16, 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)
%21 = load i32, i32* @COLOR_BLACK
%22 = load i32, i32* @COLOR_RED
%23 = tail call i32 @init_pair(i32 4, i32 %21, i32 %22)
%24 = load i32, i32* @COLOR_BLACK
%25 = load i32, i32* @COLOR_WHITE
%26 = tail call i32 @init_pair(i32 5, i32 %24, i32 %25)
ret void
}