// File: /workspace/github_c_makefile_star2_O0/diaxen[P]fft-garden/cp_dit_dr.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;
      for (k = 0; k < os; k++)
	cp_dit_bf(os, out + k, get_twiddle(k << t, log2_N));
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl %r8d, -0x20(%rbp)
movl -0x4(%rbp), %eax
movl -0x1c(%rbp), %ecx
subl %ecx, %eax
movb %al, %cl
movl $0x1, %eax
movl %eax, %edx
shll %cl, %edx
movl %edx, %ecx
movl %ecx, -0x24(%rbp)
movb -0x1c(%rbp), %cl
addb $-0x2, %cl
movl %eax, %edx
shll %cl, %edx
movl %edx, %ecx
movl %ecx, -0x28(%rbp)
movb -0x4(%rbp), %cl
shll %cl, %eax
decl %eax
movl %eax, -0x2c(%rbp)
movl -0x20(%rbp), %eax
movl -0x2c(%rbp), %ecx
andl %ecx, %eax
movl %eax, -0x30(%rbp)
movl -0x4(%rbp), %eax
movl -0x1c(%rbp), %ecx
subl %ecx, %eax
movl %eax, -0x34(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x9c(%rbp)
subl $0x1, %eax
je 0x1f28
jmp 0x1f14
movl -0x9c(%rbp), %eax
subl $0x2, %eax
je 0x1fcb
jmp 0x20e4
movl -0x30(%rbp), %eax
xorl -0x24(%rbp), %eax
movl %eax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movl -0x30(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movsd (%rax), %xmm1
movsd 0x8(%rax), %xmm0
movsd %xmm1, -0x48(%rbp)
movsd %xmm0, -0x40(%rbp)
movq -0x10(%rbp), %rax
movl -0x38(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movsd (%rax), %xmm1
movsd 0x8(%rax), %xmm0
movsd %xmm1, -0x58(%rbp)
movsd %xmm0, -0x50(%rbp)
movsd -0x48(%rbp), %xmm1
movsd -0x40(%rbp), %xmm0
movsd -0x58(%rbp), %xmm3
movsd -0x50(%rbp), %xmm2
addsd %xmm3, %xmm1
addsd %xmm2, %xmm0
movq -0x18(%rbp), %rax
movsd %xmm1, (%rax)
movsd %xmm0, 0x8(%rax)
movsd -0x48(%rbp), %xmm1
movsd -0x40(%rbp), %xmm0
movsd -0x58(%rbp), %xmm3
movsd -0x50(%rbp), %xmm2
subsd %xmm3, %xmm1
subsd %xmm2, %xmm0
movq -0x18(%rbp), %rax
movsd %xmm1, 0x10(%rax)
movsd %xmm0, 0x18(%rax)
jmp 0x21e6
movl -0x30(%rbp), %eax
movl -0x4(%rbp), %ecx
subl $0x1, %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
xorl %ecx, %eax
movl %eax, -0x5c(%rbp)
movq -0x10(%rbp), %rax
movl -0x30(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movsd (%rax), %xmm1
movsd 0x8(%rax), %xmm0
movsd %xmm1, -0x70(%rbp)
movsd %xmm0, -0x68(%rbp)
movq -0x10(%rbp), %rax
movl -0x5c(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movsd (%rax), %xmm1
movsd 0x8(%rax), %xmm0
movsd %xmm1, -0x80(%rbp)
movsd %xmm0, -0x78(%rbp)
movsd -0x70(%rbp), %xmm1
movsd -0x68(%rbp), %xmm0
movsd -0x80(%rbp), %xmm3
movsd -0x78(%rbp), %xmm2
addsd %xmm3, %xmm1
addsd %xmm2, %xmm0
movq -0x18(%rbp), %rax
movsd %xmm1, (%rax)
movsd %xmm0, 0x8(%rax)
movsd -0x70(%rbp), %xmm1
movsd -0x68(%rbp), %xmm0
movsd -0x80(%rbp), %xmm3
movsd -0x78(%rbp), %xmm2
subsd %xmm3, %xmm1
subsd %xmm2, %xmm0
movq -0x18(%rbp), %rax
movsd %xmm1, 0x10(%rax)
movsd %xmm0, 0x18(%rax)
movq -0x10(%rbp), %rax
movl -0x20(%rbp), %ecx
addl -0x24(%rbp), %ecx
andl -0x2c(%rbp), %ecx
movl %ecx, %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movsd (%rax), %xmm1
movsd 0x8(%rax), %xmm0
movq -0x18(%rbp), %rax
movsd %xmm1, 0x20(%rax)
movsd %xmm0, 0x28(%rax)
movq -0x10(%rbp), %rax
movl -0x20(%rbp), %ecx
subl -0x24(%rbp), %ecx
andl -0x2c(%rbp), %ecx
movl %ecx, %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movsd (%rax), %xmm1
movsd 0x8(%rax), %xmm0
movq -0x18(%rbp), %rax
movsd %xmm1, 0x30(%rax)
movsd %xmm0, 0x38(%rax)
movq -0x18(%rbp), %rsi
movl $0x1, %edi
callq 0x2220
jmp 0x21e6
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movl -0x1c(%rbp), %ecx
subl $0x1, %ecx
movl -0x20(%rbp), %r8d
callq 0x1ea0
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movl -0x28(%rbp), %eax
shll %eax
movl %eax, %eax
shlq $0x4, %rax
addq %rax, %rdx
movl -0x1c(%rbp), %ecx
subl $0x2, %ecx
movl -0x20(%rbp), %r8d
addl -0x24(%rbp), %r8d
callq 0x1ea0
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
imull $0x3, -0x28(%rbp), %eax
movl %eax, %eax
shlq $0x4, %rax
addq %rax, %rdx
movl -0x1c(%rbp), %ecx
subl $0x2, %ecx
movl -0x20(%rbp), %r8d
subl -0x24(%rbp), %r8d
callq 0x1ea0
movl $0x0, -0x84(%rbp)
movl -0x84(%rbp), %eax
cmpl -0x28(%rbp), %eax
jae 0x21e4
movl -0x28(%rbp), %eax
movl %eax, -0xac(%rbp)
movq -0x18(%rbp), %rax
movl -0x84(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0xa8(%rbp)
movl -0x84(%rbp), %edi
movl -0x34(%rbp), %ecx
shll %cl, %edi
movl -0x4(%rbp), %esi
callq 0x2f60
movl -0xac(%rbp), %edi
movq -0xa8(%rbp), %rsi
movsd %xmm0, -0x98(%rbp)
movsd %xmm1, -0x90(%rbp)
movsd -0x98(%rbp), %xmm0
movsd -0x90(%rbp), %xmm1
callq 0x2410
movl -0x84(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x84(%rbp)
jmp 0x215f
jmp 0x21e6
addq $0xb0, %rsp
popq %rbp
retq
nop