// File: /workspace/github_cpp_makefile_star2_O3/mouda[P]LTE_random_access-simulate/specialfunctions.cpp
// Function: alglib_impl::bessely1(double, alglib_impl::ae_state*)
double bessely1(double x, ae_state *_state)
{
    double nn;
    double xsq;
    double pzero;
    double qzero;
    double p4;
    double q4;
    double result;


    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_sin(nn, _state)+qzero*ae_cos(nn, _state));
        return result;
    }
    xsq = ae_sqr(x, _state);
    p4 = -2108847.540133123652824139923;
    p4 = 3639488548.124002058278999428+xsq*p4;
    p4 = -2580681702194.450950541426399+xsq*p4;
    p4 = 956993023992168.3481121552788+xsq*p4;
    p4 = -196588746272214065.8820322248+xsq*p4;
    p4 = 21931073399177975921.11427556+xsq*p4;
    p4 = -1212297555414509577913.561535+xsq*p4;
    p4 = 26554738314348543268942.48968+xsq*p4;
    p4 = -99637534243069222259967.44354+xsq*p4;
    q4 = 1.0;
    q4 = 1612.361029677000859332072312+xsq*q4;
    q4 = 1563282.754899580604737366452+xsq*q4;
    q4 = 1128686837.169442121732366891+xsq*q4;
    q4 = 646534088126.5275571961681500+xsq*q4;
    q4 = 297663212564727.6729292742282+xsq*q4;
    q4 = 108225825940881955.2553850180+xsq*q4;
    q4 = 29549879358971486742.90758119+xsq*q4;
    q4 = 5435310377188854170800.653097+xsq*q4;
    q4 = 508206736694124324531442.4152+xsq*q4;
    result = x*p4/q4+2/ae_pi*(besselj1(x, _state)*ae_log(x, _state)-1/x);
    return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
movsd 0x2b591(%rip), %xmm1    # 0x33678
movsd %xmm0, 0x8(%rsp)
callq 0x25bf9
testb %al, %al
je 0x81a0
leaq 0x38(%rsp), %r14
leaq 0x30(%rsp), %r15
movsd 0x8(%rsp), %xmm0
movq %r14, %rdi
movq %r15, %rsi
callq 0x12ed0
movsd 0x2babb(%rip), %xmm0    # 0x33bd8
movsd 0x8(%rsp), %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x2ba13(%rip), %xmm0    # 0x33b48
divsd %xmm1, %xmm0
movq %rbx, %rdi
callq 0x25e48
movsd %xmm0, 0x8(%rsp)
movsd (%r14), %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0x10(%rsp), %xmm0
movq %rbx, %rdi
callq 0x25f5f
movsd %xmm0, 0x28(%rsp)
movsd (%r15), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x10(%rsp), %xmm0
movq %rbx, %rdi
callq 0x25f64
mulsd 0x20(%rsp), %xmm0
movsd 0x28(%rsp), %xmm1
mulsd 0x18(%rsp), %xmm1
addsd %xmm1, %xmm0
mulsd 0x8(%rsp), %xmm0
jmp 0x82dc
movsd 0x8(%rsp), %xmm0
movq %rbx, %rdi
callq 0x25e43
movsd 0x2ba42(%rip), %xmm1    # 0x33bf8
mulsd %xmm0, %xmm1
addsd 0x2ba3e(%rip), %xmm1    # 0x33c00
mulsd %xmm0, %xmm1
addsd 0x2ba3a(%rip), %xmm1    # 0x33c08
mulsd %xmm0, %xmm1
addsd 0x2ba36(%rip), %xmm1    # 0x33c10
mulsd %xmm0, %xmm1
addsd 0x2ba32(%rip), %xmm1    # 0x33c18
mulsd %xmm0, %xmm1
addsd 0x2ba2e(%rip), %xmm1    # 0x33c20
mulsd %xmm0, %xmm1
addsd 0x2ba2a(%rip), %xmm1    # 0x33c28
mulsd %xmm0, %xmm1
addsd 0x2ba26(%rip), %xmm1    # 0x33c30
mulsd %xmm0, %xmm1
addsd 0x2ba22(%rip), %xmm1    # 0x33c38
movapd %xmm1, %xmm2
movsd 0x2ba1e(%rip), %xmm1    # 0x33c40
addsd %xmm0, %xmm1
mulsd %xmm0, %xmm1
addsd 0x2ba16(%rip), %xmm1    # 0x33c48
mulsd %xmm0, %xmm1
addsd 0x2ba12(%rip), %xmm1    # 0x33c50
mulsd %xmm0, %xmm1
addsd 0x2ba0e(%rip), %xmm1    # 0x33c58
mulsd %xmm0, %xmm1
addsd 0x2ba0a(%rip), %xmm1    # 0x33c60
mulsd %xmm0, %xmm1
addsd 0x2ba06(%rip), %xmm1    # 0x33c68
mulsd %xmm0, %xmm1
addsd 0x2ba02(%rip), %xmm1    # 0x33c70
mulsd %xmm0, %xmm1
addsd 0x2b9fe(%rip), %xmm1    # 0x33c78
mulsd %xmm0, %xmm1
addsd 0x2b9fa(%rip), %xmm1    # 0x33c80
movsd 0x8(%rsp), %xmm0
mulsd %xmm0, %xmm2
divsd %xmm1, %xmm2
movsd %xmm2, 0x10(%rsp)
movq %rbx, %rdi
callq 0x7894
movsd %xmm0, 0x18(%rsp)
movsd 0x8(%rsp), %xmm0
movq %rbx, %rdi
callq 0x25f91
movsd 0x2af4a(%rip), %xmm1    # 0x33208
divsd 0x8(%rsp), %xmm1
mulsd 0x18(%rsp), %xmm0
addsd %xmm1, %xmm0
mulsd 0x2b872(%rip), %xmm0    # 0x33b48
addsd 0x10(%rsp), %xmm0
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq