#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 COLOR_BLUE;
int COLOR_CYAN;
int COLOR_GREEN;
int COLOR_MAGENTA;
int COLOR_RED;
int COLOR_WHITE;
int COLOR_YELLOW;
int /*<<< orphan*/ TRUE;
scalar_t__ can_change_color();
int /*<<< orphan*/ cbreak();
int /*<<< orphan*/ clear();
int /*<<< orphan*/ curs_set(int /*<<< orphan*/);
int /*<<< orphan*/ init_color(int, int, int, int);
int /*<<< orphan*/ init_pair(int, int, int);
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ keypad(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ start_color();
int /*<<< orphan*/ stdscr;
int /*<<< orphan*/ use_default_colors();
void io_init() {
  initscr();
  clear();
  noecho();
  cbreak();
  curs_set(0);
  keypad(stdscr, TRUE);
  start_color();
  use_default_colors();
  init_pair(31, COLOR_RED, -1);
  init_pair(32, COLOR_GREEN, -1);
  init_pair(33, COLOR_YELLOW, -1);
  init_pair(34, COLOR_BLUE, -1);
  init_pair(35, COLOR_MAGENTA, -1);
  init_pair(36, COLOR_CYAN, -1);
  init_pair(37, COLOR_WHITE, -1);
  if (can_change_color() && 0) {
    init_color(8, 38, 5, 94);
    init_pair(38, 8, -1);
  } else {
    init_pair(38, COLOR_YELLOW, -1);
    init_pair(33, COLOR_MAGENTA, -1);
  }
}


x86 assembly (clang, -O0):
<io_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1080 <initscr@plt>
mov    $0x0,%al
call   10c0 <clear@plt>
mov    $0x0,%al
call   10b0 <noecho@plt>
mov    $0x0,%al
call   1050 <cbreak@plt>
xor    %edi,%edi
call   10d0 <curs_set@plt>
mov    0x2e0a(%rip),%rax
mov    (%rax),%edi
mov    0x2df9(%rip),%rax
mov    (%rax),%esi
call   1070 <keypad@plt>
mov    $0x0,%al
call   1090 <start_color@plt>
mov    $0x0,%al
call   1030 <use_default_colors@plt>
mov    0x2d9d(%rip),%rax
mov    (%rax),%esi
mov    $0x1f,%edi
mov    $0xffffffff,%edx
call   1060 <init_pair@plt>
mov    0x2db5(%rip),%rax
mov    (%rax),%esi
mov    $0x20,%edi
mov    $0xffffffff,%edx
call   1060 <init_pair@plt>
mov    0x2d7d(%rip),%rax
mov    (%rax),%esi
mov    $0x21,%edi
mov    $0xffffffff,%edx
call   1060 <init_pair@plt>
mov    0x2d5d(%rip),%rax
mov    (%rax),%esi
mov    $0x22,%edi
mov    $0xffffffff,%edx
call   1060 <init_pair@plt>
mov    0x2d5d(%rip),%rax
mov    (%rax),%esi
mov    $0x23,%edi
mov    $0xffffffff,%edx
call   1060 <init_pair@plt>
mov    0x2d5d(%rip),%rax
mov    (%rax),%esi
mov    $0x24,%edi
mov    $0xffffffff,%edx
call   1060 <init_pair@plt>
mov    0x2d25(%rip),%rax
mov    (%rax),%esi
mov    $0x25,%edi
mov    $0xffffffff,%edx
call   1060 <init_pair@plt>
mov    $0x0,%al
call   10a0 <can_change_color@plt>
cmp    $0x0,%rax
je     12f6 <io_init+0x146>
xor    %eax,%eax
test   $0x1,%al
jne    12c4 <io_init+0x114>
jmp    12f6 <io_init+0x146>
mov    $0x8,%edi
mov    $0x26,%esi
mov    $0x5,%edx
mov    $0x5e,%ecx
call   1040 <init_color@plt>
mov    $0x26,%edi
mov    $0x8,%esi
mov    $0xffffffff,%edx
call   1060 <init_pair@plt>
jmp    1326 <io_init+0x176>
mov    0x2cb3(%rip),%rax
mov    (%rax),%esi
mov    $0x26,%edi
mov    $0xffffffff,%edx
call   1060 <init_pair@plt>
mov    0x2cab(%rip),%rax
mov    (%rax),%esi
mov    $0x21,%edi
mov    $0xffffffff,%edx
call   1060 <init_pair@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_init>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1070 <initscr@plt>
xor    %eax,%eax
call   10b0 <clear@plt>
xor    %eax,%eax
call   10a0 <noecho@plt>
xor    %eax,%eax
call   1040 <cbreak@plt>
xor    %edi,%edi
call   10c0 <curs_set@plt>
mov    0x2e1a(%rip),%rax
mov    (%rax),%edi
mov    0x2e09(%rip),%rax
mov    (%rax),%esi
call   1060 <keypad@plt>
xor    %eax,%eax
call   1080 <start_color@plt>
xor    %eax,%eax
call   1030 <use_default_colors@plt>
mov    0x2dad(%rip),%rax
mov    (%rax),%esi
mov    $0x1f,%edi
mov    $0xffffffff,%edx
call   1050 <init_pair@plt>
mov    0x2dc5(%rip),%rax
mov    (%rax),%esi
mov    $0x20,%edi
mov    $0xffffffff,%edx
call   1050 <init_pair@plt>
mov    0x2d8d(%rip),%r14
mov    (%r14),%esi
mov    $0x21,%edi
mov    $0xffffffff,%edx
call   1050 <init_pair@plt>
mov    0x2d6c(%rip),%rax
mov    (%rax),%esi
mov    $0x22,%edi
mov    $0xffffffff,%edx
call   1050 <init_pair@plt>
mov    0x2d6c(%rip),%rbx
mov    (%rbx),%esi
mov    $0x23,%edi
mov    $0xffffffff,%edx
call   1050 <init_pair@plt>
mov    0x2d6c(%rip),%rax
mov    (%rax),%esi
mov    $0x24,%edi
mov    $0xffffffff,%edx
call   1050 <init_pair@plt>
mov    0x2d34(%rip),%rax
mov    (%rax),%esi
mov    $0x25,%edi
mov    $0xffffffff,%edx
call   1050 <init_pair@plt>
xor    %eax,%eax
call   1090 <can_change_color@plt>
mov    (%r14),%esi
mov    $0x26,%edi
mov    $0xffffffff,%edx
call   1050 <init_pair@plt>
mov    (%rbx),%esi
mov    $0x21,%edi
mov    $0xffffffff,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <init_pair@plt>

LLVM IR (-O0):
@stdscr = global i32 0
@TRUE = global i32 0
@COLOR_RED = global i32 0
@COLOR_GREEN = global i32 0
@COLOR_YELLOW = global i32 0
@COLOR_BLUE = global i32 0
@COLOR_MAGENTA = global i32 0
@COLOR_CYAN = global i32 0
@COLOR_WHITE = global i32 0
define void @io_init() {
%1 = call i32 (...) @initscr()
%2 = call i32 (...) @clear()
%3 = call i32 (...) @noecho()
%4 = call i32 (...) @cbreak()
%5 = call i32 @curs_set(i32 0)
%6 = load i32, i32* @stdscr
%7 = load i32, i32* @TRUE
%8 = call i32 @keypad(i32 %6, i32 %7)
%9 = call i32 (...) @start_color()
%10 = call i32 (...) @use_default_colors()
%11 = load i32, i32* @COLOR_RED
%12 = call i32 @init_pair(i32 31, i32 %11, i32 -1)
%13 = load i32, i32* @COLOR_GREEN
%14 = call i32 @init_pair(i32 32, i32 %13, i32 -1)
%15 = load i32, i32* @COLOR_YELLOW
%16 = call i32 @init_pair(i32 33, i32 %15, i32 -1)
%17 = load i32, i32* @COLOR_BLUE
%18 = call i32 @init_pair(i32 34, i32 %17, i32 -1)
%19 = load i32, i32* @COLOR_MAGENTA
%20 = call i32 @init_pair(i32 35, i32 %19, i32 -1)
%21 = load i32, i32* @COLOR_CYAN
%22 = call i32 @init_pair(i32 36, i32 %21, i32 -1)
%23 = load i32, i32* @COLOR_WHITE
%24 = call i32 @init_pair(i32 37, i32 %23, i32 -1)
%25 = call i64 (...) @can_change_color()
%26 = icmp ne i64 %25, 0
br i1 %26, label %27, label %31
27: ; preds = %0
br i1 false, label %28, label %31
28: ; preds = %27
%29 = call i32 @init_color(i32 8, i32 38, i32 5, i32 94)
%30 = call i32 @init_pair(i32 38, i32 8, i32 -1)
br label %36
31: ; preds = %27, %0
%32 = load i32, i32* @COLOR_YELLOW
%33 = call i32 @init_pair(i32 38, i32 %32, i32 -1)
%34 = load i32, i32* @COLOR_MAGENTA
%35 = call i32 @init_pair(i32 33, i32 %34, i32 -1)
br label %36
36: ; preds = %31, %28
ret void
}

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