#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() {
  int yy1, yy2, mm1, mm2, dd1, dd2;
  printf("Enter a date(yy/mm/dd):");
  scanf("%d/%d/%d", &yy1, &mm1, &dd1);
  while (1) {
    printf("Enter a date(yy/mm/dd):");
    scanf("%d/%d/%d", &yy2, &mm2, &dd2);
    if (yy2 == 0 && mm2 == 0 && dd2 == 0)
      break;
    if (yy2 > yy1) {
      continue;
    } else {
      if (yy2 == yy1) {
        if (mm2 > mm1) {
          continue;
        } else {
          if (mm2 == mm1) {
            if (dd2 > dd1) {
              continue;
            }
          }
        }
      }
      yy1 = yy2;
      mm1 = mm2;
      dd1 = dd2;
    }
  }
  printf("%d/%d/%d is the earliest date\n", yy1, mm1, dd1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdx
lea    -0x18(%rbp),%rcx
call   1040 <scanf@plt>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeae(%rip),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x14(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
call   1040 <scanf@plt>
cmpl   $0x0,-0xc(%rbp)
jne    119e <main+0x7e>
cmpl   $0x0,-0x14(%rbp)
jne    119e <main+0x7e>
cmpl   $0x0,-0x1c(%rbp)
jne    119e <main+0x7e>
jmp    120f <main+0xef>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    11af <main+0x8f>
jmp    1155 <main+0x35>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    11f8 <main+0xd8>
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    11cc <main+0xac>
jmp    1155 <main+0x35>
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    11ee <main+0xce>
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jle    11e9 <main+0xc9>
jmp    1155 <main+0x35>
jmp    11ee <main+0xce>
jmp    11f3 <main+0xd3>
jmp    11f8 <main+0xd8>
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1155 <main+0x35>
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%ecx
lea    0xe02(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x20,%rsp
lea    0xecc(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed3(%rip),%r14
lea    0x1c(%rsp),%rsi
lea    0x14(%rsp),%rdx
lea    0xc(%rsp),%rcx
mov    %r14,%rdi
call   1040 <scanf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x18(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0x8(%rsp),%rcx
mov    %r14,%rdi
call   1040 <scanf@plt>
mov    0x18(%rsp),%eax
mov    0x10(%rsp),%ecx
mov    0x8(%rsp),%edx
test   %eax,%eax
jne    1199 <main+0x79>
test   %ecx,%ecx
jne    1199 <main+0x79>
test   %edx,%edx
je     121f <main+0xff>
lea    0xe60(%rip),%r14
lea    0xe71(%rip),%r15
lea    0x18(%rsp),%r12
lea    0x10(%rsp),%r13
lea    0x8(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
cmp    0x1c(%rsp),%eax
jg     11ec <main+0xcc>
jne    11e0 <main+0xc0>
cmp    0x14(%rsp),%ecx
jg     11ec <main+0xcc>
jne    11e0 <main+0xc0>
cmp    0xc(%rsp),%edx
jg     11ec <main+0xcc>
cs nopw 0x0(%rax,%rax,1)
mov    %eax,0x1c(%rsp)
mov    %ecx,0x14(%rsp)
mov    %edx,0xc(%rsp)
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
mov    %rbx,%rcx
call   1040 <scanf@plt>
mov    0x18(%rsp),%eax
mov    0x10(%rsp),%ecx
mov    0x8(%rsp),%edx
test   %eax,%eax
jne    11c0 <main+0xa0>
test   %ecx,%ecx
jne    11c0 <main+0xa0>
test   %edx,%edx
jne    11c0 <main+0xa0>
mov    0x1c(%rsp),%esi
mov    0x14(%rsp),%edx
mov    0xc(%rsp),%ecx
lea    0xdef(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Enter a date(yy/mm/dd):\00"
@.str.1 = [9 x i8] c"%d/%d/%d\00"
@.str.2 = [31 x i8] c"%d/%d/%d is the earliest date\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 ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %4, i32* %6)
br label %10
10: ; preds = %0, %26, %35, %44, %52
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %3, i32* %5, i32* %7)
%13 = load i32, i32* %3
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %22
15: ; preds = %10
%16 = load i32, i32* %5
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %22
18: ; preds = %15
%19 = load i32, i32* %7
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %18
br label %53
22: ; preds = %18, %15, %10
%23 = load i32, i32* %3
%24 = load i32, i32* %2
%25 = icmp sgt i32 %23, %24
br i1 %25, label %26, label %27
26: ; preds = %22
br label %10
27: ; preds = %22
%28 = load i32, i32* %3
%29 = load i32, i32* %2
%30 = icmp eq i32 %28, %29
br i1 %30, label %31, label %48
31: ; preds = %27
%32 = load i32, i32* %5
%33 = load i32, i32* %4
%34 = icmp sgt i32 %32, %33
br i1 %34, label %35, label %36
35: ; preds = %31
br label %10
36: ; preds = %31
%37 = load i32, i32* %5
%38 = load i32, i32* %4
%39 = icmp eq i32 %37, %38
br i1 %39, label %40, label %46
40: ; preds = %36
%41 = load i32, i32* %7
%42 = load i32, i32* %6
%43 = icmp sgt i32 %41, %42
br i1 %43, label %44, label %45
44: ; preds = %40
br label %10
45: ; preds = %40
br label %46
46: ; preds = %45, %36
br label %47
47: ; preds = %46
br label %48
48: ; preds = %47, %27
%49 = load i32, i32* %3
store i32 %49, i32* %2
%50 = load i32, i32* %5
store i32 %50, i32* %4
%51 = load i32, i32* %7
store i32 %51, i32* %6
br label %52
52: ; preds = %48
br label %10
53: ; preds = %21
%54 = load i32, i32* %2
%55 = load i32, i32* %4
%56 = load i32, i32* %6
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 %54, i32 %55, i32 %56)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"Enter a date(yy/mm/dd):\00"
@.str.1 = [9 x i8] c"%d/%d/%d\00"
@.str.2 = [31 x i8] c"%d/%d/%d is the earliest date\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 ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %3, i32* %5)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %4, i32* %6)
%17 = load i32, i32* %2
%18 = icmp eq i32 %17, 0
%19 = load i32, i32* %4
%20 = icmp eq i32 %19, 0
%21 = select i1 %18, i1 %20, i1 false
%22 = load i32, i32* %6
%23 = icmp eq i32 %22, 0
%24 = select i1 %21, i1 %23, i1 false
br i1 %24, label %53, label %25
25: ; preds = %0, %42
%26 = phi i32 [ %50, %42 ], [ %22, %0 ]
%27 = phi i32 [ %47, %42 ], [ %19, %0 ]
%28 = phi i32 [ %45, %42 ], [ %17, %0 ]
%29 = load i32, i32* %1
%30 = icmp sgt i32 %28, %29
br i1 %30, label %42, label %31
31: ; preds = %25
%32 = icmp eq i32 %28, %29
br i1 %32, label %33, label %41
33: ; preds = %31
%34 = load i32, i32* %3
%35 = icmp sgt i32 %27, %34
br i1 %35, label %42, label %36
36: ; preds = %33
%37 = icmp eq i32 %27, %34
%38 = load i32, i32* %5
%39 = icmp sgt i32 %26, %38
%40 = select i1 %37, i1 %39, i1 false
br i1 %40, label %42, label %41
41: ; preds = %36, %31
store i32 %28, i32* %1
store i32 %27, i32* %3
store i32 %26, i32* %5
br label %42
42: ; preds = %41, %25, %33, %36
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%44 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %4, i32* %6)
%45 = load i32, i32* %2
%46 = icmp eq i32 %45, 0
%47 = load i32, i32* %4
%48 = icmp eq i32 %47, 0
%49 = select i1 %46, i1 %48, i1 false
%50 = load i32, i32* %6
%51 = icmp eq i32 %50, 0
%52 = select i1 %49, i1 %51, i1 false
br i1 %52, label %53, label %25
53: ; preds = %42, %0
%54 = load i32, i32* %1
%55 = load i32, i32* %3
%56 = load i32, i32* %5
%57 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 %54, i32 %55, i32 %56)
ret i32 0
}