#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*/ puts(char *);
int /*<<< orphan*/ scanf(char *, unsigned int *);
int main() {
  unsigned y;
  printf("Enter a year:\n");
  scanf(" %u%*c", &y);
  if (!(y % 400))
    puts("Leap");
  else if (!(y % 100))
    puts("Not Leap");
  else if (!(y % 4))
    puts("Leap");
  else
    puts("Not Leap");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
lea    0xebd(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x190,%ecx
xor    %edx,%edx
div    %ecx
cmp    $0x0,%edx
jne    1181 <main+0x51>
lea    0xea3(%rip),%rdi
call   1030 <puts@plt>
jmp    11dd <main+0xad>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
xor    %edx,%edx
div    %ecx
cmp    $0x0,%edx
jne    11a7 <main+0x77>
lea    0xe79(%rip),%rdi
call   1030 <puts@plt>
jmp    11d8 <main+0xa8>
mov    -0x8(%rbp),%eax
and    $0x3,%eax
cmp    $0x0,%eax
jne    11c7 <main+0x97>
lea    0xe5d(%rip),%rdi
call   1030 <puts@plt>
jmp    11d3 <main+0xa3>
lea    0xe48(%rip),%rdi
call   1030 <puts@plt>
jmp    11d8 <main+0xa8>
jmp    11dd <main+0xad>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
imul   $0xc28f5c29,%eax,%ecx
mov    %ecx,%edx
ror    $0x4,%edx
cmp    $0xa3d70b,%edx
jb     1176 <main+0x56>
ror    $0x2,%ecx
cmp    $0x28f5c29,%ecx
jb     117f <main+0x5f>
test   $0x3,%al
lea    0xea2(%rip),%rax
lea    0xe97(%rip),%rdi
cmove  %rax,%rdi
jmp    1186 <main+0x66>
lea    0xe8e(%rip),%rdi
jmp    1186 <main+0x66>
lea    0xe81(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Enter a year:\0A\00"
@.str.1 = [7 x i8] c" %u%*c\00"
@.str.2 = [5 x i8] c"Leap\00"
@.str.3 = [9 x i8] c"Not Leap\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = urem i32 %5, 400
%7 = icmp ne i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %0
%9 = call i32 @puts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %26
10: ; preds = %0
%11 = load i32, i32* %2
%12 = urem i32 %11, 100
%13 = icmp ne i32 %12, 0
br i1 %13, label %16, label %14
14: ; preds = %10
%15 = call i32 @puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
br label %25
16: ; preds = %10
%17 = load i32, i32* %2
%18 = urem i32 %17, 4
%19 = icmp ne i32 %18, 0
br i1 %19, label %22, label %20
20: ; preds = %16
%21 = call i32 @puts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %24
22: ; preds = %16
%23 = call i32 @puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
br label %24
24: ; preds = %22, %20
br label %25
25: ; preds = %24, %14
br label %26
26: ; preds = %25, %8
ret i32 0
}

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