#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 */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ COLOR_BLUE;
int /*<<< orphan*/ COLOR_PAIR(int);
int /*<<< orphan*/ COLOR_WHITE;
int /*<<< orphan*/ COLOR_YELLOW;
int /*<<< orphan*/ delwin(int /*<<< orphan*/ *);
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ getch();
int /*<<< orphan*/ init_pair(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ *newwin(int, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ start_color();
int /*<<< orphan*/ wbkgd(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ wmove(int /*<<< orphan*/ *, int /*<<< orphan*/, int);
int /*<<< orphan*/ wprintw(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ wrefresh(int /*<<< orphan*/ *);
void main() {
  WINDOW *vin;
  initscr();
  start_color();
  init_pair(1, COLOR_YELLOW, COLOR_BLUE);
  init_pair(2, COLOR_BLUE, COLOR_YELLOW);
  init_pair(3, COLOR_BLUE, COLOR_WHITE);
  vin = newwin(12, 40, 13, 0);
  wmove(vin, 0, 5);
  wprintw(vin, "Hello World.");
  wbkgd(vin, COLOR_PAIR(1));
  wrefresh(vin);
  getch();
  delwin(vin);
  endwin();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <initscr@plt>
mov    $0x0,%al
call   1070 <start_color@plt>
mov    0x2dfb(%rip),%rax
mov    (%rax),%esi
mov    0x2dea(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%edi
call   1030 <init_pair@plt>
mov    0x2dd7(%rip),%rax
mov    (%rax),%esi
mov    0x2dd6(%rip),%rax
mov    (%rax),%edx
mov    $0x2,%edi
call   1030 <init_pair@plt>
mov    0x2dbb(%rip),%rax
mov    (%rax),%esi
mov    0x2dc2(%rip),%rax
mov    (%rax),%edx
mov    $0x3,%edi
call   1030 <init_pair@plt>
mov    $0xc,%edi
mov    $0x28,%esi
mov    $0xd,%edx
xor    %ecx,%ecx
call   1080 <newwin@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x5,%edx
call   10e0 <wmove@plt>
mov    -0x8(%rbp),%rdi
lea    0xda1(%rip),%rsi
call   10b0 <wprintw@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x1,%edi
call   10a0 <COLOR_PAIR@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <wbkgd@plt>
mov    -0x8(%rbp),%rdi
call   1050 <wrefresh@plt>
mov    $0x0,%al
call   10c0 <getch@plt>
mov    -0x8(%rbp),%rdi
call   1090 <delwin@plt>
mov    $0x0,%al
call   10d0 <endwin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1060 <initscr@plt>
xor    %eax,%eax
call   1070 <start_color@plt>
mov    0x2dff(%rip),%r14
mov    (%r14),%esi
mov    0x2ded(%rip),%rbx
mov    (%rbx),%edx
mov    $0x1,%edi
call   1030 <init_pair@plt>
mov    (%rbx),%esi
mov    (%r14),%edx
mov    $0x2,%edi
call   1030 <init_pair@plt>
mov    (%rbx),%esi
mov    0x2dd9(%rip),%rax
mov    (%rax),%edx
mov    $0x3,%edi
call   1030 <init_pair@plt>
mov    $0xc,%edi
mov    $0x28,%esi
mov    $0xd,%edx
xor    %ecx,%ecx
call   1080 <newwin@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x5,%edx
call   10e0 <wmove@plt>
lea    0xdbe(%rip),%rsi
mov    %rbx,%rdi
call   10b0 <wprintw@plt>
mov    $0x1,%edi
call   10a0 <COLOR_PAIR@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <wbkgd@plt>
mov    %rbx,%rdi
call   1050 <wrefresh@plt>
xor    %eax,%eax
call   10c0 <getch@plt>
mov    %rbx,%rdi
call   1090 <delwin@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    10d0 <endwin@plt>

LLVM IR (-O0):
@COLOR_YELLOW = global i32 0
@COLOR_BLUE = global i32 0
@COLOR_WHITE = global i32 0
@.str = [13 x i8] c"Hello World.\00"
define void @main() {
%1 = alloca i32*
%2 = call i32 (...) @initscr()
%3 = call i32 (...) @start_color()
%4 = load i32, i32* @COLOR_YELLOW
%5 = load i32, i32* @COLOR_BLUE
%6 = call i32 @init_pair(i32 1, i32 %4, i32 %5)
%7 = load i32, i32* @COLOR_BLUE
%8 = load i32, i32* @COLOR_YELLOW
%9 = call i32 @init_pair(i32 2, i32 %7, i32 %8)
%10 = load i32, i32* @COLOR_BLUE
%11 = load i32, i32* @COLOR_WHITE
%12 = call i32 @init_pair(i32 3, i32 %10, i32 %11)
%13 = call i32* @newwin(i32 12, i32 40, i32 13, i32 0)
store i32* %13, i32** %1
%14 = load i32*, i32** %1
%15 = call i32 @wmove(i32* %14, i32 0, i32 5)
%16 = load i32*, i32** %1
%17 = call i32 @wprintw(i32* %16, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%18 = load i32*, i32** %1
%19 = call i32 @COLOR_PAIR(i32 1)
%20 = call i32 @wbkgd(i32* %18, i32 %19)
%21 = load i32*, i32** %1
%22 = call i32 @wrefresh(i32* %21)
%23 = call i32 (...) @getch()
%24 = load i32*, i32** %1
%25 = call i32 @delwin(i32* %24)
%26 = call i32 (...) @endwin()
ret void
}

LLVM IR (-O2):
@COLOR_YELLOW = global i32 0
@COLOR_BLUE = global i32 0
@COLOR_WHITE = global i32 0
@.str = [13 x i8] c"Hello World.\00"
define void @main() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 (...) @start_color()
%3 = load i32, i32* @COLOR_YELLOW
%4 = load i32, i32* @COLOR_BLUE
%5 = tail call i32 @init_pair(i32 1, i32 %3, i32 %4)
%6 = load i32, i32* @COLOR_BLUE
%7 = load i32, i32* @COLOR_YELLOW
%8 = tail call i32 @init_pair(i32 2, i32 %6, i32 %7)
%9 = load i32, i32* @COLOR_BLUE
%10 = load i32, i32* @COLOR_WHITE
%11 = tail call i32 @init_pair(i32 3, i32 %9, i32 %10)
%12 = tail call i32* @newwin(i32 12, i32 40, i32 13, i32 0)
%13 = tail call i32 @wmove(i32* %12, i32 0, i32 5)
%14 = tail call i32 @wprintw(i32* %12, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%15 = tail call i32 @COLOR_PAIR(i32 1)
%16 = tail call i32 @wbkgd(i32* %12, i32 %15)
%17 = tail call i32 @wrefresh(i32* %12)
%18 = tail call i32 (...) @getch()
%19 = tail call i32 @delwin(i32* %12)
%20 = tail call i32 (...) @endwin()
ret void
}