#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*/ COLOR_YELLOW;
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);
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ set_escdelay(int /*<<< orphan*/);
int /*<<< orphan*/ start_color();
int /*<<< orphan*/ stdscr;
void setup_screen(void) {
  initscr();
  start_color();
  noecho();
  cbreak();
  curs_set(0);
  set_escdelay(0);
  keypad(stdscr, true);
  init_pair(1, COLOR_WHITE, COLOR_BLACK);
  init_pair(2, COLOR_YELLOW, COLOR_BLACK);
  init_pair(3, COLOR_GREEN, COLOR_BLACK);
  init_pair(4, COLOR_BLUE, COLOR_BLACK);
  init_pair(5, COLOR_MAGENTA, COLOR_BLACK);
  init_pair(6, COLOR_CYAN, COLOR_BLACK);
  init_pair(7, COLOR_RED, COLOR_BLACK);
}


x86 assembly (clang, -O0):
<setup_screen>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1070 <initscr@plt>
mov    $0x0,%al
call   1080 <start_color@plt>
mov    $0x0,%al
call   1090 <noecho@plt>
mov    $0x0,%al
call   1040 <cbreak@plt>
xor    %edi,%edi
call   10a0 <curs_set@plt>
xor    %edi,%edi
call   1030 <set_escdelay@plt>
mov    0x2e33(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1060 <keypad@plt>
mov    0x2df0(%rip),%rax
mov    (%rax),%esi
mov    0x2e0f(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%edi
call   1050 <init_pair@plt>
mov    0x2dcc(%rip),%rax
mov    (%rax),%esi
mov    0x2df3(%rip),%rax
mov    (%rax),%edx
mov    $0x2,%edi
call   1050 <init_pair@plt>
mov    0x2dd0(%rip),%rax
mov    (%rax),%esi
mov    0x2dd7(%rip),%rax
mov    (%rax),%edx
mov    $0x3,%edi
call   1050 <init_pair@plt>
mov    0x2d8c(%rip),%rax
mov    (%rax),%esi
mov    0x2dbb(%rip),%rax
mov    (%rax),%edx
mov    $0x4,%edi
call   1050 <init_pair@plt>
mov    0x2d88(%rip),%rax
mov    (%rax),%esi
mov    0x2d9f(%rip),%rax
mov    (%rax),%edx
mov    $0x5,%edi
call   1050 <init_pair@plt>
mov    0x2d84(%rip),%rax
mov    (%rax),%esi
mov    0x2d83(%rip),%rax
mov    (%rax),%edx
mov    $0x6,%edi
call   1050 <init_pair@plt>
mov    0x2d30(%rip),%rax
mov    (%rax),%esi
mov    0x2d67(%rip),%rax
mov    (%rax),%edx
mov    $0x7,%edi
call   1050 <init_pair@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup_screen>:
push   %rbx
xor    %eax,%eax
call   1070 <initscr@plt>
xor    %eax,%eax
call   1080 <start_color@plt>
xor    %eax,%eax
call   1090 <noecho@plt>
xor    %eax,%eax
call   1040 <cbreak@plt>
xor    %edi,%edi
call   10a0 <curs_set@plt>
xor    %edi,%edi
call   1030 <set_escdelay@plt>
mov    0x2e36(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1060 <keypad@plt>
mov    0x2df3(%rip),%rax
mov    (%rax),%esi
mov    0x2e12(%rip),%rbx
mov    (%rbx),%edx
mov    $0x1,%edi
call   1050 <init_pair@plt>
mov    0x2dcf(%rip),%rax
mov    (%rax),%esi
mov    (%rbx),%edx
mov    $0x2,%edi
call   1050 <init_pair@plt>
mov    0x2dda(%rip),%rax
mov    (%rax),%esi
mov    (%rbx),%edx
mov    $0x3,%edi
call   1050 <init_pair@plt>
mov    0x2d9d(%rip),%rax
mov    (%rax),%esi
mov    (%rbx),%edx
mov    $0x4,%edi
call   1050 <init_pair@plt>
mov    0x2da0(%rip),%rax
mov    (%rax),%esi
mov    (%rbx),%edx
mov    $0x5,%edi
call   1050 <init_pair@plt>
mov    0x2da3(%rip),%rax
mov    (%rax),%esi
mov    (%rbx),%edx
mov    $0x6,%edi
call   1050 <init_pair@plt>
mov    0x2d56(%rip),%rax
mov    (%rax),%esi
mov    (%rbx),%edx
mov    $0x7,%edi
pop    %rbx
jmp    1050 <init_pair@plt>

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

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