// File: /workspace/github_c_makefile_star2_O1/diaxen[P]fft-garden/sr_dit_bi_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, 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)
    {
      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_pi4(2, out + o + 1);
          sr_dit_bf4_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++)
          {
            complex double *o = out + (sr_sched_off[i] << (s + 1));
            unsigned t = log2_N - s - 1;
            unsigned os = 1 << (s - 1);
            unsigned k;

            sr_dit_bf4_0(os, o);
            sr_dit_bf4_pi4(os, o + os / 2);

            for (k = 1; k < os / 2; k++)
              {
                complex double w1 = get_twiddle(k << t, log2_N);
                complex double w3 = get_twiddle_sr(k << t, log2_N);
                sr_dit_bf4(os, o + k, w1, w3);
                sr_dit_bf4(os, o + os - k, conj(w1 * I), -conj(w3 * I));
              }
          }

      }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
bsrl %edi, %eax
movl %eax, (%rsp)
je 0x19d5
leaq 0x3780(%rip), %rax      # 0x5098
movq (%rax), %rax
leaq 0x3786(%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 0x1972
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 0x19c4
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 0x193b
cmpl $0x1, (%rsp)
jbe 0x1ac7
leaq 0x36ba(%rip), %rax      # 0x50a0
movq (%rax), %rax
movl 0x4(%rax), %eax
testq %rax, %rax
je 0x1ac7
leaq 0x36ac(%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 0x1a01
cmpl $0x3, (%rsp)
jb 0x1cc4
leaq 0x35c8(%rip), %rax      # 0x50a0
movq (%rax), %rax
movl 0x8(%rax), %eax
testq %rax, %rax
je 0x1cc4
leaq 0x35ba(%rip), %rcx      # 0x50a8
movq (%rcx), %rcx
xorl %edx, %edx
movsd 0x1725(%rip), %xmm0     # 0x3220
movsd 0x1725(%rip), %xmm1     # 0x3228
movl (%rcx,%rdx,4), %edi
shll $0x3, %edi
shlq $0x4, %rdi
movsd 0x10(%rsi,%rdi), %xmm4
movsd 0x18(%rsi,%rdi), %xmm5
movsd 0x30(%rsi,%rdi), %xmm2
movsd 0x38(%rsi,%rdi), %xmm3
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
mulsd %xmm1, %xmm10
movapd %xmm10, %xmm11
subsd %xmm8, %xmm6
addsd %xmm9, %xmm11
subsd %xmm9, %xmm10
movapd %xmm7, %xmm8
addsd %xmm11, %xmm8
subsd %xmm11, %xmm7
movapd %xmm6, %xmm9
subsd %xmm10, %xmm6
addsd %xmm10, %xmm9
movapd %xmm4, %xmm10
addsd %xmm8, %xmm10
movapd %xmm5, %xmm11
addsd %xmm9, %xmm11
movsd %xmm10, 0x10(%rsi,%rdi)
movapd %xmm2, %xmm10
addsd %xmm6, %xmm10
movsd %xmm11, 0x18(%rsi,%rdi)
movapd %xmm3, %xmm11
subsd %xmm7, %xmm11
movsd %xmm10, 0x30(%rsi,%rdi)
movsd %xmm11, 0x38(%rsi,%rdi)
subsd %xmm8, %xmm4
subsd %xmm9, %xmm5
movsd %xmm4, 0x50(%rsi,%rdi)
movsd %xmm5, 0x58(%rsi,%rdi)
subsd %xmm6, %xmm2
addsd %xmm3, %xmm7
movsd %xmm2, 0x70(%rsi,%rdi)
movsd %xmm7, 0x78(%rsi,%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)
incq %rdx
cmpq %rdx, %rax
jne 0x1b03
movq %rsi, 0x18(%rsp)
cmpl $0x4, (%rsp)
jb 0x21e3
movl (%rsp), %edx
movl %edx, %eax
xorl $0x1f, %eax
movl $0x1c, %ebp
subl %eax, %ebp
movl $0x1, %esi
movl %ebp, %ecx
shll %cl, %esi
movq %rsi, 0x98(%rsp)
leal -0x1(%rsi), %r12d
movl $0x1e, %ecx
subl %eax, %ecx
movl %ecx, 0x8(%rsp)
movl %edx, %eax
movq %rax, 0x50(%rsp)
movq 0x18(%rsp), %rax
leaq 0x10(%rax), %rcx
movq %rcx, 0x58(%rsp)
addq $-0x10, %rax
movq %rax, 0x48(%rsp)
movl $0x3, %ecx
leaq 0x3374(%rip), %rax      # 0x50a0
movq (%rax), %rax
movq %rcx, 0x10(%rsp)
movl (%rax,%rcx,4), %eax
movq %rax, 0x88(%rsp)
testq %rax, %rax
je 0x21d0
movq 0x10(%rsp), %rax
leal -0x1(%rax), %ecx
movl $0x1, %r15d
shll %cl, %r15d
movl %eax, %edx
movl $0x2, %esi
shll %cl, %esi
movl $0x3, %edi
shll %cl, %edi
notl %edx
addl (%rsp), %edx
movl %edx, 0xc(%rsp)
movl %r15d, %edx
shrl %edx
cmpl $0x3, %edx
movl %edx, %r8d
movl $0x2, %ecx
cmovbl %ecx, %r8d
movq %r8, 0xa0(%rsp)
incl %eax
movl %eax, 0x4(%rsp)
movq %r15, %rcx
shlq $0x4, %rcx
movq 0x48(%rsp), %rax
movq %rcx, 0x68(%rsp)
addq %rcx, %rax
movq %rax, 0x60(%rsp)
shlq $0x4, %rsi
movq %rsi, 0x80(%rsp)
shlq $0x4, %rdi
movq %rdi, 0x78(%rsp)
shlq $0x4, %rdx
movq %rdx, 0x70(%rsp)
xorl %ecx, %ecx
leaq 0x32d4(%rip), %rax      # 0x50a8
movq (%rax), %rax
movq %rcx, 0x90(%rsp)
movl (%rax,%rcx,4), %r13d
movl 0x4(%rsp), %ecx
shll %cl, %r13d
shlq $0x4, %r13
movq 0x18(%rsp), %rcx
leaq (%rcx,%r13), %rax
movsd (%rcx,%r13), %xmm3
movsd 0x8(%rcx,%r13), %xmm4
movq 0x68(%rsp), %r8
movsd (%r8,%rax), %xmm0
movsd 0x8(%r8,%rax), %xmm2
movq 0x80(%rsp), %rdx
movsd (%rdx,%rax), %xmm1
movsd 0x8(%rdx,%rax), %xmm5
movq 0x78(%rsp), %rsi
movsd (%rsi,%rax), %xmm6
movsd 0x8(%rsi,%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, (%rcx,%r13)
movsd %xmm9, 0x8(%rcx,%r13)
movapd %xmm0, %xmm7
addsd %xmm5, %xmm7
movapd %xmm2, %xmm9
subsd %xmm1, %xmm9
movsd %xmm7, (%r8,%rax)
movsd %xmm9, 0x8(%r8,%rax)
subsd %xmm8, %xmm3
subsd %xmm6, %xmm4
movsd %xmm3, (%rdx,%rax)
movsd %xmm4, 0x8(%rdx,%rax)
subsd %xmm5, %xmm0
addsd %xmm2, %xmm1
movsd %xmm0, (%rsi,%rax)
movsd %xmm1, 0x8(%rsi,%rax)
movq 0x70(%rsp), %rdi
leaq (%rax,%rdi), %rcx
movsd (%rdi,%rax), %xmm2
movsd 0x8(%rdi,%rax), %xmm3
movsd (%r8,%rcx), %xmm0
movsd 0x8(%r8,%rcx), %xmm1
movsd (%rdx,%rcx), %xmm6
movsd 0x1339(%rip), %xmm5     # 0x3220
mulsd %xmm5, %xmm6
movsd 0x8(%rdx,%rcx), %xmm4
mulsd %xmm5, %xmm4
movsd 0x8(%rsi,%rcx), %xmm7
mulsd %xmm5, %xmm7
movapd %xmm6, %xmm5
addsd %xmm4, %xmm5
subsd %xmm6, %xmm4
movsd (%rsi,%rcx), %xmm6
mulsd 0x1310(%rip), %xmm6     # 0x3228
movapd %xmm6, %xmm8
addsd %xmm7, %xmm8
subsd %xmm7, %xmm6
movapd %xmm5, %xmm7
addsd %xmm8, %xmm7
subsd %xmm8, %xmm5
movapd %xmm4, %xmm8
addsd %xmm6, %xmm8
subsd %xmm6, %xmm4
movapd %xmm2, %xmm6
addsd %xmm7, %xmm6
movapd %xmm3, %xmm9
addsd %xmm8, %xmm9
movsd %xmm6, (%rdi,%rax)
movsd %xmm9, 0x8(%rdi,%rax)
movapd %xmm0, %xmm6
addsd %xmm4, %xmm6
movapd %xmm1, %xmm9
subsd %xmm5, %xmm9
movsd %xmm6, (%r8,%rcx)
movsd %xmm9, 0x8(%r8,%rcx)
subsd %xmm7, %xmm2
subsd %xmm8, %xmm3
movsd %xmm2, (%rdx,%rcx)
movsd %xmm3, 0x8(%rdx,%rcx)
subsd %xmm4, %xmm0
addsd %xmm1, %xmm5
movsd %xmm0, (%rsi,%rcx)
movsd %xmm5, 0x8(%rsi,%rcx)
movq 0x58(%rsp), %rax
leaq (%rax,%r13), %rbx
addq 0x60(%rsp), %r13
movl $0x1, %r14d
movl %r14d, %esi
movl 0xc(%rsp), %ecx
shll %cl, %esi
movl %esi, %eax
movl %ebp, %ecx
shrl %cl, %eax
movl %esi, %edx
andl %r12d, %edx
movq 0x98(%rsp), %r10
movl %r10d, %ecx
subl %edx, %ecx
btl %ebp, %esi
cmovael %edx, %ecx
movl %eax, %edx
shrl %edx
xorl %eax, %edx
movl %edx, %r8d
andl $0x1, %r8d
leaq 0x308b(%rip), %rdi      # 0x5080
movq (%rdi), %rdi
shlq $0x4, %rcx
addq %rdi, %rcx
shlq $0x3f, %rax
xorq (%rcx,%r8,8), %rax
xorl $0x1, %r8d
shlq $0x3f, %rdx
xorq (%rcx,%r8,8), %rdx
leal (%rsi,%rsi,2), %esi
movl %esi, %r9d
andl %r12d, %r9d
movl %esi, %r8d
movl %ebp, %ecx
shrl %cl, %r8d
movl %r10d, %ecx
subl %r9d, %ecx
btl %ebp, %esi
cmovael %r9d, %ecx
movl %r8d, %r9d
shrl %r9d
xorl %r8d, %r9d
movl %r9d, %r10d
andl $0x1, %r10d
shlq $0x4, %rcx
addq %rdi, %rcx
shlq $0x3f, %r8
xorq (%rcx,%r10,8), %r8
xorl $0x1, %r10d
shlq $0x3f, %r9
xorq (%rcx,%r10,8), %r9
movq %r9, %xmm3
movq %r8, %xmm2
movl 0x8(%rsp), %ecx
shrl %cl, %esi
testl %esi, %esi
je 0x2080
movdqa 0xfb8(%rip), %xmm0      # 0x3030
pxor %xmm0, %xmm2
pxor %xmm0, %xmm3
movq %rdx, %xmm1
movq %xmm1, 0xa8(%rsp)
movq %rax, %xmm0
movq %xmm0, 0xb0(%rsp)
movl %r15d, %edi
movq %rbx, %rsi
movdqa %xmm2, 0x20(%rsp)
movdqa %xmm3, 0x30(%rsp)
callq 0x21f5
movsd 0xa8(%rsp), %xmm1
movsd 0xb0(%rsp), %xmm2
movapd %xmm2, %xmm5
pxor %xmm0, %xmm0
mulsd %xmm0, %xmm5
movapd %xmm1, %xmm6
mulsd %xmm0, %xmm6
subsd %xmm1, %xmm5
addsd %xmm2, %xmm6
ucomisd %xmm5, %xmm5
jp 0x2153
movapd 0x20(%rsp), %xmm0
movapd %xmm0, %xmm2
xorpd %xmm4, %xmm4
mulsd %xmm4, %xmm2
movapd 0x30(%rsp), %xmm1
movapd %xmm1, %xmm3
mulsd %xmm4, %xmm3
subsd %xmm1, %xmm2
addsd %xmm0, %xmm3
ucomisd %xmm2, %xmm2
jp 0x217b
movapd 0xf13(%rip), %xmm0      # 0x3030
xorpd %xmm0, %xmm6
xorpd %xmm0, %xmm2
movl %r15d, %edi
movq %r13, %rsi
movapd %xmm5, %xmm0
movapd %xmm6, %xmm1
callq 0x21f5
incq %r14
addq $0x10, %rbx
addq $-0x10, %r13
cmpq %r14, 0xa0(%rsp)
jne 0x1fba
jmp 0x21b7
ucomisd %xmm6, %xmm6
jnp 0x20e7
movapd %xmm2, %xmm0
xorpd %xmm2, %xmm2
movq 0x10c7(%rip), %xmm3     # 0x3230
callq 0x2ba0
movapd %xmm0, %xmm5
movapd %xmm1, %xmm6
jmp 0x20e7
ucomisd %xmm3, %xmm3
jnp 0x2115
xorpd %xmm2, %xmm2
movsd 0x10a3(%rip), %xmm3     # 0x3230
movsd %xmm5, 0x30(%rsp)
movapd %xmm6, 0x20(%rsp)
callq 0x2ba0
movapd 0x20(%rsp), %xmm6
movsd 0x30(%rsp), %xmm5
movapd %xmm0, %xmm2
movapd %xmm1, %xmm3
jmp 0x2115
movq 0x90(%rsp), %rcx
incq %rcx
cmpq 0x88(%rsp), %rcx
jne 0x1dcd
movq 0x10(%rsp), %rcx
incq %rcx
cmpq 0x50(%rsp), %rcx
jne 0x1d25
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq