#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 *, int *);
int main(void) {
  int date1, date2, month1, month2, year1, year2;
  printf("enter the first date(mm/dd/yy): ");
  scanf("%2d/%2d/%4d", &date1, &month1, &year1);
  printf("enter the second date(mm/dd/yy): ");
  scanf("%2d/%2d/%4d", &date2, &month2, &year2);
  if (year1 > year2)
    printf("%d/%d/%d is earlier than %d/%d/%d\n", date2, month2, year2, date1,
           month1, year1);
  else if (year1 < year2)
    printf("%d/%d/%d is earlier than %d/%d/%d\n", date1, month1, year1, date2,
           month2, year2);
  else {
    if (month1 > month2)
      printf("%d/%d/%d is earlier than %d/%d/%d\n", date2, month2, year2, date1,
             month1, year1);
    else if (month1 < month2)
      printf("%d/%d/%d is earlier than %d/%d/%d\n", date1, month1, year1, date2,
             month2, year2);
    else {
      if (date1 > date2)
        printf("%d/%d/%d is earlier than %d/%d/%d\n", date2, month2, year2,
               date1, month1, year1);
      else if (date1 < date2)
        printf("%d/%d/%d is earlier than %d/%d/%d\n", date1, month1, year1,
               date2, month2, year2);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdx
lea    -0x18(%rbp),%rcx
call   1040 <scanf@plt>
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb7(%rip),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x14(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
call   1040 <scanf@plt>
mov    -0x18(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jle    11b1 <main+0x91>
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x1c(%rbp),%ecx
mov    -0x8(%rbp),%r8d
mov    -0x10(%rbp),%r9d
mov    -0x18(%rbp),%eax
lea    0xead(%rip),%rdi
mov    %eax,(%rsp)
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12d3 <main+0x1b3>
mov    -0x18(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    11e7 <main+0xc7>
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0xc(%rbp),%r8d
mov    -0x14(%rbp),%r9d
mov    -0x1c(%rbp),%eax
lea    0xe77(%rip),%rdi
mov    %eax,(%rsp)
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12ce <main+0x1ae>
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    121d <main+0xfd>
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x1c(%rbp),%ecx
mov    -0x8(%rbp),%r8d
mov    -0x10(%rbp),%r9d
mov    -0x18(%rbp),%eax
lea    0xe41(%rip),%rdi
mov    %eax,(%rsp)
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12c9 <main+0x1a9>
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1253 <main+0x133>
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0xc(%rbp),%r8d
mov    -0x14(%rbp),%r9d
mov    -0x1c(%rbp),%eax
lea    0xe0b(%rip),%rdi
mov    %eax,(%rsp)
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12c4 <main+0x1a4>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1289 <main+0x169>
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x1c(%rbp),%ecx
mov    -0x8(%rbp),%r8d
mov    -0x10(%rbp),%r9d
mov    -0x18(%rbp),%eax
lea    0xdd5(%rip),%rdi
mov    %eax,(%rsp)
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12bf <main+0x19f>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    12ba <main+0x19a>
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0xc(%rbp),%r8d
mov    -0x14(%rbp),%r9d
mov    -0x1c(%rbp),%eax
lea    0xd9f(%rip),%rdi
mov    %eax,(%rsp)
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12bf <main+0x19f>
jmp    12c4 <main+0x1a4>
jmp    12c9 <main+0x1a9>
jmp    12ce <main+0x1ae>
jmp    12d3 <main+0x1b3>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee7(%rip),%rbx
lea    0xc(%rsp),%rsi
lea    0x14(%rsp),%rdx
lea    0x1c(%rsp),%rcx
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x8(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0x18(%rsp),%rcx
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0x1c(%rsp),%ecx
mov    0x18(%rsp),%eax
cmp    %eax,%ecx
jle    11a5 <main+0x85>
mov    0x8(%rsp),%esi
mov    0x10(%rsp),%edx
mov    0xc(%rsp),%r8d
mov    0x14(%rsp),%r9d
mov    %ecx,(%rsp)
lea    0xeb1(%rip),%rdi
mov    %eax,%ecx
jmp    122b <main+0x10b>
jge    11c5 <main+0xa5>
mov    0xc(%rsp),%esi
mov    0x14(%rsp),%edx
mov    0x8(%rsp),%r8d
mov    0x10(%rsp),%r9d
mov    %eax,(%rsp)
lea    0xe8c(%rip),%rdi
jmp    122b <main+0x10b>
mov    0x14(%rsp),%r9d
mov    0x10(%rsp),%r10d
cmp    %r10d,%r9d
jle    11ee <main+0xce>
mov    0x8(%rsp),%esi
mov    0xc(%rsp),%r8d
mov    %ecx,(%rsp)
lea    0xe68(%rip),%rdi
mov    %r10d,%edx
mov    %eax,%ecx
jmp    122b <main+0x10b>
mov    0xc(%rsp),%r11d
mov    0x8(%rsp),%r8d
jl     1218 <main+0xf8>
cmp    %r8d,%r11d
jle    1216 <main+0xf6>
mov    %ecx,(%rsp)
lea    0xe46(%rip),%rdi
mov    %r8d,%esi
mov    %r10d,%edx
mov    %eax,%ecx
mov    %r11d,%r8d
jmp    122b <main+0x10b>
jge    1232 <main+0x112>
mov    %eax,(%rsp)
lea    0xe2d(%rip),%rdi
mov    %r11d,%esi
mov    %r9d,%edx
mov    %r10d,%r9d
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"enter the first date(mm/dd/yy): \00"
@.str.1 = [12 x i8] c"%2d/%2d/%4d\00"
@.str.2 = [34 x i8] c"enter the second date(mm/dd/yy): \00"
@.str.3 = [35 x i8] c"%d/%d/%d is earlier than %d/%d/%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %4, i32* %6)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32* %3, i32* %5, i32* %7)
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = icmp sgt i32 %12, %13
br i1 %14, label %15, label %23
15: ; preds = %0
%16 = load i32, i32* %3
%17 = load i32, i32* %5
%18 = load i32, i32* %7
%19 = load i32, i32* %2
%20 = load i32, i32* %4
%21 = load i32, i32* %6
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), i32 %16, i32 %17, i32 %18, i32 %19, i32 %20, i32 %21)
br label %88
23: ; preds = %0
%24 = load i32, i32* %6
%25 = load i32, i32* %7
%26 = icmp slt i32 %24, %25
br i1 %26, label %27, label %35
27: ; preds = %23
%28 = load i32, i32* %2
%29 = load i32, i32* %4
%30 = load i32, i32* %6
%31 = load i32, i32* %3
%32 = load i32, i32* %5
%33 = load i32, i32* %7
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), i32 %28, i32 %29, i32 %30, i32 %31, i32 %32, i32 %33)
br label %87
35: ; preds = %23
%36 = load i32, i32* %4
%37 = load i32, i32* %5
%38 = icmp sgt i32 %36, %37
br i1 %38, label %39, label %47
39: ; preds = %35
%40 = load i32, i32* %3
%41 = load i32, i32* %5
%42 = load i32, i32* %7
%43 = load i32, i32* %2
%44 = load i32, i32* %4
%45 = load i32, i32* %6
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), i32 %40, i32 %41, i32 %42, i32 %43, i32 %44, i32 %45)
br label %86
47: ; preds = %35
%48 = load i32, i32* %4
%49 = load i32, i32* %5
%50 = icmp slt i32 %48, %49
br i1 %50, label %51, label %59
51: ; preds = %47
%52 = load i32, i32* %2
%53 = load i32, i32* %4
%54 = load i32, i32* %6
%55 = load i32, i32* %3
%56 = load i32, i32* %5
%57 = load i32, i32* %7
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), i32 %52, i32 %53, i32 %54, i32 %55, i32 %56, i32 %57)
br label %85
59: ; preds = %47
%60 = load i32, i32* %2
%61 = load i32, i32* %3
%62 = icmp sgt i32 %60, %61
br i1 %62, label %63, label %71
63: ; preds = %59
%64 = load i32, i32* %3
%65 = load i32, i32* %5
%66 = load i32, i32* %7
%67 = load i32, i32* %2
%68 = load i32, i32* %4
%69 = load i32, i32* %6
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), i32 %64, i32 %65, i32 %66, i32 %67, i32 %68, i32 %69)
br label %84
71: ; preds = %59
%72 = load i32, i32* %2
%73 = load i32, i32* %3
%74 = icmp slt i32 %72, %73
br i1 %74, label %75, label %83
75: ; preds = %71
%76 = load i32, i32* %2
%77 = load i32, i32* %4
%78 = load i32, i32* %6
%79 = load i32, i32* %3
%80 = load i32, i32* %5
%81 = load i32, i32* %7
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), i32 %76, i32 %77, i32 %78, i32 %79, i32 %80, i32 %81)
br label %83
83: ; preds = %75, %71
br label %84
84: ; preds = %83, %63
br label %85
85: ; preds = %84, %51
br label %86
86: ; preds = %85, %39
br label %87
87: ; preds = %86, %27
br label %88
88: ; preds = %87, %15
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"enter the first date(mm/dd/yy): \00"
@.str.1 = [12 x i8] c"%2d/%2d/%4d\00"
@.str.2 = [34 x i8] c"enter the second date(mm/dd/yy): \00"
@.str.3 = [35 x i8] c"%d/%d/%d is earlier than %d/%d/%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = bitcast i32* %1 to i8*
%8 = bitcast i32* %2 to i8*
%9 = bitcast i32* %3 to i8*
%10 = bitcast i32* %4 to i8*
%11 = bitcast i32* %5 to i8*
%12 = bitcast i32* %6 to i8*
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %3, i32* %5)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %4, i32* %6)
%17 = load i32, i32* %5
%18 = load i32, i32* %6
%19 = icmp sgt i32 %17, %18
br i1 %19, label %20, label %26
20: ; preds = %0
%21 = load i32, i32* %2
%22 = load i32, i32* %4
%23 = load i32, i32* %1
%24 = load i32, i32* %3
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), i32 %21, i32 %22, i32 %18, i32 %23, i32 %24, i32 %17)
br label %56
26: ; preds = %0
%27 = icmp slt i32 %17, %18
br i1 %27, label %28, label %34
28: ; preds = %26
%29 = load i32, i32* %1
%30 = load i32, i32* %3
%31 = load i32, i32* %2
%32 = load i32, i32* %4
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), i32 %29, i32 %30, i32 %17, i32 %31, i32 %32, i32 %18)
br label %56
34: ; preds = %26
%35 = load i32, i32* %3
%36 = load i32, i32* %4
%37 = icmp sgt i32 %35, %36
br i1 %37, label %38, label %42
38: ; preds = %34
%39 = load i32, i32* %2
%40 = load i32, i32* %1
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), i32 %39, i32 %36, i32 %18, i32 %40, i32 %35, i32 %17)
br label %56
42: ; preds = %34
%43 = icmp slt i32 %35, %36
%44 = load i32, i32* %1
%45 = load i32, i32* %2
br i1 %43, label %46, label %48
46: ; preds = %42
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), i32 %44, i32 %35, i32 %17, i32 %45, i32 %36, i32 %18)
br label %56
48: ; preds = %42
%49 = icmp sgt i32 %44, %45
br i1 %49, label %50, label %52
50: ; preds = %48
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), i32 %45, i32 %36, i32 %18, i32 %44, i32 %35, i32 %17)
br label %56
52: ; preds = %48
%53 = icmp slt i32 %44, %45
br i1 %53, label %54, label %56
54: ; preds = %52
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), i32 %44, i32 %35, i32 %17, i32 %45, i32 %36, i32 %18)
br label %56
56: ; preds = %28, %46, %52, %54, %50, %38, %20
ret i32 0
}