#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 bessj1(double x) {
  double 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
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    1270 <bessj1+0x140>
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm3
movsd  -0x28(%rbp),%xmm4
movsd  -0x28(%rbp),%xmm5
movsd  0xf17(%rip),%xmm6
mulsd  %xmm6,%xmm5
movsd  0xf13(%rip),%xmm6
addsd  %xmm6,%xmm5
mulsd  %xmm5,%xmm4
movsd  0xef3(%rip),%xmm5
addsd  %xmm5,%xmm4
mulsd  %xmm4,%xmm3
movsd  0xedb(%rip),%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movsd  0xec3(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xeab(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %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  0xe75(%rip),%xmm5
addsd  %xmm5,%xmm4
mulsd  %xmm4,%xmm3
movsd  0xe5d(%rip),%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movsd  0xe45(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe2d(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe15(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
divsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    1429 <bessj1+0x2f9>
movsd  0xd88(%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  0xdc2(%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  0xd8d(%rip),%xmm4
mulsd  %xmm4,%xmm3
movsd  0xd89(%rip),%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movsd  0xd69(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xd51(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd39(%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  0xd04(%rip),%xmm4
mulsd  %xmm4,%xmm3
movsd  0xd00(%rip),%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movsd  0xce0(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xcc8(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xcb0(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xc97(%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)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1424 <bessj1+0x2f4>
movsd  -0x30(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    1429 <bessj1+0x2f9>
movsd  -0x30(%rbp),%xmm0
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bessj1>:
sub    $0x58,%rsp
movapd 0xec4(%rip),%xmm1
andpd  %xmm0,%xmm1
movsd  0xed8(%rip),%xmm2
ucomisd %xmm1,%xmm2
jbe    11e7 <bessj1+0xb7>
movapd %xmm0,%xmm2
mulsd  %xmm0,%xmm2
movsd  0xf26(%rip),%xmm3
mulsd  %xmm2,%xmm3
addsd  0xf22(%rip),%xmm3
mulsd  %xmm2,%xmm3
addsd  0xf1e(%rip),%xmm3
mulsd  %xmm2,%xmm3
addsd  0xf1a(%rip),%xmm3
mulsd  %xmm2,%xmm3
addsd  0xf16(%rip),%xmm3
mulsd  %xmm2,%xmm3
addsd  0xf12(%rip),%xmm3
movsd  0xf12(%rip),%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm2,%xmm1
addsd  0xf0a(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xf06(%rip),%xmm1
mulsd  %xmm0,%xmm3
mulsd  %xmm2,%xmm1
addsd  0xefe(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xefa(%rip),%xmm1
divsd  %xmm1,%xmm3
jmp    1309 <bessj1+0x1d9>
movapd %xmm0,0x40(%rsp)
divsd  %xmm1,%xmm2
movsd  %xmm2,0x28(%rsp)
movapd %xmm2,%xmm0
mulsd  %xmm2,%xmm0
movsd  0xe29(%rip),%xmm2
mulsd  %xmm0,%xmm2
addsd  0xe25(%rip),%xmm2
mulsd  %xmm0,%xmm2
addsd  0xe21(%rip),%xmm2
mulsd  %xmm0,%xmm2
addsd  0xe1d(%rip),%xmm2
mulsd  %xmm0,%xmm2
addsd  0xe19(%rip),%xmm2
movsd  %xmm2,0x20(%rsp)
movsd  0xe13(%rip),%xmm2
mulsd  %xmm0,%xmm2
addsd  0xe0f(%rip),%xmm2
movsd  0xdcf(%rip),%xmm3
mulsd  %xmm0,%xmm2
addsd  0xe03(%rip),%xmm2
addsd  %xmm1,%xmm3
movsd  %xmm3,0x10(%rsp)
mulsd  %xmm0,%xmm2
addsd  0xdf5(%rip),%xmm2
mulsd  %xmm0,%xmm2
addsd  0xdf1(%rip),%xmm2
movsd  %xmm2,0x18(%rsp)
movsd  0xdeb(%rip),%xmm0
divsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     12a9 <bessj1+0x179>
sqrtsd %xmm0,%xmm0
jmp    12ae <bessj1+0x17e>
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),%xmm3
mulsd  0x28(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
mulsd  %xmm0,%xmm1
mulsd  0x20(%rsp),%xmm3
subsd  %xmm1,%xmm3
mulsd  0x8(%rsp),%xmm3
xorpd  %xmm0,%xmm0
ucomisd 0x40(%rsp),%xmm0
jbe    1309 <bessj1+0x1d9>
xorpd  0xd07(%rip),%xmm3
movapd %xmm3,%xmm0
add    $0x58,%rsp
ret

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

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