#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*/ has_colors();
int /*<<< orphan*/ init_pair(int, int, int);
int /*<<< orphan*/ start_color();
int initColor() {
  if (!has_colors()) {
    return 1;
  } else {
    start_color();
    init_pair(0, 1, 0);
    init_pair(1, 2, 0);
    init_pair(2, 3, 0);
    init_pair(3, 4, 0);
    init_pair(4, 5, 0);
    init_pair(5, 6, 0);
    init_pair(6, 7, 0);
    init_pair(7, 1, 0);
    init_pair(8, 2, 0);
    init_pair(9, 3, 0);
    init_pair(10, 4, 0);
    init_pair(11, 5, 0);
    init_pair(12, 1, 2);
  }
  return 0;
}


x86 assembly (clang, -O0):
<initColor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <has_colors@plt>
cmp    $0x0,%eax
jne    1154 <initColor+0x24>
movl   $0x1,-0x4(%rbp)
jmp    123f <initColor+0x10f>
mov    $0x0,%al
call   1050 <start_color@plt>
xor    %edx,%edx
mov    $0x1,%esi
mov    %edx,%edi
call   1040 <init_pair@plt>
mov    $0x1,%edi
mov    $0x2,%esi
xor    %edx,%edx
call   1040 <init_pair@plt>
mov    $0x2,%edi
mov    $0x3,%esi
xor    %edx,%edx
call   1040 <init_pair@plt>
mov    $0x3,%edi
mov    $0x4,%esi
xor    %edx,%edx
call   1040 <init_pair@plt>
mov    $0x4,%edi
mov    $0x5,%esi
xor    %edx,%edx
call   1040 <init_pair@plt>
mov    $0x5,%edi
mov    $0x6,%esi
xor    %edx,%edx
call   1040 <init_pair@plt>
mov    $0x6,%edi
mov    $0x7,%esi
xor    %edx,%edx
call   1040 <init_pair@plt>
mov    $0x7,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1040 <init_pair@plt>
mov    $0x8,%edi
mov    $0x2,%esi
xor    %edx,%edx
call   1040 <init_pair@plt>
mov    $0x9,%edi
mov    $0x3,%esi
xor    %edx,%edx
call   1040 <init_pair@plt>
mov    $0xa,%edi
mov    $0x4,%esi
xor    %edx,%edx
call   1040 <init_pair@plt>
mov    $0xb,%edi
mov    $0x5,%esi
xor    %edx,%edx
call   1040 <init_pair@plt>
mov    $0xc,%edi
mov    $0x1,%esi
mov    $0x2,%edx
call   1040 <init_pair@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initColor>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <has_colors@plt>
test   %eax,%eax
je     1228 <initColor+0xf8>
xor    %eax,%eax
call   1050 <start_color@plt>
xor    %edi,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1040 <init_pair@plt>
mov    $0x1,%edi
mov    $0x2,%esi
xor    %edx,%edx
call   1040 <init_pair@plt>
mov    $0x2,%edi
mov    $0x3,%esi
xor    %edx,%edx
call   1040 <init_pair@plt>
mov    $0x3,%edi
mov    $0x4,%esi
xor    %edx,%edx
call   1040 <init_pair@plt>
mov    $0x4,%edi
mov    $0x5,%esi
xor    %edx,%edx
call   1040 <init_pair@plt>
mov    $0x5,%edi
mov    $0x6,%esi
xor    %edx,%edx
call   1040 <init_pair@plt>
mov    $0x6,%edi
mov    $0x7,%esi
xor    %edx,%edx
call   1040 <init_pair@plt>
mov    $0x7,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1040 <init_pair@plt>
mov    $0x8,%edi
mov    $0x2,%esi
xor    %edx,%edx
call   1040 <init_pair@plt>
mov    $0x9,%edi
mov    $0x3,%esi
xor    %edx,%edx
call   1040 <init_pair@plt>
mov    $0xa,%edi
mov    $0x4,%esi
xor    %edx,%edx
call   1040 <init_pair@plt>
mov    $0xb,%edi
mov    $0x5,%esi
xor    %edx,%edx
call   1040 <init_pair@plt>
mov    $0xc,%edi
mov    $0x1,%esi
mov    $0x2,%edx
call   1040 <init_pair@plt>
jmp    122d <initColor+0xfd>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @initColor() {
%1 = alloca i32
%2 = call i32 (...) @has_colors()
%3 = icmp ne i32 %2, 0
br i1 %3, label %5, label %4
4: ; preds = %0
store i32 1, i32* %1
br label %21
5: ; preds = %0
%6 = call i32 (...) @start_color()
%7 = call i32 @init_pair(i32 0, i32 1, i32 0)
%8 = call i32 @init_pair(i32 1, i32 2, i32 0)
%9 = call i32 @init_pair(i32 2, i32 3, i32 0)
%10 = call i32 @init_pair(i32 3, i32 4, i32 0)
%11 = call i32 @init_pair(i32 4, i32 5, i32 0)
%12 = call i32 @init_pair(i32 5, i32 6, i32 0)
%13 = call i32 @init_pair(i32 6, i32 7, i32 0)
%14 = call i32 @init_pair(i32 7, i32 1, i32 0)
%15 = call i32 @init_pair(i32 8, i32 2, i32 0)
%16 = call i32 @init_pair(i32 9, i32 3, i32 0)
%17 = call i32 @init_pair(i32 10, i32 4, i32 0)
%18 = call i32 @init_pair(i32 11, i32 5, i32 0)
%19 = call i32 @init_pair(i32 12, i32 1, i32 2)
br label %20
20: ; preds = %5
store i32 0, i32* %1
br label %21
21: ; preds = %20, %4
%22 = load i32, i32* %1
ret i32 %22
}

LLVM IR (-O2):
define i32 @initColor() {
%1 = tail call i32 (...) @has_colors()
%2 = icmp eq i32 %1, 0
br i1 %2, label %18, label %3
3: ; preds = %0
%4 = tail call i32 (...) @start_color()
%5 = tail call i32 @init_pair(i32 0, i32 1, i32 0)
%6 = tail call i32 @init_pair(i32 1, i32 2, i32 0)
%7 = tail call i32 @init_pair(i32 2, i32 3, i32 0)
%8 = tail call i32 @init_pair(i32 3, i32 4, i32 0)
%9 = tail call i32 @init_pair(i32 4, i32 5, i32 0)
%10 = tail call i32 @init_pair(i32 5, i32 6, i32 0)
%11 = tail call i32 @init_pair(i32 6, i32 7, i32 0)
%12 = tail call i32 @init_pair(i32 7, i32 1, i32 0)
%13 = tail call i32 @init_pair(i32 8, i32 2, i32 0)
%14 = tail call i32 @init_pair(i32 9, i32 3, i32 0)
%15 = tail call i32 @init_pair(i32 10, i32 4, i32 0)
%16 = tail call i32 @init_pair(i32 11, i32 5, i32 0)
%17 = tail call i32 @init_pair(i32 12, i32 1, i32 2)
br label %18
18: ; preds = %0, %3
%19 = phi i32 [ 0, %3 ], [ 1, %0 ]
ret i32 %19
}