#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 bessi1(double x) {
  double ax, ans;
  double y;
  if ((ax = fabs(x)) < 3.75) {
    y = x / 3.75;
    y *= y;
    ans =
        ax * (0.5 + y * (0.87890594 +
                         y * (0.51498869 +
                              y * (0.15084934 +
                                   y * (0.2658733e-1 +
                                        y * (0.301532e-2 + y * 0.32411e-3))))));
  } else {
    y = 3.75 / ax;
    ans = 0.2282967e-1 +
          y * (-0.2895312e-1 + y * (0.1787654e-1 - y * 0.420059e-2));
    ans = 0.39894228 +
          y * (-0.3988024e-1 +
               y * (-0.362018e-2 +
                    y * (0.163801e-2 + y * (-0.1031555e-1 + y * ans))));
    ans *= (exp(ax) / sqrt(ax));
  }
  return x < 0.0 ? -ans : ans;
}


x86 assembly (clang, -O0):
<bessi1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
movaps 0xf57(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  %xmm1,-0x10(%rbp)
movsd  0xeb6(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1212 <bessi1+0xf2>
movsd  -0x8(%rbp),%xmm0
movsd  0xe9f(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%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  0xed4(%rip),%xmm7
mulsd  %xmm7,%xmm6
movsd  0xed0(%rip),%xmm7
addsd  %xmm7,%xmm6
mulsd  %xmm6,%xmm5
movsd  0xeb0(%rip),%xmm6
addsd  %xmm6,%xmm5
mulsd  %xmm5,%xmm4
movsd  0xe98(%rip),%xmm5
addsd  %xmm5,%xmm4
mulsd  %xmm4,%xmm3
movsd  0xe80(%rip),%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movsd  0xe68(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe50(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1329 <bessi1+0x209>
movsd  0xde6(%rip),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
movsd  0xdee(%rip),%xmm3
mulsd  %xmm3,%xmm2
movsd  0xdea(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xdca(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdb2(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
movsd  -0x20(%rbp),%xmm4
movsd  -0x18(%rbp),%xmm5
mulsd  %xmm5,%xmm4
movsd  0xd77(%rip),%xmm5
addsd  %xmm5,%xmm4
mulsd  %xmm4,%xmm3
movsd  0xd5f(%rip),%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movsd  0xd47(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xd2f(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd17(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%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
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    135d <bessi1+0x23d>
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    1367 <bessi1+0x247>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bessi1>:
sub    $0x38,%rsp
movapd 0xed4(%rip),%xmm2
andpd  %xmm0,%xmm2
movsd  0xee8(%rip),%xmm1
ucomisd %xmm2,%xmm1
jbe    11a7 <bessi1+0x87>
movapd %xmm0,%xmm1
divsd  0xed6(%rip),%xmm1
mulsd  %xmm1,%xmm1
movsd  0xf1a(%rip),%xmm3
mulsd  %xmm1,%xmm3
addsd  0xf16(%rip),%xmm3
mulsd  %xmm1,%xmm3
addsd  0xf12(%rip),%xmm3
mulsd  %xmm1,%xmm3
addsd  0xf0e(%rip),%xmm3
mulsd  %xmm1,%xmm3
addsd  0xf0a(%rip),%xmm3
mulsd  %xmm1,%xmm3
addsd  0xf06(%rip),%xmm3
mulsd  %xmm1,%xmm3
addsd  0xf02(%rip),%xmm3
mulsd  %xmm2,%xmm3
jmp    1270 <bessi1+0x150>
movapd %xmm0,0x20(%rsp)
divsd  %xmm2,%xmm1
movsd  0xe6f(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  0xe6b(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  0xe67(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  0xe63(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  0xe5f(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  0xe5b(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  0xe57(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  0xe53(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  0xe4f(%rip),%xmm0
movapd %xmm0,0x10(%rsp)
movapd %xmm2,%xmm0
movapd %xmm2,(%rsp)
call   1030 <exp@plt>
movapd (%rsp),%xmm1
movapd %xmm0,%xmm2
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jb     1249 <bessi1+0x129>
xorps  %xmm0,%xmm0
sqrtsd %xmm1,%xmm0
jmp    125c <bessi1+0x13c>
movapd %xmm1,%xmm0
movsd  %xmm2,(%rsp)
call   1040 <sqrt@plt>
movsd  (%rsp),%xmm2
divsd  %xmm0,%xmm2
movapd 0x10(%rsp),%xmm3
mulsd  %xmm2,%xmm3
movapd 0x20(%rsp),%xmm0
movapd 0xd98(%rip),%xmm2
xorpd  %xmm3,%xmm2
xorpd  %xmm1,%xmm1
cmpltsd %xmm1,%xmm0
andpd  %xmm0,%xmm2
andnpd %xmm3,%xmm0
orpd   %xmm2,%xmm0
add    $0x38,%rsp
ret

LLVM IR (-O0):
define double @bessi1(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 = fcmp olt double %7, 3.750000e+00
br i1 %8, label %9, label %29
9: ; preds = %1
%10 = load double, double* %2
%11 = fdiv double %10, 3.750000e+00
store double %11, double* %5
%12 = load double, double* %5
%13 = load double, double* %5
%14 = fmul double %13, %12
store double %14, double* %5
%15 = load double, double* %3
%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 3.241100e-04, double 3.015320e-03)
%23 = call double @llvm.fmuladd.f64(double %20, double %22, double 0x3F9B39B5835A121A)
%24 = call double @llvm.fmuladd.f64(double %19, double %23, double 0x3FC34F07FAF62AEA)
%25 = call double @llvm.fmuladd.f64(double %18, double %24, double 0x3FE07AC98FAB8428)
%26 = call double @llvm.fmuladd.f64(double %17, double %25, double 0x3FEC1FFF5991ECA7)
%27 = call double @llvm.fmuladd.f64(double %16, double %26, double 5.000000e-01)
%28 = fmul double %15, %27
store double %28, double* %4
br label %57
29: ; preds = %1
%30 = load double, double* %3
%31 = fdiv double 3.750000e+00, %30
store double %31, double* %5
%32 = load double, double* %5
%33 = load double, double* %5
%34 = load double, double* %5
%35 = fneg double %34
%36 = call double @llvm.fmuladd.f64(double %35, double 4.200590e-03, double 0x3F924E3A4AA99C71)
%37 = call double @llvm.fmuladd.f64(double %33, double %36, double 0xBF9DA5E2FE119350)
%38 = call double @llvm.fmuladd.f64(double %32, double %37, double 0x3F9760A9381D27D9)
store double %38, double* %4
%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* %4
%45 = call double @llvm.fmuladd.f64(double %43, double %44, double 0xBF852051AF1F3CDC)
%46 = call double @llvm.fmuladd.f64(double %42, double %45, double 1.638010e-03)
%47 = call double @llvm.fmuladd.f64(double %41, double %46, double -3.620180e-03)
%48 = call double @llvm.fmuladd.f64(double %40, double %47, double 0xBFA46B2ECD1CFEBE)
%49 = call double @llvm.fmuladd.f64(double %39, double %48, double 0x3FD988453365DE00)
store double %49, double* %4
%50 = load double, double* %3
%51 = call double @exp(double %50)
%52 = load double, double* %3
%53 = call double @sqrt(double %52)
%54 = fdiv double %51, %53
%55 = load double, double* %4
%56 = fmul double %55, %54
store double %56, double* %4
br label %57
57: ; preds = %29, %9
%58 = load double, double* %2
%59 = fcmp olt double %58, 0.000000e+00
br i1 %59, label %60, label %63
60: ; preds = %57
%61 = load double, double* %4
%62 = fneg double %61
br label %65
63: ; preds = %57
%64 = load double, double* %4
br label %65
65: ; preds = %63, %60
%66 = phi double [ %62, %60 ], [ %64, %63 ]
ret double %66
}

LLVM IR (-O2):
define double @bessi1(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 %14
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 3.241100e-04, double 3.015320e-03)
%8 = tail call double @llvm.fmuladd.f64(double %6, double %7, double 0x3F9B39B5835A121A)
%9 = tail call double @llvm.fmuladd.f64(double %6, double %8, double 0x3FC34F07FAF62AEA)
%10 = tail call double @llvm.fmuladd.f64(double %6, double %9, double 0x3FE07AC98FAB8428)
%11 = tail call double @llvm.fmuladd.f64(double %6, double %10, double 0x3FEC1FFF5991ECA7)
%12 = tail call double @llvm.fmuladd.f64(double %6, double %11, double 5.000000e-01)
%13 = fmul double %2, %12
br label %29
14: ; preds = %1
%15 = fdiv double 3.750000e+00, %2
%16 = fneg double %15
%17 = tail call double @llvm.fmuladd.f64(double %16, double 4.200590e-03, double 0x3F924E3A4AA99C71)
%18 = tail call double @llvm.fmuladd.f64(double %15, double %17, double 0xBF9DA5E2FE119350)
%19 = tail call double @llvm.fmuladd.f64(double %15, double %18, double 0x3F9760A9381D27D9)
%20 = tail call double @llvm.fmuladd.f64(double %15, double %19, double 0xBF852051AF1F3CDC)
%21 = tail call double @llvm.fmuladd.f64(double %15, double %20, double 1.638010e-03)
%22 = tail call double @llvm.fmuladd.f64(double %15, double %21, double -3.620180e-03)
%23 = tail call double @llvm.fmuladd.f64(double %15, double %22, double 0xBFA46B2ECD1CFEBE)
%24 = tail call double @llvm.fmuladd.f64(double %15, double %23, double 0x3FD988453365DE00)
%25 = tail call double @exp(double %2)
%26 = tail call double @sqrt(double %2)
%27 = fdiv double %25, %26
%28 = fmul double %24, %27
br label %29
29: ; preds = %14, %4
%30 = phi double [ %13, %4 ], [ %28, %14 ]
%31 = fcmp olt double %0, 0.000000e+00
%32 = fneg double %30
%33 = select i1 %31, double %32, double %30
ret double %33
}