#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 CountFib1(int);
int /*<<< orphan*/ CountFib2(int);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char const *argv[]) {
  printf("%s\n", "Number of calls:");
  printf("%4s%10s%10s\n", "N", "Fib1", "Fib2");
  printf("%4s%10s%10s\n", "--", "-----", "-----");
  for (int i = 0; i <= 12; i++) {
    printf("%4d%10d%10d\n", i, CountFib1(i), CountFib2(i));
  }
  return 0;
}


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)
lea    0xeb3(%rip),%rdi
lea    0xeb0(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb3(%rip),%rdi
lea    0xeb9(%rip),%rsi
lea    0xeb4(%rip),%rdx
lea    0xeb2(%rip),%rcx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe90(%rip),%rdi
lea    0xea5(%rip),%rsi
lea    0xe9b(%rip),%rcx
mov    %rcx,%rdx
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0xc,-0x14(%rbp)
jg     11eb <main+0xbb>
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <CountFib1@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <CountFib2@plt>
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    %eax,%ecx
lea    0xe5e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11a4 <main+0x74>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xeb6(%rip),%rdi
call   1030 <puts@plt>
lea    0xebb(%rip),%rbx
lea    0xec1(%rip),%rsi
lea    0xebc(%rip),%rdx
lea    0xeba(%rip),%rcx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb1(%rip),%rsi
lea    0xea7(%rip),%rcx
mov    %rbx,%rdi
mov    %rcx,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <CountFib1@plt>
mov    %eax,%ebp
xor    %edi,%edi
call   1060 <CountFib2@plt>
lea    0xe89(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    %ebp,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <CountFib1@plt>
mov    %eax,%ebp
mov    $0x1,%edi
call   1060 <CountFib2@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %ebp,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x2,%edi
call   1050 <CountFib1@plt>
mov    %eax,%ebp
mov    $0x2,%edi
call   1060 <CountFib2@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    %ebp,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x3,%edi
call   1050 <CountFib1@plt>
mov    %eax,%ebp
mov    $0x3,%edi
call   1060 <CountFib2@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    %ebp,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x4,%edi
call   1050 <CountFib1@plt>
mov    %eax,%ebp
mov    $0x4,%edi
call   1060 <CountFib2@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    %ebp,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x5,%edi
call   1050 <CountFib1@plt>
mov    %eax,%ebp
mov    $0x5,%edi
call   1060 <CountFib2@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
mov    %ebp,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x6,%edi
call   1050 <CountFib1@plt>
mov    %eax,%ebp
mov    $0x6,%edi
call   1060 <CountFib2@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
mov    %ebp,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x7,%edi
call   1050 <CountFib1@plt>
mov    %eax,%ebp
mov    $0x7,%edi
call   1060 <CountFib2@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
mov    %ebp,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x8,%edi
call   1050 <CountFib1@plt>
mov    %eax,%ebp
mov    $0x8,%edi
call   1060 <CountFib2@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
mov    %ebp,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x9,%edi
call   1050 <CountFib1@plt>
mov    %eax,%ebp
mov    $0x9,%edi
call   1060 <CountFib2@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
mov    %ebp,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1050 <CountFib1@plt>
mov    %eax,%ebp
mov    $0xa,%edi
call   1060 <CountFib2@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
mov    %ebp,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xb,%edi
call   1050 <CountFib1@plt>
mov    %eax,%ebp
mov    $0xb,%edi
call   1060 <CountFib2@plt>
mov    %rbx,%rdi
mov    $0xb,%esi
mov    %ebp,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xc,%edi
call   1050 <CountFib1@plt>
mov    %eax,%ebp
mov    $0xc,%edi
call   1060 <CountFib2@plt>
mov    %rbx,%rdi
mov    $0xc,%esi
mov    %ebp,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [17 x i8] c"Number of calls:\00"
@.str.2 = [13 x i8] c"%4s%10s%10s\0A\00"
@.str.3 = [2 x i8] c"N\00"
@.str.4 = [5 x i8] c"Fib1\00"
@.str.5 = [5 x i8] c"Fib2\00"
@.str.6 = [3 x i8] c"--\00"
@.str.7 = [6 x i8] c"-----\00"
@.str.8 = [13 x i8] c"%4d%10d%10d\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
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
store i32 0, i32* %6
br label %10
10: ; preds = %20, %2
%11 = load i32, i32* %6
%12 = icmp sle i32 %11, 12
br i1 %12, label %13, label %23
13: ; preds = %10
%14 = load i32, i32* %6
%15 = load i32, i32* %6
%16 = call i32 @CountFib1(i32 %15)
%17 = load i32, i32* %6
%18 = call i32 @CountFib2(i32 %17)
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i32 %14, i32 %16, i32 %18)
br label %20
20: ; preds = %13
%21 = load i32, i32* %6
%22 = add nsw i32 %21, 1
store i32 %22, i32* %6
br label %10
23: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [17 x i8] c"Number of calls:\00"
@.str.2 = [13 x i8] c"%4s%10s%10s\0A\00"
@.str.3 = [2 x i8] c"N\00"
@.str.4 = [5 x i8] c"Fib1\00"
@.str.5 = [5 x i8] c"Fib2\00"
@.str.6 = [3 x i8] c"--\00"
@.str.7 = [6 x i8] c"-----\00"
@.str.8 = [13 x i8] c"%4d%10d%10d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%6 = tail call i32 @CountFib1(i32 0)
%7 = tail call i32 @CountFib2(i32 0)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i32 0, i32 %6, i32 %7)
%9 = tail call i32 @CountFib1(i32 1)
%10 = tail call i32 @CountFib2(i32 1)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i32 1, i32 %9, i32 %10)
%12 = tail call i32 @CountFib1(i32 2)
%13 = tail call i32 @CountFib2(i32 2)
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i32 2, i32 %12, i32 %13)
%15 = tail call i32 @CountFib1(i32 3)
%16 = tail call i32 @CountFib2(i32 3)
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i32 3, i32 %15, i32 %16)
%18 = tail call i32 @CountFib1(i32 4)
%19 = tail call i32 @CountFib2(i32 4)
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i32 4, i32 %18, i32 %19)
%21 = tail call i32 @CountFib1(i32 5)
%22 = tail call i32 @CountFib2(i32 5)
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i32 5, i32 %21, i32 %22)
%24 = tail call i32 @CountFib1(i32 6)
%25 = tail call i32 @CountFib2(i32 6)
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i32 6, i32 %24, i32 %25)
%27 = tail call i32 @CountFib1(i32 7)
%28 = tail call i32 @CountFib2(i32 7)
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i32 7, i32 %27, i32 %28)
%30 = tail call i32 @CountFib1(i32 8)
%31 = tail call i32 @CountFib2(i32 8)
%32 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i32 8, i32 %30, i32 %31)
%33 = tail call i32 @CountFib1(i32 9)
%34 = tail call i32 @CountFib2(i32 9)
%35 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i32 9, i32 %33, i32 %34)
%36 = tail call i32 @CountFib1(i32 10)
%37 = tail call i32 @CountFib2(i32 10)
%38 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i32 10, i32 %36, i32 %37)
%39 = tail call i32 @CountFib1(i32 11)
%40 = tail call i32 @CountFib2(i32 11)
%41 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i32 11, i32 %39, i32 %40)
%42 = tail call i32 @CountFib1(i32 12)
%43 = tail call i32 @CountFib2(i32 12)
%44 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i32 12, i32 %42, i32 %43)
ret i32 0
}