// File: /workspace/github_c_makefile_star2_O1/diaxen[P]fft-garden/sr_dit_bi_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 = 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++)
              sr_dit_bf4(os, o + k,
                     get_twiddle(k << t, log2_N),
                     get_twiddle_sr(k << t, log2_N));

            for (k++; 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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
bsrl %edi, %eax
movl %eax, 0xc(%rsp)
je 0x1af3
leaq 0x3662(%rip), %rax      # 0x5098
movq (%rax), %rax
leaq 0x3668(%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 0x1a90
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 0x1ae2
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 0x1a59
cmpl $0x1, 0xc(%rsp)
jbe 0x1be6
leaq 0x359b(%rip), %rax      # 0x50a0
movq (%rax), %rax
movl 0x4(%rax), %eax
testq %rax, %rax
je 0x1be6
leaq 0x358d(%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 0x1b20
cmpl $0x3, 0xc(%rsp)
jb 0x1de4
leaq 0x34a8(%rip), %rax      # 0x50a0
movq (%rax), %rax
movl 0x8(%rax), %eax
testq %rax, %rax
je 0x1de4
leaq 0x349a(%rip), %rcx      # 0x50a8
movq (%rcx), %rcx
xorl %edx, %edx
movsd 0x1635(%rip), %xmm0     # 0x3250
movsd 0x1635(%rip), %xmm1     # 0x3258
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 0x1c23
cmpl $0x4, 0xc(%rsp)
jb 0x218f
movl 0xc(%rsp), %eax
movq %rax, 0x20(%rsp)
leaq 0x10(%rsi), %rax
movq %rax, 0x30(%rsp)
leaq 0x30(%rsi), %rax
movq %rax, 0x28(%rsp)
movl $0x3, %ecx
movq %rsi, 0x38(%rsp)
leaq 0x3285(%rip), %rax      # 0x50a0
movq (%rax), %rax
movq %rcx, 0x18(%rsp)
movl (%rax,%rcx,4), %eax
movq %rax, 0x68(%rsp)
testq %rax, %rax
je 0x217c
movq 0x18(%rsp), %rdx
leal -0x1(%rdx), %ecx
movl $0x1, %r14d
shll %cl, %r14d
movl %edx, %r15d
notl %r15d
movl $0x2, %edi
shll %cl, %edi
movl $0x3, %r8d
shll %cl, %r8d
addl 0xc(%rsp), %r15d
movl %r14d, %r9d
shrl %r9d
cmpl $0x3, %r9d
movl %r9d, %eax
movl $0x2, %ecx
cmovbl %ecx, %eax
leal 0x1(%rdx), %ecx
movl %ecx, 0x14(%rsp)
movl $0x1, %ecx
subq %rax, %rcx
movq %rcx, 0x48(%rsp)
movq %r14, %rax
shlq $0x4, %rax
movq %rax, 0x40(%rsp)
shlq $0x4, %rdi
movq %rdi, 0x60(%rsp)
shlq $0x4, %r8
movq %r8, 0x58(%rsp)
shlq $0x4, %r9
movq %r9, 0x50(%rsp)
xorl %ecx, %ecx
movl %r15d, 0x10(%rsp)
leaq 0x31ea(%rip), %rax      # 0x50a8
movq (%rax), %rax
movq %rcx, 0x70(%rsp)
movl (%rax,%rcx,4), %eax
movl 0x14(%rsp), %ecx
shll %cl, %eax
shlq $0x4, %rax
leaq (%rsi,%rax), %rcx
movsd (%rsi,%rax), %xmm3
movsd 0x8(%rsi,%rax), %xmm4
movq 0x40(%rsp), %r9
movsd (%r9,%rcx), %xmm0
movsd 0x8(%r9,%rcx), %xmm2
movq 0x60(%rsp), %rdi
movsd (%rdi,%rcx), %xmm1
movsd 0x8(%rdi,%rcx), %xmm5
movq 0x58(%rsp), %r8
movsd (%r8,%rcx), %xmm6
movsd 0x8(%r8,%rcx), %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,%rax)
movsd %xmm9, 0x8(%rsi,%rax)
movapd %xmm0, %xmm7
addsd %xmm5, %xmm7
movapd %xmm2, %xmm9
subsd %xmm1, %xmm9
movsd %xmm7, (%r9,%rcx)
movsd %xmm9, 0x8(%r9,%rcx)
subsd %xmm8, %xmm3
subsd %xmm6, %xmm4
movsd %xmm3, (%rdi,%rcx)
movsd %xmm4, 0x8(%rdi,%rcx)
subsd %xmm5, %xmm0
addsd %xmm2, %xmm1
movsd %xmm0, (%r8,%rcx)
movsd %xmm1, 0x8(%r8,%rcx)
movq 0x50(%rsp), %rsi
leaq (%rcx,%rsi), %rdx
movsd (%rsi,%rcx), %xmm2
movsd 0x8(%rsi,%rcx), %xmm3
movsd (%r9,%rdx), %xmm0
movsd 0x8(%r9,%rdx), %xmm1
movsd (%rdi,%rdx), %xmm6
movsd 0x128b(%rip), %xmm5     # 0x3250
mulsd %xmm5, %xmm6
movsd 0x8(%rdi,%rdx), %xmm4
mulsd %xmm5, %xmm4
movsd 0x8(%r8,%rdx), %xmm7
mulsd %xmm5, %xmm7
movapd %xmm6, %xmm5
addsd %xmm4, %xmm5
subsd %xmm6, %xmm4
movsd (%r8,%rdx), %xmm6
mulsd 0x1260(%rip), %xmm6     # 0x3258
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, (%rsi,%rcx)
movsd %xmm9, 0x8(%rsi,%rcx)
movapd %xmm0, %xmm6
addsd %xmm4, %xmm6
movapd %xmm1, %xmm9
subsd %xmm5, %xmm9
movsd %xmm6, (%r9,%rdx)
movsd %xmm9, 0x8(%r9,%rdx)
subsd %xmm7, %xmm2
subsd %xmm8, %xmm3
movsd %xmm2, (%rdi,%rdx)
movsd %xmm3, 0x8(%rdi,%rdx)
subsd %xmm4, %xmm0
addsd %xmm1, %xmm5
movsd %xmm0, (%r8,%rdx)
movsd %xmm5, 0x8(%r8,%rdx)
movq 0x30(%rsp), %rcx
movq %r14, %rbp
leaq (%rcx,%rax), %r13
addq 0x28(%rsp), %rax
movl $0x1, %r15d
movl $0x2, %ebx
movq 0x48(%rsp), %r14
movl %r15d, %edx
movl 0x10(%rsp), %ecx
shll %cl, %edx
movq %rax, %r12
leaq 0x2fc4(%rip), %rax      # 0x5080
movq (%rax), %rax
shlq $0x4, %rdx
movsd (%rax,%rdx), %xmm0
movsd 0x8(%rax,%rdx), %xmm1
leaq 0x2fb3(%rip), %rax      # 0x5088
movq (%rax), %rax
movsd (%rax,%rdx), %xmm2
movsd 0x8(%rax,%rdx), %xmm3
movl %ebp, %edi
movq %r13, %rsi
callq 0x219e
incl %r15d
addq $0x10, %r13
leaq (%r14,%rbx), %rcx
incq %rcx
incq %rbx
leaq 0x10(%r12), %rax
cmpq $0x2, %rcx
jne 0x20a9
movq %rbp, %r14
cmpl %r14d, %ebx
leaq 0x2f6a(%rip), %rbp      # 0x5080
leaq 0x2f6b(%rip), %r13      # 0x5088
movl 0x10(%rsp), %r15d
jae 0x2164
movl %ebx, %eax
movl %r15d, %ecx
shll %cl, %eax
movq (%rbp), %rcx
shlq $0x4, %rax
movsd (%rcx,%rax), %xmm0
movsd 0x8(%rcx,%rax), %xmm1
movq (%r13), %rcx
movsd (%rcx,%rax), %xmm2
movsd 0x8(%rcx,%rax), %xmm3
movl %r14d, %edi
movq %r12, %rsi
callq 0x219e
incq %rbx
addq $0x10, %r12
cmpq %rbx, %r14
jne 0x2124
movq 0x70(%rsp), %rcx
incq %rcx
cmpq 0x68(%rsp), %rcx
movq 0x38(%rsp), %rsi
jne 0x1eb7
movq 0x18(%rsp), %rcx
incq %rcx
cmpq 0x20(%rsp), %rcx
jne 0x1e14
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq