// File: /workspace/github_cpp_makefile_star2_O1/mouda[P]LTE_random_access-simulate/alglibinternal.cpp
// Function: alglib_impl::complexapplyreflectionfromtheright(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 complexapplyreflectionfromtheright(/* 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 * v
     */
    vm = n2-n1+1;
    for(i=m1; i<=m2; i++)
    {
        t = ae_v_cdotproduct(&c->ptr.pp_complex[i][n1], 1, "N", &v->ptr.p_complex[1], 1, "N", ae_v_len(n1,n2));
        work->ptr.p_complex[i] = t;
    }
    
    /*
     * C := C - w * conj(v^T)
     */
    ae_v_cmove(&v->ptr.p_complex[1], 1, &v->ptr.p_complex[1], 1, "Conj", ae_v_len(1,vm));
    for(i=m1; i<=m2; i++)
    {
        t = ae_c_mul(work->ptr.p_complex[i],tau);
        ae_v_csubc(&c->ptr.pp_complex[i][n1], 1, &v->ptr.p_complex[1], 1, "N", ae_v_len(n1,n2), t);
    }
    ae_v_cmove(&v->ptr.p_complex[1], 1, &v->ptr.p_complex[1], 1, "Conj", ae_v_len(1,vm));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %r9, %rbx
movq %r8, %r14
movq %rcx, %r15
movq %rdx, %r13
movq %rsi, 0x8(%rsp)
movq %rdi, %r12
movq 0x90(%rsp), %rbp
xorps %xmm2, %xmm2
movsd %xmm0, 0x40(%rsp)
movsd %xmm1, 0x48(%rsp)
callq 0x28050
cmpq %r15, %r13
jg 0x194d6
movq %rbx, %rcx
subq %r14, %rcx
jl 0x194d6
testb %al, %al
jne 0x194d6
movq %rcx, 0x18(%rsp)
movq %rbx, 0x28(%rsp)
movq %r12, 0x38(%rsp)
leaq -0x1(%r13), %r12
leaq (,%r13,8), %rbx
movq %r14, %rax
shlq $0x4, %rax
movq %rax, 0x30(%rsp)
movq %r14, 0x20(%rsp)
movq %rbp, %r14
movq %r15, 0x10(%rsp)
movq 0x38(%rsp), %rax
movq 0x38(%rax), %rax
movq (%rax,%rbx), %rbp
addq 0x30(%rsp), %rbp
movq %r14, %r15
movq 0x8(%rsp), %rax
movq 0x28(%rax), %r14
addq $0x10, %r14
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0x2923f
movq %rax, (%rsp)
movl $0x1, %esi
movl $0x1, %r8d
movq %rbp, %rdi
leaq 0x1e75c(%rip), %rdx     # 0x37ac4
movq %r14, %rcx
movq %r15, %r14
movq %rdx, %r9
callq 0x28174
movq 0x28(%r15), %rax
movsd %xmm0, (%rax,%rbx,2)
movsd %xmm1, 0x8(%rax,%rbx,2)
incq %r12
addq $0x8, %rbx
cmpq %r12, 0x10(%rsp)
jne 0x1931e
movq 0x18(%rsp), %rsi
incq %rsi
movq 0x8(%rsp), %rax
movq 0x28(%rax), %rbx
addq $0x10, %rbx
movl $0x1, %edi
movq %rsi, 0x18(%rsp)
callq 0x2923f
leaq 0x1daa0(%rip), %r8      # 0x36e5e
movl $0x1, %esi
movl $0x1, %ecx
movq %rbx, %rdi
movq %rbx, %rdx
movq %rax, %r9
callq 0x2834a
movq 0x10(%rsp), %r12
cmpq %r12, %r13
movq 0x20(%rsp), %rbp
movq 0x8(%rsp), %rbx
jg 0x19492
subq %r13, %r12
incq %r12
shlq $0x3, %r13
movq 0x28(%r14), %rax
movsd (%rax,%r13,2), %xmm0
movsd 0x8(%rax,%r13,2), %xmm1
movsd 0x40(%rsp), %xmm2
movsd 0x48(%rsp), %xmm3
callq 0x27f95
movsd %xmm0, 0x10(%rsp)
movsd %xmm1, 0x50(%rsp)
movq 0x38(%rsp), %rax
movq 0x38(%rax), %rax
movq (%rax,%r13), %rbx
addq 0x30(%rsp), %rbx
movq 0x8(%rsp), %rax
movq 0x28(%rax), %r14
addq $0x10, %r14
movq %rbp, %rdi
movq 0x28(%rsp), %rsi
callq 0x2923f
movl $0x1, %esi
movl $0x1, %ecx
movq %rbx, %rdi
movq %r14, %rdx
movq %r15, %r14
movq 0x8(%rsp), %rbx
leaq 0x1e653(%rip), %r8      # 0x37ac4
movq %rax, %r9
movsd 0x10(%rsp), %xmm0
movsd 0x50(%rsp), %xmm1
callq 0x28cd6
addq $0x8, %r13
decq %r12
jne 0x193f8
movq 0x28(%rbx), %rbx
addq $0x10, %rbx
movl $0x1, %edi
movq 0x18(%rsp), %rsi
callq 0x2923f
leaq 0x1d9ae(%rip), %r8      # 0x36e5e
movl $0x1, %esi
movl $0x1, %ecx
movq %rbx, %rdi
movq %rbx, %rdx
movq %rax, %r9
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2834a
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq