#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_BLACK;
int /*<<< orphan*/ COLOR_PAIR(int);
int COLOR_WHITE;
int /*<<< orphan*/ attron(int /*<<< orphan*/);
int /*<<< orphan*/ init_pair(short, short, short);
void init_colors() {
  for (short i = 0; i < 8; i++) {
    for (short j = 0; j < 8; j++) {
      init_pair((short)(i << 4 | j), i, j);
    }
  }
  attron(COLOR_PAIR(COLOR_WHITE << 4 | COLOR_BLACK));
}


x86 assembly (clang, -O0):
<init_colors>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movw   $0x0,-0x2(%rbp)
movswl -0x2(%rbp),%eax
cmp    $0x8,%eax
jge    11a8 <init_colors+0x78>
movw   $0x0,-0x4(%rbp)
movswl -0x4(%rbp),%eax
cmp    $0x8,%eax
jge    1192 <init_colors+0x62>
movswl -0x2(%rbp),%eax
shl    $0x4,%eax
movswl -0x4(%rbp),%ecx
or     %ecx,%eax
mov    %ax,%cx
mov    -0x2(%rbp),%ax
movswl %cx,%edi
movswl %ax,%esi
movswl -0x4(%rbp),%edx
call   1030 <init_pair@plt>
mov    -0x4(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x4(%rbp)
jmp    1151 <init_colors+0x21>
jmp    1197 <init_colors+0x67>
mov    -0x2(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x2(%rbp)
jmp    113e <init_colors+0xe>
mov    0x2e29(%rip),%rax
mov    (%rax),%edi
shl    $0x4,%edi
mov    0x2e2d(%rip),%rax
or     (%rax),%edi
call   1050 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1040 <attron@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_colors>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
movswl %bx,%ebx
movswl %ax,%r14d
mov    %ebx,%edi
mov    %r14d,%esi
xor    %edx,%edx
call   1030 <init_pair@plt>
lea    0x1(%rbx),%eax
movswl %ax,%edi
mov    %r14d,%esi
mov    $0x1,%edx
call   1030 <init_pair@plt>
lea    0x2(%rbx),%eax
movswl %ax,%edi
mov    %r14d,%esi
mov    $0x2,%edx
call   1030 <init_pair@plt>
lea    0x3(%rbx),%eax
movswl %ax,%edi
mov    %r14d,%esi
mov    $0x3,%edx
call   1030 <init_pair@plt>
lea    0x4(%rbx),%eax
movswl %ax,%edi
mov    %r14d,%esi
mov    $0x4,%edx
call   1030 <init_pair@plt>
lea    0x5(%rbx),%eax
movswl %ax,%edi
mov    %r14d,%esi
mov    $0x5,%edx
call   1030 <init_pair@plt>
lea    0x6(%rbx),%eax
movswl %ax,%edi
mov    %r14d,%esi
mov    $0x6,%edx
call   1030 <init_pair@plt>
lea    0x7(%rbx),%eax
movswl %ax,%edi
mov    %r14d,%esi
mov    $0x7,%edx
call   1030 <init_pair@plt>
lea    0x1(%r14),%eax
add    $0x10,%ebx
movzwl %bx,%ecx
cmp    $0x80,%ecx
jne    1140 <init_colors+0x10>
mov    0x2de3(%rip),%rax
mov    (%rax),%edi
shl    $0x4,%edi
mov    0x2de7(%rip),%rax
or     (%rax),%edi
call   1050 <COLOR_PAIR@plt>
mov    %eax,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <attron@plt>

LLVM IR (-O0):
@COLOR_WHITE = global i32 0
@COLOR_BLACK = global i32 0
define void @init_colors() {
%1 = alloca i16
%2 = alloca i16
store i16 0, i16* %1
br label %3
3: ; preds = %27, %0
%4 = load i16, i16* %1
%5 = sext i16 %4 to i32
%6 = icmp slt i32 %5, 8
br i1 %6, label %7, label %30
7: ; preds = %3
store i16 0, i16* %2
br label %8
8: ; preds = %23, %7
%9 = load i16, i16* %2
%10 = sext i16 %9 to i32
%11 = icmp slt i32 %10, 8
br i1 %11, label %12, label %26
12: ; preds = %8
%13 = load i16, i16* %1
%14 = sext i16 %13 to i32
%15 = shl i32 %14, 4
%16 = load i16, i16* %2
%17 = sext i16 %16 to i32
%18 = or i32 %15, %17
%19 = trunc i32 %18 to i16
%20 = load i16, i16* %1
%21 = load i16, i16* %2
%22 = call i32 @init_pair(i16 signext %19, i16 signext %20, i16 signext %21)
br label %23
23: ; preds = %12
%24 = load i16, i16* %2
%25 = add i16 %24, 1
store i16 %25, i16* %2
br label %8
26: ; preds = %8
br label %27
27: ; preds = %26
%28 = load i16, i16* %1
%29 = add i16 %28, 1
store i16 %29, i16* %1
br label %3
30: ; preds = %3
%31 = load i32, i32* @COLOR_WHITE
%32 = shl i32 %31, 4
%33 = load i32, i32* @COLOR_BLACK
%34 = or i32 %32, %33
%35 = call i32 @COLOR_PAIR(i32 %34)
%36 = call i32 @attron(i32 %35)
ret void
}

LLVM IR (-O2):
@COLOR_WHITE = global i32 0
@COLOR_BLACK = global i32 0
define void @init_colors() {
br label %1
1: ; preds = %0, %1
%2 = phi i16 [ 0, %0 ], [ %19, %1 ]
%3 = shl i16 %2, 4
%4 = tail call i32 @init_pair(i16 signext %3, i16 signext %2, i16 signext 0)
%5 = or i16 %3, 1
%6 = tail call i32 @init_pair(i16 signext %5, i16 signext %2, i16 signext 1)
%7 = or i16 %3, 2
%8 = tail call i32 @init_pair(i16 signext %7, i16 signext %2, i16 signext 2)
%9 = or i16 %3, 3
%10 = tail call i32 @init_pair(i16 signext %9, i16 signext %2, i16 signext 3)
%11 = or i16 %3, 4
%12 = tail call i32 @init_pair(i16 signext %11, i16 signext %2, i16 signext 4)
%13 = or i16 %3, 5
%14 = tail call i32 @init_pair(i16 signext %13, i16 signext %2, i16 signext 5)
%15 = or i16 %3, 6
%16 = tail call i32 @init_pair(i16 signext %15, i16 signext %2, i16 signext 6)
%17 = or i16 %3, 7
%18 = tail call i32 @init_pair(i16 signext %17, i16 signext %2, i16 signext 7)
%19 = add nuw nsw i16 %2, 1
%20 = icmp eq i16 %19, 8
br i1 %20, label %21, label %1
21: ; preds = %1
%22 = load i32, i32* @COLOR_WHITE
%23 = shl i32 %22, 4
%24 = load i32, i32* @COLOR_BLACK
%25 = or i32 %23, %24
%26 = tail call i32 @COLOR_PAIR(i32 %25)
%27 = tail call i32 @attron(i32 %26)
ret void
}