#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 fib(int);
int /*<<< orphan*/ printf(char *, int, int);
int sumOfFib(int);
int sumOfFib2(int);
int sumOfFib3(int);
int main(int argc, char *argv[]) {
  for (int i = 0; i < 10; i++) {
    printf("    Fibonacci of %d:%d\n", i, fib(i));
    printf("SumFibonacci  of %d:%d\n", i, sumOfFib(i));
    printf("SumFibonacci2 of %d:%d\n", i, sumOfFib2(i));
    printf("SumFibonacci3 of %d:%d\n", i, sumOfFib3(i));
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    1201 <main+0xb1>
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <fib@plt>
mov    -0x24(%rbp),%esi
mov    %eax,%edx
lea    0xe6f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x14(%rbp),%edi
call   1070 <sumOfFib@plt>
mov    -0x20(%rbp),%esi
mov    %eax,%edx
lea    0xe68(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%edi
call   1060 <sumOfFib2@plt>
mov    -0x1c(%rbp),%esi
mov    %eax,%edx
lea    0xe61(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <sumOfFib3@plt>
mov    -0x18(%rbp),%esi
mov    %eax,%edx
lea    0xe5a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    116d <main+0x1d>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
xor    %ebx,%ebx
lea    0xe9e(%rip),%r14
lea    0xeaf(%rip),%r15
lea    0xec0(%rip),%r12
lea    0xed1(%rip),%r13
nopw   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1050 <fib@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    %ebx,%edi
call   1070 <sumOfFib@plt>
mov    %r15,%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    %ebx,%edi
call   1060 <sumOfFib2@plt>
mov    %r12,%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <sumOfFib3@plt>
mov    %r13,%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0xa,%ebx
jne    1180 <main+0x30>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [24 x i8] c" Fibonacci of %d:%d\0A\00"
@.str.1 = [24 x i8] c"SumFibonacci of %d:%d\0A\00"
@.str.2 = [24 x i8] c"SumFibonacci2 of %d:%d\0A\00"
@.str.3 = [24 x i8] c"SumFibonacci3 of %d:%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %4
3: ; preds = %4
ret i32 0
4: ; preds = %2, %4
%5 = phi i32 [ 0, %2 ], [ %14, %4 ]
%6 = tail call i32 @fib(i32 %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = tail call i32 @sumOfFib(i32 %5)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %8)
%10 = tail call i32 @sumOfFib2(i32 %5)
%11 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %10)
%12 = tail call i32 @sumOfFib3(i32 %5)
%13 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i32 %5, i32 %12)
%14 = add nuw nsw i32 %5, 1
%15 = icmp eq i32 %14, 10
br i1 %15, label %3, label %4
}