#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*/ def_prog_mode();
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ printw(char *);
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ reset_prog_mode();
int /*<<< orphan*/ system(char *);
int main() {
  initscr();
  printw("Hello World !!!\n");
  refresh();
  def_prog_mode();
  endwin();
  system("/bin/sh");
  reset_prog_mode();
  refresh();
  printw("Another String\n");
  refresh();
  endwin();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <initscr@plt>
lea    0xe73(%rip),%rdi
call   1050 <printw@plt>
mov    $0x0,%al
call   1080 <refresh@plt>
mov    $0x0,%al
call   1070 <def_prog_mode@plt>
mov    $0x0,%al
call   1090 <endwin@plt>
lea    0xe63(%rip),%rdi
call   1030 <system@plt>
mov    $0x0,%al
call   1060 <reset_prog_mode@plt>
mov    $0x0,%al
call   1080 <refresh@plt>
lea    0xe51(%rip),%rdi
call   1050 <printw@plt>
mov    $0x0,%al
call   1080 <refresh@plt>
mov    $0x0,%al
call   1090 <endwin@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <initscr@plt>
lea    0xe81(%rip),%rdi
call   1050 <printw@plt>
xor    %eax,%eax
call   1080 <refresh@plt>
xor    %eax,%eax
call   1070 <def_prog_mode@plt>
xor    %eax,%eax
call   1090 <endwin@plt>
lea    0xe71(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
call   1060 <reset_prog_mode@plt>
xor    %eax,%eax
call   1080 <refresh@plt>
lea    0xe5f(%rip),%rdi
call   1050 <printw@plt>
xor    %eax,%eax
call   1080 <refresh@plt>
xor    %eax,%eax
call   1090 <endwin@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Hello World !!!\0A\00"
@.str.1 = [8 x i8] c"/bin/sh\00"
@.str.2 = [16 x i8] c"Another String\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @initscr()
%3 = call i32 @printw(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @refresh()
%5 = call i32 (...) @def_prog_mode()
%6 = call i32 (...) @endwin()
%7 = call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 (...) @reset_prog_mode()
%9 = call i32 (...) @refresh()
%10 = call i32 @printw(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 (...) @refresh()
%12 = call i32 (...) @endwin()
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"Hello World !!!\0A\00"
@.str.1 = [8 x i8] c"/bin/sh\00"
@.str.2 = [16 x i8] c"Another String\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 @printw(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @refresh()
%4 = tail call i32 (...) @def_prog_mode()
%5 = tail call i32 (...) @endwin()
%6 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 (...) @reset_prog_mode()
%8 = tail call i32 (...) @refresh()
%9 = tail call i32 @printw(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%10 = tail call i32 (...) @refresh()
%11 = tail call i32 (...) @endwin()
ret i32 0
}