#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*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int main() {
  char name[80];
  int age;
  fprintf(stdout, "Enter your name and age.\n> ");
  fscanf(stdin, "%s", name);
  fscanf(stdin, "%d", &age);
  fprintf(stdout, "So you're %s, and you're %d years old.\n", name, age);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xec1(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
lea    -0x60(%rbp),%rdx
lea    0xec2(%rip),%rsi
mov    $0x0,%al
call   1030 <fscanf@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
lea    0xeae(%rip),%rsi
lea    -0x64(%rbp),%rdx
mov    $0x0,%al
call   1030 <fscanf@plt>
mov    0x2e55(%rip),%rax
mov    (%rax),%edi
lea    -0x60(%rbp),%rdx
mov    -0x64(%rbp),%ecx
lea    0xe8f(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x60,%rsp
mov    0x2ea8(%rip),%r14
mov    (%r14),%edi
lea    0xec6(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    0x2ea0(%rip),%rbx
mov    (%rbx),%edi
lea    0xecb(%rip),%rsi
lea    0x10(%rsp),%r15
mov    %r15,%rdx
xor    %eax,%eax
call   1030 <fscanf@plt>
mov    (%rbx),%edi
lea    0xeb6(%rip),%rsi
lea    0xc(%rsp),%rdx
xor    %eax,%eax
call   1030 <fscanf@plt>
mov    (%r14),%edi
mov    0xc(%rsp),%ecx
lea    0xe9f(%rip),%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1040 <fprintf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [28 x i8] c"Enter your name and age.\0A> \00"
@stdin = global i32 0
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [40 x i8] c"So you're %s, and you're %d years old.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [80 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = load i32, i32* @stdout
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @stdin
%7 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%8 = call i32 (i32, i8*, ...) @fscanf(i32 %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = load i32, i32* @stdin
%10 = call i32 (i32, i8*, ...) @fscanf(i32 %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%11 = load i32, i32* @stdout
%12 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%13 = load i32, i32* %3
%14 = call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0), i8* %12, i32 %13)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [28 x i8] c"Enter your name and age.\0A> \00"
@stdin = global i32 0
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [40 x i8] c"So you're %s, and you're %d years old.\0A\00"
define i32 @main() {
%1 = alloca [80 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%4 = bitcast i32* %2 to i8*
%5 = load i32, i32* @stdout
%6 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @stdin
%8 = call i32 (i32, i8*, ...) @fscanf(i32 %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%9 = load i32, i32* @stdin
%10 = call i32 (i32, i8*, ...) @fscanf(i32 %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%11 = load i32, i32* @stdout
%12 = load i32, i32* %2
%13 = call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0), i8* %3, i32 %12)
ret i32 0
}