#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_BLUE;
int /*<<< orphan*/ COLOR_GREEN;
int /*<<< orphan*/ COLOR_RED;
int /*<<< orphan*/ COLOR_WHITE;
int /*<<< orphan*/ COLOR_YELLOW;
scalar_t__ can_change_color();
int /*<<< orphan*/ cbreak();
scalar_t__ has_colors();
int /*<<< orphan*/ init_pair(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ start_color();
int wincomps() {
  int flag = 0;
  initscr();
  cbreak();
  if (has_colors() && can_change_color()) {
    start_color();
  } else {
    flag = 1;
  }
  init_pair(1, COLOR_BLACK, COLOR_GREEN);
  init_pair(2, COLOR_WHITE, COLOR_BLACK);
  init_pair(3, COLOR_BLUE, COLOR_BLACK);
  init_pair(4, COLOR_YELLOW, COLOR_BLACK);
  init_pair(5, COLOR_RED, COLOR_BLACK);
  refresh();
  return flag;
}


x86 assembly (clang, -O0):
<wincomps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <initscr@plt>
mov    $0x0,%al
call   1040 <cbreak@plt>
mov    $0x0,%al
call   1030 <has_colors@plt>
cmp    $0x0,%rax
je     11bb <wincomps+0x4b>
mov    $0x0,%al
call   1080 <can_change_color@plt>
cmp    $0x0,%rax
je     11bb <wincomps+0x4b>
mov    $0x0,%al
call   1070 <start_color@plt>
jmp    11c2 <wincomps+0x52>
movl   $0x1,-0x4(%rbp)
mov    0x2e1f(%rip),%rax
mov    (%rax),%esi
mov    0x2e0e(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%edi
call   1050 <init_pair@plt>
mov    0x2deb(%rip),%rax
mov    (%rax),%esi
mov    0x2dfa(%rip),%rax
mov    (%rax),%edx
mov    $0x2,%edi
call   1050 <init_pair@plt>
mov    0x2dbf(%rip),%rax
mov    (%rax),%esi
mov    0x2dde(%rip),%rax
mov    (%rax),%edx
mov    $0x3,%edi
call   1050 <init_pair@plt>
mov    0x2dab(%rip),%rax
mov    (%rax),%esi
mov    0x2dc2(%rip),%rax
mov    (%rax),%edx
mov    $0x4,%edi
call   1050 <init_pair@plt>
mov    0x2d7f(%rip),%rax
mov    (%rax),%esi
mov    0x2da6(%rip),%rax
mov    (%rax),%edx
mov    $0x5,%edi
call   1050 <init_pair@plt>
mov    $0x0,%al
call   1090 <refresh@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wincomps>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1060 <initscr@plt>
xor    %eax,%eax
call   1040 <cbreak@plt>
xor    %eax,%eax
call   1030 <has_colors@plt>
mov    $0x1,%ebp
test   %rax,%rax
je     11a7 <wincomps+0x37>
xor    %eax,%eax
call   1080 <can_change_color@plt>
test   %rax,%rax
je     11a7 <wincomps+0x37>
xor    %eax,%eax
call   1070 <start_color@plt>
xor    %ebp,%ebp
mov    0x2e3a(%rip),%rbx
mov    (%rbx),%esi
mov    0x2e29(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%edi
call   1050 <init_pair@plt>
mov    0x2e06(%rip),%rax
mov    (%rax),%esi
mov    (%rbx),%edx
mov    $0x2,%edi
call   1050 <init_pair@plt>
mov    0x2de1(%rip),%rax
mov    (%rax),%esi
mov    (%rbx),%edx
mov    $0x3,%edi
call   1050 <init_pair@plt>
mov    0x2dd4(%rip),%rax
mov    (%rax),%esi
mov    (%rbx),%edx
mov    $0x4,%edi
call   1050 <init_pair@plt>
mov    0x2daf(%rip),%rax
mov    (%rax),%esi
mov    (%rbx),%edx
mov    $0x5,%edi
call   1050 <init_pair@plt>
xor    %eax,%eax
call   1090 <refresh@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@COLOR_BLACK = global i32 0
@COLOR_GREEN = global i32 0
@COLOR_WHITE = global i32 0
@COLOR_BLUE = global i32 0
@COLOR_YELLOW = global i32 0
@COLOR_RED = global i32 0
define i32 @wincomps() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @initscr()
%3 = call i32 (...) @cbreak()
%4 = call i64 (...) @has_colors()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %0
%7 = call i64 (...) @can_change_color()
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = call i32 (...) @start_color()
br label %12
11: ; preds = %6, %0
store i32 1, i32* %1
br label %12
12: ; preds = %11, %9
%13 = load i32, i32* @COLOR_BLACK
%14 = load i32, i32* @COLOR_GREEN
%15 = call i32 @init_pair(i32 1, i32 %13, i32 %14)
%16 = load i32, i32* @COLOR_WHITE
%17 = load i32, i32* @COLOR_BLACK
%18 = call i32 @init_pair(i32 2, i32 %16, i32 %17)
%19 = load i32, i32* @COLOR_BLUE
%20 = load i32, i32* @COLOR_BLACK
%21 = call i32 @init_pair(i32 3, i32 %19, i32 %20)
%22 = load i32, i32* @COLOR_YELLOW
%23 = load i32, i32* @COLOR_BLACK
%24 = call i32 @init_pair(i32 4, i32 %22, i32 %23)
%25 = load i32, i32* @COLOR_RED
%26 = load i32, i32* @COLOR_BLACK
%27 = call i32 @init_pair(i32 5, i32 %25, i32 %26)
%28 = call i32 (...) @refresh()
%29 = load i32, i32* %1
ret i32 %29
}

LLVM IR (-O2):
@COLOR_BLACK = global i32 0
@COLOR_GREEN = global i32 0
@COLOR_WHITE = global i32 0
@COLOR_BLUE = global i32 0
@COLOR_YELLOW = global i32 0
@COLOR_RED = global i32 0
define i32 @wincomps() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 (...) @cbreak()
%3 = tail call i64 (...) @has_colors()
%4 = icmp eq i64 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %0
%6 = tail call i64 (...) @can_change_color()
%7 = icmp eq i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 (...) @start_color()
br label %10
10: ; preds = %0, %5, %8
%11 = phi i32 [ 0, %8 ], [ 1, %5 ], [ 1, %0 ]
%12 = load i32, i32* @COLOR_BLACK
%13 = load i32, i32* @COLOR_GREEN
%14 = tail call i32 @init_pair(i32 1, i32 %12, i32 %13)
%15 = load i32, i32* @COLOR_WHITE
%16 = load i32, i32* @COLOR_BLACK
%17 = tail call i32 @init_pair(i32 2, i32 %15, i32 %16)
%18 = load i32, i32* @COLOR_BLUE
%19 = load i32, i32* @COLOR_BLACK
%20 = tail call i32 @init_pair(i32 3, i32 %18, i32 %19)
%21 = load i32, i32* @COLOR_YELLOW
%22 = load i32, i32* @COLOR_BLACK
%23 = tail call i32 @init_pair(i32 4, i32 %21, i32 %22)
%24 = load i32, i32* @COLOR_RED
%25 = load i32, i32* @COLOR_BLACK
%26 = tail call i32 @init_pair(i32 5, i32 %24, i32 %25)
%27 = tail call i32 (...) @refresh()
ret i32 %11
}