#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*/ getch();
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ printw(char *);
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ reset_prog_mode();
int /*<<< orphan*/ system(char *);
int main(int argc, char const *argv[]) {
  initscr();
  printw("Hello World !!!");
  refresh();
  def_prog_mode();
  getch();
  endwin();
  system("/bin/bash");
  reset_prog_mode();
  refresh();
  printw("Another String\n");
  refresh();
  getch();
  endwin();
  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   1040 <initscr@plt>
lea    0xe5c(%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 <getch@plt>
mov    $0x0,%al
call   10a0 <endwin@plt>
lea    0xe44(%rip),%rdi
call   1030 <system@plt>
mov    $0x0,%al
call   1060 <reset_prog_mode@plt>
mov    $0x0,%al
call   1080 <refresh@plt>
lea    0xe34(%rip),%rdi
call   1050 <printw@plt>
mov    $0x0,%al
call   1080 <refresh@plt>
mov    $0x0,%al
call   1090 <getch@plt>
mov    $0x0,%al
call   10a0 <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    0xe71(%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 <getch@plt>
xor    %eax,%eax
call   10a0 <endwin@plt>
lea    0xe59(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
call   1060 <reset_prog_mode@plt>
xor    %eax,%eax
call   1080 <refresh@plt>
lea    0xe49(%rip),%rdi
call   1050 <printw@plt>
xor    %eax,%eax
call   1080 <refresh@plt>
xor    %eax,%eax
call   1090 <getch@plt>
xor    %eax,%eax
call   10a0 <endwin@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Hello World !!!\00"
@.str.1 = [10 x i8] c"/bin/bash\00"
@.str.2 = [16 x i8] c"Another String\0A\00"
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 (...) @initscr()
%7 = call i32 @printw(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (...) @refresh()
%9 = call i32 (...) @def_prog_mode()
%10 = call i32 (...) @getch()
%11 = call i32 (...) @endwin()
%12 = call i32 @system(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 (...) @reset_prog_mode()
%14 = call i32 (...) @refresh()
%15 = call i32 @printw(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%16 = call i32 (...) @refresh()
%17 = call i32 (...) @getch()
%18 = call i32 (...) @endwin()
ret i32 0
}

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