// File: /workspace/github_cpp_makefile_star2_O1/mouda[P]LTE_random_access-simulate/alglibinternal.cpp
// Function: alglib_impl::applyrotationsfromtheleft(bool, long, long, long, long, alglib_impl::ae_vector*, alglib_impl::ae_vector*, alglib_impl::ae_matrix*, alglib_impl::ae_vector*, alglib_impl::ae_state*)
void applyrotationsfromtheleft(ae_bool isforward,
     ae_int_t m1,
     ae_int_t m2,
     ae_int_t n1,
     ae_int_t n2,
     /* Real    */ ae_vector* c,
     /* Real    */ ae_vector* s,
     /* Real    */ ae_matrix* a,
     /* Real    */ ae_vector* work,
     ae_state *_state)
{
    ae_int_t j;
    ae_int_t jp1;
    double ctemp;
    double stemp;
    double temp;


    if( m1>m2||n1>n2 )
    {
        return;
    }
    
    /*
     * Form  P * A
     */
    if( isforward )
    {
        if( n1!=n2 )
        {
            
            /*
             * Common case: N1<>N2
             */
            for(j=m1; j<=m2-1; j++)
            {
                ctemp = c->ptr.p_double[j-m1+1];
                stemp = s->ptr.p_double[j-m1+1];
                if( ae_fp_neq(ctemp,1)||ae_fp_neq(stemp,0) )
                {
                    jp1 = j+1;
                    ae_v_moved(&work->ptr.p_double[n1], 1, &a->ptr.pp_double[jp1][n1], 1, ae_v_len(n1,n2), ctemp);
                    ae_v_subd(&work->ptr.p_double[n1], 1, &a->ptr.pp_double[j][n1], 1, ae_v_len(n1,n2), stemp);
                    ae_v_muld(&a->ptr.pp_double[j][n1], 1, ae_v_len(n1,n2), ctemp);
                    ae_v_addd(&a->ptr.pp_double[j][n1], 1, &a->ptr.pp_double[jp1][n1], 1, ae_v_len(n1,n2), stemp);
                    ae_v_move(&a->ptr.pp_double[jp1][n1], 1, &work->ptr.p_double[n1], 1, ae_v_len(n1,n2));
                }
            }
        }
        else
        {
            
            /*
             * Special case: N1=N2
             */
            for(j=m1; j<=m2-1; j++)
            {
                ctemp = c->ptr.p_double[j-m1+1];
                stemp = s->ptr.p_double[j-m1+1];
                if( ae_fp_neq(ctemp,1)||ae_fp_neq(stemp,0) )
                {
                    temp = a->ptr.pp_double[j+1][n1];
                    a->ptr.pp_double[j+1][n1] = ctemp*temp-stemp*a->ptr.pp_double[j][n1];
                    a->ptr.pp_double[j][n1] = stemp*temp+ctemp*a->ptr.pp_double[j][n1];
                }
            }
        }
    }
    else
    {
        if( n1!=n2 )
        {
            
            /*
             * Common case: N1<>N2
             */
            for(j=m2-1; j>=m1; j--)
            {
                ctemp = c->ptr.p_double[j-m1+1];
                stemp = s->ptr.p_double[j-m1+1];
                if( ae_fp_neq(ctemp,1)||ae_fp_neq(stemp,0) )
                {
                    jp1 = j+1;
                    ae_v_moved(&work->ptr.p_double[n1], 1, &a->ptr.pp_double[jp1][n1], 1, ae_v_len(n1,n2), ctemp);
                    ae_v_subd(&work->ptr.p_double[n1], 1, &a->ptr.pp_double[j][n1], 1, ae_v_len(n1,n2), stemp);
                    ae_v_muld(&a->ptr.pp_double[j][n1], 1, ae_v_len(n1,n2), ctemp);
                    ae_v_addd(&a->ptr.pp_double[j][n1], 1, &a->ptr.pp_double[jp1][n1], 1, ae_v_len(n1,n2), stemp);
                    ae_v_move(&a->ptr.pp_double[jp1][n1], 1, &work->ptr.p_double[n1], 1, ae_v_len(n1,n2));
                }
            }
        }
        else
        {
            
            /*
             * Special case: N1=N2
             */
            for(j=m2-1; j>=m1; j--)
            {
                ctemp = c->ptr.p_double[j-m1+1];
                stemp = s->ptr.p_double[j-m1+1];
                if( ae_fp_neq(ctemp,1)||ae_fp_neq(stemp,0) )
                {
                    temp = a->ptr.pp_double[j+1][n1];
                    a->ptr.pp_double[j+1][n1] = ctemp*temp-stemp*a->ptr.pp_double[j][n1];
                    a->ptr.pp_double[j][n1] = stemp*temp+ctemp*a->ptr.pp_double[j][n1];
                }
            }
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rcx, %r14
movq %rsi, (%rsp)
cmpq %rsi, %rdx
setl %al
movq %r8, 0x8(%rsp)
cmpq %r8, %rcx
setg %cl
orb %al, %cl
je 0x19b50
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r9, %rbp
movq %rdx, %r15
testb %dil, %dil
movq %r9, 0x30(%rsp)
je 0x19c3c
cmpq 0x8(%rsp), %r14
jne 0x19d1e
subq (%rsp), %r15
jle 0x19b41
shlq $0x3, (%rsp)
xorl %ebx, %ebx
movq 0x28(%rbp), %rax
movsd 0x8(%rax,%rbx,8), %xmm0
movq 0x70(%rsp), %rax
movq 0x28(%rax), %rax
movsd 0x8(%rax,%rbx,8), %xmm1
movsd %xmm1, 0x8(%rsp)
movsd %xmm0, 0x10(%rsp)
movsd 0x1a5f7(%rip), %xmm1    # 0x341a0
callq 0x262dc
testb %al, %al
jne 0x19bc5
xorpd %xmm1, %xmm1
movsd 0x8(%rsp), %xmm0
callq 0x262dc
testb %al, %al
je 0x19c2b
movq 0x78(%rsp), %rsi
movq 0x38(%rsi), %rax
movq (%rsp), %rdx
addq %rdx, %rax
movq (%rax,%rbx,8), %rcx
movq 0x8(%rax,%rbx,8), %rax
movsd (%rax,%r14,8), %xmm0
movsd (%rcx,%r14,8), %xmm1
movsd 0x8(%rsp), %xmm4
mulsd %xmm4, %xmm1
movsd 0x10(%rsp), %xmm3
movapd %xmm3, %xmm2
mulsd %xmm0, %xmm2
subsd %xmm1, %xmm2
movsd %xmm2, (%rax,%r14,8)
movq 0x38(%rsi), %rax
addq %rdx, %rax
movq (%rax,%rbx,8), %rax
mulsd (%rax,%r14,8), %xmm3
mulsd %xmm0, %xmm4
addsd %xmm3, %xmm4
movsd %xmm4, (%rax,%r14,8)
incq %rbx
cmpq %rbx, %r15
jne 0x19b7c
jmp 0x19b41
cmpq 0x8(%rsp), %r14
jne 0x19f25
cmpq (%rsp), %r15
jle 0x19b41
movq (%rsp), %rax
leaq (,%rax,8), %rbx
negq %rbx
movq 0x28(%rbp), %rax
addq %rbx, %rax
movsd (%rax,%r15,8), %xmm0
movq 0x70(%rsp), %rax
movq 0x28(%rax), %rax
addq %rbx, %rax
movsd (%rax,%r15,8), %xmm1
movsd %xmm1, 0x8(%rsp)
movsd %xmm0, 0x10(%rsp)
movsd 0x1a50d(%rip), %xmm1    # 0x341a0
callq 0x262dc
testb %al, %al
jne 0x19caf
xorpd %xmm1, %xmm1
movsd 0x8(%rsp), %xmm0
callq 0x262dc
testb %al, %al
je 0x19d0c
movq 0x78(%rsp), %rdx
movq 0x38(%rdx), %rax
movq -0x8(%rax,%r15,8), %rcx
movq (%rax,%r15,8), %rax
movsd (%rax,%r14,8), %xmm0
movsd (%rcx,%r14,8), %xmm1
movsd 0x8(%rsp), %xmm4
mulsd %xmm4, %xmm1
movsd 0x10(%rsp), %xmm3
movapd %xmm3, %xmm2
mulsd %xmm0, %xmm2
subsd %xmm1, %xmm2
movsd %xmm2, (%rax,%r14,8)
movq 0x38(%rdx), %rax
movq -0x8(%rax,%r15,8), %rax
mulsd (%rax,%r14,8), %xmm3
mulsd %xmm0, %xmm4
addsd %xmm3, %xmm4
movsd %xmm4, (%rax,%r14,8)
decq %r15
cmpq (%rsp), %r15
jg 0x19c60
jmp 0x19b41
subq (%rsp), %r15
jle 0x19b41
shlq $0x3, (%rsp)
xorl %r12d, %r12d
leaq (,%r14,8), %rax
movq %rax, 0x28(%rsp)
movq %r14, 0x20(%rsp)
movq 0x28(%rsp), %r13
movq 0x28(%rbp), %rax
movsd 0x8(%rax,%r12,8), %xmm1
movq 0x70(%rsp), %rax
movq 0x28(%rax), %rax
movsd 0x8(%rax,%r12,8), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd %xmm1, 0x18(%rsp)
movapd %xmm1, %xmm0
movsd 0x1a426(%rip), %xmm1    # 0x341a0
callq 0x262dc
testb %al, %al
jne 0x19d9a
xorpd %xmm1, %xmm1
movsd 0x10(%rsp), %xmm0
callq 0x262dc
testb %al, %al
je 0x19f14
movq 0x80(%rsp), %rax
movq 0x28(%rax), %rbp
addq %r13, %rbp
movq 0x78(%rsp), %rax
movq 0x38(%rax), %rax
movq (%rsp), %r14
addq %r14, %rax
movq %r14, (%rsp)
movq 0x8(%rax,%r12,8), %rbx
addq %r13, %rbx
movq 0x20(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x2923f
movl $0x1, %esi
movl $0x1, %ecx
movq %rbp, %rdi
movq %rbx, %rdx
movq %rax, %r8
movsd 0x18(%rsp), %xmm0
callq 0x28fd1
movq 0x80(%rsp), %rax
movq 0x28(%rax), %rbx
addq %r13, %rbx
movq 0x78(%rsp), %rax
movq 0x38(%rax), %rax
addq %r14, %rax
movq (%rax,%r12,8), %rbp
addq %r13, %rbp
movq 0x20(%rsp), %rdi
movq 0x8(%rsp), %r14
movq %r14, %rsi
callq 0x2923f
movl $0x1, %esi
movl $0x1, %ecx
movq %rbx, %rdi
movq %rbp, %rdx
movq %rax, %r8
movsd 0x10(%rsp), %xmm0
callq 0x291f0
movq 0x78(%rsp), %rax
movq 0x38(%rax), %rax
movq (%rsp), %rbp
addq %rbp, %rax
movq (%rax,%r12,8), %rbx
addq %r13, %rbx
movq 0x20(%rsp), %rdi
movq %r14, %rsi
callq 0x2923f
movl $0x1, %esi
movq %rbx, %rdi
movq %rax, %rdx
movsd 0x18(%rsp), %xmm0
callq 0x291fc
movq 0x78(%rsp), %rax
movq 0x38(%rax), %rax
addq %rbp, %rax
movq (%rax,%r12,8), %rbx
addq %r13, %rbx
movq 0x8(%rax,%r12,8), %rbp
addq %r13, %rbp
movq 0x20(%rsp), %rdi
movq %r14, %rsi
callq 0x2923f
movl $0x1, %esi
movl $0x1, %ecx
movq %rbx, %rdi
movq %rbp, %rdx
movq %rax, %r8
movsd 0x10(%rsp), %xmm0
callq 0x290d8
movq 0x78(%rsp), %rax
movq 0x38(%rax), %rax
addq (%rsp), %rax
movq 0x20(%rsp), %rdi
movq 0x8(%rax,%r12,8), %rbx
addq %r13, %rbx
movq 0x80(%rsp), %rax
movq 0x28(%rax), %rbp
addq %r13, %rbp
movq 0x8(%rsp), %rsi
callq 0x2923f
movl $0x1, %esi
movl $0x1, %ecx
movq %rbx, %rdi
movq %rbp, %rdx
movq 0x30(%rsp), %rbp
movq %rax, %r8
callq 0x28ecd
incq %r12
cmpq %r12, %r15
jne 0x19d47
jmp 0x19b41
cmpq (%rsp), %r15
jle 0x19b41
movq (%rsp), %rax
leaq (,%rax,8), %rax
negq %rax
movq %rax, 0x28(%rsp)
leaq (,%r14,8), %r13
movq 0x28(%rbp), %rax
movq 0x28(%rsp), %rcx
addq %rcx, %rax
movsd (%rax,%r15,8), %xmm1
movq 0x70(%rsp), %rax
movq 0x28(%rax), %rax
addq %rcx, %rax
movsd (%rax,%r15,8), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd %xmm1, 0x18(%rsp)
movapd %xmm1, %xmm0
movsd 0x1a219(%rip), %xmm1    # 0x341a0
callq 0x262dc
testb %al, %al
jne 0x19fa7
xorpd %xmm1, %xmm1
movsd 0x10(%rsp), %xmm0
callq 0x262dc
testb %al, %al
je 0x1a0f3
movq 0x80(%rsp), %rax
movq 0x28(%rax), %rbx
addq %r13, %rbx
movq 0x78(%rsp), %r12
movq 0x38(%r12), %rax
movq (%rax,%r15,8), %rbp
addq %r13, %rbp
movq %r14, %rdi
movq 0x8(%rsp), %r12
movq %r12, %rsi
callq 0x2923f
movl $0x1, %esi
movl $0x1, %ecx
movq %rbx, %rdi
movq %rbp, %rdx
movq %rax, %r8
movsd 0x18(%rsp), %xmm0
callq 0x28fd1
movq 0x80(%rsp), %rax
movq 0x28(%rax), %rbx
addq %r13, %rbx
movq 0x78(%rsp), %rax
movq 0x38(%rax), %rax
movq -0x8(%rax,%r15,8), %rbp
addq %r13, %rbp
movq %r14, %rdi
movq %r12, %rsi
callq 0x2923f
movl $0x1, %esi
movl $0x1, %ecx
movq %rbx, %rdi
movq %rbp, %rdx
movq %rax, %r8
movsd 0x10(%rsp), %xmm0
callq 0x291f0
movq 0x78(%rsp), %rbp
movq 0x38(%rbp), %rax
movq -0x8(%rax,%r15,8), %rbx
addq %r13, %rbx
movq %r14, %rdi
movq %r12, %rsi
callq 0x2923f
movl $0x1, %esi
movq %rbx, %rdi
movq %rax, %rdx
movsd 0x18(%rsp), %xmm0
callq 0x291fc
movq 0x38(%rbp), %rax
movq -0x8(%rax,%r15,8), %rbx
addq %r13, %rbx
movq (%rax,%r15,8), %rbp
addq %r13, %rbp
movq %r14, %rdi
movq %r12, %rsi
callq 0x2923f
movl $0x1, %esi
movl $0x1, %ecx
movq %rbx, %rdi
movq %rbp, %rdx
movq %rax, %r8
movsd 0x10(%rsp), %xmm0
callq 0x290d8
movq 0x78(%rsp), %rax
movq 0x38(%rax), %rax
movq (%rax,%r15,8), %rbx
addq %r13, %rbx
movq 0x80(%rsp), %rax
movq 0x28(%rax), %rbp
addq %r13, %rbp
movq %r14, %rdi
movq %r12, %rsi
callq 0x2923f
movl $0x1, %esi
movl $0x1, %ecx
movq %rbx, %rdi
movq %rbp, %rdx
movq 0x30(%rsp), %rbp
movq %rax, %r8
callq 0x28ecd
decq %r15
cmpq (%rsp), %r15
jg 0x19f4b
jmp 0x19b41