#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 d1, m1, y1, d2, m2, y2;
  scanf("%d %d %d", &d2, &m2, &y2);
  scanf("%d %d %d", &d1, &m1, &y1);
  if (y1 != y2) {
    if (y1 < y2)
      printf("10000\n");
    else
      printf("0\n");
  } else if (m1 != m2) {
    if (m1 > m2)
      printf("0");
    else
      printf("%d", (m2 - m1) * 500);
  } else if (d1 != d2) {
    if (d1 > d2)
      printf("0");
    else
      printf("%d", (d2 - d1) * 15);
  } else
    printf("0");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
call   1040 <scanf@plt>
lea    0xeb2(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
mov    -0x10(%rbp),%eax
cmp    -0x1c(%rbp),%eax
je     119d <main+0x7d>
mov    -0x10(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    118a <main+0x6a>
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1198 <main+0x78>
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1246 <main+0x126>
mov    -0xc(%rbp),%eax
cmp    -0x18(%rbp),%eax
je     11e7 <main+0xc7>
mov    -0xc(%rbp),%eax
cmp    -0x18(%rbp),%eax
jle    11c8 <main+0xa8>
lea    0xe54(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11e2 <main+0xc2>
mov    -0x18(%rbp),%eax
sub    -0xc(%rbp),%eax
imul   $0x1f4,%eax,%esi
lea    0xe2b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1241 <main+0x121>
mov    -0x8(%rbp),%eax
cmp    -0x14(%rbp),%eax
je     122e <main+0x10e>
mov    -0x8(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    1212 <main+0xf2>
lea    0xe0a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1229 <main+0x109>
mov    -0x14(%rbp),%eax
sub    -0x8(%rbp),%eax
imul   $0xf,%eax,%esi
lea    0xde4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    123c <main+0x11c>
lea    0xddb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1241 <main+0x121>
jmp    1246 <main+0x126>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xeb4(%rip),%rbx
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0x1c(%rsp),%rsi
lea    0x18(%rsp),%rdx
lea    0x14(%rsp),%rcx
mov    %rbx,%rdi
call   1060 <scanf@plt>
mov    0x8(%rsp),%eax
cmp    %eax,0x14(%rsp)
jne    11a2 <main+0x62>
mov    0xc(%rsp),%eax
sub    0x18(%rsp),%eax
jne    11b2 <main+0x72>
mov    0x10(%rsp),%eax
sub    0x1c(%rsp),%eax
je     11b4 <main+0x74>
jl     11b4 <main+0x74>
lea    (%rax,%rax,4),%eax
lea    (%rax,%rax,2),%esi
jmp    11d4 <main+0x94>
jge    11c0 <main+0x80>
lea    0xe5e(%rip),%rdi
call   1040 <puts@plt>
jmp    11e2 <main+0xa2>
jge    11ce <main+0x8e>
mov    $0x30,%edi
call   1030 <putchar@plt>
jmp    11e2 <main+0xa2>
lea    0xe46(%rip),%rdi
call   1040 <puts@plt>
jmp    11e2 <main+0xa2>
imul   $0x1f4,%eax,%esi
lea    0xe2b(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"%d %d %d\00"
@.str.4 = [3 x i8] c"%d\00"
@str = [2 x i8] c"0\00"
@str.5 = [6 x i8] c"10000\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 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %4, i32* %5, i32* %6)
%14 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%15 = load i32, i32* %3
%16 = load i32, i32* %6
%17 = icmp eq i32 %15, %16
br i1 %17, label %24, label %18
18: ; preds = %0
%19 = icmp slt i32 %15, %16
br i1 %19, label %20, label %22
20: ; preds = %18
%21 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.5, i64 0, i64 0))
br label %50
22: ; preds = %18
%23 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
br label %50
24: ; preds = %0
%25 = load i32, i32* %2
%26 = load i32, i32* %5
%27 = icmp eq i32 %26, %25
br i1 %27, label %36, label %28
28: ; preds = %24
%29 = icmp slt i32 %26, %25
br i1 %29, label %30, label %32
30: ; preds = %28
%31 = call i32 @putchar(i32 48)
br label %50
32: ; preds = %28
%33 = sub nsw i32 %26, %25
%34 = mul nsw i32 %33, 500
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %34)
br label %50
36: ; preds = %24
%37 = load i32, i32* %1
%38 = load i32, i32* %4
%39 = icmp eq i32 %38, %37
br i1 %39, label %48, label %40
40: ; preds = %36
%41 = icmp slt i32 %38, %37
br i1 %41, label %42, label %44
42: ; preds = %40
%43 = call i32 @putchar(i32 48)
br label %50
44: ; preds = %40
%45 = sub nsw i32 %38, %37
%46 = mul nsw i32 %45, 15
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %46)
br label %50
48: ; preds = %36
%49 = call i32 @putchar(i32 48)
br label %50
50: ; preds = %32, %30, %42, %44, %48, %20, %22
ret i32 0
}