// File: /workspace/github_cpp_makefile_star2_O3/mouda[P]LTE_random_access-simulate/specialfunctions.cpp
// Function: alglib_impl::besselj1(double, alglib_impl::ae_state*)
double besselj1(double x, ae_state *_state)
{
    double s;
    double xsq;
    double nn;
    double pzero;
    double qzero;
    double p1;
    double q1;
    double result;


    s = ae_sign(x, _state);
    if( ae_fp_less(x,0) )
    {
        x = -x;
    }
    if( ae_fp_greater(x,8.0) )
    {
        bessel_besselasympt1(x, &pzero, &qzero, _state);
        nn = x-3*ae_pi/4;
        result = ae_sqrt(2/ae_pi/x, _state)*(pzero*ae_cos(nn, _state)-qzero*ae_sin(nn, _state));
        if( ae_fp_less(s,0) )
        {
            result = -result;
        }
        return result;
    }
    xsq = ae_sqr(x, _state);
    p1 = 2701.122710892323414856790990;
    p1 = -4695753.530642995859767162166+xsq*p1;
    p1 = 3413234182.301700539091292655+xsq*p1;
    p1 = -1322983480332.126453125473247+xsq*p1;
    p1 = 290879526383477.5409737601689+xsq*p1;
    p1 = -35888175699101060.50743641413+xsq*p1;
    p1 = 2316433580634002297.931815435+xsq*p1;
    p1 = -66721065689249162980.20941484+xsq*p1;
    p1 = 581199354001606143928.050809+xsq*p1;
    q1 = 1.0;
    q1 = 1606.931573481487801970916749+xsq*q1;
    q1 = 1501793.594998585505921097578+xsq*q1;
    q1 = 1013863514.358673989967045588+xsq*q1;
    q1 = 524371026216.7649715406728642+xsq*q1;
    q1 = 208166122130760.7351240184229+xsq*q1;
    q1 = 60920613989175217.46105196863+xsq*q1;
    q1 = 11857707121903209998.37113348+xsq*q1;
    q1 = 1162398708003212287858.529400+xsq*q1;
    result = s*x*p1/q1;
    return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x50, %rsp
movq %rdi, %rbx
movaps %xmm0, (%rsp)
callq 0x25e5b
movq %rax, %r14
xorps %xmm1, %xmm1
movaps (%rsp), %xmm0
callq 0x25bb9
testb %al, %al
jne 0x78c3
movapd (%rsp), %xmm2
jmp 0x78d0
movapd (%rsp), %xmm2
xorpd 0x2b8e0(%rip), %xmm2    # 0x331b0
movapd %xmm2, (%rsp)
xorps %xmm0, %xmm0
cvtsi2sd %r14, %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x2bd8d(%rip), %xmm1    # 0x33678
movapd %xmm2, %xmm0
callq 0x25bf9
testb %al, %al
je 0x79bd
leaq 0x48(%rsp), %r14
leaq 0x40(%rsp), %r15
movaps (%rsp), %xmm0
movq %r14, %rdi
movq %r15, %rsi
callq 0x12ed0
movsd 0x2c2bb(%rip), %xmm0    # 0x33bd8
movapd (%rsp), %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0x2c214(%rip), %xmm0    # 0x33b48
divsd %xmm1, %xmm0
movq %rbx, %rdi
callq 0x25e48
movsd %xmm0, 0x38(%rsp)
movsd (%r14), %xmm0
movsd %xmm0, 0x30(%rsp)
movsd 0x18(%rsp), %xmm0
movq %rbx, %rdi
callq 0x25f64
movaps %xmm0, (%rsp)
movsd (%r15), %xmm0
movsd %xmm0, 0x28(%rsp)
movsd 0x18(%rsp), %xmm0
movq %rbx, %rdi
callq 0x25f5f
mulsd 0x28(%rsp), %xmm0
movapd (%rsp), %xmm1
mulsd 0x30(%rsp), %xmm1
subsd %xmm0, %xmm1
mulsd 0x38(%rsp), %xmm1
movapd %xmm1, (%rsp)
xorpd %xmm1, %xmm1
movsd 0x20(%rsp), %xmm0
callq 0x25bb9
testb %al, %al
jne 0x7aa7
movapd (%rsp), %xmm0
jmp 0x7ab4
movapd (%rsp), %xmm0
movq %rbx, %rdi
callq 0x25e43
movsd 0x2c17e(%rip), %xmm1    # 0x33b50
mulsd %xmm0, %xmm1
addsd 0x2c17a(%rip), %xmm1    # 0x33b58
mulsd %xmm0, %xmm1
addsd 0x2c176(%rip), %xmm1    # 0x33b60
mulsd %xmm0, %xmm1
addsd 0x2c172(%rip), %xmm1    # 0x33b68
mulsd %xmm0, %xmm1
addsd 0x2c16e(%rip), %xmm1    # 0x33b70
mulsd %xmm0, %xmm1
addsd 0x2c16a(%rip), %xmm1    # 0x33b78
mulsd %xmm0, %xmm1
addsd 0x2c166(%rip), %xmm1    # 0x33b80
mulsd %xmm0, %xmm1
addsd 0x2c162(%rip), %xmm1    # 0x33b88
mulsd %xmm0, %xmm1
addsd 0x2c15e(%rip), %xmm1    # 0x33b90
movsd 0x2c15e(%rip), %xmm2    # 0x33b98
addsd %xmm0, %xmm2
mulsd %xmm0, %xmm2
addsd 0x2c156(%rip), %xmm2    # 0x33ba0
mulsd %xmm0, %xmm2
addsd 0x2c152(%rip), %xmm2    # 0x33ba8
mulsd %xmm0, %xmm2
addsd 0x2c14e(%rip), %xmm2    # 0x33bb0
mulsd %xmm0, %xmm2
addsd 0x2c14a(%rip), %xmm2    # 0x33bb8
mulsd %xmm0, %xmm2
addsd 0x2c146(%rip), %xmm2    # 0x33bc0
mulsd %xmm0, %xmm2
addsd 0x2c142(%rip), %xmm2    # 0x33bc8
mulsd %xmm0, %xmm2
addsd 0x2c13e(%rip), %xmm2    # 0x33bd0
movsd 0x20(%rsp), %xmm0
mulsd (%rsp), %xmm0
mulsd %xmm1, %xmm0
divsd %xmm2, %xmm0
jmp 0x7ab4
movapd (%rsp), %xmm0
xorpd 0x2b6fc(%rip), %xmm0    # 0x331b0
addq $0x50, %rsp
popq %rbx
popq %r14
popq %r15
retq