// File: /workspace/github_cpp_makefile_star2_O3/mouda[P]LTE_random_access-simulate/alglibinternal.cpp
// Function: alglib_impl::complexapplyreflectionfromtheleft(alglib_impl::ae_matrix*, alglib_impl::ae_complex, alglib_impl::ae_vector*, long, long, long, long, alglib_impl::ae_vector*, alglib_impl::ae_state*)
void complexapplyreflectionfromtheleft(/* Complex */ ae_matrix* c,
     ae_complex tau,
     /* Complex */ ae_vector* v,
     ae_int_t m1,
     ae_int_t m2,
     ae_int_t n1,
     ae_int_t n2,
     /* Complex */ ae_vector* work,
     ae_state *_state)
{
    ae_complex t;
    ae_int_t i;
    ae_int_t vm;


    if( (ae_c_eq_d(tau,0)||n1>n2)||m1>m2 )
    {
        return;
    }
    
    /*
     * w := C^T * conj(v)
     */
    vm = m2-m1+1;
    for(i=n1; i<=n2; i++)
    {
        work->ptr.p_complex[i] = ae_complex_from_d(0);
    }
    for(i=m1; i<=m2; i++)
    {
        t = ae_c_conj(v->ptr.p_complex[i+1-m1], _state);
        ae_v_caddc(&work->ptr.p_complex[n1], 1, &c->ptr.pp_complex[i][n1], 1, "N", ae_v_len(n1,n2), t);
    }
    
    /*
     * C := C - tau * v * w^T
     */
    for(i=m1; i<=m2; i++)
    {
        t = ae_c_mul(v->ptr.p_complex[i-m1+1],tau);
        ae_v_csubc(&c->ptr.pp_complex[i][n1], 1, &work->ptr.p_complex[n1], 1, "N", ae_v_len(n1,n2), t);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %r9, %rbx
movq %r8, %rbp
movq %rcx, %r14
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %r13
xorps %xmm2, %xmm2
movsd %xmm0, 0x38(%rsp)
movsd %xmm1, 0x40(%rsp)
callq 0x2789e
cmpq %r14, %r12
jg 0x18bdf
cmpq %rbx, %rbp
jg 0x18bdf
testb %al, %al
jne 0x18bdf
movq %r13, 0x30(%rsp)
movq %r15, 0x10(%rsp)
movq %rbx, 0x18(%rsp)
incq %rbx
movq %rbp, %rax
shlq $0x4, %rax
movq %rax, %r13
leaq 0x8(%rax), %r15
xorps %xmm0, %xmm0
callq 0x276c0
movq 0x80(%rsp), %rax
movq 0x28(%rax), %rax
movsd %xmm0, -0x8(%rax,%r15)
movsd %xmm1, (%rax,%r15)
decq %rbx
addq $0x10, %r15
cmpq %rbx, %rbp
jne 0x18a47
movq %r14, %rcx
incq %rcx
movl $0x3, %r15d
movq %rbp, 0x28(%rsp)
movq %r12, %rbp
movq %r13, 0x20(%rsp)
movq 0x10(%rsp), %rax
movq 0x28(%rax), %rax
leaq 0x1(%rbp), %rbx
movsd -0x8(%rax,%r15,8), %xmm0
movsd (%rax,%r15,8), %xmm1
movq 0x88(%rsp), %rdi
movq %rcx, %r14
callq 0x276d2
movsd %xmm0, 0x8(%rsp)
movsd %xmm1, (%rsp)
movq 0x80(%rsp), %rax
movq 0x28(%rax), %r13
movq 0x20(%rsp), %rcx
addq %rcx, %r13
movq 0x30(%rsp), %rax
movq 0x38(%rax), %rax
movq (%rax,%rbp,8), %rbp
addq %rcx, %rbp
movq 0x28(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x2897c
movl $0x1, %esi
movl $0x1, %ecx
movq %r13, %rdi
movq %rbp, %rdx
leaq 0x1e194(%rip), %r8      # 0x36ca0
movq %rax, %r9
movsd 0x8(%rsp), %xmm0
movsd (%rsp), %xmm1
callq 0x281a4
movq %r14, %rcx
addq $0x2, %r15
movq %rbx, %rbp
cmpq %rbx, %r14
jne 0x18a8d
movl $0x3, %r15d
movq 0x18(%rsp), %rbx
movq 0x10(%rsp), %r13
movq 0x28(%r13), %rax
movsd -0x8(%rax,%r15,8), %xmm0
movsd (%rax,%r15,8), %xmm1
movsd 0x38(%rsp), %xmm2
movsd 0x40(%rsp), %xmm3
callq 0x277cf
movsd %xmm0, 0x8(%rsp)
movsd %xmm1, (%rsp)
movq 0x30(%rsp), %rax
movq 0x38(%rax), %rax
movq (%rax,%r12,8), %r13
movq 0x20(%rsp), %rcx
addq %rcx, %r13
movq 0x80(%rsp), %rax
movq 0x28(%rax), %rbp
addq %rcx, %rbp
movq 0x28(%rsp), %rdi
movq %rbx, %rsi
callq 0x2897c
movl $0x1, %esi
movl $0x1, %ecx
movq %r13, %rdi
movq 0x10(%rsp), %r13
movq %rbp, %rdx
leaq 0x1e0e4(%rip), %r8      # 0x36ca0
movq %rax, %r9
movsd 0x8(%rsp), %xmm0
movsd (%rsp), %xmm1
callq 0x2842b
incq %r12
addq $0x2, %r15
cmpq %r12, %r14
jne 0x18b42
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq