// File: /workspace/github_c_makefile_star2_O0/diaxen[P]fft-garden/sr_dit_bi_L.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 = sr_input_lut[i / 2];

      if (sr_sched_off[j] * 2 > i)
        {
          out[i    ] = in[i0];
          out[i + 1] = in[i0 + N / 2];
        }
      else
        {
          ct_dit_bf2_0(1, N / 2, out + i, in + i0);
          j++;
        }
    }

  /* stage >= 1 */
  if (log2_N > 1)
    for (unsigned s = 1; s < log2_N; s++)
      {
        unsigned c = sr_sched_cnt[s];

        for (unsigned i = 0; i < c; i++)
          {
            complex double *o = out + (sr_sched_off[i] << (s + 1));
            unsigned t = log2_N - s - 1;
            unsigned os = 1 << (s - 1);

            for (unsigned k = 0; k < os; k++)
              sr_dit_bf4(os, o + k,
                     get_twiddle(k << t, log2_N),
                     get_twiddle_sr(k << t, log2_N));
          }
      }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %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 0x1f71
leaq 0x41f6(%rip), %rax      # 0x6090
movq (%rax), %rax
movl -0x24(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x28(%rbp)
leaq 0x41ef(%rip), %rax      # 0x60a0
movq (%rax), %rax
movl -0x20(%rbp), %ecx
movl (%rax,%rcx,4), %eax
shll %eax
cmpl -0x24(%rbp), %eax
jbe 0x1f2d
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 -0x28(%rbp), %ecx
movl -0x4(%rbp), %edx
shrl %edx
addl %edx, %ecx
movl %ecx, %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 0x1f61
movl -0x4(%rbp), %esi
shrl %esi
movq -0x10(%rbp), %rdx
movl -0x24(%rbp), %eax
shlq $0x4, %rax
addq %rax, %rdx
movq -0x18(%rbp), %rcx
movl -0x28(%rbp), %eax
shlq $0x4, %rax
addq %rax, %rcx
movl $0x1, %edi
callq 0x20e0
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x1f63
movl -0x24(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x24(%rbp)
jmp 0x1e87
cmpl $0x1, -0x1c(%rbp)
jbe 0x20d0
movl $0x1, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jae 0x20ce
leaq 0x4103(%rip), %rax      # 0x6098
movq (%rax), %rax
movl -0x2c(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x30(%rbp), %eax
jae 0x20be
movq -0x10(%rbp), %rax
leaq 0x40e1(%rip), %rcx      # 0x60a0
movq (%rcx), %rcx
movl -0x34(%rbp), %edx
movl (%rcx,%rdx,4), %edx
movl -0x2c(%rbp), %ecx
addl $0x1, %ecx
shll %cl, %edx
movl %edx, %ecx
movl %ecx, %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movl -0x1c(%rbp), %eax
subl -0x2c(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x44(%rbp)
movl -0x2c(%rbp), %ecx
subl $0x1, %ecx
movl $0x1, %eax
shll %cl, %eax
movl %eax, -0x48(%rbp)
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x48(%rbp), %eax
jae 0x20ae
movl -0x48(%rbp), %eax
movl %eax, -0x8c(%rbp)
movq -0x40(%rbp), %rax
movl -0x4c(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x88(%rbp)
movl -0x4c(%rbp), %edi
movl -0x44(%rbp), %ecx
shll %cl, %edi
movl -0x1c(%rbp), %esi
callq 0x2ca0
movsd %xmm0, -0x80(%rbp)
movsd %xmm1, -0x78(%rbp)
movl -0x4c(%rbp), %edi
movl -0x44(%rbp), %ecx
shll %cl, %edi
movl -0x1c(%rbp), %esi
callq 0x2ce0
movl -0x8c(%rbp), %edi
movq -0x88(%rbp), %rsi
movaps %xmm0, %xmm3
movsd -0x80(%rbp), %xmm0
movaps %xmm1, %xmm2
movsd -0x78(%rbp), %xmm1
movsd %xmm0, -0x60(%rbp)
movsd %xmm1, -0x58(%rbp)
movsd -0x60(%rbp), %xmm0
movsd -0x58(%rbp), %xmm1
movsd %xmm3, -0x70(%rbp)
movsd %xmm2, -0x68(%rbp)
movsd -0x70(%rbp), %xmm2
movsd -0x68(%rbp), %xmm3
callq 0x2190
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x2002
jmp 0x20b0
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x1fa8
jmp 0x20c0
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x1f82
jmp 0x20d0
addq $0x90, %rsp
popq %rbp
retq
nopl (%rax)