// File: /workspace/github_cpp_makefile_star2_O2/mouda[P]LTE_random_access-simulate/alglibinternal.cpp
// Function: alglib_impl::taskgenint1d(double, double, long, alglib_impl::ae_vector*, alglib_impl::ae_vector*, alglib_impl::ae_state*)
void taskgenint1d(double a,
     double b,
     ae_int_t n,
     /* Real    */ ae_vector* x,
     /* Real    */ ae_vector* y,
     ae_state *_state)
{
    ae_int_t i;
    double h;

    ae_vector_clear(x);
    ae_vector_clear(y);

    ae_assert(n>=1, "TaskGenInterpolationEqdist1D: N<1!", _state);
    ae_vector_set_length(x, n, _state);
    ae_vector_set_length(y, n, _state);
    if( n>1 )
    {
        x->ptr.p_double[0] = a;
        y->ptr.p_double[0] = 2*ae_randomreal(_state)-1;
        h = (b-a)/(n-1);
        for(i=1; i<=n-1; i++)
        {
            if( i!=n-1 )
            {
                x->ptr.p_double[i] = a+(i+0.2*(2*ae_randomreal(_state)-1))*h;
            }
            else
            {
                x->ptr.p_double[i] = b;
            }
            y->ptr.p_double[i] = y->ptr.p_double[i-1]+(2*ae_randomreal(_state)-1)*(x->ptr.p_double[i]-x->ptr.p_double[i-1]);
        }
    }
    else
    {
        x->ptr.p_double[0] = 0.5*(a+b);
        y->ptr.p_double[0] = 2*ae_randomreal(_state)-1;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %r14
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r12
movsd %xmm1, 0x10(%rsp)
movsd %xmm0, 0x8(%rsp)
movq %rsi, %rdi
callq 0x23b55
movq %rbx, %rdi
callq 0x23b55
xorl %edi, %edi
testq %r12, %r12
setg %dil
leaq 0x204b2(%rip), %rsi     # 0x32c24
movq %r14, %rdx
callq 0x238ca
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x23add
movq %rbx, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x23add
cmpq $0x2, %r12
jl 0x128b6
movq 0x28(%r15), %rax
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rax)
movq %r14, %rdi
callq 0x244c4
addsd %xmm0, %xmm0
addsd 0x1da3e(%rip), %xmm0    # 0x30200
movq 0x28(%rbx), %rax
movsd %xmm0, (%rax)
movsd 0x10(%rsp), %xmm2
movapd %xmm2, %xmm1
movsd 0x8(%rsp), %xmm3
subsd %xmm3, %xmm1
leaq -0x1(%r12), %r13
cvtsi2sd %r13, %xmm0
divsd %xmm0, %xmm1
movsd %xmm1, 0x20(%rsp)
negq %r12
pushq $0x1
popq %rbp
movapd %xmm2, %xmm1
movq %r12, %rax
addq %rbp, %rax
je 0x128ee
leaq (%r12,%rbp), %rcx
addq $0x2, %rcx
movq %r13, %rax
movapd %xmm1, %xmm0
cmpq $0x1, %rcx
je 0x12859
cvtsi2sd %rbp, %xmm0
movsd %xmm0, 0x18(%rsp)
movq %r14, %rdi
callq 0x244c4
addsd %xmm0, %xmm0
addsd 0x1d9c4(%rip), %xmm0    # 0x30200
mulsd 0x1ea7c(%rip), %xmm0    # 0x312c0
addsd 0x18(%rsp), %xmm0
mulsd 0x20(%rsp), %xmm0
addsd 0x8(%rsp), %xmm0
movq %rbp, %rax
movq 0x28(%r15), %rcx
movsd %xmm0, (%rcx,%rax,8)
movq 0x28(%rbx), %rax
movsd -0x8(%rax,%rbp,8), %xmm0
movsd %xmm0, 0x18(%rsp)
movq %r14, %rdi
callq 0x244c4
addsd %xmm0, %xmm0
addsd 0x1d97a(%rip), %xmm0    # 0x30200
movq 0x28(%r15), %rax
movsd (%rax,%rbp,8), %xmm1
subsd -0x8(%rax,%rbp,8), %xmm1
mulsd %xmm0, %xmm1
addsd 0x18(%rsp), %xmm1
movq 0x28(%rbx), %rax
movsd %xmm1, (%rax,%rbp,8)
incq %rbp
movsd 0x10(%rsp), %xmm1
jmp 0x127fc
movsd 0x8(%rsp), %xmm0
addsd 0x10(%rsp), %xmm0
mulsd 0x1dbbe(%rip), %xmm0    # 0x30488
movq 0x28(%r15), %rax
movsd %xmm0, (%rax)
movq %r14, %rdi
callq 0x244c4
addsd %xmm0, %xmm0
addsd 0x1d91a(%rip), %xmm0    # 0x30200
movq 0x28(%rbx), %rax
movsd %xmm0, (%rax)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq