// File: /workspace/github_c_makefile_star2_O0/diaxen[P]fft-garden/cp_dit_bi_G_L_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];
	unsigned os = 1 << (s - 1);

	for (unsigned i = 0; i < c; i++)
	  {
	    unsigned o = sr_sched_off[i] << (s + 1);
	    cp_dit_bf_0(os, out + o);
	  }

	for (unsigned k = 1; k < os; k++)
	  {
	    unsigned t = log2_N - s - 1;
	    complex double w = get_twiddle(k << t, log2_N);

	    for (unsigned i = 0; i < c; i++)
	      {
		unsigned o = sr_sched_off[i] << (s + 1);
		cp_dit_bf(os, out + o + k, w);
	      }
	  }
      }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl -0x4(%rbp), %eax
bsrl %eax, %ecx
xorl $0x1f, %ecx
movl $0x1f, %eax
subl %ecx, %eax
movl %eax, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x4(%rbp), %eax
jae 0x1eba
leaq 0x432e(%rip), %rax      # 0x6088
movq (%rax), %rax
movl -0x24(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
movl -0x4(%rbp), %ecx
shrl %ecx
xorl %ecx, %eax
movl %eax, -0x2c(%rbp)
leaq 0x4322(%rip), %rax      # 0x60a0
movq (%rax), %rax
movl -0x20(%rbp), %ecx
movl (%rax,%rcx,4), %eax
shll %eax
cmpl -0x24(%rbp), %eax
jbe 0x1df4
movq -0x18(%rbp), %rax
movl -0x28(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movsd (%rax), %xmm1
movsd 0x8(%rax), %xmm0
movq -0x10(%rbp), %rax
movl -0x24(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movsd %xmm1, (%rax)
movsd %xmm0, 0x8(%rax)
movq -0x18(%rbp), %rax
movl -0x2c(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movsd (%rax), %xmm1
movsd 0x8(%rax), %xmm0
movq -0x10(%rbp), %rax
movl -0x24(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movsd %xmm1, (%rax)
movsd %xmm0, 0x8(%rax)
jmp 0x1eaa
movq -0x18(%rbp), %rax
movl -0x28(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movsd (%rax), %xmm1
movsd 0x8(%rax), %xmm0
movsd %xmm1, -0x40(%rbp)
movsd %xmm0, -0x38(%rbp)
movq -0x18(%rbp), %rax
movl -0x2c(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movsd (%rax), %xmm1
movsd 0x8(%rax), %xmm0
movsd %xmm1, -0x50(%rbp)
movsd %xmm0, -0x48(%rbp)
movsd -0x40(%rbp), %xmm1
movsd -0x38(%rbp), %xmm0
movsd -0x50(%rbp), %xmm3
movsd -0x48(%rbp), %xmm2
addsd %xmm3, %xmm1
addsd %xmm2, %xmm0
movq -0x10(%rbp), %rax
movl -0x24(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movsd %xmm1, (%rax)
movsd %xmm0, 0x8(%rax)
movsd -0x40(%rbp), %xmm1
movsd -0x38(%rbp), %xmm0
movsd -0x50(%rbp), %xmm3
movsd -0x48(%rbp), %xmm2
subsd %xmm3, %xmm1
subsd %xmm2, %xmm0
movq -0x10(%rbp), %rax
movl -0x24(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movsd %xmm1, (%rax)
movsd %xmm0, 0x8(%rax)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x1eac
movl -0x24(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x24(%rbp)
jmp 0x1d47
cmpl $0x1, -0x1c(%rbp)
jbe 0x1f1a
leaq 0x41d1(%rip), %rax      # 0x6098
movq (%rax), %rax
movl 0x4(%rax), %eax
movl %eax, -0x54(%rbp)
movl $0x0, -0x58(%rbp)
movl -0x58(%rbp), %eax
cmpl -0x54(%rbp), %eax
jae 0x1f18
leaq 0x41ba(%rip), %rax      # 0x60a0
movq (%rax), %rax
movl -0x58(%rbp), %ecx
movl (%rax,%rcx,4), %eax
shll $0x2, %eax
movl %eax, -0x5c(%rbp)
movq -0x10(%rbp), %rsi
movl -0x5c(%rbp), %eax
shlq $0x4, %rax
addq %rax, %rsi
movl $0x1, %edi
callq 0x2140
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0x1ed7
jmp 0x1f1a
cmpl $0x2, -0x1c(%rbp)
jbe 0x1f96
leaq 0x4171(%rip), %rax      # 0x6098
movq (%rax), %rax
movl 0x8(%rax), %eax
movl %eax, -0x60(%rbp)
movl $0x0, -0x64(%rbp)
movl -0x64(%rbp), %eax
cmpl -0x60(%rbp), %eax
jae 0x1f94
leaq 0x415a(%rip), %rax      # 0x60a0
movq (%rax), %rax
movl -0x64(%rbp), %ecx
movl (%rax,%rcx,4), %eax
shll $0x3, %eax
movl %eax, -0x68(%rbp)
movq -0x10(%rbp), %rsi
movl -0x68(%rbp), %eax
shlq $0x4, %rax
addq %rax, %rsi
addq $0x10, %rsi
movl $0x2, %edi
callq 0x2330
movq -0x10(%rbp), %rsi
movl -0x68(%rbp), %eax
shlq $0x4, %rax
addq %rax, %rsi
movl $0x2, %edi
callq 0x2140
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x1f37
jmp 0x1f96
cmpl $0x3, -0x1c(%rbp)
jbe 0x2129
movl $0x3, -0x6c(%rbp)
movl -0x6c(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jae 0x2127
leaq 0x40de(%rip), %rax      # 0x6098
movq (%rax), %rax
movl -0x6c(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x70(%rbp)
movl -0x6c(%rbp), %ecx
subl $0x1, %ecx
movl $0x1, %eax
shll %cl, %eax
movl %eax, -0x74(%rbp)
movl $0x0, -0x78(%rbp)
movl -0x78(%rbp), %eax
cmpl -0x70(%rbp), %eax
jae 0x2021
leaq 0x40b4(%rip), %rax      # 0x60a0
movq (%rax), %rax
movl -0x78(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl -0x6c(%rbp), %ecx
addl $0x1, %ecx
shll %cl, %eax
movl %eax, -0x7c(%rbp)
movl -0x74(%rbp), %edi
movq -0x10(%rbp), %rsi
movl -0x7c(%rbp), %eax
shlq $0x4, %rax
addq %rax, %rsi
callq 0x2140
movl -0x78(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x78(%rbp)
jmp 0x1fdd
movl $0x1, -0x80(%rbp)
movl -0x80(%rbp), %eax
cmpl -0x74(%rbp), %eax
jae 0x2117
movl -0x1c(%rbp), %eax
subl -0x6c(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x84(%rbp)
movl -0x80(%rbp), %edi
movl -0x84(%rbp), %ecx
shll %cl, %edi
movl -0x1c(%rbp), %esi
callq 0x25f0
movsd %xmm0, -0x98(%rbp)
movsd %xmm1, -0x90(%rbp)
movl $0x0, -0x9c(%rbp)
movl -0x9c(%rbp), %eax
cmpl -0x70(%rbp), %eax
jae 0x2107
leaq 0x401a(%rip), %rax      # 0x60a0
movq (%rax), %rax
movl -0x9c(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl -0x6c(%rbp), %ecx
addl $0x1, %ecx
shll %cl, %eax
movl %eax, -0xa0(%rbp)
movl -0x74(%rbp), %edi
movq -0x10(%rbp), %rsi
movl -0xa0(%rbp), %eax
shlq $0x4, %rax
addq %rax, %rsi
movl -0x80(%rbp), %eax
shlq $0x4, %rax
addq %rax, %rsi
movsd -0x98(%rbp), %xmm1
movsd -0x90(%rbp), %xmm0
movsd %xmm1, -0xb0(%rbp)
movsd %xmm0, -0xa8(%rbp)
movsd -0xb0(%rbp), %xmm0
movsd -0xa8(%rbp), %xmm1
callq 0x26d0
movl -0x9c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x9c(%rbp)
jmp 0x2070
jmp 0x2109
movl -0x80(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x80(%rbp)
jmp 0x2028
jmp 0x2119
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x1fa7
jmp 0x2129
addq $0xb0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)