#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 */
double era_sinh(double);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, double, double, double,
                           double);
double sinh(double);
void errorTestCase(double tmp, double *worstError, double *index, FILE *fp) {
  double ourResult = era_sinh(tmp);
  double stdResult = sinh(tmp);
  double currError = 1 - (ourResult / stdResult);
  if (currError > *worstError) {
    *worstError = currError;
    *index = tmp;
  }
  fprintf(fp, "%.17g,%e,%e,%e\n", tmp, ourResult, stdResult, currError);
}


x86 assembly (clang, -O0):
<errorTestCase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1050 <era_sinh@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sinh@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm1
divsd  -0x30(%rbp),%xmm1
movsd  0xe87(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
mov    -0x10(%rbp),%rax
ucomisd (%rax),%xmm0
jbe    11af <errorTestCase+0x7f>
movsd  -0x38(%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  -0x38(%rbp),%xmm3
lea    0xe3a(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<errorTestCase>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  %xmm0,(%rsp)
call   1050 <era_sinh@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
call   1030 <sinh@plt>
movsd  0x8(%rsp),%xmm1
movapd %xmm0,%xmm2
movapd %xmm1,%xmm0
divsd  %xmm2,%xmm0
movsd  0xe8a(%rip),%xmm3
subsd  %xmm0,%xmm3
movsd  (%rsp),%xmm0
ucomisd (%rbx),%xmm3
jbe    118e <errorTestCase+0x5e>
movsd  %xmm3,(%rbx)
movsd  %xmm0,(%r14)
lea    0xe73(%rip),%rsi
mov    %r15,%rdi
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <fprintf@plt>

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

LLVM IR (-O2):
@.str = [16 x i8] c"%.17g,%e,%e,%e\0A\00"
define void @errorTestCase(double %0, double* nocapture %1, double* nocapture writeonly %2, i32* nocapture %3) {
%5 = tail call double @era_sinh(double %0)
%6 = tail call double @sinh(double %0)
%7 = fdiv double %5, %6
%8 = fsub double 1.000000e+00, %7
%9 = load double, double* %1
%10 = fcmp ogt double %8, %9
br i1 %10, label %11, label %12
11: ; preds = %4
store double %8, double* %1
store double %0, double* %2
br label %12
12: ; preds = %11, %4
%13 = 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 %8)
ret void
}