#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 argc, char **argv) {
  int prev_1, prev_2, fib_num;
  prev_1 = 1;
  prev_2 = 1;
  printf("%d, %d, ", prev_1, prev_2);
  fib_num = prev_1 + prev_2;
  do {
    prev_2 = prev_1;
    prev_1 = fib_num;
    fib_num = prev_1 + prev_2;
    printf("%d, ", fib_num);
  } while (fib_num < 100);
  printf("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x64,-0x1c(%rbp)
jl     1151 <main+0x41>
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xed2(%rip),%rdi
mov    $0x1,%r15d
mov    $0x1,%esi
mov    $0x1,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x2,%ebx
lea    0xeb3(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r15d,%ebp
add    %ebx,%ebp
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebx,%r15d
mov    %ebp,%ebx
cmp    $0x64,%ebp
jl     1160 <main+0x40>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

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