#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*/ *);
int 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();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <initscr@plt>
mov    $0x0,%al
call   1070 <start_color@plt>
mov    0x2df4(%rip),%rax
mov    (%rax),%esi
mov    0x2de3(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%edi
call   1030 <init_pair@plt>
mov    0x2dd0(%rip),%rax
mov    (%rax),%esi
mov    0x2dcf(%rip),%rax
mov    (%rax),%edx
mov    $0x2,%edi
call   1030 <init_pair@plt>
mov    0x2db4(%rip),%rax
mov    (%rax),%esi
mov    0x2dbb(%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,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x5,%edx
call   10e0 <wmove@plt>
mov    -0x10(%rbp),%rdi
lea    0xd9a(%rip),%rsi
call   10b0 <wprintw@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x1,%edi
call   10a0 <COLOR_PAIR@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1040 <wbkgd@plt>
mov    -0x10(%rbp),%rdi
call   1050 <wrefresh@plt>
mov    $0x0,%al
call   10c0 <getch@plt>
mov    -0x10(%rbp),%rdi
call   1090 <delwin@plt>
mov    $0x0,%al
call   10d0 <endwin@plt>
xor    %eax,%eax
add    $0x20,%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
call   10d0 <endwin@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@COLOR_YELLOW = global i32 0
@COLOR_BLUE = global i32 0
@COLOR_WHITE = global i32 0
@.str = [14 x i8] c"Hello, World.\00"
define i32 @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 ([14 x i8], [14 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 i32 0
}