#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*/ EXIT_SUCCESS;
int /*<<< orphan*/ addstr(char *);
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ getch();
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ refresh();
int main(void) {
  char address[] = "Fifth avenue NY ";
  char msg_to_text[] = "(type something to exit)";
  initscr();
  addstr(address);
  addstr(msg_to_text);
  refresh();
  getch();
  endwin();
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xe8a(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xe87(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xe85(%rip),%al
mov    %al,-0x10(%rbp)
mov    0xe8b(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xe88(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xe85(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xe83(%rip),%al
mov    %al,-0x28(%rbp)
mov    $0x0,%al
call   1030 <initscr@plt>
lea    -0x20(%rbp),%rdi
call   1080 <addstr@plt>
lea    -0x40(%rbp),%rdi
call   1080 <addstr@plt>
mov    $0x0,%al
call   1040 <refresh@plt>
mov    $0x0,%al
call   1050 <getch@plt>
mov    $0x0,%al
call   1060 <endwin@plt>
mov    0x2df3(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
movaps 0xe95(%rip),%xmm0
movaps %xmm0,(%rsp)
movb   $0x0,0x10(%rsp)
movups 0xeae(%rip),%xmm0
movups %xmm0,0x29(%rsp)
movaps 0xe99(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
xor    %eax,%eax
call   1030 <initscr@plt>
mov    %rsp,%rdi
call   1080 <addstr@plt>
lea    0x20(%rsp),%rdi
call   1080 <addstr@plt>
xor    %eax,%eax
call   1040 <refresh@plt>
xor    %eax,%eax
call   1050 <getch@plt>
xor    %eax,%eax
call   1060 <endwin@plt>
mov    0x2e1f(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@__const.main.address = [17 x i8] c"Fifth avenue NY \00"
@__const.main.msg_to_text = [25 x i8] c"(type something to exit)\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [17 x i8]
%3 = alloca [25 x i8]
store i32 0, i32* %1
%4 = bitcast [17 x i8]* %2 to i8*
%5 = bitcast [25 x i8]* %3 to i8*
%6 = call i32 (...) @initscr()
%7 = getelementptr inbounds [17 x i8], [17 x i8]* %2, i64 0, i64 0
%8 = call i32 @addstr(i8* %7)
%9 = getelementptr inbounds [25 x i8], [25 x i8]* %3, i64 0, i64 0
%10 = call i32 @addstr(i8* %9)
%11 = call i32 (...) @refresh()
%12 = call i32 (...) @getch()
%13 = call i32 (...) @endwin()
%14 = load i32, i32* @EXIT_SUCCESS
%15 = call i32 @exit(i32 %14)
unreachable
}

LLVM IR (-O2):
@__const.main.address = [17 x i8] c"Fifth avenue NY \00"
@__const.main.msg_to_text = [25 x i8] c"(type something to exit)\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca [17 x i8]
%2 = alloca [25 x i8]
%3 = getelementptr inbounds [17 x i8], [17 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [25 x i8], [25 x i8]* %2, i64 0, i64 0
%5 = tail call i32 (...) @initscr()
%6 = call i32 @addstr(i8* %3)
%7 = call i32 @addstr(i8* %4)
%8 = call i32 (...) @refresh()
%9 = call i32 (...) @getch()
%10 = call i32 (...) @endwin()
%11 = load i32, i32* @EXIT_SUCCESS
%12 = call i32 @exit(i32 %11)
unreachable
}