#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);
int sqrt(double);
double airBesselI0ExpScaled(double x) {
  double b, ax, y;
  ax = ((x) > 0.0f ? (x) : -(x));
  if (ax < 5.664804810929075) {
    y = x / 5.7;
    y *= y;
    b = (0.9999999996966272 +
         y * (7.7095783675529646 +
              y * (13.211021909077445 +
                   y * (8.648398832703904 +
                        (2.5427099920536578 + 0.3103650754941674 * y) * y)))) /
        (1 + y * (-0.41292170755003793 +
                  (0.07122966874756179 - 0.005182728492608365 * y) * y));
    b *= exp(-ax);
  } else {
    y = 5.7 / ax;
    b = (0.398942280546057 +
         y * (-0.749709626164583 +
              y * (0.507462772839054 +
                   y * (-0.0918770649691261 +
                        (-0.00135238228377743 - 0.0000897561853670307 * y) *
                            y)))) /
        (1 + y * (-1.90117313211089 +
                  (1.31154807540649 - 0.255339661975509 * y) * y));
    b *= (1 / sqrt(ax));
  }
  return b;
}


x86 assembly (clang, -O0):
<airBesselI0ExpScaled>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    114e <airBesselI0ExpScaled+0x2e>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    116f <airBesselI0ExpScaled+0x4f>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe7f(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    12a2 <airBesselI0ExpScaled+0x182>
movsd  -0x8(%rbp),%xmm0
movsd  0xebf(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
movsd  0xecb(%rip),%xmm4
mulsd  %xmm4,%xmm3
movsd  0xec7(%rip),%xmm4
addsd  %xmm4,%xmm3
movsd  -0x20(%rbp),%xmm4
mulsd  %xmm4,%xmm3
movsd  0xea2(%rip),%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movsd  0xe8a(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe72(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe5a(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  0xe34(%rip),%xmm3
mulsd  %xmm3,%xmm2
movsd  0xe30(%rip),%xmm3
addsd  %xmm3,%xmm2
movsd  -0x20(%rbp),%xmm3
mulsd  %xmm3,%xmm2
movsd  0xe0b(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xda3(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1397 <airBesselI0ExpScaled+0x277>
movsd  0xdae(%rip),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
movsd  0xd78(%rip),%xmm4
mulsd  %xmm4,%xmm3
movsd  0xd74(%rip),%xmm4
addsd  %xmm4,%xmm3
movsd  -0x20(%rbp),%xmm4
mulsd  %xmm4,%xmm3
movsd  0xd4f(%rip),%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movsd  0xd37(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xd1f(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd07(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  0xce1(%rip),%xmm3
mulsd  %xmm3,%xmm2
movsd  0xcdd(%rip),%xmm3
addsd  %xmm3,%xmm2
movsd  -0x20(%rbp),%xmm3
mulsd  %xmm3,%xmm2
movsd  0xcb8(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xca0(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <sqrt@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<airBesselI0ExpScaled>:
sub    $0x18,%rsp
movapd %xmm0,%xmm3
movapd 0xed0(%rip),%xmm1
xorpd  %xmm0,%xmm1
xorpd  %xmm0,%xmm0
cmpltsd %xmm3,%xmm0
movapd %xmm0,%xmm2
andpd  %xmm3,%xmm2
andnpd %xmm1,%xmm0
orpd   %xmm2,%xmm0
movsd  0xefb(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    11fe <airBesselI0ExpScaled+0xde>
divsd  0xef1(%rip),%xmm3
mulsd  %xmm3,%xmm3
movsd  0xf1d(%rip),%xmm1
mulsd  %xmm3,%xmm1
addsd  0xf19(%rip),%xmm1
mulsd  %xmm3,%xmm1
addsd  0xf15(%rip),%xmm1
mulsd  %xmm3,%xmm1
addsd  0xf11(%rip),%xmm1
movsd  0xf11(%rip),%xmm2
mulsd  %xmm3,%xmm2
addsd  0xf0d(%rip),%xmm2
movapd %xmm3,%xmm4
unpcklpd %xmm2,%xmm3
unpcklpd %xmm4,%xmm1
mulpd  %xmm3,%xmm1
addpd  0xe6d(%rip),%xmm1
unpcklpd %xmm4,%xmm4
mulpd  %xmm1,%xmm4
addpd  0xe6d(%rip),%xmm4
movapd %xmm4,%xmm1
unpckhpd %xmm4,%xmm1
divsd  %xmm1,%xmm4
movapd %xmm4,(%rsp)
movapd 0xe14(%rip),%xmm1
xorpd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <exp@plt>
jmp    129a <airBesselI0ExpScaled+0x17a>
movsd  0xe52(%rip),%xmm4
divsd  %xmm0,%xmm4
movsd  0xe4e(%rip),%xmm1
mulsd  %xmm4,%xmm1
addsd  0xe4a(%rip),%xmm1
mulsd  %xmm4,%xmm1
addsd  0xe46(%rip),%xmm1
mulsd  %xmm4,%xmm1
addsd  0xe42(%rip),%xmm1
movsd  0xe42(%rip),%xmm2
mulsd  %xmm4,%xmm2
addsd  0xe3e(%rip),%xmm2
movapd %xmm4,%xmm3
unpcklpd %xmm2,%xmm3
unpcklpd %xmm4,%xmm1
mulpd  %xmm3,%xmm1
addpd  0xdae(%rip),%xmm1
unpcklpd %xmm4,%xmm4
mulpd  %xmm1,%xmm4
addpd  0xdae(%rip),%xmm4
movapd %xmm4,%xmm1
unpckhpd %xmm4,%xmm1
divsd  %xmm1,%xmm4
movapd %xmm4,(%rsp)
call   1040 <sqrt@plt>
lea    0x1(%rax),%ecx
xor    %edx,%edx
cmp    $0x3,%ecx
cmovb  %eax,%edx
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
mulsd  (%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @airBesselI0ExpScaled(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %2
%6 = load double, double* %2
%7 = fcmp ogt double %6, 0.000000e+00
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load double, double* %2
br label %13
10: ; preds = %1
%11 = load double, double* %2
%12 = fneg double %11
br label %13
13: ; preds = %10, %8
%14 = phi double [ %9, %8 ], [ %12, %10 ]
store double %14, double* %4
%15 = load double, double* %4
%16 = fcmp olt double %15, 0x4016A8C297A4A7C6
br i1 %16, label %17, label %45
17: ; preds = %13
%18 = load double, double* %2
%19 = fdiv double %18, 5.700000e+00
store double %19, double* %5
%20 = load double, double* %5
%21 = load double, double* %5
%22 = fmul double %21, %20
store double %22, double* %5
%23 = load double, double* %5
%24 = load double, double* %5
%25 = load double, double* %5
%26 = load double, double* %5
%27 = call double @llvm.fmuladd.f64(double 0x3FD3DD057A445A71, double %26, double 0x400457785618A9BD)
%28 = load double, double* %5
%29 = call double @llvm.fmuladd.f64(double %27, double %28, double 0x40214BFAEE8A74A8)
%30 = call double @llvm.fmuladd.f64(double %25, double %29, double 0x402A6C0B104C7448)
%31 = call double @llvm.fmuladd.f64(double %24, double %30, double 0x401ED69BB62A5B30)
%32 = call double @llvm.fmuladd.f64(double %23, double %31, double 0x3FEFFFFFFFD64E05)
%33 = load double, double* %5
%34 = load double, double* %5
%35 = call double @llvm.fmuladd.f64(double 0xBF753A7C1613A97C, double %34, double 0x3FB23C1B89C693B2)
%36 = load double, double* %5
%37 = call double @llvm.fmuladd.f64(double %35, double %36, double 0xBFDA6D4F2B6F18CF)
%38 = call double @llvm.fmuladd.f64(double %33, double %37, double 1.000000e+00)
%39 = fdiv double %32, %38
store double %39, double* %3
%40 = load double, double* %4
%41 = fneg double %40
%42 = call double @exp(double %41)
%43 = load double, double* %3
%44 = fmul double %43, %42
store double %44, double* %3
br label %71
45: ; preds = %13
%46 = load double, double* %4
%47 = fdiv double 5.700000e+00, %46
store double %47, double* %5
%48 = load double, double* %5
%49 = load double, double* %5
%50 = load double, double* %5
%51 = load double, double* %5
%52 = call double @llvm.fmuladd.f64(double 0xBF17876F85E74A06, double %51, double 0xBF56284D6B8D89FA)
%53 = load double, double* %5
%54 = call double @llvm.fmuladd.f64(double %52, double %53, double 0xBFB785415D4B7C32)
%55 = call double @llvm.fmuladd.f64(double %50, double %54, double 0x3FE03D2291A8FFB5)
%56 = call double @llvm.fmuladd.f64(double %49, double %55, double 0xBFE7FD9F0ABBF1D4)
%57 = call double @llvm.fmuladd.f64(double %48, double %56, double 0x3FD9884533FBF759)
%58 = load double, double* %5
%59 = load double, double* %5
%60 = call double @llvm.fmuladd.f64(double 0xBFD0577C2A639DCB, double %59, double 0x3FF4FC19D5B00AB8)
%61 = load double, double* %5
%62 = call double @llvm.fmuladd.f64(double %60, double %61, double 0xBFFE6B3484A733DB)
%63 = call double @llvm.fmuladd.f64(double %58, double %62, double 1.000000e+00)
%64 = fdiv double %57, %63
store double %64, double* %3
%65 = load double, double* %4
%66 = call i32 @sqrt(double %65)
%67 = sdiv i32 1, %66
%68 = sitofp i32 %67 to double
%69 = load double, double* %3
%70 = fmul double %69, %68
store double %70, double* %3
br label %71
71: ; preds = %45, %17
%72 = load double, double* %3
ret double %72
}

LLVM IR (-O2):
define double @airBesselI0ExpScaled(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %0, double %3
%5 = fcmp olt double %4, 0x4016A8C297A4A7C6
br i1 %5, label %6, label %26
6: ; preds = %1
%7 = fdiv double %0, 5.700000e+00
%8 = fmul double %7, %7
%9 = tail call double @llvm.fmuladd.f64(double %8, double 0x3FD3DD057A445A71, double 0x400457785618A9BD)
%10 = tail call double @llvm.fmuladd.f64(double %9, double %8, double 0x40214BFAEE8A74A8)
%11 = tail call double @llvm.fmuladd.f64(double %8, double %10, double 0x402A6C0B104C7448)
%12 = tail call double @llvm.fmuladd.f64(double %8, double 0xBF753A7C1613A97C, double 0x3FB23C1B89C693B2)
%13 = insertelement <2 x double> poison, double %8, i64 0
%14 = insertelement <2 x double> %13, double %12, i64 1
%15 = insertelement <2 x double> poison, double %11, i64 0
%16 = insertelement <2 x double> %15, double %8, i64 1
%17 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %14, <2 x double> %16, <2 x double> <double 0x401ED69BB62A5B30, double 0xBFDA6D4F2B6F18CF>)
%18 = shufflevector <2 x double> %13, <2 x double> poison, <2 x i32> zeroinitializer
%19 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %18, <2 x double> %17, <2 x double> <double 0x3FEFFFFFFFD64E05, double 1.000000e+00>)
%20 = extractelement <2 x double> %19, i64 0
%21 = extractelement <2 x double> %19, i64 1
%22 = fdiv double %20, %21
%23 = fneg double %4
%24 = tail call double @exp(double %23)
%25 = fmul double %22, %24
br label %48
26: ; preds = %1
%27 = fdiv double 5.700000e+00, %4
%28 = tail call double @llvm.fmuladd.f64(double %27, double 0xBF17876F85E74A06, double 0xBF56284D6B8D89FA)
%29 = tail call double @llvm.fmuladd.f64(double %28, double %27, double 0xBFB785415D4B7C32)
%30 = tail call double @llvm.fmuladd.f64(double %27, double %29, double 0x3FE03D2291A8FFB5)
%31 = tail call double @llvm.fmuladd.f64(double %27, double 0xBFD0577C2A639DCB, double 0x3FF4FC19D5B00AB8)
%32 = insertelement <2 x double> poison, double %27, i64 0
%33 = insertelement <2 x double> %32, double %31, i64 1
%34 = insertelement <2 x double> poison, double %30, i64 0
%35 = insertelement <2 x double> %34, double %27, i64 1
%36 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %33, <2 x double> %35, <2 x double> <double 0xBFE7FD9F0ABBF1D4, double 0xBFFE6B3484A733DB>)
%37 = shufflevector <2 x double> %32, <2 x double> poison, <2 x i32> zeroinitializer
%38 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %37, <2 x double> %36, <2 x double> <double 0x3FD9884533FBF759, double 1.000000e+00>)
%39 = extractelement <2 x double> %38, i64 0
%40 = extractelement <2 x double> %38, i64 1
%41 = fdiv double %39, %40
%42 = tail call i32 @sqrt(double %4)
%43 = add i32 %42, 1
%44 = icmp ult i32 %43, 3
%45 = select i1 %44, i32 %42, i32 0
%46 = sitofp i32 %45 to double
%47 = fmul double %41, %46
br label %48
48: ; preds = %26, %6
%49 = phi double [ %25, %6 ], [ %47, %26 ]
ret double %49
}