#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 lukas, first = 2, second = 1, i;
  for (i = 0; i <= 100; i++) {
    if (i <= 1) {
      if (i == 0)
        lukas = 2;
      else
        lukas = 1;
    } else {
      lukas = first + second;
      first = second;
      second = lukas;
    }
    printf("%lu, ", lukas);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x2,-0x18(%rbp)
movq   $0x1,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
cmpq   $0x64,-0x28(%rbp)
ja     11af <main+0x9f>
cmpq   $0x1,-0x28(%rbp)
ja     1172 <main+0x62>
cmpq   $0x0,-0x28(%rbp)
jne    1165 <main+0x55>
movq   $0x2,-0x10(%rbp)
jmp    116d <main+0x5d>
movq   $0x1,-0x10(%rbp)
jmp    118e <main+0x7e>
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    0xe67(%rip),%rdi
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1137 <main+0x27>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    $0x2,%r15d
mov    $0x1,%r12d
xor    %ebx,%ebx
lea    0xed3(%rip),%r14
nopl   (%rax)
cmp    $0x1,%rbx
mov    $0x1,%esi
adc    $0x0,%rsi
lea    (%r12,%r15,1),%rax
cmp    $0x2,%rbx
cmovae %rax,%rsi
cmovae %r12,%r15
cmovae %rax,%r12
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    $0x65,%rbx
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
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 i64
store i32 0, i32* %1
store i64 2, i64* %3
store i64 1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %27, %0
%7 = load i64, i64* %5
%8 = icmp ule i64 %7, 100
br i1 %8, label %9, label %30
9: ; preds = %6
%10 = load i64, i64* %5
%11 = icmp ule i64 %10, 1
br i1 %11, label %12, label %18
12: ; preds = %9
%13 = load i64, i64* %5
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %12
store i64 2, i64* %2
br label %17
16: ; preds = %12
store i64 1, i64* %2
br label %17
17: ; preds = %16, %15
br label %24
18: ; preds = %9
%19 = load i64, i64* %3
%20 = load i64, i64* %4
%21 = add i64 %19, %20
store i64 %21, i64* %2
%22 = load i64, i64* %4
store i64 %22, i64* %3
%23 = load i64, i64* %2
store i64 %23, i64* %4
br label %24
24: ; preds = %18, %17
%25 = load i64, i64* %2
%26 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %25)
br label %27
27: ; preds = %24
%28 = load i64, i64* %5
%29 = add i64 %28, 1
store i64 %29, i64* %5
br label %6
30: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%lu, \00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i64 [ 0, %0 ], [ %13, %1 ]
%3 = phi i64 [ 1, %0 ], [ %11, %1 ]
%4 = phi i64 [ 2, %0 ], [ %10, %1 ]
%5 = icmp ult i64 %2, 2
%6 = add i64 %3, %4
%7 = icmp eq i64 %2, 0
%8 = select i1 %7, i64 2, i64 1
%9 = select i1 %5, i64 %8, i64 %6
%10 = select i1 %5, i64 %4, i64 %3
%11 = select i1 %5, i64 %3, i64 %6
%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 i64 %2, 1
%14 = icmp eq i64 %13, 101
br i1 %14, label %15, label %1
15: ; preds = %1
ret i32 0
}