// File: /workspace/github_c_makefile_star2_O1/YunyiQian[P]multitel3/fft.c
// Function: fft
void	fft(complex *a, int n, float dt) {
  int i, j, k, step, m;
  complex u, w, t;
  double pi;
  pi = -PI;
  if (dt<0.) pi = PI;
  for (m=n/2,j=0,i=1; i<n-1; i++) {
    for (k=m; k<=j; k/=2) j -= k;
    j += k;
    if(i<j) {
      t = a[i];
      a[i] = a[j];
      a[j] = t;
    }
  }
  for (m=1,step=2; m<n; m=step, step*=2) {
    for (u=One,w=cmplx(cos(pi/m),sin(pi/m)),j=0; j<m; j++) {
      for (i=j; i<n; i+=step) {
	k = i+m;
	t = cmltp(a[k], u);
	a[k] = cplus(a[i], cngtv(t));
	a[i] = cplus(a[i], t);
      }
      u = cmltp(u, w);
    }
  }
  if (dt<0.) dt=-1./(n*dt);
  for (i=0; i<n; i++) a[i] = dmltp(dt, a[i]);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %esi, %r14d
xorps %xmm1, %xmm1
xorl %eax, %eax
movaps %xmm0, 0x50(%rsp)
ucomiss %xmm0, %xmm1
movq %rdi, %rbx
seta %cl
cmpl $0x3, %esi
jl 0x2299
leal -0x1(%r14), %edx
xorl %edi, %edi
movl $0x1, %esi
movl %r14d, %r8d
movl %edi, %r9d
movl %r9d, %edi
movl %r8d, %r10d
shrl $0x1f, %r10d
addl %r10d, %r8d
sarl %r8d
subl %r8d, %r9d
jge 0x225e
addl %r8d, %edi
movslq %edi, %r8
cmpq %r8, %rsi
jge 0x2291
movsd (%rbx,%rsi,8), %xmm0
movq (%rbx,%r8,8), %r9
movq %r9, (%rbx,%rsi,8)
movsd %xmm0, (%rbx,%r8,8)
incq %rsi
cmpq %rdx, %rsi
jne 0x2258
movl %r14d, %r15d
cmpl $0x2, %r14d
jl 0x23d6
movb %cl, %al
leaq 0x4711(%rip), %rcx      # 0x69c0
movsd (%rcx,%rax,8), %xmm0
movsd %xmm0, 0x30(%rsp)
movl $0x1, %ecx
movl $0x2, %eax
movq %r14, 0x40(%rsp)
movl %ecx, %ebp
movl %eax, %r12d
xorps %xmm1, %xmm1
movss 0x4707(%rip), %xmm0     # 0x69e0
callq 0x3954
movaps %xmm0, (%rsp)
xorps %xmm1, %xmm1
cvtsi2sd %ebp, %xmm1
movsd 0x30(%rsp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, 0x10(%rsp)
callq 0x10e0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x20(%rsp)
movsd 0x10(%rsp), %xmm0
callq 0x11e0
xorps %xmm1, %xmm1
cvtsd2ss %xmm0, %xmm1
movss 0x20(%rsp), %xmm0
callq 0x3954
movaps (%rsp), %xmm1
movaps %xmm0, 0x10(%rsp)
movq %r12, 0x38(%rsp)
movslq %r12d, %r13
movslq %ebp, %rax
cmpl $0x1, %eax
leaq (%rbx,%rax,8), %rbp
adcl $0x0, %eax
movq %rax, 0x48(%rsp)
xorl %r12d, %r12d
cmpl %r14d, %r12d
jge 0x23a6
movq %r12, %r14
movaps %xmm1, (%rsp)
movsd (%rbp,%r14,8), %xmm0
movaps (%rsp), %xmm1
callq 0x37dc
movaps %xmm0, 0x20(%rsp)
callq 0x380c
movaps %xmm0, %xmm1
movsd (%rbx,%r14,8), %xmm0
callq 0x37d8
movlps %xmm0, (%rbp,%r14,8)
movsd (%rbx,%r14,8), %xmm0
movaps 0x20(%rsp), %xmm1
callq 0x37d8
movaps (%rsp), %xmm1
movlps %xmm0, (%rbx,%r14,8)
addq %r13, %r14
cmpq %r15, %r14
jl 0x2357
movaps %xmm1, %xmm0
movaps 0x10(%rsp), %xmm1
callq 0x37dc
movaps %xmm0, %xmm1
incq %r12
cmpq 0x48(%rsp), %r12
movq 0x40(%rsp), %r14
jne 0x234b
movq 0x38(%rsp), %rcx
leal (%rcx,%rcx), %eax
cmpl %r14d, %ecx
jl 0x22c9
testl %r14d, %r14d
jle 0x242f
xorps %xmm0, %xmm0
cvtsi2ss %r14d, %xmm0
movaps 0x50(%rsp), %xmm2
mulss %xmm2, %xmm0
movss 0x45f0(%rip), %xmm1     # 0x69e4
divss %xmm0, %xmm1
xorps %xmm0, %xmm0
movaps %xmm2, %xmm3
cmpltss %xmm0, %xmm3
andps %xmm3, %xmm1
andnps %xmm2, %xmm3
orps %xmm1, %xmm3
movaps %xmm3, (%rsp)
xorl %r14d, %r14d
movsd (%rbx,%r14,8), %xmm1
movaps (%rsp), %xmm0
callq 0x384c
movlps %xmm0, (%rbx,%r14,8)
incq %r14
cmpq %r14, %r15
jne 0x2413
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq