// File: /workspace/github_cpp_makefile_star2_O3/mouda[P]LTE_random_access-simulate/specialfunctions.cpp
// Function: alglib_impl::sinecosineintegrals(double, double*, double*, alglib_impl::ae_state*)
void sinecosineintegrals(double x,
     double* si,
     double* ci,
     ae_state *_state)
{
    double z;
    double c;
    double s;
    double f;
    double g;
    ae_int_t sg;
    double sn;
    double sd;
    double cn;
    double cd;
    double fn;
    double fd;
    double gn;
    double gd;

    *si = 0;
    *ci = 0;

    if( ae_fp_less(x,0) )
    {
        sg = -1;
        x = -x;
    }
    else
    {
        sg = 0;
    }
    if( ae_fp_eq(x,0) )
    {
        *si = 0;
        *ci = -ae_maxrealnumber;
        return;
    }
    if( ae_fp_greater(x,1.0E9) )
    {
        *si = 1.570796326794896619-ae_cos(x, _state)/x;
        *ci = ae_sin(x, _state)/x;
        return;
    }
    if( ae_fp_less_eq(x,4) )
    {
        z = x*x;
        sn = -8.39167827910303881427E-11;
        sn = sn*z+4.62591714427012837309E-8;
        sn = sn*z-9.75759303843632795789E-6;
        sn = sn*z+9.76945438170435310816E-4;
        sn = sn*z-4.13470316229406538752E-2;
        sn = sn*z+1.00000000000000000302E0;
        sd = 2.03269266195951942049E-12;
        sd = sd*z+1.27997891179943299903E-9;
        sd = sd*z+4.41827842801218905784E-7;
        sd = sd*z+9.96412122043875552487E-5;
        sd = sd*z+1.42085239326149893930E-2;
        sd = sd*z+9.99999999999999996984E-1;
        s = x*sn/sd;
        cn = 2.02524002389102268789E-11;
        cn = cn*z-1.35249504915790756375E-8;
        cn = cn*z+3.59325051419993077021E-6;
        cn = cn*z-4.74007206873407909465E-4;
        cn = cn*z+2.89159652607555242092E-2;
        cn = cn*z-1.00000000000000000080E0;
        cd = 4.07746040061880559506E-12;
        cd = cd*z+3.06780997581887812692E-9;
        cd = cd*z+1.23210355685883423679E-6;
        cd = cd*z+3.17442024775032769882E-4;
        cd = cd*z+5.10028056236446052392E-2;
        cd = cd*z+4.00000000000000000080E0;
        c = z*cn/cd;
        if( sg!=0 )
        {
            s = -s;
        }
        *si = s;
        *ci = 0.57721566490153286061+ae_log(x, _state)+c;
        return;
    }
    s = ae_sin(x, _state);
    c = ae_cos(x, _state);
    z = 1.0/(x*x);
    if( ae_fp_less(x,8) )
    {
        fn = 4.23612862892216586994E0;
        fn = fn*z+5.45937717161812843388E0;
        fn = fn*z+1.62083287701538329132E0;
        fn = fn*z+1.67006611831323023771E-1;
        fn = fn*z+6.81020132472518137426E-3;
        fn = fn*z+1.08936580650328664411E-4;
        fn = fn*z+5.48900223421373614008E-7;
        fd = 1.00000000000000000000E0;
        fd = fd*z+8.16496634205391016773E0;
        fd = fd*z+7.30828822505564552187E0;
        fd = fd*z+1.86792257950184183883E0;
        fd = fd*z+1.78792052963149907262E-1;
        fd = fd*z+7.01710668322789753610E-3;
        fd = fd*z+1.10034357153915731354E-4;
        fd = fd*z+5.48900252756255700982E-7;
        f = fn/(x*fd);
        gn = 8.71001698973114191777E-2;
        gn = gn*z+6.11379109952219284151E-1;
        gn = gn*z+3.97180296392337498885E-1;
        gn = gn*z+7.48527737628469092119E-2;
        gn = gn*z+5.38868681462177273157E-3;
        gn = gn*z+1.61999794598934024525E-4;
        gn = gn*z+1.97963874140963632189E-6;
        gn = gn*z+7.82579040744090311069E-9;
        gd = 1.00000000000000000000E0;
        gd = gd*z+1.64402202413355338886E0;
        gd = gd*z+6.66296701268987968381E-1;
        gd = gd*z+9.88771761277688796203E-2;
        gd = gd*z+6.22396345441768420760E-3;
        gd = gd*z+1.73221081474177119497E-4;
        gd = gd*z+2.02659182086343991969E-6;
        gd = gd*z+7.82579218933534490868E-9;
        g = z*gn/gd;
    }
    else
    {
        fn = 4.55880873470465315206E-1;
        fn = fn*z+7.13715274100146711374E-1;
        fn = fn*z+1.60300158222319456320E-1;
        fn = fn*z+1.16064229408124407915E-2;
        fn = fn*z+3.49556442447859055605E-4;
        fn = fn*z+4.86215430826454749482E-6;
        fn = fn*z+3.20092790091004902806E-8;
        fn = fn*z+9.41779576128512936592E-11;
        fn = fn*z+9.70507110881952024631E-14;
        fd = 1.00000000000000000000E0;
        fd = fd*z+9.17463611873684053703E-1;
        fd = fd*z+1.78685545332074536321E-1;
        fd = fd*z+1.22253594771971293032E-2;
        fd = fd*z+3.58696481881851580297E-4;
        fd = fd*z+4.92435064317881464393E-6;
        fd = fd*z+3.21956939101046018377E-8;
        fd = fd*z+9.43720590350276732376E-11;
        fd = fd*z+9.70507110881952025725E-14;
        f = fn/(x*fd);
        gn = 6.97359953443276214934E-1;
        gn = gn*z+3.30410979305632063225E-1;
        gn = gn*z+3.84878767649974295920E-2;
        gn = gn*z+1.71718239052347903558E-3;
        gn = gn*z+3.48941165502279436777E-5;
        gn = gn*z+3.47131167084116673800E-7;
        gn = gn*z+1.70404452782044526189E-9;
        gn = gn*z+3.85945925430276600453E-12;
        gn = gn*z+3.14040098946363334640E-15;
        gd = 1.00000000000000000000E0;
        gd = gd*z+1.68548898811011640017E0;
        gd = gd*z+4.87852258695304967486E-1;
        gd = gd*z+4.67913194259625806320E-2;
        gd = gd*z+1.90284426674399523638E-3;
        gd = gd*z+3.68475504442561108162E-5;
        gd = gd*z+3.57043223443740838771E-7;
        gd = gd*z+1.72693748966316146736E-9;
        gd = gd*z+3.87830166023954706752E-12;
        gd = gd*z+3.14040098946363335242E-15;
        g = z*gn/gd;
    }
    *si = 1.570796326794896619-f*c-g*s;
    if( sg!=0 )
    {
        *si = -*si;
    }
    *ci = f*s-g*c;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x38, %rsp
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
xorl %eax, %eax
movq %rax, (%rdi)
movq %rax, (%rsi)
xorpd %xmm1, %xmm1
movaps %xmm0, (%rsp)
callq 0x25bb9
movl %eax, %ebp
testb %al, %al
jne 0x12029
movapd (%rsp), %xmm0
jmp 0x12036
movapd (%rsp), %xmm0
xorpd 0x2117a(%rip), %xmm0    # 0x331b0
movapd %xmm0, (%rsp)
xorpd %xmm1, %xmm1
callq 0x25b75
testb %al, %al
je 0x1205c
movq $0x0, (%r14)
movsd 0x21601(%rip), %xmm4    # 0x33658
jmp 0x12570
movsd 0x2229c(%rip), %xmm1    # 0x34300
movaps (%rsp), %xmm0
callq 0x25bf9
testb %al, %al
je 0x120b2
movapd (%rsp), %xmm0
movq %r15, %rdi
callq 0x25f64
movapd (%rsp), %xmm2
divsd %xmm2, %xmm0
movsd 0x224b1(%rip), %xmm1    # 0x34540
subsd %xmm0, %xmm1
movsd %xmm1, (%r14)
movapd %xmm2, %xmm0
movq %r15, %rdi
callq 0x25f5f
movapd %xmm0, %xmm4
divsd (%rsp), %xmm4
jmp 0x12570
movsd 0x21136(%rip), %xmm1    # 0x331f0
movaps (%rsp), %xmm0
callq 0x25bd9
testb %al, %al
je 0x1222f
movapd (%rsp), %xmm0
movapd %xmm0, %xmm1
mulsd %xmm0, %xmm1
movsd 0x22910(%rip), %xmm5    # 0x349f0
mulsd %xmm1, %xmm5
addsd 0x2290c(%rip), %xmm5    # 0x349f8
mulsd %xmm1, %xmm5
addsd 0x22908(%rip), %xmm5    # 0x34a00
mulsd %xmm1, %xmm5
addsd 0x22904(%rip), %xmm5    # 0x34a08
mulsd %xmm1, %xmm5
addsd 0x22900(%rip), %xmm5    # 0x34a10
movsd 0x22900(%rip), %xmm2    # 0x34a18
mulsd %xmm1, %xmm2
addsd 0x228fc(%rip), %xmm2    # 0x34a20
mulsd %xmm1, %xmm2
addsd 0x228f8(%rip), %xmm2    # 0x34a28
mulsd %xmm1, %xmm2
addsd 0x228f4(%rip), %xmm2    # 0x34a30
mulsd %xmm1, %xmm2
addsd 0x228f0(%rip), %xmm2    # 0x34a38
movsd 0x228f0(%rip), %xmm6    # 0x34a40
mulsd %xmm1, %xmm6
addsd 0x228ec(%rip), %xmm6    # 0x34a48
mulsd %xmm1, %xmm6
addsd 0x228e8(%rip), %xmm6    # 0x34a50
mulsd %xmm1, %xmm6
addsd 0x228e4(%rip), %xmm6    # 0x34a58
mulsd %xmm1, %xmm5
mulsd %xmm1, %xmm6
addsd 0x228dc(%rip), %xmm6    # 0x34a60
movsd 0x21054(%rip), %xmm3    # 0x331e0
mulsd %xmm1, %xmm6
addsd 0x21070(%rip), %xmm6    # 0x33208
movsd 0x228c8(%rip), %xmm4    # 0x34a68
mulsd %xmm1, %xmm4
addsd 0x228c4(%rip), %xmm4    # 0x34a70
addsd %xmm3, %xmm5
mulsd %xmm1, %xmm4
addsd 0x228bc(%rip), %xmm4    # 0x34a78
mulsd %xmm1, %xmm2
mulsd %xmm1, %xmm4
addsd 0x228b4(%rip), %xmm4    # 0x34a80
addsd %xmm3, %xmm2
mulsd %xmm1, %xmm4
addsd 0x228ac(%rip), %xmm4    # 0x34a88
mulsd %xmm0, %xmm5
mulsd %xmm1, %xmm4
addsd 0x21004(%rip), %xmm4    # 0x331f0
divsd %xmm2, %xmm5
mulsd %xmm1, %xmm6
divsd %xmm4, %xmm6
movsd %xmm6, 0x10(%rsp)
testb %bpl, %bpl
je 0x1220b
xorpd 0x20fa5(%rip), %xmm5    # 0x331b0
movsd %xmm5, (%r14)
movq %r15, %rdi
callq 0x25f91
addsd 0x21260(%rip), %xmm0    # 0x33480
movsd 0x10(%rsp), %xmm4
addsd %xmm0, %xmm4
jmp 0x12570
movaps (%rsp), %xmm0
movq %r15, %rdi
callq 0x25f5f
movsd %xmm0, 0x10(%rsp)
movaps (%rsp), %xmm0
movq %r15, %rdi
callq 0x25f64
movsd %xmm0, 0x18(%rsp)
movapd (%rsp), %xmm0
movapd %xmm0, %xmm2
mulsd %xmm0, %xmm2
movsd 0x20f78(%rip), %xmm1    # 0x331e0
divsd %xmm2, %xmm1
movapd %xmm1, 0x20(%rsp)
movsd 0x213fe(%rip), %xmm1    # 0x33678
callq 0x25bb9
testb %al, %al
je 0x123b7
movsd 0x226d9(%rip), %xmm4    # 0x34968
movapd 0x20(%rsp), %xmm6
mulsd %xmm6, %xmm4
addsd 0x226cf(%rip), %xmm4    # 0x34970
mulsd %xmm6, %xmm4
addsd 0x226cb(%rip), %xmm4    # 0x34978
mulsd %xmm6, %xmm4
addsd 0x226c7(%rip), %xmm4    # 0x34980
mulsd %xmm6, %xmm4
addsd 0x226c3(%rip), %xmm4    # 0x34988
mulsd %xmm6, %xmm4
addsd 0x226bf(%rip), %xmm4    # 0x34990
mulsd %xmm6, %xmm4
addsd 0x226bb(%rip), %xmm4    # 0x34998
movsd 0x226bb(%rip), %xmm1    # 0x349a0
addsd %xmm6, %xmm1
mulsd %xmm6, %xmm1
addsd 0x226b3(%rip), %xmm1    # 0x349a8
mulsd %xmm6, %xmm1
addsd 0x226af(%rip), %xmm1    # 0x349b0
mulsd %xmm6, %xmm1
addsd 0x226ab(%rip), %xmm1    # 0x349b8
mulsd %xmm6, %xmm1
addsd 0x226a7(%rip), %xmm1    # 0x349c0
mulsd %xmm6, %xmm1
addsd 0x226a3(%rip), %xmm1    # 0x349c8
mulsd %xmm6, %xmm1
addsd 0x2269f(%rip), %xmm1    # 0x349d0
movsd 0x2269f(%rip), %xmm0    # 0x349d8
mulsd %xmm6, %xmm0
addsd 0x2269b(%rip), %xmm0    # 0x349e0
movsd 0x2269b(%rip), %xmm2    # 0x349e8
addsd %xmm6, %xmm2
unpcklpd %xmm2, %xmm0            # xmm0 = xmm0[0],xmm2[0]
movapd %xmm6, %xmm2
unpcklpd %xmm6, %xmm2            # xmm2 = xmm2[0],xmm6[0]
mulpd %xmm2, %xmm0
addpd 0x22fa7(%rip), %xmm0    # 0x35310
mulpd %xmm2, %xmm0
addpd 0x22fab(%rip), %xmm0    # 0x35320
mulpd %xmm2, %xmm0
addpd 0x22faf(%rip), %xmm0    # 0x35330
mulpd %xmm2, %xmm0
addpd 0x22fb3(%rip), %xmm0    # 0x35340
movapd (%rsp), %xmm3
mulsd %xmm1, %xmm3
mulpd %xmm2, %xmm0
addpd 0x22fae(%rip), %xmm0    # 0x35350
divsd %xmm3, %xmm4
mulpd %xmm2, %xmm0
addpd 0x22fae(%rip), %xmm0    # 0x35360
jmp 0x12512
movsd 0x22521(%rip), %xmm4    # 0x348e0
movapd 0x20(%rsp), %xmm6
mulsd %xmm6, %xmm4
addsd 0x22517(%rip), %xmm4    # 0x348e8
mulsd %xmm6, %xmm4
addsd 0x22513(%rip), %xmm4    # 0x348f0
mulsd %xmm6, %xmm4
addsd 0x2250f(%rip), %xmm4    # 0x348f8
mulsd %xmm6, %xmm4
addsd 0x2250b(%rip), %xmm4    # 0x34900
mulsd %xmm6, %xmm4
addsd 0x22507(%rip), %xmm4    # 0x34908
mulsd %xmm6, %xmm4
addsd 0x22503(%rip), %xmm4    # 0x34910
mulsd %xmm6, %xmm4
addsd 0x224ff(%rip), %xmm4    # 0x34918
movsd 0x22507(%rip), %xmm1    # 0x34928
addsd %xmm6, %xmm1
mulsd %xmm6, %xmm1
addsd 0x224ff(%rip), %xmm1    # 0x34930
mulsd %xmm6, %xmm1
addsd 0x224fb(%rip), %xmm1    # 0x34938
mulsd %xmm6, %xmm1
addsd 0x224f7(%rip), %xmm1    # 0x34940
mulsd %xmm6, %xmm1
addsd 0x224f3(%rip), %xmm1    # 0x34948
mulsd %xmm6, %xmm1
addsd 0x224ef(%rip), %xmm1    # 0x34950
mulsd %xmm6, %xmm1
addsd 0x224eb(%rip), %xmm1    # 0x34958
movsd 0x224eb(%rip), %xmm2    # 0x34960
addsd %xmm6, %xmm2
movapd 0x22dff(%rip), %xmm0    # 0x35280
unpcklpd %xmm2, %xmm0            # xmm0 = xmm0[0],xmm2[0]
movapd %xmm6, %xmm2
unpcklpd %xmm6, %xmm2            # xmm2 = xmm2[0],xmm6[0]
mulpd %xmm2, %xmm0
addpd 0x22df7(%rip), %xmm0    # 0x35290
mulsd %xmm6, %xmm4
mulpd %xmm2, %xmm0
addpd 0x22df7(%rip), %xmm0    # 0x352a0
movsd 0x2246f(%rip), %xmm3    # 0x34920
mulpd %xmm2, %xmm0
addpd 0x22df3(%rip), %xmm0    # 0x352b0
addsd %xmm3, %xmm4
mulpd %xmm2, %xmm0
addpd 0x22df3(%rip), %xmm0    # 0x352c0
mulsd %xmm6, %xmm1
mulpd %xmm2, %xmm0
addpd 0x22df3(%rip), %xmm0    # 0x352d0
addsd %xmm3, %xmm1
mulpd %xmm2, %xmm0
addpd 0x22df3(%rip), %xmm0    # 0x352e0
movapd (%rsp), %xmm3
mulsd %xmm1, %xmm3
mulpd %xmm2, %xmm0
addpd 0x22dee(%rip), %xmm0    # 0x352f0
divsd %xmm3, %xmm4
mulpd %xmm2, %xmm0
addpd 0x22dee(%rip), %xmm0    # 0x35300
movapd %xmm4, %xmm1
movsd 0x18(%rsp), %xmm5
mulsd %xmm5, %xmm1
movsd 0x22018(%rip), %xmm2    # 0x34540
subsd %xmm1, %xmm2
movapd 0x20c7c(%rip), %xmm1    # 0x331b0
xorpd %xmm1, %xmm6
mulsd %xmm0, %xmm6
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
divsd %xmm0, %xmm6
movapd %xmm6, %xmm0
movsd 0x10(%rsp), %xmm3
mulsd %xmm3, %xmm0
addsd %xmm2, %xmm0
testb %bpl, %bpl
je 0x1255f
xorpd %xmm1, %xmm0
movsd %xmm0, (%r14)
mulsd %xmm6, %xmm5
mulsd %xmm3, %xmm4
addsd %xmm5, %xmm4
movsd %xmm4, (%rbx)
addq $0x38, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq