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


x86 assembly (clang, -O0):
<init_graphics>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <initscr@plt>
mov    $0x0,%al
call   1030 <cbreak@plt>
mov    $0x0,%al
call   1080 <noecho@plt>
mov    0x2e58(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1050 <keypad@plt>
xor    %edi,%edi
call   1090 <curs_set@plt>
mov    $0x0,%al
call   1070 <start_color@plt>
mov    0x2df2(%rip),%rax
mov    (%rax),%esi
mov    0x2e29(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%edi
call   1040 <init_pair@plt>
mov    0x2e06(%rip),%rax
mov    (%rax),%esi
mov    0x2e0d(%rip),%rax
mov    (%rax),%edx
mov    $0x2,%edi
call   1040 <init_pair@plt>
mov    0x2dca(%rip),%rax
mov    (%rax),%esi
mov    0x2df1(%rip),%rax
mov    (%rax),%edx
mov    $0x3,%edi
call   1040 <init_pair@plt>
mov    0x2dd6(%rip),%rax
mov    (%rax),%esi
mov    0x2dd5(%rip),%rax
mov    (%rax),%edx
mov    $0x4,%edi
call   1040 <init_pair@plt>
mov    0x2da2(%rip),%rax
mov    (%rax),%esi
mov    0x2db9(%rip),%rax
mov    (%rax),%edx
mov    $0x5,%edi
call   1040 <init_pair@plt>
mov    0x2da6(%rip),%rax
mov    (%rax),%esi
mov    0x2d9d(%rip),%rax
mov    (%rax),%edx
mov    $0x6,%edi
call   1040 <init_pair@plt>
mov    0x2d52(%rip),%rax
mov    (%rax),%esi
mov    0x2d81(%rip),%rax
mov    (%rax),%edx
mov    $0x7,%edi
call   1040 <init_pair@plt>
mov    0x2d46(%rip),%rax
mov    (%rax),%esi
mov    0x2d65(%rip),%rax
mov    (%rax),%edx
mov    $0x8,%edi
call   1040 <init_pair@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_graphics>:
push   %rbx
xor    %eax,%eax
call   1060 <initscr@plt>
xor    %eax,%eax
call   1030 <cbreak@plt>
xor    %eax,%eax
call   1080 <noecho@plt>
mov    0x2e5b(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1050 <keypad@plt>
xor    %edi,%edi
call   1090 <curs_set@plt>
xor    %eax,%eax
call   1070 <start_color@plt>
mov    0x2df5(%rip),%rax
mov    (%rax),%esi
mov    0x2e2c(%rip),%rbx
mov    (%rbx),%edx
mov    $0x1,%edi
call   1040 <init_pair@plt>
mov    0x2e09(%rip),%rax
mov    (%rax),%esi
mov    (%rbx),%edx
mov    $0x2,%edi
call   1040 <init_pair@plt>
mov    0x2dd4(%rip),%rax
mov    (%rax),%esi
mov    (%rbx),%edx
mov    $0x3,%edi
call   1040 <init_pair@plt>
mov    0x2de7(%rip),%rax
mov    (%rax),%esi
mov    (%rbx),%edx
mov    $0x4,%edi
call   1040 <init_pair@plt>
mov    0x2dba(%rip),%rax
mov    (%rax),%esi
mov    (%rbx),%edx
mov    $0x5,%edi
call   1040 <init_pair@plt>
mov    (%rbx),%edx
mov    $0x6,%edi
mov    %edx,%esi
call   1040 <init_pair@plt>
mov    0x2d7f(%rip),%rax
mov    (%rax),%esi
mov    (%rbx),%edx
mov    $0x7,%edi
call   1040 <init_pair@plt>
mov    0x2d7a(%rip),%rax
mov    (%rax),%esi
mov    (%rbx),%edx
mov    $0x8,%edi
pop    %rbx
jmp    1040 <init_pair@plt>

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

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