#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 current_year();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int year;
  for (year = 1000; year <= current_year(); year++) {
    if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0))
      printf("%d ", year);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3e8,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1040 <current_year@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
cmp    %ecx,%eax
jg     11ae <main+0x8e>
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1178 <main+0x58>
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    119b <main+0x7b>
mov    -0x8(%rbp),%esi
lea    0xe6a(%rip),%rdi
call   1030 <printf@plt>
jmp    11a0 <main+0x80>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1040 <current_year@plt>
cmp    $0x3e8,%eax
jge    1139 <main+0x19>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    $0x3e8,%ebx
mov    $0x3e7,%ecx
lea    0xeb6(%rip),%r14
jmp    116a <main+0x4a>
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
xor    %eax,%eax
call   1040 <current_year@plt>
mov    %ebp,%ecx
cmp    %eax,%ebp
jge    1132 <main+0x12>
lea    0x1(%rcx),%ebp
mov    %ebx,%eax
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rdx
shr    $0x25,%rdx
imul   $0x64,%edx,%edx
test   $0x3,%bpl
sete   %sil
mov    %ecx,%edi
sub    %edx,%edi
cmp    $0xffffffff,%edi
setne  %dl
test   %dl,%sil
jne    1150 <main+0x30>
shr    $0x27,%rax
imul   $0x190,%eax,%eax
neg    %eax
add    %ecx,%eax
add    $0x3e8,%eax
cmp    $0x3e7,%eax
jne    115a <main+0x3a>
jmp    1150 <main+0x30>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1000, i32* %2
br label %3
3: ; preds = %23, %0
%4 = load i32, i32* %2
%5 = call i32 (...) @current_year()
%6 = icmp sle i32 %4, %5
br i1 %6, label %7, label %26
7: ; preds = %3
%8 = load i32, i32* %2
%9 = srem i32 %8, 4
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = load i32, i32* %2
%13 = srem i32 %12, 100
%14 = icmp ne i32 %13, 0
br i1 %14, label %19, label %15
15: ; preds = %11, %7
%16 = load i32, i32* %2
%17 = srem i32 %16, 400
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %15, %11
%20 = load i32, i32* %2
%21 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %20)
br label %22
22: ; preds = %19, %15
br label %23
23: ; preds = %22
%24 = load i32, i32* %2
%25 = add nsw i32 %24, 1
store i32 %25, i32* %2
br label %3
26: ; preds = %3
%27 = load i32, i32* %1
ret i32 %27
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define i32 @main() {
%1 = tail call i32 (...) @current_year()
%2 = icmp slt i32 %1, 1000
br i1 %2, label %19, label %3
3: ; preds = %0, %15
%4 = phi i32 [ %16, %15 ], [ 1000, %0 ]
%5 = and i32 %4, 3
%6 = icmp eq i32 %5, 0
%7 = urem i32 %4, 100
%8 = icmp ne i32 %7, 0
%9 = and i1 %6, %8
%10 = urem i32 %4, 400
%11 = icmp eq i32 %10, 0
%12 = select i1 %9, i1 true, i1 %11
br i1 %12, label %13, label %15
13: ; preds = %3
%14 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
br label %15
15: ; preds = %3, %13
%16 = add nuw nsw i32 %4, 1
%17 = tail call i32 (...) @current_year()
%18 = icmp slt i32 %4, %17
br i1 %18, label %3, label %19
19: ; preds = %15, %0
ret i32 0
}