// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
bsrl %edi, %eax
movl %eax, 0xc(%rsp)
je 0x1af6
leaq 0x365f(%rip), %rax      # 0x5098
movq (%rax), %rax
leaq 0x3665(%rip), %rcx      # 0x50a8
movq (%rcx), %rcx
movl %edi, %r15d
shrl %edi
leaq 0x18(%rsi), %r8
xorl %r9d, %r9d
movq %rdi, %r10
shlq $0x4, %r10
xorl %r11d, %r11d
movl (%rax,%r9,2), %ebx
movl %r11d, %r14d
movl (%rcx,%r14,4), %r14d
addl %r14d, %r14d
cmpq %r14, %r9
jae 0x1a93
movq %rbx, %r14
shlq $0x4, %r14
movups (%rdx,%r14), %xmm0
movups %xmm0, -0x18(%r8)
addl %edi, %ebx
shlq $0x4, %rbx
movupd (%rdx,%rbx), %xmm0
movupd %xmm0, -0x8(%r8)
jmp 0x1ae5
shlq $0x4, %rbx
leaq (%rdx,%rbx), %r14
movsd (%rdx,%rbx), %xmm0
movsd 0x8(%rdx,%rbx), %xmm1
movsd (%r10,%r14), %xmm2
movsd 0x8(%r10,%r14), %xmm3
movapd %xmm0, %xmm4
addsd %xmm2, %xmm4
movapd %xmm1, %xmm5
addsd %xmm3, %xmm5
movsd %xmm4, -0x18(%r8)
movsd %xmm5, -0x10(%r8)
subsd %xmm2, %xmm0
subsd %xmm3, %xmm1
movsd %xmm0, -0x8(%r8)
movsd %xmm1, (%r8)
incl %r11d
addq $0x2, %r9
addq $0x20, %r8
cmpq %r15, %r9
jb 0x1a5c
cmpl $0x1, 0xc(%rsp)
jbe 0x1be9
leaq 0x3598(%rip), %rax      # 0x50a0
movq (%rax), %rax
movl 0x4(%rax), %eax
testq %rax, %rax
je 0x1be9
leaq 0x358a(%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 0x1b23
cmpl $0x3, 0xc(%rsp)
jb 0x1de7
leaq 0x34a5(%rip), %rax      # 0x50a0
movq (%rax), %rax
movl 0x8(%rax), %eax
testq %rax, %rax
je 0x1de7
leaq 0x3497(%rip), %rcx      # 0x50a8
movq (%rcx), %rcx
xorl %edx, %edx
movsd 0x1632(%rip), %xmm0     # 0x3250
movsd 0x1632(%rip), %xmm1     # 0x3258
movl (%rcx,%rdx,4), %edi
shll $0x3, %edi
shlq $0x4, %rdi
movsd (%rsi,%rdi), %xmm5
movsd 0x8(%rsi,%rdi), %xmm2
movsd 0x20(%rsi,%rdi), %xmm3
movsd 0x40(%rsi,%rdi), %xmm4
movsd 0x48(%rsi,%rdi), %xmm6
movsd 0x60(%rsi,%rdi), %xmm8
movsd 0x68(%rsi,%rdi), %xmm9
movsd 0x28(%rsi,%rdi), %xmm7
movapd %xmm4, %xmm10
subsd %xmm8, %xmm4
movapd %xmm6, %xmm11
addsd %xmm8, %xmm10
addsd %xmm9, %xmm11
subsd %xmm9, %xmm6
movapd %xmm5, %xmm8
addsd %xmm10, %xmm8
movapd %xmm2, %xmm9
addsd %xmm11, %xmm9
movapd %xmm3, %xmm12
movsd %xmm8, (%rsi,%rdi)
addsd %xmm6, %xmm12
movapd %xmm7, %xmm8
subsd %xmm4, %xmm8
movsd %xmm9, 0x8(%rsi,%rdi)
movsd %xmm12, 0x20(%rsi,%rdi)
subsd %xmm10, %xmm5
subsd %xmm11, %xmm2
movsd %xmm8, 0x28(%rsi,%rdi)
movsd %xmm5, 0x40(%rsi,%rdi)
subsd %xmm6, %xmm3
addsd %xmm7, %xmm4
movsd %xmm2, 0x48(%rsi,%rdi)
movsd %xmm3, 0x60(%rsi,%rdi)
movsd %xmm4, 0x68(%rsi,%rdi)
movsd 0x10(%rsi,%rdi), %xmm5
movsd 0x18(%rsi,%rdi), %xmm2
movsd 0x30(%rsi,%rdi), %xmm3
movsd 0x38(%rsi,%rdi), %xmm4
movsd 0x50(%rsi,%rdi), %xmm8
mulsd %xmm0, %xmm8
movsd 0x58(%rsi,%rdi), %xmm6
mulsd %xmm0, %xmm6
movsd 0x78(%rsi,%rdi), %xmm9
mulsd %xmm0, %xmm9
movapd %xmm8, %xmm7
addsd %xmm6, %xmm7
movsd 0x70(%rsi,%rdi), %xmm10
subsd %xmm8, %xmm6
mulsd %xmm1, %xmm10
movapd %xmm10, %xmm8
subsd %xmm9, %xmm10
addsd %xmm9, %xmm8
movapd %xmm7, %xmm9
subsd %xmm8, %xmm7
movapd %xmm6, %xmm11
addsd %xmm8, %xmm9
addsd %xmm10, %xmm11
subsd %xmm10, %xmm6
movapd %xmm5, %xmm8
addsd %xmm9, %xmm8
movapd %xmm2, %xmm10
addsd %xmm11, %xmm10
movapd %xmm3, %xmm12
movsd %xmm8, 0x10(%rsi,%rdi)
addsd %xmm6, %xmm12
movapd %xmm4, %xmm8
subsd %xmm7, %xmm8
movsd %xmm10, 0x18(%rsi,%rdi)
movsd %xmm12, 0x30(%rsi,%rdi)
subsd %xmm9, %xmm5
subsd %xmm11, %xmm2
movsd %xmm8, 0x38(%rsi,%rdi)
movsd %xmm5, 0x50(%rsi,%rdi)
subsd %xmm6, %xmm3
addsd %xmm4, %xmm7
movsd %xmm2, 0x58(%rsi,%rdi)
movsd %xmm3, 0x70(%rsi,%rdi)
movsd %xmm7, 0x78(%rsi,%rdi)
incq %rdx
cmpq %rdx, %rax
jne 0x1c26
cmpl $0x4, 0xc(%rsp)
jb 0x22b8
movl 0xc(%rsp), %eax
movq %rax, 0x78(%rsp)
movl $0x3, %r15d
movsd 0x1446(%rip), %xmm11    # 0x3250
movsd 0x1445(%rip), %xmm12    # 0x3258
movq %rsi, 0x28(%rsp)
leaq -0x1(%r15), %rax
movl $0x1, %ebp
movl %eax, %ecx
shll %cl, %ebp
leal -0x2(%r15), %ecx
movl $0x1, %r12d
shll %cl, %r12d
leaq 0x3267(%rip), %rcx      # 0x50a0
movq (%rcx), %rcx
movl (%rcx,%r15,4), %edx
movl %ebp, %ecx
movq %rcx, 0x10(%rsp)
testq %rdx, %rdx
je 0x2040
leaq 0x3251(%rip), %rcx      # 0x50a8
movq (%rcx), %r14
movl $0x2, %edi
movl %eax, %ecx
shll %cl, %edi
movl $0x3, %r8d
shll %cl, %r8d
movl %r12d, %eax
leal 0x1(%r15), %ecx
movq 0x10(%rsp), %r9
shlq $0x4, %r9
shlq $0x4, %rdi
shlq $0x4, %r8
shlq $0x4, %rax
xorl %r10d, %r10d
movl (%r14,%r10,4), %ebx
shll %cl, %ebx
shlq $0x4, %rbx
leaq (%rsi,%rbx), %r11
movsd (%rsi,%rbx), %xmm3
movsd 0x8(%rsi,%rbx), %xmm4
movsd (%r9,%r11), %xmm0
movsd 0x8(%r9,%r11), %xmm2
movsd (%rdi,%r11), %xmm1
movsd 0x8(%rdi,%r11), %xmm5
movsd (%r8,%r11), %xmm6
movsd 0x8(%r8,%r11), %xmm7
movapd %xmm1, %xmm8
addsd %xmm6, %xmm8
subsd %xmm6, %xmm1
movapd %xmm5, %xmm6
addsd %xmm7, %xmm6
subsd %xmm7, %xmm5
movapd %xmm3, %xmm7
movapd %xmm4, %xmm9
addsd %xmm8, %xmm7
addsd %xmm6, %xmm9
movsd %xmm7, (%rsi,%rbx)
movapd %xmm0, %xmm7
movsd %xmm9, 0x8(%rsi,%rbx)
addsd %xmm5, %xmm7
movapd %xmm2, %xmm9
subsd %xmm1, %xmm9
movsd %xmm7, (%r9,%r11)
movsd %xmm9, 0x8(%r9,%r11)
subsd %xmm8, %xmm3
subsd %xmm6, %xmm4
movsd %xmm3, (%rdi,%r11)
movsd %xmm4, 0x8(%rdi,%r11)
subsd %xmm5, %xmm0
addsd %xmm2, %xmm1
movsd %xmm0, (%r8,%r11)
movsd %xmm1, 0x8(%r8,%r11)
leaq (%r11,%rax), %rbx
movsd (%rax,%r11), %xmm3
movsd 0x8(%rax,%r11), %xmm0
movsd (%r9,%rbx), %xmm1
movsd 0x8(%r9,%rbx), %xmm2
movsd (%rdi,%rbx), %xmm6
mulsd %xmm11, %xmm6
movsd 0x8(%rdi,%rbx), %xmm4
mulsd %xmm11, %xmm4
movsd 0x8(%r8,%rbx), %xmm7
mulsd %xmm11, %xmm7
movapd %xmm6, %xmm5
addsd %xmm4, %xmm5
movsd (%r8,%rbx), %xmm8
subsd %xmm6, %xmm4
mulsd %xmm12, %xmm8
movapd %xmm8, %xmm6
subsd %xmm7, %xmm8
addsd %xmm7, %xmm6
movapd %xmm5, %xmm7
subsd %xmm6, %xmm5
movapd %xmm4, %xmm9
addsd %xmm6, %xmm7
addsd %xmm8, %xmm9
subsd %xmm8, %xmm4
movapd %xmm3, %xmm6
addsd %xmm7, %xmm6
movapd %xmm0, %xmm8
addsd %xmm9, %xmm8
movapd %xmm1, %xmm10
movsd %xmm6, (%rax,%r11)
addsd %xmm4, %xmm10
movapd %xmm2, %xmm6
subsd %xmm5, %xmm6
movsd %xmm8, 0x8(%rax,%r11)
movsd %xmm10, (%r9,%rbx)
subsd %xmm7, %xmm3
subsd %xmm9, %xmm0
movsd %xmm6, 0x8(%r9,%rbx)
movsd %xmm3, (%rdi,%rbx)
subsd %xmm4, %xmm1
addsd %xmm2, %xmm5
movsd %xmm0, 0x8(%rdi,%rbx)
movsd %xmm1, (%r8,%rbx)
movsd %xmm5, 0x8(%r8,%rbx)
incq %r10
cmpq %r10, %rdx
jne 0x1e8b
movl %r15d, %eax
notl %eax
addl 0xc(%rsp), %eax
movl %eax, 0x18(%rsp)
cmpl $0x3, %r12d
movl $0x2, %eax
cmovbl %eax, %r12d
movq %r12, 0x80(%rsp)
leal 0x1(%r15), %eax
movl %eax, 0x1c(%rsp)
movl $0x1, %eax
shlq $0x4, 0x10(%rsp)
movq %r15, 0x88(%rsp)
movq %rax, 0x20(%rsp)
movl 0x18(%rsp), %ecx
shll %cl, %eax
leaq 0x3011(%rip), %rcx      # 0x50a0
movq (%rcx), %rcx
movl (%rcx,%r15,4), %r13d
testq %r13, %r13
je 0x2275
leaq 0x2fda(%rip), %rcx      # 0x5080
movq (%rcx), %rcx
shlq $0x4, %rax
movsd (%rcx,%rax), %xmm1
movsd 0x8(%rcx,%rax), %xmm2
leaq 0x2fc9(%rip), %rcx      # 0x5088
movq (%rcx), %rcx
movsd (%rcx,%rax), %xmm3
movsd 0x8(%rcx,%rax), %xmm4
movq 0x20(%rsp), %rbx
movq %rbx, %r14
negq %r14
movapd %xmm1, %xmm5
xorpd %xmm0, %xmm0
mulsd %xmm0, %xmm5
movapd %xmm2, %xmm6
mulsd %xmm0, %xmm6
movsd %xmm2, 0x40(%rsp)
subsd %xmm2, %xmm5
movsd %xmm5, 0x68(%rsp)
movsd %xmm1, 0x48(%rsp)
addsd %xmm1, %xmm6
movsd %xmm6, 0x60(%rsp)
movapd %xmm3, %xmm1
mulsd %xmm0, %xmm1
movapd %xmm4, %xmm2
mulsd %xmm0, %xmm2
movsd %xmm4, 0x30(%rsp)
subsd %xmm4, %xmm1
movsd %xmm1, 0x58(%rsp)
movsd %xmm3, 0x38(%rsp)
addsd %xmm3, %xmm2
movsd %xmm2, 0x50(%rsp)
shlq $0x4, %rbx
shlq $0x4, %r14
addq 0x10(%rsp), %r14
xorl %r15d, %r15d
leaq 0x2f55(%rip), %rax      # 0x50a8
movq (%rax), %rax
movl (%rax,%r15,4), %r12d
movl 0x1c(%rsp), %ecx
shll %cl, %r12d
shlq $0x4, %r12
addq 0x28(%rsp), %r12
leaq (%r12,%rbx), %rsi
movl %ebp, %edi
movsd 0x48(%rsp), %xmm0
movsd 0x40(%rsp), %xmm1
movsd 0x38(%rsp), %xmm2
movsd 0x30(%rsp), %xmm3
callq 0x22ca
movsd 0x68(%rsp), %xmm4
ucomisd %xmm4, %xmm4
movsd 0x60(%rsp), %xmm1
jp 0x21e3
movsd 0x58(%rsp), %xmm2
ucomisd %xmm2, %xmm2
movsd 0x50(%rsp), %xmm3
jp 0x221b
addq %r14, %r12
movapd 0xe74(%rip), %xmm0      # 0x3030
xorpd %xmm0, %xmm1
xorpd %xmm0, %xmm2
movl %ebp, %edi
movq %r12, %rsi
movapd %xmm4, %xmm0
callq 0x22ca
incq %r15
cmpq %r15, %r13
jne 0x214c
jmp 0x2275
movsd 0x60(%rsp), %xmm0
ucomisd %xmm0, %xmm0
movsd 0x68(%rsp), %xmm4
movapd %xmm0, %xmm1
jnp 0x219f
xorps %xmm2, %xmm2
movsd 0x48(%rsp), %xmm0
movsd 0x40(%rsp), %xmm1
movsd 0x1050(%rip), %xmm3     # 0x3260
callq 0x2c80
movapd %xmm0, %xmm4
jmp 0x219f
movsd 0x50(%rsp), %xmm3
ucomisd %xmm3, %xmm3
movsd 0x58(%rsp), %xmm2
jnp 0x21b1
xorpd %xmm2, %xmm2
movsd 0x38(%rsp), %xmm0
movapd %xmm1, 0x90(%rsp)
movsd 0x30(%rsp), %xmm1
movsd 0x1012(%rip), %xmm3     # 0x3260
movsd %xmm4, 0x70(%rsp)
callq 0x2c80
movsd 0x70(%rsp), %xmm4
movapd %xmm0, %xmm2
movapd %xmm1, %xmm3
movapd 0x90(%rsp), %xmm1
jmp 0x21b1
movq 0x20(%rsp), %rax
incq %rax
cmpq 0x80(%rsp), %rax
movq 0x88(%rsp), %r15
jne 0x207d
incq %r15
cmpq 0x78(%rsp), %r15
movq 0x28(%rsp), %rsi
movsd 0xfa7(%rip), %xmm11     # 0x3250
movsd 0xfa6(%rip), %xmm12     # 0x3258
jne 0x1e18
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq