// File: /workspace/github_cpp_makefile_star2_O1/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, %r13
movsd %xmm1, 0x8(%rsp)
movsd %xmm0, (%rsp)
movq %rsi, %rdi
callq 0x25ac7
movq %rbx, %rdi
callq 0x25ac7
xorl %edi, %edi
testq %r13, %r13
setg %dil
leaq 0x231b5(%rip), %rsi     # 0x36aac
movq %r14, %rdx
callq 0x2581c
movq %r15, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x25a42
movq %rbx, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x25a42
cmpq $0x2, %r13
jl 0x13a2c
movq 0x28(%r15), %rax
movsd (%rsp), %xmm0
movsd %xmm0, (%rax)
movq %r14, %rdi
callq 0x2662f
addsd %xmm0, %xmm0
addsd 0x2088a(%rip), %xmm0    # 0x341d0
movq 0x28(%rbx), %rax
movsd %xmm0, (%rax)
movsd 0x8(%rsp), %xmm2
movapd %xmm2, %xmm1
subsd (%rsp), %xmm1
leaq -0x1(%r13), %rax
movq %rax, 0x20(%rsp)
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
divsd %xmm0, %xmm1
movsd %xmm1, 0x18(%rsp)
addq $-0x2, %r13
xorl %ebp, %ebp
movapd %xmm2, %xmm0
leaq 0x1(%rbp), %r12
cmpq %rbp, %r13
je 0x139c6
xorps %xmm0, %xmm0
cvtsi2sd %r12, %xmm0
movsd %xmm0, 0x10(%rsp)
movq %r14, %rdi
callq 0x2662f
addsd %xmm0, %xmm0
addsd 0x20823(%rip), %xmm0    # 0x341d0
mulsd 0x21b13(%rip), %xmm0    # 0x354c8
addsd 0x10(%rsp), %xmm0
mulsd 0x18(%rsp), %xmm0
addsd (%rsp), %xmm0
movq 0x28(%r15), %rax
movsd %xmm0, 0x8(%rax,%rbp,8)
movq 0x28(%rbx), %rax
movsd (%rax,%rbp,8), %xmm0
movsd %xmm0, 0x10(%rsp)
movq %r14, %rdi
callq 0x2662f
addsd %xmm0, %xmm0
addsd 0x207dd(%rip), %xmm0    # 0x341d0
movq 0x28(%r15), %rax
movsd 0x8(%rax,%rbp,8), %xmm1
subsd (%rax,%rbp,8), %xmm1
mulsd %xmm0, %xmm1
addsd 0x10(%rsp), %xmm1
movq 0x28(%rbx), %rax
movsd %xmm1, 0x8(%rax,%rbp,8)
movq %r12, %rbp
cmpq %r12, 0x20(%rsp)
movsd 0x8(%rsp), %xmm0
jne 0x13982
jmp 0x13a63
movsd (%rsp), %xmm0
addsd 0x8(%rsp), %xmm0
mulsd 0x20a29(%rip), %xmm0    # 0x34468
movq 0x28(%r15), %rax
movsd %xmm0, (%rax)
movq %r14, %rdi
callq 0x2662f
addsd %xmm0, %xmm0
addsd 0x20775(%rip), %xmm0    # 0x341d0
movq 0x28(%rbx), %rax
movsd %xmm0, (%rax)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq