// File: /workspace/github_cpp_makefile_star2_O3/mouda[P]LTE_random_access-simulate/alglibinternal.cpp
// Function: alglib_impl::ftbase_fftirltrec(alglib_impl::ae_vector*, long, long, alglib_impl::ae_vector*, long, long, long, long, alglib_impl::ae_state*)
static void ftbase_fftirltrec(/* 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 m1;
    ae_int_t n1;


    if( m==0||n==0 )
    {
        return;
    }
    if( ae_maxint(m, n, _state)<=8 )
    {
        for(i=0; i<=m-1; i++)
        {
            idx1 = bstart+i;
            idx2 = astart+i*astride;
            for(j=0; j<=n-1; j++)
            {
                b->ptr.p_double[idx1] = a->ptr.p_double[idx2];
                idx1 = idx1+bstride;
                idx2 = idx2+1;
            }
        }
        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_fftirltrec(a, astart, astride, b, bstart, bstride, m, n1, _state);
        ftbase_fftirltrec(a, astart+n1, astride, b, bstart+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_fftirltrec(a, astart, astride, b, bstart, bstride, m1, n, _state);
        ftbase_fftirltrec(a, astart+m1*astride, astride, b, bstart+m1, bstride, m-m1, n, _state);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %r8, 0x18(%rsp)
movq %rcx, %rbp
movq %rdx, 0x20(%rsp)
movq %rsi, 0x10(%rsp)
movq 0x88(%rsp), %r14
movq 0x80(%rsp), %r13
testq %r13, %r13
sete %al
testq %r14, %r14
sete %cl
orb %al, %cl
jne 0x24dcd
movq %rdi, %r15
movq 0x90(%rsp), %r12
movq %rdi, 0x38(%rsp)
movq %rbp, 0x30(%rsp)
movq %r9, 0x28(%rsp)
movq %r13, 0x40(%rsp)
movq %r13, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x25ec6
cmpq $0x8, %rax
jle 0x24d7e
cmpq %r13, %r14
jle 0x24cc9
movq %r12, %rbx
movq %r14, %r12
shrq $0x3f, %r12
addq %r14, %r12
sarq %r12
movq %r14, %rax
subq %r12, %rax
cmpq $0x8, %rax
jl 0x24c32
leaq 0x7(%r12), %rcx
testq %r12, %r12
cmovnsq %r12, %rcx
andq $-0x8, %rcx
movq %r12, %rax
subq %rcx, %rax
je 0x24c32
subq %rax, %r12
addq $0x8, %r12
movq %r14, %rax
subq %r12, %rax
xorl %edi, %edi
testq %rax, %rax
setg %dil
leaq 0x11577(%rip), %rsi     # 0x361bf
movq %rbx, %rdx
callq 0x2510e
subq $0x8, %rsp
movq %r15, %rdi
movq %r14, 0x10(%rsp)
movq 0x18(%rsp), %r14
movq %r14, %rsi
movq 0x28(%rsp), %rdx
movq %rbp, %rcx
movq 0x20(%rsp), %r13
movq %r13, %r8
movq 0x30(%rsp), %rbp
movq %rbp, %r9
pushq %rbx
pushq %r12
movq 0x58(%rsp), %r15
pushq %r15
callq 0x24b73
addq $0x20, %rsp
addq %r12, %r14
movq %r14, 0x10(%rsp)
movq 0x8(%rsp), %r14
movq %r12, %rax
imulq %rbp, %rax
addq %rax, %r13
movq %r13, 0x18(%rsp)
movq %r15, %r13
movq 0x30(%rsp), %rbp
movq 0x38(%rsp), %r15
subq %r12, %r14
movq %rbx, %r12
jne 0x24bd6
jmp 0x24dcd
movq %r13, %rsi
shrq $0x3f, %rsi
addq %r13, %rsi
sarq %rsi
movq %r13, %rax
subq %rsi, %rax
cmpq $0x8, %rax
jl 0x24d0a
leaq 0x7(%rsi), %rdx
testq %rsi, %rsi
cmovnsq %rsi, %rdx
andq $-0x8, %rdx
movq %rsi, %rcx
subq %rdx, %rcx
je 0x24d0a
subq %rcx, %rsi
addq $0x8, %rsi
movq %rsi, 0x8(%rsp)
subq %rsi, %r13
jmp 0x24d12
movq %rsi, 0x8(%rsp)
movq %rax, %r13
xorl %edi, %edi
testq %r13, %r13
setg %dil
leaq 0x1149d(%rip), %rsi     # 0x361bf
movq %r12, %rdx
callq 0x2510e
subq $0x8, %rsp
movq %r15, %rdi
movq 0x18(%rsp), %rsi
movq 0x28(%rsp), %rdx
movq %rbp, %rcx
movq 0x20(%rsp), %r8
movq 0x30(%rsp), %r9
pushq %r12
pushq %r14
movq 0x20(%rsp), %rbx
pushq %rbx
callq 0x24b73
addq $0x20, %rsp
testq %r13, %r13
je 0x24dcd
movq %rbx, %rax
imulq 0x20(%rsp), %rax
addq %rax, 0x10(%rsp)
addq %rbx, 0x18(%rsp)
testq %r14, %r14
jne 0x24bd1
jmp 0x24dcd
testq %r13, %r13
movq 0x28(%rsp), %r8
jle 0x24dcd
xorl %eax, %eax
testq %r14, %r14
jle 0x24dc5
movq %rax, %rcx
imulq 0x20(%rsp), %rcx
addq 0x10(%rsp), %rcx
movq 0x18(%rsp), %rdx
addq %rax, %rdx
movq %r14, %rsi
movq 0x28(%r15), %rdi
movsd (%rdi,%rcx,8), %xmm0
movq 0x28(%rbp), %rdi
movsd %xmm0, (%rdi,%rdx,8)
addq %r8, %rdx
incq %rcx
decq %rsi
jne 0x24da8
incq %rax
cmpq %r13, %rax
jne 0x24d8a
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq