// File: /workspace/github_cpp_makefile_star2_O2/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, 0x20(%rsp)
movq 0xa0(%rsp), %rbp
movq 0x90(%rsp), %r13
movq 0x80(%rsp), %rax
movq 0x78(%rsp), %rbx
movq %rdx, 0x30(%rsp)
movq %rdx, %r14
subq %rsi, %r14
setl %dl
movq %r8, 0x18(%rsp)
movq %r8, %r12
movq %rcx, 0x10(%rsp)
subq %rcx, %r12
setl %cl
orb %dl, %cl
testl %r9d, %r9d
je 0x15c33
testb %cl, %cl
jne 0x15c37
subq %rbx, %rax
xorl %edi, %edi
cmpq %rax, %r14
sete %dil
leaq 0x1d38d(%rip), %rsi     # 0x32f54
movq %rbp, %rdx
movsd %xmm1, 0x8(%rsp)
callq 0x238ca
movq %rbp, %rdx
movq 0x98(%rsp), %rbp
movq %rbp, %rax
subq %r13, %rax
xorl %edi, %edi
cmpq %rax, %r12
sete %dil
leaq 0x1d388(%rip), %rsi     # 0x32f7e
callq 0x238ca
xorps %xmm1, %xmm1
movsd 0x8(%rsp), %xmm0
callq 0x241f5
testb %al, %al
je 0x15cc5
movq %r13, %rax
cmpq %rbp, %rax
jg 0x15cf8
movq 0x88(%rsp), %rcx
movq 0x28(%rcx), %rcx
andq $0x0, (%rcx,%rax,8)
incq %rax
jmp 0x15c14
testb %cl, %cl
je 0x15c46
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
subq %rbx, %rax
xorl %edi, %edi
cmpq %rax, %r12
sete %dil
leaq 0x1d2fb(%rip), %rsi     # 0x32f54
movq %rbp, %rdx
movsd %xmm1, 0x8(%rsp)
callq 0x238ca
movq 0x98(%rsp), %r12
movq %r12, %rax
subq %r13, %rax
xorl %edi, %edi
cmpq %rax, %r14
sete %dil
leaq 0x1d2f9(%rip), %rsi     # 0x32f7e
movq %rbp, %rdx
callq 0x238ca
xorps %xmm1, %xmm1
movsd 0x8(%rsp), %xmm0
callq 0x241f5
testb %al, %al
je 0x15d88
movq %r13, %rax
cmpq %r12, %rax
jg 0x15dbb
movq 0x88(%rsp), %rcx
movq 0x28(%rcx), %rcx
andq $0x0, (%rcx,%rax,8)
incq %rax
jmp 0x15ca6
leaq (,%r13,8), %r14
movq 0x88(%rsp), %rax
addq 0x28(%rax), %r14
movq %r13, %rdi
movq %rbp, %rsi
callq 0x26b4d
pushq $0x1
popq %rsi
movq %r14, %rdi
movq %rax, %rdx
movsd 0x8(%rsp), %xmm0
callq 0x26b08
leaq (,%r13,8), %rax
movq %rax, 0x8(%rsp)
shlq $0x3, 0x10(%rsp)
pushq $0x1
popq %rbp
cmpq 0x30(%rsp), %r15
jg 0x15c37
movq 0x70(%rsp), %rax
movq 0x28(%rax), %rax
movsd (%rax,%rbx,8), %xmm0
mulsd 0x28(%rsp), %xmm0
movsd %xmm0, 0x18(%rsp)
movq 0x88(%rsp), %rax
movq 0x28(%rax), %r14
addq 0x8(%rsp), %r14
movq 0x20(%rsp), %rax
movq 0x38(%rax), %rax
movq (%rax,%r15,8), %r12
addq 0x10(%rsp), %r12
movq %r13, %rdi
movq 0x98(%rsp), %rsi
callq 0x26b4d
movq %r14, %rdi
movq %rbp, %rsi
movq %r12, %rdx
movq %rbp, %rcx
movq %rax, %r8
movsd 0x18(%rsp), %xmm0
callq 0x269b8
incq %r15
incq %rbx
jmp 0x15d0e
movq %r12, %rsi
leaq (,%r13,8), %rbp
movq 0x88(%rsp), %rax
addq 0x28(%rax), %rbp
movq %r13, %rdi
callq 0x26b4d
pushq $0x1
popq %rsi
movq %rbp, %rdi
movq %rax, %rdx
movsd 0x8(%rsp), %xmm0
callq 0x26b08
movq 0x10(%rsp), %rax
leaq (,%rax,8), %rax
movq %rax, 0x8(%rsp)
shlq $0x3, %rbx
pushq $0x1
popq %rbp
cmpq 0x30(%rsp), %r15
jg 0x15c37
movq 0x20(%rsp), %rax
movq 0x38(%rax), %rax
movq (%rax,%r15,8), %r12
addq 0x8(%rsp), %r12
movq 0x70(%rsp), %rax
movq 0x28(%rax), %r14
addq %rbx, %r14
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x26b4d
movq %r12, %rdi
movq %rbp, %rsi
movq %r14, %rdx
movq %rbp, %rcx
movq %rax, %r8
callq 0x2668d
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
jmp 0x15dd4