#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 fibonacci(int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int input[] = {19, 9, 2,  16, 3,  8,  0,  6, 4,  17,
                 5,  1, 14, 12, 15, 13, 10, 7, 11, 18};
  int inputArraySize = sizeof input / sizeof input[0];
  int i = 0;
  for (i = 0; i < inputArraySize; i++) {
    int fiboNumber = fibonacci(input[i]);
    printf("%d\n", fiboNumber);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x60(%rbp),%rdi
lea    0xeaf(%rip),%rsi
mov    $0x50,%edx
call   1040 <memcpy@plt>
movl   $0x14,-0x64(%rbp)
movl   $0x0,-0x68(%rbp)
movl   $0x0,-0x68(%rbp)
mov    -0x68(%rbp),%eax
cmp    -0x64(%rbp),%eax
jge    11a9 <main+0x79>
movslq -0x68(%rbp),%rax
mov    -0x60(%rbp,%rax,4),%edi
call   1050 <fibonacci@plt>
mov    %eax,-0x6c(%rbp)
mov    -0x6c(%rbp),%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    -0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
jmp    1170 <main+0x40>
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
xor    %ebx,%ebx
lea    0xed2(%rip),%r15
lea    0xf1b(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%rbx,%r15,1),%edi
call   1040 <fibonacci@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    $0x4,%rbx
cmp    $0x50,%rbx
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@__const.main.input = [20 x i32] [i32 19, i32 9, i32 2, i32 16, i32 3, i32 8, i32 0, i32 6, i32 4, i32 17, i32 5, i32 1, i32 14, i32 12, i32 15, i32 13, i32 10, i32 7, i32 11, i32 18]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i64 [ 0, %2 ], [ %9, %3 ]
%5 = getelementptr inbounds [20 x i32], [20 x i32]* @__const.main.input, i64 0, i64 %4
%6 = load i32, i32* %5
%7 = tail call i32 @fibonacci(i32 %6)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = add nuw nsw i64 %4, 1
%10 = icmp eq i64 %9, 20
br i1 %10, label %11, label %3
11: ; preds = %3
ret i32 0
}