#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_CYAN;
int /*<<< orphan*/ TRUE;
int /*<<< orphan*/ cbreak();
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*/ noecho();
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ start_color();
int /*<<< orphan*/ stdscr;
int /*<<< orphan*/ timeout(int /*<<< orphan*/);
int init_ncurses() {
  initscr();
  start_color();
  cbreak();
  keypad(stdscr, TRUE);
  noecho();
  curs_set(0);
  refresh();
  timeout(0);
  init_pair(1, COLOR_BLACK, COLOR_CYAN);
  return 0;
}


x86 assembly (clang, -O0):
<init_ncurses>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <initscr@plt>
mov    $0x0,%al
call   1070 <start_color@plt>
mov    $0x0,%al
call   1030 <cbreak@plt>
mov    0x2e38(%rip),%rax
mov    (%rax),%edi
mov    0x2e27(%rip),%rax
mov    (%rax),%esi
call   1050 <keypad@plt>
mov    $0x0,%al
call   10a0 <noecho@plt>
xor    %edi,%edi
call   10b0 <curs_set@plt>
mov    $0x0,%al
call   1090 <refresh@plt>
xor    %edi,%edi
call   1080 <timeout@plt>
mov    0x2df5(%rip),%rax
mov    (%rax),%esi
mov    0x2de4(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%edi
call   1040 <init_pair@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_ncurses>:
push   %rax
xor    %eax,%eax
call   1060 <initscr@plt>
xor    %eax,%eax
call   1070 <start_color@plt>
xor    %eax,%eax
call   1030 <cbreak@plt>
mov    0x2e3b(%rip),%rax
mov    (%rax),%edi
mov    0x2e2a(%rip),%rax
mov    (%rax),%esi
call   1050 <keypad@plt>
xor    %eax,%eax
call   10a0 <noecho@plt>
xor    %edi,%edi
call   10b0 <curs_set@plt>
xor    %eax,%eax
call   1090 <refresh@plt>
xor    %edi,%edi
call   1080 <timeout@plt>
mov    0x2df8(%rip),%rax
mov    (%rax),%esi
mov    0x2de7(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%edi
call   1040 <init_pair@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdscr = global i32 0
@TRUE = global i32 0
@COLOR_BLACK = global i32 0
@COLOR_CYAN = global i32 0
define i32 @init_ncurses() {
%1 = call i32 (...) @initscr()
%2 = call i32 (...) @start_color()
%3 = call i32 (...) @cbreak()
%4 = load i32, i32* @stdscr
%5 = load i32, i32* @TRUE
%6 = call i32 @keypad(i32 %4, i32 %5)
%7 = call i32 (...) @noecho()
%8 = call i32 @curs_set(i32 0)
%9 = call i32 (...) @refresh()
%10 = call i32 @timeout(i32 0)
%11 = load i32, i32* @COLOR_BLACK
%12 = load i32, i32* @COLOR_CYAN
%13 = call i32 @init_pair(i32 1, i32 %11, i32 %12)
ret i32 0
}

LLVM IR (-O2):
@stdscr = global i32 0
@TRUE = global i32 0
@COLOR_BLACK = global i32 0
@COLOR_CYAN = global i32 0
define i32 @init_ncurses() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 (...) @start_color()
%3 = tail call i32 (...) @cbreak()
%4 = load i32, i32* @stdscr
%5 = load i32, i32* @TRUE
%6 = tail call i32 @keypad(i32 %4, i32 %5)
%7 = tail call i32 (...) @noecho()
%8 = tail call i32 @curs_set(i32 0)
%9 = tail call i32 (...) @refresh()
%10 = tail call i32 @timeout(i32 0)
%11 = load i32, i32* @COLOR_BLACK
%12 = load i32, i32* @COLOR_CYAN
%13 = tail call i32 @init_pair(i32 1, i32 %11, i32 %12)
ret i32 0
}