// File: /workspace/github_cpp_makefile_star2_O2/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, 0x10(%rsp)
cmpq %rdx, %rsi
setg %al
movq %r8, 0x20(%rsp)
cmpq %r8, %rcx
setg %cl
orb %al, %cl
je 0x1828d
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r9, %r12
movq %rdx, %r15
testb %dil, %dil
movq %r9, 0x30(%rsp)
movq %r14, (%rsp)
je 0x1836a
cmpq 0x20(%rsp), %r14
movq 0x10(%rsp), %r13
jne 0x18445
pushq $0x8
popq %rbx
cmpq %r13, %r15
je 0x1827e
movq 0x28(%r12), %rax
movsd (%rax,%rbx), %xmm0
movq 0x70(%rsp), %rax
movq 0x28(%rax), %rax
movsd (%rax,%rbx), %xmm1
movsd %xmm1, (%rsp)
movsd %xmm0, 0x10(%rsp)
movsd 0x17f10(%rip), %xmm1    # 0x301f8
callq 0x24217
testb %al, %al
jne 0x18303
xorpd %xmm1, %xmm1
movsd (%rsp), %xmm0
callq 0x24217
testb %al, %al
je 0x1835e
movq 0x78(%rsp), %rdx
movq 0x38(%rdx), %rax
movq (%rax,%r13,8), %rcx
movq 0x8(%rax,%r13,8), %rax
movsd (%rax,%r14,8), %xmm0
movsd (%rcx,%r14,8), %xmm1
movsd (%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 (%rax,%r13,8), %rax
mulsd (%rax,%r14,8), %xmm3
mulsd %xmm0, %xmm4
addsd %xmm3, %xmm4
movsd %xmm4, (%rax,%r14,8)
incq %r13
addq $0x8, %rbx
jmp 0x182b8
cmpq 0x20(%rsp), %r14
movq 0x10(%rsp), %rax
jne 0x1860e
leaq (,%rax,8), %rbx
negq %rbx
cmpq %rax, %r15
jle 0x1827e
movq 0x28(%r12), %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, (%rsp)
movsd %xmm0, 0x8(%rsp)
movsd 0x17e37(%rip), %xmm1    # 0x301f8
callq 0x24217
testb %al, %al
jne 0x183dc
xorpd %xmm1, %xmm1
movsd (%rsp), %xmm0
callq 0x24217
testb %al, %al
je 0x18438
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 (%rsp), %xmm4
mulsd %xmm4, %xmm1
movsd 0x8(%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
movq 0x10(%rsp), %rax
jmp 0x18385
leaq (,%r14,8), %rbp
cmpq %r15, %r13
je 0x1827e
movq 0x28(%r12), %rax
movq %r13, %rcx
subq 0x10(%rsp), %rcx
movsd 0x8(%rax,%rcx,8), %xmm1
movq 0x70(%rsp), %rax
movq 0x28(%rax), %rax
movsd 0x8(%rax,%rcx,8), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd %xmm1, 0x18(%rsp)
movapd %xmm1, %xmm0
movsd 0x17d68(%rip), %xmm1    # 0x301f8
callq 0x24217
testb %al, %al
jne 0x184b0
xorpd %xmm1, %xmm1
movsd 0x8(%rsp), %xmm0
callq 0x24217
testb %al, %al
je 0x18606
leaq 0x1(%r13), %rax
movq %rax, 0x28(%rsp)
movq 0x80(%rsp), %rax
movq 0x28(%rax), %rbx
addq %rbp, %rbx
movq 0x78(%rsp), %rax
movq 0x38(%rax), %rax
movq 0x8(%rax,%r13,8), %r12
addq %rbp, %r12
movq %r14, %rdi
movq 0x20(%rsp), %r14
movq %r14, %rsi
callq 0x26b4d
movq %rbx, %rdi
pushq $0x1
popq %rcx
movq %rcx, %rsi
movq %r12, %rdx
movq %rax, %r8
movsd 0x18(%rsp), %xmm0
callq 0x26888
movq 0x80(%rsp), %rax
movq 0x28(%rax), %rbx
addq %rbp, %rbx
movq 0x78(%rsp), %rax
movq 0x38(%rax), %rax
movq (%rax,%r13,8), %r12
addq %rbp, %r12
movq (%rsp), %rdi
movq %r14, %rsi
callq 0x26b4d
movq %rbx, %rdi
pushq $0x1
popq %rcx
movq %rcx, %rsi
movq %r12, %rdx
movq %rax, %r8
movsd 0x8(%rsp), %xmm0
callq 0x26afc
movq 0x78(%rsp), %r12
movq 0x38(%r12), %rax
movq (%rax,%r13,8), %rbx
addq %rbp, %rbx
movq (%rsp), %rdi
movq %r14, %rsi
callq 0x26b4d
movq %rbx, %rdi
pushq $0x1
popq %rsi
movq %rax, %rdx
movsd 0x18(%rsp), %xmm0
callq 0x26b08
movq 0x38(%r12), %rax
movq (%rax,%r13,8), %rbx
addq %rbp, %rbx
movq 0x8(%rax,%r13,8), %r12
addq %rbp, %r12
movq (%rsp), %rdi
movq %r14, %rsi
callq 0x26b4d
movq %rbx, %rdi
pushq $0x1
popq %rcx
movq %rcx, %rsi
movq %r12, %rdx
movq %rax, %r8
movsd 0x8(%rsp), %xmm0
callq 0x269b8
movq 0x78(%rsp), %rax
movq 0x38(%rax), %rax
movq 0x8(%rax,%r13,8), %rbx
addq %rbp, %rbx
movq 0x80(%rsp), %rax
movq 0x28(%rax), %r12
addq %rbp, %r12
movq (%rsp), %rdi
movq %r14, %rsi
movq (%rsp), %r14
callq 0x26b4d
movq %rbx, %rdi
pushq $0x1
popq %rcx
movq %rcx, %rsi
movq %r12, %rdx
movq 0x30(%rsp), %r12
movq %rax, %r8
callq 0x2675e
movq 0x28(%rsp), %r13
jmp 0x1844d
incq %r13
jmp 0x1844d
leaq (,%rax,8), %rcx
negq %rcx
movq %rcx, 0x28(%rsp)
leaq (,%r14,8), %rbp
cmpq %rax, %r15
jle 0x1827e
movq 0x28(%r12), %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, 0x8(%rsp)
movsd %xmm1, 0x18(%rsp)
movapd %xmm1, %xmm0
movsd 0x17b8c(%rip), %xmm1    # 0x301f8
callq 0x24217
testb %al, %al
jne 0x1868c
xorpd %xmm1, %xmm1
movsd 0x8(%rsp), %xmm0
callq 0x24217
testb %al, %al
je 0x187d3
movq 0x80(%rsp), %rax
movq 0x28(%rax), %rbx
addq %rbp, %rbx
movq 0x78(%rsp), %r13
movq 0x38(%r13), %rax
movq (%rax,%r15,8), %r12
addq %rbp, %r12
movq %r14, %rdi
movq 0x20(%rsp), %r14
movq %r14, %rsi
callq 0x26b4d
movq %rbx, %rdi
pushq $0x1
popq %r13
movq %r13, %rsi
movq %r12, %rdx
movq %r13, %rcx
movq %rax, %r8
movsd 0x18(%rsp), %xmm0
callq 0x26888
movq 0x80(%rsp), %rax
movq 0x28(%rax), %rbx
addq %rbp, %rbx
movq 0x78(%rsp), %rax
movq 0x38(%rax), %rax
movq -0x8(%rax,%r15,8), %r12
addq %rbp, %r12
movq (%rsp), %rdi
movq %r14, %rsi
callq 0x26b4d
movq %rbx, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r13, %rcx
movq %rax, %r8
movsd 0x8(%rsp), %xmm0
callq 0x26afc
movq 0x78(%rsp), %r12
movq 0x38(%r12), %rax
movq -0x8(%rax,%r15,8), %rbx
addq %rbp, %rbx
movq (%rsp), %rdi
movq %r14, %rsi
callq 0x26b4d
movq %rbx, %rdi
movq %r13, %rsi
movq %rax, %rdx
movsd 0x18(%rsp), %xmm0
callq 0x26b08
movq 0x38(%r12), %rax
movq -0x8(%rax,%r15,8), %rbx
addq %rbp, %rbx
movq (%rax,%r15,8), %r12
addq %rbp, %r12
movq (%rsp), %rdi
movq %r14, %rsi
callq 0x26b4d
movq %rbx, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r13, %rcx
movq %rax, %r8
movsd 0x8(%rsp), %xmm0
callq 0x269b8
movq 0x78(%rsp), %rax
movq 0x38(%rax), %rax
movq (%rax,%r15,8), %rbx
addq %rbp, %rbx
movq 0x80(%rsp), %rax
movq 0x28(%rax), %r12
addq %rbp, %r12
movq (%rsp), %rdi
movq %r14, %rsi
movq (%rsp), %r14
callq 0x26b4d
movq %rbx, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq 0x30(%rsp), %r12
movq %r13, %rcx
movq %rax, %r8
callq 0x2675e
decq %r15
movq 0x10(%rsp), %rax
jmp 0x18626