// File: /workspace/github_cpp_makefile_star2_O3/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, %rbx
movq 0xa0(%rsp), %rbp
movq 0x98(%rsp), %r10
movq 0x90(%rsp), %r13
movq 0x80(%rsp), %rax
movq 0x78(%rsp), %r11
movq %rdx, %r14
subq %rsi, %r14
setl %dil
movq %r8, %r12
subq %rcx, %r12
setl %sil
orb %dil, %sil
testl %r9d, %r9d
movq %rbx, 0x30(%rsp)
je 0x1699b
testb %sil, %sil
jne 0x16c21
movq %rdx, 0x10(%rsp)
movq %rcx, 0x18(%rsp)
subq %r11, %rax
xorl %edi, %edi
cmpq %rax, %r14
sete %dil
leaq 0x1f643(%rip), %rsi     # 0x35f64
movq %rbp, %rdx
movq %r10, %r14
movsd %xmm1, 0x8(%rsp)
callq 0x2510e
movq %r14, %rax
subq %r13, %rax
xorl %edi, %edi
cmpq %rax, %r12
sete %dil
leaq 0x1f646(%rip), %rsi     # 0x35f8e
movq %rbp, %rdx
callq 0x2510e
xorpd %xmm1, %xmm1
movsd 0x8(%rsp), %xmm0
callq 0x25b75
testb %al, %al
je 0x16a3c
cmpq %r13, %r14
movq 0x88(%rsp), %rsi
movq %r14, %r9
jl 0x16a77
leaq 0x1(%r9), %rax
movq %r13, %rcx
movq 0x28(%rsi), %rdx
movq $0x0, (%rdx,%rcx,8)
incq %rcx
cmpq %rcx, %rax
jne 0x16982
jmp 0x16a77
testb %sil, %sil
jne 0x16c21
movq %r8, 0x20(%rsp)
movq %rdx, 0x10(%rsp)
movq %rcx, 0x18(%rsp)
subq %r11, %rax
xorl %edi, %edi
cmpq %rax, %r12
sete %dil
leaq 0x1f59e(%rip), %rsi     # 0x35f64
movq %rbp, %rdx
movq %r10, %r12
movsd %xmm1, 0x8(%rsp)
callq 0x2510e
movq %r12, %rax
subq %r13, %rax
xorl %edi, %edi
cmpq %rax, %r14
sete %dil
leaq 0x1f5a1(%rip), %rsi     # 0x35f8e
movq %rbp, %rdx
callq 0x2510e
xorpd %xmm1, %xmm1
movsd 0x8(%rsp), %xmm0
callq 0x25b75
testb %al, %al
je 0x16b48
cmpq %r13, %r12
movq 0x88(%rsp), %rdx
jl 0x16b7d
incq %r12
movq %r13, %rax
movq 0x28(%rdx), %rcx
movq $0x0, (%rcx,%rax,8)
incq %rax
cmpq %rax, %r12
jne 0x16a23
jmp 0x16b7d
leaq (,%r13,8), %r12
movq 0x88(%rsp), %rbp
addq 0x28(%rbp), %r12
movq %r13, %rdi
movq %r14, %rsi
callq 0x2897c
movl $0x1, %esi
movq %r12, %rdi
movq %rax, %rdx
movsd 0x8(%rsp), %xmm0
callq 0x28939
movq %rbp, %rsi
movq %r14, %r9
movq 0x10(%rsp), %rbp
incq %rbp
leaq (,%r13,8), %rax
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rcx
shlq $0x3, %rcx
movsd 0x28(%rsp), %xmm0
movq 0x78(%rsp), %r8
movq 0x70(%rsp), %rax
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(%rbx), %rax
movq (%rax,%r15,8), %rbp
addq %rcx, %rbp
movq %r13, %rdi
movq %r9, %rsi
movq %r13, %r14
movq %r8, %r13
movq %r9, %rbx
callq 0x2897c
movl $0x1, %esi
movl $0x1, %ecx
movq %r12, %rdi
movq %rbp, %rdx
movq %rax, %r8
movsd 0x20(%rsp), %xmm0
callq 0x28815
movq %rbx, %r9
movq 0x70(%rsp), %rax
movq %r13, %r8
movq %r14, %r13
movq 0x88(%rsp), %rsi
movq 0x10(%rsp), %rbp
movq 0x30(%rsp), %rbx
movq 0x18(%rsp), %rcx
movsd 0x28(%rsp), %xmm0
incq %r15
incq %r8
cmpq %r15, %rbp
jne 0x16aaf
jmp 0x16c21
leaq (,%r13,8), %r14
movq 0x88(%rsp), %rax
addq 0x28(%rax), %r14
movq %r13, %rdi
movq %r12, %rsi
callq 0x2897c
movl $0x1, %esi
movq %r14, %rdi
movq %rax, %rdx
movsd 0x8(%rsp), %xmm0
callq 0x28939
movq 0x10(%rsp), %rcx
incq %rcx
movq 0x18(%rsp), %rdi
leaq (,%rdi,8), %rax
movq %rax, 0x10(%rsp)
movq 0x78(%rsp), %r14
shlq $0x3, %r14
movq 0x70(%rsp), %rsi
movq 0x20(%rsp), %r8
movq 0x38(%rbx), %rax
movq (%rax,%r15,8), %rbp
addq 0x10(%rsp), %rbp
movq 0x28(%rsi), %r12
addq %r14, %r12
movq %r8, %rsi
movq %rcx, %rbx
callq 0x2897c
movl $0x1, %esi
movl $0x1, %ecx
movq %rbp, %rdi
movq %r12, %rdx
movq %rax, %r8
callq 0x28519
movq 0x20(%rsp), %r8
movq 0x70(%rsp), %rsi
movq %rbx, %rcx
movq 0x30(%rsp), %rbx
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 0x16baa
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq