// File: /workspace/github_cpp_makefile_star2_O3/mouda[P]LTE_random_access-simulate/specialfunctions.cpp
// Function: alglib_impl::besselj0(double, alglib_impl::ae_state*)
double besselj0(double x, ae_state *_state)
{
    double xsq;
    double nn;
    double pzero;
    double qzero;
    double p1;
    double q1;
    double result;


    if( ae_fp_less(x,0) )
    {
        x = -x;
    }
    if( ae_fp_greater(x,8.0) )
    {
        bessel_besselasympt0(x, &pzero, &qzero, _state);
        nn = x-ae_pi/4;
        result = ae_sqrt(2/ae_pi/x, _state)*(pzero*ae_cos(nn, _state)-qzero*ae_sin(nn, _state));
        return result;
    }
    xsq = ae_sqr(x, _state);
    p1 = 26857.86856980014981415848441;
    p1 = -40504123.71833132706360663322+xsq*p1;
    p1 = 25071582855.36881945555156435+xsq*p1;
    p1 = -8085222034853.793871199468171+xsq*p1;
    p1 = 1434354939140344.111664316553+xsq*p1;
    p1 = -136762035308817138.6865416609+xsq*p1;
    p1 = 6382059341072356562.289432465+xsq*p1;
    p1 = -117915762910761053603.8440800+xsq*p1;
    p1 = 493378725179413356181.6813446+xsq*p1;
    q1 = 1.0;
    q1 = 1363.063652328970604442810507+xsq*q1;
    q1 = 1114636.098462985378182402543+xsq*q1;
    q1 = 669998767.2982239671814028660+xsq*q1;
    q1 = 312304311494.1213172572469442+xsq*q1;
    q1 = 112775673967979.8507056031594+xsq*q1;
    q1 = 30246356167094626.98627330784+xsq*q1;
    q1 = 5428918384092285160.200195092+xsq*q1;
    q1 = 493378725179413356211.3278438+xsq*q1;
    result = p1/q1;
    return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x50, %rsp
movq %rdi, %rbx
xorps %xmm1, %xmm1
movaps %xmm0, (%rsp)
callq 0x25bb9
testb %al, %al
jne 0x7675
movaps (%rsp), %xmm0
jmp 0x7680
movaps (%rsp), %xmm0
xorps 0x2bb30(%rip), %xmm0    # 0x331b0
movsd 0x2bff0(%rip), %xmm1    # 0x33678
movaps %xmm0, (%rsp)
callq 0x25bf9
testb %al, %al
je 0x7739
leaq 0x48(%rsp), %r14
leaq 0x40(%rsp), %r15
movaps (%rsp), %xmm0
movq %r14, %rdi
movq %r15, %rsi
callq 0x12d9b
movsd 0x2c486(%rip), %xmm0    # 0x33b40
movapd (%rsp), %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0x2c477(%rip), %xmm0    # 0x33b48
divsd %xmm1, %xmm0
movq %rbx, %rdi
callq 0x25e48
movsd %xmm0, (%rsp)
movsd (%r14), %xmm0
movsd %xmm0, 0x28(%rsp)
movsd 0x18(%rsp), %xmm0
movq %rbx, %rdi
callq 0x25f64
movaps %xmm0, 0x30(%rsp)
movsd (%r15), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x18(%rsp), %xmm0
movq %rbx, %rdi
callq 0x25f5f
movapd 0x30(%rsp), %xmm2
mulsd 0x20(%rsp), %xmm0
mulsd 0x28(%rsp), %xmm2
subsd %xmm0, %xmm2
mulsd (%rsp), %xmm2
jmp 0x77ce
movapd (%rsp), %xmm0
movq %rbx, %rdi
callq 0x25e43
movsd 0x2c3da(%rip), %xmm2    # 0x33b28
mulsd %xmm0, %xmm2
addsd 0x2c3d6(%rip), %xmm2    # 0x33b30
movsd 0x2c3d6(%rip), %xmm1    # 0x33b38
addsd %xmm0, %xmm1
unpcklpd %xmm1, %xmm2            # xmm2 = xmm2[0],xmm1[0]
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
mulpd %xmm0, %xmm2
addpd 0x2d656(%rip), %xmm2    # 0x34dd0
mulpd %xmm0, %xmm2
addpd 0x2d65a(%rip), %xmm2    # 0x34de0
mulpd %xmm0, %xmm2
addpd 0x2d65e(%rip), %xmm2    # 0x34df0
mulpd %xmm0, %xmm2
addpd 0x2d662(%rip), %xmm2    # 0x34e00
mulpd %xmm0, %xmm2
addpd 0x2d666(%rip), %xmm2    # 0x34e10
mulpd %xmm0, %xmm2
addpd 0x2d66a(%rip), %xmm2    # 0x34e20
mulpd %xmm0, %xmm2
addpd 0x2d66e(%rip), %xmm2    # 0x34e30
movapd %xmm2, %xmm0
unpckhpd %xmm2, %xmm0            # xmm0 = xmm0[1],xmm2[1]
divsd %xmm0, %xmm2
movapd %xmm2, %xmm0
addq $0x50, %rsp
popq %rbx
popq %r14
popq %r15
retq