#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__ clock_t;

/* Variables and functions */
double CLOCKS_PER_SEC;
scalar_t__ clock();
int /*<<< orphan*/ pr();
int /*<<< orphan*/ printf(char *, double, double);
int /*<<< orphan*/ td();
int main() {
  clock_t t;
  t = clock();
  td();
  t = clock() - t;
  double td_time = ((double)t) / CLOCKS_PER_SEC;
  t = clock();
  pr();
  t = clock() - t;
  double pr_time = ((double)t) / CLOCKS_PER_SEC;
  printf("pr: %f\ntd: %f", pr_time, td_time);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <td@plt>
mov    $0x0,%al
call   1030 <clock@plt>
sub    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
cvtsi2sdq -0x10(%rbp),%xmm0
mov    0x2e6b(%rip),%rax
divsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <pr@plt>
mov    $0x0,%al
call   1030 <clock@plt>
sub    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
cvtsi2sdq -0x10(%rbp),%xmm0
mov    0x2e34(%rip),%rax
divsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
lea    0xe32(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%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
xor    %eax,%eax
call   1060 <td@plt>
xor    %eax,%eax
call   1030 <clock@plt>
sub    %rbx,%rax
cvtsi2sd %rax,%xmm0
mov    0x2e7d(%rip),%r14
divsd  (%r14),%xmm0
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <clock@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <pr@plt>
xor    %eax,%eax
call   1030 <clock@plt>
sub    %rbx,%rax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
divsd  (%r14),%xmm0
lea    0xe5c(%rip),%rdi
movsd  (%rsp),%xmm1
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global double 0.000000e+00
@.str = [14 x i8] c"pr: %f\0Atd: %f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca double
%4 = alloca double
store i32 0, i32* %1
%5 = call i64 (...) @clock()
store i64 %5, i64* %2
%6 = call i32 (...) @td()
%7 = call i64 (...) @clock()
%8 = load i64, i64* %2
%9 = sub nsw i64 %7, %8
store i64 %9, i64* %2
%10 = load i64, i64* %2
%11 = sitofp i64 %10 to double
%12 = load double, double* @CLOCKS_PER_SEC
%13 = fdiv double %11, %12
store double %13, double* %3
%14 = call i64 (...) @clock()
store i64 %14, i64* %2
%15 = call i32 (...) @pr()
%16 = call i64 (...) @clock()
%17 = load i64, i64* %2
%18 = sub nsw i64 %16, %17
store i64 %18, i64* %2
%19 = load i64, i64* %2
%20 = sitofp i64 %19 to double
%21 = load double, double* @CLOCKS_PER_SEC
%22 = fdiv double %20, %21
store double %22, double* %4
%23 = load double, double* %4
%24 = load double, double* %3
%25 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), double %23, double %24)
ret i32 0
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global double 0.000000e+00
@.str = [14 x i8] c"pr: %f\0Atd: %f\00"
define i32 @main() {
%1 = tail call i64 (...) @clock()
%2 = tail call i32 (...) @td()
%3 = tail call i64 (...) @clock()
%4 = sub nsw i64 %3, %1
%5 = sitofp i64 %4 to double
%6 = load double, double* @CLOCKS_PER_SEC
%7 = fdiv double %5, %6
%8 = tail call i64 (...) @clock()
%9 = tail call i32 (...) @pr()
%10 = tail call i64 (...) @clock()
%11 = sub nsw i64 %10, %8
%12 = sitofp i64 %11 to double
%13 = load double, double* @CLOCKS_PER_SEC
%14 = fdiv double %12, %13
%15 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), double %14, double %7)
ret i32 0
}