// File: 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
movq %rsp, %rbp
subq $0x90, %rsp
movq 0x20(%rbp), %rax
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
cmpq $0x0, 0x10(%rbp)
je 0x3a77d
cmpq $0x0, 0x18(%rbp)
jne 0x3a782
jmp 0x3aa6e
movq 0x10(%rbp), %rdi
movq 0x18(%rbp), %rsi
movq 0x20(%rbp), %rdx
callq 0x3c9f0
cmpq $0x8, %rax
jg 0x3a853
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq 0x10(%rbp), %rcx
subq $0x1, %rcx
cmpq %rcx, %rax
jg 0x3a84e
movq -0x28(%rbp), %rax
addq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq -0x38(%rbp), %rcx
imulq -0x18(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq 0x18(%rbp), %rcx
subq $0x1, %rcx
cmpq %rcx, %rax
jg 0x3a83b
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x50(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x48(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq -0x48(%rbp), %rax
addq -0x30(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x3a7e2
jmp 0x3a83d
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x3a7a5
jmp 0x3aa6e
movq 0x18(%rbp), %rax
cmpq 0x10(%rbp), %rax
jle 0x3a96a
movq 0x18(%rbp), %rax
movl $0x2, %ecx
cqto
idivq %rcx
movq %rax, -0x60(%rbp)
movq 0x18(%rbp), %rax
subq -0x60(%rbp), %rax
cmpq $0x8, %rax
jl 0x3a8be
movq -0x60(%rbp), %rax
movl $0x8, %ecx
cqto
idivq %rcx
cmpq $0x0, %rdx
je 0x3a8be
movq -0x60(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x60(%rbp), %rax
movl $0x8, %ecx
cqto
idivq %rcx
movq -0x68(%rbp), %rax
movl $0x8, %ecx
subq %rdx, %rcx
addq %rcx, %rax
movq %rax, -0x60(%rbp)
movq 0x18(%rbp), %rax
subq -0x60(%rbp), %rax
cmpq $0x0, %rax
setg %al
movq 0x20(%rbp), %rdx
movzbl %al, %edi
andl $0x1, %edi
leaq 0x1d62d(%rip), %rsi     # 0x57f0b
callq 0x3b240
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %r8
movq -0x30(%rbp), %r9
movq 0x10(%rbp), %r11
movq -0x60(%rbp), %r10
movq 0x20(%rbp), %rax
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x3a740
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq -0x60(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %r8
movq -0x60(%rbp), %rax
imulq -0x30(%rbp), %rax
addq %rax, %r8
movq -0x30(%rbp), %r9
movq 0x10(%rbp), %r11
movq 0x18(%rbp), %r10
subq -0x60(%rbp), %r10
movq 0x20(%rbp), %rax
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x3a740
jmp 0x3aa6e
movq 0x10(%rbp), %rax
movl $0x2, %ecx
cqto
idivq %rcx
movq %rax, -0x58(%rbp)
movq 0x10(%rbp), %rax
subq -0x58(%rbp), %rax
cmpq $0x8, %rax
jl 0x3a9c7
movq -0x58(%rbp), %rax
movl $0x8, %ecx
cqto
idivq %rcx
cmpq $0x0, %rdx
je 0x3a9c7
movq -0x58(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x58(%rbp), %rax
movl $0x8, %ecx
cqto
idivq %rcx
movq -0x70(%rbp), %rax
movl $0x8, %ecx
subq %rdx, %rcx
addq %rcx, %rax
movq %rax, -0x58(%rbp)
movq 0x10(%rbp), %rax
subq -0x58(%rbp), %rax
cmpq $0x0, %rax
setg %al
movq 0x20(%rbp), %rdx
movzbl %al, %edi
andl $0x1, %edi
leaq 0x1d524(%rip), %rsi     # 0x57f0b
callq 0x3b240
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %r8
movq -0x30(%rbp), %r9
movq -0x58(%rbp), %r11
movq 0x18(%rbp), %r10
movq 0x20(%rbp), %rax
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x3a740
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x58(%rbp), %rax
imulq -0x18(%rbp), %rax
addq %rax, %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %r8
addq -0x58(%rbp), %r8
movq -0x30(%rbp), %r9
movq 0x10(%rbp), %r11
subq -0x58(%rbp), %r11
movq 0x18(%rbp), %r10
movq 0x20(%rbp), %rax
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x3a740
addq $0x90, %rsp
popq %rbp
retq
nopw (%rax,%rax)