// File: /workspace/github_c_makefile_star2_O3/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, %ebx
movl $0x60, %edi
callq 0x10f0
testl %ebp, %ebp
je 0x24a2
cmpl $0x1, %ebp
jne 0x24b5
testl %ebx, %ebx
jle 0x2483
movl %ebx, %ecx
andl $0xf, %ecx
je 0x24b5
leaq 0x5fe2(%rip), %rdi      # 0x846c
leaq 0x5db8(%rip), %rsi      # 0x8249
leaq 0x5f9f(%rip), %rcx      # 0x8437
movl $0x4c1, %edx            # imm = 0x4C1
callq 0x1090
testl %ebx, %ebx
jle 0x2986
movl %ebx, %ecx
andl $0x1f, %ecx
jne 0x2986
movl %ebx, %ecx
shrl $0x1f, %ecx
addl %ebx, %ecx
sarl %ecx
testl %ebp, %ebp
movl %ebx, (%rax)
movl %ebp, 0x44(%rax)
movq %rbx, 0x8(%rsp)
cmovnel %ebx, %ecx
leal 0x3(%rcx), %edx
testl %ecx, %ecx
cmovnsl %ecx, %edx
sarl $0x2, %edx
movq %rax, 0x40(%rsp)
movl %edx, 0x4(%rax)
movq %rdx, 0x48(%rsp)
leal (%rdx,%rdx), %ebx
movslq %ebx, %rdi
shlq $0x4, %rdi
addq $0x40, %rdi
callq 0x10f0
testq %rax, %rax
je 0x250f
movq %rax, %r12
andq $-0x40, %r12
movq %rax, 0x38(%r12)
addq $0x40, %r12
jmp 0x2512
xorl %r12d, %r12d
leal (%rbx,%rbx,2), %eax
leal (%rbx,%rbx,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 0x267f
movq %rdx, 0x58(%rsp)
cmpl $0x4, 0x8(%rsp)
jl 0x2657
movabsq $0x800000000, %rbp      # imm = 0x800000000
cvtsi2sdl 0x8(%rsp), %xmm1
xorl %eax, %eax
xorpd %xmm2, %xmm2
movsd 0x5b4b(%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 0x5ab2(%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 0x25ca
addsd 0x5a69(%rip), %xmm2     # 0x80a8
movl 0x18(%rsp), %esi
incl %esi
movq 0x10(%rsp), %rax
incq %rax
cmpl 0x48(%rsp), %esi
jne 0x257d
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 0x292d
movq %rcx, 0x50(%rsp)
cmpl $0x8, 0x8(%rsp)
jl 0x278f
movabsq $0x800000000, %r15      # imm = 0x800000000
cvtsi2sdl 0x8(%rsp), %xmm1
xorl %eax, %eax
xorpd %xmm2, %xmm2
movsd 0x5a13(%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 0x597a(%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 0x2702
addsd 0x5931(%rip), %xmm2     # 0x80a8
movl 0x18(%rsp), %esi
incl %esi
movq 0x10(%rsp), %rax
incq %rax
cmpl 0x48(%rsp), %esi
jne 0x26b5
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 0x5991(%rip), %rdx      # 0x8140
movl %edi, 0x3c(%rsp)
movq %rbx, %rsi
callq 0x16a7
cmpl $0x2, %eax
jl 0x292d
xorps %xmm0, %xmm0
cvtsi2sdl 0x3c(%rsp), %xmm0
movsd 0x58e3(%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 0x2921
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 0x28ea
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 0x289f
incl %ebx
addq 0x48(%rsp), %rbp
movq 0x18(%rsp), %r8
cmpl %r8d, %ebx
jne 0x287c
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 0x280f
movq 0x40(%rsp), %rdi
movslq 0xc(%rdi), %rcx
movl $0x1, %eax
testq %rcx, %rcx
jle 0x2956
xorl %edx, %edx
movq 0x8(%rsp), %rsi
imull 0x10(%rdi,%rdx,4), %eax
incq %rdx
cmpq %rdx, %rcx
jne 0x2947
jmp 0x295b
movq 0x8(%rsp), %rsi
leal 0x3(%rsi), %ecx
testl %esi, %esi
cmovnsl %esi, %ecx
sarl $0x2, %ecx
cmpl %ecx, %eax
je 0x2971
callq 0x29a5
xorl %edi, %edi
movq %rdi, %rax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5a88(%rip), %rdi      # 0x8415
leaq 0x58b5(%rip), %rsi      # 0x8249
leaq 0x5a9c(%rip), %rcx      # 0x8437
movl $0x4c0, %edx            # imm = 0x4C0
callq 0x1090