#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 */
long long clock();
int /*<<< orphan*/ printf(char *, long long);
int /*<<< orphan*/ tribonacci(long long, long long);
int main(void) {
  long long int l = 0, r = 1;
  long long int start, end;
  for (int i = 0; i < 10; i++) {
    r *= 10;
    start = clock();
    tribonacci(l, r);
    end = clock();
    printf("end-start: %lld\n", end - start);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
movl   $0x0,-0x2c(%rbp)
cmpl   $0xa,-0x2c(%rbp)
jge    11ae <main+0x7e>
imul   $0xa,-0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <tribonacci@plt>
mov    $0x0,%al
call   1030 <clock@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rsi
sub    -0x20(%rbp),%rsi
lea    0xe65(%rip),%rdi
call   1040 <printf@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1156 <main+0x26>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <clock@plt>
mov    %rax,%rbx
mov    $0xa,%esi
xor    %edi,%edi
call   1050 <tribonacci@plt>
xor    %eax,%eax
call   1030 <clock@plt>
sub    %rbx,%rax
lea    0xea5(%rip),%r14
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <clock@plt>
mov    %rax,%rbx
mov    $0x64,%esi
xor    %edi,%edi
call   1050 <tribonacci@plt>
xor    %eax,%eax
call   1030 <clock@plt>
sub    %rbx,%rax
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <clock@plt>
mov    %rax,%rbx
mov    $0x3e8,%esi
xor    %edi,%edi
call   1050 <tribonacci@plt>
xor    %eax,%eax
call   1030 <clock@plt>
sub    %rbx,%rax
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <clock@plt>
mov    %rax,%rbx
mov    $0x2710,%esi
xor    %edi,%edi
call   1050 <tribonacci@plt>
xor    %eax,%eax
call   1030 <clock@plt>
sub    %rbx,%rax
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <clock@plt>
mov    %rax,%rbx
mov    $0x186a0,%esi
xor    %edi,%edi
call   1050 <tribonacci@plt>
xor    %eax,%eax
call   1030 <clock@plt>
sub    %rbx,%rax
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <clock@plt>
mov    %rax,%rbx
mov    $0xf4240,%esi
xor    %edi,%edi
call   1050 <tribonacci@plt>
xor    %eax,%eax
call   1030 <clock@plt>
sub    %rbx,%rax
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <clock@plt>
mov    %rax,%rbx
mov    $0x989680,%esi
xor    %edi,%edi
call   1050 <tribonacci@plt>
xor    %eax,%eax
call   1030 <clock@plt>
sub    %rbx,%rax
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <clock@plt>
mov    %rax,%rbx
mov    $0x5f5e100,%esi
xor    %edi,%edi
call   1050 <tribonacci@plt>
xor    %eax,%eax
call   1030 <clock@plt>
sub    %rbx,%rax
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <clock@plt>
mov    %rax,%rbx
mov    $0x3b9aca00,%esi
xor    %edi,%edi
call   1050 <tribonacci@plt>
xor    %eax,%eax
call   1030 <clock@plt>
sub    %rbx,%rax
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <clock@plt>
mov    %rax,%rbx
movabs $0x2540be400,%rsi
xor    %edi,%edi
call   1050 <tribonacci@plt>
xor    %eax,%eax
call   1030 <clock@plt>
sub    %rbx,%rax
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [17 x i8] c"end-start: %lld\0A\00"
define i32 @main() {
%1 = tail call i64 (...) @clock()
%2 = tail call i32 @tribonacci(i64 0, i64 10)
%3 = tail call i64 (...) @clock()
%4 = sub nsw i64 %3, %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i64 %4)
%6 = tail call i64 (...) @clock()
%7 = tail call i32 @tribonacci(i64 0, i64 100)
%8 = tail call i64 (...) @clock()
%9 = sub nsw i64 %8, %6
%10 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i64 %9)
%11 = tail call i64 (...) @clock()
%12 = tail call i32 @tribonacci(i64 0, i64 1000)
%13 = tail call i64 (...) @clock()
%14 = sub nsw i64 %13, %11
%15 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i64 %14)
%16 = tail call i64 (...) @clock()
%17 = tail call i32 @tribonacci(i64 0, i64 10000)
%18 = tail call i64 (...) @clock()
%19 = sub nsw i64 %18, %16
%20 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i64 %19)
%21 = tail call i64 (...) @clock()
%22 = tail call i32 @tribonacci(i64 0, i64 100000)
%23 = tail call i64 (...) @clock()
%24 = sub nsw i64 %23, %21
%25 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i64 %24)
%26 = tail call i64 (...) @clock()
%27 = tail call i32 @tribonacci(i64 0, i64 1000000)
%28 = tail call i64 (...) @clock()
%29 = sub nsw i64 %28, %26
%30 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i64 %29)
%31 = tail call i64 (...) @clock()
%32 = tail call i32 @tribonacci(i64 0, i64 10000000)
%33 = tail call i64 (...) @clock()
%34 = sub nsw i64 %33, %31
%35 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i64 %34)
%36 = tail call i64 (...) @clock()
%37 = tail call i32 @tribonacci(i64 0, i64 100000000)
%38 = tail call i64 (...) @clock()
%39 = sub nsw i64 %38, %36
%40 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i64 %39)
%41 = tail call i64 (...) @clock()
%42 = tail call i32 @tribonacci(i64 0, i64 1000000000)
%43 = tail call i64 (...) @clock()
%44 = sub nsw i64 %43, %41
%45 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i64 %44)
%46 = tail call i64 (...) @clock()
%47 = tail call i32 @tribonacci(i64 0, i64 10000000000)
%48 = tail call i64 (...) @clock()
%49 = sub nsw i64 %48, %46
%50 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i64 %49)
ret i32 0
}