// File: /workspace/github_cpp_makefile_star2_O1/mouda[P]LTE_random_access-simulate/alglibinternal.cpp
// Function: alglib_impl::matrixvectormultiply(alglib_impl::ae_matrix*, long, long, long, long, bool, alglib_impl::ae_vector*, long, long, double, alglib_impl::ae_vector*, long, long, double, alglib_impl::ae_state*)
void matrixvectormultiply(/* Real    */ ae_matrix* a,
     ae_int_t i1,
     ae_int_t i2,
     ae_int_t j1,
     ae_int_t j2,
     ae_bool trans,
     /* Real    */ ae_vector* x,
     ae_int_t ix1,
     ae_int_t ix2,
     double alpha,
     /* Real    */ ae_vector* y,
     ae_int_t iy1,
     ae_int_t iy2,
     double beta,
     ae_state *_state)
{
    ae_int_t i;
    double v;


    if( !trans )
    {
        
        /*
         * y := alpha*A*x + beta*y;
         */
        if( i1>i2||j1>j2 )
        {
            return;
        }
        ae_assert(j2-j1==ix2-ix1, "MatrixVectorMultiply: A and X dont match!", _state);
        ae_assert(i2-i1==iy2-iy1, "MatrixVectorMultiply: A and Y dont match!", _state);
        
        /*
         * beta*y
         */
        if( ae_fp_eq(beta,0) )
        {
            for(i=iy1; i<=iy2; i++)
            {
                y->ptr.p_double[i] = 0;
            }
        }
        else
        {
            ae_v_muld(&y->ptr.p_double[iy1], 1, ae_v_len(iy1,iy2), beta);
        }
        
        /*
         * alpha*A*x
         */
        for(i=i1; i<=i2; i++)
        {
            v = ae_v_dotproduct(&a->ptr.pp_double[i][j1], 1, &x->ptr.p_double[ix1], 1, ae_v_len(j1,j2));
            y->ptr.p_double[iy1+i-i1] = y->ptr.p_double[iy1+i-i1]+alpha*v;
        }
    }
    else
    {
        
        /*
         * y := alpha*A'*x + beta*y;
         */
        if( i1>i2||j1>j2 )
        {
            return;
        }
        ae_assert(i2-i1==ix2-ix1, "MatrixVectorMultiply: A and X dont match!", _state);
        ae_assert(j2-j1==iy2-iy1, "MatrixVectorMultiply: A and Y dont match!", _state);
        
        /*
         * beta*y
         */
        if( ae_fp_eq(beta,0) )
        {
            for(i=iy1; i<=iy2; i++)
            {
                y->ptr.p_double[i] = 0;
            }
        }
        else
        {
            ae_v_muld(&y->ptr.p_double[iy1], 1, ae_v_len(iy1,iy2), beta);
        }
        
        /*
         * alpha*A'*x
         */
        for(i=i1; i<=i2; i++)
        {
            v = alpha*x->ptr.p_double[ix1+i-i1];
            ae_v_addd(&y->ptr.p_double[iy1], 1, &a->ptr.pp_double[i][j1], 1, ae_v_len(iy1,iy2), v);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movsd %xmm0, 0x28(%rsp)
movq %rsi, %r15
movq %rdi, %r14
movq 0xa0(%rsp), %rbp
movq 0x98(%rsp), %r10
movq 0x90(%rsp), %r13
movq 0x80(%rsp), %rax
movq 0x78(%rsp), %r11
movq %rdx, %rbx
subq %rsi, %rbx
setl %dil
movq %r8, %r12
subq %rcx, %r12
setl %sil
orb %dil, %sil
testl %r9d, %r9d
movq %r14, 0x30(%rsp)
je 0x16fad
testb %sil, %sil
jne 0x17245
movq %rdx, 0x10(%rsp)
movq %rcx, 0x18(%rsp)
subq %r11, %rax
xorl %edi, %edi
cmpq %rax, %rbx
sete %dil
leaq 0x1fea9(%rip), %rsi     # 0x36ddc
movq %rbp, %rdx
movq %r10, %rbx
movsd %xmm1, 0x8(%rsp)
callq 0x2581c
movq %rbx, %rax
subq %r13, %rax
xorl %edi, %edi
cmpq %rax, %r12
sete %dil
leaq 0x1feac(%rip), %rsi     # 0x36e06
movq %rbp, %rdx
callq 0x2581c
xorpd %xmm1, %xmm1
movsd 0x8(%rsp), %xmm0
callq 0x262ba
testb %al, %al
je 0x1704e
cmpq %r13, %rbx
movq 0x88(%rsp), %rsi
movq %rbx, %r9
jl 0x17089
leaq 0x1(%r9), %rax
movq %r13, %rcx
movq 0x28(%rsi), %rdx
movq $0x0, (%rdx,%rcx,8)
incq %rcx
cmpq %rcx, %rax
jne 0x16f94
jmp 0x17089
testb %sil, %sil
jne 0x17245
movq %r8, 0x20(%rsp)
movq %rdx, 0x10(%rsp)
movq %rcx, 0x18(%rsp)
subq %r11, %rax
xorl %edi, %edi
cmpq %rax, %r12
sete %dil
leaq 0x1fe04(%rip), %rsi     # 0x36ddc
movq %rbp, %rdx
movq %r10, %r12
movsd %xmm1, 0x8(%rsp)
callq 0x2581c
movq %r12, %rax
subq %r13, %rax
xorl %edi, %edi
cmpq %rax, %rbx
sete %dil
leaq 0x1fe07(%rip), %rsi     # 0x36e06
movq %rbp, %rdx
callq 0x2581c
xorpd %xmm1, %xmm1
movsd 0x8(%rsp), %xmm0
callq 0x262ba
testb %al, %al
je 0x17163
cmpq %r13, %r12
movq 0x88(%rsp), %rdx
jl 0x17198
incq %r12
movq %r13, %rax
movq 0x28(%rdx), %rcx
movq $0x0, (%rcx,%rax,8)
incq %rax
cmpq %rax, %r12
jne 0x17035
jmp 0x17198
leaq (,%r13,8), %r12
movq 0x88(%rsp), %rbp
addq 0x28(%rbp), %r12
movq %r13, %rdi
movq %rbx, %rsi
callq 0x2923f
movl $0x1, %esi
movq %r12, %rdi
movq %rax, %rdx
movsd 0x8(%rsp), %xmm0
callq 0x291fc
movq %rbp, %rsi
movq %rbx, %r9
movq 0x10(%rsp), %rbp
cmpq %r15, %rbp
movsd 0x28(%rsp), %xmm0
movq 0x18(%rsp), %rcx
movq 0x78(%rsp), %r8
movq 0x70(%rsp), %rax
jl 0x17245
incq %rbp
leaq (,%r13,8), %rdx
movq %rdx, 0x8(%rsp)
shlq $0x3, %rcx
movq %rcx, 0x18(%rsp)
movq %rbp, 0x10(%rsp)
movq 0x28(%rax), %rax
movsd (%rax,%r8,8), %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, 0x20(%rsp)
movq 0x28(%rsi), %r12
addq 0x8(%rsp), %r12
movq 0x38(%r14), %rax
movq (%rax,%r15,8), %rbx
addq %rcx, %rbx
movq %r13, %rdi
movq %r9, %rsi
movq %r13, %rbp
movq %r8, %r13
movq %r9, %r14
callq 0x2923f
movl $0x1, %esi
movl $0x1, %ecx
movq %r12, %rdi
movq %rbx, %rdx
movq %rax, %r8
movsd 0x20(%rsp), %xmm0
callq 0x290d8
movq %r14, %r9
movq 0x70(%rsp), %rax
movq %r13, %r8
movq %rbp, %r13
movq 0x88(%rsp), %rsi
movq 0x10(%rsp), %rbp
movq 0x30(%rsp), %r14
movq 0x18(%rsp), %rcx
movsd 0x28(%rsp), %xmm0
incq %r15
incq %r8
cmpq %r15, %rbp
jne 0x170ca
jmp 0x17245
leaq (,%r13,8), %rbx
movq 0x88(%rsp), %rax
addq 0x28(%rax), %rbx
movq %r13, %rdi
movq %r12, %rsi
callq 0x2923f
movl $0x1, %esi
movq %rbx, %rdi
movq %rax, %rdx
movsd 0x8(%rsp), %xmm0
callq 0x291fc
movq 0x10(%rsp), %rcx
cmpq %r15, %rcx
movq 0x18(%rsp), %rdi
movq 0x78(%rsp), %rbx
movq 0x70(%rsp), %rsi
movq 0x20(%rsp), %r8
jl 0x17245
incq %rcx
leaq (,%rdi,8), %rax
movq %rax, 0x10(%rsp)
shlq $0x3, %rbx
movq 0x38(%r14), %rax
movq (%rax,%r15,8), %rbp
addq 0x10(%rsp), %rbp
movq 0x28(%rsi), %r12
addq %rbx, %r12
movq %r8, %rsi
movq %rcx, %r14
callq 0x2923f
movl $0x1, %esi
movl $0x1, %ecx
movq %rbp, %rdi
movq %r12, %rdx
movq %rax, %r8
callq 0x28ddc
movq 0x20(%rsp), %r8
movq 0x70(%rsp), %rsi
movq %r14, %rcx
movq 0x30(%rsp), %r14
movq 0x18(%rsp), %rdi
movq 0x88(%rsp), %rax
movq 0x28(%rax), %rax
mulsd 0x28(%rsp), %xmm0
addsd (%rax,%r13,8), %xmm0
movsd %xmm0, (%rax,%r13,8)
incq %r15
incq %r13
cmpq %r15, %rcx
jne 0x171ce
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq