#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 main() {
  int x;
  for (x = 1890; x <= 1910; ++x) {
    if (x % 4 == 0) {
      if (x % 100 == 0) {
        if (x % 400 == 0)
          printf("%4d is a leap year\n", x);
        else
          printf("%4d is not a leap year.\n", x);
      } else
        printf("%4d is a leap year\n", x);
    } else
      printf("%4d is not a leap year.\n", x);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x762,-0x8(%rbp)
cmpl   $0x776,-0x8(%rbp)
jg     11cd <main+0xbd>
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11ab <main+0x9b>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1197 <main+0x87>
mov    -0x8(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1183 <main+0x73>
mov    -0x8(%rbp),%esi
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
jmp    1192 <main+0x82>
mov    -0x8(%rbp),%esi
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
jmp    11a6 <main+0x96>
mov    -0x8(%rbp),%esi
lea    0xe5f(%rip),%rdi
call   1030 <printf@plt>
jmp    11ba <main+0xaa>
mov    -0x8(%rbp),%esi
lea    0xe5f(%rip),%rdi
call   1030 <printf@plt>
jmp    11bf <main+0xaf>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    $0x762,%ebx
lea    0xef3(%rip),%r14
lea    0xed8(%rip),%r15
jmp    1142 <main+0x32>
nopw   0x0(%rax,%rax,1)
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x777,%ebx
je     1185 <main+0x75>
mov    %r14,%rdi
test   $0x3,%bl
jne    1130 <main+0x20>
movzwl %bx,%eax
mov    %eax,%ecx
shr    $0x2,%ecx
imul   $0x147b,%ecx,%ecx
shr    $0x11,%ecx
imul   $0xffffff9c,%ecx,%ecx
mov    %r15,%rdi
add    %bx,%cx
jne    1130 <main+0x20>
shr    $0x4,%eax
imul   $0xa3e,%eax,%eax
shr    $0x10,%eax
imul   $0xfffffe70,%eax,%eax
mov    %r15,%rdi
add    %bx,%ax
je     1130 <main+0x20>
mov    %r14,%rdi
jmp    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [20 x i8] c"%4d is a leap year\0A\00"
@.str.1 = [25 x i8] c"%4d is not a leap year.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1890, i32* %2
br label %3
3: ; preds = %33, %0
%4 = load i32, i32* %2
%5 = icmp sle i32 %4, 1910
br i1 %5, label %6, label %36
6: ; preds = %3
%7 = load i32, i32* %2
%8 = srem i32 %7, 4
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %29
10: ; preds = %6
%11 = load i32, i32* %2
%12 = srem i32 %11, 100
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %25
14: ; preds = %10
%15 = load i32, i32* %2
%16 = srem i32 %15, 400
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %14
%19 = load i32, i32* %2
%20 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %19)
br label %24
21: ; preds = %14
%22 = load i32, i32* %2
%23 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %22)
br label %24
24: ; preds = %21, %18
br label %28
25: ; preds = %10
%26 = load i32, i32* %2
%27 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %26)
br label %28
28: ; preds = %25, %24
br label %32
29: ; preds = %6
%30 = load i32, i32* %2
%31 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %30)
br label %32
32: ; preds = %29, %28
br label %33
33: ; preds = %32
%34 = load i32, i32* %2
%35 = add nsw i32 %34, 1
store i32 %35, i32* %2
br label %3
36: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"%4d is a leap year\0A\00"
@.str.1 = [25 x i8] c"%4d is not a leap year.\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %13
%2 = phi i32 [ 1890, %0 ], [ %16, %13 ]
%3 = and i32 %2, 3
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %13
5: ; preds = %1
%6 = trunc i32 %2 to i16
%7 = urem i16 %6, 100
%8 = icmp eq i16 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %5
%10 = urem i16 %6, 400
%11 = icmp eq i16 %10, 0
%12 = select i1 %11, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0)
br label %13
13: ; preds = %1, %5, %9
%14 = phi i8* [ %12, %9 ], [ getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), %5 ], [ getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), %1 ]
%15 = tail call i32 @printf(i8* %14, i32 %2)
%16 = add nuw nsw i32 %2, 1
%17 = icmp eq i32 %16, 1911
br i1 %17, label %18, label %1
18: ; preds = %13
ret i32 0
}