
.text
	.even
.globl _ASM_FFT_energy_phi
_ASM_FFT_energy_phi:
		  link a6,#-8
		  subq.w   #1,d0
FFT_energy_phi_0:
		  fmove.s  a0@+,fp0
		  fmove.s  a1@+,fp1
		  fmove.x  fp0,fp4
		  fmove.x  fp1,fp5
		  fmul.x   fp4,fp4           | (#2)
		  fmul.x   fp5,fp5           | (#2)
		  fadd.x   fp4,fp5           | fp5 = en = real^2 + imag^2
		  fmove.s  fp5,a2@+         | *energy++ = en
		  ftst.x   fp5
		  fbne     FFT_energy_phi_1  | en <> 0  ***1***
		  fmove.s  #0,fp1            | phi = 0
		  bra.s    FFT_energy_phi_5
FFT_energy_phi_1:
		  ftst.x   fp0
		  fbeq     FFT_energy_phi_3  | real == 0
FFT_energy_phi_2:
		  fdiv.x   fp0,fp1           | fp1 = imag / real (#2)
		  fatan.x  fp1,fp1           | fp1 = atan( imag / real )
		  bra.s    FFT_energy_phi_5
FFT_energy_phi_3:
		  fmove.s  #0r0.0000000000000000000,fp0
		  bra.s    FFT_energy_phi_2
FFT_energy_phi_5:
		  fmove.s  fp1,a3@+         | *phi++ = phi
		  dbra     d0,FFT_energy_phi_0
		  unlk a6
		  rts

|                 even
|
|                  end


	unlk a6
	rts
