#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*/ A_BOLD;
int /*<<< orphan*/ COLOR_BLACK;
int /*<<< orphan*/ COLOR_GREEN;
int /*<<< orphan*/ COLOR_PAIR(int);
int /*<<< orphan*/ attroff(int /*<<< orphan*/);
int /*<<< orphan*/ attron(int /*<<< orphan*/);
int /*<<< orphan*/ bkgd(int /*<<< orphan*/);
int /*<<< orphan*/ cleanup_screen();
int /*<<< orphan*/ clear_screen();
int /*<<< orphan*/ init_color(int /*<<< orphan*/, int, int, int);
int /*<<< orphan*/ init_pair(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ setup_screen();
int /*<<< orphan*/ start_color();
int /*<<< orphan*/ start_megamaniac();
int main(int argc, char *argv[]) {
  setup_screen();
  clear_screen();
  start_color();
  init_color(COLOR_GREEN, 518, 875, 31);
  init_pair(1, COLOR_GREEN, COLOR_BLACK);
  bkgd(COLOR_PAIR(1));
  attron(A_BOLD);
  start_megamaniac();
  attroff(A_BOLD);
  cleanup_screen();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1080 <setup_screen@plt>
mov    $0x0,%al
call   10c0 <clear_screen@plt>
mov    $0x0,%al
call   1070 <start_color@plt>
mov    0x2dfe(%rip),%rax
mov    (%rax),%edi
mov    $0x206,%esi
mov    $0x36b,%edx
mov    $0x1f,%ecx
call   1050 <init_color@plt>
mov    0x2de1(%rip),%rax
mov    (%rax),%esi
mov    0x2de0(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%edi
call   1060 <init_pair@plt>
mov    $0x1,%edi
call   10a0 <COLOR_PAIR@plt>
mov    %eax,%edi
call   10d0 <bkgd@plt>
mov    0x2da4(%rip),%rax
mov    (%rax),%edi
call   1090 <attron@plt>
mov    $0x0,%al
call   10b0 <start_megamaniac@plt>
mov    0x2d8f(%rip),%rax
mov    (%rax),%edi
call   1030 <attroff@plt>
mov    $0x0,%al
call   1040 <cleanup_screen@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1080 <setup_screen@plt>
xor    %eax,%eax
call   10c0 <clear_screen@plt>
xor    %eax,%eax
call   1070 <start_color@plt>
mov    0x2e13(%rip),%rbx
mov    (%rbx),%edi
mov    $0x206,%esi
mov    $0x36b,%edx
mov    $0x1f,%ecx
call   1050 <init_color@plt>
mov    (%rbx),%esi
mov    0x2dfc(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%edi
call   1060 <init_pair@plt>
mov    $0x1,%edi
call   10a0 <COLOR_PAIR@plt>
mov    %eax,%edi
call   10d0 <bkgd@plt>
mov    0x2dc0(%rip),%rbx
mov    (%rbx),%edi
call   1090 <attron@plt>
xor    %eax,%eax
call   10b0 <start_megamaniac@plt>
mov    (%rbx),%edi
call   1030 <attroff@plt>
xor    %eax,%eax
call   1040 <cleanup_screen@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@COLOR_GREEN = global i32 0
@COLOR_BLACK = global i32 0
@A_BOLD = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @setup_screen()
%7 = call i32 (...) @clear_screen()
%8 = call i32 (...) @start_color()
%9 = load i32, i32* @COLOR_GREEN
%10 = call i32 @init_color(i32 %9, i32 518, i32 875, i32 31)
%11 = load i32, i32* @COLOR_GREEN
%12 = load i32, i32* @COLOR_BLACK
%13 = call i32 @init_pair(i32 1, i32 %11, i32 %12)
%14 = call i32 @COLOR_PAIR(i32 1)
%15 = call i32 @bkgd(i32 %14)
%16 = load i32, i32* @A_BOLD
%17 = call i32 @attron(i32 %16)
%18 = call i32 (...) @start_megamaniac()
%19 = load i32, i32* @A_BOLD
%20 = call i32 @attroff(i32 %19)
%21 = call i32 (...) @cleanup_screen()
ret i32 0
}

LLVM IR (-O2):
@COLOR_GREEN = global i32 0
@COLOR_BLACK = global i32 0
@A_BOLD = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @setup_screen()
%4 = tail call i32 (...) @clear_screen()
%5 = tail call i32 (...) @start_color()
%6 = load i32, i32* @COLOR_GREEN
%7 = tail call i32 @init_color(i32 %6, i32 518, i32 875, i32 31)
%8 = load i32, i32* @COLOR_GREEN
%9 = load i32, i32* @COLOR_BLACK
%10 = tail call i32 @init_pair(i32 1, i32 %8, i32 %9)
%11 = tail call i32 @COLOR_PAIR(i32 1)
%12 = tail call i32 @bkgd(i32 %11)
%13 = load i32, i32* @A_BOLD
%14 = tail call i32 @attron(i32 %13)
%15 = tail call i32 (...) @start_megamaniac()
%16 = load i32, i32* @A_BOLD
%17 = tail call i32 @attroff(i32 %16)
%18 = tail call i32 (...) @cleanup_screen()
ret i32 0
}