// File: /workspace/github_cpp_makefile_star2_O2/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 0x24239
testb %al, %al
jne 0x6f64
movaps (%rsp), %xmm0
jmp 0x6f6f
movaps (%rsp), %xmm0
xorps 0x29241(%rip), %xmm0    # 0x301b0
movsd 0x29701(%rip), %xmm1    # 0x30678
movaps %xmm0, (%rsp)
callq 0x24279
testb %al, %al
je 0x7028
leaq 0x48(%rsp), %r14
leaq 0x40(%rsp), %r15
movaps (%rsp), %xmm0
movq %r14, %rdi
movq %r15, %rsi
callq 0x121f5
movsd 0x29b97(%rip), %xmm0    # 0x30b40
movapd (%rsp), %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0x29b88(%rip), %xmm0    # 0x30b48
divsd %xmm1, %xmm0
movq %rbx, %rdi
callq 0x24424
movsd %xmm0, (%rsp)
movsd (%r14), %xmm0
movsd %xmm0, 0x28(%rsp)
movsd 0x18(%rsp), %xmm0
movq %rbx, %rdi
callq 0x24532
movaps %xmm0, 0x30(%rsp)
movsd (%r15), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x18(%rsp), %xmm0
movq %rbx, %rdi
callq 0x2452d
movapd 0x30(%rsp), %xmm2
mulsd 0x20(%rsp), %xmm0
mulsd 0x28(%rsp), %xmm2
subsd %xmm0, %xmm2
mulsd (%rsp), %xmm2
jmp 0x70bd
movapd (%rsp), %xmm0
movq %rbx, %rdi
callq 0x2441f
movsd 0x29aeb(%rip), %xmm2    # 0x30b28
mulsd %xmm0, %xmm2
addsd 0x29ae7(%rip), %xmm2    # 0x30b30
movsd 0x29ae7(%rip), %xmm1    # 0x30b38
addsd %xmm0, %xmm1
unpcklpd %xmm1, %xmm2            # xmm2 = xmm2[0],xmm1[0]
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
mulpd %xmm0, %xmm2
addpd 0x2ad57(%rip), %xmm2    # 0x31dc0
mulpd %xmm0, %xmm2
addpd 0x2ad5b(%rip), %xmm2    # 0x31dd0
mulpd %xmm0, %xmm2
addpd 0x2ad5f(%rip), %xmm2    # 0x31de0
mulpd %xmm0, %xmm2
addpd 0x2ad63(%rip), %xmm2    # 0x31df0
mulpd %xmm0, %xmm2
addpd 0x2ad67(%rip), %xmm2    # 0x31e00
mulpd %xmm0, %xmm2
addpd 0x2ad6b(%rip), %xmm2    # 0x31e10
mulpd %xmm0, %xmm2
addpd 0x2ad6f(%rip), %xmm2    # 0x31e20
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