#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 CDFkernelBD(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);
    cdf = rho * lambda / vt1 * (1 - expmlt) /
          (rho * lambda + (lambda * (1 - rho) - mu) * expmlt);
  }
  return (cdf);
}


x86 assembly (clang, -O0):
<CDFkernelBD>:
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 <CDFkernelBD+0xb1>
movsd  -0x30(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe96(%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  0xe6d(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    1250 <CDFkernelBD+0x140>
movsd  -0x28(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  -0x30(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  0xe27(%rip),%xmm1
subsd  -0x40(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x30(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm3
movsd  -0x20(%rbp),%xmm2
movsd  0xe07(%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)
movsd  -0x38(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CDFkernelBD>:
sub    $0x38,%rsp
movapd %xmm3,%xmm6
subsd  %xmm4,%xmm6
andpd  0xedc(%rip),%xmm6
movsd  0xef4(%rip),%xmm7
ucomisd %xmm6,%xmm7
jbe    1167 <CDFkernelBD+0x57>
mulsd  %xmm5,%xmm3
unpcklpd %xmm3,%xmm3
movapd %xmm1,%xmm2
unpcklpd %xmm0,%xmm2
mulpd  %xmm3,%xmm2
addpd  0xec2(%rip),%xmm2
unpcklpd %xmm1,%xmm0
mulpd  %xmm2,%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
divsd  %xmm1,%xmm0
add    $0x38,%rsp
ret
movapd %xmm4,%xmm1
subsd  %xmm3,%xmm1
mulsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
movapd %xmm3,0x20(%rsp)
movsd  %xmm4,0x10(%rsp)
movsd  %xmm2,0x18(%rsp)
movsd  %xmm5,0x8(%rsp)
call   1030 <exp@plt>
movapd %xmm0,%xmm1
movapd 0x20(%rsp),%xmm4
movapd %xmm4,%xmm2
movsd  0x8(%rsp),%xmm5
mulsd  %xmm5,%xmm2
movsd  0xe74(%rip),%xmm3
movapd %xmm3,%xmm0
subsd  %xmm5,%xmm3
mulsd  %xmm4,%xmm3
subsd  0x10(%rsp),%xmm3
mulsd  %xmm1,%xmm3
addsd  %xmm2,%xmm3
divsd  0x18(%rsp),%xmm2
subsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm0
divsd  %xmm3,%xmm0
add    $0x38,%rsp
ret

LLVM IR (-O0):
define double @CDFkernelBD(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 %65
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* %12
%46 = load double, double* %10
%47 = fmul double %45, %46
%48 = load double, double* %9
%49 = fdiv double %47, %48
%50 = load double, double* %14
%51 = fsub double 1.000000e+00, %50
%52 = fmul double %49, %51
%53 = load double, double* %12
%54 = load double, double* %10
%55 = load double, double* %10
%56 = load double, double* %12
%57 = fsub double 1.000000e+00, %56
%58 = load double, double* %11
%59 = fneg double %58
%60 = call double @llvm.fmuladd.f64(double %55, double %57, double %59)
%61 = load double, double* %14
%62 = fmul double %60, %61
%63 = call double @llvm.fmuladd.f64(double %53, double %54, double %62)
%64 = fdiv double %52, %63
store double %64, double* %13
br label %65
65: ; preds = %38, %22
%66 = load double, double* %13
ret double %66
}

LLVM IR (-O2):
define double @CDFkernelBD(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 %37
23: ; preds = %6
%24 = fsub double %4, %3
%25 = fmul double %24, %0
%26 = tail call double @exp(double %25)
%27 = fmul double %3, %5
%28 = fdiv double %27, %2
%29 = fsub double 1.000000e+00, %26
%30 = fmul double %28, %29
%31 = fsub double 1.000000e+00, %5
%32 = fneg double %4
%33 = tail call double @llvm.fmuladd.f64(double %3, double %31, double %32)
%34 = fmul double %33, %26
%35 = tail call double @llvm.fmuladd.f64(double %5, double %3, double %34)
%36 = fdiv double %30, %35
br label %37
37: ; preds = %23, %10
%38 = phi double [ %22, %10 ], [ %36, %23 ]
ret double %38
}