#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 sqrt(double);
double FIRCalcBessi0(double x) {
  double ax, ans;
  double y;
  ax = fabs(x);
  if (ax < 3.75) {
    y = x / 3.75;
    y = 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)))))));
  }
  return ans;
}


x86 assembly (clang, -O0):
<FIRCalcBessi0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movaps 0xf47(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xeb6(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    120a <FIRCalcBessi0+0xea>
movsd  -0x8(%rbp),%xmm0
movsd  0xe9e(%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  -0x20(%rbp),%xmm4
movsd  -0x20(%rbp),%xmm5
movsd  0xec8(%rip),%xmm6
mulsd  %xmm6,%xmm5
movsd  0xec4(%rip),%xmm6
addsd  %xmm6,%xmm5
mulsd  %xmm5,%xmm4
movsd  0xea4(%rip),%xmm5
addsd  %xmm5,%xmm4
mulsd  %xmm4,%xmm3
movsd  0xe8c(%rip),%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movsd  0xe74(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe5c(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe44(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    12d0 <FIRCalcBessi0+0x1b0>
movsd  0xdee(%rip),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
movsd  -0x20(%rbp),%xmm4
movsd  -0x20(%rbp),%xmm5
movsd  -0x20(%rbp),%xmm6
movsd  0xdc9(%rip),%xmm7
mulsd  %xmm7,%xmm6
movsd  0xdc5(%rip),%xmm7
addsd  %xmm7,%xmm6
mulsd  %xmm6,%xmm5
movsd  0xda5(%rip),%xmm6
addsd  %xmm6,%xmm5
mulsd  %xmm5,%xmm4
movsd  0xd8d(%rip),%xmm5
addsd  %xmm5,%xmm4
mulsd  %xmm4,%xmm3
movsd  0xd75(%rip),%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movsd  0xd5d(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xd45(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FIRCalcBessi0>:
sub    $0x18,%rsp
movapd 0xed4(%rip),%xmm2
andpd  %xmm0,%xmm2
movsd  0xed8(%rip),%xmm1
ucomisd %xmm2,%xmm1
jbe    119f <FIRCalcBessi0+0x7f>
divsd  0xeca(%rip),%xmm0
mulsd  %xmm0,%xmm0
movsd  0xefe(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xefa(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xef6(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xef2(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xeee(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xeea(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xee6(%rip),%xmm1
jmp    1244 <FIRCalcBessi0+0x124>
divsd  %xmm2,%xmm1
movsd  %xmm1,0x10(%rsp)
movapd %xmm2,%xmm0
movapd %xmm2,(%rsp)
call   1030 <exp@plt>
movapd (%rsp),%xmm1
movapd %xmm0,%xmm3
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jb     11d3 <FIRCalcBessi0+0xb3>
xorps  %xmm0,%xmm0
sqrtsd %xmm1,%xmm0
jmp    11e6 <FIRCalcBessi0+0xc6>
movapd %xmm1,%xmm0
movsd  %xmm3,(%rsp)
call   1040 <sqrt@plt>
movsd  (%rsp),%xmm3
movsd  0xe2a(%rip),%xmm1
movsd  0x10(%rsp),%xmm2
mulsd  %xmm2,%xmm1
addsd  0xe20(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xe1c(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xe18(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xe14(%rip),%xmm1
divsd  %xmm0,%xmm3
mulsd  %xmm2,%xmm1
addsd  0xe0c(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xe08(%rip),%xmm1
mulsd  %xmm3,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

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

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