#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*/ TRUE;
int /*<<< orphan*/ cbreak();
int /*<<< orphan*/ draw(int, int);
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ getmaxyx(int /*<<< orphan*/, int, int);
int /*<<< orphan*/ init_pair(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ keypad(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ start_color();
int /*<<< orphan*/ stdscr;
int main(void) {
  int x, y;
  initscr();
  cbreak();
  noecho();
  keypad(stdscr, TRUE);
  start_color();
  init_pair(1, COLOR_BLACK, COLOR_BLUE);
  init_pair(2, COLOR_BLACK, COLOR_CYAN);
  init_pair(3, COLOR_BLACK, COLOR_GREEN);
  getmaxyx(stdscr, y, x);
  draw(y, x);
  getchar();
  endwin();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1070 <initscr@plt>
mov    $0x0,%al
call   1040 <cbreak@plt>
mov    $0x0,%al
call   10c0 <noecho@plt>
mov    0x2e1d(%rip),%rax
mov    (%rax),%edi
mov    0x2e0c(%rip),%rax
mov    (%rax),%esi
call   1060 <keypad@plt>
mov    $0x0,%al
call   1080 <start_color@plt>
mov    0x2def(%rip),%rax
mov    (%rax),%esi
mov    0x2dc6(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%edi
call   1050 <init_pair@plt>
mov    0x2dd3(%rip),%rax
mov    (%rax),%esi
mov    0x2dc2(%rip),%rax
mov    (%rax),%edx
mov    $0x2,%edi
call   1050 <init_pair@plt>
mov    0x2db7(%rip),%rax
mov    (%rax),%esi
mov    0x2d9e(%rip),%rax
mov    (%rax),%edx
mov    $0x3,%edi
call   1050 <init_pair@plt>
mov    0x2dab(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1090 <getmaxyx@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <draw@plt>
mov    $0x0,%al
call   10a0 <getchar@plt>
mov    $0x0,%al
call   10b0 <endwin@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1070 <initscr@plt>
xor    %eax,%eax
call   1040 <cbreak@plt>
xor    %eax,%eax
call   10c0 <noecho@plt>
mov    0x2e28(%rip),%r14
mov    (%r14),%edi
mov    0x2e16(%rip),%rax
mov    (%rax),%esi
call   1060 <keypad@plt>
xor    %eax,%eax
call   1080 <start_color@plt>
mov    0x2df9(%rip),%rbx
mov    (%rbx),%esi
mov    0x2dd0(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%edi
call   1050 <init_pair@plt>
mov    (%rbx),%esi
mov    0x2dd3(%rip),%rax
mov    (%rax),%edx
mov    $0x2,%edi
call   1050 <init_pair@plt>
mov    (%rbx),%esi
mov    0x2db6(%rip),%rax
mov    (%rax),%edx
mov    $0x3,%edi
call   1050 <init_pair@plt>
mov    (%r14),%edi
call   1090 <getmaxyx@plt>
call   1030 <draw@plt>
xor    %eax,%eax
call   10a0 <getchar@plt>
xor    %eax,%eax
call   10b0 <endwin@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stdscr = global i32 0
@TRUE = global i32 0
@COLOR_BLACK = global i32 0
@COLOR_BLUE = global i32 0
@COLOR_CYAN = global i32 0
@COLOR_GREEN = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @initscr()
%5 = call i32 (...) @cbreak()
%6 = call i32 (...) @noecho()
%7 = load i32, i32* @stdscr
%8 = load i32, i32* @TRUE
%9 = call i32 @keypad(i32 %7, i32 %8)
%10 = call i32 (...) @start_color()
%11 = load i32, i32* @COLOR_BLACK
%12 = load i32, i32* @COLOR_BLUE
%13 = call i32 @init_pair(i32 1, i32 %11, i32 %12)
%14 = load i32, i32* @COLOR_BLACK
%15 = load i32, i32* @COLOR_CYAN
%16 = call i32 @init_pair(i32 2, i32 %14, i32 %15)
%17 = load i32, i32* @COLOR_BLACK
%18 = load i32, i32* @COLOR_GREEN
%19 = call i32 @init_pair(i32 3, i32 %17, i32 %18)
%20 = load i32, i32* @stdscr
%21 = load i32, i32* %3
%22 = load i32, i32* %2
%23 = call i32 @getmaxyx(i32 %20, i32 %21, i32 %22)
%24 = load i32, i32* %3
%25 = load i32, i32* %2
%26 = call i32 @draw(i32 %24, i32 %25)
%27 = call i32 (...) @getchar()
%28 = call i32 (...) @endwin()
ret i32 0
}

LLVM IR (-O2):
@stdscr = global i32 0
@TRUE = global i32 0
@COLOR_BLACK = global i32 0
@COLOR_BLUE = global i32 0
@COLOR_CYAN = global i32 0
@COLOR_GREEN = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 (...) @cbreak()
%3 = tail call i32 (...) @noecho()
%4 = load i32, i32* @stdscr
%5 = load i32, i32* @TRUE
%6 = tail call i32 @keypad(i32 %4, i32 %5)
%7 = tail call i32 (...) @start_color()
%8 = load i32, i32* @COLOR_BLACK
%9 = load i32, i32* @COLOR_BLUE
%10 = tail call i32 @init_pair(i32 1, i32 %8, i32 %9)
%11 = load i32, i32* @COLOR_BLACK
%12 = load i32, i32* @COLOR_CYAN
%13 = tail call i32 @init_pair(i32 2, i32 %11, i32 %12)
%14 = load i32, i32* @COLOR_BLACK
%15 = load i32, i32* @COLOR_GREEN
%16 = tail call i32 @init_pair(i32 3, i32 %14, i32 %15)
%17 = load i32, i32* @stdscr
%18 = tail call i32 @getmaxyx(i32 %17, i32 undef, i32 undef)
%19 = tail call i32 @draw(i32 undef, i32 undef)
%20 = tail call i32 (...) @getchar()
%21 = tail call i32 (...) @endwin()
ret i32 0
}