// File: /workspace/github_cpp_makefile_star2_O2/mouda[P]LTE_random_access-simulate/alglibinternal.cpp
// Function: alglib_impl::hermitianmatrixvectormultiply(alglib_impl::ae_matrix*, bool, long, long, alglib_impl::ae_vector*, alglib_impl::ae_complex, alglib_impl::ae_vector*, alglib_impl::ae_state*)
void hermitianmatrixvectormultiply(/* Complex */ ae_matrix* a,
     ae_bool isupper,
     ae_int_t i1,
     ae_int_t i2,
     /* Complex */ ae_vector* x,
     ae_complex alpha,
     /* Complex */ ae_vector* y,
     ae_state *_state)
{
    ae_int_t i;
    ae_int_t ba1;
    ae_int_t ba2;
    ae_int_t by1;
    ae_int_t by2;
    ae_int_t bx1;
    ae_int_t bx2;
    ae_int_t n;
    ae_complex v;


    n = i2-i1+1;
    if( n<=0 )
    {
        return;
    }
    
    /*
     * Let A = L + D + U, where
     *  L is strictly lower triangular (main diagonal is zero)
     *  D is diagonal
     *  U is strictly upper triangular (main diagonal is zero)
     *
     * A*x = L*x + D*x + U*x
     *
     * Calculate D*x first
     */
    for(i=i1; i<=i2; i++)
    {
        y->ptr.p_complex[i-i1+1] = ae_c_mul(a->ptr.pp_complex[i][i],x->ptr.p_complex[i-i1+1]);
    }
    
    /*
     * Add L*x + U*x
     */
    if( isupper )
    {
        for(i=i1; i<=i2-1; i++)
        {
            
            /*
             * Add L*x to the result
             */
            v = x->ptr.p_complex[i-i1+1];
            by1 = i-i1+2;
            by2 = n;
            ba1 = i+1;
            ba2 = i2;
            ae_v_caddc(&y->ptr.p_complex[by1], 1, &a->ptr.pp_complex[i][ba1], 1, "Conj", ae_v_len(by1,by2), v);
            
            /*
             * Add U*x to the result
             */
            bx1 = i-i1+2;
            bx2 = n;
            ba1 = i+1;
            ba2 = i2;
            v = ae_v_cdotproduct(&x->ptr.p_complex[bx1], 1, "N", &a->ptr.pp_complex[i][ba1], 1, "N", ae_v_len(bx1,bx2));
            y->ptr.p_complex[i-i1+1] = ae_c_add(y->ptr.p_complex[i-i1+1],v);
        }
    }
    else
    {
        for(i=i1+1; i<=i2; i++)
        {
            
            /*
             * Add L*x to the result
             */
            bx1 = 1;
            bx2 = i-i1;
            ba1 = i1;
            ba2 = i-1;
            v = ae_v_cdotproduct(&x->ptr.p_complex[bx1], 1, "N", &a->ptr.pp_complex[i][ba1], 1, "N", ae_v_len(bx1,bx2));
            y->ptr.p_complex[i-i1+1] = ae_c_add(y->ptr.p_complex[i-i1+1],v);
            
            /*
             * Add U*x to the result
             */
            v = x->ptr.p_complex[i-i1+1];
            by1 = 1;
            by2 = i-i1;
            ba1 = i1;
            ba2 = i-1;
            ae_v_caddc(&y->ptr.p_complex[by1], 1, &a->ptr.pp_complex[i][ba1], 1, "Conj", ae_v_len(by1,by2), v);
        }
    }
    ae_v_cmulc(&y->ptr.p_complex[1], 1, ae_v_len(1,n), alpha);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %r9, 0x18(%rsp)
movq %rdi, 0x30(%rsp)
movq %rcx, %rax
subq %rdx, %rax
js 0x16929
movq %r8, %r13
movq %rcx, %rbp
movl %esi, %r14d
movsd %xmm0, 0x58(%rsp)
movsd %xmm1, 0x60(%rsp)
incq %rax
movq %rax, 0x48(%rsp)
movq %rdx, %rax
shlq $0x4, %rax
movq %rax, 0x28(%rsp)
pushq $0x1
popq %r15
movq %rdx, 0x10(%rsp)
movq %rdx, %r12
cmpq %rbp, %r12
jg 0x167bd
movq 0x30(%rsp), %rax
movq 0x38(%rax), %rax
movq (%rax,%r12,8), %rax
addq 0x28(%rsp), %rax
movsd -0x8(%rax,%r15,8), %xmm0
movsd (%rax,%r15,8), %xmm1
movq 0x28(%r13), %rax
movsd 0x8(%rax,%r15,8), %xmm2
movsd 0x10(%rax,%r15,8), %xmm3
callq 0x2596d
movq 0x18(%rsp), %rax
movq 0x28(%rax), %rax
movsd %xmm0, 0x8(%rax,%r15,8)
movsd %xmm1, 0x10(%rax,%r15,8)
incq %r12
addq $0x2, %r15
jmp 0x16762
movq %rbp, 0x50(%rsp)
movq %r13, 0x40(%rsp)
testb %r14b, %r14b
je 0x16938
movq 0x10(%rsp), %rdx
leaq (,%rdx,8), %rax
movq %rax, 0x20(%rsp)
pushq $0x20
popq %r15
xorl %ecx, %ecx
movq 0x30(%rsp), %rbp
movq 0x28(%rsp), %r12
leaq (%rdx,%rcx), %rax
cmpq 0x50(%rsp), %rax
jge 0x16a66
movq 0x40(%rsp), %rax
movq 0x28(%rax), %rax
movsd -0x10(%rax,%r15), %xmm0
movsd %xmm0, 0x70(%rsp)
movsd -0x8(%rax,%r15), %xmm0
movsd %xmm0, 0x68(%rsp)
leaq 0x2(%rcx), %rdi
movq %rdi, 0x38(%rsp)
movq 0x18(%rsp), %rax
movq 0x28(%rax), %r13
addq %r15, %r13
movq 0x38(%rbp), %rax
addq 0x20(%rsp), %rax
movq (%rax,%rcx,8), %rax
addq %r12, %rax
leaq (%r15,%rax), %r14
addq $-0x10, %r14
movq 0x48(%rsp), %rbx
movq %rbx, %rsi
movq %rcx, 0x8(%rsp)
callq 0x26b4d
movq %r13, %rdi
pushq $0x1
popq %rcx
movq %rcx, %rsi
movq %r14, %rdx
leaq 0x1c760(%rip), %r8      # 0x32fd6
movq %rax, %r9
movsd 0x70(%rsp), %xmm0
movsd 0x68(%rsp), %xmm1
callq 0x26349
movq 0x40(%rsp), %rax
movq 0x28(%rax), %r14
addq %r15, %r14
movq 0x38(%rbp), %rax
addq 0x20(%rsp), %rax
movq 0x8(%rsp), %rcx
movq (%rax,%rcx,8), %rax
addq %r12, %rax
leaq (%r15,%rax), %r13
addq $-0x10, %r13
movq 0x38(%rsp), %rdi
movq %rbx, %rsi
movq 0x18(%rsp), %rbx
callq 0x26b4d
movq %rax, (%rsp)
movq %r14, %rdi
pushq $0x1
popq %rsi
leaq 0x1d35e(%rip), %rdx     # 0x33c34
movq %r13, %rcx
movq %rsi, %r8
movq %rdx, %r9
callq 0x25b78
movaps %xmm0, %xmm2
movaps %xmm1, %xmm3
movq 0x28(%rbx), %rax
movsd -0x10(%rax,%r15), %xmm0
movsd -0x8(%rax,%r15), %xmm1
callq 0x25964
movq 0x10(%rsp), %rdx
movq 0x8(%rsp), %rcx
movq 0x28(%rbx), %rax
movsd %xmm0, -0x10(%rax,%r15)
movsd %xmm1, -0x8(%rax,%r15)
incq %rcx
addq $0x10, %r15
jmp 0x167f2
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%rsp), %r12
leaq (,%r12,8), %rax
movq %rax, 0x8(%rsp)
pushq $0x1
popq %r14
xorl %ebp, %ebp
pushq $0x1
popq %rbx
cmpq 0x50(%rsp), %r12
jge 0x16a66
incq %r12
movq %r12, 0x10(%rsp)
movq 0x40(%rsp), %r12
movq 0x28(%r12), %r13
addq $0x10, %r13
movq 0x30(%rsp), %rax
movq 0x38(%rax), %rax
addq 0x8(%rsp), %rax
movq 0x8(%rbp,%rax), %r15
addq 0x28(%rsp), %r15
movq %rbx, %rdi
movq %r14, %rsi
callq 0x26b4d
movq %rax, (%rsp)
movq %r13, %rdi
movq %rbx, %rsi
leaq 0x1d28c(%rip), %rdx     # 0x33c34
movq %r15, %rcx
movq %rbx, %r8
movq %rdx, %r9
callq 0x25b78
movaps %xmm0, %xmm2
movaps %xmm1, %xmm3
movq 0x18(%rsp), %r15
movq 0x28(%r15), %rax
movsd 0x20(%rax,%rbp,2), %xmm0
movsd 0x28(%rax,%rbp,2), %xmm1
callq 0x25964
movq 0x28(%r15), %rax
movsd %xmm0, 0x20(%rax,%rbp,2)
movsd %xmm1, 0x28(%rax,%rbp,2)
movq 0x28(%r12), %rax
movq 0x10(%rsp), %r12
movsd 0x20(%rax,%rbp,2), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x28(%rax,%rbp,2), %xmm0
movsd %xmm0, 0x38(%rsp)
movq 0x28(%r15), %r15
addq $0x10, %r15
movq 0x30(%rsp), %rax
movq 0x38(%rax), %rax
addq 0x8(%rsp), %rax
movq 0x8(%rbp,%rax), %r13
addq 0x28(%rsp), %r13
movq %rbx, %rdi
movq %r14, %rsi
callq 0x26b4d
movq %r15, %rdi
movq %rbx, %rsi
movq %r13, %rdx
movq %rbx, %rcx
leaq 0x1c590(%rip), %r8      # 0x32fd6
movq %rax, %r9
movsd 0x20(%rsp), %xmm0
movsd 0x38(%rsp), %xmm1
callq 0x26349
addq $0x8, %rbp
incq %r14
jmp 0x16953
movq 0x18(%rsp), %rax
movq 0x28(%rax), %rbx
addq $0x10, %rbx
pushq $0x1
popq %r14
movq %r14, %rdi
movq 0x48(%rsp), %rsi
callq 0x26b4d
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
movsd 0x58(%rsp), %xmm0
movsd 0x60(%rsp), %xmm1
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x26602