#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 main() {
  int day, month, year, leapYear;
  day = 0;
  month = 0;
  year = 0;
  leapYear = 0;
  printf("\nPlease enter a year: ");
  scanf("%d", &year);
  if ((year % 400 == 0) || (year % 4 == 0 && year % 100 > 0)) {
    leapYear = 1;
  } else {
    leapYear = 0;
  }
  printf("\nPlease enter a month: ");
  scanf("%d", &month);
  while (month < 1 || month > 12) {
    printf("\nError - the month that you entered is not possible.");
    printf("\nPlease enter a correct month between 1 and 12: ");
    scanf("%d", &month);
  }
  printf("\nPlease enter a day: ");
  scanf("%d", &day);
  switch (month) {
  case 1:
  case 3:
  case 5:
  case 7:
  case 8:
  case 10:
  case 12:
    while (day < 1 || day > 31) {
      printf("\nError - the day that you entered is not possible.");
      printf("\nPlease enter a correct day between 1 and 31: ");
      scanf("%d", &day);
    }
    break;
  case 2:
    if (leapYear == 1) {
      while (day < 1 || day > 29) {
        printf("\nError - the day that you entered is not possible.");
        printf("\nPlease enter a correct day between 1 and 29: ");
        scanf("%d", &day);
      }
      break;
    } else {
      while (day < 1 || day > 28) {
        printf("\nError - the day that you entered is not possible.");
        printf("\nPlease enter a correct day between 1 and 28: ");
        scanf("%d", &day);
      }
      break;
    }
  case 4:
  case 6:
  case 9:
  case 11:
    while (day < 1 || day > 30) {
      printf("\nError - the day that you entered is not possible.");
      printf("\nPlease enter a correct day between 1 and 30: ");
      scanf("%d", &day);
    }
  }
  printf("\nYou entered, %d/%d/%d. (day/month/year)\n", day, month, year);
  if (leapYear == 1) {
    printf("\nYour year, %d, is a leap year.\n", year);
  } else
    printf("\nYour year, %d, is not a leap year.\n", year);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb7(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x10(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     11a5 <main+0x85>
mov    -0x10(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11b1 <main+0x91>
mov    -0x10(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jle    11b1 <main+0x91>
movl   $0x1,-0x14(%rbp)
jmp    11b8 <main+0x98>
movl   $0x0,-0x14(%rbp)
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe4a(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    $0x1,%al
cmpl   $0x1,-0xc(%rbp)
mov    %al,-0x15(%rbp)
jl     11ef <main+0xcf>
cmpl   $0xc,-0xc(%rbp)
setg   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    11ff <main+0xdf>
jmp    1230 <main+0x110>
lea    0xe2c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe53(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdf5(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
jmp    11d6 <main+0xb6>
lea    0xe61(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xdd2(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
sub    $0x1,%eax
je     130f <main+0x1ef>
jmp    1262 <main+0x142>
mov    -0x1c(%rbp),%eax
sub    $0x2,%eax
je     1373 <main+0x253>
jmp    1273 <main+0x153>
mov    -0x1c(%rbp),%eax
sub    $0x3,%eax
je     130f <main+0x1ef>
jmp    1284 <main+0x164>
mov    -0x1c(%rbp),%eax
sub    $0x4,%eax
je     1445 <main+0x325>
jmp    1295 <main+0x175>
mov    -0x1c(%rbp),%eax
sub    $0x5,%eax
je     130f <main+0x1ef>
jmp    12a6 <main+0x186>
mov    -0x1c(%rbp),%eax
sub    $0x6,%eax
je     1445 <main+0x325>
jmp    12b7 <main+0x197>
mov    -0x1c(%rbp),%eax
add    $0xfffffff9,%eax
sub    $0x2,%eax
jb     130f <main+0x1ef>
jmp    12cb <main+0x1ab>
mov    -0x1c(%rbp),%eax
sub    $0x9,%eax
je     1445 <main+0x325>
jmp    12dc <main+0x1bc>
mov    -0x1c(%rbp),%eax
sub    $0xa,%eax
je     130f <main+0x1ef>
jmp    12ed <main+0x1cd>
mov    -0x1c(%rbp),%eax
sub    $0xb,%eax
je     1445 <main+0x325>
jmp    12fe <main+0x1de>
mov    -0x1c(%rbp),%eax
sub    $0xc,%eax
jne    14a9 <main+0x389>
jmp    130f <main+0x1ef>
jmp    1314 <main+0x1f4>
mov    $0x1,%al
cmpl   $0x1,-0x8(%rbp)
mov    %al,-0x1d(%rbp)
jl     132d <main+0x20d>
cmpl   $0x1f,-0x8(%rbp)
setg   %al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%al
test   $0x1,%al
jne    133d <main+0x21d>
jmp    136e <main+0x24e>
lea    0xd6a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xd8f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xcb7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
jmp    1314 <main+0x1f4>
jmp    14a9 <main+0x389>
cmpl   $0x1,-0x14(%rbp)
jne    13e1 <main+0x2c1>
jmp    1382 <main+0x262>
mov    $0x1,%al
cmpl   $0x1,-0x8(%rbp)
mov    %al,-0x1e(%rbp)
jl     139b <main+0x27b>
cmpl   $0x1d,-0x8(%rbp)
setg   %al
mov    %al,-0x1e(%rbp)
mov    -0x1e(%rbp),%al
test   $0x1,%al
jne    13ab <main+0x28b>
jmp    13dc <main+0x2bc>
lea    0xcfc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xd50(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xc49(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
jmp    1382 <main+0x262>
jmp    14a9 <main+0x389>
jmp    13e6 <main+0x2c6>
mov    $0x1,%al
cmpl   $0x1,-0x8(%rbp)
mov    %al,-0x1f(%rbp)
jl     13ff <main+0x2df>
cmpl   $0x1c,-0x8(%rbp)
setg   %al
mov    %al,-0x1f(%rbp)
mov    -0x1f(%rbp),%al
test   $0x1,%al
jne    140f <main+0x2ef>
jmp    1440 <main+0x320>
lea    0xc98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xd1b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xbe5(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
jmp    13e6 <main+0x2c6>
jmp    14a9 <main+0x389>
jmp    144a <main+0x32a>
mov    $0x1,%al
cmpl   $0x1,-0x8(%rbp)
mov    %al,-0x20(%rbp)
jl     1463 <main+0x343>
cmpl   $0x1e,-0x8(%rbp)
setg   %al
mov    %al,-0x20(%rbp)
mov    -0x20(%rbp),%al
test   $0x1,%al
jne    1473 <main+0x353>
jmp    14a4 <main+0x384>
lea    0xc34(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xce6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xb81(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
jmp    144a <main+0x32a>
jmp    14a9 <main+0x389>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xce4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x1,-0x14(%rbp)
jne    14e0 <main+0x3c0>
mov    -0x10(%rbp),%esi
lea    0xcf3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    14f1 <main+0x3d1>
mov    -0x10(%rbp),%esi
lea    0xcfe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0x4(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x0,0xc(%rsp)
lea    0xeb5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
imul   $0xc28f5c29,%eax,%ecx
add    $0x51eb850,%ecx
ror    $0x4,%ecx
cmp    $0xa3d70b,%ecx
jb     11aa <main+0x8a>
test   $0x3,%al
sete   %cl
movslq %eax,%rdx
imul   $0x51eb851f,%rdx,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
sar    $0x25,%rdx
add    %esi,%edx
imul   $0x64,%edx,%edx
sub    %edx,%eax
test   %eax,%eax
setg   %bpl
and    %cl,%bpl
jmp    11ad <main+0x8d>
mov    $0x1,%bpl
lea    0xe66(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe55(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x8(%rsp),%eax
add    $0xfffffff3,%eax
cmp    $0xfffffff3,%eax
ja     122b <main+0x10b>
lea    0xe53(%rip),%r14
lea    0xe81(%rip),%r15
lea    0xe2a(%rip),%r12
lea    0x8(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    0x8(%rsp),%eax
add    $0xfffffff3,%eax
cmp    $0xfffffff4,%eax
jb     1200 <main+0xe0>
lea    0xe66(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xdd7(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x8(%rsp),%eax
cmp    $0xc,%eax
ja     139d <main+0x27d>
mov    $0x15aa,%ecx
bt     %eax,%ecx
jae    12c0 <main+0x1a0>
mov    0x4(%rsp),%esi
lea    -0x20(%rsi),%eax
cmp    $0xffffffe0,%eax
ja     13fb <main+0x2db>
lea    0xe36(%rip),%r14
lea    0xe62(%rip),%r15
lea    0xd91(%rip),%r12
lea    0x4(%rsp),%rbx
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
lea    -0x20(%rsi),%eax
cmp    $0xffffffe1,%eax
jb     1290 <main+0x170>
jmp    13fb <main+0x2db>
mov    $0xa50,%ecx
bt     %eax,%ecx
jae    1330 <main+0x210>
mov    0x4(%rsp),%esi
lea    -0x1f(%rsi),%eax
cmp    $0xffffffe1,%eax
ja     13fb <main+0x2db>
lea    0xdcd(%rip),%r14
lea    0xe86(%rip),%r15
lea    0xd28(%rip),%r12
lea    0x4(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
lea    -0x1f(%rsi),%eax
cmp    $0xffffffe2,%eax
jb     1300 <main+0x1e0>
jmp    13fb <main+0x2db>
cmp    $0x2,%eax
jne    139d <main+0x27d>
mov    0x4(%rsp),%esi
test   %bpl,%bpl
je     13a3 <main+0x283>
lea    -0x1e(%rsi),%eax
cmp    $0xffffffe2,%eax
ja     1423 <main+0x303>
lea    0xd5d(%rip),%r14
lea    0xdb8(%rip),%r15
lea    0xcb8(%rip),%r12
lea    0x4(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
lea    -0x1e(%rsi),%eax
cmp    $0xffffffe3,%eax
jb     1370 <main+0x250>
jmp    13fb <main+0x2db>
mov    0x4(%rsp),%esi
jmp    13fb <main+0x2db>
lea    -0x1d(%rsi),%eax
cmp    $0xffffffe3,%eax
ja     143b <main+0x31b>
lea    0xcf8(%rip),%r14
lea    0xd82(%rip),%r15
lea    0xc53(%rip),%r12
lea    0x4(%rsp),%rbx
nopl   0x0(%rax)
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
lea    -0x1d(%rsi),%eax
cmp    $0xffffffe4,%eax
jb     13d0 <main+0x2b0>
mov    0x8(%rsp),%edx
mov    0xc(%rsp),%ecx
lea    0xd93(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
test   %bpl,%bpl
je     1451 <main+0x331>
mov    0xc(%rsp),%esi
lea    0xda6(%rip),%rdi
jmp    145c <main+0x33c>
mov    0x8(%rsp),%edx
mov    0xc(%rsp),%ecx
lea    0xd6b(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    1416 <main+0x2f6>
mov    0x8(%rsp),%edx
mov    0xc(%rsp),%ecx
lea    0xd53(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
lea    0xd8c(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [23 x i8] c"\0APlease enter a year: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [24 x i8] c"\0APlease enter a month: \00"
@.str.3 = [53 x i8] c"\0AError - the month that you entered is not possible.\00"
@.str.4 = [49 x i8] c"\0APlease enter a correct month between 1 and 12: \00"
@.str.5 = [22 x i8] c"\0APlease enter a day: \00"
@.str.6 = [51 x i8] c"\0AError - the day that you entered is not possible.\00"
@.str.7 = [47 x i8] c"\0APlease enter a correct day between 1 and 31: \00"
@.str.8 = [47 x i8] c"\0APlease enter a correct day between 1 and 29: \00"
@.str.9 = [47 x i8] c"\0APlease enter a correct day between 1 and 28: \00"
@.str.10 = [47 x i8] c"\0APlease enter a correct day between 1 and 30: \00"
@.str.11 = [42 x i8] c"\0AYou entered, %d/%d/%d. (day/month/year)\0A\00"
@.str.12 = [33 x i8] c"\0AYour year, %d, is a leap year.\0A\00"
@.str.13 = [37 x i8] c"\0AYour year, %d, is not a leap year.\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
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%8 = load i32, i32* %4
%9 = srem i32 %8, 400
%10 = icmp eq i32 %9, 0
br i1 %10, label %19, label %11
11: ; preds = %0
%12 = load i32, i32* %4
%13 = srem i32 %12, 4
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %20
15: ; preds = %11
%16 = load i32, i32* %4
%17 = srem i32 %16, 100
%18 = icmp sgt i32 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %15, %0
store i32 1, i32* %5
br label %21
20: ; preds = %15, %11
store i32 0, i32* %5
br label %21
21: ; preds = %20, %19
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%23 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
br label %24
24: ; preds = %32, %21
%25 = load i32, i32* %3
%26 = icmp slt i32 %25, 1
br i1 %26, label %30, label %27
27: ; preds = %24
%28 = load i32, i32* %3
%29 = icmp sgt i32 %28, 12
br label %30
30: ; preds = %27, %24
%31 = phi i1 [ true, %24 ], [ %29, %27 ]
br i1 %31, label %32, label %36
32: ; preds = %30
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.3, i64 0, i64 0))
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.4, i64 0, i64 0))
%35 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
br label %24
36: ; preds = %30
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0))
%38 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%39 = load i32, i32* %3
switch i32 %39, label %99 [
i32 1, label %40
i32 3, label %40
i32 5, label %40
i32 7, label %40
i32 8, label %40
i32 10, label %40
i32 12, label %40
i32 2, label %54
i32 4, label %85
i32 6, label %85
i32 9, label %85
i32 11, label %85
]
40: ; preds = %36, %36, %36, %36, %36, %36, %36
br label %41
41: ; preds = %49, %40
%42 = load i32, i32* %2
%43 = icmp slt i32 %42, 1
br i1 %43, label %47, label %44
44: ; preds = %41
%45 = load i32, i32* %2
%46 = icmp sgt i32 %45, 31
br label %47
47: ; preds = %44, %41
%48 = phi i1 [ true, %41 ], [ %46, %44 ]
br i1 %48, label %49, label %53
49: ; preds = %47
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.6, i64 0, i64 0))
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.7, i64 0, i64 0))
%52 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
br label %41
53: ; preds = %47
br label %99
54: ; preds = %36
%55 = load i32, i32* %5
%56 = icmp eq i32 %55, 1
br i1 %56, label %57, label %71
57: ; preds = %54
br label %58
58: ; preds = %66, %57
%59 = load i32, i32* %2
%60 = icmp slt i32 %59, 1
br i1 %60, label %64, label %61
61: ; preds = %58
%62 = load i32, i32* %2
%63 = icmp sgt i32 %62, 29
br label %64
64: ; preds = %61, %58
%65 = phi i1 [ true, %58 ], [ %63, %61 ]
br i1 %65, label %66, label %70
66: ; preds = %64
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.6, i64 0, i64 0))
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.8, i64 0, i64 0))
%69 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
br label %58
70: ; preds = %64
br label %99
71: ; preds = %54
br label %72
72: ; preds = %80, %71
%73 = load i32, i32* %2
%74 = icmp slt i32 %73, 1
br i1 %74, label %78, label %75
75: ; preds = %72
%76 = load i32, i32* %2
%77 = icmp sgt i32 %76, 28
br label %78
78: ; preds = %75, %72
%79 = phi i1 [ true, %72 ], [ %77, %75 ]
br i1 %79, label %80, label %84
80: ; preds = %78
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.6, i64 0, i64 0))
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.9, i64 0, i64 0))
%83 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
br label %72
84: ; preds = %78
br label %99
85: ; preds = %36, %36, %36, %36
br label %86
86: ; preds = %94, %85
%87 = load i32, i32* %2
%88 = icmp slt i32 %87, 1
br i1 %88, label %92, label %89
89: ; preds = %86
%90 = load i32, i32* %2
%91 = icmp sgt i32 %90, 30
br label %92
92: ; preds = %89, %86
%93 = phi i1 [ true, %86 ], [ %91, %89 ]
br i1 %93, label %94, label %98
94: ; preds = %92
%95 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.6, i64 0, i64 0))
%96 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.10, i64 0, i64 0))
%97 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
br label %86
98: ; preds = %92
br label %99
99: ; preds = %98, %36, %84, %70, %53
%100 = load i32, i32* %2
%101 = load i32, i32* %3
%102 = load i32, i32* %4
%103 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.11, i64 0, i64 0), i32 %100, i32 %101, i32 %102)
%104 = load i32, i32* %5
%105 = icmp eq i32 %104, 1
br i1 %105, label %106, label %109
106: ; preds = %99
%107 = load i32, i32* %4
%108 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.12, i64 0, i64 0), i32 %107)
br label %112
109: ; preds = %99
%110 = load i32, i32* %4
%111 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.13, i64 0, i64 0), i32 %110)
br label %112
112: ; preds = %109, %106
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"\0APlease enter a year: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [24 x i8] c"\0APlease enter a month: \00"
@.str.3 = [53 x i8] c"\0AError - the month that you entered is not possible.\00"
@.str.4 = [49 x i8] c"\0APlease enter a correct month between 1 and 12: \00"
@.str.5 = [22 x i8] c"\0APlease enter a day: \00"
@.str.6 = [51 x i8] c"\0AError - the day that you entered is not possible.\00"
@.str.7 = [47 x i8] c"\0APlease enter a correct day between 1 and 31: \00"
@.str.8 = [47 x i8] c"\0APlease enter a correct day between 1 and 29: \00"
@.str.9 = [47 x i8] c"\0APlease enter a correct day between 1 and 28: \00"
@.str.10 = [47 x i8] c"\0APlease enter a correct day between 1 and 30: \00"
@.str.11 = [42 x i8] c"\0AYou entered, %d/%d/%d. (day/month/year)\0A\00"
@.str.12 = [33 x i8] c"\0AYour year, %d, is a leap year.\0A\00"
@.str.13 = [37 x i8] c"\0AYour year, %d, is not a leap year.\0A\00"
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*
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%9 = load i32, i32* %3
%10 = srem i32 %9, 400
%11 = icmp eq i32 %10, 0
br i1 %11, label %18, label %12
12: ; preds = %0
%13 = and i32 %9, 3
%14 = icmp eq i32 %13, 0
%15 = srem i32 %9, 100
%16 = icmp sgt i32 %15, 0
%17 = and i1 %14, %16
br label %18
18: ; preds = %12, %0
%19 = phi i1 [ true, %0 ], [ %17, %12 ]
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%21 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%22 = load i32, i32* %2
%23 = add i32 %22, -13
%24 = icmp ult i32 %23, -12
br i1 %24, label %25, label %32
25: ; preds = %18, %25
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.3, i64 0, i64 0))
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.4, i64 0, i64 0))
%28 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%29 = load i32, i32* %2
%30 = add i32 %29, -13
%31 = icmp ult i32 %30, -12
br i1 %31, label %25, label %32
32: ; preds = %25, %18
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0))
%34 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%35 = load i32, i32* %2
switch i32 %35, label %36 [
i32 1, label %38
i32 3, label %38
i32 5, label %38
i32 7, label %38
i32 8, label %38
i32 10, label %38
i32 12, label %38
i32 2, label %49
i32 4, label %79
i32 6, label %79
i32 9, label %79
i32 11, label %79
]
36: ; preds = %32
%37 = load i32, i32* %1
br label %90
38: ; preds = %32, %32, %32, %32, %32, %32, %32
%39 = load i32, i32* %1
%40 = add i32 %39, -32
%41 = icmp ult i32 %40, -31
br i1 %41, label %42, label %90
42: ; preds = %38, %42
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str.6, i64 0, i64 0))
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.7, i64 0, i64 0))
%45 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%46 = load i32, i32* %1
%47 = add i32 %46, -32
%48 = icmp ult i32 %47, -31
br i1 %48, label %42, label %90
49: ; preds = %32
%50 = load i32, i32* %1
br i1 %19, label %58, label %51
51: ; preds = %49
%52 = add i32 %50, -29
%53 = icmp ult i32 %52, -28
br i1 %53, label %72, label %54
54: ; preds = %51
%55 = load i32, i32* %2
%56 = load i32, i32* %3
%57 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.11, i64 0, i64 0), i32 %50, i32 %55, i32 %56)
br label %98
58: ; preds = %49
%59 = add i32 %50, -30
%60 = icmp ult i32 %59, -29
br i1 %60, label %65, label %61
61: ; preds = %58
%62 = load i32, i32* %2
%63 = load i32, i32* %3
%64 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.11, i64 0, i64 0), i32 %50, i32 %62, i32 %63)
br label %95
65: ; preds = %58, %65
%66 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str.6, i64 0, i64 0))
%67 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.8, i64 0, i64 0))
%68 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%69 = load i32, i32* %1
%70 = add i32 %69, -30
%71 = icmp ult i32 %70, -29
br i1 %71, label %65, label %90
72: ; preds = %51, %72
%73 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str.6, i64 0, i64 0))
%74 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.9, i64 0, i64 0))
%75 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%76 = load i32, i32* %1
%77 = add i32 %76, -29
%78 = icmp ult i32 %77, -28
br i1 %78, label %72, label %90
79: ; preds = %32, %32, %32, %32
%80 = load i32, i32* %1
%81 = add i32 %80, -31
%82 = icmp ult i32 %81, -30
br i1 %82, label %83, label %90
83: ; preds = %79, %83
%84 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str.6, i64 0, i64 0))
%85 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.10, i64 0, i64 0))
%86 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%87 = load i32, i32* %1
%88 = add i32 %87, -31
%89 = icmp ult i32 %88, -30
br i1 %89, label %83, label %90
90: ; preds = %83, %72, %65, %42, %36, %79, %38
%91 = phi i32 [ %37, %36 ], [ %80, %79 ], [ %39, %38 ], [ %46, %42 ], [ %69, %65 ], [ %76, %72 ], [ %87, %83 ]
%92 = load i32, i32* %2
%93 = load i32, i32* %3
%94 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.11, i64 0, i64 0), i32 %91, i32 %92, i32 %93)
br i1 %19, label %95, label %98
95: ; preds = %61, %90
%96 = load i32, i32* %3
%97 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.12, i64 0, i64 0), i32 %96)
br label %101
98: ; preds = %54, %90
%99 = load i32, i32* %3
%100 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.13, i64 0, i64 0), i32 %99)
br label %101
101: ; preds = %98, %95
ret i32 0
}