// File: /workspace/github_cpp_makefile_star2_O1/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 $0x40, %rsp
movq %rdi, %rbx
xorps %xmm1, %xmm1
movaps %xmm0, (%rsp)
callq 0x262fe
testb %al, %al
jne 0x7752
movaps (%rsp), %xmm0
jmp 0x775d
movaps (%rsp), %xmm0
xorps 0x2ca83(%rip), %xmm0    # 0x341e0
movsd 0x2ceeb(%rip), %xmm1    # 0x34650
movaps %xmm0, (%rsp)
callq 0x2633e
testb %al, %al
je 0x7817
leaq 0x38(%rsp), %r14
leaq 0x30(%rsp), %r15
movaps (%rsp), %xmm0
movq %r14, %rdi
movq %r15, %rsi
callq 0x132fc
movsd 0x2d541(%rip), %xmm0    # 0x34cd8
movapd (%rsp), %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x2d532(%rip), %xmm0    # 0x34ce0
divsd %xmm1, %xmm0
movq %rbx, %rdi
callq 0x2658d
movsd %xmm0, (%rsp)
movsd (%r14), %xmm0
movsd %xmm0, 0x28(%rsp)
movsd 0x10(%rsp), %xmm0
movq %rbx, %rdi
callq 0x266a9
movsd %xmm0, 0x18(%rsp)
movsd (%r15), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x10(%rsp), %xmm0
movq %rbx, %rdi
callq 0x266a4
movsd 0x18(%rsp), %xmm3
mulsd 0x20(%rsp), %xmm0
mulsd 0x28(%rsp), %xmm3
subsd %xmm0, %xmm3
mulsd (%rsp), %xmm3
jmp 0x78f0
movapd (%rsp), %xmm0
movq %rbx, %rdi
callq 0x26588
movsd 0x2d42c(%rip), %xmm3    # 0x34c58
mulsd %xmm0, %xmm3
addsd 0x2d428(%rip), %xmm3    # 0x34c60
mulsd %xmm0, %xmm3
addsd 0x2d424(%rip), %xmm3    # 0x34c68
mulsd %xmm0, %xmm3
addsd 0x2d420(%rip), %xmm3    # 0x34c70
mulsd %xmm0, %xmm3
addsd 0x2d41c(%rip), %xmm3    # 0x34c78
mulsd %xmm0, %xmm3
addsd 0x2d418(%rip), %xmm3    # 0x34c80
mulsd %xmm0, %xmm3
addsd 0x2d414(%rip), %xmm3    # 0x34c88
mulsd %xmm0, %xmm3
addsd 0x2d410(%rip), %xmm3    # 0x34c90
movsd 0x2d418(%rip), %xmm1    # 0x34ca0
addsd %xmm0, %xmm1
mulsd %xmm0, %xmm1
addsd 0x2d410(%rip), %xmm1    # 0x34ca8
mulsd %xmm0, %xmm1
addsd 0x2d40c(%rip), %xmm1    # 0x34cb0
mulsd %xmm0, %xmm1
addsd 0x2d408(%rip), %xmm1    # 0x34cb8
mulsd %xmm0, %xmm1
addsd 0x2d404(%rip), %xmm1    # 0x34cc0
mulsd %xmm0, %xmm3
mulsd %xmm0, %xmm1
addsd 0x2d3fc(%rip), %xmm1    # 0x34cc8
movsd 0x2d3c4(%rip), %xmm2    # 0x34c98
mulsd %xmm0, %xmm1
addsd 0x2d3f0(%rip), %xmm1    # 0x34cd0
addsd %xmm2, %xmm3
mulsd %xmm0, %xmm1
addsd %xmm2, %xmm1
divsd %xmm1, %xmm3
movapd %xmm3, %xmm0
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq