// File: /workspace/github_c_makefile_star2_O3/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 $0x38, %rsp
movl %ecx, %eax
movq %rdx, %rbx
movl %edi, %r13d
subl %ecx, %r13d
movl $0x1, %r15d
movl %r13d, %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 0x1b37
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, (%rbx)
subpd %xmm1, %xmm0
movupd %xmm0, 0x10(%rbx)
jmp 0x1ea1
movl $0x2, %eax
movl %r13d, %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, (%rbx)
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(%rbx)
subpd %xmm5, %xmm2
movupd %xmm2, 0x20(%rbx)
shufpd $0x2, %xmm1, %xmm0      # xmm0 = xmm0[0],xmm1[1]
movupd %xmm0, 0x30(%rbx)
jmp 0x1ea1
movl %edi, %ebp
decl %eax
movq %r12, %rsi
movl %ecx, 0x10(%rsp)
movq %rbx, %rdx
movl %eax, %ecx
movl %r8d, 0x8(%rsp)
callq 0x1a1f
movl $0x2, %edx
movl 0x10(%rsp), %ecx
shll %cl, %edx
movl $0x2, %eax
movq %rax, 0x18(%rsp)
shlq $0x4, %rdx
movq %rdx, 0x20(%rsp)
addq %rbx, %rdx
addl 0x8(%rsp), %r15d
movl %ebp, %edi
movq %r12, %rsi
movl %r15d, %r8d
callq 0x1a1f
movl $0x3, %r15d
movl 0x10(%rsp), %eax
movl %eax, %ecx
shll %cl, %r15d
movl $0x3, %r8d
shlq $0x4, %r15
leaq (%rbx,%r15), %rdx
movl %r13d, %ecx
shll %cl, %r8d
addl 0x8(%rsp), %r8d
movl %ebp, %edi
movq %r12, %rsi
movl %eax, %ecx
movl %eax, %ebp
callq 0x1a1f
movl %r14d, %eax
shlq $0x4, %rax
movupd (%rbx), %xmm0
movq 0x20(%rsp), %rdi
movupd (%rbx,%rdi), %xmm1
movupd (%rbx,%r15), %xmm2
movapd %xmm1, %xmm3
addpd %xmm2, %xmm3
movapd %xmm0, %xmm4
addpd %xmm3, %xmm4
movupd %xmm4, (%rbx)
movupd (%rbx,%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, (%rbx,%rax)
subpd %xmm3, %xmm0
movupd %xmm0, (%rbx,%rdi)
shufpd $0x2, %xmm2, %xmm4      # xmm4 = xmm4[0],xmm2[1]
movupd %xmm4, (%rbx,%r15)
movl %r14d, %ecx
shrl %ecx
movq %rcx, %rsi
shlq $0x4, %rsi
leaq (%rbx,%rsi), %rdx
movsd (%rbx,%rsi), %xmm2
movsd 0x8(%rbx,%rsi), %xmm3
movsd (%rax,%rdx), %xmm0
movsd 0x8(%rax,%rdx), %xmm1
movsd 0x15fe(%rip), %xmm6     # 0x3250
movsd (%rdi,%rdx), %xmm7
mulsd %xmm6, %xmm7
movsd 0x8(%rdi,%rdx), %xmm4
mulsd %xmm6, %xmm4
mulsd 0x8(%r15,%rdx), %xmm6
movsd (%r15,%rdx), %xmm8
movapd %xmm7, %xmm5
addsd %xmm4, %xmm5
subsd %xmm7, %xmm4
mulsd 0x15d1(%rip), %xmm8     # 0x3258
movapd %xmm8, %xmm7
addsd %xmm6, %xmm7
subsd %xmm6, %xmm8
movapd %xmm5, %xmm6
addsd %xmm7, %xmm6
subsd %xmm7, %xmm5
movapd %xmm4, %xmm7
addsd %xmm8, %xmm7
subsd %xmm8, %xmm4
movapd %xmm2, %xmm8
addsd %xmm6, %xmm8
movapd %xmm3, %xmm9
addsd %xmm7, %xmm9
movsd %xmm8, (%rbx,%rsi)
movsd %xmm9, 0x8(%rbx,%rsi)
movapd %xmm0, %xmm8
addsd %xmm4, %xmm8
movapd %xmm1, %xmm9
subsd %xmm5, %xmm9
movsd %xmm8, (%rax,%rdx)
movsd %xmm9, 0x8(%rax,%rdx)
subsd %xmm6, %xmm2
subsd %xmm7, %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)
cmpl $0x2, %ebp
jb 0x1ea1
cmpl $0x3, %ecx
movq 0x18(%rsp), %rdx
cmovael %ecx, %edx
movq %rdx, 0x18(%rsp)
leaq (%rax,%rbx), %r15
addq $-0x10, %r15
addq $0x10, %rbx
movl $0x1, %r12d
leaq 0x333d(%rip), %rbp      # 0x5088
movl %r12d, %eax
movl %r13d, %ecx
shll %cl, %eax
leaq 0x3326(%rip), %rcx      # 0x5080
movq (%rcx), %rcx
shlq $0x4, %rax
movsd (%rcx,%rax), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x8(%rcx,%rax), %xmm1
movsd %xmm1, 0x30(%rsp)
movq (%rbp), %rcx
movsd (%rcx,%rax), %xmm2
movsd 0x8(%rcx,%rax), %xmm3
movl %r14d, %edi
movq %rbx, %rsi
movsd %xmm2, 0x8(%rsp)
movsd %xmm3, 0x10(%rsp)
callq 0x1ec5
movsd 0x30(%rsp), %xmm3
movsd 0x20(%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 0x1e31
movsd 0x8(%rsp), %xmm5
movapd %xmm5, %xmm2
xorpd %xmm0, %xmm0
mulsd %xmm0, %xmm2
movsd 0x10(%rsp), %xmm6
movapd %xmm6, %xmm3
mulsd %xmm0, %xmm3
subsd %xmm6, %xmm2
addsd %xmm5, %xmm3
ucomisd %xmm2, %xmm2
jp 0x1e59
movapd 0x122e(%rip), %xmm0     # 0x3030
xorpd %xmm0, %xmm1
xorpd %xmm0, %xmm2
movl %r14d, %edi
movq %r15, %rsi
movapd %xmm4, %xmm0
callq 0x1ec5
incq %r12
addq $0x10, %rbx
addq $-0x10, %r15
cmpq %r12, 0x18(%rsp)
jne 0x1d4b
jmp 0x1ea1
ucomisd %xmm1, %xmm1
jnp 0x1dcc
movapd %xmm2, %xmm0
xorpd %xmm2, %xmm2
movapd %xmm3, %xmm1
movsd 0x1415(%rip), %xmm3     # 0x3260
callq 0x2870
movapd %xmm0, %xmm4
jmp 0x1dcc
ucomisd %xmm3, %xmm3
jnp 0x1dfa
xorpd %xmm2, %xmm2
movsd 0x8(%rsp), %xmm0
movapd %xmm1, 0x20(%rsp)
movsd 0x10(%rsp), %xmm1
movsd 0x13e3(%rip), %xmm3     # 0x3260
movsd %xmm4, 0x8(%rsp)
callq 0x2870
movsd 0x8(%rsp), %xmm4
movapd %xmm0, %xmm2
movapd %xmm1, %xmm3
movapd 0x20(%rsp), %xmm1
jmp 0x1dfa
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq