#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*/ curs_set(int /*<<< orphan*/);
int /*<<< orphan*/ init_pair(int, int, int /*<<< orphan*/);
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ keypad(int /*<<< orphan*/, int);
int /*<<< orphan*/ nodelay(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ nonl();
int /*<<< orphan*/ raw();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ start_color();
int /*<<< orphan*/ stdscr;
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void init() {
  int c;
  srand(time(NULL));
  keypad(initscr(), 1);
  raw();
  nodelay(stdscr, 0);
  noecho();
  curs_set(0);
  nonl();
  start_color();
  for (c = 0; c <= 8; c++) {
    init_pair(c, c, COLOR_BLACK);
  }
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   10a0 <time@plt>
mov    %eax,%edi
call   1080 <srand@plt>
mov    $0x0,%al
call   1050 <initscr@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1040 <keypad@plt>
mov    $0x0,%al
call   1060 <raw@plt>
mov    0x2dff(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   10b0 <nodelay@plt>
mov    $0x0,%al
call   10c0 <noecho@plt>
xor    %edi,%edi
call   10d0 <curs_set@plt>
mov    $0x0,%al
call   1090 <nonl@plt>
mov    $0x0,%al
call   1070 <start_color@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x8,-0x4(%rbp)
jg     1241 <init+0x91>
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    0x2db4(%rip),%rax
mov    (%rax),%edx
call   1030 <init_pair@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1215 <init+0x65>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rbx
xor    %edi,%edi
call   10a0 <time@plt>
mov    %eax,%edi
call   1080 <srand@plt>
xor    %eax,%eax
call   1050 <initscr@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1040 <keypad@plt>
xor    %eax,%eax
call   1060 <raw@plt>
mov    0x2e08(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   10b0 <nodelay@plt>
xor    %eax,%eax
call   10c0 <noecho@plt>
xor    %edi,%edi
call   10d0 <curs_set@plt>
xor    %eax,%eax
call   1090 <nonl@plt>
xor    %eax,%eax
call   1070 <start_color@plt>
mov    0x2dd4(%rip),%rbx
mov    (%rbx),%edx
xor    %edi,%edi
xor    %esi,%esi
call   1030 <init_pair@plt>
mov    (%rbx),%edx
mov    $0x1,%edi
mov    $0x1,%esi
call   1030 <init_pair@plt>
mov    (%rbx),%edx
mov    $0x2,%edi
mov    $0x2,%esi
call   1030 <init_pair@plt>
mov    (%rbx),%edx
mov    $0x3,%edi
mov    $0x3,%esi
call   1030 <init_pair@plt>
mov    (%rbx),%edx
mov    $0x4,%edi
mov    $0x4,%esi
call   1030 <init_pair@plt>
mov    (%rbx),%edx
mov    $0x5,%edi
mov    $0x5,%esi
call   1030 <init_pair@plt>
mov    (%rbx),%edx
mov    $0x6,%edi
mov    $0x6,%esi
call   1030 <init_pair@plt>
mov    (%rbx),%edx
mov    $0x7,%edi
mov    $0x7,%esi
call   1030 <init_pair@plt>
mov    (%rbx),%edx
mov    $0x8,%edi
mov    $0x8,%esi
pop    %rbx
jmp    1030 <init_pair@plt>

LLVM IR (-O0):
@stdscr = global i32 0
@COLOR_BLACK = global i32 0
define void @init() {
%1 = alloca i32
%2 = call i32 @time(i32* null)
%3 = call i32 @srand(i32 %2)
%4 = call i32 (...) @initscr()
%5 = call i32 @keypad(i32 %4, i32 1)
%6 = call i32 (...) @raw()
%7 = load i32, i32* @stdscr
%8 = call i32 @nodelay(i32 %7, i32 0)
%9 = call i32 (...) @noecho()
%10 = call i32 @curs_set(i32 0)
%11 = call i32 (...) @nonl()
%12 = call i32 (...) @start_color()
store i32 0, i32* %1
br label %13
13: ; preds = %21, %0
%14 = load i32, i32* %1
%15 = icmp sle i32 %14, 8
br i1 %15, label %16, label %24
16: ; preds = %13
%17 = load i32, i32* %1
%18 = load i32, i32* %1
%19 = load i32, i32* @COLOR_BLACK
%20 = call i32 @init_pair(i32 %17, i32 %18, i32 %19)
br label %21
21: ; preds = %16
%22 = load i32, i32* %1
%23 = add nsw i32 %22, 1
store i32 %23, i32* %1
br label %13
24: ; preds = %13
ret void
}

LLVM IR (-O2):
@stdscr = global i32 0
@COLOR_BLACK = global i32 0
define void @init() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 (...) @initscr()
%4 = tail call i32 @keypad(i32 %3, i32 1)
%5 = tail call i32 (...) @raw()
%6 = load i32, i32* @stdscr
%7 = tail call i32 @nodelay(i32 %6, i32 0)
%8 = tail call i32 (...) @noecho()
%9 = tail call i32 @curs_set(i32 0)
%10 = tail call i32 (...) @nonl()
%11 = tail call i32 (...) @start_color()
%12 = load i32, i32* @COLOR_BLACK
%13 = tail call i32 @init_pair(i32 0, i32 0, i32 %12)
%14 = load i32, i32* @COLOR_BLACK
%15 = tail call i32 @init_pair(i32 1, i32 1, i32 %14)
%16 = load i32, i32* @COLOR_BLACK
%17 = tail call i32 @init_pair(i32 2, i32 2, i32 %16)
%18 = load i32, i32* @COLOR_BLACK
%19 = tail call i32 @init_pair(i32 3, i32 3, i32 %18)
%20 = load i32, i32* @COLOR_BLACK
%21 = tail call i32 @init_pair(i32 4, i32 4, i32 %20)
%22 = load i32, i32* @COLOR_BLACK
%23 = tail call i32 @init_pair(i32 5, i32 5, i32 %22)
%24 = load i32, i32* @COLOR_BLACK
%25 = tail call i32 @init_pair(i32 6, i32 6, i32 %24)
%26 = load i32, i32* @COLOR_BLACK
%27 = tail call i32 @init_pair(i32 7, i32 7, i32 %26)
%28 = load i32, i32* @COLOR_BLACK
%29 = tail call i32 @init_pair(i32 8, i32 8, i32 %28)
ret void
}