// File: /workspace/github_cpp_makefile_star2_O2/mouda[P]LTE_random_access-simulate/alglibinternal.cpp
// Function: alglib_impl::ftbase_ffticltrec(alglib_impl::ae_vector*, long, long, alglib_impl::ae_vector*, long, long, long, long, alglib_impl::ae_state*)
static void ftbase_ffticltrec(/* Real    */ ae_vector* a,
     ae_int_t astart,
     ae_int_t astride,
     /* Real    */ ae_vector* b,
     ae_int_t bstart,
     ae_int_t bstride,
     ae_int_t m,
     ae_int_t n,
     ae_state *_state)
{
    ae_int_t i;
    ae_int_t j;
    ae_int_t idx1;
    ae_int_t idx2;
    ae_int_t m2;
    ae_int_t m1;
    ae_int_t n1;


    if( m==0||n==0 )
    {
        return;
    }
    if( ae_maxint(m, n, _state)<=8 )
    {
        m2 = 2*bstride;
        for(i=0; i<=m-1; i++)
        {
            idx1 = bstart+2*i;
            idx2 = astart+2*i*astride;
            for(j=0; j<=n-1; j++)
            {
                b->ptr.p_double[idx1+0] = a->ptr.p_double[idx2+0];
                b->ptr.p_double[idx1+1] = a->ptr.p_double[idx2+1];
                idx1 = idx1+m2;
                idx2 = idx2+2;
            }
        }
        return;
    }
    if( n>m )
    {
        
        /*
         * New partition:
         *
         * "A^T -> B" becomes "(A1 A2)^T -> ( B1 )
         *                                  ( B2 )
         */
        n1 = n/2;
        if( n-n1>=8&&n1%8!=0 )
        {
            n1 = n1+(8-n1%8);
        }
        ae_assert(n-n1>0, "Assertion failed", _state);
        ftbase_ffticltrec(a, astart, astride, b, bstart, bstride, m, n1, _state);
        ftbase_ffticltrec(a, astart+2*n1, astride, b, bstart+2*n1*bstride, bstride, m, n-n1, _state);
    }
    else
    {
        
        /*
         * New partition:
         *
         * "A^T -> B" becomes "( A1 )^T -> ( B1 B2 )
         *                     ( A2 )
         */
        m1 = m/2;
        if( m-m1>=8&&m1%8!=0 )
        {
            m1 = m1+(8-m1%8);
        }
        ae_assert(m-m1>0, "Assertion failed", _state);
        ftbase_ffticltrec(a, astart, astride, b, bstart, bstride, m1, n, _state);
        ftbase_ffticltrec(a, astart+2*m1*astride, astride, b, bstart+2*m1, bstride, m-m1, n, _state);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, %rbx
movq %r8, %r14
movq %rcx, %r15
movq %rdx, (%rsp)
movq %rdi, %rbp
movq 0x68(%rsp), %r13
movq 0x60(%rsp), %r12
testq %r12, %r12
je 0x233a5
movq %r12, 0x20(%rsp)
testq %r13, %r13
je 0x233a5
movq %rsi, 0x8(%rsp)
movq %r12, %rdi
movq %r13, %rsi
movq 0x70(%rsp), %rdx
callq 0x244a0
cmpq $0x8, %rax
jle 0x2332f
movq %r14, 0x18(%rsp)
cmpq %r12, %r13
jle 0x23287
movq %r13, %rax
cqto
pushq $0x2
popq %rcx
idivq %rcx
movq %rax, %r14
movq %r13, %rsi
subq %rax, %rsi
cmpq $0x8, %rsi
jl 0x23212
movq %r14, %rax
cqto
pushq $0x8
popq %rcx
idivq %rcx
testq %rdx, %rdx
je 0x23212
subq %rdx, %r14
addq $0x8, %r14
subq %r14, %r13
movq %r13, %rsi
movq %rsi, 0x10(%rsp)
xorl %edi, %edi
testq %rsi, %rsi
setg %dil
leaq 0xff88(%rip), %rsi      # 0x331af
movq 0x70(%rsp), %r12
movq %r12, %rdx
callq 0x238ca
subq $0x8, %rsp
movq %rbp, %rdi
movq 0x10(%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %r15, %rcx
movq 0x20(%rsp), %r13
movq %r13, %r8
movq %rbx, %r9
pushq %r12
pushq %r14
movq 0x38(%rsp), %r12
pushq %r12
callq 0x2316f
movq 0x28(%rsp), %rsi
addq $0x20, %rsp
leaq (%rsi,%r14,2), %rsi
addq %r14, %r14
imulq %rbx, %r14
addq %r14, %r13
movq %r13, %r14
movq 0x10(%rsp), %r13
jmp 0x231a5
movq %r12, %rax
cqto
pushq $0x2
popq %rsi
idivq %rsi
movq %rax, %rdi
movq %r12, %r8
subq %rax, %r8
cmpq $0x8, %r8
jl 0x232be
movq %rdi, %rax
cqto
pushq $0x8
popq %rsi
idivq %rsi
testq %rdx, %rdx
je 0x232be
subq %rdx, %rdi
addq $0x8, %rdi
subq %rdi, %r12
movq %r12, %r8
movq %r8, 0x10(%rsp)
movq %rdi, %r12
xorl %edi, %edi
testq %r8, %r8
setg %dil
leaq 0xfed9(%rip), %rsi      # 0x331af
movq 0x70(%rsp), %rdx
callq 0x238ca
subq $0x8, %rsp
movq %rbp, %rdi
movq 0x10(%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %r15, %rcx
movq 0x20(%rsp), %r14
movq %r14, %r8
movq %rbx, %r9
pushq 0x78(%rsp)
pushq %r13
pushq %r12
callq 0x2316f
movq 0x28(%rsp), %rsi
addq $0x20, %rsp
leaq (%r12,%r12), %rax
imulq (%rsp), %rax
addq %rax, %rsi
leaq (%r14,%r12,2), %r14
movq 0x10(%rsp), %r12
jmp 0x23197
xorl %eax, %eax
testq %r13, %r13
cmovleq %rax, %r13
testq %r12, %r12
cmovleq %rax, %r12
shlq $0x3, %r14
shlq $0x4, %rbx
movq 0x8(%rsp), %r8
shlq $0x3, %r8
shlq $0x4, (%rsp)
cmpq %r12, %rax
je 0x233a5
movq %r8, %rcx
movq %r14, %rdx
movq %r13, %rsi
subq $0x1, %rsi
jb 0x23398
movq 0x28(%rbp), %rdi
movsd (%rdi,%rcx), %xmm0
movq 0x28(%r15), %rdi
movsd %xmm0, (%rdi,%rdx)
movq 0x28(%rbp), %rdi
movsd 0x8(%rdi,%rcx), %xmm0
movq 0x28(%r15), %rdi
movsd %xmm0, 0x8(%rdi,%rdx)
addq %rbx, %rdx
addq $0x10, %rcx
jmp 0x23363
incq %rax
addq $0x10, %r14
addq (%rsp), %r8
jmp 0x23355
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq