#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*/ freopen(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, unsigned long *, unsigned long *,
                         unsigned long *, unsigned long *, unsigned long *,
                         unsigned long *);
int /*<<< orphan*/ stdin;
int main() {
  unsigned long d1, m1, y1, d2, m2, y2;
  unsigned long dayFine = 15;
  unsigned long monthFine = 500;
  unsigned long yearFine = 10000;
  unsigned long fine = 0;
  freopen("nestedLogicTestCase.test", "r", stdin);
  scanf("%lu %lu %lu %lu %lu %lu", &d1, &m1, &y1, &d2, &m2, &y2);
  if (y1 > y2) {
    printf("Year not equal\n");
    fine = yearFine;
  } else if (y1 == y2) {
    if (m1 > m2) {
      printf("Month not equal\n");
      fine = (m1 - m2) * monthFine;
    } else if (m1 == m2) {
      if (d1 > d2) {
        printf("Day not equal\n");
        fine = (d1 - d2) * dayFine;
      }
    }
  }
  printf("%lu\n", fine);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0xf,-0x40(%rbp)
movq   $0x1f4,-0x48(%rbp)
movq   $0x2710,-0x50(%rbp)
movq   $0x0,-0x58(%rbp)
mov    0x2e82(%rip),%rax
mov    (%rax),%edx
lea    0xe91(%rip),%rdi
lea    0xea3(%rip),%rsi
call   1040 <freopen@plt>
lea    0xe99(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
lea    -0x28(%rbp),%r8
lea    -0x30(%rbp),%r9
lea    -0x38(%rbp),%rax
mov    %rax,(%rsp)
call   1050 <scanf@plt>
mov    -0x20(%rbp),%rax
cmp    -0x38(%rbp),%rax
jbe    11cc <main+0x9c>
lea    0xe7b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x50(%rbp),%rax
mov    %rax,-0x58(%rbp)
jmp    125b <main+0x12b>
mov    -0x20(%rbp),%rax
cmp    -0x38(%rbp),%rax
jne    1256 <main+0x126>
mov    -0x18(%rbp),%rax
cmp    -0x30(%rbp),%rax
jbe    120c <main+0xdc>
lea    0xe54(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
sub    -0x30(%rbp),%rax
imul   -0x48(%rbp),%rax
mov    %rax,-0x58(%rbp)
jmp    1251 <main+0x121>
mov    -0x18(%rbp),%rax
cmp    -0x30(%rbp),%rax
jne    124c <main+0x11c>
mov    -0x10(%rbp),%rax
cmp    -0x28(%rbp),%rax
jbe    1247 <main+0x117>
lea    0xe25(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
sub    -0x28(%rbp),%rax
imul   -0x40(%rbp),%rax
mov    %rax,-0x58(%rbp)
jmp    124c <main+0x11c>
jmp    1251 <main+0x121>
jmp    1256 <main+0x126>
jmp    125b <main+0x12b>
mov    -0x58(%rbp),%rsi
lea    0xdfd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
mov    0x2e9d(%rip),%rax
mov    (%rax),%edx
lea    0xeac(%rip),%rdi
lea    0xebe(%rip),%rsi
call   1050 <freopen@plt>
lea    0x28(%rsp),%rax
mov    %rax,(%rsp)
lea    0xeab(%rip),%rdi
lea    0x20(%rsp),%rsi
lea    0x18(%rsp),%rdx
lea    0x30(%rsp),%rcx
lea    0x10(%rsp),%r8
lea    0x8(%rsp),%r9
call   1060 <scanf@plt>
mov    0x30(%rsp),%rax
mov    0x28(%rsp),%rcx
cmp    %rcx,%rax
jbe    11b0 <main+0x70>
lea    0xeb2(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2710,%esi
jmp    1210 <main+0xd0>
jne    120e <main+0xce>
mov    0x18(%rsp),%rax
mov    0x8(%rsp),%rcx
cmp    %rcx,%rax
jbe    11e0 <main+0xa0>
lea    0xe7e(%rip),%rdi
call   1030 <puts@plt>
mov    0x18(%rsp),%rax
sub    0x8(%rsp),%rax
imul   $0x1f4,%rax,%rsi
jmp    1210 <main+0xd0>
jne    120e <main+0xce>
mov    0x20(%rsp),%rax
cmp    0x10(%rsp),%rax
jbe    120e <main+0xce>
lea    0xe43(%rip),%rdi
call   1030 <puts@plt>
mov    0x20(%rsp),%rax
sub    0x10(%rsp),%rax
lea    (%rax,%rax,4),%rax
lea    (%rax,%rax,2),%rsi
jmp    1210 <main+0xd0>
xor    %esi,%esi
lea    0xe1c(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@.str = [25 x i8] c"nestedLogicTestCase.test\00"
@.str.1 = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.2 = [24 x i8] c"%lu %lu %lu %lu %lu %lu\00"
@.str.3 = [16 x i8] c"Year not equal\0A\00"
@.str.4 = [17 x i8] c"Month not equal\0A\00"
@.str.5 = [15 x i8] c"Day not equal\0A\00"
@.str.6 = [5 x i8] c"%lu\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
store i32 0, i32* %1
store i64 15, i64* %8
store i64 500, i64* %9
store i64 10000, i64* %10
store i64 0, i64* %11
%12 = load i32, i32* @stdin
%13 = call i32 @freopen(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%14 = call i32 @scanf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i64* %2, i64* %3, i64* %4, i64* %5, i64* %6, i64* %7)
%15 = load i64, i64* %4
%16 = load i64, i64* %7
%17 = icmp ugt i64 %15, %16
br i1 %17, label %18, label %21
18: ; preds = %0
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%20 = load i64, i64* %10
store i64 %20, i64* %11
br label %55
21: ; preds = %0
%22 = load i64, i64* %4
%23 = load i64, i64* %7
%24 = icmp eq i64 %22, %23
br i1 %24, label %25, label %54
25: ; preds = %21
%26 = load i64, i64* %3
%27 = load i64, i64* %6
%28 = icmp ugt i64 %26, %27
br i1 %28, label %29, label %36
29: ; preds = %25
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0))
%31 = load i64, i64* %3
%32 = load i64, i64* %6
%33 = sub i64 %31, %32
%34 = load i64, i64* %9
%35 = mul i64 %33, %34
store i64 %35, i64* %11
br label %53
36: ; preds = %25
%37 = load i64, i64* %3
%38 = load i64, i64* %6
%39 = icmp eq i64 %37, %38
br i1 %39, label %40, label %52
40: ; preds = %36
%41 = load i64, i64* %2
%42 = load i64, i64* %5
%43 = icmp ugt i64 %41, %42
br i1 %43, label %44, label %51
44: ; preds = %40
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
%46 = load i64, i64* %2
%47 = load i64, i64* %5
%48 = sub i64 %46, %47
%49 = load i64, i64* %8
%50 = mul i64 %48, %49
store i64 %50, i64* %11
br label %51
51: ; preds = %44, %40
br label %52
52: ; preds = %51, %36
br label %53
53: ; preds = %52, %29
br label %54
54: ; preds = %53, %21
br label %55
55: ; preds = %54, %18
%56 = load i64, i64* %11
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i64 %56)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"nestedLogicTestCase.test\00"
@.str.1 = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.2 = [24 x i8] c"%lu %lu %lu %lu %lu %lu\00"
@.str.6 = [5 x i8] c"%lu\0A\00"
@str = [14 x i8] c"Day not equal\00"
@str.7 = [16 x i8] c"Month not equal\00"
@str.8 = [15 x i8] c"Year not equal\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = bitcast i64* %1 to i8*
%8 = bitcast i64* %2 to i8*
%9 = bitcast i64* %3 to i8*
%10 = bitcast i64* %4 to i8*
%11 = bitcast i64* %5 to i8*
%12 = bitcast i64* %6 to i8*
%13 = load i32, i32* @stdin
%14 = tail call i32 @freopen(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %13)
%15 = call i32 @scanf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i64* %1, i64* %2, i64* %3, i64* %4, i64* %5, i64* %6)
%16 = load i64, i64* %3
%17 = load i64, i64* %6
%18 = icmp ugt i64 %16, %17
br i1 %18, label %19, label %21
19: ; preds = %0
%20 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.8, i64 0, i64 0))
br label %45
21: ; preds = %0
%22 = icmp eq i64 %16, %17
br i1 %22, label %23, label %45
23: ; preds = %21
%24 = load i64, i64* %2
%25 = load i64, i64* %5
%26 = icmp ugt i64 %24, %25
br i1 %26, label %27, label %33
27: ; preds = %23
%28 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.7, i64 0, i64 0))
%29 = load i64, i64* %2
%30 = load i64, i64* %5
%31 = sub i64 %29, %30
%32 = mul i64 %31, 500
br label %45
33: ; preds = %23
%34 = icmp eq i64 %24, %25
br i1 %34, label %35, label %45
35: ; preds = %33
%36 = load i64, i64* %1
%37 = load i64, i64* %4
%38 = icmp ugt i64 %36, %37
br i1 %38, label %39, label %45
39: ; preds = %35
%40 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%41 = load i64, i64* %1
%42 = load i64, i64* %4
%43 = sub i64 %41, %42
%44 = mul i64 %43, 15
br label %45
45: ; preds = %21, %33, %39, %35, %27, %19
%46 = phi i64 [ 10000, %19 ], [ %32, %27 ], [ %44, %39 ], [ 0, %35 ], [ 0, %33 ], [ 0, %21 ]
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i64 %46)
ret i32 0
}