#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 /*<<< orphan*/ printf(char *, long, int /*<<< orphan*/, int);
int /*<<< orphan*/ seq(long);
int time(int /*<<< orphan*/ *);
int main() {
  int start;
  for (long i = 1; i < 1e10; i *= 10) {
    start = time(NULL);
    printf("seq(%ld) = %ld (%ld s)\n", i, seq(i), time(NULL) - start);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x1,-0x10(%rbp)
cvtsi2sdq -0x10(%rbp),%xmm1
movsd  0xeab(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    11ae <main+0x7e>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <seq@plt>
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    %eax,%ecx
sub    -0x8(%rbp),%ecx
lea    0xe6d(%rip),%rdi
call   1030 <printf@plt>
imul   $0xa,-0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1147 <main+0x17>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%ebx
mov    $0x1,%edi
call   1040 <seq@plt>
mov    %eax,%ebp
xor    %edi,%edi
call   1050 <time@plt>
sub    %ebx,%eax
lea    0xea7(%rip),%r14
mov    $0x1,%esi
mov    %r14,%rdi
mov    %ebp,%edx
mov    %eax,%ecx
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%ebp
mov    $0xa,%edi
call   1040 <seq@plt>
mov    %eax,%ebx
xor    %edi,%edi
call   1050 <time@plt>
sub    %ebp,%eax
mov    $0xa,%esi
mov    %r14,%rdi
mov    %ebx,%edx
mov    %eax,%ecx
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%ebx
mov    $0x64,%edi
call   1040 <seq@plt>
mov    %eax,%ebp
xor    %edi,%edi
call   1050 <time@plt>
sub    %ebx,%eax
mov    $0x64,%esi
mov    %r14,%rdi
mov    %ebp,%edx
mov    %eax,%ecx
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%ebx
mov    $0x3e8,%edi
call   1040 <seq@plt>
mov    %eax,%ebp
xor    %edi,%edi
call   1050 <time@plt>
sub    %ebx,%eax
mov    $0x3e8,%esi
mov    %r14,%rdi
mov    %ebp,%edx
mov    %eax,%ecx
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%ebx
mov    $0x2710,%edi
call   1040 <seq@plt>
mov    %eax,%ebp
xor    %edi,%edi
call   1050 <time@plt>
sub    %ebx,%eax
mov    $0x2710,%esi
mov    %r14,%rdi
mov    %ebp,%edx
mov    %eax,%ecx
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%ebx
mov    $0x186a0,%edi
call   1040 <seq@plt>
mov    %eax,%ebp
xor    %edi,%edi
call   1050 <time@plt>
sub    %ebx,%eax
mov    $0x186a0,%esi
mov    %r14,%rdi
mov    %ebp,%edx
mov    %eax,%ecx
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%ebx
mov    $0xf4240,%edi
call   1040 <seq@plt>
mov    %eax,%ebp
xor    %edi,%edi
call   1050 <time@plt>
sub    %ebx,%eax
mov    $0xf4240,%esi
mov    %r14,%rdi
mov    %ebp,%edx
mov    %eax,%ecx
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%ebx
mov    $0x989680,%edi
call   1040 <seq@plt>
mov    %eax,%ebp
xor    %edi,%edi
call   1050 <time@plt>
sub    %ebx,%eax
mov    $0x989680,%esi
mov    %r14,%rdi
mov    %ebp,%edx
mov    %eax,%ecx
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%ebx
mov    $0x5f5e100,%edi
call   1040 <seq@plt>
mov    %eax,%ebp
xor    %edi,%edi
call   1050 <time@plt>
sub    %ebx,%eax
mov    $0x5f5e100,%esi
mov    %r14,%rdi
mov    %ebp,%edx
mov    %eax,%ecx
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%ebx
mov    $0x3b9aca00,%edi
call   1040 <seq@plt>
mov    %eax,%ebp
xor    %edi,%edi
call   1050 <time@plt>
sub    %ebx,%eax
mov    $0x3b9aca00,%esi
mov    %r14,%rdi
mov    %ebp,%edx
mov    %eax,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [24 x i8] c"seq(%ld) = %ld (%ld s)\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
store i32 0, i32* %1
store i64 1, i64* %3
br label %4
4: ; preds = %17, %0
%5 = load i64, i64* %3
%6 = sitofp i64 %5 to double
%7 = fcmp olt double %6, 1.000000e+10
br i1 %7, label %8, label %20
8: ; preds = %4
%9 = call i32 @time(i32* null)
store i32 %9, i32* %2
%10 = load i64, i64* %3
%11 = load i64, i64* %3
%12 = call i32 @seq(i64 %11)
%13 = call i32 @time(i32* null)
%14 = load i32, i32* %2
%15 = sub nsw i32 %13, %14
%16 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i64 %10, i32 %12, i32 %15)
br label %17
17: ; preds = %8
%18 = load i64, i64* %3
%19 = mul nsw i64 %18, 10
store i64 %19, i64* %3
br label %4
20: ; preds = %4
%21 = load i32, i32* %1
ret i32 %21
}

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