#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, next;
  int c;
  for (c = 0; c < 100; c++) {
    if (c == 0) {
      printf("%u\t", first);
    } else if (c == 1) {
      printf("%u\t", second);
    } else {
      next = first + second;
      first = second;
      second = next;
      printf("%u\t", next);
    }
  }
  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)
movl   $0x0,-0x24(%rbp)
cmpl   $0x64,-0x24(%rbp)
jge    11c2 <main+0xb2>
cmpl   $0x0,-0x24(%rbp)
jne    115f <main+0x4f>
mov    -0x10(%rbp),%rsi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
jmp    11af <main+0x9f>
cmpl   $0x1,-0x24(%rbp)
jne    117e <main+0x6e>
mov    -0x18(%rbp),%rsi
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
jmp    11aa <main+0x9a>
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xe5b(%rip),%rdi
call   1030 <printf@plt>
jmp    11af <main+0x9f>
jmp    11b4 <main+0xa4>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1136 <main+0x26>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
mov    $0x2,%eax
xor    %ebp,%ebp
lea    0xed6(%rip),%r14
jmp    114f <main+0x3f>
nopl   0x0(%rax)
add    %rbx,%rax
mov    %rax,%rsi
mov    %rax,%r15
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%ebp
mov    %rbx,%rax
mov    %r15,%rbx
cmp    $0x64,%ebp
je     116b <main+0x5b>
test   %ebp,%ebp
je     1160 <main+0x50>
cmp    $0x1,%ebp
jne    1130 <main+0x20>
mov    %rbx,%rsi
jmp    1163 <main+0x53>
nopl   (%rax)
mov    %rax,%rsi
mov    %rbx,%r15
mov    %rax,%rbx
jmp    1139 <main+0x29>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%u\09\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
store i32 0, i32* %5
br label %6
6: ; preds = %31, %0
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 100
br i1 %8, label %9, label %34
9: ; preds = %6
%10 = load i32, i32* %5
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load i64, i64* %2
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %13)
br label %30
15: ; preds = %9
%16 = load i32, i32* %5
%17 = icmp eq i32 %16, 1
br i1 %17, label %18, label %21
18: ; preds = %15
%19 = load i64, i64* %3
%20 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %19)
br label %29
21: ; preds = %15
%22 = load i64, i64* %2
%23 = load i64, i64* %3
%24 = add i64 %22, %23
store i64 %24, i64* %4
%25 = load i64, i64* %3
store i64 %25, i64* %2
%26 = load i64, i64* %4
store i64 %26, i64* %3
%27 = load i64, i64* %4
%28 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %27)
br label %29
29: ; preds = %21, %18
br label %30
30: ; preds = %29, %12
br label %31
31: ; preds = %30
%32 = load i32, i32* %5
%33 = add nsw i32 %32, 1
store i32 %33, i32* %5
br label %6
34: ; preds = %6
ret i32 0
}

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