#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 */
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ init_pair(int, int, int);
void colorsInit() {
  uint16_t fg, bg;
  for (fg = 0; fg < 8; fg++)
    for (bg = 0; bg < 8; bg++)
      init_pair(fg * 8 + bg, fg, bg);
}


x86 assembly (clang, -O0):
<colorsInit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x8,-0x4(%rbp)
jge    116f <colorsInit+0x5f>
movl   $0x0,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jge    115c <colorsInit+0x4c>
mov    -0x4(%rbp),%edi
shl    $0x3,%edi
add    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1030 <init_pair@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1130 <colorsInit+0x20>
jmp    1161 <colorsInit+0x51>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <colorsInit+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<colorsInit>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
mov    $0x7,%ebx
nopw   0x0(%rax,%rax,1)
lea    -0x7(%rbx),%edi
mov    %ebp,%esi
xor    %edx,%edx
call   1030 <init_pair@plt>
lea    -0x6(%rbx),%edi
mov    %ebp,%esi
mov    $0x1,%edx
call   1030 <init_pair@plt>
lea    -0x5(%rbx),%edi
mov    %ebp,%esi
mov    $0x2,%edx
call   1030 <init_pair@plt>
lea    -0x4(%rbx),%edi
mov    %ebp,%esi
mov    $0x3,%edx
call   1030 <init_pair@plt>
lea    -0x3(%rbx),%edi
mov    %ebp,%esi
mov    $0x4,%edx
call   1030 <init_pair@plt>
lea    -0x2(%rbx),%edi
mov    %ebp,%esi
mov    $0x5,%edx
call   1030 <init_pair@plt>
lea    -0x1(%rbx),%edi
mov    %ebp,%esi
mov    $0x6,%edx
call   1030 <init_pair@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    $0x7,%edx
call   1030 <init_pair@plt>
add    $0x1,%ebp
add    $0x8,%ebx
cmp    $0x47,%ebx
jne    1120 <colorsInit+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @colorsInit() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %22, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 8
br i1 %5, label %6, label %25
6: ; preds = %3
store i32 0, i32* %2
br label %7
7: ; preds = %18, %6
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 8
br i1 %9, label %10, label %21
10: ; preds = %7
%11 = load i32, i32* %1
%12 = mul nsw i32 %11, 8
%13 = load i32, i32* %2
%14 = add nsw i32 %12, %13
%15 = load i32, i32* %1
%16 = load i32, i32* %2
%17 = call i32 @init_pair(i32 %14, i32 %15, i32 %16)
br label %18
18: ; preds = %10
%19 = load i32, i32* %2
%20 = add nsw i32 %19, 1
store i32 %20, i32* %2
br label %7
21: ; preds = %7
br label %22
22: ; preds = %21
%23 = load i32, i32* %1
%24 = add nsw i32 %23, 1
store i32 %24, i32* %1
br label %3
25: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @colorsInit() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %19, %1 ]
%3 = shl nsw i32 %2, 3
%4 = tail call i32 @init_pair(i32 %3, i32 %2, i32 0)
%5 = or i32 %3, 1
%6 = tail call i32 @init_pair(i32 %5, i32 %2, i32 1)
%7 = or i32 %3, 2
%8 = tail call i32 @init_pair(i32 %7, i32 %2, i32 2)
%9 = or i32 %3, 3
%10 = tail call i32 @init_pair(i32 %9, i32 %2, i32 3)
%11 = or i32 %3, 4
%12 = tail call i32 @init_pair(i32 %11, i32 %2, i32 4)
%13 = or i32 %3, 5
%14 = tail call i32 @init_pair(i32 %13, i32 %2, i32 5)
%15 = or i32 %3, 6
%16 = tail call i32 @init_pair(i32 %15, i32 %2, i32 6)
%17 = or i32 %3, 7
%18 = tail call i32 @init_pair(i32 %17, i32 %2, i32 7)
%19 = add nuw nsw i32 %2, 1
%20 = icmp eq i32 %19, 8
br i1 %20, label %21, label %1
21: ; preds = %1
ret void
}