#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 *, unsigned long);
int main() {
  unsigned long N1 = 2;
  unsigned long N2 = 1;
  unsigned long N_sum = 0;
  unsigned long N_number = 0;
  printf("%lu\n", N1);
  printf("%lu\n", N2);
  for (N_number; N_number < 100; N_number++) {
    N_sum = N1 + N2;
    printf("%lu\n", N_sum);
    N1 = N2;
    N2 = N_sum;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x2,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
cmpq   $0x64,-0x28(%rbp)
jae    11a7 <main+0x97>
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xe7f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    115f <main+0x4f>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
lea    0xee0(%rip),%r14
mov    $0x2,%ebx
mov    $0x2,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    $0x1,%r12d
mov    $0x1,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    $0x64,%r15d
nopl   0x0(%rax,%rax,1)
mov    %r12,%r13
add    %r12,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%r12
mov    %r13,%rbx
add    $0xffffffffffffffff,%r15
jne    1150 <main+0x40>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%lu\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 1)
br label %3
3: ; preds = %0, %3
%4 = phi i64 [ 0, %0 ], [ %9, %3 ]
%5 = phi i64 [ 1, %0 ], [ %7, %3 ]
%6 = phi i64 [ 2, %0 ], [ %5, %3 ]
%7 = add i64 %5, %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %7)
%9 = add nuw nsw i64 %4, 1
%10 = icmp eq i64 %9, 100
br i1 %10, label %11, label %3
11: ; preds = %3
ret i32 0
}