// File: /workspace/github_c_makefile_star2_O3/diaxen[P]fft-garden/sr_dit_dr_P.c
// Function: sr_dit_dr
static void
sr_dit_dr(unsigned log2_N,
	  const complex double * restrict in,
	  complex double * restrict out,
	  unsigned l, unsigned i)
{
  unsigned is = 1 << (log2_N - l);
  unsigned os = 1 << (l - 2);
  unsigned t = log2_N - l;

  switch (l)
    {
    case 1:                     /* size 2 base case  */
      ct_dit_bf2_0(1, is, out, in + i);
      break;

    case 2:                     /* size 4 base case  */
      // sr_dit_dr(log2_N, in, out, 1, i);
      ct_dit_bf2_0(1, is * 2, out, in + i);

      out[2] = in[i + is];
      out[3] = in[i + 3 * is];
      sr_dit_bf4_0(1, out);
      break;

    default:
      sr_dit_dr(log2_N, in, out, l - 1, i);
      sr_dit_dr(log2_N, in, out + os * 2, l - 2, i + is);
      sr_dit_dr(log2_N, in, out + 3 * os, l - 2, i + 3 * is);

      unsigned k;
      sr_dit_bf4_0(os, out);
      sr_dit_bf4_pi4(os, out + os / 2);

      for (k = 1; k < os / 2; k++)
        sr_dit_bf4(os, out + k,
               get_twiddle(k << t, log2_N),
               get_twiddle_sr(k << t, log2_N));

      for (k++; k < os; k++)
        sr_dit_bf4(os, out + 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 $0x28, %rsp
movl %ecx, %eax
movq %rdx, %r13
movl %edi, %ebp
subl %ecx, %ebp
movl $0x1, %r15d
movl %ebp, %ecx
shll %cl, %r15d
movq %rsi, %r12
movl $0x1, %r14d
leal -0x2(%rax), %ecx
shll %cl, %r14d
cmpl $0x2, %eax
je 0x1a98
cmpl $0x1, %eax
jne 0x1b3b
movl %r8d, %eax
shlq $0x4, %rax
leaq (%r12,%rax), %rcx
movl %r15d, %edx
shlq $0x4, %rdx
movupd (%r12,%rax), %xmm0
movupd (%rdx,%rcx), %xmm1
movapd %xmm0, %xmm2
addpd %xmm1, %xmm2
movupd %xmm2, (%r13)
subpd %xmm1, %xmm0
movupd %xmm0, 0x10(%r13)
jmp 0x1e1a
movl $0x2, %eax
movl %ebp, %ecx
shll %cl, %eax
movl %r8d, %edx
shlq $0x4, %rdx
leaq (%r12,%rdx), %rsi
shlq $0x4, %rax
movl $0x3, %edi
shll %cl, %edi
addl %r8d, %r15d
shlq $0x4, %r15
addl %r8d, %edi
shlq $0x4, %rdi
movupd (%r12,%rdx), %xmm0
movupd (%rax,%rsi), %xmm1
movapd %xmm0, %xmm2
addpd %xmm1, %xmm2
movupd (%r12,%r15), %xmm3
movupd (%r12,%rdi), %xmm4
movapd %xmm4, %xmm5
addpd %xmm3, %xmm5
movapd %xmm2, %xmm6
addpd %xmm5, %xmm6
movupd %xmm6, (%r13)
subpd %xmm1, %xmm0
subpd %xmm4, %xmm3
shufpd $0x1, %xmm3, %xmm3      # xmm3 = xmm3[1,0]
movapd %xmm0, %xmm1
addpd %xmm3, %xmm1
subpd %xmm3, %xmm0
movapd %xmm0, %xmm3
movsd %xmm1, %xmm3            # xmm3 = xmm1[0],xmm3[1]
movupd %xmm3, 0x10(%r13)
subpd %xmm5, %xmm2
movupd %xmm2, 0x20(%r13)
shufpd $0x2, %xmm1, %xmm0      # xmm0 = xmm0[0],xmm1[1]
movupd %xmm0, 0x30(%r13)
jmp 0x1e1a
movl %edi, %ebx
decl %eax
movq %r12, %rsi
movl %ecx, 0xc(%rsp)
movq %r13, %rdx
movl %eax, %ecx
movl %r8d, 0x10(%rsp)
callq 0x1a1f
movl $0x2, %edx
movl 0xc(%rsp), %ecx
shll %cl, %edx
movl $0x2, %eax
movq %rax, 0x18(%rsp)
shlq $0x4, %rdx
movq %rdx, 0x20(%rsp)
addq %r13, %rdx
addl 0x10(%rsp), %r15d
movl %ebx, %edi
movq %r12, %rsi
movl %r15d, %r8d
callq 0x1a1f
movl $0x3, %r15d
movl 0xc(%rsp), %eax
movl %eax, %ecx
shll %cl, %r15d
movl $0x3, %r8d
shlq $0x4, %r15
leaq (%r15,%r13), %rdx
movl %ebp, %ecx
shll %cl, %r8d
addl 0x10(%rsp), %r8d
movl %ebx, %edi
movq %r12, %rsi
movl %eax, %ecx
movl %eax, %ebx
callq 0x1a1f
movq %r14, %rax
shlq $0x4, %rax
movupd (%r13), %xmm0
movq 0x20(%rsp), %rdi
movupd (%r13,%rdi), %xmm1
movupd (%r13,%r15), %xmm2
movapd %xmm1, %xmm3
addpd %xmm2, %xmm3
movapd %xmm0, %xmm4
addpd %xmm3, %xmm4
movupd %xmm4, (%r13)
movupd (%r13,%rax), %xmm4
subpd %xmm2, %xmm1
shufpd $0x1, %xmm1, %xmm1      # xmm1 = xmm1[1,0]
movapd %xmm4, %xmm2
addpd %xmm1, %xmm2
subpd %xmm1, %xmm4
movapd %xmm4, %xmm1
movsd %xmm2, %xmm1            # xmm1 = xmm2[0],xmm1[1]
movupd %xmm1, (%r13,%rax)
subpd %xmm3, %xmm0
movupd %xmm0, (%r13,%rdi)
shufpd $0x2, %xmm2, %xmm4      # xmm4 = xmm4[0],xmm2[1]
movupd %xmm4, (%r13,%r15)
movl %r14d, %ecx
shrl %ecx
movq %rcx, %rsi
shlq $0x4, %rsi
leaq (%rsi,%r13), %rdx
movsd (%r13,%rsi), %xmm2
movsd 0x8(%r13,%rsi), %xmm3
movsd (%rax,%rdx), %xmm0
movsd 0x8(%rax,%rdx), %xmm1
movsd (%r15,%rdx), %xmm6
movsd 0x15e4(%rip), %xmm7     # 0x3250
movsd (%rdi,%rdx), %xmm8
mulsd %xmm7, %xmm8
movsd 0x8(%rdi,%rdx), %xmm4
mulsd %xmm7, %xmm4
mulsd 0x8(%r15,%rdx), %xmm7
movapd %xmm8, %xmm5
addsd %xmm4, %xmm5
mulsd 0x15bf(%rip), %xmm6     # 0x3258
subsd %xmm8, %xmm4
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, (%r13,%rsi)
movsd %xmm9, 0x8(%r13,%rsi)
movapd %xmm0, %xmm6
addsd %xmm4, %xmm6
movapd %xmm1, %xmm9
subsd %xmm5, %xmm9
movsd %xmm6, (%rax,%rdx)
movsd %xmm9, 0x8(%rax,%rdx)
subsd %xmm7, %xmm2
subsd %xmm8, %xmm3
movsd %xmm2, (%rdi,%rdx)
movsd %xmm3, 0x8(%rdi,%rdx)
subsd %xmm4, %xmm0
addsd %xmm1, %xmm5
movsd %xmm0, (%r15,%rdx)
movsd %xmm5, 0x8(%r15,%rdx)
movl $0x1, %eax
cmpl $0x2, %ebx
jb 0x1db2
cmpl $0x3, %ecx
movq 0x18(%rsp), %rax
cmovael %ecx, %eax
movq %rax, 0x18(%rsp)
movq %r13, 0x10(%rsp)
leaq 0x10(%r13), %rbx
movl $0x1, %r15d
leaq 0x3321(%rip), %r12      # 0x5080
leaq 0x3322(%rip), %r13      # 0x5088
movl %r15d, %eax
movl %ebp, %ecx
shll %cl, %eax
movq (%r12), %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 %rbx, %rsi
callq 0x1e3e
incq %r15
addq $0x10, %rbx
cmpq %r15, 0x18(%rsp)
jne 0x1d66
movq 0x18(%rsp), %rax
movq 0x10(%rsp), %r13
leal 0x1(%rax), %ecx
cmpl %r14d, %ecx
jae 0x1e1a
movl %eax, %eax
leaq 0x1(%rax), %r15
shlq $0x4, %rax
leaq (%rax,%r13), %rbx
addq $0x10, %rbx
leaq 0x32ad(%rip), %r12      # 0x5080
leaq 0x32ae(%rip), %r13      # 0x5088
movl %r15d, %eax
movl %ebp, %ecx
shll %cl, %eax
movq (%r12), %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 %rbx, %rsi
callq 0x1e3e
incq %r15
addq $0x10, %rbx
cmpq %r15, %r14
jne 0x1dda
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq