#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(float);
float fabs(float);
double sqrt(float);
float bessi0(float x) {
  float ax, ans;
  double y;
  if ((ax = fabs(x)) < 3.75) {
    y = x / 3.75;
    y *= y;
    ans =
        1.0 +
        y * (3.5156229 +
             y * (3.0899424 +
                  y * (1.2067492 +
                       y * (0.2659732 + y * (0.360768e-1 + y * 0.45813e-2)))));
  } else {
    y = 3.75 / ax;
    ans = (exp(ax) / sqrt(ax)) *
          (0.39894228 +
           y * (0.1328592e-1 +
                y * (0.225319e-2 +
                     y * (-0.157565e-2 +
                          y * (0.916281e-2 +
                               y * (-0.2057706e-1 +
                                    y * (0.2635537e-1 +
                                         y * (-0.1647633e-1 +
                                              y * 0.392377e-2))))))));
  }
  return ans;
}


x86 assembly (clang, -O0):
<bessi0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <fabs@plt>
movss  %xmm0,-0x8(%rbp)
cvtss2sd %xmm0,%xmm1
movsd  0xea8(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    121f <bessi0+0xef>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe8d(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm3
movsd  -0x18(%rbp),%xmm4
movsd  -0x18(%rbp),%xmm5
movsd  0xec7(%rip),%xmm6
mulsd  %xmm6,%xmm5
movsd  0xec3(%rip),%xmm6
addsd  %xmm6,%xmm5
mulsd  %xmm5,%xmm4
movsd  0xea3(%rip),%xmm5
addsd  %xmm5,%xmm4
mulsd  %xmm4,%xmm3
movsd  0xe8b(%rip),%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movsd  0xe73(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe5b(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe43(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1323 <bessi0+0x1f3>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xdd0(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movss  -0x8(%rbp),%xmm0
call   1040 <exp@plt>
movsd  %xmm0,-0x20(%rbp)
movss  -0x8(%rbp),%xmm0
call   1050 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm3
movsd  -0x18(%rbp),%xmm4
movsd  -0x18(%rbp),%xmm5
movsd  -0x18(%rbp),%xmm6
movsd  -0x18(%rbp),%xmm7
movsd  -0x18(%rbp),%xmm8
movsd  0xdb0(%rip),%xmm9
mulsd  %xmm9,%xmm8
movsd  0xdaa(%rip),%xmm9
addsd  %xmm9,%xmm8
mulsd  %xmm8,%xmm7
movsd  0xd87(%rip),%xmm8
addsd  %xmm8,%xmm7
mulsd  %xmm7,%xmm6
movsd  0xd6e(%rip),%xmm7
addsd  %xmm7,%xmm6
mulsd  %xmm6,%xmm5
movsd  0xd56(%rip),%xmm6
addsd  %xmm6,%xmm5
mulsd  %xmm5,%xmm4
movsd  0xd3e(%rip),%xmm5
addsd  %xmm5,%xmm4
mulsd  %xmm4,%xmm3
movsd  0xd26(%rip),%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movsd  0xd0e(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xcf6(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bessi0>:
sub    $0x28,%rsp
movaps 0xed5(%rip),%xmm2
andps  %xmm0,%xmm2
movss  0xeda(%rip),%xmm1
ucomiss %xmm2,%xmm1
jbe    11a0 <bessi0+0x80>
cvtss2sd %xmm0,%xmm0
divsd  0xed1(%rip),%xmm0
mulsd  %xmm0,%xmm0
movsd  0xf15(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xf11(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xf0d(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xf09(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xf05(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xf01(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xefd(%rip),%xmm1
jmp    1251 <bessi0+0x131>
xorps  %xmm0,%xmm0
cvtss2sd %xmm2,%xmm0
movsd  0xe69(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
movaps %xmm2,%xmm0
movaps %xmm2,0x10(%rsp)
call   1030 <exp@plt>
movsd  %xmm0,0x8(%rsp)
movapd 0x10(%rsp),%xmm0
call   1040 <sqrt@plt>
movsd  0xe42(%rip),%xmm1
movsd  (%rsp),%xmm2
mulsd  %xmm2,%xmm1
addsd  0xe39(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xe35(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xe31(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xe2d(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xe29(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xe25(%rip),%xmm1
movsd  0x8(%rsp),%xmm3
divsd  %xmm0,%xmm3
mulsd  %xmm2,%xmm1
addsd  0xe17(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xe13(%rip),%xmm1
mulsd  %xmm3,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define float @bessi0(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca double
store float %0, float* %2
%6 = load float, float* %2
%7 = call float @fabs(float %6)
store float %7, float* %3
%8 = fpext float %7 to double
%9 = fcmp olt double %8, 3.750000e+00
br i1 %9, label %10, label %30
10: ; preds = %1
%11 = load float, float* %2
%12 = fpext float %11 to double
%13 = fdiv double %12, 3.750000e+00
store double %13, double* %5
%14 = load double, double* %5
%15 = load double, double* %5
%16 = fmul double %15, %14
store double %16, double* %5
%17 = load double, double* %5
%18 = load double, double* %5
%19 = load double, double* %5
%20 = load double, double* %5
%21 = load double, double* %5
%22 = load double, double* %5
%23 = call double @llvm.fmuladd.f64(double %22, double 4.581300e-03, double 3.607680e-02)
%24 = call double @llvm.fmuladd.f64(double %21, double %23, double 0x3FD105B474E732AA)
%25 = call double @llvm.fmuladd.f64(double %20, double %24, double 0x3FF34ED83FC7962C)
%26 = call double @llvm.fmuladd.f64(double %19, double %25, double 0x4008B833B89430A4)
%27 = call double @llvm.fmuladd.f64(double %18, double %26, double 0x400C1FFEE6248CA7)
%28 = call double @llvm.fmuladd.f64(double %17, double %27, double 1.000000e+00)
%29 = fptrunc double %28 to float
store float %29, float* %4
br label %57
30: ; preds = %1
%31 = load float, float* %3
%32 = fpext float %31 to double
%33 = fdiv double 3.750000e+00, %32
store double %33, double* %5
%34 = load float, float* %3
%35 = call double @exp(float %34)
%36 = load float, float* %3
%37 = call double @sqrt(float %36)
%38 = fdiv double %35, %37
%39 = load double, double* %5
%40 = load double, double* %5
%41 = load double, double* %5
%42 = load double, double* %5
%43 = load double, double* %5
%44 = load double, double* %5
%45 = load double, double* %5
%46 = load double, double* %5
%47 = call double @llvm.fmuladd.f64(double %46, double 3.923770e-03, double 0xBF90DF2BCA084C55)
%48 = call double @llvm.fmuladd.f64(double %45, double %47, double 0x3F9AFCE6F0E55AE3)
%49 = call double @llvm.fmuladd.f64(double %44, double %48, double 0xBF9512271EFDC716)
%50 = call double @llvm.fmuladd.f64(double %43, double %49, double 9.162810e-03)
%51 = call double @llvm.fmuladd.f64(double %42, double %50, double -1.575650e-03)
%52 = call double @llvm.fmuladd.f64(double %41, double %51, double 2.253190e-03)
%53 = call double @llvm.fmuladd.f64(double %40, double %52, double 0x3F8B35A5FF2D9D1C)
%54 = call double @llvm.fmuladd.f64(double %39, double %53, double 0x3FD988453365DE00)
%55 = fmul double %38, %54
%56 = fptrunc double %55 to float
store float %56, float* %4
br label %57
57: ; preds = %30, %10
%58 = load float, float* %4
ret float %58
}

LLVM IR (-O2):
define float @bessi0(float %0) {
%2 = tail call float @llvm.fabs.f32(float %0)
%3 = fcmp olt float %2, 3.750000e+00
br i1 %3, label %4, label %14
4: ; preds = %1
%5 = fpext float %0 to double
%6 = fdiv double %5, 3.750000e+00
%7 = fmul double %6, %6
%8 = tail call double @llvm.fmuladd.f64(double %7, double 4.581300e-03, double 3.607680e-02)
%9 = tail call double @llvm.fmuladd.f64(double %7, double %8, double 0x3FD105B474E732AA)
%10 = tail call double @llvm.fmuladd.f64(double %7, double %9, double 0x3FF34ED83FC7962C)
%11 = tail call double @llvm.fmuladd.f64(double %7, double %10, double 0x4008B833B89430A4)
%12 = tail call double @llvm.fmuladd.f64(double %7, double %11, double 0x400C1FFEE6248CA7)
%13 = tail call double @llvm.fmuladd.f64(double %7, double %12, double 1.000000e+00)
br label %29
14: ; preds = %1
%15 = fpext float %2 to double
%16 = fdiv double 3.750000e+00, %15
%17 = tail call double @exp(float %2)
%18 = tail call double @sqrt(float %2)
%19 = fdiv double %17, %18
%20 = tail call double @llvm.fmuladd.f64(double %16, double 3.923770e-03, double 0xBF90DF2BCA084C55)
%21 = tail call double @llvm.fmuladd.f64(double %16, double %20, double 0x3F9AFCE6F0E55AE3)
%22 = tail call double @llvm.fmuladd.f64(double %16, double %21, double 0xBF9512271EFDC716)
%23 = tail call double @llvm.fmuladd.f64(double %16, double %22, double 9.162810e-03)
%24 = tail call double @llvm.fmuladd.f64(double %16, double %23, double -1.575650e-03)
%25 = tail call double @llvm.fmuladd.f64(double %16, double %24, double 2.253190e-03)
%26 = tail call double @llvm.fmuladd.f64(double %16, double %25, double 0x3F8B35A5FF2D9D1C)
%27 = tail call double @llvm.fmuladd.f64(double %16, double %26, double 0x3FD988453365DE00)
%28 = fmul double %27, %19
br label %29
29: ; preds = %14, %4
%30 = phi double [ %13, %4 ], [ %28, %14 ]
%31 = fptrunc double %30 to float
ret float %31
}