#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 a;
  scanf("%d", &a);
  if (a % 4 == 0) {
    if (a % 100 == 0 && a % 400 == 0) {
      printf("Leap Year");
    } else if (a % 4 == 0 && a % 100 != 0) {
      printf("Leap Year");
    } else if (a % 100 == 0 && a % 400 != 0) {
      printf("Not Leap Year");
    }
  } else {
    printf("Not Leap Year");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1208 <main+0xe8>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    118c <main+0x6c>
mov    -0x8(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    118c <main+0x6c>
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
jmp    1203 <main+0xe3>
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11c5 <main+0xa5>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     11c5 <main+0xa5>
lea    0xe4c(%rip),%rdi
call   1030 <printf@plt>
jmp    11fe <main+0xde>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11f9 <main+0xd9>
mov    -0x8(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     11f9 <main+0xd9>
lea    0xe0f(%rip),%rdi
call   1030 <printf@plt>
jmp    11fe <main+0xde>
jmp    1203 <main+0xe3>
jmp    1214 <main+0xf4>
lea    0xdf4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
test   $0x3,%al
je     114a <main+0x2a>
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret
movslq %eax,%rcx
imul   $0x51eb851f,%rcx,%rcx
mov    %rcx,%rdx
sar    $0x25,%rdx
mov    %rcx,%rsi
shr    $0x3f,%rsi
add    %esi,%edx
imul   $0x64,%edx,%edx
mov    %eax,%edi
sub    %edx,%edi
sar    $0x27,%rcx
add    %esi,%ecx
imul   $0x190,%ecx,%ecx
sub    %ecx,%eax
mov    %edi,%ecx
or     %eax,%ecx
sete   %cl
test   %edi,%edi
setne  %dl
or     %cl,%dl
lea    0xe79(%rip),%rcx
lea    0xe6e(%rip),%rdi
cmovne %rcx,%rdi
jne    1141 <main+0x21>
test   %eax,%eax
je     1146 <main+0x26>
jmp    1141 <main+0x21>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [10 x i8] c"Leap Year\00"
@.str.2 = [14 x i8] c"Not Leap Year\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = and i32 %4, 3
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %17
7: ; preds = %0
%8 = srem i32 %4, 100
%9 = srem i32 %4, 400
%10 = icmp ne i32 %9, 0
%11 = or i32 %8, %9
%12 = icmp eq i32 %11, 0
%13 = icmp ne i32 %8, 0
%14 = or i1 %12, %13
%15 = select i1 %14, i1 true, i1 %10
%16 = select i1 %14, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0)
br i1 %15, label %17, label %20
17: ; preds = %7, %0
%18 = phi i8* [ %16, %7 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), %0 ]
%19 = call i32 @printf(i8* dereferenceable(1) %18)
br label %20
20: ; preds = %7, %17
ret i32 0
}