#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_BLUE;
int /*<<< orphan*/ COLOR_PAIR(int);
int /*<<< orphan*/ COLOR_RED;
int /*<<< orphan*/ COLOR_WHITE;
int /*<<< orphan*/ TRUE;
int /*<<< orphan*/ attroff(int /*<<< orphan*/);
int /*<<< orphan*/ attron(int /*<<< orphan*/);
int /*<<< orphan*/ bkgd(int /*<<< orphan*/);
int /*<<< orphan*/ getch();
int /*<<< orphan*/ init_pair(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ keypad(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ move(int, int);
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ printw(char *);
int /*<<< orphan*/ raw();
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ sair();
int /*<<< orphan*/ start_color();
int /*<<< orphan*/ stdscr;
int main(void) {
  initscr();
  raw();
  keypad(stdscr, TRUE);
  noecho();
  start_color();
  init_pair(1, COLOR_WHITE, COLOR_BLUE);
  init_pair(2, COLOR_BLUE, COLOR_WHITE);
  init_pair(3, COLOR_RED, COLOR_WHITE);
  bkgd(COLOR_PAIR(1));
  attron(COLOR_PAIR(3));
  move(2, 1);
  printw("Olá mundo!!!");
  attroff(COLOR_PAIR(3));
  attron(COLOR_PAIR(2));
  move(3, 1);
  printw("Qualquer tecla para sair.");
  attroff(COLOR_PAIR(2));
  refresh();
  getch();
  sair();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <initscr@plt>
mov    $0x0,%al
call   1070 <raw@plt>
mov    0x2ddf(%rip),%rax
mov    (%rax),%edi
mov    0x2dce(%rip),%rax
mov    (%rax),%esi
call   1050 <keypad@plt>
mov    $0x0,%al
call   1100 <noecho@plt>
mov    $0x0,%al
call   1080 <start_color@plt>
mov    0x2da2(%rip),%rax
mov    (%rax),%esi
mov    0x2d91(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%edi
call   1040 <init_pair@plt>
mov    0x2d7e(%rip),%rax
mov    (%rax),%esi
mov    0x2d7d(%rip),%rax
mov    (%rax),%edx
mov    $0x2,%edi
call   1040 <init_pair@plt>
mov    0x2d5a(%rip),%rax
mov    (%rax),%esi
mov    0x2d61(%rip),%rax
mov    (%rax),%edx
mov    $0x3,%edi
call   1040 <init_pair@plt>
mov    $0x1,%edi
call   10b0 <COLOR_PAIR@plt>
mov    %eax,%edi
call   10f0 <bkgd@plt>
mov    $0x3,%edi
call   10b0 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1090 <attron@plt>
mov    $0x2,%edi
mov    $0x1,%esi
call   1110 <move@plt>
lea    0xd4d(%rip),%rdi
call   10a0 <printw@plt>
mov    $0x3,%edi
call   10b0 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1030 <attroff@plt>
mov    $0x2,%edi
call   10b0 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1090 <attron@plt>
mov    $0x3,%edi
mov    $0x1,%esi
call   1110 <move@plt>
lea    0xd1e(%rip),%rdi
call   10a0 <printw@plt>
mov    $0x2,%edi
call   10b0 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1030 <attroff@plt>
mov    $0x0,%al
call   10c0 <refresh@plt>
mov    $0x0,%al
call   10e0 <getch@plt>
mov    $0x0,%al
call   10d0 <sair@plt>
xor    %eax,%eax
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 <raw@plt>
mov    0x2ddf(%rip),%rax
mov    (%rax),%edi
mov    0x2dce(%rip),%rax
mov    (%rax),%esi
call   1050 <keypad@plt>
xor    %eax,%eax
call   1100 <noecho@plt>
xor    %eax,%eax
call   1080 <start_color@plt>
mov    0x2da2(%rip),%r14
mov    (%r14),%esi
mov    0x2d90(%rip),%rbx
mov    (%rbx),%edx
mov    $0x1,%edi
call   1040 <init_pair@plt>
mov    (%rbx),%esi
mov    (%r14),%edx
mov    $0x2,%edi
call   1040 <init_pair@plt>
mov    0x2d66(%rip),%rax
mov    (%rax),%esi
mov    (%r14),%edx
mov    $0x3,%edi
call   1040 <init_pair@plt>
mov    $0x1,%edi
call   10b0 <COLOR_PAIR@plt>
mov    %eax,%edi
call   10f0 <bkgd@plt>
mov    $0x3,%edi
call   10b0 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1090 <attron@plt>
mov    $0x2,%edi
mov    $0x1,%esi
call   1110 <move@plt>
lea    0xd5f(%rip),%rdi
call   10a0 <printw@plt>
mov    $0x3,%edi
call   10b0 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1030 <attroff@plt>
mov    $0x2,%edi
call   10b0 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1090 <attron@plt>
mov    $0x3,%edi
mov    $0x1,%esi
call   1110 <move@plt>
lea    0xd30(%rip),%rdi
call   10a0 <printw@plt>
mov    $0x2,%edi
call   10b0 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1030 <attroff@plt>
xor    %eax,%eax
call   10c0 <refresh@plt>
xor    %eax,%eax
call   10e0 <getch@plt>
xor    %eax,%eax
call   10d0 <sair@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stdscr = global i32 0
@TRUE = global i32 0
@COLOR_WHITE = global i32 0
@COLOR_BLUE = global i32 0
@COLOR_RED = global i32 0
@.str = [14 x i8] c"Ol\C3\A1 mundo!!!\00"
@.str.1 = [26 x i8] c"Qualquer tecla para sair.\00"
define i32 @main() {
%1 = call i32 (...) @initscr()
%2 = call i32 (...) @raw()
%3 = load i32, i32* @stdscr
%4 = load i32, i32* @TRUE
%5 = call i32 @keypad(i32 %3, i32 %4)
%6 = call i32 (...) @noecho()
%7 = call i32 (...) @start_color()
%8 = load i32, i32* @COLOR_WHITE
%9 = load i32, i32* @COLOR_BLUE
%10 = call i32 @init_pair(i32 1, i32 %8, i32 %9)
%11 = load i32, i32* @COLOR_BLUE
%12 = load i32, i32* @COLOR_WHITE
%13 = call i32 @init_pair(i32 2, i32 %11, i32 %12)
%14 = load i32, i32* @COLOR_RED
%15 = load i32, i32* @COLOR_WHITE
%16 = call i32 @init_pair(i32 3, i32 %14, i32 %15)
%17 = call i32 @COLOR_PAIR(i32 1)
%18 = call i32 @bkgd(i32 %17)
%19 = call i32 @COLOR_PAIR(i32 3)
%20 = call i32 @attron(i32 %19)
%21 = call i32 @move(i32 2, i32 1)
%22 = call i32 @printw(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%23 = call i32 @COLOR_PAIR(i32 3)
%24 = call i32 @attroff(i32 %23)
%25 = call i32 @COLOR_PAIR(i32 2)
%26 = call i32 @attron(i32 %25)
%27 = call i32 @move(i32 3, i32 1)
%28 = call i32 @printw(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%29 = call i32 @COLOR_PAIR(i32 2)
%30 = call i32 @attroff(i32 %29)
%31 = call i32 (...) @refresh()
%32 = call i32 (...) @getch()
%33 = call i32 (...) @sair()
ret i32 0
}

LLVM IR (-O2):
@stdscr = global i32 0
@TRUE = global i32 0
@COLOR_WHITE = global i32 0
@COLOR_BLUE = global i32 0
@COLOR_RED = global i32 0
@.str = [14 x i8] c"Ol\C3\A1 mundo!!!\00"
@.str.1 = [26 x i8] c"Qualquer tecla para sair.\00"
define i32 @main() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 (...) @raw()
%3 = load i32, i32* @stdscr
%4 = load i32, i32* @TRUE
%5 = tail call i32 @keypad(i32 %3, i32 %4)
%6 = tail call i32 (...) @noecho()
%7 = tail call i32 (...) @start_color()
%8 = load i32, i32* @COLOR_WHITE
%9 = load i32, i32* @COLOR_BLUE
%10 = tail call i32 @init_pair(i32 1, i32 %8, i32 %9)
%11 = load i32, i32* @COLOR_BLUE
%12 = load i32, i32* @COLOR_WHITE
%13 = tail call i32 @init_pair(i32 2, i32 %11, i32 %12)
%14 = load i32, i32* @COLOR_RED
%15 = load i32, i32* @COLOR_WHITE
%16 = tail call i32 @init_pair(i32 3, i32 %14, i32 %15)
%17 = tail call i32 @COLOR_PAIR(i32 1)
%18 = tail call i32 @bkgd(i32 %17)
%19 = tail call i32 @COLOR_PAIR(i32 3)
%20 = tail call i32 @attron(i32 %19)
%21 = tail call i32 @move(i32 2, i32 1)
%22 = tail call i32 @printw(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%23 = tail call i32 @COLOR_PAIR(i32 3)
%24 = tail call i32 @attroff(i32 %23)
%25 = tail call i32 @COLOR_PAIR(i32 2)
%26 = tail call i32 @attron(i32 %25)
%27 = tail call i32 @move(i32 3, i32 1)
%28 = tail call i32 @printw(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%29 = tail call i32 @COLOR_PAIR(i32 2)
%30 = tail call i32 @attroff(i32 %29)
%31 = tail call i32 (...) @refresh()
%32 = tail call i32 (...) @getch()
%33 = tail call i32 (...) @sair()
ret i32 0
}