#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 bessj0(float x) {
  float ax, z;
  double xx, y, ans, ans1, ans2;
  if ((ax = fabs(x)) < 8.0) {
    y = x * x;
    ans1 =
        57568490574.0 +
        y * (-13362590354.0 +
             y * (651619640.7 +
                  y * (-11214424.18 + y * (77392.33017 + y * (-184.9052456)))));
    ans2 = 57568490411.0 +
           y * (1029532985.0 +
                y * (9494680.718 +
                     y * (59272.64853 + y * (267.8532712 + y * 1.0))));
    ans = ans1 / ans2;
  } else {
    z = 8.0 / ax;
    y = z * z;
    xx = ax - 0.785398164;
    ans1 = 1.0 + y * (-0.1098628627e-2 +
                      y * (0.2734510407e-4 +
                           y * (-0.2073370639e-5 + y * 0.2093887211e-6)));
    ans2 = -0.1562499995e-1 +
           y * (0.1430488765e-3 +
                y * (-0.6911147651e-5 +
                     y * (0.7621095161e-6 - y * 0.934935152e-7)));
    ans = sqrt(0.636619772 / ax) * (cos(xx) * ans1 - z * sin(xx) * ans2);
  }
  return ans;
}


x86 assembly (clang, -O0):
<bessj0>:
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    1279 <bessj0+0x139>
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%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  0xf0a(%rip),%xmm5
mulsd  %xmm5,%xmm4
movsd  0xf06(%rip),%xmm5
addsd  %xmm5,%xmm4
mulsd  %xmm4,%xmm3
movsd  0xee6(%rip),%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movsd  0xece(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xeb6(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe9e(%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  -0x20(%rbp),%xmm4
movsd  0xe6c(%rip),%xmm5
addsd  %xmm5,%xmm4
mulsd  %xmm4,%xmm3
movsd  0xe54(%rip),%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movsd  0xe3c(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe24(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe0c(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
divsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    1435 <bessj0+0x2f5>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xd76(%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  0xda5(%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  0xd70(%rip),%xmm4
mulsd  %xmm4,%xmm3
movsd  0xd6c(%rip),%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movsd  0xd4c(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xd34(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd1c(%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
movq   %xmm3,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm3
movsd  0xcd0(%rip),%xmm4
mulsd  %xmm4,%xmm3
movsd  0xccc(%rip),%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movsd  0xcac(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xc94(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xc7c(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xc5a(%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)
movsd  -0x28(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bessj0>:
sub    $0x48,%rsp
movaps 0xec5(%rip),%xmm1
andps  %xmm0,%xmm1
movss  0xf0a(%rip),%xmm2
ucomiss %xmm1,%xmm2
jbe    11bc <bessj0+0x8c>
mulss  %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xf5d(%rip),%xmm2
mulsd  %xmm0,%xmm2
addsd  0xf59(%rip),%xmm2
movsd  0xf59(%rip),%xmm1
addsd  %xmm0,%xmm1
unpcklpd %xmm1,%xmm2
unpcklpd %xmm0,%xmm0
mulpd  %xmm0,%xmm2
addpd  0xe89(%rip),%xmm2
mulpd  %xmm0,%xmm2
addpd  0xe8d(%rip),%xmm2
mulpd  %xmm0,%xmm2
addpd  0xe91(%rip),%xmm2
mulpd  %xmm0,%xmm2
addpd  0xe95(%rip),%xmm2
movapd %xmm2,%xmm0
unpckhpd %xmm2,%xmm0
divsd  %xmm0,%xmm2
jmp    12d6 <bessj0+0x1a6>
divss  %xmm1,%xmm2
movss  %xmm2,0xc(%rsp)
movaps %xmm2,%xmm0
mulss  %xmm2,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe87(%rip),%xmm2
mulsd  %xmm0,%xmm2
addsd  0xe83(%rip),%xmm2
mulsd  %xmm0,%xmm2
addsd  0xe7f(%rip),%xmm2
mulsd  %xmm0,%xmm2
addsd  0xe7b(%rip),%xmm2
cvtss2sd %xmm1,%xmm1
mulsd  %xmm0,%xmm2
addsd  0xe73(%rip),%xmm2
movsd  %xmm2,0x28(%rsp)
movsd  0xe6d(%rip),%xmm2
mulsd  %xmm0,%xmm2
addsd  0xe69(%rip),%xmm2
movsd  0xe29(%rip),%xmm3
mulsd  %xmm0,%xmm2
addsd  0xe5d(%rip),%xmm2
addsd  %xmm1,%xmm3
movsd  %xmm3,0x18(%rsp)
mulsd  %xmm0,%xmm2
addsd  0xe4f(%rip),%xmm2
mulsd  %xmm0,%xmm2
addsd  0xe4b(%rip),%xmm2
movsd  %xmm2,0x20(%rsp)
movsd  0xe45(%rip),%xmm0
divsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     127f <bessj0+0x14f>
sqrtsd %xmm0,%xmm0
jmp    1284 <bessj0+0x154>
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),%xmm2
movss  0xc(%rsp),%xmm1
mulss  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
movsd  0x20(%rsp),%xmm1
mulsd  %xmm0,%xmm1
mulsd  0x28(%rsp),%xmm2
subsd  %xmm1,%xmm2
mulsd  0x10(%rsp),%xmm2
xorps  %xmm0,%xmm0
cvtsd2ss %xmm2,%xmm0
add    $0x48,%rsp
ret

LLVM IR (-O0):
define float @bessj0(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 %42
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 double, double* %6
%20 = load double, double* %6
%21 = load double, double* %6
%22 = load double, double* %6
%23 = load double, double* %6
%24 = call double @llvm.fmuladd.f64(double %23, double 0xC0671CF7C59EDB22, double 0x40F2E50548605682)
%25 = call double @llvm.fmuladd.f64(double %22, double %24, double 0xC16563CB05C28F5C)
%26 = call double @llvm.fmuladd.f64(double %21, double %25, double 0x41C36B769C59999A)
%27 = call double @llvm.fmuladd.f64(double %20, double %26, double 0xC208E3C794900000)
%28 = call double @llvm.fmuladd.f64(double %19, double %27, double 0x422ACEB2E89C0000)
store double %28, double* %8
%29 = load double, double* %6
%30 = load double, double* %6
%31 = load double, double* %6
%32 = load double, double* %6
%33 = load double, double* %6
%34 = call double @llvm.fmuladd.f64(double %33, double 1.000000e+00, double 0x4070BDA6FFB3A9E6)
%35 = call double @llvm.fmuladd.f64(double %32, double %34, double 0x40ECF114C0C1FC8F)
%36 = call double @llvm.fmuladd.f64(double %31, double %35, double 0x41621C1316F9DB23)
%37 = call double @llvm.fmuladd.f64(double %30, double %36, double 0x41CEAEB69C800000)
%38 = call double @llvm.fmuladd.f64(double %29, double %37, double 0x422ACEB2E7560000)
store double %38, double* %9
%39 = load double, double* %8
%40 = load double, double* %9
%41 = fdiv double %39, %40
store double %41, double* %7
br label %88
42: ; preds = %1
%43 = load float, float* %3
%44 = fpext float %43 to double
%45 = fdiv double 8.000000e+00, %44
%46 = fptrunc double %45 to float
store float %46, float* %4
%47 = load float, float* %4
%48 = load float, float* %4
%49 = fmul float %47, %48
%50 = fpext float %49 to double
store double %50, double* %6
%51 = load float, float* %3
%52 = fpext float %51 to double
%53 = fsub double %52, 0x3FE921FB5496FD7F
store double %53, double* %5
%54 = load double, double* %6
%55 = load double, double* %6
%56 = load double, double* %6
%57 = load double, double* %6
%58 = call double @llvm.fmuladd.f64(double %57, double 0x3E8C1A8AAB292861, double 0xBEC1648790299C51)
%59 = call double @llvm.fmuladd.f64(double %56, double %58, double 0x3EFCAC653E340F37)
%60 = call double @llvm.fmuladd.f64(double %55, double %59, double 0xBF51FFFB817F9F0A)
%61 = call double @llvm.fmuladd.f64(double %54, double %60, double 1.000000e+00)
store double %61, double* %8
%62 = load double, double* %6
%63 = load double, double* %6
%64 = load double, double* %6
%65 = load double, double* %6
%66 = fneg double %65
%67 = call double @llvm.fmuladd.f64(double %66, double 0x3E7918D350375DFB, double 0x3EA992788C9726A9)
%68 = call double @llvm.fmuladd.f64(double %64, double %67, double 0xBEDCFCC9CD06FBFC)
%69 = call double @llvm.fmuladd.f64(double %63, double %68, double 0x3F22BFEC7E1AA561)
%70 = call double @llvm.fmuladd.f64(double %62, double %69, double 0xBF8FFFFFFE483202)
store double %70, double* %9
%71 = load float, float* %3
%72 = fpext float %71 to double
%73 = fdiv double 0x3FE45F306D974364, %72
%74 = call double @sqrt(double %73)
%75 = load double, double* %5
%76 = call double @cos(double %75)
%77 = load double, double* %8
%78 = load float, float* %4
%79 = load double, double* %5
%80 = call float @sin(double %79)
%81 = fmul float %78, %80
%82 = fpext float %81 to double
%83 = load double, double* %9
%84 = fmul double %82, %83
%85 = fneg double %84
%86 = call double @llvm.fmuladd.f64(double %76, double %77, double %85)
%87 = fmul double %74, %86
store double %87, double* %7
br label %88
88: ; preds = %42, %14
%89 = load double, double* %7
%90 = fptrunc double %89 to float
ret float %90
}

LLVM IR (-O2):
define float @bessj0(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 = tail call double @llvm.fmuladd.f64(double %7, double 0xC0671CF7C59EDB22, double 0x40F2E50548605682)
%9 = fadd double %7, 0x4070BDA6FFB3A9E6
%10 = insertelement <2 x double> poison, double %7, i64 0
%11 = shufflevector <2 x double> %10, <2 x double> poison, <2 x i32> zeroinitializer
%12 = insertelement <2 x double> poison, double %8, i64 0
%13 = insertelement <2 x double> %12, double %9, i64 1
%14 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %11, <2 x double> %13, <2 x double> <double 0xC16563CB05C28F5C, double 0x40ECF114C0C1FC8F>)
%15 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %11, <2 x double> %14, <2 x double> <double 0x41C36B769C59999A, double 0x41621C1316F9DB23>)
%16 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %11, <2 x double> %15, <2 x double> <double 0xC208E3C794900000, double 0x41CEAEB69C800000>)
%17 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %11, <2 x double> %16, <2 x double> <double 0x422ACEB2E89C0000, double 0x422ACEB2E7560000>)
%18 = extractelement <2 x double> %17, i64 0
%19 = extractelement <2 x double> %17, i64 1
%20 = fdiv double %18, %19
br label %45
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, 0xBFE921FB5496FD7F
%26 = tail call double @llvm.fmuladd.f64(double %24, double 0x3E8C1A8AAB292861, double 0xBEC1648790299C51)
%27 = tail call double @llvm.fmuladd.f64(double %24, double %26, double 0x3EFCAC653E340F37)
%28 = tail call double @llvm.fmuladd.f64(double %24, double %27, double 0xBF51FFFB817F9F0A)
%29 = tail call double @llvm.fmuladd.f64(double %24, double %28, double 1.000000e+00)
%30 = fneg double %24
%31 = tail call double @llvm.fmuladd.f64(double %30, double 0x3E7918D350375DFB, double 0x3EA992788C9726A9)
%32 = tail call double @llvm.fmuladd.f64(double %24, double %31, double 0xBEDCFCC9CD06FBFC)
%33 = tail call double @llvm.fmuladd.f64(double %24, double %32, double 0x3F22BFEC7E1AA561)
%34 = tail call double @llvm.fmuladd.f64(double %24, double %33, double 0xBF8FFFFFFE483202)
%35 = fdiv double 0x3FE45F306D974364, %3
%36 = tail call double @sqrt(double %35)
%37 = tail call double @cos(double %25)
%38 = tail call float @sin(double %25)
%39 = fmul float %22, %38
%40 = fpext float %39 to double
%41 = fneg double %34
%42 = fmul double %41, %40
%43 = tail call double @llvm.fmuladd.f64(double %37, double %29, double %42)
%44 = fmul double %36, %43
br label %45
45: ; preds = %21, %5
%46 = phi double [ %20, %5 ], [ %44, %21 ]
%47 = fptrunc double %46 to float
ret float %47
}