// File: /workspace/github_cpp_makefile_star2_O3/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, %r12
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x40(%rsp), %rsi
movq %rdx, %rdi
callq 0x25055
leaq 0x58(%rsp), %rdi
movl $0x3, %edx
xorl %esi, %esi
movq %r12, %rcx
movl $0x1, %r8d
callq 0x251ec
movq 0x28(%r14), %rax
movq 0x18(%rax,%rbx,8), %rcx
cmpq $0x5, %rcx
ja 0x227e5
movl $0x29, %edx
btq %rcx, %rdx
jae 0x224ae
movq 0x28(%rax,%rbx,8), %rsi
movq %r14, %rdi
movq %r12, %rdx
callq 0x22426
movq 0x28(%r14), %rax
movq 0x30(%rax,%rbx,8), %rsi
movq %r14, %rdi
movq %r12, %rdx
callq 0x22426
jmp 0x227e5
movl $0x14, %edx
btq %rcx, %rdx
jae 0x2251d
movq 0x10(%rax,%rbx,8), %rcx
imulq 0x8(%rax,%rbx,8), %rcx
cmpq $0x5, %rcx
je 0x226c4
cmpq $0x3, %rcx
jne 0x227e5
movq 0x38(%rax,%rbx,8), %rbx
movsd 0x1360b(%rip), %xmm0    # 0x35af0
movq %r12, %rdi
callq 0x25f64
addsd 0x10d13(%rip), %xmm0    # 0x33208
movq 0x58(%r14), %rax
movsd %xmm0, (%rax,%rbx,8)
movsd 0x135ea(%rip), %xmm0    # 0x35af0
movq %r12, %rdi
callq 0x25f5f
movq 0x58(%r14), %rax
movsd %xmm0, 0x8(%rax,%rbx,8)
jmp 0x227e5
movq 0x28(%rax,%rbx,8), %rsi
movq %r14, %rdi
movq %r12, 0x18(%rsp)
movq %r12, %rdx
callq 0x22426
movq 0x28(%r14), %rax
movq 0x8(%rax,%rbx,8), %rcx
movq %rcx, 0x10(%rsp)
movq 0x20(%rax,%rbx,8), %r13
movq %rbx, 0x20(%rsp)
movq 0x38(%rax,%rbx,8), %rax
movq %rax, 0x8(%rsp)
testq %r13, %r13
jle 0x22587
leaq (,%r13,2), %rcx
cmpq $0x2, %rcx
movl $0x1, %eax
cmovgeq %rcx, %rax
movq 0x8(%rsp), %rcx
movq 0x58(%r14), %rdx
movq $0x0, (%rdx,%rcx,8)
incq %rcx
decq %rax
jne 0x22573
cmpq $0x0, 0x10(%rsp)
jle 0x22695
cvtsi2sdq 0x10(%rsp), %xmm0
movsd %xmm0, (%rsp)
movq 0x8(%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 0x18(%rsp), %r14
movq %r14, %rdi
callq 0x25e43
movsd 0x10eb0(%rip), %xmm1    # 0x33490
mulsd %xmm1, %xmm0
divsd (%rsp), %xmm0
movq %r14, %rdi
callq 0x25f64
movsd %xmm0, 0x30(%rsp)
movsd 0x38(%rsp), %xmm0
movq %r14, %rdi
callq 0x25e43
mulsd 0x10e83(%rip), %xmm0    # 0x33490
divsd (%rsp), %xmm0
movq %r14, %rdi
movq 0x28(%rsp), %r14
callq 0x25f5f
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 0x2267b
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, 0x10(%rsp)
jne 0x225bd
leaq 0x30(%r14), %rdi
movq 0x28(%r14), %rax
movq 0x20(%rsp), %rcx
movq 0x28(%rax,%rcx,8), %rcx
movq 0x8(%rsp), %rsi
movq %r14, %rdx
xorl %r8d, %r8d
movq 0x18(%rsp), %r12
movq %r12, %r9
callq 0x22a91
jmp 0x227e5
movq 0x38(%rax,%rbx,8), %r15
movsd 0x1340f(%rip), %xmm0    # 0x35ae0
movq %r12, %rdi
callq 0x25f64
movsd %xmm0, (%rsp)
movsd 0x13402(%rip), %xmm0    # 0x35ae8
movq %r12, %rdi
callq 0x25f64
addsd (%rsp), %xmm0
mulsd 0x10d8d(%rip), %xmm0    # 0x33488
addsd 0x10b05(%rip), %xmm0    # 0x33208
movq 0x58(%r14), %rax
movsd %xmm0, (%rax,%r15,8)
movsd 0x133cb(%rip), %xmm0    # 0x35ae0
movq %r12, %rdi
callq 0x25f64
movsd %xmm0, (%rsp)
movsd 0x133be(%rip), %xmm0    # 0x35ae8
movq %r12, %rdi
callq 0x25f64
movsd (%rsp), %xmm1
subsd %xmm0, %xmm1
mulsd 0x10d45(%rip), %xmm1    # 0x33488
movq 0x58(%r14), %rax
movsd %xmm1, 0x8(%rax,%r15,8)
movsd 0x1338a(%rip), %xmm0    # 0x35ae0
movq %r12, %rdi
callq 0x25f5f
xorps 0x10a4b(%rip), %xmm0    # 0x331b0
movq 0x58(%r14), %rax
movlps %xmm0, 0x10(%rax,%r15,8)
movsd 0x13369(%rip), %xmm0    # 0x35ae0
movq %r12, %rdi
callq 0x25f5f
movsd %xmm0, (%rsp)
movsd 0x1335c(%rip), %xmm0    # 0x35ae8
movq %r12, %rdi
callq 0x25f5f
addsd (%rsp), %xmm0
xorpd 0x10a0f(%rip), %xmm0    # 0x331b0
movq 0x58(%r14), %rax
movlpd %xmm0, 0x18(%rax,%r15,8)
movsd 0x1332c(%rip), %xmm0    # 0x35ae0
movq %r12, %rdi
callq 0x25f5f
movsd %xmm0, (%rsp)
movsd 0x1331f(%rip), %xmm0    # 0x35ae8
movq %r12, %rdi
callq 0x25f5f
movsd (%rsp), %xmm1
subsd %xmm0, %xmm1
movq 0x58(%r14), %rax
movsd %xmm1, 0x20(%rax,%r15,8)
movq %r12, %rdi
callq 0x24ff2
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq