// File: mouda[P]LTE_random_access-simulate/specialfunctions.cpp
// Function: alglib_impl::besselj0(double, alglib_impl::ae_state*)
double besselj0(double x, ae_state *_state)
{
    double xsq;
    double nn;
    double pzero;
    double qzero;
    double p1;
    double q1;
    double result;


    if( ae_fp_less(x,0) )
    {
        x = -x;
    }
    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_cos(nn, _state)-qzero*ae_sin(nn, _state));
        return result;
    }
    xsq = ae_sqr(x, _state);
    p1 = 26857.86856980014981415848441;
    p1 = -40504123.71833132706360663322+xsq*p1;
    p1 = 25071582855.36881945555156435+xsq*p1;
    p1 = -8085222034853.793871199468171+xsq*p1;
    p1 = 1434354939140344.111664316553+xsq*p1;
    p1 = -136762035308817138.6865416609+xsq*p1;
    p1 = 6382059341072356562.289432465+xsq*p1;
    p1 = -117915762910761053603.8440800+xsq*p1;
    p1 = 493378725179413356181.6813446+xsq*p1;
    q1 = 1.0;
    q1 = 1363.063652328970604442810507+xsq*q1;
    q1 = 1114636.098462985378182402543+xsq*q1;
    q1 = 669998767.2982239671814028660+xsq*q1;
    q1 = 312304311494.1213172572469442+xsq*q1;
    q1 = 112775673967979.8507056031594+xsq*q1;
    q1 = 30246356167094626.98627330784+xsq*q1;
    q1 = 5428918384092285160.200195092+xsq*q1;
    q1 = 493378725179413356211.3278438+xsq*q1;
    result = p1/q1;
    return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movsd %xmm0, -0x10(%rbp)
movq %rdi, -0x18(%rbp)
movsd -0x10(%rbp), %xmm0
xorps %xmm1, %xmm1
callq 0x3c440
testb $0x1, %al
jne 0x9f74
jmp 0x9f95
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 0x4b67e(%rip), %xmm1    # 0x55620
callq 0x3c4c0
testb $0x1, %al
jne 0x9fb0
jmp 0xa07e
movsd -0x10(%rbp), %xmm0
movq -0x18(%rbp), %rdx
leaq -0x30(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x1c130
movsd -0x10(%rbp), %xmm0
movsd 0x4bb25(%rip), %xmm1    # 0x55af8
subsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
movsd 0x4bcd4(%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 -0x28(%rbp), %xmm0
movq -0x18(%rbp), %rdi
callq 0x3cbc0
movsd %xmm0, -0x60(%rbp)
movsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x70(%rbp)
movsd -0x28(%rbp), %xmm0
movq -0x18(%rbp), %rdi
callq 0x3cb90
movsd -0x70(%rbp), %xmm2
movsd -0x68(%rbp), %xmm1
movsd -0x60(%rbp), %xmm3
movaps %xmm0, %xmm4
movsd -0x58(%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, -0x50(%rbp)
movsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x8(%rbp)
jmp 0xa2b4
movsd -0x10(%rbp), %xmm0
movq -0x18(%rbp), %rdi
callq 0x3c870
movsd %xmm0, -0x20(%rbp)
movsd 0x4bc17(%rip), %xmm0    # 0x55cb0
movsd %xmm0, -0x40(%rbp)
movsd -0x20(%rbp), %xmm0
movsd -0x40(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4bbf4(%rip), %xmm1    # 0x55ca8
addsd %xmm1, %xmm0
movsd %xmm0, -0x40(%rbp)
movsd -0x20(%rbp), %xmm0
movsd -0x40(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4bbcd(%rip), %xmm1    # 0x55ca0
addsd %xmm1, %xmm0
movsd %xmm0, -0x40(%rbp)
movsd -0x20(%rbp), %xmm0
movsd -0x40(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4bba6(%rip), %xmm1    # 0x55c98
addsd %xmm1, %xmm0
movsd %xmm0, -0x40(%rbp)
movsd -0x20(%rbp), %xmm0
movsd -0x40(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4bb7f(%rip), %xmm1    # 0x55c90
addsd %xmm1, %xmm0
movsd %xmm0, -0x40(%rbp)
movsd -0x20(%rbp), %xmm0
movsd -0x40(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4bb58(%rip), %xmm1    # 0x55c88
addsd %xmm1, %xmm0
movsd %xmm0, -0x40(%rbp)
movsd -0x20(%rbp), %xmm0
movsd -0x40(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4bb31(%rip), %xmm1    # 0x55c80
addsd %xmm1, %xmm0
movsd %xmm0, -0x40(%rbp)
movsd -0x20(%rbp), %xmm0
movsd -0x40(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4bb0a(%rip), %xmm1    # 0x55c78
addsd %xmm1, %xmm0
movsd %xmm0, -0x40(%rbp)
movsd -0x20(%rbp), %xmm0
movsd -0x40(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4baab(%rip), %xmm1    # 0x55c38
addsd %xmm1, %xmm0
movsd %xmm0, -0x40(%rbp)
movsd 0x4ae6a(%rip), %xmm0    # 0x55008
movsd %xmm0, -0x48(%rbp)
movsd -0x20(%rbp), %xmm0
movsd -0x48(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4bab7(%rip), %xmm1    # 0x55c70
addsd %xmm1, %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0x20(%rbp), %xmm0
movsd -0x48(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4ba90(%rip), %xmm1    # 0x55c68
addsd %xmm1, %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0x20(%rbp), %xmm0
movsd -0x48(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4ba69(%rip), %xmm1    # 0x55c60
addsd %xmm1, %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0x20(%rbp), %xmm0
movsd -0x48(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4ba42(%rip), %xmm1    # 0x55c58
addsd %xmm1, %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0x20(%rbp), %xmm0
movsd -0x48(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4ba1b(%rip), %xmm1    # 0x55c50
addsd %xmm1, %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0x20(%rbp), %xmm0
movsd -0x48(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4b9f4(%rip), %xmm1    # 0x55c48
addsd %xmm1, %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0x20(%rbp), %xmm0
movsd -0x48(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4b9cd(%rip), %xmm1    # 0x55c40
addsd %xmm1, %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0x20(%rbp), %xmm0
movsd -0x48(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4b9a6(%rip), %xmm1    # 0x55c38
addsd %xmm1, %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0x40(%rbp), %xmm0
divsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x8(%rbp)
movsd -0x8(%rbp), %xmm0
addq $0x70, %rsp
popq %rbp
retq
nop