#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 main() {
  int num;
  long L0 = 2, L1 = 1, L = 0;
  printf("%li, %li, ", L0, L1);
  for (num = 0; num < 100; num++) {
    L = L0 + L1;
    L0 = L1;
    L1 = L;
    printf("%li, ", L1);
  }
  printf("\n");
  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)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    119a <main+0x8a>
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)
mov    -0x18(%rbp),%rsi
lea    0xe80(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1154 <main+0x44>
lea    0xe6a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
lea    0xed1(%rip),%rdi
mov    $0x2,%ebx
mov    $0x1,%r15d
mov    $0x2,%esi
mov    $0x1,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x64,%ebp
lea    0xeae(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    %r15,%r12
add    %r15,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%r15
mov    %r12,%rbx
add    $0xffffffff,%ebp
jne    1160 <main+0x40>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

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