// File: /workspace/github_cpp_makefile_star2_O1/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 0x265a0
movq %rax, %r14
xorps %xmm1, %xmm1
movaps (%rsp), %xmm0
callq 0x262fe
testb %al, %al
jne 0x79e5
movapd (%rsp), %xmm2
jmp 0x79f2
movapd (%rsp), %xmm2
xorpd 0x2c7ee(%rip), %xmm2    # 0x341e0
movapd %xmm2, (%rsp)
xorps %xmm0, %xmm0
cvtsi2sd %r14, %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x2cc43(%rip), %xmm1    # 0x34650
movapd %xmm2, %xmm0
callq 0x2633e
testb %al, %al
je 0x7adf
leaq 0x48(%rsp), %r14
leaq 0x40(%rsp), %r15
movaps (%rsp), %xmm0
movq %r14, %rdi
movq %r15, %rsi
callq 0x13461
movsd 0x2d331(%rip), %xmm0    # 0x34d70
movapd (%rsp), %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0x2d28a(%rip), %xmm0    # 0x34ce0
divsd %xmm1, %xmm0
movq %rbx, %rdi
callq 0x2658d
movsd %xmm0, 0x38(%rsp)
movsd (%r14), %xmm0
movsd %xmm0, 0x30(%rsp)
movsd 0x18(%rsp), %xmm0
movq %rbx, %rdi
callq 0x266a9
movaps %xmm0, (%rsp)
movsd (%r15), %xmm0
movsd %xmm0, 0x28(%rsp)
movsd 0x18(%rsp), %xmm0
movq %rbx, %rdi
callq 0x266a4
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 0x262fe
testb %al, %al
jne 0x7bc9
movapd (%rsp), %xmm0
jmp 0x7bd6
movapd (%rsp), %xmm0
movq %rbx, %rdi
callq 0x26588
movsd 0x2d1f4(%rip), %xmm1    # 0x34ce8
mulsd %xmm0, %xmm1
addsd 0x2d1f0(%rip), %xmm1    # 0x34cf0
mulsd %xmm0, %xmm1
addsd 0x2d1ec(%rip), %xmm1    # 0x34cf8
mulsd %xmm0, %xmm1
addsd 0x2d1e8(%rip), %xmm1    # 0x34d00
mulsd %xmm0, %xmm1
addsd 0x2d1e4(%rip), %xmm1    # 0x34d08
mulsd %xmm0, %xmm1
addsd 0x2d1e0(%rip), %xmm1    # 0x34d10
mulsd %xmm0, %xmm1
addsd 0x2d1dc(%rip), %xmm1    # 0x34d18
mulsd %xmm0, %xmm1
addsd 0x2d1d8(%rip), %xmm1    # 0x34d20
mulsd %xmm0, %xmm1
addsd 0x2d1d4(%rip), %xmm1    # 0x34d28
movsd 0x2d1d4(%rip), %xmm2    # 0x34d30
addsd %xmm0, %xmm2
mulsd %xmm0, %xmm2
addsd 0x2d1cc(%rip), %xmm2    # 0x34d38
mulsd %xmm0, %xmm2
addsd 0x2d1c8(%rip), %xmm2    # 0x34d40
mulsd %xmm0, %xmm2
addsd 0x2d1c4(%rip), %xmm2    # 0x34d48
mulsd %xmm0, %xmm2
addsd 0x2d1c0(%rip), %xmm2    # 0x34d50
mulsd %xmm0, %xmm2
addsd 0x2d1bc(%rip), %xmm2    # 0x34d58
mulsd %xmm0, %xmm2
addsd 0x2d1b8(%rip), %xmm2    # 0x34d60
mulsd %xmm0, %xmm2
addsd 0x2d1b4(%rip), %xmm2    # 0x34d68
movsd 0x20(%rsp), %xmm0
mulsd (%rsp), %xmm0
mulsd %xmm1, %xmm0
divsd %xmm2, %xmm0
jmp 0x7bd6
movapd (%rsp), %xmm0
xorpd 0x2c60a(%rip), %xmm0    # 0x341e0
addq $0x50, %rsp
popq %rbx
popq %r14
popq %r15
retq