#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);
int /*<<< orphan*/ scanf(char *, int *);
void main() {
  int year;
  scanf("%d", &year);
  if (((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) ? 1 : 0)
    printf("%d is a leap year", year);
  else
    printf("%d is not a leap year", year);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1160 <main+0x40>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1174 <main+0x54>
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1183 <main+0x63>
mov    $0x1,%al
test   $0x1,%al
jne    1192 <main+0x72>
jmp    11a6 <main+0x86>
xor    %eax,%eax
test   $0x1,%al
jne    1192 <main+0x72>
jmp    11a6 <main+0x86>
mov    -0x4(%rbp),%esi
lea    0xe67(%rip),%rdi
call   1030 <printf@plt>
jmp    11b5 <main+0x95>
mov    -0x4(%rbp),%esi
lea    0xe65(%rip),%rdi
call   1030 <printf@plt>
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),%esi
imul   $0xc28f5c29,%esi,%eax
add    $0x51eb850,%eax
mov    %eax,%ecx
ror    $0x2,%ecx
ror    $0x4,%eax
cmp    $0xa3d70b,%eax
lea    0xeae(%rip),%rdi
lea    0xeb9(%rip),%rax
cmovb  %rdi,%rax
cmp    $0x28f5c29,%ecx
cmovb  %rax,%rdi
test   $0x3,%sil
cmovne %rax,%rdi
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [18 x i8] c"%d is a leap year\00"
@.str.2 = [22 x i8] c"%d is not a leap year\00"
define void @main() {
%1 = alloca i32
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%3 = load i32, i32* %1
%4 = srem i32 %3, 4
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = load i32, i32* %1
%8 = srem i32 %7, 100
%9 = icmp ne i32 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %6, %0
%11 = load i32, i32* %1
%12 = srem i32 %11, 400
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %10, %6
br i1 true, label %16, label %19
15: ; preds = %10
br i1 false, label %16, label %19
16: ; preds = %15, %14
%17 = load i32, i32* %1
%18 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %17)
br label %22
19: ; preds = %15, %14
%20 = load i32, i32* %1
%21 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %20)
br label %22
22: ; preds = %19, %16
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [18 x i8] c"%d is a leap year\00"
@.str.2 = [22 x i8] c"%d is not a leap year\00"
define void @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
%7 = srem i32 %4, 100
%8 = icmp ne i32 %7, 0
%9 = and i1 %6, %8
%10 = srem i32 %4, 400
%11 = icmp eq i32 %10, 0
%12 = or i1 %9, %11
%13 = select i1 %12, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0)
%14 = call i32 @printf(i8* %13, i32 %4)
ret void
}