#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() {
  int i;
  long long unsigned x = 2, y = 1, z = 0;
  for (i = 0; i < 100; i++) {
    if (i == 0)
      z = 2;
    else if (i == 1)
      z = 1;
    else {
      z = x + y;
      x = y;
      y = z;
    }
    printf("%llu, ", z);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x2,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    11b5 <main+0xa5>
cmpl   $0x0,-0x8(%rbp)
jne    115f <main+0x4f>
movq   $0x2,-0x20(%rbp)
jmp    1197 <main+0x87>
cmpl   $0x1,-0x8(%rbp)
jne    1176 <main+0x66>
movq   $0x1,-0x20(%rbp)
jmp    1192 <main+0x82>
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)
jmp    1197 <main+0x87>
mov    -0x20(%rbp),%rsi
lea    0xe5e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113e <main+0x2e>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %ebp,%ebp
mov    $0x2,%r15d
mov    $0x1,%ebx
lea    0xed5(%rip),%r14
jmp    114c <main+0x3c>
nopl   (%rax)
mov    %r15,%rsi
add    %rbx,%rsi
mov    %rbx,%r15
mov    %rsi,%rbx
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%ebp
cmp    $0x64,%ebp
je     1167 <main+0x57>
test   %ebp,%ebp
je     1160 <main+0x50>
cmp    $0x1,%ebp
jne    1130 <main+0x20>
mov    $0x1,%esi
jmp    113c <main+0x2c>
nopl   0x0(%rax)
mov    $0x2,%esi
jmp    113c <main+0x2c>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

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