#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 *, int, unsigned long);
int main() {
  unsigned long pre, pop, tek;
  int i;
  pre = 1;
  pop = 2;
  tek = 0;
  printf("%d - %lu\n", 1, pre);
  printf("%d - %lu\n", 2, pop);
  for (i = 3; i <= 100; i++) {
    tek = pre + pop;
    printf("%d - %lu\n", i, tek);
    pop = pre;
    pre = tek;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x1,-0x10(%rbp)
movq   $0x2,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%rdx
lea    0xebe(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rdx
lea    0xea9(%rip),%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
movl   $0x3,-0x24(%rbp)
cmpl   $0x64,-0x24(%rbp)
jg     11af <main+0x9f>
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x24(%rbp),%esi
mov    -0x20(%rbp),%rdx
lea    0xe74(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1168 <main+0x58>
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),%r14
mov    $0x1,%r15d
mov    $0x1,%edx
mov    %r14,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    $0x2,%r12d
mov    $0x2,%edx
mov    %r14,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    $0x3,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r12,%rbx
add    %r15,%rbx
mov    %r14,%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
call   1030 <printf@plt>
add    $0x1,%ebp
mov    %r15,%r12
mov    %rbx,%r15
cmp    $0x65,%ebp
jne    1160 <main+0x50>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

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