// File: /workspace/github_cpp_makefile_star2_O3/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 0x253a5
movq %rbx, %rdi
callq 0x253a5
xorl %edi, %edi
testq %r12, %r12
setg %dil
leaq 0x228fc(%rip), %rsi     # 0x35c34
movq %r14, %rdx
callq 0x2510e
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x25326
movq %rbx, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x25326
cmpq $0x2, %r12
jl 0x13475
movq 0x28(%r15), %rax
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rax)
movq %r14, %rdi
callq 0x25eea
addsd %xmm0, %xmm0
addsd 0x1fe80(%rip), %xmm0    # 0x33208
movq 0x28(%rbx), %rax
movsd %xmm0, (%rax)
movsd 0x10(%rsp), %xmm2
movapd %xmm2, %xmm1
subsd 0x8(%rsp), %xmm1
leaq -0x1(%r12), %r13
xorps %xmm0, %xmm0
cvtsi2sd %r13, %xmm0
divsd %xmm0, %xmm1
movsd %xmm1, 0x20(%rsp)
negq %r12
movl $0x1, %ebp
movapd %xmm2, %xmm0
leaq (%r12,%rbp), %rcx
movq %r13, %rax
cmpq $-0x1, %rcx
je 0x1340f
xorps %xmm0, %xmm0
cvtsi2sd %rbp, %xmm0
movsd %xmm0, 0x18(%rsp)
movq %r14, %rdi
callq 0x25eea
addsd %xmm0, %xmm0
addsd 0x1fe16(%rip), %xmm0    # 0x33208
mulsd 0x20ec6(%rip), %xmm0    # 0x342c0
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 0x25eea
addsd %xmm0, %xmm0
movq 0x28(%r15), %rax
movsd (%rax,%rbp,8), %xmm1
subsd -0x8(%rax,%rbp,8), %xmm1
addsd 0x1fdbd(%rip), %xmm0    # 0x33208
mulsd %xmm0, %xmm1
addsd 0x18(%rsp), %xmm1
movq 0x28(%rbx), %rax
movsd %xmm1, (%rax,%rbp,8)
incq %rbp
movq %r12, %rax
addq %rbp, %rax
movsd 0x10(%rsp), %xmm0
jne 0x133c3
jmp 0x134ad
movsd 0x8(%rsp), %xmm0
addsd 0x10(%rsp), %xmm0
mulsd 0x1ffff(%rip), %xmm0    # 0x33488
movq 0x28(%r15), %rax
movsd %xmm0, (%rax)
movq %r14, %rdi
callq 0x25eea
addsd %xmm0, %xmm0
addsd 0x1fd63(%rip), %xmm0    # 0x33208
movq 0x28(%rbx), %rax
movsd %xmm0, (%rax)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq