#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*/ beep();
int /*<<< orphan*/ clear();
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ erase();
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ printw(char *);
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ sleep(int);
int main() {
  initscr();
  printw("hello world");
  refresh();
  beep();
  sleep(2);
  clear();
  refresh();
  beep();
  sleep(2);
  erase();
  refresh();
  beep();
  sleep(2);
  endwin();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <initscr@plt>
lea    0xe6e(%rip),%rdi
call   1060 <printw@plt>
mov    $0x0,%al
call   1070 <refresh@plt>
mov    $0x0,%al
call   1050 <beep@plt>
mov    $0x2,%edi
call   10a0 <sleep@plt>
mov    $0x0,%al
call   1090 <clear@plt>
mov    $0x0,%al
call   1070 <refresh@plt>
mov    $0x0,%al
call   1050 <beep@plt>
mov    $0x2,%edi
call   10a0 <sleep@plt>
mov    $0x0,%al
call   1040 <erase@plt>
mov    $0x0,%al
call   1070 <refresh@plt>
mov    $0x0,%al
call   1050 <beep@plt>
mov    $0x2,%edi
call   10a0 <sleep@plt>
mov    $0x0,%al
call   1080 <endwin@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <initscr@plt>
lea    0xe71(%rip),%rdi
call   1060 <printw@plt>
xor    %eax,%eax
call   1070 <refresh@plt>
xor    %eax,%eax
call   1050 <beep@plt>
mov    $0x2,%edi
call   10a0 <sleep@plt>
xor    %eax,%eax
call   1090 <clear@plt>
xor    %eax,%eax
call   1070 <refresh@plt>
xor    %eax,%eax
call   1050 <beep@plt>
mov    $0x2,%edi
call   10a0 <sleep@plt>
xor    %eax,%eax
call   1040 <erase@plt>
xor    %eax,%eax
call   1070 <refresh@plt>
xor    %eax,%eax
call   1050 <beep@plt>
mov    $0x2,%edi
call   10a0 <sleep@plt>
xor    %eax,%eax
call   1080 <endwin@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"hello world\00"
define i32 @main() {
%1 = call i32 (...) @initscr()
%2 = call i32 @printw(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @refresh()
%4 = call i32 (...) @beep()
%5 = call i32 @sleep(i32 2)
%6 = call i32 (...) @clear()
%7 = call i32 (...) @refresh()
%8 = call i32 (...) @beep()
%9 = call i32 @sleep(i32 2)
%10 = call i32 (...) @erase()
%11 = call i32 (...) @refresh()
%12 = call i32 (...) @beep()
%13 = call i32 @sleep(i32 2)
%14 = call i32 (...) @endwin()
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"hello world\00"
define i32 @main() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 @printw(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @refresh()
%4 = tail call i32 (...) @beep()
%5 = tail call i32 @sleep(i32 2)
%6 = tail call i32 (...) @clear()
%7 = tail call i32 (...) @refresh()
%8 = tail call i32 (...) @beep()
%9 = tail call i32 @sleep(i32 2)
%10 = tail call i32 (...) @erase()
%11 = tail call i32 (...) @refresh()
%12 = tail call i32 (...) @beep()
%13 = tail call i32 @sleep(i32 2)
%14 = tail call i32 (...) @endwin()
ret i32 0
}