#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 */
scalar_t__ isLeapYeart(int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int i;
  for (i = 1900; i <= 2100; ++i) {
    if (isLeapYeart(i)) {
      printf("%d er skudår\n", i);
    } else {
      printf("%d er ikke skudår\n", i);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x76c,-0x8(%rbp)
cmpl   $0x834,-0x8(%rbp)
jg     118b <main+0x6b>
mov    -0x8(%rbp),%edi
call   1040 <isLeapYeart@plt>
cmp    $0x0,%rax
je     1169 <main+0x49>
mov    -0x8(%rbp),%esi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
jmp    1178 <main+0x58>
mov    -0x8(%rbp),%esi
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
jmp    117d <main+0x5d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    $0x76c,%ebx
lea    0xede(%rip),%r14
lea    0xec8(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1040 <isLeapYeart@plt>
test   %rax,%rax
mov    %r15,%rdi
cmove  %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x835,%ebx
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [15 x i8] c"%d er skud\C3\A5r\0A\00"
@.str.1 = [20 x i8] c"%d er ikke skud\C3\A5r\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1900, i32* %2
br label %3
3: ; preds = %17, %0
%4 = load i32, i32* %2
%5 = icmp sle i32 %4, 2100
br i1 %5, label %6, label %20
6: ; preds = %3
%7 = load i32, i32* %2
%8 = call i64 @isLeapYeart(i32 %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %6
%11 = load i32, i32* %2
%12 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %11)
br label %16
13: ; preds = %6
%14 = load i32, i32* %2
%15 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %14)
br label %16
16: ; preds = %13, %10
br label %17
17: ; preds = %16
%18 = load i32, i32* %2
%19 = add nsw i32 %18, 1
store i32 %19, i32* %2
br label %3
20: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"%d er skud\C3\A5r\0A\00"
@.str.1 = [20 x i8] c"%d er ikke skud\C3\A5r\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 1900, %0 ], [ %7, %1 ]
%3 = tail call i64 @isLeapYeart(i32 %2)
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
%6 = tail call i32 @printf(i8* %5, i32 %2)
%7 = add nuw nsw i32 %2, 1
%8 = icmp eq i32 %7, 2101
br i1 %8, label %9, label %1
9: ; preds = %1
ret i32 0
}