// File: /workspace/github_c_makefile_star2_O0/diaxen[P]fft-garden/sr_dit_bi_G_L_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, is = 0; is < N; is += 2)
    {
      unsigned i0 = sr_input_lut[is / 2];

      if (sr_sched_off[j] * 2 > is)
        {
          out[is    ] = in[i0];
          out[is + 1] = in[i0 + N / 2];
        }
      else
        {
          ct_dit_bf2_0(1, N / 2, out + is, in + i0);
          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;
          sr_dit_bf4_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;

          sr_dit_bf4_0(2, out + o);
          sr_dit_bf4_pi4(2, out + o + 1);
        }
    }

  /* stage >= 3 */
  if (log2_N > 3)
    for (unsigned k = 3; k < log2_N; k++)
      {
        unsigned t = log2_N - k - 1;
        unsigned n2 = 1 << (k - 1);
        unsigned n4 = 1 << (k - 2);

        unsigned c = sr_sched_cnt[k];
        for (unsigned i = 0; i < c; i++)
          {
            unsigned o = sr_sched_off[i] << (k + 1);

            sr_dit_bf4_0(n2, out + o);
            sr_dit_bf4_pi4(n2, out + o + n4);
          }

        for (unsigned j0 = 1; j0 < n4; j0++)
          {
            complex double w1 = get_twiddle(j0 << t, log2_N);
            complex double w3 = get_twiddle_sr(j0 << t, log2_N);

            unsigned c = sr_sched_cnt[k];
            for (unsigned i = 0; i < c; i++)
              {
                unsigned o = sr_sched_off[i] << (k + 1);

                sr_dit_bf4(n2, out + o + j0, w1, w3);
                sr_dit_bf4(n2, out + o + n2 - j0, conj(w1 * I), -conj(w3 * I));
              }
          }
      }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
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 0x2530
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 0x1fd1
leaq 0x411a(%rip), %rax      # 0x6098
movq (%rax), %rax
movl 0x4(%rax), %eax
movl %eax, -0x2c(%rbp)
movl $0x0, -0x30(%rbp)
movl -0x30(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jae 0x1fcf
leaq 0x4103(%rip), %rax      # 0x60a0
movq (%rax), %rax
movl -0x30(%rbp), %ecx
movl (%rax,%rcx,4), %eax
shll $0x2, %eax
movl %eax, -0x34(%rbp)
movq -0x10(%rbp), %rsi
movl -0x34(%rbp), %eax
shlq $0x4, %rax
addq %rax, %rsi
movl $0x1, %edi
callq 0x25e0
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x1f8e
jmp 0x1fd1
cmpl $0x2, -0x1c(%rbp)
jbe 0x204d
leaq 0x40ba(%rip), %rax      # 0x6098
movq (%rax), %rax
movl 0x8(%rax), %eax
movl %eax, -0x38(%rbp)
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x38(%rbp), %eax
jae 0x204b
leaq 0x40a3(%rip), %rax      # 0x60a0
movq (%rax), %rax
movl -0x3c(%rbp), %ecx
movl (%rax,%rcx,4), %eax
shll $0x3, %eax
movl %eax, -0x40(%rbp)
movq -0x10(%rbp), %rsi
movl -0x40(%rbp), %eax
shlq $0x4, %rax
addq %rax, %rsi
movl $0x2, %edi
callq 0x25e0
movq -0x10(%rbp), %rsi
movl -0x40(%rbp), %eax
shlq $0x4, %rax
addq %rax, %rsi
addq $0x10, %rsi
movl $0x2, %edi
callq 0x27d0
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x1fee
jmp 0x204d
cmpl $0x3, -0x1c(%rbp)
jbe 0x2519
movl $0x3, -0x44(%rbp)
movl -0x44(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jae 0x2517
movl -0x1c(%rbp), %eax
subl -0x44(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x48(%rbp)
movl -0x44(%rbp), %ecx
subl $0x1, %ecx
movl $0x1, %eax
shll %cl, %eax
movl %eax, -0x4c(%rbp)
movl -0x44(%rbp), %ecx
subl $0x2, %ecx
movl $0x1, %eax
shll %cl, %eax
movl %eax, -0x50(%rbp)
leaq 0x3ffb(%rip), %rax      # 0x6098
movq (%rax), %rax
movl -0x44(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x54(%rbp)
movl $0x0, -0x58(%rbp)
movl -0x58(%rbp), %eax
cmpl -0x54(%rbp), %eax
jae 0x2114
leaq 0x3fe1(%rip), %rax      # 0x60a0
movq (%rax), %rax
movl -0x58(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl -0x44(%rbp), %ecx
addl $0x1, %ecx
shll %cl, %eax
movl %eax, -0x5c(%rbp)
movl -0x4c(%rbp), %edi
movq -0x10(%rbp), %rsi
movl -0x5c(%rbp), %eax
shlq $0x4, %rax
addq %rax, %rsi
callq 0x25e0
movl -0x4c(%rbp), %edi
movq -0x10(%rbp), %rsi
movl -0x5c(%rbp), %eax
shlq $0x4, %rax
addq %rax, %rsi
movl -0x50(%rbp), %eax
shlq $0x4, %rax
addq %rax, %rsi
callq 0x27d0
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0x20b0
movl $0x1, -0x60(%rbp)
movl -0x60(%rbp), %eax
cmpl -0x50(%rbp), %eax
jae 0x2507
movl -0x60(%rbp), %edi
movl -0x48(%rbp), %ecx
shll %cl, %edi
movl -0x1c(%rbp), %esi
callq 0x2ac0
movsd %xmm0, -0x70(%rbp)
movsd %xmm1, -0x68(%rbp)
movl -0x60(%rbp), %edi
movl -0x48(%rbp), %ecx
shll %cl, %edi
movl -0x1c(%rbp), %esi
callq 0x2b00
movsd %xmm0, -0x80(%rbp)
movsd %xmm1, -0x78(%rbp)
leaq 0x3f36(%rip), %rax      # 0x6098
movq (%rax), %rax
movl -0x44(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x84(%rbp)
movl $0x0, -0x88(%rbp)
movl -0x88(%rbp), %eax
cmpl -0x84(%rbp), %eax
jae 0x24f7
leaq 0x3f0c(%rip), %rax      # 0x60a0
movq (%rax), %rax
movl -0x88(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl -0x44(%rbp), %ecx
addl $0x1, %ecx
shll %cl, %eax
movl %eax, -0x8c(%rbp)
movl -0x4c(%rbp), %edi
movq -0x10(%rbp), %rsi
movl -0x8c(%rbp), %eax
shlq $0x4, %rax
addq %rax, %rsi
movl -0x60(%rbp), %eax
shlq $0x4, %rax
addq %rax, %rsi
movsd -0x70(%rbp), %xmm1
movsd -0x68(%rbp), %xmm0
movsd -0x80(%rbp), %xmm3
movsd -0x78(%rbp), %xmm2
movsd %xmm1, -0xa0(%rbp)
movsd %xmm0, -0x98(%rbp)
movsd -0xa0(%rbp), %xmm0
movsd -0x98(%rbp), %xmm1
movsd %xmm3, -0xb0(%rbp)
movsd %xmm2, -0xa8(%rbp)
movsd -0xb0(%rbp), %xmm2
movsd -0xa8(%rbp), %xmm3
callq 0x2b40
movl -0x4c(%rbp), %eax
movl %eax, -0x10c(%rbp)
movq -0x10(%rbp), %rax
movl -0x8c(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movl -0x4c(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movl -0x60(%rbp), %ecx
movl %ecx, %edx
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x108(%rbp)
movsd -0x70(%rbp), %xmm1
movsd %xmm1, -0x100(%rbp)
movsd -0x68(%rbp), %xmm2
movsd %xmm2, -0xf8(%rbp)
xorps %xmm3, %xmm3
movaps %xmm1, %xmm0
mulsd %xmm3, %xmm0
movsd 0x1d83(%rip), %xmm4     # 0x4010
movaps %xmm2, %xmm3
mulsd %xmm4, %xmm3
movsd 0x1d74(%rip), %xmm4     # 0x4010
mulsd %xmm4, %xmm1
xorps %xmm4, %xmm4
mulsd %xmm4, %xmm2
subsd %xmm3, %xmm0
movsd %xmm0, -0xf0(%rbp)
addsd %xmm2, %xmm1
movsd %xmm1, -0xe8(%rbp)
ucomisd %xmm0, %xmm0
movsd %xmm0, -0xe0(%rbp)
movsd %xmm1, -0xd8(%rbp)
jnp 0x232b
movsd -0xe8(%rbp), %xmm1
movsd -0xf0(%rbp), %xmm0
ucomisd %xmm1, %xmm1
movsd %xmm0, -0xe0(%rbp)
movsd %xmm1, -0xd8(%rbp)
jnp 0x232b
movsd -0xf8(%rbp), %xmm1
movsd -0x100(%rbp), %xmm0
xorps %xmm2, %xmm2
movsd 0x1cfa(%rip), %xmm3     # 0x4010
callq 0x36a0
movsd %xmm0, -0xe0(%rbp)
movsd %xmm1, -0xd8(%rbp)
movsd -0xe0(%rbp), %xmm1
movsd -0xd8(%rbp), %xmm0
movsd %xmm1, -0x150(%rbp)
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, -0x148(%rbp)
movsd -0x80(%rbp), %xmm1
movsd %xmm1, -0x140(%rbp)
movsd -0x78(%rbp), %xmm2
movsd %xmm2, -0x138(%rbp)
xorps %xmm3, %xmm3
movaps %xmm1, %xmm0
mulsd %xmm3, %xmm0
movsd 0x1c82(%rip), %xmm4     # 0x4010
movaps %xmm2, %xmm3
mulsd %xmm4, %xmm3
movsd 0x1c73(%rip), %xmm4     # 0x4010
mulsd %xmm4, %xmm1
xorps %xmm4, %xmm4
mulsd %xmm4, %xmm2
subsd %xmm3, %xmm0
movsd %xmm0, -0x130(%rbp)
addsd %xmm2, %xmm1
movsd %xmm1, -0x128(%rbp)
ucomisd %xmm0, %xmm0
movsd %xmm0, -0x120(%rbp)
movsd %xmm1, -0x118(%rbp)
jnp 0x242c
movsd -0x128(%rbp), %xmm1
movsd -0x130(%rbp), %xmm0
ucomisd %xmm1, %xmm1
movsd %xmm0, -0x120(%rbp)
movsd %xmm1, -0x118(%rbp)
jnp 0x242c
movsd -0x138(%rbp), %xmm1
movsd -0x140(%rbp), %xmm0
xorps %xmm2, %xmm2
movsd 0x1bf9(%rip), %xmm3     # 0x4010
callq 0x36a0
movsd %xmm0, -0x120(%rbp)
movsd %xmm1, -0x118(%rbp)
movq -0x108(%rbp), %rsi
movl -0x10c(%rbp), %edi
movsd -0x148(%rbp), %xmm0
movsd -0x150(%rbp), %xmm1
movsd -0x120(%rbp), %xmm3
movsd -0x118(%rbp), %xmm2
movq %xmm2, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm2
movq %xmm3, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm3
movq %xmm2, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm2
movsd %xmm1, -0xc0(%rbp)
movsd %xmm0, -0xb8(%rbp)
movsd -0xc0(%rbp), %xmm0
movsd -0xb8(%rbp), %xmm1
movsd %xmm3, -0xd0(%rbp)
movsd %xmm2, -0xc8(%rbp)
movsd -0xd0(%rbp), %xmm2
movsd -0xc8(%rbp), %xmm3
callq 0x2b40
movl -0x88(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x88(%rbp)
jmp 0x217b
jmp 0x24f9
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x211b
jmp 0x2509
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x205e
jmp 0x2519
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
nopw %cs:(%rax,%rax)