// File: 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 %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movsd %xmm0, -0x10(%rbp)
movq %rdi, -0x18(%rbp)
movsd -0x10(%rbp), %xmm0
movq -0x18(%rbp), %rdi
callq 0x3c8c0
cvtsi2sd %rax, %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x10(%rbp), %xmm0
xorps %xmm1, %xmm1
callq 0x3c440
testb $0x1, %al
jne 0xa41f
jmp 0xa440
movsd -0x10(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, -0x10(%rbp)
movsd -0x10(%rbp), %xmm0
movsd 0x4b1d3(%rip), %xmm1    # 0x55620
callq 0x3c4c0
testb $0x1, %al
jne 0xa45b
jmp 0xa55d
movsd -0x10(%rbp), %xmm0
movq -0x18(%rbp), %rdx
leaq -0x38(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x1c4c0
movsd -0x10(%rbp), %xmm0
movsd 0x4b8ca(%rip), %xmm1    # 0x55d48
subsd %xmm1, %xmm0
movsd %xmm0, -0x30(%rbp)
movsd 0x4b829(%rip), %xmm0    # 0x55cb8
divsd -0x10(%rbp), %xmm0
movq -0x18(%rbp), %rdi
callq 0x3c890
movsd %xmm0, -0x60(%rbp)
movsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x70(%rbp)
movsd -0x30(%rbp), %xmm0
movq -0x18(%rbp), %rdi
callq 0x3cbc0
movsd %xmm0, -0x68(%rbp)
movsd -0x40(%rbp), %xmm0
movsd %xmm0, -0x78(%rbp)
movsd -0x30(%rbp), %xmm0
movq -0x18(%rbp), %rdi
callq 0x3cb90
movsd -0x78(%rbp), %xmm2
movsd -0x70(%rbp), %xmm1
movsd -0x68(%rbp), %xmm3
movaps %xmm0, %xmm4
movsd -0x60(%rbp), %xmm0
mulsd %xmm4, %xmm2
movq %xmm2, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm2
mulsd %xmm3, %xmm1
addsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x58(%rbp)
movsd -0x20(%rbp), %xmm0
xorps %xmm1, %xmm1
callq 0x3c440
testb $0x1, %al
jne 0xa52d
jmp 0xa54e
movsd -0x58(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, -0x58(%rbp)
movsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x8(%rbp)
jmp 0xa79d
movsd -0x10(%rbp), %xmm0
movq -0x18(%rbp), %rdi
callq 0x3c870
movsd %xmm0, -0x28(%rbp)
movsd 0x4b7c8(%rip), %xmm0    # 0x55d40
movsd %xmm0, -0x48(%rbp)
movsd -0x28(%rbp), %xmm0
movsd -0x48(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4b7a5(%rip), %xmm1    # 0x55d38
addsd %xmm1, %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0x28(%rbp), %xmm0
movsd -0x48(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4b77e(%rip), %xmm1    # 0x55d30
addsd %xmm1, %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0x28(%rbp), %xmm0
movsd -0x48(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4b757(%rip), %xmm1    # 0x55d28
addsd %xmm1, %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0x28(%rbp), %xmm0
movsd -0x48(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4b730(%rip), %xmm1    # 0x55d20
addsd %xmm1, %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0x28(%rbp), %xmm0
movsd -0x48(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4b709(%rip), %xmm1    # 0x55d18
addsd %xmm1, %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0x28(%rbp), %xmm0
movsd -0x48(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4b6e2(%rip), %xmm1    # 0x55d10
addsd %xmm1, %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0x28(%rbp), %xmm0
movsd -0x48(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4b6bb(%rip), %xmm1    # 0x55d08
addsd %xmm1, %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0x28(%rbp), %xmm0
movsd -0x48(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4b694(%rip), %xmm1    # 0x55d00
addsd %xmm1, %xmm0
movsd %xmm0, -0x48(%rbp)
movsd 0x4a98b(%rip), %xmm0    # 0x55008
movsd %xmm0, -0x50(%rbp)
movsd -0x28(%rbp), %xmm0
movsd -0x50(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4b660(%rip), %xmm1    # 0x55cf8
addsd %xmm1, %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0x28(%rbp), %xmm0
movsd -0x50(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4b639(%rip), %xmm1    # 0x55cf0
addsd %xmm1, %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0x28(%rbp), %xmm0
movsd -0x50(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4b612(%rip), %xmm1    # 0x55ce8
addsd %xmm1, %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0x28(%rbp), %xmm0
movsd -0x50(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4b5eb(%rip), %xmm1    # 0x55ce0
addsd %xmm1, %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0x28(%rbp), %xmm0
movsd -0x50(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4b5c4(%rip), %xmm1    # 0x55cd8
addsd %xmm1, %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0x28(%rbp), %xmm0
movsd -0x50(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4b59d(%rip), %xmm1    # 0x55cd0
addsd %xmm1, %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0x28(%rbp), %xmm0
movsd -0x50(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4b576(%rip), %xmm1    # 0x55cc8
addsd %xmm1, %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0x28(%rbp), %xmm0
movsd -0x50(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4b54f(%rip), %xmm1    # 0x55cc0
addsd %xmm1, %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0x20(%rbp), %xmm0
mulsd -0x10(%rbp), %xmm0
mulsd -0x48(%rbp), %xmm0
divsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
movsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x8(%rbp)
movsd -0x8(%rbp), %xmm0
addq $0x80, %rsp
popq %rbp
retq
nopl (%rax,%rax)