#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 */
scalar_t__ fibonacci(int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int sum = 0;
#pragma omp parallel for reduction(+ : sum)
  for (int i = 0; i < 11; i++) {
    sum += fibonacci(i);
  }
  printf("%d\n", sum);
}


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   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0xb,-0x18(%rbp)
jge    1171 <main+0x51>
mov    -0x18(%rbp),%edi
call   1040 <fibonacci@plt>
mov    %rax,%rcx
movslq -0x14(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1144 <main+0x24>
mov    -0x14(%rbp),%esi
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %edi,%edi
call   1040 <fibonacci@plt>
mov    %rax,%rbx
mov    $0x1,%edi
call   1040 <fibonacci@plt>
add    %eax,%ebx
mov    $0x2,%edi
call   1040 <fibonacci@plt>
add    %eax,%ebx
mov    $0x3,%edi
call   1040 <fibonacci@plt>
add    %eax,%ebx
mov    $0x4,%edi
call   1040 <fibonacci@plt>
add    %eax,%ebx
mov    $0x5,%edi
call   1040 <fibonacci@plt>
add    %eax,%ebx
mov    $0x6,%edi
call   1040 <fibonacci@plt>
add    %eax,%ebx
mov    $0x7,%edi
call   1040 <fibonacci@plt>
add    %eax,%ebx
mov    $0x8,%edi
call   1040 <fibonacci@plt>
add    %eax,%ebx
mov    $0x9,%edi
call   1040 <fibonacci@plt>
add    %eax,%ebx
mov    $0xa,%edi
call   1040 <fibonacci@plt>
add    %eax,%ebx
lea    0xe56(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @fibonacci(i32 0)
%4 = trunc i64 %3 to i32
%5 = tail call i64 @fibonacci(i32 1)
%6 = trunc i64 %5 to i32
%7 = add i32 %4, %6
%8 = tail call i64 @fibonacci(i32 2)
%9 = trunc i64 %8 to i32
%10 = add i32 %7, %9
%11 = tail call i64 @fibonacci(i32 3)
%12 = trunc i64 %11 to i32
%13 = add i32 %10, %12
%14 = tail call i64 @fibonacci(i32 4)
%15 = trunc i64 %14 to i32
%16 = add i32 %13, %15
%17 = tail call i64 @fibonacci(i32 5)
%18 = trunc i64 %17 to i32
%19 = add i32 %16, %18
%20 = tail call i64 @fibonacci(i32 6)
%21 = trunc i64 %20 to i32
%22 = add i32 %19, %21
%23 = tail call i64 @fibonacci(i32 7)
%24 = trunc i64 %23 to i32
%25 = add i32 %22, %24
%26 = tail call i64 @fibonacci(i32 8)
%27 = trunc i64 %26 to i32
%28 = add i32 %25, %27
%29 = tail call i64 @fibonacci(i32 9)
%30 = trunc i64 %29 to i32
%31 = add i32 %28, %30
%32 = tail call i64 @fibonacci(i32 10)
%33 = trunc i64 %32 to i32
%34 = add i32 %31, %33
%35 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %34)
ret i32 0
}