// File: /workspace/github_cpp_makefile_star2_O1/mouda[P]LTE_random_access-simulate/alglibinternal.cpp
// Function: alglib_impl::applyreflectionfromtheleft(alglib_impl::ae_matrix*, double, alglib_impl::ae_vector*, long, long, long, long, alglib_impl::ae_vector*, alglib_impl::ae_state*)
void applyreflectionfromtheleft(/* Real    */ ae_matrix* c,
     double tau,
     /* Real    */ ae_vector* v,
     ae_int_t m1,
     ae_int_t m2,
     ae_int_t n1,
     ae_int_t n2,
     /* Real    */ ae_vector* work,
     ae_state *_state)
{
    double t;
    ae_int_t i;
    ae_int_t vm;


    if( (ae_fp_eq(tau,0)||n1>n2)||m1>m2 )
    {
        return;
    }
    
    /*
     * w := C' * v
     */
    vm = m2-m1+1;
    for(i=n1; i<=n2; i++)
    {
        work->ptr.p_double[i] = 0;
    }
    for(i=m1; i<=m2; i++)
    {
        t = v->ptr.p_double[i+1-m1];
        ae_v_addd(&work->ptr.p_double[n1], 1, &c->ptr.pp_double[i][n1], 1, ae_v_len(n1,n2), t);
    }
    
    /*
     * C := C - tau * v * w'
     */
    for(i=m1; i<=m2; i++)
    {
        t = v->ptr.p_double[i-m1+1]*tau;
        ae_v_subd(&c->ptr.pp_double[i][n1], 1, &work->ptr.p_double[n1], 1, 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, %r14
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbp
xorpd %xmm1, %xmm1
movsd %xmm0, 0x30(%rsp)
callq 0x262ba
cmpq %r15, %r12
jg 0x18ac1
cmpq %rbx, %r14
jg 0x18ac1
testb %al, %al
jne 0x18ac1
movq %r13, 0x28(%rsp)
movq 0x80(%rsp), %r8
movq %rbx, %rsi
leaq 0x1(%rbx), %rax
movq %r14, %rdi
movq 0x28(%r8), %rdx
movq $0x0, (%rdx,%r14,8)
incq %r14
cmpq %r14, %rax
jne 0x1892f
movq %r15, 0x20(%rsp)
movq %r12, 0x18(%rsp)
cmpq %r15, %r12
movq %rsi, %rbx
movq %rdi, (%rsp)
movq 0x28(%rsp), %rdx
movq %rbp, %rcx
movq %rbp, 0x38(%rsp)
jg 0x18a0a
movq 0x20(%rsp), %rsi
movq 0x18(%rsp), %rax
subq %rax, %rsi
incq %rsi
movq %rsi, 0x8(%rsp)
leaq (,%rax,8), %rax
movq %rax, 0x40(%rsp)
xorl %r14d, %r14d
movq (%rsp), %rax
leaq (,%rax,8), %r13
movq 0x28(%rdx), %rax
movsd 0x8(%rax,%r14,8), %xmm0
movsd %xmm0, 0x10(%rsp)
movq 0x28(%r8), %r15
addq %r13, %r15
movq 0x38(%rcx), %rax
addq 0x40(%rsp), %rax
movq (%rax,%r14,8), %r12
addq %r13, %r12
movq (%rsp), %rdi
movq %rbx, %rsi
movq %rdx, %rbp
callq 0x2923f
movl $0x1, %esi
movl $0x1, %ecx
movq %r15, %rdi
movq %r12, %rdx
movq %rax, %r8
movsd 0x10(%rsp), %xmm0
callq 0x290d8
movq %rbp, %rdx
movq 0x38(%rsp), %rcx
movq 0x80(%rsp), %r8
incq %r14
cmpq %r14, 0x8(%rsp)
jne 0x1899b
movq 0x20(%rsp), %r15
movq 0x18(%rsp), %r13
cmpq %r15, %r13
movsd 0x30(%rsp), %xmm0
jg 0x18ac1
movq %rdx, %r14
subq %r13, %r15
incq %r15
shlq $0x3, %r13
xorl %ebp, %ebp
movq (%rsp), %rax
leaq (,%rax,8), %rax
movq %rax, 0x8(%rsp)
movq 0x28(%r14), %rax
movsd 0x8(%rax,%rbp,8), %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, 0x10(%rsp)
movq 0x38(%rcx), %rax
addq %r13, %rax
movq %r15, %r14
movq (%rax,%rbp,8), %r15
movq 0x8(%rsp), %rax
addq %rax, %r15
movq 0x28(%r8), %r12
addq %rax, %r12
movq (%rsp), %rdi
movq %rbx, %rsi
callq 0x2923f
movl $0x1, %esi
movl $0x1, %ecx
movq %r15, %rdi
movq %r14, %r15
movq %r12, %rdx
movq 0x28(%rsp), %r14
movq %rax, %r8
movsd 0x10(%rsp), %xmm0
callq 0x291f0
movsd 0x30(%rsp), %xmm0
movq 0x38(%rsp), %rcx
movq 0x80(%rsp), %r8
incq %rbp
cmpq %rbp, %r15
jne 0x18a43
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq