// File: /workspace/github_cpp_makefile_star2_O2/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 0x24437
movq %rax, %r14
xorps %xmm1, %xmm1
movaps (%rsp), %xmm0
callq 0x24239
testb %al, %al
jne 0x71b0
movapd (%rsp), %xmm2
jmp 0x71bd
movapd (%rsp), %xmm2
xorpd 0x28ff3(%rip), %xmm2    # 0x301b0
movapd %xmm2, (%rsp)
cvtsi2sd %r14, %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x294a3(%rip), %xmm1    # 0x30678
movapd %xmm2, %xmm0
callq 0x24279
testb %al, %al
je 0x72a7
leaq 0x48(%rsp), %r14
leaq 0x40(%rsp), %r15
movaps (%rsp), %xmm0
movq %r14, %rdi
movq %r15, %rsi
callq 0x1232a
movsd 0x299d1(%rip), %xmm0    # 0x30bd8
movapd (%rsp), %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0x2992a(%rip), %xmm0    # 0x30b48
divsd %xmm1, %xmm0
movq %rbx, %rdi
callq 0x24424
movsd %xmm0, 0x38(%rsp)
movsd (%r14), %xmm0
movsd %xmm0, 0x30(%rsp)
movsd 0x18(%rsp), %xmm0
movq %rbx, %rdi
callq 0x24532
movaps %xmm0, (%rsp)
movsd (%r15), %xmm0
movsd %xmm0, 0x28(%rsp)
movsd 0x18(%rsp), %xmm0
movq %rbx, %rdi
callq 0x2452d
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 0x24239
testb %al, %al
jne 0x7391
movapd (%rsp), %xmm0
jmp 0x739e
movapd (%rsp), %xmm0
movq %rbx, %rdi
callq 0x2441f
movsd 0x29894(%rip), %xmm1    # 0x30b50
mulsd %xmm0, %xmm1
addsd 0x29890(%rip), %xmm1    # 0x30b58
mulsd %xmm0, %xmm1
addsd 0x2988c(%rip), %xmm1    # 0x30b60
mulsd %xmm0, %xmm1
addsd 0x29888(%rip), %xmm1    # 0x30b68
mulsd %xmm0, %xmm1
addsd 0x29884(%rip), %xmm1    # 0x30b70
mulsd %xmm0, %xmm1
addsd 0x29880(%rip), %xmm1    # 0x30b78
mulsd %xmm0, %xmm1
addsd 0x2987c(%rip), %xmm1    # 0x30b80
mulsd %xmm0, %xmm1
addsd 0x29878(%rip), %xmm1    # 0x30b88
mulsd %xmm0, %xmm1
addsd 0x29874(%rip), %xmm1    # 0x30b90
movsd 0x29874(%rip), %xmm2    # 0x30b98
addsd %xmm0, %xmm2
mulsd %xmm0, %xmm2
addsd 0x2986c(%rip), %xmm2    # 0x30ba0
mulsd %xmm0, %xmm2
addsd 0x29868(%rip), %xmm2    # 0x30ba8
mulsd %xmm0, %xmm2
addsd 0x29864(%rip), %xmm2    # 0x30bb0
mulsd %xmm0, %xmm2
addsd 0x29860(%rip), %xmm2    # 0x30bb8
mulsd %xmm0, %xmm2
addsd 0x2985c(%rip), %xmm2    # 0x30bc0
mulsd %xmm0, %xmm2
addsd 0x29858(%rip), %xmm2    # 0x30bc8
mulsd %xmm0, %xmm2
addsd 0x29854(%rip), %xmm2    # 0x30bd0
movsd 0x20(%rsp), %xmm0
mulsd (%rsp), %xmm0
mulsd %xmm1, %xmm0
divsd %xmm2, %xmm0
jmp 0x739e
movapd (%rsp), %xmm0
xorpd 0x28e12(%rip), %xmm0    # 0x301b0
addq $0x50, %rsp
popq %rbx
popq %r14
popq %r15
retq