#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 EXIT_SUCCESS;
long long FibGenerator(int /*<<< orphan*/);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, long long);
int main(void) {
  long long fibc[40] = {0};
  for (int i = 0; i < 40; ++i) {
    fibc[i] = FibGenerator(0);
    printf("%lld\n", fibc[i]);
  }
  getchar();
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x160,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x150(%rbp),%rdi
xor    %esi,%esi
mov    $0x140,%edx
call   1050 <memset@plt>
movl   $0x0,-0x154(%rbp)
cmpl   $0x28,-0x154(%rbp)
jge    11c4 <main+0x84>
xor    %edi,%edi
call   1030 <FibGenerator@plt>
mov    %rax,%rcx
movslq -0x154(%rbp),%rax
mov    %rcx,-0x150(%rbp,%rax,8)
ff
movslq -0x154(%rbp),%rax
mov    -0x150(%rbp,%rax,8),%rsi
ff
lea    0xe55(%rip),%rdi
call   1040 <printf@plt>
mov    -0x154(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x154(%rbp)
jmp    116f <main+0x2f>
mov    $0x0,%al
call   1060 <getchar@plt>
mov    0x2e0e(%rip),%rax
mov    (%rax),%eax
add    $0x160,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x28,%ebp
lea    0xec1(%rip),%rbx
nop
xor    %edi,%edi
call   1030 <FibGenerator@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
add    $0xffffffff,%ebp
jne    1140 <main+0x10>
xor    %eax,%eax
call   1050 <getchar@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

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