// File: /workspace/github_c_makefile_star2_O1/diaxen[P]fft-garden/cp_dit_dr_P.c
// Function: cp_dit_dr
static void
cp_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 mask = (1 << log2_N) - 1;
  unsigned i0 = i & mask;
  unsigned t = log2_N - l;

  switch (l)
    {
#if 0
    case 0:			/* size 1 base case  */
      out[0] = in[i];
      break;
#endif

    case 1: {			/* size 2 base case  */
      unsigned i1 = i0 ^ is;
      complex double a = in[i0];
      complex double b = in[i1];
      out[0] = a + b;
      out[1] = a - b;
      break;
    }

    case 2: {			/* size 4 base case  */
      //      cp_dit_dr(log2_N, in, out, 1, i);
      unsigned i1 = i0 ^ (1 << (log2_N - 1));
      complex double a = in[i0];
      complex double b = in[i1];
      out[0] = a + b;
      out[1] = a - b;

      out[2] = in[(i + is) & mask];
      out[3] = in[(i - is) & mask];
      cp_dit_bf_0(1, out);
      break;
    }

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

      unsigned k;
      cp_dit_bf_0(os, out);

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

      cp_dit_bf_pi4(os, out + k);

      for (k += 1; k < os; k++)
	cp_dit_bf(os, out + k, get_twiddle(k << t, log2_N));
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %r8d, %r15d
movl %ecx, %eax
movl %edi, %r13d
movl %edi, %ebp
subl %ecx, %ebp
movl $0x1, %r12d
movl %ebp, %ecx
shll %cl, %r12d
movl $0x1, %r14d
leal -0x2(%rax), %ebx
movl %ebx, %ecx
shll %cl, %r14d
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
movl %r13d, %ecx
shll %cl, %edi
notl %edi
movl %edi, %ecx
andl %r8d, %ecx
cmpl $0x2, %eax
je 0x1ace
cmpl $0x1, %eax
jne 0x1bd4
xorl %ecx, %r12d
movl %ecx, %eax
shlq $0x4, %rax
movsd (%rsi,%rax), %xmm0
movsd 0x8(%rsi,%rax), %xmm1
shlq $0x4, %r12
movsd (%rsi,%r12), %xmm2
movsd 0x8(%rsi,%r12), %xmm3
movapd %xmm0, %xmm4
addsd %xmm2, %xmm4
movapd %xmm1, %xmm5
addsd %xmm3, %xmm5
movsd %xmm4, (%rdx)
movsd %xmm5, 0x8(%rdx)
subsd %xmm2, %xmm0
subsd %xmm3, %xmm1
movsd %xmm0, 0x10(%rdx)
movsd %xmm1, 0x18(%rdx)
jmp 0x1ece
decb %r13b
movl %ecx, %eax
btcl %r13d, %ecx
shlq $0x4, %rax
movsd (%rsi,%rax), %xmm0
movsd 0x8(%rsi,%rax), %xmm1
shlq $0x4, %rcx
movsd (%rsi,%rcx), %xmm4
movsd 0x8(%rsi,%rcx), %xmm5
movapd %xmm0, %xmm2
addsd %xmm4, %xmm2
movapd %xmm1, %xmm3
addsd %xmm5, %xmm3
movsd %xmm2, (%rdx)
movsd %xmm3, 0x8(%rdx)
subsd %xmm4, %xmm0
subsd %xmm5, %xmm1
movsd %xmm0, 0x10(%rdx)
movsd %xmm1, 0x18(%rdx)
leal (%r12,%r15), %eax
andl %edi, %eax
shlq $0x4, %rax
movsd (%rsi,%rax), %xmm4
movsd 0x8(%rsi,%rax), %xmm5
movsd %xmm4, 0x20(%rdx)
movsd %xmm5, 0x28(%rdx)
subl %r12d, %r15d
andl %edi, %r15d
shlq $0x4, %r15
movsd (%rsi,%r15), %xmm6
movsd 0x8(%rsi,%r15), %xmm7
movapd %xmm4, %xmm8
addsd %xmm6, %xmm8
subsd %xmm6, %xmm4
movapd %xmm7, %xmm6
addsd %xmm5, %xmm6
subsd %xmm7, %xmm5
movapd %xmm2, %xmm7
addsd %xmm8, %xmm7
movapd %xmm3, %xmm9
addsd %xmm6, %xmm9
movsd %xmm7, (%rdx)
movsd %xmm9, 0x8(%rdx)
movapd %xmm0, %xmm7
addsd %xmm5, %xmm7
movapd %xmm1, %xmm9
subsd %xmm4, %xmm9
movsd %xmm7, 0x10(%rdx)
movsd %xmm9, 0x18(%rdx)
subsd %xmm8, %xmm2
subsd %xmm6, %xmm3
movsd %xmm2, 0x20(%rdx)
movsd %xmm3, 0x28(%rdx)
subsd %xmm5, %xmm0
addsd %xmm1, %xmm4
movsd %xmm0, 0x30(%rdx)
movsd %xmm4, 0x38(%rdx)
jmp 0x1ece
decl %eax
movl %r13d, %edi
movl %eax, %ecx
movq %rdx, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movl %r15d, %r8d
callq 0x1a27
movl $0x2, %edx
movl %ebx, %ecx
shll %cl, %edx
movl $0x2, %eax
movq %rax, 0x18(%rsp)
shlq $0x4, %rdx
movq %rdx, 0x20(%rsp)
movq 0x10(%rsp), %rax
addq %rax, %rdx
leal (%r12,%r15), %r8d
movl %r13d, %edi
movq 0x8(%rsp), %rsi
movl %ebx, %ecx
callq 0x1a27
movl %ebx, %r8d
movl $0x3, %ebx
movl %r8d, %ecx
shll %cl, %ebx
shlq $0x4, %rbx
movq 0x10(%rsp), %rax
leaq (%rax,%rbx), %rdx
subl %r12d, %r15d
movl %r13d, %edi
movq 0x8(%rsp), %rsi
movl %r8d, %ecx
movl %r8d, %r12d
movl %r15d, %r8d
callq 0x1a27
movq 0x10(%rsp), %rsi
movsd (%rsi), %xmm3
movsd 0x8(%rsi), %xmm4
movq %r14, %r9
shlq $0x4, %r9
movsd (%rsi,%r9), %xmm0
movsd 0x8(%rsi,%r9), %xmm2
movq 0x20(%rsp), %rax
movsd (%rsi,%rax), %xmm1
movsd 0x8(%rsi,%rax), %xmm5
movsd (%rsi,%rbx), %xmm6
movsd 0x8(%rsi,%rbx), %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)
movsd %xmm9, 0x8(%rsi)
movapd %xmm0, %xmm7
addsd %xmm5, %xmm7
movapd %xmm2, %xmm9
subsd %xmm1, %xmm9
movsd %xmm7, (%rsi,%r9)
movsd %xmm9, 0x8(%rsi,%r9)
subsd %xmm8, %xmm3
subsd %xmm6, %xmm4
movsd %xmm3, (%rsi,%rax)
movsd %xmm4, 0x8(%rsi,%rax)
subsd %xmm5, %xmm0
addsd %xmm2, %xmm1
movsd %xmm0, (%rsi,%rbx)
movq %rbx, 0x8(%rsp)
movsd %xmm1, 0x8(%rsi,%rbx)
movl $0x1, %r13d
cmpl $0x2, %r12d
jb 0x1d86
movq %r9, %rbx
movl %r14d, %eax
shrl %eax
cmpl $0x3, %eax
movq 0x18(%rsp), %rcx
cmovael %eax, %ecx
movq %rcx, 0x18(%rsp)
leaq 0x10(%rsi), %r15
movl $0x1, %r13d
leaq 0x3335(%rip), %r12      # 0x5080
movl %r13d, %eax
movl %ebp, %ecx
shll %cl, %eax
movq (%r12), %rcx
shlq $0x4, %rax
movsd (%rcx,%rax), %xmm0
movsd 0x8(%rcx,%rax), %xmm1
movl %r14d, %edi
movq %r15, %rsi
callq 0x1ef2
incq %r13
addq $0x10, %r15
cmpq %r13, 0x18(%rsp)
jne 0x1d4b
movq 0x10(%rsp), %rsi
movq %rbx, %r9
movl %r13d, %eax
movq %rax, %rdx
shlq $0x4, %rdx
leaq (%rsi,%rdx), %rcx
movsd (%rsi,%rdx), %xmm2
movsd 0x8(%rsi,%rdx), %xmm3
movsd (%r9,%rcx), %xmm0
movsd 0x8(%r9,%rcx), %xmm1
movsd 0x149c(%rip), %xmm6     # 0x3250
movq 0x20(%rsp), %rdi
movsd (%rdi,%rcx), %xmm7
mulsd %xmm6, %xmm7
movq 0x8(%rsp), %r8
movsd (%r8,%rcx), %xmm8
mulsd %xmm6, %xmm8
movsd 0x8(%rdi,%rcx), %xmm4
mulsd %xmm6, %xmm4
mulsd 0x8(%r8,%rcx), %xmm6
movapd %xmm7, %xmm5
addsd %xmm4, %xmm5
subsd %xmm7, %xmm4
movapd %xmm8, %xmm7
subsd %xmm6, %xmm7
addsd %xmm8, %xmm6
movapd %xmm5, %xmm8
addsd %xmm7, %xmm8
subsd %xmm7, %xmm5
movapd %xmm4, %xmm7
addsd %xmm6, %xmm7
subsd %xmm6, %xmm4
movapd %xmm2, %xmm6
addsd %xmm8, %xmm6
movapd %xmm3, %xmm9
addsd %xmm7, %xmm9
movsd %xmm6, (%rsi,%rdx)
movsd %xmm9, 0x8(%rsi,%rdx)
movapd %xmm0, %xmm6
addsd %xmm4, %xmm6
movapd %xmm1, %xmm9
subsd %xmm5, %xmm9
movsd %xmm6, (%r9,%rcx)
movsd %xmm9, 0x8(%r9,%rcx)
subsd %xmm8, %xmm2
subsd %xmm7, %xmm3
movsd %xmm2, (%rdi,%rcx)
movsd %xmm3, 0x8(%rdi,%rcx)
subsd %xmm4, %xmm0
addsd %xmm1, %xmm5
movsd %xmm0, (%r8,%rcx)
movsd %xmm5, 0x8(%r8,%rcx)
incl %r13d
cmpl %r14d, %r13d
jae 0x1ece
leaq 0x1(%rax), %r15
shlq $0x4, %rax
leaq (%rax,%rsi), %rbx
addq $0x10, %rbx
leaq 0x31e3(%rip), %r12      # 0x5080
movl %r15d, %eax
movl %ebp, %ecx
shll %cl, %eax
movq (%r12), %rcx
shlq $0x4, %rax
movsd (%rcx,%rax), %xmm0
movsd 0x8(%rcx,%rax), %xmm1
movl %r14d, %edi
movq %rbx, %rsi
callq 0x1ef2
incq %r15
addq $0x10, %rbx
cmpq %r15, %r14
jne 0x1e9d
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq