// File: /workspace/github_c_makefile_star2_O2/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 $0x18, %rsp
movl %ecx, %eax
movl %edi, %ebp
subl %ecx, %ebp
pushq $0x1
popq %r14
movl %r14d, %r13d
movl %ebp, %ecx
shll %cl, %r13d
movq %rdx, %rbx
movq %rsi, %r9
leal -0x2(%rax), %r15d
movl %r15d, %ecx
shll %cl, %r14d
cmpl $0x2, %eax
je 0x1a1b
cmpl $0x1, %eax
jne 0x1a7a
movl %r8d, %eax
shlq $0x4, %rax
addq %rax, %r9
movl %r13d, %edi
movq %rbx, %rsi
movq %r9, %rdx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1cc6
pushq $0x2
popq %rdi
movl %ebp, %ecx
shll %cl, %edi
movl %r8d, %edx
shlq $0x4, %rdx
addq %r9, %rdx
movq %rbx, %rsi
movq %r9, %r14
movl %r8d, %r15d
callq 0x1cc6
addl %r15d, %r13d
shlq $0x4, %r13
movups (%r14,%r13), %xmm0
pushq $0x3
popq %rax
movl %ebp, %ecx
shll %cl, %eax
movups %xmm0, 0x20(%rbx)
addl %r15d, %eax
shlq $0x4, %rax
movups (%r14,%rax), %xmm0
movups %xmm0, 0x30(%rbx)
pushq $0x1
popq %rdi
movq %rbx, %rsi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1ceb
movl %edi, %r12d
decl %eax
movq %r9, %rsi
movq %rbx, %rdx
movl %eax, %ecx
movq %r9, 0x8(%rsp)
movl %r8d, (%rsp)
callq 0x19b7
pushq $0x2
popq %rax
movl %r15d, %ecx
shll %cl, %eax
shlq $0x4, %rax
movq %rax, 0x10(%rsp)
leaq (%rbx,%rax), %rdx
addl (%rsp), %r13d
movl %r12d, %edi
movq 0x8(%rsp), %rsi
movl %r15d, %ecx
movl %r13d, %r8d
callq 0x19b7
pushq $0x3
popq %r8
movl %r8d, %r13d
movl %r15d, %ecx
shll %cl, %r13d
shlq $0x4, %r13
leaq (%rbx,%r13), %rdx
movl %ebp, %ecx
shll %cl, %r8d
addl (%rsp), %r8d
movl %r12d, %edi
movq 0x8(%rsp), %rsi
movl %r15d, %ecx
callq 0x19b7
movl %r14d, %edi
movq %rbx, %rsi
callq 0x1ceb
movl %r14d, %ecx
shrl %ecx
movq %rcx, (%rsp)
shlq $0x4, %rcx
leaq (%rbx,%rcx), %rax
movsd (%rbx,%rcx), %xmm0
movsd 0x8(%rbx,%rcx), %xmm1
movl %r14d, %edx
movq %rdx, 0x8(%rsp)
shlq $0x4, %rdx
movsd (%rdx,%rax), %xmm2
movsd 0x8(%rdx,%rax), %xmm3
movsd (%r13,%rax), %xmm6
movsd 0x1714(%rip), %xmm7     # 0x3250
movq 0x10(%rsp), %rsi
movsd (%rsi,%rax), %xmm8
mulsd %xmm7, %xmm8
movsd 0x8(%rsi,%rax), %xmm4
mulsd %xmm7, %xmm4
mulsd 0x8(%r13,%rax), %xmm7
movapd %xmm8, %xmm5
addsd %xmm4, %xmm5
subsd %xmm8, %xmm4
mulsd 0x16e5(%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 %xmm0, %xmm6
addsd %xmm7, %xmm6
movapd %xmm1, %xmm9
addsd %xmm8, %xmm9
movsd %xmm6, (%rbx,%rcx)
movsd %xmm9, 0x8(%rbx,%rcx)
movapd %xmm2, %xmm6
addsd %xmm4, %xmm6
movapd %xmm3, %xmm9
subsd %xmm5, %xmm9
movsd %xmm6, (%rdx,%rax)
movsd %xmm9, 0x8(%rdx,%rax)
subsd %xmm7, %xmm0
subsd %xmm8, %xmm1
movsd %xmm0, (%rsi,%rax)
movsd %xmm1, 0x8(%rsi,%rax)
subsd %xmm4, %xmm2
addsd %xmm3, %xmm5
movsd %xmm2, (%r13,%rax)
movsd %xmm5, 0x8(%r13,%rax)
addq $0x20, %rbx
pushq $0x1
popq %r13
leaq 0x346e(%rip), %r15      # 0x5080
leaq 0x346f(%rip), %r12      # 0x5088
cmpq (%rsp), %r13
jae 0x1c5c
movl %r13d, %eax
movl %ebp, %ecx
shll %cl, %eax
leaq -0x10(%rbx), %rsi
movq (%r15), %rcx
shlq $0x4, %rax
movsd (%rcx,%rax), %xmm0
movsd 0x8(%rcx,%rax), %xmm1
movq (%r12), %rcx
movsd (%rcx,%rax), %xmm2
movsd 0x8(%rcx,%rax), %xmm3
movl %r14d, %edi
callq 0x1d5c
incq %r13
addq $0x10, %rbx
jmp 0x1c19
incq %r13
cmpq 0x8(%rsp), %r13
jae 0x1ca2
movl %r13d, %eax
movl %ebp, %ecx
shll %cl, %eax
movq (%r15), %rcx
shlq $0x4, %rax
movsd (%rcx,%rax), %xmm0
movsd 0x8(%rcx,%rax), %xmm1
movq (%r12), %rcx
movsd (%rcx,%rax), %xmm2
movsd 0x8(%rcx,%rax), %xmm3
movl %r14d, %edi
movq %rbx, %rsi
callq 0x1d5c
incq %r13
addq $0x10, %rbx
jmp 0x1c5f
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq