#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);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
int main() {
  int year, month, day;
  int cday;
  scanf("%d %d %d", &year, &month, &day);
  switch (month) {
  case 1:
    cday = 0;
    break;
  case 2:
    cday = 31;
    break;
  case 3:
    cday = 31 + 28;
    break;
  case 4:
    cday = 31 + 28 + 31;
    break;
  case 5:
    cday = 31 + 28 + 31 + 30;
    break;
  case 6:
    cday = 31 + 28 + 31 + 30 + 31;
    break;
  case 7:
    cday = 31 + 28 + 31 + 30 + 31 + 30;
    break;
  case 8:
    cday = 31 + 28 + 31 + 30 + 31 + 30 + 31;
    break;
  case 9:
    cday = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31;
    break;
  case 10:
    cday = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30;
    break;
  case 11:
    cday = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;
    break;
  case 12:
    cday = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;
    break;
  }
  cday += day;
  if ((year % 4 == 0 && year % 100 != 0 || year % 400 == 0) && month > 2) {
    cday += 1;
  }
  printf("%d\n", cday);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xefa(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x20(%rbp)
sub    $0xb,%eax
ja     11fb <main+0xdb>
mov    -0x20(%rbp),%rax
lea    0xe99(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x14(%rbp)
jmp    11fb <main+0xdb>
movl   $0x1f,-0x14(%rbp)
jmp    11fb <main+0xdb>
movl   $0x3b,-0x14(%rbp)
jmp    11fb <main+0xdb>
movl   $0x5a,-0x14(%rbp)
jmp    11fb <main+0xdb>
movl   $0x78,-0x14(%rbp)
jmp    11fb <main+0xdb>
movl   $0x97,-0x14(%rbp)
jmp    11fb <main+0xdb>
movl   $0xb5,-0x14(%rbp)
jmp    11fb <main+0xdb>
movl   $0xd4,-0x14(%rbp)
jmp    11fb <main+0xdb>
movl   $0xf3,-0x14(%rbp)
jmp    11fb <main+0xdb>
movl   $0x111,-0x14(%rbp)
jmp    11fb <main+0xdb>
movl   $0x130,-0x14(%rbp)
jmp    11fb <main+0xdb>
movl   $0x14e,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    122c <main+0x10c>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1240 <main+0x120>
mov    -0x8(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1253 <main+0x133>
cmpl   $0x2,-0xc(%rbp)
jle    1253 <main+0x133>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xddc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <scanf@plt>
mov    0x10(%rsp),%eax
lea    -0x2(%rax),%ecx
xor    %esi,%esi
cmp    $0xa,%ecx
ja     115a <main+0x3a>
movslq %ecx,%rcx
lea    0xeb9(%rip),%rdx
mov    (%rdx,%rcx,4),%esi
add    0xc(%rsp),%esi
movslq 0x14(%rsp),%rcx
test   $0x3,%cl
jne    118c <main+0x6c>
imul   $0x51eb851f,%rcx,%rdx
mov    %rdx,%rdi
shr    $0x3f,%rdi
sar    $0x25,%rdx
add    %edi,%edx
imul   $0x64,%edx,%edx
mov    %ecx,%edi
sub    %edx,%edi
je     118c <main+0x6c>
cmp    $0x3,%eax
jge    11a8 <main+0x88>
jmp    11ab <main+0x8b>
imul   $0xc28f5c29,%ecx,%ecx
add    $0x51eb850,%ecx
ror    $0x4,%ecx
cmp    $0xa3d70a,%ecx
ja     11ab <main+0x8b>
cmp    $0x2,%eax
jle    11ab <main+0x8b>
add    $0x1,%esi
lea    0xe57(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%d %d %d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%7 = load i32, i32* %3
switch i32 %7, label %20 [
i32 1, label %8
i32 2, label %9
i32 3, label %10
i32 4, label %11
i32 5, label %12
i32 6, label %13
i32 7, label %14
i32 8, label %15
i32 9, label %16
i32 10, label %17
i32 11, label %18
i32 12, label %19
]
8: ; preds = %0
store i32 0, i32* %5
br label %20
9: ; preds = %0
store i32 31, i32* %5
br label %20
10: ; preds = %0
store i32 59, i32* %5
br label %20
11: ; preds = %0
store i32 90, i32* %5
br label %20
12: ; preds = %0
store i32 120, i32* %5
br label %20
13: ; preds = %0
store i32 151, i32* %5
br label %20
14: ; preds = %0
store i32 181, i32* %5
br label %20
15: ; preds = %0
store i32 212, i32* %5
br label %20
16: ; preds = %0
store i32 243, i32* %5
br label %20
17: ; preds = %0
store i32 273, i32* %5
br label %20
18: ; preds = %0
store i32 304, i32* %5
br label %20
19: ; preds = %0
store i32 334, i32* %5
br label %20
20: ; preds = %0, %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8
%21 = load i32, i32* %4
%22 = load i32, i32* %5
%23 = add nsw i32 %22, %21
store i32 %23, i32* %5
%24 = load i32, i32* %2
%25 = srem i32 %24, 4
%26 = icmp eq i32 %25, 0
br i1 %26, label %27, label %31
27: ; preds = %20
%28 = load i32, i32* %2
%29 = srem i32 %28, 100
%30 = icmp ne i32 %29, 0
br i1 %30, label %35, label %31
31: ; preds = %27, %20
%32 = load i32, i32* %2
%33 = srem i32 %32, 400
%34 = icmp eq i32 %33, 0
br i1 %34, label %35, label %41
35: ; preds = %31, %27
%36 = load i32, i32* %3
%37 = icmp sgt i32 %36, 2
br i1 %37, label %38, label %41
38: ; preds = %35
%39 = load i32, i32* %5
%40 = add nsw i32 %39, 1
store i32 %40, i32* %5
br label %41
41: ; preds = %38, %35, %31
%42 = load i32, i32* %5
%43 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %42)
%44 = load i32, i32* %1
ret i32 %44
}

LLVM IR (-O2):
@.str = [9 x i8] c"%d %d %d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
@switch.table.main = [11 x i32] [i32 31, i32 59, i32 90, i32 120, i32 151, i32 181, i32 212, i32 243, i32 273, i32 304, i32 334]
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%8 = load i32, i32* %2
%9 = add i32 %8, -2
%10 = icmp ult i32 %9, 11
br i1 %10, label %11, label %15
11: ; preds = %0
%12 = sext i32 %9 to i64
%13 = getelementptr inbounds [11 x i32], [11 x i32]* @switch.table.main, i64 0, i64 %12
%14 = load i32, i32* %13
br label %15
15: ; preds = %11, %0
%16 = phi i32 [ 0, %0 ], [ %14, %11 ]
%17 = load i32, i32* %3
%18 = add nsw i32 %17, %16
%19 = load i32, i32* %1
%20 = and i32 %19, 3
%21 = icmp ne i32 %20, 0
%22 = srem i32 %19, 100
%23 = icmp eq i32 %22, 0
%24 = or i1 %21, %23
br i1 %24, label %25, label %30
25: ; preds = %15
%26 = srem i32 %19, 400
%27 = icmp eq i32 %26, 0
%28 = icmp sgt i32 %8, 2
%29 = select i1 %27, i1 %28, i1 false
br i1 %29, label %32, label %34
30: ; preds = %15
%31 = icmp sgt i32 %8, 2
br i1 %31, label %32, label %34
32: ; preds = %25, %30
%33 = add nsw i32 %18, 1
br label %34
34: ; preds = %32, %30, %25
%35 = phi i32 [ %33, %32 ], [ %18, %30 ], [ %18, %25 ]
%36 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %35)
ret i32 0
}