#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() {
  long long a = 2;
  long long b = 1;
  int num_count = 1;
  long long lucas = 0;
  printf("%lld \n", a);
  printf("%lld \n", b);
  while (num_count < 100) {
    lucas = a + b;
    a = b;
    b = lucas;
    num_count++;
    printf("%d - %lld \n", num_count, lucas);
  }
  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)
movl   $0x1,-0x1c(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,%esi
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
mov    %eax,%esi
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x64,-0x1c(%rbp)
jge    11af <main+0x9f>
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
mov    -0x28(%rbp),%rdx
lea    0xe5d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1166 <main+0x56>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xee7(%rip),%rbx
mov    $0x2,%ebp
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    $0x2,%ebx
mov    $0x1,%eax
lea    0xeae(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rax,%r15
add    %rax,%rbx
mov    %r14,%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%ebp
mov    %rbx,%rax
mov    %r15,%rbx
cmp    $0x65,%ebp
jne    1160 <main+0x50>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

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