#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 long, ...);
int main() {
  unsigned long long first = 2, second = 1, lucas;
  int i;
  lucas = first + second;
  printf("%llu\n%llu\n%llu\n", first, second, lucas);
  for (i = 4; i <= 100; i++) {
    first = second;
    second = lucas;
    lucas = first + second;
    printf("%llu\n", lucas);
  }
  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)
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x4,-0x24(%rbp)
cmpl   $0x64,-0x24(%rbp)
jg     11a2 <main+0x92>
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    115c <main+0x4c>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
lea    0xee1(%rip),%rdi
mov    $0x1,%ebx
mov    $0x3,%r15d
mov    $0x2,%esi
mov    $0x1,%edx
mov    $0x3,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x61,%ebp
lea    0xebe(%rip),%r14
nopl   0x0(%rax)
mov    %r15,%r12
add    %r15,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%r15
mov    %r12,%rbx
add    $0xffffffff,%ebp
jne    1150 <main+0x40>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

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