#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, ...);
int main() {
  unsigned long long int x, z, n;
  int i;
  x = 2;
  z = 1;
  printf("%llu\n", x);
  printf("%llu\n", z);
  for (i = 3; i <= 100; i++) {
    n = x + z;
    printf("%d - %llu\n", i, n);
    x = z;
    z = n;
  }
  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)
mov    -0x10(%rbp),%rax
mov    %eax,%esi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
mov    %eax,%esi
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x3,-0x24(%rbp)
cmpl   $0x64,-0x24(%rbp)
jg     11a7 <main+0x97>
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x24(%rbp),%esi
mov    -0x20(%rbp),%rdx
lea    0xe7e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    115e <main+0x4e>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xee6(%rip),%rbx
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%r12d
mov    $0x2,%eax
mov    $0x3,%ebx
lea    0xeac(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rax,%r15
add    %r12,%r15
mov    %r14,%rdi
mov    %ebx,%esi
mov    %r15,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%ebx
mov    %r12,%rax
mov    %r15,%r12
cmp    $0x65,%ebx
jne    1160 <main+0x50>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%llu\0A\00"
@.str.1 = [11 x i8] c"%d - %llu\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 2)
%2 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 1)
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 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, 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
}