#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("Hey, what's your name?");
  scanf("%s", &name);
  printf("\nOk, %s", name);
  printf(", how old are you?");
  scanf("%d", &age);
  if (age < 16) {
    printf("You can't drive.");
  }
  if (age < 18) {
    printf("You can't vote");
  }
  if (age < 25) {
    printf("You can't rent a car.");
  }
  if (age > 25) {
    printf("You can do anything that's legal!");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
lea    -0x60(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    -0x60(%rbp),%rsi
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb5(%rip),%rdi
lea    -0x64(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
cmpl   $0x10,-0x64(%rbp)
jge    11a0 <main+0x80>
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x12,-0x64(%rbp)
jge    11b8 <main+0x98>
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x19,-0x64(%rbp)
jge    11d0 <main+0xb0>
lea    0xe8c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x19,-0x64(%rbp)
jle    11e8 <main+0xc8>
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x60,%rsp
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xec7(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec3(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
cmp    $0xf,%eax
jle    11a9 <main+0x89>
cmp    $0x11,%eax
jle    11c0 <main+0xa0>
cmp    $0x18,%eax
jle    11d7 <main+0xb7>
cmp    $0x1a,%eax
jl     11a1 <main+0x81>
lea    0xed1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbx
ret
lea    0xe85(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%eax
cmp    $0x11,%eax
jg     1189 <main+0x69>
lea    0xe7f(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%eax
cmp    $0x18,%eax
jg     118e <main+0x6e>
lea    0xe77(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%eax
cmp    $0x1a,%eax
jge    1193 <main+0x73>
jmp    11a1 <main+0x81>

LLVM IR (-O0):
@.str = [23 x i8] c"Hey, what's your name?\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [8 x i8] c"\0AOk, %s\00"
@.str.3 = [19 x i8] c", how old are you?\00"
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [17 x i8] c"You can't drive.\00"
@.str.6 = [15 x i8] c"You can't vote\00"
@.str.7 = [22 x i8] c"You can't rent a car.\00"
@.str.8 = [34 x i8] c"You can do anything that's legal!\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [80 x i8]
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), [80 x i8]* %6)
%10 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %10)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %7)
%14 = load i32, i32* %7
%15 = icmp slt i32 %14, 16
br i1 %15, label %16, label %18
16: ; preds = %2
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0))
br label %18
18: ; preds = %16, %2
%19 = load i32, i32* %7
%20 = icmp slt i32 %19, 18
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0))
br label %23
23: ; preds = %21, %18
%24 = load i32, i32* %7
%25 = icmp slt i32 %24, 25
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0))
br label %28
28: ; preds = %26, %23
%29 = load i32, i32* %7
%30 = icmp sgt i32 %29, 25
br i1 %30, label %31, label %33
31: ; preds = %28
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.8, i64 0, i64 0))
br label %33
33: ; preds = %31, %28
%34 = load i32, i32* %3
ret i32 %34
}

LLVM IR (-O2):
@.str = [23 x i8] c"Hey, what's your name?\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [8 x i8] c"\0AOk, %s\00"
@.str.3 = [19 x i8] c", how old are you?\00"
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [17 x i8] c"You can't drive.\00"
@.str.6 = [15 x i8] c"You can't vote\00"
@.str.7 = [22 x i8] c"You can't rent a car.\00"
@.str.8 = [34 x i8] c"You can do anything that's legal!\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 ([23 x i8], [23 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 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %5)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %4)
%12 = load i32, i32* %4
%13 = icmp slt i32 %12, 16
br i1 %13, label %14, label %17
14: ; preds = %2
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0))
%16 = load i32, i32* %4
br label %17
17: ; preds = %14, %2
%18 = phi i32 [ %16, %14 ], [ %12, %2 ]
%19 = icmp slt i32 %18, 18
br i1 %19, label %20, label %23
20: ; preds = %17
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0))
%22 = load i32, i32* %4
br label %23
23: ; preds = %20, %17
%24 = phi i32 [ %22, %20 ], [ %18, %17 ]
%25 = icmp slt i32 %24, 25
br i1 %25, label %26, label %29
26: ; preds = %23
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0))
%28 = load i32, i32* %4
br label %29
29: ; preds = %26, %23
%30 = phi i32 [ %28, %26 ], [ %24, %23 ]
%31 = icmp sgt i32 %30, 25
br i1 %31, label %32, label %34
32: ; preds = %29
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.8, i64 0, i64 0))
br label %34
34: ; preds = %32, %29
ret i32 0
}