#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*/ TRUE;
int /*<<< orphan*/ idlok(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ init_pair(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ leaveok(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ nodelay(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ scrollok(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ start_color();
int /*<<< orphan*/ stdscr;
int /*<<< orphan*/ wattrset(int /*<<< orphan*/, int /*<<< orphan*/);
int initcolor(void) {
  initscr();
  start_color();
  refresh();
  noecho();
  wattrset(stdscr, 0);
  scrollok(stdscr, TRUE);
  leaveok(stdscr, TRUE);
  idlok(stdscr, TRUE);
  nodelay(stdscr, TRUE);
  init_pair(2, COLOR_GREEN, COLOR_BLACK);
  init_pair(5, COLOR_WHITE, COLOR_BLACK);
  init_pair(1, COLOR_RED, COLOR_BLACK);
  init_pair(6, COLOR_CYAN, COLOR_BLACK);
  init_pair(7, COLOR_WHITE, COLOR_BLACK);
  init_pair(9, COLOR_WHITE, COLOR_BLACK);
  init_pair(8, COLOR_GREEN, COLOR_BLACK);
  init_pair(11, COLOR_WHITE, COLOR_BLACK);
  init_pair(12, COLOR_YELLOW, COLOR_BLACK);
  init_pair(3, COLOR_MAGENTA, COLOR_BLACK);
  init_pair(4, COLOR_MAGENTA, COLOR_BLACK);
  init_pair(10, COLOR_BLUE, COLOR_BLACK);
  init_pair(3, COLOR_BLUE, COLOR_BLACK);
  return 1;
}


x86 assembly (clang, -O0):
<initcolor>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <initscr@plt>
mov    $0x0,%al
call   1060 <start_color@plt>
mov    $0x0,%al
call   1080 <refresh@plt>
mov    $0x0,%al
call   10b0 <noecho@plt>
mov    0x2e21(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1030 <wattrset@plt>
mov    0x2e11(%rip),%rax
mov    (%rax),%edi
mov    0x2e00(%rip),%rax
mov    (%rax),%esi
call   10a0 <scrollok@plt>
mov    0x2dfa(%rip),%rax
mov    (%rax),%edi
mov    0x2de9(%rip),%rax
mov    (%rax),%esi
call   10c0 <leaveok@plt>
mov    0x2de3(%rip),%rax
mov    (%rax),%edi
mov    0x2dd2(%rip),%rax
mov    (%rax),%esi
call   1090 <idlok@plt>
mov    0x2dcc(%rip),%rax
mov    (%rax),%edi
mov    0x2dbb(%rip),%rax
mov    (%rax),%esi
call   1070 <nodelay@plt>
mov    0x2d95(%rip),%rax
mov    (%rax),%esi
mov    0x2d9c(%rip),%rax
mov    (%rax),%edx
mov    $0x2,%edi
call   1040 <init_pair@plt>
mov    0x2d61(%rip),%rax
mov    (%rax),%esi
mov    0x2d80(%rip),%rax
mov    (%rax),%edx
mov    $0x5,%edi
call   1040 <init_pair@plt>
mov    0x2d2d(%rip),%rax
mov    (%rax),%esi
mov    0x2d64(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%edi
call   1040 <init_pair@plt>
mov    0x2d49(%rip),%rax
mov    (%rax),%esi
mov    0x2d48(%rip),%rax
mov    (%rax),%edx
mov    $0x6,%edi
call   1040 <init_pair@plt>
mov    0x2d0d(%rip),%rax
mov    (%rax),%esi
mov    0x2d2c(%rip),%rax
mov    (%rax),%edx
mov    $0x7,%edi
call   1040 <init_pair@plt>
mov    0x2cf1(%rip),%rax
mov    (%rax),%esi
mov    0x2d10(%rip),%rax
mov    (%rax),%edx
mov    $0x9,%edi
call   1040 <init_pair@plt>
mov    0x2ced(%rip),%rax
mov    (%rax),%esi
mov    0x2cf4(%rip),%rax
mov    (%rax),%edx
mov    $0x8,%edi
call   1040 <init_pair@plt>
mov    0x2cb9(%rip),%rax
mov    (%rax),%esi
mov    0x2cd8(%rip),%rax
mov    (%rax),%edx
mov    $0xb,%edi
call   1040 <init_pair@plt>
mov    0x2c95(%rip),%rax
mov    (%rax),%esi
mov    0x2cbc(%rip),%rax
mov    (%rax),%edx
mov    $0xc,%edi
call   1040 <init_pair@plt>
mov    0x2c89(%rip),%rax
mov    (%rax),%esi
mov    0x2ca0(%rip),%rax
mov    (%rax),%edx
mov    $0x3,%edi
call   1040 <init_pair@plt>
mov    0x2c6d(%rip),%rax
mov    (%rax),%esi
mov    0x2c84(%rip),%rax
mov    (%rax),%edx
mov    $0x4,%edi
call   1040 <init_pair@plt>
mov    0x2c39(%rip),%rax
mov    (%rax),%esi
mov    0x2c68(%rip),%rax
mov    (%rax),%edx
mov    $0xa,%edi
call   1040 <init_pair@plt>
mov    0x2c1d(%rip),%rax
mov    (%rax),%esi
mov    0x2c4c(%rip),%rax
mov    (%rax),%edx
mov    $0x3,%edi
call   1040 <init_pair@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<initcolor>:
push   %r15
push   %r14
push   %rbx
xor    %eax,%eax
call   1050 <initscr@plt>
xor    %eax,%eax
call   1060 <start_color@plt>
xor    %eax,%eax
call   1080 <refresh@plt>
xor    %eax,%eax
call   10b0 <noecho@plt>
mov    0x2e20(%rip),%rbx
mov    (%rbx),%edi
xor    %esi,%esi
call   1030 <wattrset@plt>
mov    (%rbx),%edi
mov    0x2e06(%rip),%r14
mov    (%r14),%esi
call   10a0 <scrollok@plt>
mov    (%rbx),%edi
mov    (%r14),%esi
call   10c0 <leaveok@plt>
mov    (%rbx),%edi
mov    (%r14),%esi
call   1090 <idlok@plt>
mov    (%rbx),%edi
mov    (%r14),%esi
call   1070 <nodelay@plt>
mov    0x2dc1(%rip),%r14
mov    (%r14),%esi
mov    0x2dc7(%rip),%rbx
mov    (%rbx),%edx
mov    $0x2,%edi
call   1040 <init_pair@plt>
mov    0x2d8c(%rip),%r15
mov    (%r15),%esi
mov    (%rbx),%edx
mov    $0x5,%edi
call   1040 <init_pair@plt>
mov    0x2d5e(%rip),%rax
mov    (%rax),%esi
mov    (%rbx),%edx
mov    $0x1,%edi
call   1040 <init_pair@plt>
mov    0x2d81(%rip),%rax
mov    (%rax),%esi
mov    (%rbx),%edx
mov    $0x6,%edi
call   1040 <init_pair@plt>
mov    (%r15),%esi
mov    (%rbx),%edx
mov    $0x7,%edi
call   1040 <init_pair@plt>
mov    (%r15),%esi
mov    (%rbx),%edx
mov    $0x9,%edi
call   1040 <init_pair@plt>
mov    (%r14),%esi
mov    (%rbx),%edx
mov    $0x8,%edi
call   1040 <init_pair@plt>
mov    (%r15),%esi
mov    (%rbx),%edx
mov    $0xb,%edi
call   1040 <init_pair@plt>
mov    0x2d08(%rip),%rax
mov    (%rax),%esi
mov    (%rbx),%edx
mov    $0xc,%edi
call   1040 <init_pair@plt>
mov    0x2d03(%rip),%r14
mov    (%r14),%esi
mov    (%rbx),%edx
mov    $0x3,%edi
call   1040 <init_pair@plt>
mov    (%r14),%esi
mov    (%rbx),%edx
mov    $0x4,%edi
call   1040 <init_pair@plt>
mov    0x2cc6(%rip),%r14
mov    (%r14),%esi
mov    (%rbx),%edx
mov    $0xa,%edi
call   1040 <init_pair@plt>
mov    (%r14),%esi
mov    (%rbx),%edx
mov    $0x3,%edi
call   1040 <init_pair@plt>
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stdscr = global i32 0
@TRUE = global i32 0
@COLOR_GREEN = global i32 0
@COLOR_BLACK = global i32 0
@COLOR_WHITE = global i32 0
@COLOR_RED = global i32 0
@COLOR_CYAN = global i32 0
@COLOR_YELLOW = global i32 0
@COLOR_MAGENTA = global i32 0
@COLOR_BLUE = global i32 0
define i32 @initcolor() {
%1 = call i32 (...) @initscr()
%2 = call i32 (...) @start_color()
%3 = call i32 (...) @refresh()
%4 = call i32 (...) @noecho()
%5 = load i32, i32* @stdscr
%6 = call i32 @wattrset(i32 %5, i32 0)
%7 = load i32, i32* @stdscr
%8 = load i32, i32* @TRUE
%9 = call i32 @scrollok(i32 %7, i32 %8)
%10 = load i32, i32* @stdscr
%11 = load i32, i32* @TRUE
%12 = call i32 @leaveok(i32 %10, i32 %11)
%13 = load i32, i32* @stdscr
%14 = load i32, i32* @TRUE
%15 = call i32 @idlok(i32 %13, i32 %14)
%16 = load i32, i32* @stdscr
%17 = load i32, i32* @TRUE
%18 = call i32 @nodelay(i32 %16, i32 %17)
%19 = load i32, i32* @COLOR_GREEN
%20 = load i32, i32* @COLOR_BLACK
%21 = call i32 @init_pair(i32 2, i32 %19, i32 %20)
%22 = load i32, i32* @COLOR_WHITE
%23 = load i32, i32* @COLOR_BLACK
%24 = call i32 @init_pair(i32 5, i32 %22, i32 %23)
%25 = load i32, i32* @COLOR_RED
%26 = load i32, i32* @COLOR_BLACK
%27 = call i32 @init_pair(i32 1, i32 %25, i32 %26)
%28 = load i32, i32* @COLOR_CYAN
%29 = load i32, i32* @COLOR_BLACK
%30 = call i32 @init_pair(i32 6, i32 %28, i32 %29)
%31 = load i32, i32* @COLOR_WHITE
%32 = load i32, i32* @COLOR_BLACK
%33 = call i32 @init_pair(i32 7, i32 %31, i32 %32)
%34 = load i32, i32* @COLOR_WHITE
%35 = load i32, i32* @COLOR_BLACK
%36 = call i32 @init_pair(i32 9, i32 %34, i32 %35)
%37 = load i32, i32* @COLOR_GREEN
%38 = load i32, i32* @COLOR_BLACK
%39 = call i32 @init_pair(i32 8, i32 %37, i32 %38)
%40 = load i32, i32* @COLOR_WHITE
%41 = load i32, i32* @COLOR_BLACK
%42 = call i32 @init_pair(i32 11, i32 %40, i32 %41)
%43 = load i32, i32* @COLOR_YELLOW
%44 = load i32, i32* @COLOR_BLACK
%45 = call i32 @init_pair(i32 12, i32 %43, i32 %44)
%46 = load i32, i32* @COLOR_MAGENTA
%47 = load i32, i32* @COLOR_BLACK
%48 = call i32 @init_pair(i32 3, i32 %46, i32 %47)
%49 = load i32, i32* @COLOR_MAGENTA
%50 = load i32, i32* @COLOR_BLACK
%51 = call i32 @init_pair(i32 4, i32 %49, i32 %50)
%52 = load i32, i32* @COLOR_BLUE
%53 = load i32, i32* @COLOR_BLACK
%54 = call i32 @init_pair(i32 10, i32 %52, i32 %53)
%55 = load i32, i32* @COLOR_BLUE
%56 = load i32, i32* @COLOR_BLACK
%57 = call i32 @init_pair(i32 3, i32 %55, i32 %56)
ret i32 1
}

LLVM IR (-O2):
@stdscr = global i32 0
@TRUE = global i32 0
@COLOR_GREEN = global i32 0
@COLOR_BLACK = global i32 0
@COLOR_WHITE = global i32 0
@COLOR_RED = global i32 0
@COLOR_CYAN = global i32 0
@COLOR_YELLOW = global i32 0
@COLOR_MAGENTA = global i32 0
@COLOR_BLUE = global i32 0
define i32 @initcolor() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 (...) @start_color()
%3 = tail call i32 (...) @refresh()
%4 = tail call i32 (...) @noecho()
%5 = load i32, i32* @stdscr
%6 = tail call i32 @wattrset(i32 %5, i32 0)
%7 = load i32, i32* @stdscr
%8 = load i32, i32* @TRUE
%9 = tail call i32 @scrollok(i32 %7, i32 %8)
%10 = load i32, i32* @stdscr
%11 = load i32, i32* @TRUE
%12 = tail call i32 @leaveok(i32 %10, i32 %11)
%13 = load i32, i32* @stdscr
%14 = load i32, i32* @TRUE
%15 = tail call i32 @idlok(i32 %13, i32 %14)
%16 = load i32, i32* @stdscr
%17 = load i32, i32* @TRUE
%18 = tail call i32 @nodelay(i32 %16, i32 %17)
%19 = load i32, i32* @COLOR_GREEN
%20 = load i32, i32* @COLOR_BLACK
%21 = tail call i32 @init_pair(i32 2, i32 %19, i32 %20)
%22 = load i32, i32* @COLOR_WHITE
%23 = load i32, i32* @COLOR_BLACK
%24 = tail call i32 @init_pair(i32 5, i32 %22, i32 %23)
%25 = load i32, i32* @COLOR_RED
%26 = load i32, i32* @COLOR_BLACK
%27 = tail call i32 @init_pair(i32 1, i32 %25, i32 %26)
%28 = load i32, i32* @COLOR_CYAN
%29 = load i32, i32* @COLOR_BLACK
%30 = tail call i32 @init_pair(i32 6, i32 %28, i32 %29)
%31 = load i32, i32* @COLOR_WHITE
%32 = load i32, i32* @COLOR_BLACK
%33 = tail call i32 @init_pair(i32 7, i32 %31, i32 %32)
%34 = load i32, i32* @COLOR_WHITE
%35 = load i32, i32* @COLOR_BLACK
%36 = tail call i32 @init_pair(i32 9, i32 %34, i32 %35)
%37 = load i32, i32* @COLOR_GREEN
%38 = load i32, i32* @COLOR_BLACK
%39 = tail call i32 @init_pair(i32 8, i32 %37, i32 %38)
%40 = load i32, i32* @COLOR_WHITE
%41 = load i32, i32* @COLOR_BLACK
%42 = tail call i32 @init_pair(i32 11, i32 %40, i32 %41)
%43 = load i32, i32* @COLOR_YELLOW
%44 = load i32, i32* @COLOR_BLACK
%45 = tail call i32 @init_pair(i32 12, i32 %43, i32 %44)
%46 = load i32, i32* @COLOR_MAGENTA
%47 = load i32, i32* @COLOR_BLACK
%48 = tail call i32 @init_pair(i32 3, i32 %46, i32 %47)
%49 = load i32, i32* @COLOR_MAGENTA
%50 = load i32, i32* @COLOR_BLACK
%51 = tail call i32 @init_pair(i32 4, i32 %49, i32 %50)
%52 = load i32, i32* @COLOR_BLUE
%53 = load i32, i32* @COLOR_BLACK
%54 = tail call i32 @init_pair(i32 10, i32 %52, i32 %53)
%55 = load i32, i32* @COLOR_BLUE
%56 = load i32, i32* @COLOR_BLACK
%57 = tail call i32 @init_pair(i32 3, i32 %55, i32 %56)
ret i32 1
}