// File: /workspace/github_c_makefile_star2_O1/pavel-demin[P]ft8d-c/pffft.c
// Function: pffft_new_setup
PFFFT_Setup *pffft_new_setup(int N, pffft_transform_t transform) {
  PFFFT_Setup *s = (PFFFT_Setup*)malloc(sizeof(PFFFT_Setup));
  int k, m;
  /* unfortunately, the fft size must be a multiple of 16 for complex FFTs
     and 32 for real FFTs -- a lot of stuff would need to be rewritten to
     handle other cases (or maybe just switch to a scalar fft, I don't know..) */
  if (transform == PFFFT_REAL) { assert((N%(2*SIMD_SZ*SIMD_SZ))==0 && N>0); }
  if (transform == PFFFT_COMPLEX) { assert((N%(SIMD_SZ*SIMD_SZ))==0 && N>0); }
  //assert((N % 32) == 0);
  s->N = N;
  s->transform = transform;
  /* nb of complex simd vectors */
  s->Ncvec = (transform == PFFFT_REAL ? N/2 : N)/SIMD_SZ;
  s->data = (v4sf*)pffft_aligned_malloc(2*s->Ncvec * sizeof(v4sf));
  s->e = (float*)s->data;
  s->twiddle = (float*)(s->data + (2*s->Ncvec*(SIMD_SZ-1))/SIMD_SZ);

  if (transform == PFFFT_REAL) {
    for (k=0; k < s->Ncvec; ++k) {
      int i = k/SIMD_SZ;
      int j = k%SIMD_SZ;
      for (m=0; m < SIMD_SZ-1; ++m) {
        float A = -2*M_PI*(m+1)*k / N;
        s->e[(2*(i*3 + m) + 0) * SIMD_SZ + j] = cos(A);
        s->e[(2*(i*3 + m) + 1) * SIMD_SZ + j] = sin(A);
      }
    }
    rffti1_ps(N/SIMD_SZ, s->twiddle, s->ifac);
  } else {
    for (k=0; k < s->Ncvec; ++k) {
      int i = k/SIMD_SZ;
      int j = k%SIMD_SZ;
      for (m=0; m < SIMD_SZ-1; ++m) {
        float A = -2*M_PI*(m+1)*k / N;
        s->e[(2*(i*3 + m) + 0)*SIMD_SZ + j] = cos(A);
        s->e[(2*(i*3 + m) + 1)*SIMD_SZ + j] = sin(A);
      }
    }
    cffti1_ps(N/SIMD_SZ, s->twiddle, s->ifac);
  }

  /* check that N is decomposable with allowed prime factors */
  for (k=0, m=1; k < s->ifac[1]; ++k) { m *= s->ifac[2+k]; }
  if (m != N/SIMD_SZ) {
    pffft_destroy_setup(s); s = 0;
  }

  return s;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movl %esi, %ebp
movl %edi, %r14d
movl $0x60, %edi
callq 0x10f0
testl %ebp, %ebp
jne 0x24f0
testl %r14d, %r14d
jle 0x29fd
movl %r14d, %ecx
andl $0x1f, %ecx
jne 0x29fd
cmpl $0x1, %ebp
jne 0x250a
testl %r14d, %r14d
jle 0x29de
movl %r14d, %ecx
andl $0xf, %ecx
jne 0x29de
movl %r14d, %ebx
shrl $0x1f, %ebx
addl %r14d, %ebx
sarl %ebx
testl %ebp, %ebp
movl %r14d, (%rax)
movl %ebp, 0x44(%rax)
movq %r14, 0x8(%rsp)
cmovnel %r14d, %ebx
leal 0x3(%rbx), %ecx
testl %ebx, %ebx
cmovnsl %ebx, %ecx
sarl $0x2, %ecx
movq %rax, 0x40(%rsp)
movl %ecx, 0x4(%rax)
movq %rcx, 0x48(%rsp)
leal (%rcx,%rcx), %r14d
movslq %r14d, %rdi
shlq $0x4, %rdi
addq $0x40, %rdi
callq 0x10f0
testq %rax, %rax
je 0x2569
movq %rax, %r12
andq $-0x40, %r12
movq %rax, 0x38(%r12)
addq $0x40, %r12
jmp 0x256c
xorl %r12d, %r12d
leal (%r14,%r14,2), %eax
leal (%r14,%r14,2), %ecx
addl $0x3, %ecx
testl %eax, %eax
cmovnsl %eax, %ecx
sarl $0x2, %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
leaq (%r12,%rcx), %rdx
movq 0x40(%rsp), %rax
movq %r12, 0x48(%rax)
movq %r12, 0x50(%rax)
movq %rdx, 0x58(%rax)
testl %ebp, %ebp
je 0x26d9
movq %rdx, 0x58(%rsp)
cmpl $0x4, %ebx
jl 0x26b1
movabsq $0x800000000, %rbp      # imm = 0x800000000
cvtsi2sdl 0x8(%rsp), %xmm1
xorl %eax, %eax
xorpd %xmm2, %xmm2
movsd 0x5af1(%rip), %xmm3     # 0x80c0
xorl %esi, %esi
movsd %xmm1, 0x20(%rsp)
movq %rax, 0x10(%rsp)
shrq $0x2, %rax
movq %rax, %rcx
movabsq $0x1800000000, %rdx     # imm = 0x1800000000
imulq %rdx, %rcx
movl %esi, 0x18(%rsp)
movl %esi, %r13d
andl $0x3, %r13d
shlq $0x5, %rax
leaq (%rax,%rax,2), %rax
leaq (%rax,%r13,4), %r14
shlq $0x20, %r13
addq %rcx, %r13
addq %r12, %r14
movq $-0x60, %r15
movl $0x1, %ebx
movsd %xmm2, 0x28(%rsp)
xorps %xmm0, %xmm0
cvtsi2sd %ebx, %xmm0
mulsd %xmm3, %xmm0
mulsd %xmm2, %xmm0
divsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x30(%rsp)
callq 0x10b0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x60(%r14,%r15)
movsd 0x30(%rsp), %xmm0
callq 0x1120
movsd 0x5a58(%rip), %xmm3     # 0x80c0
movsd 0x28(%rsp), %xmm2
movsd 0x20(%rsp), %xmm1
cvtsd2ss %xmm0, %xmm0
movq %r13, %rax
sarq $0x1e, %rax
movss %xmm0, 0x10(%r12,%rax)
addq %rbp, %r13
incl %ebx
addq $0x20, %r15
jne 0x2624
addsd 0x5a0f(%rip), %xmm2     # 0x80a8
movl 0x18(%rsp), %esi
incl %esi
movq 0x10(%rsp), %rax
incq %rax
cmpl 0x48(%rsp), %esi
jne 0x25d7
movq 0x8(%rsp), %rax
leal 0x3(%rax), %edi
testl %eax, %eax
cmovnsl %eax, %edi
sarl $0x2, %edi
movq 0x40(%rsp), %rdx
addq $0x8, %rdx
movq 0x58(%rsp), %rsi
callq 0x14ee
jmp 0x2985
movq %rcx, 0x50(%rsp)
cmpl $0x4, %ebx
jl 0x27e7
movabsq $0x800000000, %r15      # imm = 0x800000000
cvtsi2sdl 0x8(%rsp), %xmm1
xorl %eax, %eax
xorpd %xmm2, %xmm2
movsd 0x59bb(%rip), %xmm3     # 0x80c0
xorl %esi, %esi
movsd %xmm1, 0x20(%rsp)
movq %rax, 0x10(%rsp)
shrq $0x2, %rax
movq %rax, %rcx
movabsq $0x1800000000, %rdx     # imm = 0x1800000000
imulq %rdx, %rcx
movl %esi, 0x18(%rsp)
movl %esi, %r13d
andl $0x3, %r13d
shlq $0x5, %rax
leaq (%rax,%rax,2), %rax
leaq (%rax,%r13,4), %r14
shlq $0x20, %r13
addq %rcx, %r13
addq %r12, %r14
movq $-0x60, %rbp
movl $0x1, %ebx
movsd %xmm2, 0x28(%rsp)
xorps %xmm0, %xmm0
cvtsi2sd %ebx, %xmm0
mulsd %xmm3, %xmm0
mulsd %xmm2, %xmm0
divsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x30(%rsp)
callq 0x10b0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x60(%r14,%rbp)
movsd 0x30(%rsp), %xmm0
callq 0x1120
movsd 0x5922(%rip), %xmm3     # 0x80c0
movsd 0x28(%rsp), %xmm2
movsd 0x20(%rsp), %xmm1
cvtsd2ss %xmm0, %xmm0
movq %r13, %rax
sarq $0x1e, %rax
movss %xmm0, 0x10(%r12,%rax)
addq %r15, %r13
incl %ebx
addq $0x20, %rbp
jne 0x275a
addsd 0x58d9(%rip), %xmm2     # 0x80a8
movl 0x18(%rsp), %esi
incl %esi
movq 0x10(%rsp), %rax
incq %rax
cmpl 0x48(%rsp), %esi
jne 0x270d
movq 0x8(%rsp), %rax
leal 0x3(%rax), %edi
testl %eax, %eax
cmovnsl %eax, %edi
sarl $0x2, %edi
movq 0x40(%rsp), %rbx
addq $0x8, %rbx
leaq 0x5919(%rip), %rdx      # 0x8120
movl %edi, 0x3c(%rsp)
movq %rbx, %rsi
callq 0x16a2
cmpl $0x2, %eax
jl 0x2985
xorps %xmm0, %xmm0
cvtsi2sdl 0x3c(%rsp), %xmm0
movsd 0x588b(%rip), %xmm1     # 0x80b8
divsd %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtsd2ss %xmm1, %xmm0
movss %xmm0, 0x58(%rsp)
movl %eax, %ecx
movq 0x50(%rsp), %rax
addq %r12, %rax
addq $0x4, %rax
movq %rax, 0x68(%rsp)
movl $0x1, %edi
xorl %esi, %esi
movl $0x1, %eax
movq %rbx, 0x78(%rsp)
movq %rcx, 0x70(%rsp)
movl %edi, %edx
movl 0x4(%rbx,%rax,4), %r8d
movl %r8d, %edi
movl %edx, 0x20(%rsp)
imull %edx, %edi
cmpl $0x2, %r8d
jl 0x2979
movq %rax, 0x80(%rsp)
movl 0x3c(%rsp), %eax
cltd
movl %edi, 0x64(%rsp)
idivl %edi
movq %rsi, 0x50(%rsp)
movslq %esi, %rdx
movl %eax, 0x10(%rsp)
cltq
leal -0x3(%rax), %r15d
leal -0x1(%r8), %ecx
movl %ecx, 0x60(%rsp)
movq 0x68(%rsp), %rcx
leaq (%rcx,%rdx,4), %rbp
shlq $0x2, %rax
movq %rax, 0x48(%rsp)
shrl %r15d
incq %r15
xorl %r13d, %r13d
movl $0x1, %ebx
movq %r8, 0x18(%rsp)
addl 0x20(%rsp), %r13d
cmpl $0x3, 0x10(%rsp)
jl 0x2942
xorps %xmm0, %xmm0
cvtsi2ss %r13d, %xmm0
mulss 0x58(%rsp), %xmm0
movss %xmm0, 0x28(%rsp)
xorl %r12d, %r12d
leaq 0x1(%r12), %r14
xorps %xmm0, %xmm0
cvtsi2ss %r14d, %xmm0
mulss 0x28(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x30(%rsp)
callq 0x10b0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x4(%rbp,%r12,8)
movsd 0x30(%rsp), %xmm0
callq 0x1120
cvtsd2ss %xmm0, %xmm0
movss %xmm0, (%rbp,%r12,8)
movq %r14, %r12
cmpl %r14d, %r15d
jne 0x28f7
incl %ebx
addq 0x48(%rsp), %rbp
movq 0x18(%rsp), %r8
cmpl %r8d, %ebx
jne 0x28d4
movl 0x10(%rsp), %eax
imull 0x60(%rsp), %eax
movq 0x50(%rsp), %rsi
addl %eax, %esi
movq 0x78(%rsp), %rbx
movq 0x70(%rsp), %rcx
movq 0x80(%rsp), %rax
movl 0x64(%rsp), %edi
incq %rax
cmpq %rcx, %rax
jne 0x2867
movq 0x40(%rsp), %rdi
movslq 0xc(%rdi), %rcx
movl $0x1, %eax
testq %rcx, %rcx
jle 0x29ae
xorl %edx, %edx
movq 0x8(%rsp), %rsi
imull 0x10(%rdi,%rdx,4), %eax
incq %rdx
cmpq %rdx, %rcx
jne 0x299f
jmp 0x29b3
movq 0x8(%rsp), %rsi
leal 0x3(%rsi), %ecx
testl %esi, %esi
cmovnsl %esi, %ecx
sarl $0x2, %ecx
cmpl %ecx, %eax
je 0x29c9
callq 0x2a1c
xorl %edi, %edi
movq %rdi, %rax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5a67(%rip), %rdi      # 0x844c
leaq 0x583d(%rip), %rsi      # 0x8229
leaq 0x5a24(%rip), %rcx      # 0x8417
movl $0x4c1, %edx            # imm = 0x4C1
callq 0x1090
leaq 0x59f1(%rip), %rdi      # 0x83f5
leaq 0x581e(%rip), %rsi      # 0x8229
leaq 0x5a05(%rip), %rcx      # 0x8417
movl $0x4c0, %edx            # imm = 0x4C0
callq 0x1090