#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 getint();
int /*<<< orphan*/ getstring(char *);
int /*<<< orphan*/ putint(int);
int /*<<< orphan*/ putstring(char *);
int main(void) {
  char name[80];
  int age;
  putstring("Your name? ");
  getstring(name);
  putstring("Your age ");
  age = getint();
  putstring("You are: ");
  putstring(name);
  putstring(".\n");
  putstring("You are: ");
  putint(age);
  putstring(" years old.\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
lea    0xeb1(%rip),%rdi
call   1060 <putstring@plt>
lea    -0x50(%rbp),%rdi
call   1030 <getstring@plt>
lea    0xea8(%rip),%rdi
call   1060 <putstring@plt>
mov    $0x0,%al
call   1050 <getint@plt>
mov    %eax,-0x54(%rbp)
lea    0xe9c(%rip),%rdi
call   1060 <putstring@plt>
lea    -0x50(%rbp),%rdi
call   1060 <putstring@plt>
lea    0xe9b(%rip),%rdi
call   1060 <putstring@plt>
lea    0xe7b(%rip),%rdi
call   1060 <putstring@plt>
mov    -0x54(%rbp),%edi
call   1040 <putint@plt>
lea    0xe71(%rip),%rdi
call   1060 <putstring@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x50,%rsp
lea    0xeb1(%rip),%rdi
call   1060 <putstring@plt>
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <getstring@plt>
lea    0xea6(%rip),%rdi
call   1060 <putstring@plt>
xor    %eax,%eax
call   1050 <getint@plt>
mov    %eax,%ebp
lea    0xe9b(%rip),%rbx
mov    %rbx,%rdi
call   1060 <putstring@plt>
mov    %r14,%rdi
call   1060 <putstring@plt>
lea    0xe98(%rip),%rdi
call   1060 <putstring@plt>
mov    %rbx,%rdi
call   1060 <putstring@plt>
mov    %ebp,%edi
call   1040 <putint@plt>
lea    0xe73(%rip),%rdi
call   1060 <putstring@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Your name? \00"
@.str.1 = [10 x i8] c"Your age \00"
@.str.2 = [10 x i8] c"You are: \00"
@.str.3 = [3 x i8] c".\0A\00"
@.str.4 = [13 x i8] c" years old.\0A\00"
define i32 @main() {
%1 = alloca [80 x i8]
%2 = alloca i32
%3 = call i32 @putstring(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%5 = call i32 @getstring(i8* %4)
%6 = call i32 @putstring(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 (...) @getint()
store i32 %7, i32* %2
%8 = call i32 @putstring(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%9 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%10 = call i32 @putstring(i8* %9)
%11 = call i32 @putstring(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 @putstring(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%13 = load i32, i32* %2
%14 = call i32 @putint(i32 %13)
%15 = call i32 @putstring(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Your name? \00"
@.str.1 = [10 x i8] c"Your age \00"
@.str.2 = [10 x i8] c"You are: \00"
@.str.3 = [3 x i8] c".\0A\00"
@.str.4 = [13 x i8] c" years old.\0A\00"
define i32 @main() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @putstring(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @getstring(i8* %2)
%5 = call i32 @putstring(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (...) @getint()
%7 = call i32 @putstring(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @putstring(i8* %2)
%9 = call i32 @putstring(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%10 = call i32 @putstring(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 @putint(i32 %6)
%12 = call i32 @putstring(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}