#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 *);
int main(void) {
  int age1, age2;
  printf("First age: ");
  scanf("%d", &age1);
  printf("Second age: ");
  scanf("%d", &age2);
  if (age1 > age2) {
    printf("The first age is greater than the second age.\n");
  } else {
    if (age1 == age2) {
      printf("The ages are equal.\n");
    } else {
      printf("The second age is greater than the first age.\n");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
lea    0xeae(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1184 <main+0x64>
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
jmp    11b2 <main+0x92>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    11a1 <main+0x81>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
jmp    11ad <main+0x8d>
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
jmp    11b2 <main+0x92>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
call   1040 <printf@plt>
lea    0xec4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0xc(%rsp),%eax
cmp    0x8(%rsp),%eax
lea    0xecd(%rip),%rax
lea    0xe98(%rip),%rcx
cmove  %rax,%rcx
lea    0xecf(%rip),%rdi
cmovle %rcx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"First age: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [13 x i8] c"Second age: \00"
@.str.3 = [47 x i8] c"The first age is greater than the second age.\0A\00"
@.str.4 = [21 x i8] c"The ages are equal.\0A\00"
@.str.5 = [47 x i8] c"The second age is greater than the first age.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = icmp sgt i32 %8, %9
br i1 %10, label %11, label %13
11: ; preds = %0
%12 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, i64 0, i64 0))
br label %22
13: ; preds = %0
%14 = load i32, i32* %2
%15 = load i32, i32* %3
%16 = icmp eq i32 %14, %15
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0))
br label %21
19: ; preds = %13
%20 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.5, i64 0, i64 0))
br label %21
21: ; preds = %19, %17
br label %22
22: ; preds = %21, %11
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"First age: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [13 x i8] c"Second age: \00"
@str = [46 x i8] c"The second age is greater than the first age.\00"
@str.6 = [20 x i8] c"The ages are equal.\00"
@str.7 = [46 x i8] c"The first age is greater than the second age.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = icmp sgt i32 %9, %10
%12 = icmp eq i32 %9, %10
%13 = select i1 %12, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @str.6, i64 0, i64 0), i8* getelementptr inbounds ([46 x i8], [46 x i8]* @str, i64 0, i64 0)
%14 = select i1 %11, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @str.7, i64 0, i64 0), i8* %13
%15 = call i32 @puts(i8* dereferenceable(1) %14)
ret i32 0
}