#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 */
double exp(double);
double fabs(double);
double CDFkernelBDS_YR07(double t, double t1, double vt1, double lambda,
                         double mu, double rho) {
  double cdf, expmlt, small = 1e-20;
  if (fabs(lambda - mu) < small)
    cdf = (1 + rho * lambda * t1) * t / (t1 * (1 + rho * lambda * t));
  else {
    expmlt = exp((mu - lambda) * t);
    if (expmlt < 1e10)
      cdf = rho * lambda / vt1 * (1 - expmlt) /
            (rho * lambda + (lambda * (1 - rho) - mu) * expmlt);
    else {
      expmlt = 1 / expmlt;
      cdf = rho * lambda / vt1 * (expmlt - 1) /
            (rho * lambda * expmlt + (lambda * (1 - rho) - mu));
    }
  }
  return (cdf);
}


x86 assembly (clang, -O0):
<CDFkernelBDS_YR07>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  0xed2(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x20(%rbp),%xmm1
subsd  -0x28(%rbp),%xmm1
movaps 0xeac(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    11c1 <CDFkernelBDS_YR07+0xb1>
movsd  -0x30(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe9e(%rip),%xmm1
addsd  %xmm1,%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
mulsd  -0x20(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm3
mulsd  %xmm3,%xmm2
movsd  0xe75(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    12f9 <CDFkernelBDS_YR07+0x1e9>
movsd  -0x28(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  0xe36(%rip),%xmm0
ucomisd -0x40(%rbp),%xmm0
jbe    1268 <CDFkernelBDS_YR07+0x158>
movsd  -0x30(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  0xe1c(%rip),%xmm1
subsd  -0x40(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x30(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm3
movsd  -0x20(%rbp),%xmm2
movsd  0xdfc(%rip),%xmm5
subsd  -0x30(%rbp),%xmm5
movsd  -0x28(%rbp),%xmm4
movq   %xmm4,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm4
mulsd  %xmm5,%xmm2
addsd  %xmm4,%xmm2
mulsd  -0x40(%rbp),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    12f4 <CDFkernelBDS_YR07+0x1e4>
movsd  0xdb0(%rip),%xmm0
divsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x30(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
movsd  0xd8a(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x30(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm3
movsd  -0x20(%rbp),%xmm2
movsd  0xd66(%rip),%xmm5
subsd  -0x30(%rbp),%xmm5
movsd  -0x28(%rbp),%xmm4
movq   %xmm4,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm4
mulsd  %xmm5,%xmm2
addsd  %xmm4,%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    12f9 <CDFkernelBDS_YR07+0x1e9>
movsd  -0x38(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CDFkernelBDS_YR07>:
sub    $0x38,%rsp
movapd %xmm3,%xmm6
subsd  %xmm4,%xmm6
andpd  0xedc(%rip),%xmm6
movsd  0xf04(%rip),%xmm7
ucomisd %xmm6,%xmm7
jbe    1163 <CDFkernelBDS_YR07+0x53>
mulsd  %xmm5,%xmm3
unpcklpd %xmm3,%xmm3
movapd %xmm1,%xmm2
unpcklpd %xmm0,%xmm2
mulpd  %xmm3,%xmm2
addpd  0xed2(%rip),%xmm2
unpcklpd %xmm1,%xmm0
mulpd  %xmm2,%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
jmp    124b <CDFkernelBDS_YR07+0x13b>
movaps %xmm2,0x10(%rsp)
movsd  %xmm5,(%rsp)
movsd  %xmm4,0x8(%rsp)
movapd %xmm4,%xmm1
movapd %xmm3,0x20(%rsp)
subsd  %xmm3,%xmm1
mulsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <exp@plt>
movapd %xmm0,%xmm1
movsd  0xe9e(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    11ec <CDFkernelBDS_YR07+0xdc>
movapd 0x20(%rsp),%xmm4
movapd %xmm4,%xmm2
movsd  (%rsp),%xmm5
mulsd  %xmm5,%xmm2
movsd  0xe8d(%rip),%xmm3
movapd %xmm3,%xmm0
subsd  %xmm5,%xmm3
mulsd  %xmm4,%xmm3
subsd  0x8(%rsp),%xmm3
mulsd  %xmm1,%xmm3
addsd  %xmm2,%xmm3
divsd  0x10(%rsp),%xmm2
subsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm0
divsd  %xmm3,%xmm0
add    $0x38,%rsp
ret
movapd 0x20(%rsp),%xmm4
movapd %xmm4,%xmm2
movsd  (%rsp),%xmm5
mulsd  %xmm5,%xmm2
movapd 0xe09(%rip),%xmm3
movsd  %xmm2,%xmm3
movapd 0x10(%rsp),%xmm0
unpcklpd %xmm1,%xmm0
divpd  %xmm0,%xmm3
movapd %xmm3,%xmm0
unpckhpd %xmm3,%xmm0
mulsd  %xmm0,%xmm2
addsd  0xe13(%rip),%xmm0
mulsd  %xmm3,%xmm0
movsd  0xe0f(%rip),%xmm1
subsd  %xmm5,%xmm1
mulsd  %xmm4,%xmm1
subsd  0x8(%rsp),%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
add    $0x38,%rsp
ret

LLVM IR (-O0):
define double @CDFkernelBDS_YR07(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
store double 0x3BC79CA10C924223, double* %15
%16 = load double, double* %10
%17 = load double, double* %11
%18 = fsub double %16, %17
%19 = call double @llvm.fabs.f64(double %18)
%20 = load double, double* %15
%21 = fcmp olt double %19, %20
br i1 %21, label %22, label %38
22: ; preds = %6
%23 = load double, double* %12
%24 = load double, double* %10
%25 = fmul double %23, %24
%26 = load double, double* %8
%27 = call double @llvm.fmuladd.f64(double %25, double %26, double 1.000000e+00)
%28 = load double, double* %7
%29 = fmul double %27, %28
%30 = load double, double* %8
%31 = load double, double* %12
%32 = load double, double* %10
%33 = fmul double %31, %32
%34 = load double, double* %7
%35 = call double @llvm.fmuladd.f64(double %33, double %34, double 1.000000e+00)
%36 = fmul double %30, %35
%37 = fdiv double %29, %36
store double %37, double* %13
br label %92
38: ; preds = %6
%39 = load double, double* %11
%40 = load double, double* %10
%41 = fsub double %39, %40
%42 = load double, double* %7
%43 = fmul double %41, %42
%44 = call double @exp(double %43)
store double %44, double* %14
%45 = load double, double* %14
%46 = fcmp olt double %45, 1.000000e+10
br i1 %46, label %47, label %68
47: ; preds = %38
%48 = load double, double* %12
%49 = load double, double* %10
%50 = fmul double %48, %49
%51 = load double, double* %9
%52 = fdiv double %50, %51
%53 = load double, double* %14
%54 = fsub double 1.000000e+00, %53
%55 = fmul double %52, %54
%56 = load double, double* %12
%57 = load double, double* %10
%58 = load double, double* %10
%59 = load double, double* %12
%60 = fsub double 1.000000e+00, %59
%61 = load double, double* %11
%62 = fneg double %61
%63 = call double @llvm.fmuladd.f64(double %58, double %60, double %62)
%64 = load double, double* %14
%65 = fmul double %63, %64
%66 = call double @llvm.fmuladd.f64(double %56, double %57, double %65)
%67 = fdiv double %55, %66
store double %67, double* %13
br label %91
68: ; preds = %38
%69 = load double, double* %14
%70 = fdiv double 1.000000e+00, %69
store double %70, double* %14
%71 = load double, double* %12
%72 = load double, double* %10
%73 = fmul double %71, %72
%74 = load double, double* %9
%75 = fdiv double %73, %74
%76 = load double, double* %14
%77 = fsub double %76, 1.000000e+00
%78 = fmul double %75, %77
%79 = load double, double* %12
%80 = load double, double* %10
%81 = fmul double %79, %80
%82 = load double, double* %14
%83 = load double, double* %10
%84 = load double, double* %12
%85 = fsub double 1.000000e+00, %84
%86 = load double, double* %11
%87 = fneg double %86
%88 = call double @llvm.fmuladd.f64(double %83, double %85, double %87)
%89 = call double @llvm.fmuladd.f64(double %81, double %82, double %88)
%90 = fdiv double %78, %89
store double %90, double* %13
br label %91
91: ; preds = %68, %47
br label %92
92: ; preds = %91, %22
%93 = load double, double* %13
ret double %93
}

LLVM IR (-O2):
define double @CDFkernelBDS_YR07(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = fsub double %3, %4
%8 = tail call double @llvm.fabs.f64(double %7)
%9 = fcmp olt double %8, 0x3BC79CA10C924223
br i1 %9, label %10, label %23
10: ; preds = %6
%11 = fmul double %3, %5
%12 = insertelement <2 x double> poison, double %11, i64 0
%13 = shufflevector <2 x double> %12, <2 x double> poison, <2 x i32> zeroinitializer
%14 = insertelement <2 x double> poison, double %1, i64 0
%15 = insertelement <2 x double> %14, double %0, i64 1
%16 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %13, <2 x double> %15, <2 x double> <double 1.000000e+00, double 1.000000e+00>)
%17 = insertelement <2 x double> poison, double %0, i64 0
%18 = insertelement <2 x double> %17, double %1, i64 1
%19 = fmul <2 x double> %16, %18
%20 = extractelement <2 x double> %19, i64 0
%21 = extractelement <2 x double> %19, i64 1
%22 = fdiv double %20, %21
br label %54
23: ; preds = %6
%24 = fsub double %4, %3
%25 = fmul double %24, %0
%26 = tail call double @exp(double %25)
%27 = fcmp olt double %26, 1.000000e+10
br i1 %27, label %28, label %39
28: ; preds = %23
%29 = fmul double %3, %5
%30 = fdiv double %29, %2
%31 = fsub double 1.000000e+00, %26
%32 = fmul double %30, %31
%33 = fsub double 1.000000e+00, %5
%34 = fneg double %4
%35 = tail call double @llvm.fmuladd.f64(double %3, double %33, double %34)
%36 = fmul double %35, %26
%37 = tail call double @llvm.fmuladd.f64(double %5, double %3, double %36)
%38 = fdiv double %32, %37
br label %54
39: ; preds = %23
%40 = fmul double %3, %5
%41 = insertelement <2 x double> <double poison, double 1.000000e+00>, double %40, i64 0
%42 = insertelement <2 x double> poison, double %2, i64 0
%43 = insertelement <2 x double> %42, double %26, i64 1
%44 = fdiv <2 x double> %41, %43
%45 = extractelement <2 x double> %44, i64 1
%46 = fadd double %45, -1.000000e+00
%47 = extractelement <2 x double> %44, i64 0
%48 = fmul double %47, %46
%49 = fsub double 1.000000e+00, %5
%50 = fneg double %4
%51 = tail call double @llvm.fmuladd.f64(double %3, double %49, double %50)
%52 = tail call double @llvm.fmuladd.f64(double %40, double %45, double %51)
%53 = fdiv double %48, %52
br label %54
54: ; preds = %28, %39, %10
%55 = phi double [ %22, %10 ], [ %38, %28 ], [ %53, %39 ]
ret double %55
}