// File: /workspace/github_cpp_makefile_star2_O1/mouda[P]LTE_random_access-simulate/specialfunctions.cpp
// Function: alglib_impl::bessely0(double, alglib_impl::ae_state*)
double bessely0(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_besselasympt0(x, &pzero, &qzero, _state);
        nn = x-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 = -41370.35497933148554125235152;
    p4 = 59152134.65686889654273830069+xsq*p4;
    p4 = -34363712229.79040378171030138+xsq*p4;
    p4 = 10255208596863.94284509167421+xsq*p4;
    p4 = -1648605817185729.473122082537+xsq*p4;
    p4 = 137562431639934407.8571335453+xsq*p4;
    p4 = -5247065581112764941.297350814+xsq*p4;
    p4 = 65874732757195549259.99402049+xsq*p4;
    p4 = -27502866786291095837.01933175+xsq*p4;
    q4 = 1.0;
    q4 = 1282.452772478993804176329391+xsq*q4;
    q4 = 1001702.641288906265666651753+xsq*q4;
    q4 = 579512264.0700729537480087915+xsq*q4;
    q4 = 261306575504.1081249568482092+xsq*q4;
    q4 = 91620380340751.85262489147968+xsq*q4;
    q4 = 23928830434997818.57439356652+xsq*q4;
    q4 = 4192417043410839973.904769661+xsq*q4;
    q4 = 372645883898616588198.9980+xsq*q4;
    result = p4/q4+2/ae_pi*besselj0(x, _state)*ae_log(x, _state);
    return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
movsd 0x2c6a4(%rip), %xmm1    # 0x34650
movsd %xmm0, 0x8(%rsp)
callq 0x2633e
testb %al, %al
je 0x8065
leaq 0x38(%rsp), %r14
leaq 0x30(%rsp), %r15
movsd 0x8(%rsp), %xmm0
movq %r14, %rdi
movq %r15, %rsi
callq 0x132fc
movsd 0x2ccf6(%rip), %xmm0    # 0x34cd8
movsd 0x8(%rsp), %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x2cce6(%rip), %xmm0    # 0x34ce0
divsd %xmm1, %xmm0
movq %rbx, %rdi
callq 0x2658d
movsd %xmm0, 0x8(%rsp)
movsd (%r14), %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0x10(%rsp), %xmm0
movq %rbx, %rdi
callq 0x266a4
movsd %xmm0, 0x28(%rsp)
movsd (%r15), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x10(%rsp), %xmm0
movq %rbx, %rdi
callq 0x266a9
mulsd 0x20(%rsp), %xmm0
movsd 0x28(%rsp), %xmm1
mulsd 0x18(%rsp), %xmm1
addsd %xmm1, %xmm0
mulsd 0x8(%rsp), %xmm0
jmp 0x817f
movsd 0x8(%rsp), %xmm0
movq %rbx, %rdi
callq 0x26588
movsd 0x2ccfd(%rip), %xmm1    # 0x34d78
mulsd %xmm0, %xmm1
addsd 0x2ccf9(%rip), %xmm1    # 0x34d80
mulsd %xmm0, %xmm1
addsd 0x2ccf5(%rip), %xmm1    # 0x34d88
mulsd %xmm0, %xmm1
addsd 0x2ccf1(%rip), %xmm1    # 0x34d90
mulsd %xmm0, %xmm1
addsd 0x2cced(%rip), %xmm1    # 0x34d98
mulsd %xmm0, %xmm1
addsd 0x2cce9(%rip), %xmm1    # 0x34da0
mulsd %xmm0, %xmm1
addsd 0x2cce5(%rip), %xmm1    # 0x34da8
mulsd %xmm0, %xmm1
addsd 0x2cce1(%rip), %xmm1    # 0x34db0
mulsd %xmm0, %xmm1
addsd 0x2ccdd(%rip), %xmm1    # 0x34db8
movapd %xmm1, %xmm2
movsd 0x2ccd9(%rip), %xmm1    # 0x34dc0
addsd %xmm0, %xmm1
mulsd %xmm0, %xmm1
addsd 0x2ccd1(%rip), %xmm1    # 0x34dc8
mulsd %xmm0, %xmm1
addsd 0x2cccd(%rip), %xmm1    # 0x34dd0
mulsd %xmm0, %xmm1
addsd 0x2ccc9(%rip), %xmm1    # 0x34dd8
mulsd %xmm0, %xmm1
addsd 0x2ccc5(%rip), %xmm1    # 0x34de0
mulsd %xmm0, %xmm1
addsd 0x2ccc1(%rip), %xmm1    # 0x34de8
mulsd %xmm0, %xmm1
addsd 0x2ccbd(%rip), %xmm1    # 0x34df0
mulsd %xmm0, %xmm1
addsd 0x2ccb9(%rip), %xmm1    # 0x34df8
divsd %xmm1, %xmm2
movsd %xmm2, 0x10(%rsp)
movsd 0x8(%rsp), %xmm0
movq %rbx, %rdi
callq 0x7730
mulsd 0x2cb81(%rip), %xmm0    # 0x34ce0
movsd %xmm0, 0x18(%rsp)
movsd 0x8(%rsp), %xmm0
movq %rbx, %rdi
callq 0x266d6
mulsd 0x18(%rsp), %xmm0
addsd 0x10(%rsp), %xmm0
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq