#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() {
  int g, d, g1, d1;
  char i;
  g = 1;
  d = 2;
  i = 0;
  printf("%d, ", g);
  while (i < 100) {
    g1 = g + d;
    d1 = g;
    g = g1;
    d = d1;
    i = i + 1;
    printf("%d, ", g);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
movb   $0x0,-0x15(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
movsbl -0x15(%rbp),%eax
cmp    $0x64,%eax
jge    1186 <main+0x76>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0xc(%rbp)
movsbl -0x15(%rbp),%eax
add    $0x1,%eax
mov    %al,-0x15(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
jmp    1140 <main+0x30>
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    0xee1(%rip),%r14
mov    $0x1,%r15d
mov    %r14,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    $0x2,%ebp
mov    $0xff000000,%ebx
nopl   0x0(%rax)
mov    %r15d,%r12d
add    %r15d,%ebp
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
add    $0x1000000,%ebx
mov    %ebp,%r15d
mov    %r12d,%ebp
cmp    $0x63000000,%ebx
jb     1140 <main+0x30>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

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