#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*/ addch(char);
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ getch();
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ refresh();
int main(void) {
  char address[] = "San lorenzo avenue (type something to exit)";
  char *pstr;
  pstr = address;
  initscr();
  while (*pstr) {
    addch(*pstr);
    pstr++;
  }
  refresh();
  getch();
  endwin();
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xe76(%rip),%rsi
mov    $0x2c,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    $0x0,%al
call   1030 <initscr@plt>
mov    -0x38(%rbp),%rax
cmpb   $0x0,(%rax)
je     11cd <main+0x5d>
mov    -0x38(%rbp),%rax
movsbl (%rax),%edi
call   1050 <addch@plt>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    11a3 <main+0x33>
mov    $0x0,%al
call   1060 <refresh@plt>
mov    $0x0,%al
call   1070 <getch@plt>
mov    $0x0,%al
call   1080 <endwin@plt>
mov    0x2df7(%rip),%rax
mov    (%rax),%edi
call   1090 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
movups 0xeb0(%rip),%xmm0
movups %xmm0,0x1c(%rsp)
movaps 0xe98(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe7c(%rip),%xmm0
movaps %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <initscr@plt>
lea    0x1(%rsp),%rbx
mov    $0x53,%al
cs nopw 0x0(%rax,%rax,1)
movsbl %al,%edi
call   1040 <addch@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    11a0 <main+0x40>
xor    %eax,%eax
call   1050 <refresh@plt>
xor    %eax,%eax
call   1060 <getch@plt>
xor    %eax,%eax
call   1070 <endwin@plt>
mov    0x2e11(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@__const.main.address = [44 x i8] c"San lorenzo avenue (type something to exit)\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [44 x i8]
%3 = alloca i8*
store i32 0, i32* %1
%4 = bitcast [44 x i8]* %2 to i8*
%5 = getelementptr inbounds [44 x i8], [44 x i8]* %2, i64 0, i64 0
store i8* %5, i8** %3
%6 = call i32 (...) @initscr()
br label %7
7: ; preds = %11, %0
%8 = load i8*, i8** %3
%9 = load i8, i8* %8
%10 = icmp ne i8 %9, 0
br i1 %10, label %11, label %17
11: ; preds = %7
%12 = load i8*, i8** %3
%13 = load i8, i8* %12
%14 = call i32 @addch(i8 signext %13)
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %3
br label %7
17: ; preds = %7
%18 = call i32 (...) @refresh()
%19 = call i32 (...) @getch()
%20 = call i32 (...) @endwin()
%21 = load i32, i32* @EXIT_SUCCESS
%22 = call i32 @exit(i32 %21)
unreachable
}

LLVM IR (-O2):
@__const.main.address = [44 x i8] c"San lorenzo avenue (type something to exit)\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca [44 x i8]
%2 = getelementptr inbounds [44 x i8], [44 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (...) @initscr()
br label %4
4: ; preds = %0, %4
%5 = phi i8 [ %9, %4 ], [ 83, %0 ]
%6 = phi i8* [ %8, %4 ], [ %2, %0 ]
%7 = tail call i32 @addch(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4
%12 = tail call i32 (...) @refresh()
%13 = tail call i32 (...) @getch()
%14 = tail call i32 (...) @endwin()
%15 = load i32, i32* @EXIT_SUCCESS
%16 = tail call i32 @exit(i32 %15)
unreachable
}