#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 */
short COLOR_BLACK;
short COLOR_BLUE;
short COLOR_CYAN;
short COLOR_GREEN;
short COLOR_MAGENTA;
short COLOR_RED;
short COLOR_WHITE;
short COLOR_YELLOW;
int /*<<< orphan*/ init_pair(int, short, int);
void init_ansi_colors(void) {
  int i;
  short ncurses_colors[] = {COLOR_BLACK,  COLOR_RED,  COLOR_GREEN,
                            COLOR_YELLOW, COLOR_BLUE, COLOR_MAGENTA,
                            COLOR_CYAN,   COLOR_WHITE};
  for (i = 0; i < 8; i++)
    init_pair(i + 1, ncurses_colors[i], -1);
}


x86 assembly (clang, -O0):
<init_ansi_colors>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%ax
mov    %ax,-0x20(%rbp)
mov    0x2e7b(%rip),%rax
mov    (%rax),%ax
mov    %ax,-0x1e(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%ax
mov    %ax,-0x1c(%rbp)
mov    0x2e6f(%rip),%rax
mov    (%rax),%ax
mov    %ax,-0x1a(%rbp)
mov    0x2e59(%rip),%rax
mov    (%rax),%ax
mov    %ax,-0x18(%rbp)
mov    0x2e63(%rip),%rax
mov    (%rax),%ax
mov    %ax,-0x16(%rbp)
mov    0x2e6d(%rip),%rax
mov    (%rax),%ax
mov    %ax,-0x14(%rbp)
mov    0x2e3f(%rip),%rax
mov    (%rax),%ax
mov    %ax,-0x12(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x8,-0x4(%rbp)
jge    11c0 <init_ansi_colors+0xb0>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
movslq -0x4(%rbp),%rax
mov    $0xffffffff,%edx
movswl -0x20(%rbp,%rax,2),%esi
call   1030 <init_pair@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    118f <init_ansi_colors+0x7f>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_ansi_colors>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    0x2ec6(%rip),%rax
movswl (%rax),%esi
mov    0x2e7c(%rip),%rax
movswl (%rax),%ebp
mov    0x2ea2(%rip),%rax
movswl (%rax),%r14d
mov    0x2e77(%rip),%rax
movswl (%rax),%ebx
mov    0x2e65(%rip),%rax
movswl (%rax),%r13d
mov    0x2e72(%rip),%rax
movswl (%rax),%r12d
mov    0x2e7f(%rip),%rax
movswl (%rax),%r15d
mov    0x2e54(%rip),%rax
movswl (%rax),%eax
mov    %eax,0x4(%rsp)
mov    $0x1,%edi
mov    $0xffffffff,%edx
call   1030 <init_pair@plt>
mov    $0x2,%edi
mov    %ebp,%esi
mov    $0xffffffff,%edx
call   1030 <init_pair@plt>
mov    $0x3,%edi
mov    %r14d,%esi
mov    $0xffffffff,%edx
call   1030 <init_pair@plt>
mov    $0x4,%edi
mov    %ebx,%esi
mov    $0xffffffff,%edx
call   1030 <init_pair@plt>
mov    $0x5,%edi
mov    %r13d,%esi
mov    $0xffffffff,%edx
call   1030 <init_pair@plt>
mov    $0x6,%edi
mov    %r12d,%esi
mov    $0xffffffff,%edx
call   1030 <init_pair@plt>
mov    $0x7,%edi
mov    %r15d,%esi
mov    $0xffffffff,%edx
call   1030 <init_pair@plt>
mov    $0x8,%edi
mov    0x4(%rsp),%esi
mov    $0xffffffff,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <init_pair@plt>

LLVM IR (-O0):
@COLOR_BLACK = global i16 0
@COLOR_RED = global i16 0
@COLOR_GREEN = global i16 0
@COLOR_YELLOW = global i16 0
@COLOR_BLUE = global i16 0
@COLOR_MAGENTA = global i16 0
@COLOR_CYAN = global i16 0
@COLOR_WHITE = global i16 0
define void @init_ansi_colors() {
%1 = alloca i32
%2 = alloca [8 x i16]
%3 = getelementptr inbounds [8 x i16], [8 x i16]* %2, i64 0, i64 0
%4 = load i16, i16* @COLOR_BLACK
store i16 %4, i16* %3
%5 = getelementptr inbounds i16, i16* %3, i64 1
%6 = load i16, i16* @COLOR_RED
store i16 %6, i16* %5
%7 = getelementptr inbounds i16, i16* %5, i64 1
%8 = load i16, i16* @COLOR_GREEN
store i16 %8, i16* %7
%9 = getelementptr inbounds i16, i16* %7, i64 1
%10 = load i16, i16* @COLOR_YELLOW
store i16 %10, i16* %9
%11 = getelementptr inbounds i16, i16* %9, i64 1
%12 = load i16, i16* @COLOR_BLUE
store i16 %12, i16* %11
%13 = getelementptr inbounds i16, i16* %11, i64 1
%14 = load i16, i16* @COLOR_MAGENTA
store i16 %14, i16* %13
%15 = getelementptr inbounds i16, i16* %13, i64 1
%16 = load i16, i16* @COLOR_CYAN
store i16 %16, i16* %15
%17 = getelementptr inbounds i16, i16* %15, i64 1
%18 = load i16, i16* @COLOR_WHITE
store i16 %18, i16* %17
store i32 0, i32* %1
br label %19
19: ; preds = %30, %0
%20 = load i32, i32* %1
%21 = icmp slt i32 %20, 8
br i1 %21, label %22, label %33
22: ; preds = %19
%23 = load i32, i32* %1
%24 = add nsw i32 %23, 1
%25 = load i32, i32* %1
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [8 x i16], [8 x i16]* %2, i64 0, i64 %26
%28 = load i16, i16* %27
%29 = call i32 @init_pair(i32 %24, i16 signext %28, i32 -1)
br label %30
30: ; preds = %22
%31 = load i32, i32* %1
%32 = add nsw i32 %31, 1
store i32 %32, i32* %1
br label %19
33: ; preds = %19
ret void
}

LLVM IR (-O2):
@COLOR_BLACK = global i16 0
@COLOR_RED = global i16 0
@COLOR_GREEN = global i16 0
@COLOR_YELLOW = global i16 0
@COLOR_BLUE = global i16 0
@COLOR_MAGENTA = global i16 0
@COLOR_CYAN = global i16 0
@COLOR_WHITE = global i16 0
define void @init_ansi_colors() {
%1 = load i16, i16* @COLOR_BLACK
%2 = load i16, i16* @COLOR_RED
%3 = load i16, i16* @COLOR_GREEN
%4 = load i16, i16* @COLOR_YELLOW
%5 = load i16, i16* @COLOR_BLUE
%6 = load i16, i16* @COLOR_MAGENTA
%7 = load i16, i16* @COLOR_CYAN
%8 = load i16, i16* @COLOR_WHITE
%9 = tail call i32 @init_pair(i32 1, i16 signext %1, i32 -1)
%10 = tail call i32 @init_pair(i32 2, i16 signext %2, i32 -1)
%11 = tail call i32 @init_pair(i32 3, i16 signext %3, i32 -1)
%12 = tail call i32 @init_pair(i32 4, i16 signext %4, i32 -1)
%13 = tail call i32 @init_pair(i32 5, i16 signext %5, i32 -1)
%14 = tail call i32 @init_pair(i32 6, i16 signext %6, i32 -1)
%15 = tail call i32 @init_pair(i32 7, i16 signext %7, i32 -1)
%16 = tail call i32 @init_pair(i32 8, i16 signext %8, i32 -1)
ret void
}