#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*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
int main(int argc, char *argv[]) {
  char name[80];
  int age;
  printf("Hello. What is your name?");
  scanf("%s", &name);
  printf("\n");
  printf("Hi, %s!", name);
  printf("\t How old are you?");
  scanf("%d", &age);
  printf("\n");
  int ageAfterFive = age + 5;
  int ageBeforeFive = age - 5;
  printf("Did you know that in five years you will be %d ", ageAfterFive,
         " years old?\n");
  printf("And five years ago you were %d ", ageBeforeFive, " !\tImagine that!");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
lea    -0x60(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xf20(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x60(%rbp),%rsi
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb4(%rip),%rdi
lea    -0x64(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xee0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x64(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0x68(%rbp)
mov    -0x64(%rbp),%eax
sub    $0x5,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x68(%rbp),%esi
lea    0xe82(%rip),%rdi
lea    0xeab(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x6c(%rbp),%esi
lea    0xea7(%rip),%rdi
lea    0xec0(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x60,%rsp
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed0(%rip),%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xeb3(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeaa(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeaf(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0xc(%rsp),%ebx
lea    0x5(%rbx),%esi
add    $0xfffffffb,%ebx
lea    0xe8b(%rip),%rdi
lea    0xeb4(%rip),%rdx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb3(%rip),%rdi
lea    0xecc(%rip),%rdx
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Hello. What is your name?\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [8 x i8] c"Hi, %s!\00"
@.str.4 = [19 x i8] c"\09 How old are you?\00"
@.str.5 = [3 x i8] c"%d\00"
@.str.6 = [48 x i8] c"Did you know that in five years you will be %d \00"
@.str.7 = [13 x i8] c" years old?\0A\00"
@.str.8 = [32 x i8] c"And five years ago you were %d \00"
@.str.9 = [17 x i8] c" !\09Imagine that!\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [80 x i8]
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), [80 x i8]* %5)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%12 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* %12)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %6)
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%17 = load i32, i32* %6
%18 = add nsw i32 %17, 5
store i32 %18, i32* %7
%19 = load i32, i32* %6
%20 = sub nsw i32 %19, 5
store i32 %20, i32* %8
%21 = load i32, i32* %7
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.6, i64 0, i64 0), i32 %21, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0))
%23 = load i32, i32* %8
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.8, i64 0, i64 0), i32 %23, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.9, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"Hello. What is your name?\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.3 = [8 x i8] c"Hi, %s!\00"
@.str.4 = [19 x i8] c"\09 How old are you?\00"
@.str.5 = [3 x i8] c"%d\00"
@.str.6 = [48 x i8] c"Did you know that in five years you will be %d \00"
@.str.7 = [13 x i8] c" years old?\0A\00"
@.str.8 = [32 x i8] c"And five years ago you were %d \00"
@.str.9 = [17 x i8] c" !\09Imagine that!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [80 x i8]
%4 = alloca i32
%5 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%6 = bitcast i32* %4 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), [80 x i8]* %3)
%9 = call i32 @putchar(i32 10)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* %5)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %4)
%13 = call i32 @putchar(i32 10)
%14 = load i32, i32* %4
%15 = add nsw i32 %14, 5
%16 = add nsw i32 %14, -5
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.6, i64 0, i64 0), i32 %15, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0))
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.8, i64 0, i64 0), i32 %16, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.9, i64 0, i64 0))
ret i32 0
}