#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_CYAN;
int /*<<< orphan*/ COLOR_GREEN;
int /*<<< orphan*/ COLOR_MAGENTA;
int /*<<< orphan*/ COLOR_RED;
int /*<<< orphan*/ COLOR_WHITE;
int /*<<< orphan*/ COLOR_YELLOW;
int /*<<< orphan*/ EXIT_FAILURE;
scalar_t__ FALSE;
int /*<<< orphan*/ TRUE;
int /*<<< orphan*/ cbreak();
int /*<<< orphan*/ curs_set(int /*<<< orphan*/);
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ has_colors();
int /*<<< orphan*/ init_pair(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ keypad(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ start_color();
int /*<<< orphan*/ stdscr;
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int /*<<< orphan*/ timeout(int);
void inicializaciones(void) {
  if (has_colors() == FALSE) {
    endwin();
    puts("Su monitor no soporta colores");
    exit(EXIT_FAILURE);
  }
  curs_set(0);
  cbreak();
  keypad(stdscr, TRUE);
  timeout(1);
  noecho();
  srand(time(NULL));
  start_color();
  init_pair(1, COLOR_YELLOW, COLOR_BLUE);
  init_pair(2, COLOR_BLUE, COLOR_BLUE);
  init_pair(3, COLOR_WHITE, COLOR_BLACK);
  init_pair(4, COLOR_YELLOW, COLOR_BLACK);
  init_pair(5, COLOR_RED, COLOR_BLACK);
  init_pair(6, COLOR_RED, COLOR_BLACK);
  init_pair(7, COLOR_MAGENTA, COLOR_BLACK);
  init_pair(8, COLOR_CYAN, COLOR_BLACK);
  init_pair(9, COLOR_GREEN, COLOR_BLACK);
}


x86 assembly (clang, -O0):
<inicializaciones>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <has_colors@plt>
mov    0x2dae(%rip),%rcx
cmp    (%rcx),%rax
jne    120c <inicializaciones+0x3c>
mov    $0x0,%al
call   10c0 <endwin@plt>
lea    0xe07(%rip),%rdi
call   1030 <puts@plt>
mov    0x2d9b(%rip),%rax
mov    (%rax),%edi
call   10e0 <exit@plt>
xor    %edi,%edi
call   10f0 <curs_set@plt>
mov    $0x0,%al
call   1050 <cbreak@plt>
mov    0x2dc7(%rip),%rax
mov    (%rax),%edi
mov    0x2db6(%rip),%rax
mov    (%rax),%esi
call   1070 <keypad@plt>
mov    $0x1,%edi
call   1090 <timeout@plt>
mov    $0x0,%al
call   10d0 <noecho@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10b0 <time@plt>
mov    %eax,%edi
call   10a0 <srand@plt>
mov    $0x0,%al
call   1080 <start_color@plt>
mov    0x2d48(%rip),%rax
mov    (%rax),%esi
mov    0x2d2f(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%edi
call   1060 <init_pair@plt>
mov    0x2d1c(%rip),%rax
mov    (%rax),%esi
mov    0x2d13(%rip),%rax
mov    (%rax),%edx
mov    $0x2,%edi
call   1060 <init_pair@plt>
mov    0x2d18(%rip),%rax
mov    (%rax),%esi
mov    0x2d37(%rip),%rax
mov    (%rax),%edx
mov    $0x3,%edi
call   1060 <init_pair@plt>
mov    0x2cf4(%rip),%rax
mov    (%rax),%esi
mov    0x2d1b(%rip),%rax
mov    (%rax),%edx
mov    $0x4,%edi
call   1060 <init_pair@plt>
mov    0x2cb8(%rip),%rax
mov    (%rax),%esi
mov    0x2cff(%rip),%rax
mov    (%rax),%edx
mov    $0x5,%edi
call   1060 <init_pair@plt>
mov    0x2c9c(%rip),%rax
mov    (%rax),%esi
mov    0x2ce3(%rip),%rax
mov    (%rax),%edx
mov    $0x6,%edi
call   1060 <init_pair@plt>
mov    0x2cb0(%rip),%rax
mov    (%rax),%esi
mov    0x2cc7(%rip),%rax
mov    (%rax),%edx
mov    $0x7,%edi
call   1060 <init_pair@plt>
mov    0x2cac(%rip),%rax
mov    (%rax),%esi
mov    0x2cab(%rip),%rax
mov    (%rax),%edx
mov    $0x8,%edi
call   1060 <init_pair@plt>
mov    0x2c88(%rip),%rax
mov    (%rax),%esi
mov    0x2c8f(%rip),%rax
mov    (%rax),%edx
mov    $0x9,%edi
call   1060 <init_pair@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<inicializaciones>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <has_colors@plt>
mov    0x2dae(%rip),%rcx
cmp    (%rcx),%rax
je     12f7 <inicializaciones+0x127>
xor    %edi,%edi
call   10f0 <curs_set@plt>
xor    %eax,%eax
call   1050 <cbreak@plt>
mov    0x2de8(%rip),%rax
mov    (%rax),%edi
mov    0x2dd7(%rip),%rax
mov    (%rax),%esi
call   1070 <keypad@plt>
mov    $0x1,%edi
call   1090 <timeout@plt>
xor    %eax,%eax
call   10d0 <noecho@plt>
xor    %edi,%edi
call   10b0 <time@plt>
mov    %eax,%edi
call   10a0 <srand@plt>
xor    %eax,%eax
call   1080 <start_color@plt>
mov    0x2d6b(%rip),%r14
mov    (%r14),%esi
mov    0x2d51(%rip),%rbx
mov    (%rbx),%edx
mov    $0x1,%edi
call   1060 <init_pair@plt>
mov    (%rbx),%edx
mov    $0x2,%edi
mov    %edx,%esi
call   1060 <init_pair@plt>
mov    0x2d48(%rip),%rax
mov    (%rax),%esi
mov    0x2d67(%rip),%rbx
mov    (%rbx),%edx
mov    $0x3,%edi
call   1060 <init_pair@plt>
mov    (%r14),%esi
mov    (%rbx),%edx
mov    $0x4,%edi
call   1060 <init_pair@plt>
mov    0x2cf5(%rip),%r14
mov    (%r14),%esi
mov    (%rbx),%edx
mov    $0x5,%edi
call   1060 <init_pair@plt>
mov    (%r14),%esi
mov    (%rbx),%edx
mov    $0x6,%edi
call   1060 <init_pair@plt>
mov    0x2d00(%rip),%rax
mov    (%rax),%esi
mov    (%rbx),%edx
mov    $0x7,%edi
call   1060 <init_pair@plt>
mov    0x2d03(%rip),%rax
mov    (%rax),%esi
mov    (%rbx),%edx
mov    $0x8,%edi
call   1060 <init_pair@plt>
mov    0x2ce6(%rip),%rax
mov    (%rax),%esi
mov    (%rbx),%edx
mov    $0x9,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1060 <init_pair@plt>
xor    %eax,%eax
call   10c0 <endwin@plt>
lea    0xcfb(%rip),%rdi
call   1030 <puts@plt>
mov    0x2c8f(%rip),%rax
mov    (%rax),%edi
call   10e0 <exit@plt>

LLVM IR (-O0):
@FALSE = global i64 0
@.str = [30 x i8] c"Su monitor no soporta colores\00"
@EXIT_FAILURE = global i32 0
@stdscr = global i32 0
@TRUE = global i32 0
@COLOR_YELLOW = global i32 0
@COLOR_BLUE = global i32 0
@COLOR_WHITE = global i32 0
@COLOR_BLACK = global i32 0
@COLOR_RED = global i32 0
@COLOR_MAGENTA = global i32 0
@COLOR_CYAN = global i32 0
@COLOR_GREEN = global i32 0
define void @inicializaciones() {
%1 = call i64 (...) @has_colors()
%2 = load i64, i64* @FALSE
%3 = icmp eq i64 %1, %2
br i1 %3, label %4, label %9
4: ; preds = %0
%5 = call i32 (...) @endwin()
%6 = call i32 @puts(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = call i32 @exit(i32 %7)
unreachable
9: ; preds = %0
%10 = call i32 @curs_set(i32 0)
%11 = call i32 (...) @cbreak()
%12 = load i32, i32* @stdscr
%13 = load i32, i32* @TRUE
%14 = call i32 @keypad(i32 %12, i32 %13)
%15 = call i32 @timeout(i32 1)
%16 = call i32 (...) @noecho()
%17 = call i32 @time(i32* null)
%18 = call i32 @srand(i32 %17)
%19 = call i32 (...) @start_color()
%20 = load i32, i32* @COLOR_YELLOW
%21 = load i32, i32* @COLOR_BLUE
%22 = call i32 @init_pair(i32 1, i32 %20, i32 %21)
%23 = load i32, i32* @COLOR_BLUE
%24 = load i32, i32* @COLOR_BLUE
%25 = call i32 @init_pair(i32 2, i32 %23, i32 %24)
%26 = load i32, i32* @COLOR_WHITE
%27 = load i32, i32* @COLOR_BLACK
%28 = call i32 @init_pair(i32 3, i32 %26, i32 %27)
%29 = load i32, i32* @COLOR_YELLOW
%30 = load i32, i32* @COLOR_BLACK
%31 = call i32 @init_pair(i32 4, i32 %29, i32 %30)
%32 = load i32, i32* @COLOR_RED
%33 = load i32, i32* @COLOR_BLACK
%34 = call i32 @init_pair(i32 5, i32 %32, i32 %33)
%35 = load i32, i32* @COLOR_RED
%36 = load i32, i32* @COLOR_BLACK
%37 = call i32 @init_pair(i32 6, i32 %35, i32 %36)
%38 = load i32, i32* @COLOR_MAGENTA
%39 = load i32, i32* @COLOR_BLACK
%40 = call i32 @init_pair(i32 7, i32 %38, i32 %39)
%41 = load i32, i32* @COLOR_CYAN
%42 = load i32, i32* @COLOR_BLACK
%43 = call i32 @init_pair(i32 8, i32 %41, i32 %42)
%44 = load i32, i32* @COLOR_GREEN
%45 = load i32, i32* @COLOR_BLACK
%46 = call i32 @init_pair(i32 9, i32 %44, i32 %45)
ret void
}

LLVM IR (-O2):
@FALSE = global i64 0
@.str = [30 x i8] c"Su monitor no soporta colores\00"
@EXIT_FAILURE = global i32 0
@stdscr = global i32 0
@TRUE = global i32 0
@COLOR_YELLOW = global i32 0
@COLOR_BLUE = global i32 0
@COLOR_WHITE = global i32 0
@COLOR_BLACK = global i32 0
@COLOR_RED = global i32 0
@COLOR_MAGENTA = global i32 0
@COLOR_CYAN = global i32 0
@COLOR_GREEN = global i32 0
define void @inicializaciones() {
%1 = tail call i64 (...) @has_colors()
%2 = load i64, i64* @FALSE
%3 = icmp eq i64 %1, %2
br i1 %3, label %4, label %9
4: ; preds = %0
%5 = tail call i32 (...) @endwin()
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %0
%10 = tail call i32 @curs_set(i32 0)
%11 = tail call i32 (...) @cbreak()
%12 = load i32, i32* @stdscr
%13 = load i32, i32* @TRUE
%14 = tail call i32 @keypad(i32 %12, i32 %13)
%15 = tail call i32 @timeout(i32 1)
%16 = tail call i32 (...) @noecho()
%17 = tail call i32 @time(i32* null)
%18 = tail call i32 @srand(i32 %17)
%19 = tail call i32 (...) @start_color()
%20 = load i32, i32* @COLOR_YELLOW
%21 = load i32, i32* @COLOR_BLUE
%22 = tail call i32 @init_pair(i32 1, i32 %20, i32 %21)
%23 = load i32, i32* @COLOR_BLUE
%24 = tail call i32 @init_pair(i32 2, i32 %23, i32 %23)
%25 = load i32, i32* @COLOR_WHITE
%26 = load i32, i32* @COLOR_BLACK
%27 = tail call i32 @init_pair(i32 3, i32 %25, i32 %26)
%28 = load i32, i32* @COLOR_YELLOW
%29 = load i32, i32* @COLOR_BLACK
%30 = tail call i32 @init_pair(i32 4, i32 %28, i32 %29)
%31 = load i32, i32* @COLOR_RED
%32 = load i32, i32* @COLOR_BLACK
%33 = tail call i32 @init_pair(i32 5, i32 %31, i32 %32)
%34 = load i32, i32* @COLOR_RED
%35 = load i32, i32* @COLOR_BLACK
%36 = tail call i32 @init_pair(i32 6, i32 %34, i32 %35)
%37 = load i32, i32* @COLOR_MAGENTA
%38 = load i32, i32* @COLOR_BLACK
%39 = tail call i32 @init_pair(i32 7, i32 %37, i32 %38)
%40 = load i32, i32* @COLOR_CYAN
%41 = load i32, i32* @COLOR_BLACK
%42 = tail call i32 @init_pair(i32 8, i32 %40, i32 %41)
%43 = load i32, i32* @COLOR_GREEN
%44 = load i32, i32* @COLOR_BLACK
%45 = tail call i32 @init_pair(i32 9, i32 %43, i32 %44)
ret void
}