#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 int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, double, double, double,
                           double);
double ourDuration_SpeedTest(double);
double stdDuration_SpeedTest(double);
void speedTestCase(double tmp, double *worstSpeed, double *index, FILE *fp) {
  double ourSpeed = ourDuration_SpeedTest(tmp);
  double stdSpeed = stdDuration_SpeedTest(tmp);
  if (ourSpeed - stdSpeed > *worstSpeed) {
    *worstSpeed = ourSpeed - stdSpeed;
    *index = tmp;
  }
  fprintf(fp, "%.17g,%e,%e,%e\n", tmp, ourSpeed, stdSpeed, ourSpeed - stdSpeed);
}


x86 assembly (clang, -O0):
<speedTestCase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <ourDuration_SpeedTest@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <stdDuration_SpeedTest@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
mov    -0x10(%rbp),%rax
ucomisd (%rax),%xmm0
jbe    119e <speedTestCase+0x6e>
movsd  -0x28(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x8(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rdi
movsd  -0x8(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm3
subsd  -0x30(%rbp),%xmm3
lea    0xe3e(%rip),%rsi
call   1050 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<speedTestCase>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  %xmm0,(%rsp)
call   1030 <ourDuration_SpeedTest@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
call   1040 <stdDuration_SpeedTest@plt>
movsd  0x8(%rsp),%xmm1
movapd %xmm0,%xmm2
movsd  (%rsp),%xmm0
movapd %xmm1,%xmm3
subsd  %xmm2,%xmm3
ucomisd (%rbx),%xmm3
jbe    1182 <speedTestCase+0x52>
movsd  %xmm3,(%rbx)
movsd  %xmm0,(%r14)
lea    0xe77(%rip),%rsi
mov    %r15,%rdi
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <fprintf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"%.17g,%e,%e,%e\0A\00"
define void @speedTestCase(double %0, double* %1, double* %2, i32* %3) {
%5 = alloca double
%6 = alloca double*
%7 = alloca double*
%8 = alloca i32*
%9 = alloca double
%10 = alloca double
store double %0, double* %5
store double* %1, double** %6
store double* %2, double** %7
store i32* %3, i32** %8
%11 = load double, double* %5
%12 = call double @ourDuration_SpeedTest(double %11)
store double %12, double* %9
%13 = load double, double* %5
%14 = call double @stdDuration_SpeedTest(double %13)
store double %14, double* %10
%15 = load double, double* %9
%16 = load double, double* %10
%17 = fsub double %15, %16
%18 = load double*, double** %6
%19 = load double, double* %18
%20 = fcmp ogt double %17, %19
br i1 %20, label %21, label %28
21: ; preds = %4
%22 = load double, double* %9
%23 = load double, double* %10
%24 = fsub double %22, %23
%25 = load double*, double** %6
store double %24, double* %25
%26 = load double, double* %5
%27 = load double*, double** %7
store double %26, double* %27
br label %28
28: ; preds = %21, %4
%29 = load i32*, i32** %8
%30 = load double, double* %5
%31 = load double, double* %9
%32 = load double, double* %10
%33 = load double, double* %9
%34 = load double, double* %10
%35 = fsub double %33, %34
%36 = call i32 @fprintf(i32* %29, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %30, double %31, double %32, double %35)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"%.17g,%e,%e,%e\0A\00"
define void @speedTestCase(double %0, double* nocapture %1, double* nocapture writeonly %2, i32* nocapture %3) {
%5 = tail call double @ourDuration_SpeedTest(double %0)
%6 = tail call double @stdDuration_SpeedTest(double %0)
%7 = fsub double %5, %6
%8 = load double, double* %1
%9 = fcmp ogt double %7, %8
br i1 %9, label %10, label %11
10: ; preds = %4
store double %7, double* %1
store double %0, double* %2
br label %11
11: ; preds = %10, %4
%12 = tail call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %0, double %5, double %6, double %7)
ret void
}