#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() {
  long unsigned l, f, s;
  int counter;
  for (counter = 0; counter <= 100; ++counter) {
    if (counter == 0) {
      f = 2;
      printf(" %lu,", f);
    } else if (counter == 1) {
      s = 1;
      printf(" %lu,", s);
    } else {
      l = f + s;
      f = s;
      s = l;
      printf(" %lu,", l);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x64,-0x24(%rbp)
jg     11c2 <main+0xb2>
cmpl   $0x0,-0x24(%rbp)
jne    1157 <main+0x47>
movq   $0x2,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
jmp    11af <main+0x9f>
cmpl   $0x1,-0x24(%rbp)
jne    117e <main+0x6e>
movq   $0x1,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
jmp    11aa <main+0x9a>
mov    -0x18(%rbp),%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%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    1126 <main+0x16>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %ebp,%ebp
lea    0xee0(%rip),%r14
jmp    114c <main+0x3c>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r15,%rsi
add    %rbx,%rsi
mov    %rbx,%r15
mov    %rsi,%rbx
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%ebp
cmp    $0x65,%ebp
je     117d <main+0x6d>
test   %ebp,%ebp
je     1170 <main+0x60>
cmp    $0x1,%ebp
jne    1130 <main+0x20>
mov    $0x1,%esi
mov    $0x1,%ebx
jmp    113c <main+0x2c>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x2,%esi
mov    $0x2,%r15d
jmp    113c <main+0x2c>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c" %lu,\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 i32 0, i32* %5
br label %6
6: ; preds = %31, %0
%7 = load i32, i32* %5
%8 = icmp sle 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
store i64 2, i64* %3
%13 = load i64, i64* %3
%14 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 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
store i64 1, i64* %4
%19 = load i64, i64* %4
%20 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %19)
br label %29
21: ; preds = %15
%22 = load i64, i64* %3
%23 = load i64, i64* %4
%24 = add i64 %22, %23
store i64 %24, i64* %2
%25 = load i64, i64* %4
store i64 %25, i64* %3
%26 = load i64, i64* %2
store i64 %26, i64* %4
%27 = load i64, i64* %2
%28 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 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 = [6 x i8] c" %lu,\00"
define i32 @main() {
br label %1
1: ; preds = %0, %8
%2 = phi i32 [ 0, %0 ], [ %13, %8 ]
%3 = phi i64 [ undef, %0 ], [ %11, %8 ]
%4 = phi i64 [ undef, %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 ], [ 1, %5 ], [ 2, %1 ]
%10 = phi i64 [ %3, %6 ], [ %4, %5 ], [ 2, %1 ]
%11 = phi i64 [ %7, %6 ], [ 1, %5 ], [ %3, %1 ]
%12 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %9)
%13 = add nuw nsw i32 %2, 1
%14 = icmp eq i32 %13, 101
br i1 %14, label %15, label %1
15: ; preds = %8
ret i32 0
}