// File: /workspace/github_cpp_makefile_star2_O1/mouda[P]LTE_random_access-simulate/alglibinternal.cpp
// Function: alglib_impl::ftbase_ftbaseprecomputeplanrec(alglib_impl::ftplan*, long, long, alglib_impl::ae_state*)
static void ftbase_ftbaseprecomputeplanrec(ftplan* plan,
     ae_int_t entryoffset,
     ae_int_t stackptr,
     ae_state *_state)
{
    ae_frame _frame_block;
    ae_int_t i;
    ae_int_t n1;
    ae_int_t n2;
    ae_int_t n;
    ae_int_t m;
    ae_int_t offs;
    double v;
    ae_vector emptyarray;
    double bx;
    double by;

    ae_frame_make(_state, &_frame_block);
    ae_vector_init(&emptyarray, 0, DT_REAL, _state, ae_true);

    if( (plan->plan.ptr.p_int[entryoffset+3]==ftbase_fftcooleytukeyplan||plan->plan.ptr.p_int[entryoffset+3]==ftbase_fftrealcooleytukeyplan)||plan->plan.ptr.p_int[entryoffset+3]==ftbase_fhtcooleytukeyplan )
    {
        ftbase_ftbaseprecomputeplanrec(plan, plan->plan.ptr.p_int[entryoffset+5], stackptr, _state);
        ftbase_ftbaseprecomputeplanrec(plan, plan->plan.ptr.p_int[entryoffset+6], stackptr, _state);
        ae_frame_leave(_state);
        return;
    }
    if( plan->plan.ptr.p_int[entryoffset+3]==ftbase_fftcodeletplan||plan->plan.ptr.p_int[entryoffset+3]==ftbase_fhtcodeletplan )
    {
        n1 = plan->plan.ptr.p_int[entryoffset+1];
        n2 = plan->plan.ptr.p_int[entryoffset+2];
        n = n1*n2;
        if( n==3 )
        {
            offs = plan->plan.ptr.p_int[entryoffset+7];
            plan->precomputed.ptr.p_double[offs+0] = ae_cos(2*ae_pi/3, _state)-1;
            plan->precomputed.ptr.p_double[offs+1] = ae_sin(2*ae_pi/3, _state);
            ae_frame_leave(_state);
            return;
        }
        if( n==5 )
        {
            offs = plan->plan.ptr.p_int[entryoffset+7];
            v = 2*ae_pi/5;
            plan->precomputed.ptr.p_double[offs+0] = (ae_cos(v, _state)+ae_cos(2*v, _state))/2-1;
            plan->precomputed.ptr.p_double[offs+1] = (ae_cos(v, _state)-ae_cos(2*v, _state))/2;
            plan->precomputed.ptr.p_double[offs+2] = -ae_sin(v, _state);
            plan->precomputed.ptr.p_double[offs+3] = -(ae_sin(v, _state)+ae_sin(2*v, _state));
            plan->precomputed.ptr.p_double[offs+4] = ae_sin(v, _state)-ae_sin(2*v, _state);
            ae_frame_leave(_state);
            return;
        }
    }
    if( plan->plan.ptr.p_int[entryoffset+3]==ftbase_fftbluesteinplan )
    {
        ftbase_ftbaseprecomputeplanrec(plan, plan->plan.ptr.p_int[entryoffset+5], stackptr, _state);
        n = plan->plan.ptr.p_int[entryoffset+1];
        m = plan->plan.ptr.p_int[entryoffset+4];
        offs = plan->plan.ptr.p_int[entryoffset+7];
        for(i=0; i<=2*m-1; i++)
        {
            plan->precomputed.ptr.p_double[offs+i] = 0;
        }
        for(i=0; i<=n-1; i++)
        {
            bx = ae_cos(ae_pi*ae_sqr(i, _state)/n, _state);
            by = ae_sin(ae_pi*ae_sqr(i, _state)/n, _state);
            plan->precomputed.ptr.p_double[offs+2*i+0] = bx;
            plan->precomputed.ptr.p_double[offs+2*i+1] = by;
            plan->precomputed.ptr.p_double[offs+2*m+2*i+0] = bx;
            plan->precomputed.ptr.p_double[offs+2*m+2*i+1] = by;
            if( i>0 )
            {
                plan->precomputed.ptr.p_double[offs+2*(m-i)+0] = bx;
                plan->precomputed.ptr.p_double[offs+2*(m-i)+1] = by;
            }
        }
        ftbaseexecuteplanrec(&plan->precomputed, offs, plan, plan->plan.ptr.p_int[entryoffset+5], stackptr, _state);
        ae_frame_leave(_state);
        return;
    }
    ae_frame_leave(_state);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
leaq 0x40(%rsp), %rsi
movq %rdx, %rdi
callq 0x2575d
leaq 0x58(%rsp), %rdi
movl $0x3, %edx
xorl %esi, %esi
movq %rbx, 0x8(%rsp)
movq %rbx, %rcx
movl $0x1, %r8d
callq 0x25900
movq 0x28(%r14), %rax
movq 0x18(%rax,%r15,8), %rcx
cmpq $0x5, %rcx
ja 0x22f0a
movl $0x29, %edx
btq %rcx, %rdx
jae 0x22bc5
movq 0x28(%rax,%r15,8), %rsi
movq %r14, %rdi
movq 0x8(%rsp), %rbx
movq %rbx, %rdx
callq 0x22b33
movq 0x28(%r14), %rax
movq 0x30(%rax,%r15,8), %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x22b33
jmp 0x22f0a
movl $0x14, %edx
btq %rcx, %rdx
jae 0x22d6e
movq 0x10(%rax,%r15,8), %rdx
imulq 0x8(%rax,%r15,8), %rdx
cmpq $0x5, %rdx
je 0x22c39
cmpq $0x3, %rdx
jne 0x22d64
movq 0x38(%rax,%r15,8), %rbx
movsd 0x13d54(%rip), %xmm0    # 0x36950
movq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x266a9
addsd 0x115bf(%rip), %xmm0    # 0x341d0
movq 0x58(%r14), %rax
movsd %xmm0, (%rax,%rbx,8)
movsd 0x13d2e(%rip), %xmm0    # 0x36950
movq %r15, %rdi
callq 0x266a4
movq 0x58(%r14), %rax
movsd %xmm0, 0x8(%rax,%rbx,8)
jmp 0x22f0a
movq 0x38(%rax,%r15,8), %r15
movsd 0x13cfa(%rip), %xmm0    # 0x36940
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x266a9
movsd %xmm0, (%rsp)
movsd 0x13ce8(%rip), %xmm0    # 0x36948
movq %rbx, %rdi
callq 0x266a9
addsd (%rsp), %xmm0
mulsd 0x117f3(%rip), %xmm0    # 0x34468
addsd 0x11553(%rip), %xmm0    # 0x341d0
movq 0x58(%r14), %rax
movsd %xmm0, (%rax,%r15,8)
movsd 0x13cb1(%rip), %xmm0    # 0x36940
movq %rbx, %rdi
callq 0x266a9
movsd %xmm0, (%rsp)
movsd 0x13ca4(%rip), %xmm0    # 0x36948
movq %rbx, %rdi
callq 0x266a9
movsd (%rsp), %xmm1
subsd %xmm0, %xmm1
mulsd 0x117ab(%rip), %xmm1    # 0x34468
movq 0x58(%r14), %rax
movsd %xmm1, 0x8(%rax,%r15,8)
movsd 0x13c70(%rip), %xmm0    # 0x36940
movq %rbx, %rdi
callq 0x266a4
xorps 0x11501(%rip), %xmm0    # 0x341e0
movq 0x58(%r14), %rax
movlps %xmm0, 0x10(%rax,%r15,8)
movsd 0x13c4f(%rip), %xmm0    # 0x36940
movq %rbx, %rdi
callq 0x266a4
movsd %xmm0, (%rsp)
movsd 0x13c42(%rip), %xmm0    # 0x36948
movq %rbx, %rdi
callq 0x266a4
addsd (%rsp), %xmm0
xorpd 0x114c5(%rip), %xmm0    # 0x341e0
movq 0x58(%r14), %rax
movlpd %xmm0, 0x18(%rax,%r15,8)
movsd 0x13c12(%rip), %xmm0    # 0x36940
movq %rbx, %rdi
callq 0x266a4
movsd %xmm0, (%rsp)
movsd 0x13c05(%rip), %xmm0    # 0x36948
movq %rbx, %rdi
callq 0x266a4
movsd (%rsp), %xmm1
subsd %xmm0, %xmm1
movq 0x58(%r14), %rax
movsd %xmm1, 0x20(%rax,%r15,8)
jmp 0x22f0a
cmpq $0x1, %rcx
jne 0x22f0a
movq 0x28(%rax,%r15,8), %rsi
movq %r14, %rdi
movq 0x8(%rsp), %rdx
callq 0x22b33
movq 0x28(%r14), %rax
movq 0x8(%rax,%r15,8), %rcx
movq %rcx, 0x18(%rsp)
movq 0x20(%rax,%r15,8), %r13
movq %r15, 0x20(%rsp)
movq 0x38(%rax,%r15,8), %rax
movq %rax, 0x10(%rsp)
testq %r13, %r13
jle 0x22dd5
leaq (,%r13,2), %rcx
cmpq $0x2, %rcx
movl $0x1, %eax
cmovgeq %rcx, %rax
movq 0x10(%rsp), %rcx
movq 0x58(%r14), %rdx
movq $0x0, (%rdx,%rcx,8)
incq %rcx
decq %rax
jne 0x22dc1
cmpq $0x0, 0x18(%rsp)
jle 0x22ee3
cvtsi2sdq 0x18(%rsp), %xmm0
movsd %xmm0, (%rsp)
movq 0x10(%rsp), %rax
leaq (,%rax,8), %r12
shlq $0x4, %r13
xorl %r15d, %r15d
movq %r13, %rbp
xorl %ebx, %ebx
movq %r14, 0x28(%rsp)
xorps %xmm0, %xmm0
cvtsi2sd %rbx, %xmm0
movsd %xmm0, 0x38(%rsp)
movq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x26588
movsd 0x11642(%rip), %xmm1    # 0x34470
mulsd %xmm1, %xmm0
divsd (%rsp), %xmm0
movq %r14, %rdi
callq 0x266a9
movsd %xmm0, 0x30(%rsp)
movsd 0x38(%rsp), %xmm0
movq %r14, %rdi
callq 0x26588
mulsd 0x11615(%rip), %xmm0    # 0x34470
divsd (%rsp), %xmm0
movq %r14, %rdi
movq 0x28(%rsp), %r14
callq 0x266a4
movsd 0x30(%rsp), %xmm1
movq 0x58(%r14), %rax
addq %r12, %rax
movsd %xmm1, (%r15,%rax)
movq 0x58(%r14), %rax
addq %r12, %rax
movsd %xmm0, 0x8(%r15,%rax)
movq 0x58(%r14), %rax
addq %r12, %rax
movsd %xmm1, (%r13,%rax)
movq 0x58(%r14), %rax
addq %r12, %rax
movsd %xmm0, 0x8(%r13,%rax)
testq %rbx, %rbx
je 0x22ec9
movq 0x58(%r14), %rax
addq %r12, %rax
movsd %xmm1, (%rbp,%rax)
movq 0x58(%r14), %rax
addq %r12, %rax
movsd %xmm0, 0x8(%rbp,%rax)
incq %rbx
addq $-0x10, %rbp
addq $0x10, %r15
addq $0x10, %r13
cmpq %rbx, 0x18(%rsp)
jne 0x22e0b
leaq 0x30(%r14), %rdi
movq 0x28(%r14), %rax
movq 0x20(%rsp), %rcx
movq 0x28(%rax,%rcx,8), %rcx
movq 0x10(%rsp), %rsi
movq %r14, %rdx
xorl %r8d, %r8d
movq 0x8(%rsp), %r9
callq 0x231b8
movq 0x8(%rsp), %rdi
callq 0x256fa
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq