// File: /workspace/github_cpp_makefile_star2_O3/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 $0x48, %rsp
movq %rsi, 0x10(%rsp)
cmpq %rsi, %rdx
setl %al
movq %r8, 0x8(%rsp)
movq %rcx, 0x20(%rsp)
cmpq %r8, %rcx
setg %cl
orb %al, %cl
je 0x1949f
addq $0x48, %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, 0x38(%rsp)
je 0x19599
movq 0x20(%rsp), %rax
cmpq 0x8(%rsp), %rax
jne 0x19689
subq 0x10(%rsp), %r15
jle 0x19490
shlq $0x3, 0x10(%rsp)
xorl %ebx, %ebx
movq 0x28(%rbp), %rax
movsd 0x8(%rax,%rbx,8), %xmm0
movq 0x80(%rsp), %rax
movq 0x28(%rax), %rax
movsd 0x8(%rax,%rbx,8), %xmm1
movsd %xmm1, 0x8(%rsp)
movsd %xmm0, 0x18(%rsp)
movsd 0x19cde(%rip), %xmm1    # 0x331e0
callq 0x25b97
testb %al, %al
jne 0x1951e
xorpd %xmm1, %xmm1
movsd 0x8(%rsp), %xmm0
callq 0x25b97
testb %al, %al
je 0x19588
movq 0x88(%rsp), %rsi
movq 0x38(%rsi), %rax
movq 0x10(%rsp), %rdx
addq %rdx, %rax
movq (%rax,%rbx,8), %rcx
movq 0x8(%rax,%rbx,8), %rax
movq 0x20(%rsp), %rdi
movsd (%rax,%rdi,8), %xmm0
movsd (%rcx,%rdi,8), %xmm1
movsd 0x8(%rsp), %xmm4
mulsd %xmm4, %xmm1
movsd 0x18(%rsp), %xmm3
movapd %xmm3, %xmm2
mulsd %xmm0, %xmm2
subsd %xmm1, %xmm2
movsd %xmm2, (%rax,%rdi,8)
movq 0x38(%rsi), %rax
addq %rdx, %rax
movq (%rax,%rbx,8), %rax
mulsd (%rax,%rdi,8), %xmm3
mulsd %xmm0, %xmm4
addsd %xmm3, %xmm4
movsd %xmm4, (%rax,%rdi,8)
incq %rbx
cmpq %rbx, %r15
jne 0x194d2
jmp 0x19490
movq 0x20(%rsp), %rax
cmpq 0x8(%rsp), %rax
jne 0x19891
cmpq 0x10(%rsp), %r15
jle 0x19490
movq 0x10(%rsp), %rax
leaq (,%rax,8), %rbx
negq %rbx
movq 0x28(%rbp), %rax
addq %rbx, %rax
movsd (%rax,%r15,8), %xmm0
movq 0x80(%rsp), %rax
movq 0x28(%rax), %rax
addq %rbx, %rax
movsd (%rax,%r15,8), %xmm1
movsd %xmm1, 0x8(%rsp)
movsd %xmm0, 0x18(%rsp)
movsd 0x19be6(%rip), %xmm1    # 0x331e0
callq 0x25b97
testb %al, %al
jne 0x19616
xorpd %xmm1, %xmm1
movsd 0x8(%rsp), %xmm0
callq 0x25b97
testb %al, %al
je 0x19676
movq 0x88(%rsp), %rdx
movq 0x38(%rdx), %rax
movq -0x8(%rax,%r15,8), %rcx
movq (%rax,%r15,8), %rax
movq 0x20(%rsp), %rsi
movsd (%rax,%rsi,8), %xmm0
movsd (%rcx,%rsi,8), %xmm1
movsd 0x8(%rsp), %xmm4
mulsd %xmm4, %xmm1
movsd 0x18(%rsp), %xmm3
movapd %xmm3, %xmm2
mulsd %xmm0, %xmm2
subsd %xmm1, %xmm2
movsd %xmm2, (%rax,%rsi,8)
movq 0x38(%rdx), %rax
movq -0x8(%rax,%r15,8), %rax
mulsd (%rax,%rsi,8), %xmm3
mulsd %xmm0, %xmm4
addsd %xmm3, %xmm4
movsd %xmm4, (%rax,%rsi,8)
decq %r15
cmpq 0x10(%rsp), %r15
jg 0x195c4
jmp 0x19490
cmpq 0x10(%rsp), %r15
jle 0x19490
movq 0x20(%rsp), %rax
leaq (,%rax,8), %rax
movq %rax, 0x40(%rsp)
movq 0x10(%rsp), %r13
movq 0x40(%rsp), %r14
movq 0x28(%rbp), %rax
movq %r13, %rcx
subq 0x10(%rsp), %rcx
movsd 0x8(%rax,%rcx,8), %xmm1
movq 0x80(%rsp), %rax
movq 0x28(%rax), %rax
movsd 0x8(%rax,%rcx,8), %xmm0
movsd %xmm0, 0x18(%rsp)
movsd %xmm1, 0x28(%rsp)
movapd %xmm1, %xmm0
movsd 0x19af4(%rip), %xmm1    # 0x331e0
callq 0x25b97
testb %al, %al
jne 0x1970c
xorpd %xmm1, %xmm1
movsd 0x18(%rsp), %xmm0
callq 0x25b97
testb %al, %al
je 0x19880
leaq 0x1(%r13), %rax
movq %rax, 0x30(%rsp)
movq 0x90(%rsp), %rax
movq 0x28(%rax), %rbp
addq %r14, %rbp
movq 0x88(%rsp), %rax
movq 0x38(%rax), %rax
movq 0x8(%rax,%r13,8), %rbx
addq %r14, %rbx
movq 0x20(%rsp), %r12
movq %r12, %rdi
movq 0x8(%rsp), %rsi
callq 0x2897c
movl $0x1, %esi
movl $0x1, %ecx
movq %rbp, %rdi
movq %rbx, %rdx
movq %rax, %r8
movsd 0x28(%rsp), %xmm0
callq 0x2870e
movq 0x90(%rsp), %rax
movq 0x28(%rax), %rbx
addq %r14, %rbx
movq 0x88(%rsp), %rax
movq 0x38(%rax), %rax
movq (%rax,%r13,8), %rbp
addq %r14, %rbp
movq %r12, %rdi
movq 0x8(%rsp), %rsi
callq 0x2897c
movl $0x1, %esi
movl $0x1, %ecx
movq %rbx, %rdi
movq %rbp, %rdx
movq %rax, %r8
movsd 0x18(%rsp), %xmm0
callq 0x2892d
movq 0x88(%rsp), %rbp
movq 0x38(%rbp), %rax
movq (%rax,%r13,8), %rbx
addq %r14, %rbx
movq %r12, %rdi
movq 0x8(%rsp), %r12
movq %r12, %rsi
callq 0x2897c
movl $0x1, %esi
movq %rbx, %rdi
movq %rax, %rdx
movsd 0x28(%rsp), %xmm0
callq 0x28939
movq 0x38(%rbp), %rax
movq (%rax,%r13,8), %rbx
addq %r14, %rbx
movq 0x8(%rax,%r13,8), %rbp
addq %r14, %rbp
movq 0x20(%rsp), %rdi
movq %r12, %rsi
callq 0x2897c
movl $0x1, %esi
movl $0x1, %ecx
movq %rbx, %rdi
movq %rbp, %rdx
movq %rax, %r8
movsd 0x18(%rsp), %xmm0
callq 0x28815
movq 0x88(%rsp), %rax
movq 0x38(%rax), %rax
movq 0x8(%rax,%r13,8), %rbx
addq %r14, %rbx
movq 0x90(%rsp), %rax
movq 0x28(%rax), %rbp
addq %r14, %rbp
movq 0x20(%rsp), %rdi
movq %r12, %rsi
callq 0x2897c
movl $0x1, %esi
movl $0x1, %ecx
movq %rbx, %rdi
movq %rbp, %rdx
movq 0x38(%rsp), %rbp
movq %rax, %r8
callq 0x2860a
movq 0x30(%rsp), %r13
jmp 0x19883
incq %r13
cmpq %r15, %r13
jne 0x196b0
jmp 0x19490
cmpq 0x10(%rsp), %r15
jle 0x19490
movq 0x10(%rsp), %rax
leaq (,%rax,8), %rax
negq %rax
movq %rax, 0x30(%rsp)
movq 0x20(%rsp), %rax
leaq (,%rax,8), %r12
movq 0x8(%rsp), %r14
movq 0x28(%rbp), %rax
movq 0x30(%rsp), %rcx
addq %rcx, %rax
movsd (%rax,%r15,8), %xmm1
movq 0x80(%rsp), %rax
movq 0x28(%rax), %rax
addq %rcx, %rax
movsd (%rax,%r15,8), %xmm0
movsd %xmm0, 0x18(%rsp)
movsd %xmm1, 0x28(%rsp)
movapd %xmm1, %xmm0
movsd 0x198de(%rip), %xmm1    # 0x331e0
callq 0x25b97
testb %al, %al
jne 0x19922
xorpd %xmm1, %xmm1
movsd 0x18(%rsp), %xmm0
callq 0x25b97
testb %al, %al
je 0x19a79
movq 0x90(%rsp), %rax
movq 0x28(%rax), %rbx
addq %r12, %rbx
movq 0x88(%rsp), %r13
movq 0x38(%r13), %rax
movq (%rax,%r15,8), %rbp
addq %r12, %rbp
movq 0x20(%rsp), %r13
movq %r13, %rdi
movq %r14, %rsi
callq 0x2897c
movl $0x1, %esi
movl $0x1, %ecx
movq %rbx, %rdi
movq %rbp, %rdx
movq %rax, %r8
movsd 0x28(%rsp), %xmm0
callq 0x2870e
movq 0x90(%rsp), %rax
movq 0x28(%rax), %rbx
addq %r12, %rbx
movq 0x88(%rsp), %rax
movq 0x38(%rax), %rax
movq -0x8(%rax,%r15,8), %rbp
addq %r12, %rbp
movq %r13, %rdi
movq %r14, %rsi
callq 0x2897c
movl $0x1, %esi
movl $0x1, %ecx
movq %rbx, %rdi
movq %rbp, %rdx
movq %rax, %r8
movsd 0x18(%rsp), %xmm0
callq 0x2892d
movq 0x88(%rsp), %rbp
movq 0x38(%rbp), %rax
movq -0x8(%rax,%r15,8), %rbx
addq %r12, %rbx
movq %r13, %rdi
movq %r14, %rsi
callq 0x2897c
movl $0x1, %esi
movq %rbx, %rdi
movq %rax, %rdx
movsd 0x28(%rsp), %xmm0
callq 0x28939
movq 0x38(%rbp), %rax
movq -0x8(%rax,%r15,8), %rbx
addq %r12, %rbx
movq (%rax,%r15,8), %rbp
addq %r12, %rbp
movq %r13, %rdi
movq %r14, %rsi
callq 0x2897c
movl $0x1, %esi
movl $0x1, %ecx
movq %rbx, %rdi
movq %rbp, %rdx
movq %rax, %r8
movsd 0x18(%rsp), %xmm0
callq 0x28815
movq 0x88(%rsp), %rax
movq 0x38(%rax), %rax
movq (%rax,%r15,8), %rbx
addq %r12, %rbx
movq 0x90(%rsp), %rax
movq 0x28(%rax), %rbp
addq %r12, %rbp
movq %r13, %rdi
movq %r14, %rsi
callq 0x2897c
movl $0x1, %esi
movl $0x1, %ecx
movq %rbx, %rdi
movq %rbp, %rdx
movq 0x38(%rsp), %rbp
movq %rax, %r8
callq 0x2860a
decq %r15
cmpq 0x10(%rsp), %r15
jg 0x198c3
jmp 0x19490