#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_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();
  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);
  cbreak();
  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   1030 <has_colors@plt>
cmp    $0x0,%rax
je     11b4 <wincomps+0x44>
mov    $0x0,%al
call   1080 <can_change_color@plt>
cmp    $0x0,%rax
je     11b4 <wincomps+0x44>
mov    $0x0,%al
call   1070 <start_color@plt>
jmp    11bb <wincomps+0x4b>
movl   $0x1,-0x4(%rbp)
mov    0x2e26(%rip),%rax
mov    (%rax),%esi
mov    0x2e15(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%edi
call   1050 <init_pair@plt>
mov    0x2df2(%rip),%rax
mov    (%rax),%esi
mov    0x2e01(%rip),%rax
mov    (%rax),%edx
mov    $0x2,%edi
call   1050 <init_pair@plt>
mov    0x2dc6(%rip),%rax
mov    (%rax),%esi
mov    0x2de5(%rip),%rax
mov    (%rax),%edx
mov    $0x3,%edi
call   1050 <init_pair@plt>
mov    0x2db2(%rip),%rax
mov    (%rax),%esi
mov    0x2dc9(%rip),%rax
mov    (%rax),%edx
mov    $0x4,%edi
call   1050 <init_pair@plt>
mov    $0x0,%al
call   1040 <cbreak@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   1030 <has_colors@plt>
mov    $0x1,%ebp
test   %rax,%rax
je     11a0 <wincomps+0x30>
xor    %eax,%eax
call   1080 <can_change_color@plt>
test   %rax,%rax
je     11a0 <wincomps+0x30>
xor    %eax,%eax
call   1070 <start_color@plt>
xor    %ebp,%ebp
mov    0x2e41(%rip),%rbx
mov    (%rbx),%esi
mov    0x2e30(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%edi
call   1050 <init_pair@plt>
mov    0x2e0d(%rip),%rax
mov    (%rax),%esi
mov    (%rbx),%edx
mov    $0x2,%edi
call   1050 <init_pair@plt>
mov    0x2de8(%rip),%rax
mov    (%rax),%esi
mov    (%rbx),%edx
mov    $0x3,%edi
call   1050 <init_pair@plt>
mov    0x2ddb(%rip),%rax
mov    (%rax),%esi
mov    (%rbx),%edx
mov    $0x4,%edi
call   1050 <init_pair@plt>
xor    %eax,%eax
call   1040 <cbreak@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
define i32 @wincomps() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @initscr()
%3 = call i64 (...) @has_colors()
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %0
%6 = call i64 (...) @can_change_color()
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = call i32 (...) @start_color()
br label %11
10: ; preds = %5, %0
store i32 1, i32* %1
br label %11
11: ; preds = %10, %8
%12 = load i32, i32* @COLOR_BLACK
%13 = load i32, i32* @COLOR_GREEN
%14 = call i32 @init_pair(i32 1, i32 %12, i32 %13)
%15 = load i32, i32* @COLOR_WHITE
%16 = load i32, i32* @COLOR_BLACK
%17 = call i32 @init_pair(i32 2, i32 %15, i32 %16)
%18 = load i32, i32* @COLOR_BLUE
%19 = load i32, i32* @COLOR_BLACK
%20 = call i32 @init_pair(i32 3, i32 %18, i32 %19)
%21 = load i32, i32* @COLOR_YELLOW
%22 = load i32, i32* @COLOR_BLACK
%23 = call i32 @init_pair(i32 4, i32 %21, i32 %22)
%24 = call i32 (...) @cbreak()
%25 = call i32 (...) @refresh()
%26 = load i32, i32* %1
ret i32 %26
}

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