#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*/ COLOR_CYAN;
int /*<<< orphan*/ COLOR_GREEN;
int /*<<< orphan*/ COLOR_WHITE;
int /*<<< orphan*/ COLOR_YELLOW;
scalar_t__ has_colors();
int /*<<< orphan*/ init_pair(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ start_color();
void init_colors() {
  if (has_colors()) {
    start_color();
    init_pair(1, COLOR_YELLOW, COLOR_BLACK);
    init_pair(2, COLOR_GREEN, COLOR_BLACK);
    init_pair(3, COLOR_CYAN, COLOR_BLACK);
    init_pair(4, COLOR_WHITE, COLOR_BLACK);
  }
}


x86 assembly (clang, -O0):
<init_colors>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <has_colors@plt>
cmp    $0x0,%rax
je     11bc <init_colors+0x8c>
mov    $0x0,%al
call   1050 <start_color@plt>
mov    0x2e6d(%rip),%rax
mov    (%rax),%esi
mov    0x2e8c(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%edi
call   1040 <init_pair@plt>
mov    0x2e69(%rip),%rax
mov    (%rax),%esi
mov    0x2e70(%rip),%rax
mov    (%rax),%edx
mov    $0x2,%edi
call   1040 <init_pair@plt>
mov    0x2e55(%rip),%rax
mov    (%rax),%esi
mov    0x2e54(%rip),%rax
mov    (%rax),%edx
mov    $0x3,%edi
call   1040 <init_pair@plt>
mov    0x2e21(%rip),%rax
mov    (%rax),%esi
mov    0x2e38(%rip),%rax
mov    (%rax),%edx
mov    $0x4,%edi
call   1040 <init_pair@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_colors>:
push   %rbx
xor    %eax,%eax
call   1030 <has_colors@plt>
test   %rax,%rax
je     11a0 <init_colors+0x70>
xor    %eax,%eax
call   1050 <start_color@plt>
mov    0x2e75(%rip),%rax
mov    (%rax),%esi
mov    0x2e94(%rip),%rbx
mov    (%rbx),%edx
mov    $0x1,%edi
call   1040 <init_pair@plt>
mov    0x2e71(%rip),%rax
mov    (%rax),%esi
mov    (%rbx),%edx
mov    $0x2,%edi
call   1040 <init_pair@plt>
mov    0x2e64(%rip),%rax
mov    (%rax),%esi
mov    (%rbx),%edx
mov    $0x3,%edi
call   1040 <init_pair@plt>
mov    0x2e37(%rip),%rax
mov    (%rax),%esi
mov    (%rbx),%edx
mov    $0x4,%edi
pop    %rbx
jmp    1040 <init_pair@plt>
pop    %rbx
ret

LLVM IR (-O0):
@COLOR_YELLOW = global i32 0
@COLOR_BLACK = global i32 0
@COLOR_GREEN = global i32 0
@COLOR_CYAN = global i32 0
@COLOR_WHITE = global i32 0
define void @init_colors() {
%1 = call i64 (...) @has_colors()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %17
3: ; preds = %0
%4 = call i32 (...) @start_color()
%5 = load i32, i32* @COLOR_YELLOW
%6 = load i32, i32* @COLOR_BLACK
%7 = call i32 @init_pair(i32 1, i32 %5, i32 %6)
%8 = load i32, i32* @COLOR_GREEN
%9 = load i32, i32* @COLOR_BLACK
%10 = call i32 @init_pair(i32 2, i32 %8, i32 %9)
%11 = load i32, i32* @COLOR_CYAN
%12 = load i32, i32* @COLOR_BLACK
%13 = call i32 @init_pair(i32 3, i32 %11, i32 %12)
%14 = load i32, i32* @COLOR_WHITE
%15 = load i32, i32* @COLOR_BLACK
%16 = call i32 @init_pair(i32 4, i32 %14, i32 %15)
br label %17
17: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
@COLOR_YELLOW = global i32 0
@COLOR_BLACK = global i32 0
@COLOR_GREEN = global i32 0
@COLOR_CYAN = global i32 0
@COLOR_WHITE = global i32 0
define void @init_colors() {
%1 = tail call i64 (...) @has_colors()
%2 = icmp eq i64 %1, 0
br i1 %2, label %17, label %3
3: ; preds = %0
%4 = tail call i32 (...) @start_color()
%5 = load i32, i32* @COLOR_YELLOW
%6 = load i32, i32* @COLOR_BLACK
%7 = tail call i32 @init_pair(i32 1, i32 %5, i32 %6)
%8 = load i32, i32* @COLOR_GREEN
%9 = load i32, i32* @COLOR_BLACK
%10 = tail call i32 @init_pair(i32 2, i32 %8, i32 %9)
%11 = load i32, i32* @COLOR_CYAN
%12 = load i32, i32* @COLOR_BLACK
%13 = tail call i32 @init_pair(i32 3, i32 %11, i32 %12)
%14 = load i32, i32* @COLOR_WHITE
%15 = load i32, i32* @COLOR_BLACK
%16 = tail call i32 @init_pair(i32 4, i32 %14, i32 %15)
br label %17
17: ; preds = %3, %0
ret void
}