// File: /workspace/github_c_makefile_star2_O0/diaxen[P]fft-garden/test.c
// Function: simple_dft
static void simple_dft(unsigned size, complex double *output,
		       const complex double *input,
		       unsigned stride /* = 1*/)
{
  unsigned half = size >> 1;

  if (!half)
    {
      output[0] = input[0];
    }
  else
    {
      simple_dft(half, output       , input         , stride << 1);
      simple_dft(half, output + half, input + stride, stride << 1);

      for (unsigned i = 0; i < half; i++)
	{
	  complex double a = output[i];
	  complex double b = output[i + half];

	  double angle = 2 * M_PI * i / size;
	  complex double tw = conj(cexp(angle * I));
	  complex double c = b * tw;

	  output[i] = a + c;
	  output[i + half] = a - c;
	}
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl -0x4(%rbp), %eax
shrl %eax
movl %eax, -0x20(%rbp)
cmpl $0x0, -0x20(%rbp)
jne 0x14e6
movq -0x18(%rbp), %rax
movsd (%rax), %xmm1
movsd 0x8(%rax), %xmm0
movq -0x10(%rbp), %rax
movsd %xmm1, (%rax)
movsd %xmm0, 0x8(%rax)
jmp 0x1771
movl -0x20(%rbp), %edi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movl -0x1c(%rbp), %ecx
shll %ecx
callq 0x14a0
movl -0x20(%rbp), %edi
movq -0x10(%rbp), %rsi
movl -0x20(%rbp), %eax
shlq $0x4, %rax
addq %rax, %rsi
movq -0x18(%rbp), %rdx
movl -0x1c(%rbp), %eax
shlq $0x4, %rax
addq %rax, %rdx
movl -0x1c(%rbp), %ecx
shll %ecx
callq 0x14a0
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x20(%rbp), %eax
jae 0x176f
movq -0x10(%rbp), %rax
movl -0x24(%rbp), %ecx
shlq $0x4, %rcx
movsd (%rax,%rcx), %xmm1
movsd 0x8(%rax,%rcx), %xmm0
movsd %xmm1, -0x38(%rbp)
movsd %xmm0, -0x30(%rbp)
movq -0x10(%rbp), %rax
movl -0x24(%rbp), %ecx
movl -0x20(%rbp), %edx
addl %edx, %ecx
shlq $0x4, %rcx
movsd (%rax,%rcx), %xmm1
movsd 0x8(%rax,%rcx), %xmm0
movsd %xmm1, -0x48(%rbp)
movsd %xmm0, -0x40(%rbp)
movl -0x24(%rbp), %eax
cvtsi2sd %rax, %xmm0
movsd 0x2a94(%rip), %xmm1     # 0x4020
mulsd %xmm1, %xmm0
movl -0x4(%rbp), %eax
cvtsi2sd %rax, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0x50(%rbp), %xmm0
xorps %xmm2, %xmm2
movaps %xmm0, %xmm1
mulsd %xmm2, %xmm1
movsd 0x2a58(%rip), %xmm2     # 0x4010
mulsd %xmm2, %xmm0
movsd %xmm1, -0x70(%rbp)
movsd %xmm0, -0x68(%rbp)
movsd -0x70(%rbp), %xmm0
movsd -0x68(%rbp), %xmm1
callq 0x1050
movsd %xmm0, -0xc8(%rbp)
movaps %xmm1, %xmm0
movsd -0xc8(%rbp), %xmm1
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm1, -0x60(%rbp)
movsd %xmm0, -0x58(%rbp)
movsd -0x48(%rbp), %xmm1
movsd %xmm1, -0xc0(%rbp)
movsd -0x40(%rbp), %xmm2
movsd %xmm2, -0xb8(%rbp)
movsd -0x60(%rbp), %xmm4
movsd %xmm4, -0xb0(%rbp)
movsd -0x58(%rbp), %xmm5
movsd %xmm5, -0xa8(%rbp)
movaps %xmm1, %xmm0
mulsd %xmm4, %xmm0
movaps %xmm2, %xmm3
mulsd %xmm5, %xmm3
mulsd %xmm5, %xmm1
mulsd %xmm4, %xmm2
subsd %xmm3, %xmm0
movsd %xmm0, -0xa0(%rbp)
addsd %xmm2, %xmm1
movsd %xmm1, -0x98(%rbp)
ucomisd %xmm0, %xmm0
movsd %xmm0, -0x90(%rbp)
movsd %xmm1, -0x88(%rbp)
jnp 0x16dc
movsd -0x98(%rbp), %xmm1
movsd -0xa0(%rbp), %xmm0
ucomisd %xmm1, %xmm1
movsd %xmm0, -0x90(%rbp)
movsd %xmm1, -0x88(%rbp)
jnp 0x16dc
movsd -0xa8(%rbp), %xmm3
movsd -0xb0(%rbp), %xmm2
movsd -0xb8(%rbp), %xmm1
movsd -0xc0(%rbp), %xmm0
callq 0x3320
movsd %xmm0, -0x90(%rbp)
movsd %xmm1, -0x88(%rbp)
movsd -0x90(%rbp), %xmm1
movsd -0x88(%rbp), %xmm0
movsd %xmm1, -0x80(%rbp)
movsd %xmm0, -0x78(%rbp)
movsd -0x38(%rbp), %xmm1
movsd -0x30(%rbp), %xmm0
movsd -0x80(%rbp), %xmm3
movsd -0x78(%rbp), %xmm2
addsd %xmm3, %xmm1
addsd %xmm2, %xmm0
movq -0x10(%rbp), %rax
movl -0x24(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movsd %xmm1, (%rax)
movsd %xmm0, 0x8(%rax)
movsd -0x38(%rbp), %xmm1
movsd -0x30(%rbp), %xmm0
movsd -0x80(%rbp), %xmm3
movsd -0x78(%rbp), %xmm2
subsd %xmm3, %xmm1
subsd %xmm2, %xmm0
movq -0x10(%rbp), %rax
movl -0x24(%rbp), %ecx
addl -0x20(%rbp), %ecx
movl %ecx, %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movsd %xmm1, (%rax)
movsd %xmm0, 0x8(%rax)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x152b
jmp 0x1771
addq $0xd0, %rsp
popq %rbp
retq
nopw (%rax,%rax)