#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 checkLeapYear(int);
int /*<<< orphan*/ daysToDate(int *, int *, int, int);
int findDateDifference(int, int, int, int);
int findNextTaxDay(int, int, int);
int /*<<< orphan*/ inputData(int *, int *);
int nameOfDay(int, int, int);
int /*<<< orphan*/ printData(int, int, int, int, int, int, int);
int main() {
  int numOfDays = 0;
  int years = 0;
  int isLeapYear = 0;
  int d = 0;
  int m = 0;
  int dt = 0;
  int mt = 0;
  int taxDigit = 0;
  int taxDay = 0;
  int isNextYear = 0;
  int dayDiff = 0;
  int dayDigits = 0;
  inputData(&numOfDays, &years);
  isLeapYear = checkLeapYear(years);
  daysToDate(&d, &m, numOfDays, isLeapYear);
  dayDigits = nameOfDay(d, m, years);
  taxDay = nameOfDay(15, 4, years);
  taxDigit = findNextTaxDay(taxDay, years, isLeapYear);
  daysToDate(&dt, &mt, taxDigit, isLeapYear);
  if ((numOfDays > taxDigit && taxDay < dayDigits && taxDay != 0 &&
       taxDay != 6) ||
      (m >= mt && d > dt)) {
    isNextYear++;
    taxDay = nameOfDay(15, 4, years + 1);
    isLeapYear += checkLeapYear(years + 1);
    taxDigit = findNextTaxDay(taxDay, years + 1, isLeapYear);
    daysToDate(&dt, &mt, taxDigit, isLeapYear);
  }
  dayDiff = findDateDifference(taxDigit, numOfDays, isLeapYear, isNextYear);
  printData(dayDiff, mt, dt, m, d, years, isNextYear);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1080 <inputData@plt>
mov    -0xc(%rbp),%edi
call   1030 <checkLeapYear@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    -0x14(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <daysToDate@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1090 <nameOfDay@plt>
mov    %eax,-0x34(%rbp)
mov    -0xc(%rbp),%edx
mov    $0xf,%edi
mov    $0x4,%esi
call   1090 <nameOfDay@plt>
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1050 <findNextTaxDay@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    -0x1c(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1040 <daysToDate@plt>
mov    -0x8(%rbp),%eax
cmp    -0x24(%rbp),%eax
jle    1274 <main+0x104>
mov    -0x28(%rbp),%eax
cmp    -0x34(%rbp),%eax
jge    1274 <main+0x104>
cmpl   $0x0,-0x28(%rbp)
je     1274 <main+0x104>
cmpl   $0x6,-0x28(%rbp)
jne    128c <main+0x11c>
mov    -0x18(%rbp),%eax
cmp    -0x20(%rbp),%eax
jl     12e5 <main+0x175>
mov    -0x14(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jle    12e5 <main+0x175>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
mov    -0xc(%rbp),%edx
add    $0x1,%edx
mov    $0xf,%edi
mov    $0x4,%esi
call   1090 <nameOfDay@plt>
mov    %eax,-0x28(%rbp)
mov    -0xc(%rbp),%edi
add    $0x1,%edi
call   1030 <checkLeapYear@plt>
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x28(%rbp),%edi
mov    -0xc(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1050 <findNextTaxDay@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    -0x1c(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1040 <daysToDate@plt>
mov    -0x24(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x2c(%rbp),%ecx
call   1070 <findDateDifference@plt>
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%edi
mov    -0x20(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0xc(%rbp),%r9d
mov    -0x2c(%rbp),%eax
mov    %eax,(%rsp)
call   1060 <printData@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x28,%rsp
movl   $0x0,0x24(%rsp)
movl   $0x0,0x10(%rsp)
movl   $0x0,0x20(%rsp)
movl   $0x0,0x1c(%rsp)
movl   $0x0,0x18(%rsp)
movl   $0x0,0x14(%rsp)
lea    0x24(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1080 <inputData@plt>
mov    0x10(%rsp),%edi
call   1030 <checkLeapYear@plt>
mov    %eax,%r14d
mov    0x24(%rsp),%edx
lea    0x20(%rsp),%rdi
lea    0x1c(%rsp),%rsi
mov    %eax,%ecx
call   1040 <daysToDate@plt>
mov    0x20(%rsp),%edi
mov    0x1c(%rsp),%esi
mov    0x10(%rsp),%edx
call   1090 <nameOfDay@plt>
mov    %eax,%r15d
mov    0x10(%rsp),%edx
mov    $0xf,%edi
mov    $0x4,%esi
call   1090 <nameOfDay@plt>
mov    %eax,%ebx
mov    0x10(%rsp),%esi
mov    %eax,%edi
mov    %r14d,%edx
call   1050 <findNextTaxDay@plt>
mov    %eax,%ebp
lea    0x18(%rsp),%rdi
lea    0x14(%rsp),%rsi
mov    %eax,%edx
mov    %r14d,%ecx
call   1040 <daysToDate@plt>
mov    0x24(%rsp),%esi
cmp    %r15d,%ebx
jge    123d <main+0xcd>
cmp    %ebp,%esi
jle    123d <main+0xcd>
cmp    $0x6,%ebx
je     123d <main+0xcd>
test   %ebx,%ebx
jne    1253 <main+0xe3>
mov    0x1c(%rsp),%eax
xor    %ebx,%ebx
cmp    0x14(%rsp),%eax
jl     12aa <main+0x13a>
mov    0x20(%rsp),%eax
cmp    0x18(%rsp),%eax
jle    12aa <main+0x13a>
mov    0x10(%rsp),%edx
add    $0x1,%edx
mov    $0xf,%edi
mov    $0x4,%esi
call   1090 <nameOfDay@plt>
mov    %eax,%ebx
mov    0x10(%rsp),%edi
add    $0x1,%edi
call   1030 <checkLeapYear@plt>
add    %eax,%r14d
mov    0x10(%rsp),%esi
add    $0x1,%esi
mov    %ebx,%edi
mov    %r14d,%edx
call   1050 <findNextTaxDay@plt>
mov    %eax,%ebp
lea    0x18(%rsp),%rdi
lea    0x14(%rsp),%rsi
mov    %eax,%edx
mov    %r14d,%ecx
call   1040 <daysToDate@plt>
mov    $0x1,%ebx
mov    0x24(%rsp),%esi
mov    %ebp,%edi
mov    %r14d,%edx
mov    %ebx,%ecx
call   1070 <findDateDifference@plt>
mov    0x14(%rsp),%esi
mov    0x18(%rsp),%edx
mov    0x1c(%rsp),%ecx
mov    0x20(%rsp),%r8d
mov    0x10(%rsp),%r9d
mov    %ebx,(%rsp)
mov    %eax,%edi
call   1060 <printData@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
store i32 0, i32* %10
store i32 0, i32* %11
store i32 0, i32* %12
store i32 0, i32* %13
%14 = call i32 @inputData(i32* %2, i32* %3)
%15 = load i32, i32* %3
%16 = call i32 @checkLeapYear(i32 %15)
store i32 %16, i32* %4
%17 = load i32, i32* %2
%18 = load i32, i32* %4
%19 = call i32 @daysToDate(i32* %5, i32* %6, i32 %17, i32 %18)
%20 = load i32, i32* %5
%21 = load i32, i32* %6
%22 = load i32, i32* %3
%23 = call i32 @nameOfDay(i32 %20, i32 %21, i32 %22)
store i32 %23, i32* %13
%24 = load i32, i32* %3
%25 = call i32 @nameOfDay(i32 15, i32 4, i32 %24)
store i32 %25, i32* %10
%26 = load i32, i32* %10
%27 = load i32, i32* %3
%28 = load i32, i32* %4
%29 = call i32 @findNextTaxDay(i32 %26, i32 %27, i32 %28)
store i32 %29, i32* %9
%30 = load i32, i32* %9
%31 = load i32, i32* %4
%32 = call i32 @daysToDate(i32* %7, i32* %8, i32 %30, i32 %31)
%33 = load i32, i32* %2
%34 = load i32, i32* %9
%35 = icmp sgt i32 %33, %34
br i1 %35, label %36, label %46
36: ; preds = %0
%37 = load i32, i32* %10
%38 = load i32, i32* %13
%39 = icmp slt i32 %37, %38
br i1 %39, label %40, label %46
40: ; preds = %36
%41 = load i32, i32* %10
%42 = icmp ne i32 %41, 0
br i1 %42, label %43, label %46
43: ; preds = %40
%44 = load i32, i32* %10
%45 = icmp ne i32 %44, 6
br i1 %45, label %54, label %46
46: ; preds = %43, %40, %36, %0
%47 = load i32, i32* %6
%48 = load i32, i32* %8
%49 = icmp sge i32 %47, %48
br i1 %49, label %50, label %73
50: ; preds = %46
%51 = load i32, i32* %5
%52 = load i32, i32* %7
%53 = icmp sgt i32 %51, %52
br i1 %53, label %54, label %73
54: ; preds = %50, %43
%55 = load i32, i32* %11
%56 = add nsw i32 %55, 1
store i32 %56, i32* %11
%57 = load i32, i32* %3
%58 = add nsw i32 %57, 1
%59 = call i32 @nameOfDay(i32 15, i32 4, i32 %58)
store i32 %59, i32* %10
%60 = load i32, i32* %3
%61 = add nsw i32 %60, 1
%62 = call i32 @checkLeapYear(i32 %61)
%63 = load i32, i32* %4
%64 = add nsw i32 %63, %62
store i32 %64, i32* %4
%65 = load i32, i32* %10
%66 = load i32, i32* %3
%67 = add nsw i32 %66, 1
%68 = load i32, i32* %4
%69 = call i32 @findNextTaxDay(i32 %65, i32 %67, i32 %68)
store i32 %69, i32* %9
%70 = load i32, i32* %9
%71 = load i32, i32* %4
%72 = call i32 @daysToDate(i32* %7, i32* %8, i32 %70, i32 %71)
br label %73
73: ; preds = %54, %50, %46
%74 = load i32, i32* %9
%75 = load i32, i32* %2
%76 = load i32, i32* %4
%77 = load i32, i32* %11
%78 = call i32 @findDateDifference(i32 %74, i32 %75, i32 %76, i32 %77)
store i32 %78, i32* %12
%79 = load i32, i32* %12
%80 = load i32, i32* %8
%81 = load i32, i32* %7
%82 = load i32, i32* %6
%83 = load i32, i32* %5
%84 = load i32, i32* %3
%85 = load i32, i32* %11
%86 = call i32 @printData(i32 %79, i32 %80, i32 %81, i32 %82, i32 %83, i32 %84, i32 %85)
ret i32 0
}

LLVM IR (-O2):
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*
store i32 0, i32* %1
%8 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%9 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%10 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%11 = bitcast i32* %5 to i8*
store i32 0, i32* %5
%12 = bitcast i32* %6 to i8*
store i32 0, i32* %6
%13 = call i32 @inputData(i32* %1, i32* %2)
%14 = load i32, i32* %2
%15 = call i32 @checkLeapYear(i32 %14)
%16 = load i32, i32* %1
%17 = call i32 @daysToDate(i32* %3, i32* %4, i32 %16, i32 %15)
%18 = load i32, i32* %3
%19 = load i32, i32* %4
%20 = load i32, i32* %2
%21 = call i32 @nameOfDay(i32 %18, i32 %19, i32 %20)
%22 = load i32, i32* %2
%23 = call i32 @nameOfDay(i32 15, i32 4, i32 %22)
%24 = load i32, i32* %2
%25 = call i32 @findNextTaxDay(i32 %23, i32 %24, i32 %15)
%26 = call i32 @daysToDate(i32* %5, i32* %6, i32 %25, i32 %15)
%27 = load i32, i32* %1
%28 = icmp sgt i32 %27, %25
%29 = freeze i32 %21
%30 = icmp slt i32 %23, %29
%31 = and i1 %30, %28
br i1 %31, label %32, label %33
32: ; preds = %0
switch i32 %23, label %41 [
i32 6, label %33
i32 0, label %33
]
33: ; preds = %32, %32, %0
%34 = load i32, i32* %4
%35 = load i32, i32* %6
%36 = icmp slt i32 %34, %35
br i1 %36, label %54, label %37
37: ; preds = %33
%38 = load i32, i32* %3
%39 = load i32, i32* %5
%40 = icmp sgt i32 %38, %39
br i1 %40, label %41, label %54
41: ; preds = %32, %37
%42 = load i32, i32* %2
%43 = add nsw i32 %42, 1
%44 = call i32 @nameOfDay(i32 15, i32 4, i32 %43)
%45 = load i32, i32* %2
%46 = add nsw i32 %45, 1
%47 = call i32 @checkLeapYear(i32 %46)
%48 = add nsw i32 %47, %15
%49 = load i32, i32* %2
%50 = add nsw i32 %49, 1
%51 = call i32 @findNextTaxDay(i32 %44, i32 %50, i32 %48)
%52 = call i32 @daysToDate(i32* %5, i32* %6, i32 %51, i32 %48)
%53 = load i32, i32* %1
br label %54
54: ; preds = %41, %37, %33
%55 = phi i32 [ %53, %41 ], [ %27, %37 ], [ %27, %33 ]
%56 = phi i32 [ %48, %41 ], [ %15, %37 ], [ %15, %33 ]
%57 = phi i32 [ %51, %41 ], [ %25, %37 ], [ %25, %33 ]
%58 = phi i32 [ 1, %41 ], [ 0, %37 ], [ 0, %33 ]
%59 = call i32 @findDateDifference(i32 %57, i32 %55, i32 %56, i32 %58)
%60 = load i32, i32* %6
%61 = load i32, i32* %5
%62 = load i32, i32* %4
%63 = load i32, i32* %3
%64 = load i32, i32* %2
%65 = call i32 @printData(i32 %59, i32 %60, i32 %61, i32 %62, i32 %63, i32 %64, i32 %58)
ret i32 0
}