// File: /workspace/github_c_makefile_star2_O1/diaxen[P]fft-garden/sr_dit_bi_G_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, 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);
              }

            unsigned j1 = j0 + n4;
            w1 = get_twiddle(j1 << t, log2_N);
	    w3 = get_twiddle_sr(j1 << t, log2_N);

            for (unsigned i = 0; i < c; i++)
              {
                unsigned o = sr_sched_off[i] << (k + 1);
                sr_dit_bf4(n2, out + o + j1, w1, w3);
              }
	  }
      }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
bsrl %edi, %eax
movl %eax, 0xc(%rsp)
je 0x19d6
leaq 0x377f(%rip), %rax      # 0x5098
movq (%rax), %rax
leaq 0x3785(%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 0x1973
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 0x19c5
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 0x193c
cmpl $0x1, 0xc(%rsp)
jbe 0x1ac9
leaq 0x36b8(%rip), %rax      # 0x50a0
movq (%rax), %rax
movl 0x4(%rax), %eax
testq %rax, %rax
je 0x1ac9
leaq 0x36aa(%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 0x1a03
cmpl $0x3, 0xc(%rsp)
jb 0x1cc7
leaq 0x35c5(%rip), %rax      # 0x50a0
movq (%rax), %rax
movl 0x8(%rax), %eax
testq %rax, %rax
je 0x1cc7
leaq 0x35b7(%rip), %rcx      # 0x50a8
movq (%rcx), %rcx
xorl %edx, %edx
movsd 0x1722(%rip), %xmm0     # 0x3220
movsd 0x1722(%rip), %xmm1     # 0x3228
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 0x1b06
cmpl $0x4, 0xc(%rsp)
jb 0x2238
movl 0xc(%rsp), %edx
movl %edx, %eax
xorl $0x1f, %eax
movl $0x1c, %ecx
subl %eax, %ecx
movl $0x1, %edi
movl %ecx, 0x18(%rsp)
shll %cl, %edi
movq %rdi, 0x48(%rsp)
leal -0x1(%rdi), %ecx
movl %ecx, 0x14(%rsp)
movl $0x1e, %ecx
subl %eax, %ecx
movl %ecx, 0x10(%rsp)
movl %edx, %eax
movq %rax, 0x70(%rsp)
movl $0x3, %ebp
leaq 0x3391(%rip), %rbx      # 0x50a8
movsd 0x1500(%rip), %xmm11    # 0x3220
movsd 0x14ff(%rip), %xmm12    # 0x3228
movq %rsi, 0x20(%rsp)
leaq -0x1(%rbp), %rax
movl $0x1, %r15d
movl %eax, %ecx
shll %cl, %r15d
leal -0x2(%rbp), %ecx
movl $0x1, %edi
shll %cl, %edi
leaq 0x3352(%rip), %rcx      # 0x50a0
movq (%rcx), %rcx
movl (%rcx,%rbp,4), %edx
movq %rdi, %r13
movl %edi, %ecx
movq %rcx, 0x40(%rsp)
testq %rdx, %rdx
je 0x1f57
movq (%rbx), %r12
movl $0x2, %edi
movl %eax, %ecx
shll %cl, %edi
movl $0x3, %r8d
shll %cl, %r8d
movl %r15d, %eax
leal 0x1(%rbp), %ecx
shlq $0x4, %rax
shlq $0x4, %rdi
shlq $0x4, %r8
movq 0x40(%rsp), %r9
shlq $0x4, %r9
xorl %r10d, %r10d
movl (%r12,%r10,4), %r14d
shll %cl, %r14d
shlq $0x4, %r14
leaq (%rsi,%r14), %r11
movsd (%rsi,%r14), %xmm3
movsd 0x8(%rsi,%r14), %xmm4
movsd (%rax,%r11), %xmm0
movsd 0x8(%rax,%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,%r14)
movapd %xmm0, %xmm7
movsd %xmm9, 0x8(%rsi,%r14)
addsd %xmm5, %xmm7
movapd %xmm2, %xmm9
subsd %xmm1, %xmm9
movsd %xmm7, (%rax,%r11)
movsd %xmm9, 0x8(%rax,%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,%r9), %r14
movsd (%r9,%r11), %xmm3
movsd 0x8(%r9,%r11), %xmm0
movsd (%rax,%r14), %xmm1
movsd 0x8(%rax,%r14), %xmm2
movsd (%rdi,%r14), %xmm6
mulsd %xmm11, %xmm6
movsd 0x8(%rdi,%r14), %xmm4
mulsd %xmm11, %xmm4
movsd 0x8(%r8,%r14), %xmm7
mulsd %xmm11, %xmm7
movapd %xmm6, %xmm5
addsd %xmm4, %xmm5
movsd (%r8,%r14), %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, (%r9,%r11)
addsd %xmm4, %xmm10
movapd %xmm2, %xmm6
subsd %xmm5, %xmm6
movsd %xmm8, 0x8(%r9,%r11)
movsd %xmm10, (%rax,%r14)
subsd %xmm7, %xmm3
subsd %xmm9, %xmm0
movsd %xmm6, 0x8(%rax,%r14)
movsd %xmm3, (%rdi,%r14)
subsd %xmm4, %xmm1
addsd %xmm2, %xmm5
movsd %xmm0, 0x8(%rdi,%r14)
movsd %xmm1, (%r8,%r14)
movsd %xmm5, 0x8(%r8,%r14)
incq %r10
cmpq %r10, %rdx
jne 0x1d9a
movl %ebp, %eax
notl %eax
addl 0xc(%rsp), %eax
movl %eax, 0x1c(%rsp)
cmpl $0x3, %r13d
movl $0x2, %eax
cmovbl %eax, %r13d
movq %r13, 0x78(%rsp)
leal 0x1(%rbp), %r13d
movl $0x1, %edi
movq %rbp, 0x80(%rsp)
movq %rdi, 0x28(%rsp)
movl 0x1c(%rsp), %ecx
shll %cl, %edi
movl %edi, %eax
movl 0x18(%rsp), %ecx
shrl %cl, %eax
movl %edi, %edx
movl 0x14(%rsp), %r10d
andl %r10d, %edx
movq 0x48(%rsp), %r11
movl %r11d, %r9d
subl %edx, %r9d
btl %ecx, %edi
cmovael %edx, %r9d
movl %eax, %edx
shrl %edx
xorl %eax, %edx
movl %edx, %r8d
andl $0x1, %r8d
leaq 0x30b7(%rip), %rsi      # 0x5080
movq (%rsi), %rsi
shlq $0x4, %r9
addq %rsi, %r9
shlq $0x3f, %rax
xorq (%r9,%r8,8), %rax
xorl $0x1, %r8d
shlq $0x3f, %rdx
xorq (%r9,%r8,8), %rdx
leal (%rdi,%rdi,2), %edi
movl %edi, %r9d
andl %r10d, %r9d
movl %edi, %r8d
shrl %cl, %r8d
subl %r9d, %r11d
btl %ecx, %edi
cmovael %r9d, %r11d
movl %r8d, %r9d
shrl %r9d
xorl %r8d, %r9d
movl %r9d, %r10d
andl $0x1, %r10d
shlq $0x4, %r11
addq %rsi, %r11
shlq $0x3f, %r8
xorq (%r11,%r10,8), %r8
xorl $0x1, %r10d
shlq $0x3f, %r9
xorq (%r11,%r10,8), %r9
movq %r9, %xmm1
movq %r8, %xmm2
movl 0x10(%rsp), %ecx
shrl %cl, %edi
testl %edi, %edi
je 0x204f
movdqa 0xfe9(%rip), %xmm0      # 0x3030
pxor %xmm0, %xmm2
pxor %xmm0, %xmm1
leaq 0x304a(%rip), %rcx      # 0x50a0
movq (%rcx), %rcx
movl (%rcx,%rbp,4), %r14d
testq %r14, %r14
je 0x20c4
movq %rdx, 0x38(%rsp)
movq %rax, 0x30(%rsp)
movq 0x28(%rsp), %rbp
shlq $0x4, %rbp
addq 0x20(%rsp), %rbp
xorl %r12d, %r12d
movdqa %xmm1, 0x60(%rsp)
movdqa %xmm2, 0x50(%rsp)
movq (%rbx), %rax
movl (%rax,%r12,4), %esi
movl %r13d, %ecx
shll %cl, %esi
shlq $0x4, %rsi
addq %rbp, %rsi
movl %r15d, %edi
movq 0x30(%rsp), %xmm0
movq 0x38(%rsp), %xmm1
movdqa 0x50(%rsp), %xmm2
movapd 0x60(%rsp), %xmm3
callq 0x224a
incq %r12
cmpq %r12, %r14
jne 0x2089
movq 0x40(%rsp), %rax
movq 0x28(%rsp), %rcx
leaq (%rcx,%rax), %rbp
movl %ebp, %esi
movl 0x1c(%rsp), %ecx
shll %cl, %esi
movl %esi, %eax
movl 0x18(%rsp), %ecx
shrl %cl, %eax
movl %esi, %edx
movl 0x14(%rsp), %r11d
andl %r11d, %edx
movq 0x48(%rsp), %r10
movl %r10d, %r9d
subl %edx, %r9d
btl %ecx, %esi
cmovael %edx, %r9d
movl %eax, %edx
shrl %edx
xorl %eax, %edx
movl %edx, %r8d
andl $0x1, %r8d
leaq 0x2f6e(%rip), %rdi      # 0x5080
movq (%rdi), %rdi
shlq $0x4, %r9
addq %rdi, %r9
shlq $0x3f, %rax
xorq (%r9,%r8,8), %rax
xorl $0x1, %r8d
shlq $0x3f, %rdx
xorq (%r9,%r8,8), %rdx
leal (%rsi,%rsi,2), %esi
movl %esi, %r9d
andl %r11d, %r9d
movl %esi, %r8d
shrl %cl, %r8d
subl %r9d, %r10d
btl %ecx, %esi
cmovael %r9d, %r10d
movl %r8d, %r9d
shrl %r9d
xorl %r8d, %r9d
shlq $0x4, %r10
addq %rdi, %r10
movl %r9d, %edi
andl $0x1, %edi
shlq $0x3f, %r8
xorq (%r10,%rdi,8), %r8
xorl $0x1, %edi
shlq $0x3f, %r9
xorq (%r10,%rdi,8), %r9
movq %r9, %xmm1
movq %r8, %xmm2
movl 0x10(%rsp), %ecx
shrl %cl, %esi
testl %esi, %esi
je 0x2196
movdqa 0xea2(%rip), %xmm0      # 0x3030
pxor %xmm0, %xmm2
pxor %xmm0, %xmm1
testq %r14, %r14
je 0x21f8
movq %rdx, 0x38(%rsp)
movq %rax, 0x30(%rsp)
shlq $0x4, %rbp
addq 0x20(%rsp), %rbp
xorl %r12d, %r12d
movdqa %xmm1, 0x60(%rsp)
movdqa %xmm2, 0x50(%rsp)
movq (%rbx), %rax
movl (%rax,%r12,4), %esi
movl %r13d, %ecx
shll %cl, %esi
shlq $0x4, %rsi
addq %rbp, %rsi
movl %r15d, %edi
movq 0x30(%rsp), %xmm0
movq 0x38(%rsp), %xmm1
movdqa 0x50(%rsp), %xmm2
movapd 0x60(%rsp), %xmm3
callq 0x224a
incq %r12
cmpq %r12, %r14
jne 0x21bd
movq 0x28(%rsp), %rdi
incq %rdi
cmpq 0x78(%rsp), %rdi
movq 0x80(%rsp), %rbp
movsd 0x100a(%rip), %xmm11    # 0x3220
movsd 0x1009(%rip), %xmm12    # 0x3228
jne 0x1f86
incq %rbp
cmpq 0x70(%rsp), %rbp
movq 0x20(%rsp), %rsi
jne 0x1d2e
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq