#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 */
typedef scalar_t__ time_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, float, ...);
int /*<<< orphan*/ t();
scalar_t__ time(int /*<<< orphan*/ *);
main() {
  int limit = 100000000;
  int j;
  time_t t1, t2;
  t1 = time(NULL);
  for (j = 0; j < limit; j++) {
    t();
  }
  t2 = time(NULL);
  printf("%d %d\n", (int)t1, (int)t2);
  printf("%e\n", ((float)(t2 - t1)) / limit);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5f5e100,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    117b <main+0x4b>
mov    $0x0,%al
call   1030 <t@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    115a <main+0x2a>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cvtsi2ss %eax,%xmm0
mov    -0x20(%rbp),%rax
mov    %eax,%esi
lea    0xe63(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x20(%rbp),%rax
sub    -0x18(%rbp),%rax
cvtsi2ss %rax,%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
lea    0xe46(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %edi,%edi
call   1050 <time@plt>
mov    %rax,%r14
mov    $0x5f5e100,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1030 <t@plt>
add    $0xffffffff,%ebx
jne    1150 <main+0x20>
xor    %edi,%edi
call   1050 <time@plt>
mov    %rax,%rbx
cvtsi2ss %r14d,%xmm0
lea    0xe92(%rip),%rdi
mov    %ebx,%esi
mov    $0x1,%al
call   1040 <printf@plt>
sub    %r14,%rbx
xorps  %xmm0,%xmm0
cvtsi2ss %rbx,%xmm0
divss  0xe72(%rip),%xmm0
lea    0xe76(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%d %d\0A\00"
@.str.1 = [4 x i8] c"%e\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64
store i32 0, i32* %1
store i32 100000000, i32* %2
%6 = call i64 @time(i32* null)
store i64 %6, i64* %4
store i32 0, i32* %3
br label %7
7: ; preds = %13, %0
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = call i32 (...) @t()
br label %13
13: ; preds = %11
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %7
16: ; preds = %7
%17 = call i64 @time(i32* null)
store i64 %17, i64* %5
%18 = load i64, i64* %4
%19 = trunc i64 %18 to i32
%20 = sitofp i32 %19 to float
%21 = load i64, i64* %5
%22 = trunc i64 %21 to i32
%23 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), float %20, i32 %22)
%24 = load i64, i64* %5
%25 = load i64, i64* %4
%26 = sub nsw i64 %24, %25
%27 = sitofp i64 %26 to float
%28 = load i32, i32* %2
%29 = sitofp i32 %28 to float
%30 = fdiv float %27, %29
%31 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), float %30)
%32 = load i32, i32* %1
ret i32 %32
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d %d\0A\00"
@.str.1 = [4 x i8] c"%e\0A\00"
define i32 @main() {
%1 = tail call i64 @time(i32* null)
br label %2
2: ; preds = %0, %2
%3 = phi i32 [ 0, %0 ], [ %5, %2 ]
%4 = tail call i32 (...) @t()
%5 = add nuw nsw i32 %3, 1
%6 = icmp eq i32 %5, 100000000
br i1 %6, label %7, label %2
7: ; preds = %2
%8 = tail call i64 @time(i32* null)
%9 = trunc i64 %1 to i32
%10 = sitofp i32 %9 to float
%11 = trunc i64 %8 to i32
%12 = tail call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), float %10, i32 %11)
%13 = sub nsw i64 %8, %1
%14 = sitofp i64 %13 to float
%15 = fdiv float %14, 1.000000e+08
%16 = tail call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), float %15)
ret i32 0
}