// File: 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 %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movsd %xmm0, -0x10(%rbp)
movq %rdi, -0x18(%rbp)
movsd -0x10(%rbp), %xmm0
movsd 0x4a82f(%rip), %xmm1    # 0x55620
callq 0x3c4c0
testb $0x1, %al
jne 0xadff
jmp 0xaeb6
movsd -0x10(%rbp), %xmm0
movq -0x18(%rbp), %rdx
leaq -0x30(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x1c130
movsd -0x10(%rbp), %xmm0
movsd 0x4acd6(%rip), %xmm1    # 0x55af8
subsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
movsd 0x4ae85(%rip), %xmm0    # 0x55cb8
divsd -0x10(%rbp), %xmm0
movq -0x18(%rbp), %rdi
callq 0x3c890
movsd %xmm0, -0x58(%rbp)
movsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x68(%rbp)
movsd -0x20(%rbp), %xmm0
movq -0x18(%rbp), %rdi
callq 0x3cb90
movsd %xmm0, -0x60(%rbp)
movsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x70(%rbp)
movsd -0x20(%rbp), %xmm0
movq -0x18(%rbp), %rdi
callq 0x3cbc0
movsd -0x70(%rbp), %xmm2
movsd -0x68(%rbp), %xmm1
movsd -0x60(%rbp), %xmm3
movaps %xmm0, %xmm4
movsd -0x58(%rbp), %xmm0
mulsd %xmm4, %xmm2
mulsd %xmm3, %xmm1
addsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x8(%rbp)
jmp 0xb136
movsd -0x10(%rbp), %xmm0
movq -0x18(%rbp), %rdi
callq 0x3c870
movsd %xmm0, -0x28(%rbp)
movsd 0x4aeff(%rip), %xmm0    # 0x55dd0
movsd %xmm0, -0x40(%rbp)
movsd -0x28(%rbp), %xmm0
movsd -0x40(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4aedc(%rip), %xmm1    # 0x55dc8
addsd %xmm1, %xmm0
movsd %xmm0, -0x40(%rbp)
movsd -0x28(%rbp), %xmm0
movsd -0x40(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4aeb5(%rip), %xmm1    # 0x55dc0
addsd %xmm1, %xmm0
movsd %xmm0, -0x40(%rbp)
movsd -0x28(%rbp), %xmm0
movsd -0x40(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4ae8e(%rip), %xmm1    # 0x55db8
addsd %xmm1, %xmm0
movsd %xmm0, -0x40(%rbp)
movsd -0x28(%rbp), %xmm0
movsd -0x40(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4ae67(%rip), %xmm1    # 0x55db0
addsd %xmm1, %xmm0
movsd %xmm0, -0x40(%rbp)
movsd -0x28(%rbp), %xmm0
movsd -0x40(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4ae40(%rip), %xmm1    # 0x55da8
addsd %xmm1, %xmm0
movsd %xmm0, -0x40(%rbp)
movsd -0x28(%rbp), %xmm0
movsd -0x40(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4ae19(%rip), %xmm1    # 0x55da0
addsd %xmm1, %xmm0
movsd %xmm0, -0x40(%rbp)
movsd -0x28(%rbp), %xmm0
movsd -0x40(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4adf2(%rip), %xmm1    # 0x55d98
addsd %xmm1, %xmm0
movsd %xmm0, -0x40(%rbp)
movsd -0x28(%rbp), %xmm0
movsd -0x40(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4adcb(%rip), %xmm1    # 0x55d90
addsd %xmm1, %xmm0
movsd %xmm0, -0x40(%rbp)
movsd 0x4a032(%rip), %xmm0    # 0x55008
movsd %xmm0, -0x48(%rbp)
movsd -0x28(%rbp), %xmm0
movsd -0x48(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4ad97(%rip), %xmm1    # 0x55d88
addsd %xmm1, %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0x28(%rbp), %xmm0
movsd -0x48(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4ad70(%rip), %xmm1    # 0x55d80
addsd %xmm1, %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0x28(%rbp), %xmm0
movsd -0x48(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4ad49(%rip), %xmm1    # 0x55d78
addsd %xmm1, %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0x28(%rbp), %xmm0
movsd -0x48(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4ad22(%rip), %xmm1    # 0x55d70
addsd %xmm1, %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0x28(%rbp), %xmm0
movsd -0x48(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4acfb(%rip), %xmm1    # 0x55d68
addsd %xmm1, %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0x28(%rbp), %xmm0
movsd -0x48(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4acd4(%rip), %xmm1    # 0x55d60
addsd %xmm1, %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0x28(%rbp), %xmm0
movsd -0x48(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4acad(%rip), %xmm1    # 0x55d58
addsd %xmm1, %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0x28(%rbp), %xmm0
movsd -0x48(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4ac86(%rip), %xmm1    # 0x55d50
addsd %xmm1, %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0x40(%rbp), %xmm0
divsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x80(%rbp)
movsd -0x10(%rbp), %xmm0
movq -0x18(%rbp), %rdi
callq 0x9f50
movaps %xmm0, %xmm1
movsd 0x4abbd(%rip), %xmm0    # 0x55cb8
mulsd %xmm1, %xmm0
movsd %xmm0, -0x78(%rbp)
movsd -0x10(%rbp), %xmm0
movq -0x18(%rbp), %rdi
callq 0x3cd70
movsd -0x80(%rbp), %xmm1
movaps %xmm0, %xmm2
movsd -0x78(%rbp), %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x8(%rbp)
movsd -0x8(%rbp), %xmm0
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)