// File: /workspace/github_c_makefile_star2_O1/diaxen[P]fft-garden/cp_dit_bi_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;

            cp_dit_bf_0(os, out + o);
            for (k = 1; k < os / 2; k++)
              cp_dit_bf(os, out + o + k, get_twiddle(k << t, log2_N));
            cp_dit_bf_pi4(os, out + o + k);
            for (k += 1; k < os; k++)
              cp_dit_bf(os, out + o + k, get_twiddle(k << t, log2_N));
          }
      }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
bsrl %edi, %eax
movl %eax, 0x8(%rsp)
je 0x19d3
leaq 0x3777(%rip), %rax      # 0x5090
movq (%rax), %rax
leaq 0x3785(%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 0x197f
movsd %xmm1, -0x18(%r8)
movsd %xmm0, -0x10(%r8)
shlq $0x4, %r11
movupd (%rdx,%r11), %xmm0
movupd %xmm0, -0x8(%r8)
jmp 0x19c2
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 0x1935
cmpl $0x1, 0x8(%rsp)
jbe 0x1ac6
leaq 0x36bb(%rip), %rax      # 0x50a0
movq (%rax), %rax
movl 0x4(%rax), %eax
testq %rax, %rax
je 0x1ac6
leaq 0x36ad(%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 0x1a00
cmpl $0x3, 0x8(%rsp)
jb 0x1caf
leaq 0x35c8(%rip), %rax      # 0x50a0
movq (%rax), %rax
movl 0x8(%rax), %eax
testq %rax, %rax
je 0x1caf
leaq 0x35ba(%rip), %rcx      # 0x50a8
movq (%rcx), %rcx
xorl %edx, %edx
movsd 0x1725(%rip), %xmm0     # 0x3220
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 0x1afb
cmpl $0x4, 0x8(%rsp)
jb 0x2132
movl 0x8(%rsp), %edx
movl %edx, %eax
xorl $0x1f, %eax
movl $0x1c, %r9d
subl %eax, %r9d
movl $0x1, %r11d
movl %r9d, %ecx
shll %cl, %r11d
leal -0x1(%r11), %r15d
movl %edx, %eax
movq %rax, 0x38(%rsp)
leaq 0x10(%rsi), %rax
movq %rax, 0x48(%rsp)
leaq 0x18(%rsi), %rax
movq %rax, 0x30(%rsp)
leaq 0x30(%rsi), %rax
movq %rax, 0x40(%rsp)
movl $0x3, %ecx
movq %rsi, 0x50(%rsp)
movl %r15d, 0xc(%rsp)
movq %r11, 0x20(%rsp)
leaq 0x3387(%rip), %rax      # 0x50a0
movq (%rax), %rax
movq %rcx, 0x18(%rsp)
movl (%rax,%rcx,4), %eax
movq %rax, 0x88(%rsp)
testq %rax, %rax
je 0x211f
movq 0x18(%rsp), %rax
movl %eax, %edi
leal -0x1(%rax), %ecx
movl $0x1, %r8d
shll %cl, %r8d
movl $0x2, %edx
shll %cl, %edx
notl %edi
addl 0x8(%rsp), %edi
movl $0x3, %r10d
shll %cl, %r10d
movl %r8d, %r11d
shrl %r11d
cmpl $0x3, %r11d
movl $0x2, %ecx
cmovbl %ecx, %r11d
incl %eax
movl %eax, 0x14(%rsp)
shlq $0x4, %r10
movq 0x30(%rsp), %rax
movq %r10, 0x78(%rsp)
leaq (%rax,%r10), %rcx
movq %rcx, 0x70(%rsp)
shlq $0x4, %rdx
movq %rdx, 0x80(%rsp)
leaq (%rax,%rdx), %rcx
movq %rcx, 0x68(%rsp)
movq %r8, %rcx
shlq $0x4, %rcx
movq %rcx, 0x60(%rsp)
addq %rcx, %rax
movq %rax, 0x58(%rsp)
shlq $0x4, %r11
addq $-0x10, %r11
movq %r11, 0xa0(%rsp)
xorl %ecx, %ecx
movl %edi, 0x10(%rsp)
movq %r8, 0x28(%rsp)
leaq 0x32cf(%rip), %rax      # 0x50a8
movq (%rax), %rax
movq %rcx, 0x98(%rsp)
movl (%rax,%rcx,4), %r11d
movl 0x14(%rsp), %ecx
shll %cl, %r11d
shlq $0x4, %r11
leaq (%rsi,%r11), %rax
movsd (%rsi,%r11), %xmm3
movsd 0x8(%rsi,%r11), %xmm4
movq 0x60(%rsp), %r10
movsd (%r10,%rax), %xmm0
movsd 0x8(%r10,%rax), %xmm2
movq 0x80(%rsp), %rcx
movsd (%rcx,%rax), %xmm1
movsd 0x8(%rcx,%rax), %xmm5
movq 0x78(%rsp), %rdx
movsd (%rdx,%rax), %xmm6
movsd 0x8(%rdx,%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,%r11)
movsd %xmm9, 0x8(%rsi,%r11)
movapd %xmm0, %xmm7
addsd %xmm5, %xmm7
movapd %xmm2, %xmm9
subsd %xmm1, %xmm9
movsd %xmm7, (%r10,%rax)
movsd %xmm9, 0x8(%r10,%rax)
subsd %xmm8, %xmm3
subsd %xmm6, %xmm4
movsd %xmm3, (%rcx,%rax)
movsd %xmm4, 0x8(%rcx,%rax)
subsd %xmm5, %xmm0
addsd %xmm2, %xmm1
movsd %xmm0, (%rdx,%rax)
movsd %xmm1, 0x8(%rdx,%rax)
movq 0x48(%rsp), %rax
leaq (%rax,%r11), %rbp
movq 0x40(%rsp), %rax
movq %r11, 0x90(%rsp)
leaq (%rax,%r11), %rdx
movl $0x1, %r15d
movl $0x2, %r12d
xorl %ebx, %ebx
movl %r15d, %esi
movl %edi, %ecx
shll %cl, %esi
movl %esi, %edi
andl 0xc(%rsp), %edi
movl %esi, %eax
movl %r9d, %ecx
shrl %cl, %eax
movq 0x20(%rsp), %rcx
subl %edi, %ecx
btl %r9d, %esi
cmovael %edi, %ecx
movq %rdx, %r13
movl %eax, %edx
shrl %edx
xorl %eax, %edx
movl %edx, %edi
shlq $0x4, %rcx
leaq 0x3167(%rip), %rsi      # 0x5080
addq (%rsi), %rcx
andl $0x1, %edi
shlq $0x3f, %rax
xorq (%rcx,%rdi,8), %rax
leaq (%rbx,%rbp), %rsi
xorl $0x1, %edi
shlq $0x3f, %rdx
xorq (%rcx,%rdi,8), %rdx
movq %rdx, %xmm1
movq %rax, %xmm0
movl %r8d, %edi
movl %r9d, %r14d
callq 0x2144
movl %r14d, %r9d
movq 0x28(%rsp), %r8
movl 0x10(%rsp), %edi
incl %r15d
addq $0x10, %rbx
incq %r12
leaq 0x10(%r13), %rdx
cmpq %rbx, 0xa0(%rsp)
jne 0x1ee1
movsd (%rbx,%rbp), %xmm2
movsd 0x8(%rbx,%rbp), %xmm3
movq 0x58(%rsp), %rax
movq 0x90(%rsp), %rdx
leaq (%rax,%rdx), %rcx
movsd -0x8(%rbx,%rcx), %xmm0
movsd (%rbx,%rcx), %xmm1
movq 0x68(%rsp), %rax
addq %rdx, %rax
addq 0x70(%rsp), %rdx
movsd -0x8(%rbx,%rax), %xmm6
movsd 0x126b(%rip), %xmm5     # 0x3220
mulsd %xmm5, %xmm6
movsd -0x8(%rbx,%rdx), %xmm7
mulsd %xmm5, %xmm7
movsd (%rbx,%rax), %xmm4
mulsd %xmm5, %xmm4
movsd (%rbx,%rdx), %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, (%rbx,%rbp)
movsd %xmm9, 0x8(%rbx,%rbp)
movapd %xmm0, %xmm8
addsd %xmm4, %xmm8
movapd %xmm1, %xmm9
subsd %xmm5, %xmm9
movsd %xmm8, -0x8(%rbx,%rcx)
movsd %xmm9, (%rbx,%rcx)
subsd %xmm7, %xmm2
subsd %xmm6, %xmm3
movsd %xmm2, -0x8(%rbx,%rax)
movsd %xmm3, (%rbx,%rax)
subsd %xmm4, %xmm0
addsd %xmm1, %xmm5
movsd %xmm0, -0x8(%rbx,%rdx)
movsd %xmm5, (%rbx,%rdx)
cmpl %r8d, %r12d
movq 0x20(%rsp), %r11
movl 0xc(%rsp), %r15d
leaq 0x2ff9(%rip), %rbp      # 0x5080
jae 0x2101
movl %r12d, %edx
movl %edi, %ecx
shll %cl, %edx
movl %edx, %esi
andl %r15d, %esi
movl %edx, %eax
movl %r9d, %ecx
shrl %cl, %eax
movl %r11d, %ecx
subl %esi, %ecx
btl %r9d, %edx
cmovael %esi, %ecx
movl %eax, %edx
shrl %edx
xorl %eax, %edx
movl %edx, %esi
shlq $0x4, %rcx
addq (%rbp), %rcx
andl $0x1, %esi
shlq $0x3f, %rax
xorq (%rcx,%rsi,8), %rax
xorl $0x1, %esi
shlq $0x3f, %rdx
xorq (%rcx,%rsi,8), %rdx
movq %rdx, %xmm1
movq %rax, %xmm0
movl %r8d, %edi
movq %r13, %rsi
movq %r11, %rbx
callq 0x2144
movq %rbx, %r11
movl %r14d, %r9d
movq 0x28(%rsp), %r8
movl 0x10(%rsp), %edi
incq %r12
addq $0x10, %r13
cmpq %r12, %r8
jne 0x2089
movq 0x98(%rsp), %rcx
incq %rcx
cmpq 0x88(%rsp), %rcx
movq 0x50(%rsp), %rsi
jne 0x1dd2
movq 0x18(%rsp), %rcx
incq %rcx
cmpq 0x38(%rsp), %rcx
jne 0x1d12
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq