// File: /workspace/github_cpp_makefile_star2_O2/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 $0x68, %rsp
movq %r9, %rbx
movq %r8, %r14
movq %rcx, %r15
movq %rdx, %rbp
movq %rsi, 0x8(%rsp)
movq %rdi, 0x38(%rsp)
movq 0xa0(%rsp), %rax
movq %rax, 0x30(%rsp)
xorps %xmm2, %xmm2
movsd %xmm0, 0x48(%rsp)
movsd %xmm1, 0x50(%rsp)
callq 0x25a3c
movq %r15, 0x40(%rsp)
cmpq %r15, %rbp
jg 0x17c92
movq %rbx, %rcx
subq %r14, %rcx
jl 0x17c92
testb %al, %al
jne 0x17c92
movq %rcx, 0x10(%rsp)
movq %rbx, 0x20(%rsp)
leaq (,%rbp,8), %r15
movq %r14, 0x18(%rsp)
shlq $0x4, %r14
movq %r14, 0x28(%rsp)
pushq $0x1
popq %rbx
movq %rbp, %r13
cmpq 0x40(%rsp), %r13
jg 0x17b5e
movq 0x38(%rsp), %rax
movq 0x38(%rax), %rax
movq (%rax,%r15), %r14
addq 0x28(%rsp), %r14
movq 0x8(%rsp), %rax
movq 0x28(%rax), %r12
addq $0x10, %r12
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x26b4d
movq %rax, (%rsp)
movq %r14, %rdi
movq %rbx, %rsi
leaq 0x1c103(%rip), %rdx     # 0x33c34
movq %r12, %rcx
movq %rbx, %r8
movq %rdx, %r9
callq 0x25b78
movq 0x30(%rsp), %rax
movq 0x28(%rax), %rax
movsd %xmm0, (%rax,%r15,2)
movsd %xmm1, 0x8(%rax,%r15,2)
incq %r13
addq $0x8, %r15
jmp 0x17aeb
movq 0x10(%rsp), %rsi
incq %rsi
movq 0x8(%rsp), %rax
movq 0x28(%rax), %rbx
addq $0x10, %rbx
pushq $0x1
popq %r14
movq %r14, %rdi
movq %rsi, 0x10(%rsp)
callq 0x26b4d
leaq 0x1b44b(%rip), %r8      # 0x32fd6
movq %rbx, %rdi
movq %r14, %rsi
movq %rbx, %rdx
movq %r14, %rcx
movq %rax, %r9
callq 0x25d46
movq %rbp, %r12
shlq $0x4, %r12
movq 0x20(%rsp), %r15
movq 0x18(%rsp), %r13
cmpq 0x40(%rsp), %rbp
jg 0x17c4b
movq 0x30(%rsp), %rax
movq 0x28(%rax), %rax
movsd (%rax,%r12), %xmm0
movsd 0x8(%rax,%r12), %xmm1
movsd 0x48(%rsp), %xmm2
movsd 0x50(%rsp), %xmm3
callq 0x2596d
movsd %xmm0, 0x60(%rsp)
movsd %xmm1, 0x58(%rsp)
movq 0x38(%rsp), %rax
movq 0x38(%rax), %rax
movq (%rax,%rbp,8), %rbx
addq 0x28(%rsp), %rbx
movq 0x8(%rsp), %rax
movq 0x28(%rax), %r14
addq $0x10, %r14
movq %r13, %rdi
movq %r15, %rsi
callq 0x26b4d
movq %rbx, %rdi
pushq $0x1
popq %rcx
movq %rcx, %rsi
movq %r14, %rdx
leaq 0x1c009(%rip), %r8      # 0x33c34
movq %rax, %r9
movsd 0x60(%rsp), %xmm0
movsd 0x58(%rsp), %xmm1
callq 0x265a9
incq %rbp
addq $0x10, %r12
jmp 0x17bb0
movq 0x8(%rsp), %rax
movq 0x28(%rax), %rbx
addq $0x10, %rbx
pushq $0x1
popq %r14
movq %r14, %rdi
movq 0x10(%rsp), %rsi
callq 0x26b4d
leaq 0x1b366(%rip), %r8      # 0x32fd6
movq %rbx, %rdi
movq %r14, %rsi
movq %rbx, %rdx
movq %r14, %rcx
movq %rax, %r9
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x25d46
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq