#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);
double fabs(double);
double sin(double);
double sqrt(double);
double bessj0(double x) {
  double 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
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
movaps 0xf77(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  %xmm1,-0x10(%rbp)
movsd  0xea6(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1267 <bessj0+0x137>
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm3
movsd  -0x28(%rbp),%xmm4
movsd  0xf1c(%rip),%xmm5
mulsd  %xmm5,%xmm4
movsd  0xf18(%rip),%xmm5
addsd  %xmm5,%xmm4
mulsd  %xmm4,%xmm3
movsd  0xef8(%rip),%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movsd  0xee0(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xec8(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeb0(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm3
movsd  -0x28(%rbp),%xmm4
movsd  0xe7e(%rip),%xmm5
addsd  %xmm5,%xmm4
mulsd  %xmm4,%xmm3
movsd  0xe66(%rip),%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movsd  0xe4e(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe36(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe1e(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
divsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    1403 <bessj0+0x2d3>
movsd  0xd91(%rip),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xdcb(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm3
movsd  0xd96(%rip),%xmm4
mulsd  %xmm4,%xmm3
movsd  0xd92(%rip),%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movsd  0xd72(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xd5a(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd42(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm3
movq   %xmm3,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm3
movsd  0xcf6(%rip),%xmm4
mulsd  %xmm4,%xmm3
movsd  0xcf2(%rip),%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movsd  0xcd2(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xcba(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xca2(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xc89(%rip),%xmm0
divsd  -0x10(%rbp),%xmm0
call   1050 <sqrt@plt>
movsd  %xmm0,-0x48(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x58(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <sin@plt>
movsd  -0x60(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm3
movaps %xmm0,%xmm4
movsd  -0x48(%rbp),%xmm0
mulsd  %xmm4,%xmm2
mulsd  -0x40(%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,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bessj0>:
sub    $0x48,%rsp
movapd 0xec4(%rip),%xmm1
andpd  %xmm0,%xmm1
movsd  0xf08(%rip),%xmm2
ucomisd %xmm1,%xmm2
jbe    11bb <bessj0+0x8b>
mulsd  %xmm0,%xmm0
movsd  0xf5e(%rip),%xmm2
mulsd  %xmm0,%xmm2
addsd  0xf5a(%rip),%xmm2
movsd  0xf5a(%rip),%xmm1
addsd  %xmm0,%xmm1
unpcklpd %xmm1,%xmm2
unpcklpd %xmm0,%xmm0
mulpd  %xmm0,%xmm2
addpd  0xe8a(%rip),%xmm2
mulpd  %xmm0,%xmm2
addpd  0xe8e(%rip),%xmm2
mulpd  %xmm0,%xmm2
addpd  0xe92(%rip),%xmm2
mulpd  %xmm0,%xmm2
addpd  0xe96(%rip),%xmm2
movapd %xmm2,%xmm0
unpckhpd %xmm2,%xmm0
divsd  %xmm0,%xmm2
jmp    12c3 <bessj0+0x193>
divsd  %xmm1,%xmm2
movsd  %xmm2,0x28(%rsp)
movapd %xmm2,%xmm0
mulsd  %xmm2,%xmm0
movsd  0xe8b(%rip),%xmm2
mulsd  %xmm0,%xmm2
addsd  0xe87(%rip),%xmm2
mulsd  %xmm0,%xmm2
addsd  0xe83(%rip),%xmm2
mulsd  %xmm0,%xmm2
addsd  0xe7f(%rip),%xmm2
mulsd  %xmm0,%xmm2
addsd  0xe7b(%rip),%xmm2
movsd  %xmm2,0x20(%rsp)
movsd  0xe75(%rip),%xmm2
mulsd  %xmm0,%xmm2
addsd  0xe71(%rip),%xmm2
movsd  0xe31(%rip),%xmm3
mulsd  %xmm0,%xmm2
addsd  0xe65(%rip),%xmm2
addsd  %xmm1,%xmm3
movsd  %xmm3,0x10(%rsp)
mulsd  %xmm0,%xmm2
addsd  0xe57(%rip),%xmm2
mulsd  %xmm0,%xmm2
addsd  0xe53(%rip),%xmm2
movsd  %xmm2,0x18(%rsp)
movsd  0xe4d(%rip),%xmm0
divsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1277 <bessj0+0x147>
sqrtsd %xmm0,%xmm0
jmp    127c <bessj0+0x14c>
call   1050 <sqrt@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1040 <cos@plt>
movaps %xmm0,0x30(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <sin@plt>
movapd 0x30(%rsp),%xmm2
mulsd  0x28(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
mulsd  %xmm0,%xmm1
mulsd  0x20(%rsp),%xmm2
subsd  %xmm1,%xmm2
mulsd  0x8(%rsp),%xmm2
movapd %xmm2,%xmm0
add    $0x48,%rsp
ret

LLVM IR (-O0):
define double @bessj0(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double %0, double* %2
%10 = load double, double* %2
%11 = call double @llvm.fabs.f64(double %10)
store double %11, double* %3
%12 = fcmp olt double %11, 8.000000e+00
br i1 %12, label %13, label %40
13: ; preds = %1
%14 = load double, double* %2
%15 = load double, double* %2
%16 = fmul double %14, %15
store double %16, double* %6
%17 = load double, double* %6
%18 = load double, double* %6
%19 = load double, double* %6
%20 = load double, double* %6
%21 = load double, double* %6
%22 = call double @llvm.fmuladd.f64(double %21, double 0xC0671CF7C59EDB22, double 0x40F2E50548605682)
%23 = call double @llvm.fmuladd.f64(double %20, double %22, double 0xC16563CB05C28F5C)
%24 = call double @llvm.fmuladd.f64(double %19, double %23, double 0x41C36B769C59999A)
%25 = call double @llvm.fmuladd.f64(double %18, double %24, double 0xC208E3C794900000)
%26 = call double @llvm.fmuladd.f64(double %17, double %25, double 0x422ACEB2E89C0000)
store double %26, double* %8
%27 = load double, double* %6
%28 = load double, double* %6
%29 = load double, double* %6
%30 = load double, double* %6
%31 = load double, double* %6
%32 = call double @llvm.fmuladd.f64(double %31, double 1.000000e+00, double 0x4070BDA6FFB3A9E6)
%33 = call double @llvm.fmuladd.f64(double %30, double %32, double 0x40ECF114C0C1FC8F)
%34 = call double @llvm.fmuladd.f64(double %29, double %33, double 0x41621C1316F9DB23)
%35 = call double @llvm.fmuladd.f64(double %28, double %34, double 0x41CEAEB69C800000)
%36 = call double @llvm.fmuladd.f64(double %27, double %35, double 0x422ACEB2E7560000)
store double %36, double* %9
%37 = load double, double* %8
%38 = load double, double* %9
%39 = fdiv double %37, %38
store double %39, double* %7
br label %80
40: ; preds = %1
%41 = load double, double* %3
%42 = fdiv double 8.000000e+00, %41
store double %42, double* %4
%43 = load double, double* %4
%44 = load double, double* %4
%45 = fmul double %43, %44
store double %45, double* %6
%46 = load double, double* %3
%47 = fsub double %46, 0x3FE921FB5496FD7F
store double %47, double* %5
%48 = load double, double* %6
%49 = load double, double* %6
%50 = load double, double* %6
%51 = load double, double* %6
%52 = call double @llvm.fmuladd.f64(double %51, double 0x3E8C1A8AAB292861, double 0xBEC1648790299C51)
%53 = call double @llvm.fmuladd.f64(double %50, double %52, double 0x3EFCAC653E340F37)
%54 = call double @llvm.fmuladd.f64(double %49, double %53, double 0xBF51FFFB817F9F0A)
%55 = call double @llvm.fmuladd.f64(double %48, double %54, double 1.000000e+00)
store double %55, double* %8
%56 = load double, double* %6
%57 = load double, double* %6
%58 = load double, double* %6
%59 = load double, double* %6
%60 = fneg double %59
%61 = call double @llvm.fmuladd.f64(double %60, double 0x3E7918D350375DFB, double 0x3EA992788C9726A9)
%62 = call double @llvm.fmuladd.f64(double %58, double %61, double 0xBEDCFCC9CD06FBFC)
%63 = call double @llvm.fmuladd.f64(double %57, double %62, double 0x3F22BFEC7E1AA561)
%64 = call double @llvm.fmuladd.f64(double %56, double %63, double 0xBF8FFFFFFE483202)
store double %64, double* %9
%65 = load double, double* %3
%66 = fdiv double 0x3FE45F306D974364, %65
%67 = call double @sqrt(double %66)
%68 = load double, double* %5
%69 = call double @cos(double %68)
%70 = load double, double* %8
%71 = load double, double* %4
%72 = load double, double* %5
%73 = call double @sin(double %72)
%74 = fmul double %71, %73
%75 = load double, double* %9
%76 = fmul double %74, %75
%77 = fneg double %76
%78 = call double @llvm.fmuladd.f64(double %69, double %70, double %77)
%79 = fmul double %67, %78
store double %79, double* %7
br label %80
80: ; preds = %40, %13
%81 = load double, double* %7
ret double %81
}

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