#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 isLeapYear(int);
int /*<<< orphan*/ printf(char *, int, char *, int, int, int);
void printDate(int seconds_1970, int leapYears_Num, int currentYear) {
  int temp = seconds_1970 / (60);
  int min = temp % (60);
  temp = temp / 60;
  int hours = temp % 24;
  temp = temp / 24;
  int days = (temp % 365) - leapYears_Num + 1;
  char *month;
  temp = 28 + isLeapYear(currentYear);
  if (days <= 31)
    month = "Jan";
  else if ((days -= 31) <= temp)
    month = "Feb";
  else if ((days -= temp) <= 31)
    month = "Mar";
  else if ((days -= 31) <= 30)
    month = "Apr";
  else if ((days -= 30) <= 31)
    month = "May";
  else if ((days -= 31) <= 30)
    month = "Jun";
  else if ((days -= 30) <= 31)
    month = "Jul";
  else if ((days -= 31) <= 31)
    month = "Aug";
  else if ((days -= 31) <= 30)
    month = "Sep";
  else if ((days -= 30) <= 31)
    month = "Oct";
  else if ((days -= 31) <= 30)
    month = "Nov";
  else {
    month = "Dec";
    days -= 30;
  }
  printf("Today is %d %s %d and Time is %d:%d in GMT\n\n", days, month,
         currentYear, hours, min);
}


x86 assembly (clang, -O0):
<printDate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x18,%ecx
cltd
idiv   %ecx
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x18,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x16d,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
sub    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <isLeapYear@plt>
add    $0x1c,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x1f,-0x1c(%rbp)
jg     11b5 <printDate+0x95>
lea    0xe54(%rip),%rax
mov    %rax,-0x28(%rbp)
jmp    1351 <printDate+0x231>
mov    -0x1c(%rbp),%eax
sub    $0x1f,%eax
mov    %eax,-0x1c(%rbp)
cmp    -0x10(%rbp),%eax
jg     11d7 <printDate+0xb7>
lea    0xe36(%rip),%rax
mov    %rax,-0x28(%rbp)
jmp    134c <printDate+0x22c>
mov    -0x10(%rbp),%ecx
mov    -0x1c(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x1c(%rbp)
cmp    $0x1f,%eax
jg     11fb <printDate+0xdb>
lea    0xe16(%rip),%rax
mov    %rax,-0x28(%rbp)
jmp    1347 <printDate+0x227>
mov    -0x1c(%rbp),%eax
sub    $0x1f,%eax
mov    %eax,-0x1c(%rbp)
cmp    $0x1e,%eax
jg     121d <printDate+0xfd>
lea    0xdf8(%rip),%rax
mov    %rax,-0x28(%rbp)
jmp    1342 <printDate+0x222>
mov    -0x1c(%rbp),%eax
sub    $0x1e,%eax
mov    %eax,-0x1c(%rbp)
cmp    $0x1f,%eax
jg     123f <printDate+0x11f>
lea    0xdda(%rip),%rax
mov    %rax,-0x28(%rbp)
jmp    133d <printDate+0x21d>
mov    -0x1c(%rbp),%eax
sub    $0x1f,%eax
mov    %eax,-0x1c(%rbp)
cmp    $0x1e,%eax
jg     1261 <printDate+0x141>
lea    0xdbc(%rip),%rax
mov    %rax,-0x28(%rbp)
jmp    1338 <printDate+0x218>
mov    -0x1c(%rbp),%eax
sub    $0x1e,%eax
mov    %eax,-0x1c(%rbp)
cmp    $0x1f,%eax
jg     1283 <printDate+0x163>
lea    0xd9e(%rip),%rax
mov    %rax,-0x28(%rbp)
jmp    1333 <printDate+0x213>
mov    -0x1c(%rbp),%eax
sub    $0x1f,%eax
mov    %eax,-0x1c(%rbp)
cmp    $0x1f,%eax
jg     12a5 <printDate+0x185>
lea    0xd80(%rip),%rax
mov    %rax,-0x28(%rbp)
jmp    132e <printDate+0x20e>
mov    -0x1c(%rbp),%eax
sub    $0x1f,%eax
mov    %eax,-0x1c(%rbp)
cmp    $0x1e,%eax
jg     12c7 <printDate+0x1a7>
lea    0xd62(%rip),%rax
mov    %rax,-0x28(%rbp)
jmp    1329 <printDate+0x209>
mov    -0x1c(%rbp),%eax
sub    $0x1e,%eax
mov    %eax,-0x1c(%rbp)
cmp    $0x1f,%eax
jg     12e9 <printDate+0x1c9>
lea    0xd44(%rip),%rax
mov    %rax,-0x28(%rbp)
jmp    1324 <printDate+0x204>
mov    -0x1c(%rbp),%eax
sub    $0x1f,%eax
mov    %eax,-0x1c(%rbp)
cmp    $0x1e,%eax
jg     130b <printDate+0x1eb>
lea    0xd26(%rip),%rax
mov    %rax,-0x28(%rbp)
jmp    131f <printDate+0x1ff>
lea    0xd1a(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    -0x1c(%rbp),%eax
sub    $0x1e,%eax
mov    %eax,-0x1c(%rbp)
jmp    1324 <printDate+0x204>
jmp    1329 <printDate+0x209>
jmp    132e <printDate+0x20e>
jmp    1333 <printDate+0x213>
jmp    1338 <printDate+0x218>
jmp    133d <printDate+0x21d>
jmp    1342 <printDate+0x222>
jmp    1347 <printDate+0x227>
jmp    134c <printDate+0x22c>
jmp    1351 <printDate+0x231>
mov    -0x1c(%rbp),%esi
mov    -0x28(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x14(%rbp),%r9d
lea    0xcc6(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printDate>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
movslq %edi,%rbx
imul   $0xffffffffc22e4507,%rbx,%rax
shr    $0x20,%rax
add    %ebx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x10,%eax
add    %ecx,%eax
movswl %ax,%ecx
imul   $0x59c7,%ecx,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x17,%ecx
add    %edx,%ecx
imul   $0x16d,%ecx,%ecx
sub    %ecx,%eax
movswl %ax,%ebp
sub    %esi,%ebp
mov    %r14d,%edi
call   1040 <isLeapYear@plt>
cmp    $0x1e,%ebp
jg     117d <printDate+0x5d>
add    $0x1,%ebp
lea    0xe88(%rip),%rdx
jmp    125e <printDate+0x13e>
add    $0x1c,%eax
add    $0xffffffe2,%ebp
mov    %ebp,%ecx
sub    %eax,%ecx
jle    119a <printDate+0x7a>
cmp    $0x20,%ecx
jge    11a6 <printDate+0x86>
lea    0xe73(%rip),%rdx
jmp    125c <printDate+0x13c>
lea    0xe63(%rip),%rdx
jmp    125e <printDate+0x13e>
cmp    $0x3d,%ecx
ja     11ba <printDate+0x9a>
add    $0xffffffe1,%ecx
lea    0xe57(%rip),%rdx
jmp    125c <printDate+0x13c>
cmp    $0x5c,%ecx
ja     11ce <printDate+0xae>
add    $0xffffffc3,%ecx
lea    0xe47(%rip),%rdx
jmp    125c <printDate+0x13c>
cmp    $0x7a,%ecx
ja     11df <printDate+0xbf>
add    $0xffffffa4,%ecx
lea    0xe37(%rip),%rdx
jmp    125c <printDate+0x13c>
cmp    $0x99,%ecx
ja     11f3 <printDate+0xd3>
add    $0xffffff86,%ecx
lea    0xe27(%rip),%rdx
jmp    125c <printDate+0x13c>
cmp    $0xb8,%ecx
ja     120a <printDate+0xea>
add    $0xffffff67,%ecx
lea    0xe14(%rip),%rdx
jmp    125c <printDate+0x13c>
cmp    $0xd6,%ecx
ja     1221 <printDate+0x101>
add    $0xffffff48,%ecx
lea    0xe01(%rip),%rdx
jmp    125c <printDate+0x13c>
cmp    $0xf5,%ecx
ja     1238 <printDate+0x118>
add    $0xffffff2a,%ecx
lea    0xdee(%rip),%rdx
jmp    125c <printDate+0x13c>
cmp    $0x113,%ecx
ja     124f <printDate+0x12f>
add    $0xffffff0b,%ecx
lea    0xddb(%rip),%rdx
jmp    125c <printDate+0x13c>
add    $0xfffffeed,%ecx
lea    0xdd0(%rip),%rdx
mov    %ecx,%ebp
imul   $0xffffffff91a2b3c5,%rbx,%rax
shr    $0x20,%rax
add    %ebx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0xb,%eax
add    %ecx,%eax
movslq %eax,%r8
imul   $0x2aaaaaab,%r8,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x22,%rax
add    %ecx,%eax
shl    $0x3,%eax
lea    (%rax,%rax,2),%eax
sub    %eax,%r8d
imul   $0xffffffff88888889,%rbx,%rax
shr    $0x20,%rax
add    %ebx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x5,%eax
add    %ecx,%eax
movslq %eax,%r9
imul   $0xffffffff88888889,%r9,%rax
shr    $0x20,%rax
add    %r9d,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x5,%eax
add    %ecx,%eax
imul   $0x3c,%eax,%eax
sub    %eax,%r9d
lea    0xd5c(%rip),%rdi
mov    %ebp,%esi
mov    %r14d,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"Jan\00"
@.str.1 = [4 x i8] c"Feb\00"
@.str.2 = [4 x i8] c"Mar\00"
@.str.3 = [4 x i8] c"Apr\00"
@.str.4 = [4 x i8] c"May\00"
@.str.5 = [4 x i8] c"Jun\00"
@.str.6 = [4 x i8] c"Jul\00"
@.str.7 = [4 x i8] c"Aug\00"
@.str.8 = [4 x i8] c"Sep\00"
@.str.9 = [4 x i8] c"Oct\00"
@.str.10 = [4 x i8] c"Nov\00"
@.str.11 = [4 x i8] c"Dec\00"
@.str.12 = [45 x i8] c"Today is %d %s %d and Time is %d:%d in GMT\0A\0A\00"
define void @printDate(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%12 = load i32, i32* %4
%13 = sdiv i32 %12, 60
store i32 %13, i32* %7
%14 = load i32, i32* %7
%15 = srem i32 %14, 60
store i32 %15, i32* %8
%16 = load i32, i32* %7
%17 = sdiv i32 %16, 60
store i32 %17, i32* %7
%18 = load i32, i32* %7
%19 = srem i32 %18, 24
store i32 %19, i32* %9
%20 = load i32, i32* %7
%21 = sdiv i32 %20, 24
store i32 %21, i32* %7
%22 = load i32, i32* %7
%23 = srem i32 %22, 365
%24 = load i32, i32* %5
%25 = sub nsw i32 %23, %24
%26 = add nsw i32 %25, 1
store i32 %26, i32* %10
%27 = load i32, i32* %6
%28 = call i32 @isLeapYear(i32 %27)
%29 = add nsw i32 28, %28
store i32 %29, i32* %7
%30 = load i32, i32* %10
%31 = icmp sle i32 %30, 31
br i1 %31, label %32, label %33
32: ; preds = %3
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %11
br label %98
33: ; preds = %3
%34 = load i32, i32* %10
%35 = sub nsw i32 %34, 31
store i32 %35, i32* %10
%36 = load i32, i32* %7
%37 = icmp sle i32 %35, %36
br i1 %37, label %38, label %39
38: ; preds = %33
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %11
br label %97
39: ; preds = %33
%40 = load i32, i32* %7
%41 = load i32, i32* %10
%42 = sub nsw i32 %41, %40
store i32 %42, i32* %10
%43 = icmp sle i32 %42, 31
br i1 %43, label %44, label %45
44: ; preds = %39
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8** %11
br label %96
45: ; preds = %39
%46 = load i32, i32* %10
%47 = sub nsw i32 %46, 31
store i32 %47, i32* %10
%48 = icmp sle i32 %47, 30
br i1 %48, label %49, label %50
49: ; preds = %45
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8** %11
br label %95
50: ; preds = %45
%51 = load i32, i32* %10
%52 = sub nsw i32 %51, 30
store i32 %52, i32* %10
%53 = icmp sle i32 %52, 31
br i1 %53, label %54, label %55
54: ; preds = %50
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8** %11
br label %94
55: ; preds = %50
%56 = load i32, i32* %10
%57 = sub nsw i32 %56, 31
store i32 %57, i32* %10
%58 = icmp sle i32 %57, 30
br i1 %58, label %59, label %60
59: ; preds = %55
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8** %11
br label %93
60: ; preds = %55
%61 = load i32, i32* %10
%62 = sub nsw i32 %61, 30
store i32 %62, i32* %10
%63 = icmp sle i32 %62, 31
br i1 %63, label %64, label %65
64: ; preds = %60
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8** %11
br label %92
65: ; preds = %60
%66 = load i32, i32* %10
%67 = sub nsw i32 %66, 31
store i32 %67, i32* %10
%68 = icmp sle i32 %67, 31
br i1 %68, label %69, label %70
69: ; preds = %65
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8** %11
br label %91
70: ; preds = %65
%71 = load i32, i32* %10
%72 = sub nsw i32 %71, 31
store i32 %72, i32* %10
%73 = icmp sle i32 %72, 30
br i1 %73, label %74, label %75
74: ; preds = %70
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i8** %11
br label %90
75: ; preds = %70
%76 = load i32, i32* %10
%77 = sub nsw i32 %76, 30
store i32 %77, i32* %10
%78 = icmp sle i32 %77, 31
br i1 %78, label %79, label %80
79: ; preds = %75
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i8** %11
br label %89
80: ; preds = %75
%81 = load i32, i32* %10
%82 = sub nsw i32 %81, 31
store i32 %82, i32* %10
%83 = icmp sle i32 %82, 30
br i1 %83, label %84, label %85
84: ; preds = %80
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i8** %11
br label %88
85: ; preds = %80
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i8** %11
%86 = load i32, i32* %10
%87 = sub nsw i32 %86, 30
store i32 %87, i32* %10
br label %88
88: ; preds = %85, %84
br label %89
89: ; preds = %88, %79
br label %90
90: ; preds = %89, %74
br label %91
91: ; preds = %90, %69
br label %92
92: ; preds = %91, %64
br label %93
93: ; preds = %92, %59
br label %94
94: ; preds = %93, %54
br label %95
95: ; preds = %94, %49
br label %96
96: ; preds = %95, %44
br label %97
97: ; preds = %96, %38
br label %98
98: ; preds = %97, %32
%99 = load i32, i32* %10
%100 = load i8*, i8** %11
%101 = load i32, i32* %6
%102 = load i32, i32* %9
%103 = load i32, i32* %8
%104 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.12, i64 0, i64 0), i32 %99, i8* %100, i32 %101, i32 %102, i32 %103)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"Jan\00"
@.str.1 = [4 x i8] c"Feb\00"
@.str.2 = [4 x i8] c"Mar\00"
@.str.3 = [4 x i8] c"Apr\00"
@.str.4 = [4 x i8] c"May\00"
@.str.5 = [4 x i8] c"Jun\00"
@.str.6 = [4 x i8] c"Jul\00"
@.str.7 = [4 x i8] c"Aug\00"
@.str.8 = [4 x i8] c"Sep\00"
@.str.9 = [4 x i8] c"Oct\00"
@.str.10 = [4 x i8] c"Nov\00"
@.str.11 = [4 x i8] c"Dec\00"
@.str.12 = [45 x i8] c"Today is %d %s %d and Time is %d:%d in GMT\0A\0A\00"
define void @printDate(i32 %0, i32 %1, i32 %2) {
%4 = sdiv i32 %0, 86400
%5 = trunc i32 %4 to i16
%6 = srem i16 %5, 365
%7 = sext i16 %6 to i32
%8 = sub nsw i32 %7, %1
%9 = tail call i32 @isLeapYear(i32 %2)
%10 = add nsw i32 %9, 28
%11 = icmp slt i32 %8, 31
br i1 %11, label %12, label %14
12: ; preds = %3
%13 = add nsw i32 %8, 1
br label %54
14: ; preds = %3
%15 = add nsw i32 %8, -30
%16 = icmp sgt i32 %15, %10
br i1 %16, label %17, label %54
17: ; preds = %14
%18 = sub nsw i32 %15, %10
%19 = icmp slt i32 %18, 32
br i1 %19, label %54, label %20
20: ; preds = %17
%21 = icmp ult i32 %18, 62
br i1 %21, label %22, label %24
22: ; preds = %20
%23 = add nsw i32 %18, -31
br label %54
24: ; preds = %20
%25 = icmp ult i32 %18, 93
br i1 %25, label %26, label %28
26: ; preds = %24
%27 = add nsw i32 %18, -61
br label %54
28: ; preds = %24
%29 = icmp ult i32 %18, 123
br i1 %29, label %30, label %32
30: ; preds = %28
%31 = add nsw i32 %18, -92
br label %54
32: ; preds = %28
%33 = icmp ult i32 %18, 154
br i1 %33, label %34, label %36
34: ; preds = %32
%35 = add nsw i32 %18, -122
br label %54
36: ; preds = %32
%37 = icmp ult i32 %18, 185
br i1 %37, label %38, label %40
38: ; preds = %36
%39 = add nsw i32 %18, -153
br label %54
40: ; preds = %36
%41 = icmp ult i32 %18, 215
br i1 %41, label %42, label %44
42: ; preds = %40
%43 = add nsw i32 %18, -184
br label %54
44: ; preds = %40
%45 = icmp ult i32 %18, 246
br i1 %45, label %46, label %48
46: ; preds = %44
%47 = add nsw i32 %18, -214
br label %54
48: ; preds = %44
%49 = icmp ult i32 %18, 276
br i1 %49, label %50, label %52
50: ; preds = %48
%51 = add nsw i32 %18, -245
br label %54
52: ; preds = %48
%53 = add nsw i32 %18, -275
br label %54
54: ; preds = %17, %14, %22, %30, %38, %46, %52, %50, %42, %34, %26, %12
%55 = phi i32 [ %13, %12 ], [ %23, %22 ], [ %27, %26 ], [ %31, %30 ], [ %35, %34 ], [ %39, %38 ], [ %43, %42 ], [ %47, %46 ], [ %51, %50 ], [ %53, %52 ], [ %15, %14 ], [ %18, %17 ]
%56 = phi i8* [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), %12 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), %22 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), %26 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), %30 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), %34 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), %38 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), %42 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), %46 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), %50 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), %52 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), %14 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), %17 ]
%57 = sdiv i32 %0, 3600
%58 = srem i32 %57, 24
%59 = sdiv i32 %0, 60
%60 = srem i32 %59, 60
%61 = tail call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.12, i64 0, i64 0), i32 %55, i8* %56, i32 %2, i32 %58, i32 %60)
ret void
}