// File: /workspace/github_cpp_makefile_star2_O3/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 $0x38, %rsp
movq %rcx, %r15
movq %rdx, 0x8(%rsp)
movq 0x78(%rsp), %r12
movq 0x70(%rsp), %rbx
testq %rbx, %rbx
sete %al
testq %r12, %r12
sete %cl
orb %al, %cl
jne 0x24b64
movq %rdi, %rbp
movq 0x80(%rsp), %rdx
movq %r9, 0x18(%rsp)
movq %rbx, 0x20(%rsp)
movq %rsi, %r14
movq %r8, %r13
movq %rbx, %rdi
movq %r12, %rsi
callq 0x25ec6
cmpq $0x8, %rax
jle 0x24aef
cmpq %rbx, %r12
movq %r12, 0x30(%rsp)
movq %r14, 0x28(%rsp)
jle 0x24a0f
movq %r12, %rax
shrq $0x3f, %r12
addq %rax, %r12
sarq %r12
movq %rax, %rbx
subq %r12, %rax
cmpq $0x8, %rax
jl 0x24982
leaq 0x7(%r12), %rcx
testq %r12, %r12
cmovnsq %r12, %rcx
andq $-0x8, %rcx
movq %r12, %rax
subq %rcx, %rax
je 0x24982
subq %rax, %r12
addq $0x8, %r12
movq %rbx, %rax
subq %r12, %rax
xorl %edi, %edi
testq %rax, %rax
setg %dil
leaq 0x11827(%rip), %rsi     # 0x361bf
movq 0x80(%rsp), %rdx
movq %rdx, %rbx
callq 0x2510e
subq $0x8, %rsp
movq %rbp, %rdi
movq %r14, %rsi
movq 0x10(%rsp), %rdx
movq %r15, %rcx
movq %r13, %r14
movq %r13, %r8
movq 0x20(%rsp), %r13
movq %r13, %r9
pushq %rbx
pushq %r12
movq 0x38(%rsp), %rbx
pushq %rbx
callq 0x248d3
movq 0x48(%rsp), %rsi
movq %r14, %r8
addq $0x20, %rsp
leaq (%r12,%r12), %rax
imulq %r13, %rax
addq %rax, %r8
movq 0x80(%rsp), %rdx
leaq (%rsi,%r12,2), %rsi
movq 0x30(%rsp), %rax
subq %r12, %rax
movq %rax, %r12
jne 0x2491c
jmp 0x24b64
movq %rbx, %rsi
shrq $0x3f, %rsi
addq %rbx, %rsi
sarq %rsi
movq %rbx, %rax
subq %rsi, %rax
cmpq $0x8, %rax
jl 0x24a53
leaq 0x7(%rsi), %rdx
testq %rsi, %rsi
cmovnsq %rsi, %rdx
andq $-0x8, %rdx
movq %rsi, %rcx
subq %rdx, %rcx
je 0x24a53
movq %rbx, %rax
subq %rcx, %rsi
addq $0x8, %rsi
movq %rsi, 0x10(%rsp)
subq %rsi, %rax
jmp 0x24a58
movq %rsi, 0x10(%rsp)
movq %rax, 0x20(%rsp)
xorl %edi, %edi
testq %rax, %rax
setg %dil
leaq 0x11752(%rip), %rsi     # 0x361bf
movq 0x80(%rsp), %rbx
movq %rbx, %rdx
callq 0x2510e
subq $0x8, %rsp
movq %rbp, %rdi
movq %r14, %rsi
movq 0x10(%rsp), %rdx
movq %r15, %rcx
movq %r13, %r8
movq 0x20(%rsp), %r9
pushq %rbx
movq 0x40(%rsp), %rbx
pushq %rbx
movq 0x28(%rsp), %r14
pushq %r14
callq 0x248d3
movq 0x48(%rsp), %rsi
movq %rbx, %r12
addq $0x20, %rsp
movq 0x20(%rsp), %rbx
testq %rbx, %rbx
je 0x24b64
leaq (%r14,%r14), %rax
imulq 0x8(%rsp), %rax
addq %rax, %rsi
movq 0x80(%rsp), %rdx
leaq (,%r14,2), %r8
addq %r13, %r8
testq %r12, %r12
jne 0x24917
jmp 0x24b64
testq %rbx, %rbx
movq 0x18(%rsp), %r10
jle 0x24b64
movq %r13, %r8
movq %r14, %r9
shlq $0x3, %r9
shlq $0x4, 0x8(%rsp)
shlq $0x3, %r8
shlq $0x4, %r10
xorl %eax, %eax
testq %r12, %r12
jle 0x24b53
movq %r12, %rcx
movq %r8, %rdx
movq %r9, %rsi
movq 0x28(%rbp), %rdi
movsd (%rdi,%rsi), %xmm0
movq 0x28(%r15), %rdi
movsd %xmm0, (%rdi,%rdx)
movq 0x28(%rbp), %rdi
movsd 0x8(%rdi,%rsi), %xmm0
movq 0x28(%r15), %rdi
movsd %xmm0, 0x8(%rdi,%rdx)
addq $0x10, %rsi
addq %r10, %rdx
decq %rcx
jne 0x24b21
incq %rax
addq 0x8(%rsp), %r9
addq $0x10, %r8
cmpq %rbx, %rax
jne 0x24b13
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq