// File: /workspace/github_c_makefile_star2_O1/diaxen[P]fft-garden/cp_dit_bi_S_P.c
// Function: fft
void
fft(unsigned N, complex double * restrict out,
    const complex double * restrict in)
{
  unsigned log2_N = 31 - clz32(N);

  /* stage 0 */
  for (unsigned j = 0, i = 0; i < N; i += 2)
    {
      unsigned i0 = cp_input_lut[i / 2];
      unsigned i1 = i0 ^ (N >> 1);

      if (sr_sched_off[j] * 2 > i)
        {
          out[i    ] = in[i0];
          out[i + 1] = in[i1];
        }
      else
        {
          complex double a = in[i0];
          complex double b = in[i1];
          out[i    ] = a + b;
          out[i + 1] = a - b;
          j++;
        }
    }

  /* stage 1 */
  if (log2_N > 1)
    {
      unsigned c = sr_sched_cnt[1];
      for (unsigned i = 0; i < c; i++)
        {
          unsigned o = sr_sched_off[i] << 2;
          cp_dit_bf_0(1, out + o);
        }
    }

  /* stage 2 */
  if (log2_N > 2)
    {
      unsigned c = sr_sched_cnt[2];
      for (unsigned i = 0; i < c; i++)
        {
          unsigned o = sr_sched_off[i] << 3;

          cp_dit_bf_pi4(2, out + o + 1);
          cp_dit_bf_0(2, out + o);
        }
    }

  /* stage >= 3 */
  if (log2_N > 3)
    for (unsigned s = 3; s < log2_N; s++)
      {
        unsigned c = sr_sched_cnt[s];
        for (unsigned i = 0; i < c; i++)
          {
            unsigned o = sr_sched_off[i] << (s + 1);
            unsigned t = log2_N - s - 1;
            unsigned os = 1 << (s - 1);
            unsigned k;

            unsigned m = os / 2;
            cp_dit_bf_0(os, out + o);
            cp_dit_bf_pi4(os, out + o + m);
            for (k = 1; k < m; k++)
              {
                complex double w = get_twiddle(k << t, log2_N);
                cp_dit_bf(os, out + o + k, w);
                cp_dit_bf(os, out + o + os - k, -I * conj(w));
              }
          }
      }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
bsrl %edi, %eax
movl %eax, (%rsp)
je 0x1af2
leaq 0x3658(%rip), %rax      # 0x5090
movq (%rax), %rax
leaq 0x3666(%rip), %rcx      # 0x50a8
movq (%rcx), %rcx
movl %edi, %r15d
shrl %edi
leaq 0x18(%rsi), %r8
xorl %r9d, %r9d
xorl %r10d, %r10d
movl (%rax,%r9,2), %r11d
movl %r11d, %ebx
xorl %edi, %ebx
movl %r10d, %r14d
movl (%rcx,%r14,4), %r14d
addl %r14d, %r14d
shlq $0x4, %r11
movsd (%rdx,%r11), %xmm1
movsd 0x8(%rdx,%r11), %xmm0
movl %ebx, %r11d
cmpq %r14, %r9
jae 0x1a9e
movsd %xmm1, -0x18(%r8)
movsd %xmm0, -0x10(%r8)
shlq $0x4, %r11
movupd (%rdx,%r11), %xmm0
movupd %xmm0, -0x8(%r8)
jmp 0x1ae1
shlq $0x4, %r11
movsd (%rdx,%r11), %xmm2
movsd 0x8(%rdx,%r11), %xmm3
movapd %xmm1, %xmm4
addsd %xmm2, %xmm4
movapd %xmm0, %xmm5
addsd %xmm3, %xmm5
movsd %xmm4, -0x18(%r8)
movsd %xmm5, -0x10(%r8)
subsd %xmm2, %xmm1
subsd %xmm3, %xmm0
movsd %xmm1, -0x8(%r8)
movsd %xmm0, (%r8)
incl %r10d
addq $0x2, %r9
addq $0x20, %r8
cmpq %r15, %r9
jb 0x1a54
cmpl $0x1, (%rsp)
jbe 0x1be4
leaq 0x359d(%rip), %rax      # 0x50a0
movq (%rax), %rax
movl 0x4(%rax), %eax
testq %rax, %rax
je 0x1be4
leaq 0x358f(%rip), %rcx      # 0x50a8
movq (%rcx), %rcx
xorl %edx, %edx
movl (%rcx,%rdx,4), %edi
shll $0x2, %edi
shlq $0x4, %rdi
movsd (%rsi,%rdi), %xmm3
movsd 0x8(%rsi,%rdi), %xmm4
movsd 0x10(%rsi,%rdi), %xmm0
movsd 0x18(%rsi,%rdi), %xmm2
movsd 0x20(%rsi,%rdi), %xmm1
movsd 0x28(%rsi,%rdi), %xmm5
movsd 0x30(%rsi,%rdi), %xmm6
movsd 0x38(%rsi,%rdi), %xmm7
movapd %xmm1, %xmm8
addsd %xmm6, %xmm8
subsd %xmm6, %xmm1
movapd %xmm5, %xmm6
addsd %xmm7, %xmm6
subsd %xmm7, %xmm5
movapd %xmm3, %xmm7
addsd %xmm8, %xmm7
movapd %xmm4, %xmm9
addsd %xmm6, %xmm9
movsd %xmm7, (%rsi,%rdi)
movsd %xmm9, 0x8(%rsi,%rdi)
movapd %xmm0, %xmm7
addsd %xmm5, %xmm7
movapd %xmm2, %xmm9
subsd %xmm1, %xmm9
movsd %xmm7, 0x10(%rsi,%rdi)
movsd %xmm9, 0x18(%rsi,%rdi)
subsd %xmm8, %xmm3
subsd %xmm6, %xmm4
movsd %xmm3, 0x20(%rsi,%rdi)
movsd %xmm4, 0x28(%rsi,%rdi)
subsd %xmm5, %xmm0
addsd %xmm2, %xmm1
movsd %xmm0, 0x30(%rsi,%rdi)
movsd %xmm1, 0x38(%rsi,%rdi)
incq %rdx
cmpq %rdx, %rax
jne 0x1b1e
cmpl $0x3, (%rsp)
jb 0x1dcc
leaq 0x34ab(%rip), %rax      # 0x50a0
movq (%rax), %rax
movl 0x8(%rax), %eax
testq %rax, %rax
je 0x1dcc
leaq 0x349d(%rip), %rcx      # 0x50a8
movq (%rcx), %rcx
xorl %edx, %edx
movsd 0x1638(%rip), %xmm0     # 0x3250
movl (%rcx,%rdx,4), %edi
shll $0x3, %edi
shlq $0x4, %rdi
movsd 0x10(%rsi,%rdi), %xmm2
movsd 0x18(%rsi,%rdi), %xmm3
movsd 0x50(%rsi,%rdi), %xmm7
movsd 0x30(%rsi,%rdi), %xmm1
mulsd %xmm0, %xmm7
movsd 0x70(%rsi,%rdi), %xmm8
movsd 0x58(%rsi,%rdi), %xmm4
mulsd %xmm0, %xmm8
mulsd %xmm0, %xmm4
movsd 0x78(%rsi,%rdi), %xmm9
mulsd %xmm0, %xmm9
movsd 0x38(%rsi,%rdi), %xmm6
movapd %xmm7, %xmm5
addsd %xmm4, %xmm5
movapd %xmm8, %xmm10
subsd %xmm7, %xmm4
subsd %xmm9, %xmm10
addsd %xmm8, %xmm9
movapd %xmm5, %xmm7
addsd %xmm10, %xmm7
subsd %xmm10, %xmm5
movapd %xmm4, %xmm8
subsd %xmm9, %xmm4
addsd %xmm9, %xmm8
movapd %xmm2, %xmm9
addsd %xmm7, %xmm9
movapd %xmm3, %xmm10
addsd %xmm8, %xmm10
movsd %xmm9, 0x10(%rsi,%rdi)
movapd %xmm1, %xmm9
addsd %xmm4, %xmm9
movsd %xmm10, 0x18(%rsi,%rdi)
movapd %xmm6, %xmm10
subsd %xmm5, %xmm10
movsd %xmm9, 0x30(%rsi,%rdi)
movsd %xmm10, 0x38(%rsi,%rdi)
subsd %xmm7, %xmm2
subsd %xmm8, %xmm3
movsd %xmm2, 0x50(%rsi,%rdi)
movsd %xmm3, 0x58(%rsi,%rdi)
subsd %xmm4, %xmm1
addsd %xmm6, %xmm5
movsd %xmm1, 0x70(%rsi,%rdi)
movsd %xmm5, 0x78(%rsi,%rdi)
movsd (%rsi,%rdi), %xmm4
movsd 0x8(%rsi,%rdi), %xmm1
movsd 0x20(%rsi,%rdi), %xmm2
movsd 0x40(%rsi,%rdi), %xmm3
movsd 0x48(%rsi,%rdi), %xmm5
movsd 0x60(%rsi,%rdi), %xmm7
movsd 0x68(%rsi,%rdi), %xmm8
movsd 0x28(%rsi,%rdi), %xmm6
movapd %xmm3, %xmm9
subsd %xmm7, %xmm3
movapd %xmm5, %xmm10
addsd %xmm7, %xmm9
addsd %xmm8, %xmm10
subsd %xmm8, %xmm5
movapd %xmm4, %xmm7
addsd %xmm9, %xmm7
movapd %xmm1, %xmm8
addsd %xmm10, %xmm8
movapd %xmm2, %xmm11
movsd %xmm7, (%rsi,%rdi)
addsd %xmm5, %xmm11
movapd %xmm6, %xmm7
subsd %xmm3, %xmm7
movsd %xmm8, 0x8(%rsi,%rdi)
movsd %xmm11, 0x20(%rsi,%rdi)
subsd %xmm9, %xmm4
subsd %xmm10, %xmm1
movsd %xmm7, 0x28(%rsi,%rdi)
movsd %xmm4, 0x40(%rsi,%rdi)
subsd %xmm5, %xmm2
addsd %xmm6, %xmm3
movsd %xmm1, 0x48(%rsi,%rdi)
movsd %xmm2, 0x60(%rsi,%rdi)
movsd %xmm3, 0x68(%rsi,%rdi)
incq %rdx
cmpq %rdx, %rax
jne 0x1c18
cmpl $0x4, (%rsp)
jb 0x2152
movl (%rsp), %eax
movq %rax, 0x18(%rsp)
leaq 0x10(%rsi), %rax
movq %rax, 0x20(%rsp)
leaq -0x10(%rsi), %rax
movq %rax, 0x10(%rsp)
movl $0x3, %ecx
movq %rsi, 0x28(%rsp)
leaq 0x329f(%rip), %rax      # 0x50a0
movq (%rax), %rax
movq %rcx, 0x8(%rsp)
movl (%rax,%rcx,4), %eax
movq %rax, 0x58(%rsp)
testq %rax, %rax
je 0x213f
movq 0x8(%rsp), %rax
movl %eax, %ebp
notl %ebp
addl (%rsp), %ebp
leal -0x1(%rax), %ecx
movl $0x1, %r14d
shll %cl, %r14d
movl %r14d, %edx
shrl %edx
movl $0x2, %edi
shll %cl, %edi
movl $0x3, %r8d
shll %cl, %r8d
cmpl $0x3, %edx
movl %edx, %ebx
movl $0x2, %ecx
cmovbl %ecx, %ebx
incl %eax
movl %eax, 0x4(%rsp)
movq %r14, %rcx
shlq $0x4, %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x38(%rsp)
addq %rcx, %rax
movq %rax, 0x30(%rsp)
shlq $0x4, %rdi
movq %rdi, 0x48(%rsp)
shlq $0x4, %r8
movq %r8, 0x40(%rsp)
shlq $0x4, %rdx
movq %rdx, 0x50(%rsp)
xorl %ecx, %ecx
leaq 0x3211(%rip), %rax      # 0x50a8
movq (%rax), %rax
movq %rcx, 0x60(%rsp)
movl (%rax,%rcx,4), %r12d
movl 0x4(%rsp), %ecx
shll %cl, %r12d
shlq $0x4, %r12
leaq (%rsi,%r12), %rax
movsd (%rsi,%r12), %xmm3
movsd 0x8(%rsi,%r12), %xmm4
movq 0x38(%rsp), %r9
movsd (%r9,%rax), %xmm0
movsd 0x8(%r9,%rax), %xmm2
movq 0x48(%rsp), %rdi
movsd (%rdi,%rax), %xmm1
movsd 0x8(%rdi,%rax), %xmm5
movq 0x40(%rsp), %r8
movsd (%r8,%rax), %xmm6
movsd 0x8(%r8,%rax), %xmm7
movapd %xmm1, %xmm8
addsd %xmm6, %xmm8
subsd %xmm6, %xmm1
movapd %xmm5, %xmm6
addsd %xmm7, %xmm6
subsd %xmm7, %xmm5
movapd %xmm3, %xmm7
addsd %xmm8, %xmm7
movapd %xmm4, %xmm9
addsd %xmm6, %xmm9
movsd %xmm7, (%rsi,%r12)
movsd %xmm9, 0x8(%rsi,%r12)
movapd %xmm0, %xmm7
addsd %xmm5, %xmm7
movapd %xmm2, %xmm9
subsd %xmm1, %xmm9
movsd %xmm7, (%r9,%rax)
movsd %xmm9, 0x8(%r9,%rax)
subsd %xmm8, %xmm3
subsd %xmm6, %xmm4
movsd %xmm3, (%rdi,%rax)
movsd %xmm4, 0x8(%rdi,%rax)
subsd %xmm5, %xmm0
addsd %xmm2, %xmm1
movsd %xmm0, (%r8,%rax)
movsd %xmm1, 0x8(%r8,%rax)
movq 0x50(%rsp), %rdx
leaq (%rax,%rdx), %rcx
movsd (%rdx,%rax), %xmm2
movsd 0x8(%rdx,%rax), %xmm3
movsd (%r9,%rcx), %xmm0
movsd 0x8(%r9,%rcx), %xmm1
movsd (%rdi,%rcx), %xmm6
movsd 0x12ad(%rip), %xmm5     # 0x3250
mulsd %xmm5, %xmm6
movsd (%r8,%rcx), %xmm7
mulsd %xmm5, %xmm7
movsd 0x8(%rdi,%rcx), %xmm4
mulsd %xmm5, %xmm4
movsd 0x8(%r8,%rcx), %xmm8
mulsd %xmm5, %xmm8
movapd %xmm6, %xmm5
addsd %xmm4, %xmm5
subsd %xmm6, %xmm4
movapd %xmm7, %xmm6
subsd %xmm8, %xmm6
addsd %xmm7, %xmm8
movapd %xmm5, %xmm7
addsd %xmm6, %xmm7
subsd %xmm6, %xmm5
movapd %xmm4, %xmm6
addsd %xmm8, %xmm6
subsd %xmm8, %xmm4
movapd %xmm2, %xmm8
addsd %xmm7, %xmm8
movapd %xmm3, %xmm9
addsd %xmm6, %xmm9
movsd %xmm8, (%rdx,%rax)
movsd %xmm9, 0x8(%rdx,%rax)
movapd %xmm0, %xmm8
addsd %xmm4, %xmm8
movapd %xmm1, %xmm9
subsd %xmm5, %xmm9
movsd %xmm8, (%r9,%rcx)
movsd %xmm9, 0x8(%r9,%rcx)
subsd %xmm7, %xmm2
subsd %xmm6, %xmm3
movsd %xmm2, (%rdi,%rcx)
movsd %xmm3, 0x8(%rdi,%rcx)
subsd %xmm4, %xmm0
addsd %xmm1, %xmm5
movsd %xmm0, (%r8,%rcx)
movsd %xmm5, 0x8(%r8,%rcx)
movq 0x20(%rsp), %rax
leaq (%rax,%r12), %r13
addq 0x30(%rsp), %r12
movl $0x1, %r15d
movl %r15d, %eax
movl %ebp, %ecx
shll %cl, %eax
leaq 0x2ff9(%rip), %rcx      # 0x5080
movq (%rcx), %rcx
shlq $0x4, %rax
movsd (%rcx,%rax), %xmm0
movsd %xmm0, 0x68(%rsp)
movsd 0x8(%rcx,%rax), %xmm1
movaps %xmm1, 0x70(%rsp)
movl %r14d, %edi
movq %r13, %rsi
callq 0x2164
movapd 0x70(%rsp), %xmm3
movsd 0x68(%rsp), %xmm2
movapd %xmm2, %xmm0
mulsd 0xfa9(%rip), %xmm0      # 0x3070
movapd %xmm3, %xmm1
mulsd 0xf45(%rip), %xmm1      # 0x3018
subsd %xmm3, %xmm0
subsd %xmm2, %xmm1
ucomisd %xmm0, %xmm0
jp 0x2102
movl %r14d, %edi
movq %r12, %rsi
callq 0x2164
incq %r15
addq $0x10, %r13
addq $-0x10, %r12
cmpq %r15, %rbx
jne 0x2079
jmp 0x2127
ucomisd %xmm1, %xmm1
jnp 0x20e1
xorpd 0xf20(%rip), %xmm3      # 0x3030
movsd 0xf58(%rip), %xmm0      # 0x3070
movsd 0x1138(%rip), %xmm1     # 0x3258
callq 0x2ad0
jmp 0x20e1
movq 0x60(%rsp), %rcx
incq %rcx
cmpq 0x58(%rsp), %rcx
movq 0x28(%rsp), %rsi
jne 0x1e90
movq 0x8(%rsp), %rcx
incq %rcx
cmpq 0x18(%rsp), %rcx
jne 0x1dfa
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq