#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 cos(double);
float fabs(float);
float sin(double);
double sqrt(double);
float bessj1(float x) {
  float ax, z;
  double xx, y, ans, ans1, ans2;
  if ((ax = fabs(x)) < 8.0) {
    y = x * x;
    ans1 = x * (72362614232.0 +
                y * (-7895059235.0 +
                     y * (242396853.1 +
                          y * (-2972611.439 +
                               y * (15704.48260 + y * (-30.16036606))))));
    ans2 = 144725228442.0 +
           y * (2300535178.0 +
                y * (18583304.74 +
                     y * (99447.43394 + y * (376.9991397 + y * 1.0))));
    ans = ans1 / ans2;
  } else {
    z = 8.0 / ax;
    y = z * z;
    xx = ax - 2.356194491;
    ans1 = 1.0 + y * (0.183105e-2 +
                      y * (-0.3516396496e-4 +
                           y * (0.2457520174e-5 + y * (-0.240337019e-6))));
    ans2 =
        0.04687499995 +
        y * (-0.2002690873e-3 +
             y * (0.8449199096e-5 + y * (-0.88228987e-6 + y * 0.105787412e-6)));
    ans = sqrt(0.636619772 / ax) * (cos(xx) * ans1 - z * sin(xx) * ans2);
    if (x < 0.0)
      ans = -ans;
  }
  return ans;
}


x86 assembly (clang, -O0):
<bessj1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <fabs@plt>
movss  %xmm0,-0x8(%rbp)
cvtss2sd %xmm0,%xmm1
movsd  0xe98(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1286 <bessj1+0x146>
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
movsd  -0x20(%rbp),%xmm4
movsd  -0x20(%rbp),%xmm5
movsd  0xf01(%rip),%xmm6
mulsd  %xmm6,%xmm5
movsd  0xefd(%rip),%xmm6
addsd  %xmm6,%xmm5
mulsd  %xmm5,%xmm4
movsd  0xedd(%rip),%xmm5
addsd  %xmm5,%xmm4
mulsd  %xmm4,%xmm3
movsd  0xec5(%rip),%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movsd  0xead(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe95(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
movsd  -0x20(%rbp),%xmm4
movsd  0xe5f(%rip),%xmm5
addsd  %xmm5,%xmm4
mulsd  %xmm4,%xmm3
movsd  0xe47(%rip),%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movsd  0xe2f(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe17(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdff(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
divsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    1467 <bessj1+0x327>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xd69(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd98(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
movsd  0xd63(%rip),%xmm4
mulsd  %xmm4,%xmm3
movsd  0xd5f(%rip),%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movsd  0xd3f(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xd27(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd0f(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
movsd  0xcda(%rip),%xmm4
mulsd  %xmm4,%xmm3
movsd  0xcd6(%rip),%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movsd  0xcb6(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xc9e(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xc86(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xc64(%rip),%xmm0
divsd  %xmm1,%xmm0
call   1060 <sqrt@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1050 <cos@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x54(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <sin@plt>
movss  -0x54(%rbp),%xmm2
movsd  -0x50(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm3
movaps %xmm0,%xmm4
movsd  -0x40(%rbp),%xmm0
mulss  %xmm4,%xmm2
cvtss2sd %xmm2,%xmm2
mulsd  -0x38(%rbp),%xmm2
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    1462 <bessj1+0x322>
movsd  -0x28(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    1467 <bessj1+0x327>
movsd  -0x28(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bessj1>:
sub    $0x58,%rsp
movaps 0xec5(%rip),%xmm1
andps  %xmm0,%xmm1
movss  0xeda(%rip),%xmm2
ucomiss %xmm1,%xmm2
jbe    11eb <bessj1+0xbb>
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
mulss  %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xf22(%rip),%xmm3
mulsd  %xmm0,%xmm3
addsd  0xf1e(%rip),%xmm3
mulsd  %xmm0,%xmm3
addsd  0xf1a(%rip),%xmm3
mulsd  %xmm0,%xmm3
addsd  0xf16(%rip),%xmm3
mulsd  %xmm0,%xmm3
addsd  0xf12(%rip),%xmm3
mulsd  %xmm0,%xmm3
addsd  0xf0e(%rip),%xmm3
movsd  0xf0e(%rip),%xmm2
addsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm2
addsd  0xf06(%rip),%xmm2
mulsd  %xmm0,%xmm2
addsd  0xf02(%rip),%xmm2
mulsd  %xmm1,%xmm3
mulsd  %xmm0,%xmm2
addsd  0xefa(%rip),%xmm2
mulsd  %xmm0,%xmm2
addsd  0xef6(%rip),%xmm2
divsd  %xmm2,%xmm3
jmp    131c <bessj1+0x1ec>
movaps %xmm0,0x40(%rsp)
divss  %xmm1,%xmm2
movss  %xmm2,0xc(%rsp)
movaps %xmm2,%xmm0
mulss  %xmm2,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe23(%rip),%xmm2
mulsd  %xmm0,%xmm2
addsd  0xe1f(%rip),%xmm2
mulsd  %xmm0,%xmm2
addsd  0xe1b(%rip),%xmm2
mulsd  %xmm0,%xmm2
addsd  0xe17(%rip),%xmm2
cvtss2sd %xmm1,%xmm1
mulsd  %xmm0,%xmm2
addsd  0xe0f(%rip),%xmm2
movsd  %xmm2,0x28(%rsp)
movsd  0xe09(%rip),%xmm2
mulsd  %xmm0,%xmm2
addsd  0xe05(%rip),%xmm2
movsd  0xdc5(%rip),%xmm3
mulsd  %xmm0,%xmm2
addsd  0xdf9(%rip),%xmm2
addsd  %xmm1,%xmm3
movsd  %xmm3,0x18(%rsp)
mulsd  %xmm0,%xmm2
addsd  0xdeb(%rip),%xmm2
mulsd  %xmm0,%xmm2
addsd  0xde7(%rip),%xmm2
movsd  %xmm2,0x20(%rsp)
movsd  0xde1(%rip),%xmm0
divsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     12b3 <bessj1+0x183>
sqrtsd %xmm0,%xmm0
jmp    12b8 <bessj1+0x188>
call   1050 <sqrt@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x18(%rsp),%xmm0
call   1040 <cos@plt>
movaps %xmm0,0x30(%rsp)
movsd  0x18(%rsp),%xmm0
call   1030 <sin@plt>
movapd 0x30(%rsp),%xmm3
movss  0xc(%rsp),%xmm1
mulss  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
movsd  0x20(%rsp),%xmm1
mulsd  %xmm0,%xmm1
mulsd  0x28(%rsp),%xmm3
subsd  %xmm1,%xmm3
mulsd  0x10(%rsp),%xmm3
xorps  %xmm0,%xmm0
ucomiss 0x40(%rsp),%xmm0
jbe    131c <bessj1+0x1ec>
xorpd  0xcf4(%rip),%xmm3
xorps  %xmm0,%xmm0
cvtsd2ss %xmm3,%xmm0
add    $0x58,%rsp
ret

LLVM IR (-O0):
define float @bessj1(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store float %0, float* %2
%10 = load float, float* %2
%11 = call float @fabs(float %10)
store float %11, float* %3
%12 = fpext float %11 to double
%13 = fcmp olt double %12, 8.000000e+00
br i1 %13, label %14, label %45
14: ; preds = %1
%15 = load float, float* %2
%16 = load float, float* %2
%17 = fmul float %15, %16
%18 = fpext float %17 to double
store double %18, double* %6
%19 = load float, float* %2
%20 = fpext float %19 to double
%21 = load double, double* %6
%22 = load double, double* %6
%23 = load double, double* %6
%24 = load double, double* %6
%25 = load double, double* %6
%26 = call double @llvm.fmuladd.f64(double %25, double 0xC03E290DC00716A0, double 0x40CEAC3DC5D63886)
%27 = call double @llvm.fmuladd.f64(double %24, double %26, double 0xC146ADE1B83126E9)
%28 = call double @llvm.fmuladd.f64(double %23, double %27, double 0x41ACE55D6A333333)
%29 = call double @llvm.fmuladd.f64(double %22, double %28, double 0xC1FD6950B2300000)
%30 = call double @llvm.fmuladd.f64(double %21, double %29, double 0x4230D925DDD80000)
%31 = fmul double %20, %30
store double %31, double* %8
%32 = load double, double* %6
%33 = load double, double* %6
%34 = load double, double* %6
%35 = load double, double* %6
%36 = load double, double* %6
%37 = call double @llvm.fmuladd.f64(double %36, double 1.000000e+00, double 0x40778FFC79E8FA2A)
%38 = call double @llvm.fmuladd.f64(double %35, double %37, double 0x40F84776F16B11C7)
%39 = call double @llvm.fmuladd.f64(double %34, double %38, double 0x4171B8F08BD70A3D)
%40 = call double @llvm.fmuladd.f64(double %33, double %39, double 0x41E123EC31400000)
%41 = call double @llvm.fmuladd.f64(double %32, double %40, double 0x4240D925DDCD0000)
store double %41, double* %9
%42 = load double, double* %8
%43 = load double, double* %9
%44 = fdiv double %42, %43
store double %44, double* %7
br label %97
45: ; preds = %1
%46 = load float, float* %3
%47 = fpext float %46 to double
%48 = fdiv double 8.000000e+00, %47
%49 = fptrunc double %48 to float
store float %49, float* %4
%50 = load float, float* %4
%51 = load float, float* %4
%52 = fmul float %50, %51
%53 = fpext float %52 to double
store double %53, double* %6
%54 = load float, float* %3
%55 = fpext float %54 to double
%56 = fsub double %55, 0x4002D97C7F4EE208
store double %56, double* %5
%57 = load double, double* %6
%58 = load double, double* %6
%59 = load double, double* %6
%60 = load double, double* %6
%61 = call double @llvm.fmuladd.f64(double %60, double 0xBE9020F5634D8D14, double 0x3EC49D7C00DF0E15)
%62 = call double @llvm.fmuladd.f64(double %59, double %61, double 0xBF026FA0A2D15CD3)
%63 = call double @llvm.fmuladd.f64(double %58, double %62, double 1.831050e-03)
%64 = call double @llvm.fmuladd.f64(double %57, double %63, double 1.000000e+00)
store double %64, double* %8
%65 = load double, double* %6
%66 = load double, double* %6
%67 = load double, double* %6
%68 = load double, double* %6
%69 = call double @llvm.fmuladd.f64(double %68, double 0x3E7C65A7D5438122, double 0xBEAD9ACFF13878F1)
%70 = call double @llvm.fmuladd.f64(double %67, double %69, double 0x3EE1B82114D8A643)
%71 = call double @llvm.fmuladd.f64(double %66, double %70, double 0xBF2A3FEA5C574380)
%72 = call double @llvm.fmuladd.f64(double %65, double %71, double 0x3FA7FFFFFF920C81)
store double %72, double* %9
%73 = load float, float* %3
%74 = fpext float %73 to double
%75 = fdiv double 0x3FE45F306D974364, %74
%76 = call double @sqrt(double %75)
%77 = load double, double* %5
%78 = call double @cos(double %77)
%79 = load double, double* %8
%80 = load float, float* %4
%81 = load double, double* %5
%82 = call float @sin(double %81)
%83 = fmul float %80, %82
%84 = fpext float %83 to double
%85 = load double, double* %9
%86 = fmul double %84, %85
%87 = fneg double %86
%88 = call double @llvm.fmuladd.f64(double %78, double %79, double %87)
%89 = fmul double %76, %88
store double %89, double* %7
%90 = load float, float* %2
%91 = fpext float %90 to double
%92 = fcmp olt double %91, 0.000000e+00
br i1 %92, label %93, label %96
93: ; preds = %45
%94 = load double, double* %7
%95 = fneg double %94
store double %95, double* %7
br label %96
96: ; preds = %93, %45
br label %97
97: ; preds = %96, %14
%98 = load double, double* %7
%99 = fptrunc double %98 to float
ret float %99
}

LLVM IR (-O2):
define float @bessj1(float %0) {
%2 = tail call float @llvm.fabs.f32(float %0)
%3 = fpext float %2 to double
%4 = fcmp olt float %2, 8.000000e+00
br i1 %4, label %5, label %21
5: ; preds = %1
%6 = fmul float %0, %0
%7 = fpext float %6 to double
%8 = fpext float %0 to double
%9 = tail call double @llvm.fmuladd.f64(double %7, double 0xC03E290DC00716A0, double 0x40CEAC3DC5D63886)
%10 = tail call double @llvm.fmuladd.f64(double %7, double %9, double 0xC146ADE1B83126E9)
%11 = tail call double @llvm.fmuladd.f64(double %7, double %10, double 0x41ACE55D6A333333)
%12 = tail call double @llvm.fmuladd.f64(double %7, double %11, double 0xC1FD6950B2300000)
%13 = tail call double @llvm.fmuladd.f64(double %7, double %12, double 0x4230D925DDD80000)
%14 = fmul double %13, %8
%15 = fadd double %7, 0x40778FFC79E8FA2A
%16 = tail call double @llvm.fmuladd.f64(double %7, double %15, double 0x40F84776F16B11C7)
%17 = tail call double @llvm.fmuladd.f64(double %7, double %16, double 0x4171B8F08BD70A3D)
%18 = tail call double @llvm.fmuladd.f64(double %7, double %17, double 0x41E123EC31400000)
%19 = tail call double @llvm.fmuladd.f64(double %7, double %18, double 0x4240D925DDCD0000)
%20 = fdiv double %14, %19
br label %47
21: ; preds = %1
%22 = fdiv float 8.000000e+00, %2
%23 = fmul float %22, %22
%24 = fpext float %23 to double
%25 = fadd double %3, 0xC002D97C7F4EE208
%26 = tail call double @llvm.fmuladd.f64(double %24, double 0xBE9020F5634D8D14, double 0x3EC49D7C00DF0E15)
%27 = tail call double @llvm.fmuladd.f64(double %24, double %26, double 0xBF026FA0A2D15CD3)
%28 = tail call double @llvm.fmuladd.f64(double %24, double %27, double 1.831050e-03)
%29 = tail call double @llvm.fmuladd.f64(double %24, double %28, double 1.000000e+00)
%30 = tail call double @llvm.fmuladd.f64(double %24, double 0x3E7C65A7D5438122, double 0xBEAD9ACFF13878F1)
%31 = tail call double @llvm.fmuladd.f64(double %24, double %30, double 0x3EE1B82114D8A643)
%32 = tail call double @llvm.fmuladd.f64(double %24, double %31, double 0xBF2A3FEA5C574380)
%33 = tail call double @llvm.fmuladd.f64(double %24, double %32, double 0x3FA7FFFFFF920C81)
%34 = fdiv double 0x3FE45F306D974364, %3
%35 = tail call double @sqrt(double %34)
%36 = tail call double @cos(double %25)
%37 = tail call float @sin(double %25)
%38 = fmul float %22, %37
%39 = fpext float %38 to double
%40 = fneg double %33
%41 = fmul double %40, %39
%42 = tail call double @llvm.fmuladd.f64(double %36, double %29, double %41)
%43 = fmul double %35, %42
%44 = fcmp olt float %0, 0.000000e+00
br i1 %44, label %45, label %47
45: ; preds = %21
%46 = fneg double %43
br label %47
47: ; preds = %21, %45, %5
%48 = phi double [ %20, %5 ], [ %46, %45 ], [ %43, %21 ]
%49 = fptrunc double %48 to float
ret float %49
}