#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 i;
  scanf("%d", &i);
  if ((i % 4) && (i % 100 == 0) || (i % 400 == 0)) {
    printf("Year is leap");
  } else if ((i % 4 != 0) || (i % 100 != 0) || (i % 400 != 0)) {
    printf("YEAR IS NOT LEAP");
  }
}


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
je     1167 <main+0x47>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     117b <main+0x5b>
mov    -0x8(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    118c <main+0x6c>
lea    0xe81(%rip),%rdi
call   1030 <printf@plt>
jmp    11d9 <main+0xb9>
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11c8 <main+0xa8>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11c8 <main+0xa8>
mov    -0x8(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     11d4 <main+0xb4>
lea    0xe41(%rip),%rdi
call   1030 <printf@plt>
jmp    11d9 <main+0xb9>
mov    -0x4(%rbp),%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
imul   $0xc28f5c29,%eax,%ecx
add    $0x51eb850,%ecx
mov    %ecx,%edx
ror    $0x2,%edx
ror    $0x4,%ecx
cmp    $0xa3d70b,%ecx
lea    0xeac(%rip),%rdi
lea    0xeb2(%rip),%rcx
cmovb  %rdi,%rcx
cmp    $0x28f5c29,%edx
cmovae %rcx,%rdi
test   $0x3,%al
cmove  %rcx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [13 x i8] c"Year is leap\00"
@.str.2 = [17 x i8] c"YEAR IS NOT LEAP\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 ne i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %0
%8 = load i32, i32* %2
%9 = srem i32 %8, 100
%10 = icmp eq i32 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %7, %0
%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, %7
%16 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
br label %32
17: ; preds = %11
%18 = load i32, i32* %2
%19 = srem i32 %18, 4
%20 = icmp ne i32 %19, 0
br i1 %20, label %29, label %21
21: ; preds = %17
%22 = load i32, i32* %2
%23 = srem i32 %22, 100
%24 = icmp ne i32 %23, 0
br i1 %24, label %29, label %25
25: ; preds = %21
%26 = load i32, i32* %2
%27 = srem i32 %26, 400
%28 = icmp ne i32 %27, 0
br i1 %28, label %29, label %31
29: ; preds = %25, %21, %17
%30 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
br label %31
31: ; preds = %29, %25
br label %32
32: ; preds = %31, %15
%33 = load i32, i32* %1
ret i32 %33
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [13 x i8] c"Year is leap\00"
@.str.2 = [17 x i8] c"YEAR IS NOT LEAP\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 ne i32 %5, 0
%7 = srem i32 %4, 100
%8 = icmp eq i32 %7, 0
%9 = and i1 %6, %8
%10 = srem i32 %4, 400
%11 = icmp eq i32 %10, 0
%12 = select i1 %9, i1 true, i1 %11
%13 = select i1 %12, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0)
%14 = call i32 @printf(i8* dereferenceable(1) %13)
ret i32 0
}