// File: /workspace/github_c_makefile_star2_O2/diaxen[P]fft-garden/sr_dit_dr_S_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++)
	{
	  complex double w1 = get_twiddle(k << t, log2_N);
	  complex double w3 = get_twiddle_sr(k << t, log2_N);
	  sr_dit_bf4(os, out + k, w1, w3);
	  sr_dit_bf4(os, out + os - k, conj(w1 * I), -conj(w3 * I));
	}
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %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 $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1d89
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 0x1d89
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 $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1dae
movl %edi, %r12d
decl %eax
movq %r9, %rsi
movq %rbx, %rdx
movl %eax, %ecx
movq %r9, (%rsp)
movl %r8d, 0x8(%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 0x8(%rsp), %r13d
movl %r12d, %edi
movq (%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 0x8(%rsp), %r8d
movl %r12d, %edi
movq (%rsp), %rsi
movl %r15d, %ecx
callq 0x19b7
movl %r14d, %edi
movq %rbx, %rsi
callq 0x1dae
movl %r14d, %r12d
shrl %r12d
movq %r12, %rdx
shlq $0x4, %rdx
leaq (%rbx,%rdx), %rax
movsd (%rbx,%rdx), %xmm0
movsd 0x8(%rbx,%rdx), %xmm1
movl %r14d, %ecx
shlq $0x4, %rcx
movsd (%rcx,%rax), %xmm2
movsd 0x8(%rcx,%rax), %xmm3
movsd (%r13,%rax), %xmm6
movsd 0x1719(%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 0x16ea(%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,%rdx)
movsd %xmm9, 0x8(%rbx,%rdx)
movapd %xmm2, %xmm6
addsd %xmm4, %xmm6
movapd %xmm3, %xmm9
subsd %xmm5, %xmm9
movsd %xmm6, (%rcx,%rax)
movsd %xmm9, 0x8(%rcx,%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)
leaq (%rcx,%rbx), %r15
addq $-0x10, %r15
addq $0x10, %rbx
pushq $0x1
popq %r13
cmpq %r12, %r13
jae 0x1d65
movl %r13d, %eax
movl %ebp, %ecx
shll %cl, %eax
leaq 0x345b(%rip), %rcx      # 0x5080
movq (%rcx), %rcx
shlq $0x4, %rax
movsd (%rcx,%rax), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x8(%rcx,%rax), %xmm1
movsd %xmm1, 0x20(%rsp)
leaq 0x343e(%rip), %rcx      # 0x5088
movq (%rcx), %rcx
movsd (%rcx,%rax), %xmm2
movsd 0x8(%rcx,%rax), %xmm3
movl %r14d, %edi
movq %rbx, %rsi
movsd %xmm2, (%rsp)
movsd %xmm3, 0x8(%rsp)
callq 0x1e1f
movsd 0x20(%rsp), %xmm3
movsd 0x10(%rsp), %xmm2
movapd %xmm2, %xmm4
xorpd %xmm0, %xmm0
mulsd %xmm0, %xmm4
movapd %xmm3, %xmm1
mulsd %xmm0, %xmm1
subsd %xmm3, %xmm4
addsd %xmm2, %xmm1
ucomisd %xmm4, %xmm4
jp 0x1cf8
movsd (%rsp), %xmm5
movapd %xmm5, %xmm2
xorpd %xmm0, %xmm0
mulsd %xmm0, %xmm2
movsd 0x8(%rsp), %xmm6
movapd %xmm6, %xmm3
mulsd %xmm0, %xmm3
subsd %xmm6, %xmm2
addsd %xmm5, %xmm3
ucomisd %xmm2, %xmm2
jp 0x1d20
movapd 0x135f(%rip), %xmm0     # 0x3030
xorpd %xmm0, %xmm1
xorpd %xmm0, %xmm2
movl %r14d, %edi
movq %r15, %rsi
movapd %xmm4, %xmm0
callq 0x1e1f
incq %r13
addq $0x10, %rbx
addq $-0x10, %r15
jmp 0x1c0e
ucomisd %xmm1, %xmm1
jnp 0x1c9c
movapd %xmm2, %xmm0
xorpd %xmm2, %xmm2
movapd %xmm3, %xmm1
movsd 0x154e(%rip), %xmm3     # 0x3260
callq 0x2820
movapd %xmm0, %xmm4
jmp 0x1c9c
ucomisd %xmm3, %xmm3
jnp 0x1cc9
xorpd %xmm2, %xmm2
movsd (%rsp), %xmm0
movapd %xmm1, 0x10(%rsp)
movsd 0x8(%rsp), %xmm1
movsd 0x151d(%rip), %xmm3     # 0x3260
movsd %xmm4, (%rsp)
callq 0x2820
movsd (%rsp), %xmm4
movapd %xmm0, %xmm2
movapd %xmm1, %xmm3
movapd 0x10(%rsp), %xmm1
jmp 0x1cc9
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq