// File: /workspace/github_cpp_makefile_star2_O1/kebwi[P]Trifid/src/FFT/fftlib.cpp
// Function: frstage(double*, long, double*)
inline void frstage(Float_t *ioptr, long M, Float_t *Utbl){
/*	Finish RFFT		*/

unsigned long 	pos;
unsigned long 	posi;
unsigned long 	diffUcnt;

Float_t 	*p0r, *p1r;
Float_t 	*u0r, *u0i;

Float_t w0r, w0i;
Float_t f0r, f0i, f1r, f1i, f4r, f4i, f5r, f5i;
Float_t t0r, t0i, t1r, t1i;
const Float_t Two = 2.0;

pos = POW2(M-1);
posi = pos + 1;

p0r = ioptr;
p1r = ioptr + pos/2;

u0r = Utbl + POW2(M-3);

w0r =  *u0r,

f0r = *(p0r);
f0i = *(p0r + 1);
f4r = *(p0r + pos);
f4i = *(p0r + posi);
f1r = *(p1r);
f1i = *(p1r + 1);
f5r = *(p1r + pos);
f5i = *(p1r + posi);

	t0r = Two * f0r + Two * f0i;    /* compute Re(x[0]) */
	t0i = Two * f0r - Two * f0i;    /* compute Re(x[N/2]) */
	t1r = f4r + f4r;
	t1i = -f4i - f4i;

	f0r = f1r + f5r;
	f0i = f1i - f5i;
	f4r = f1i + f5i;
	f4i = f5r - f1r;

	f1r = f0r + w0r * f4r + w0r * f4i;
	f1i = f0i - w0r * f4r + w0r * f4i;
	f5r = Two * f0r - f1r;
	f5i = f1i - Two * f0i;

*(p0r) = t0r;
*(p0r + 1) = t0i;
*(p0r + pos) = t1r;
*(p0r + posi) = t1i;
*(p1r) = f1r;
*(p1r + 1) = f1i;
*(p1r + pos) = f5r;
*(p1r + posi) = f5i;

u0r = Utbl + 1;
u0i = Utbl + (POW2(M-2)-1);

w0r =  *u0r,
w0i =  *u0i;
	
p0r = (ioptr + 2);
p1r = (ioptr + (POW2(M-2)-1)*2);

				/* Butterflys */
				/*
		f0	-	t0	-	-	f0
		f5	-	t1	- w0	-	f5

		f1	-	t0	-	-	f1
		f4	-	t1	-iw0 -	f4
				*/

for (diffUcnt = POW2(M-3)-1; diffUcnt > 0 ; diffUcnt--){

	f0r = *(p0r);
	f0i = *(p0r + 1);
	f5r = *(p1r + pos);
	f5i = *(p1r + posi);
	f1r = *(p1r);
	f1i = *(p1r + 1);
	f4r = *(p0r + pos);
	f4i = *(p0r + posi);

	t0r = f0r + f5r;
	t0i = f0i - f5i;
	t1r = f0i + f5i;
	t1i = f5r - f0r;

	f0r = t0r + w0r * t1r + w0i * t1i;
	f0i = t0i - w0i * t1r + w0r * t1i;
	f5r = Two * t0r - f0r;
	f5i = f0i - Two * t0i;

	t0r = f1r + f4r;
	t0i = f1i - f4i;
	t1r = f1i + f4i;
	t1i = f4r - f1r;

	f1r = t0r + w0i * t1r + w0r * t1i;
	f1i = t0i - w0r * t1r + w0i * t1i;
	f4r = Two * t0r - f1r;
	f4i = f1i - Two * t0i;

	*(p0r) = f0r;
	*(p0r + 1) = f0i;
	*(p1r + pos) = f5r;
	*(p1r + posi) = f5i;

	w0r = *++u0r;
	w0i = *--u0i;

	*(p1r) = f1r;
	*(p1r + 1) = f1i;
	*(p0r + pos) = f4r;
	*(p0r + posi) = f4i;

	p0r += 2;
	p1r -= 2;
};
}

// Assembly:
leal -0x1(%rsi), %ecx
movl $0x1, %eax
movl $0x1, %r8d
shlq %cl, %r8
movq %r8, %rcx
andq $-0x2, %rcx
leaq (%rdi,%rcx,4), %r9
leal -0x3(%rsi), %ecx
shlq %cl, %rax
movsd (%rdx,%rax,8), %xmm4
movsd (%rdi), %xmm1
movsd 0x8(%rdi), %xmm6
movsd (%rdi,%r8,8), %xmm2
movsd 0x8(%rdi,%r8,8), %xmm7
movsd (%r9), %xmm8
movsd 0x8(%r9), %xmm3
movsd (%r9,%r8,8), %xmm0
movsd 0x8(%r9,%r8,8), %xmm9
addsd %xmm6, %xmm6
addsd %xmm1, %xmm1
movapd %xmm1, %xmm5
addsd %xmm6, %xmm5
subsd %xmm6, %xmm1
addsd %xmm2, %xmm2
movapd 0x2c07(%rip), %xmm6     # 0x2c490
xorpd %xmm7, %xmm6
subsd %xmm7, %xmm6
movapd %xmm8, %xmm7
addsd %xmm0, %xmm7
movapd %xmm3, %xmm10
subsd %xmm9, %xmm10
addsd %xmm9, %xmm3
subsd %xmm8, %xmm0
mulsd %xmm4, %xmm3
movapd %xmm10, %xmm8
subsd %xmm3, %xmm8
addsd %xmm7, %xmm3
mulsd %xmm4, %xmm0
addsd %xmm0, %xmm3
addsd %xmm8, %xmm0
addsd %xmm7, %xmm7
subsd %xmm3, %xmm7
addsd %xmm10, %xmm10
movsd %xmm5, (%rdi)
movsd %xmm1, 0x8(%rdi)
movsd %xmm2, (%rdi,%r8,8)
movsd %xmm6, 0x8(%rdi,%r8,8)
movsd %xmm3, (%r9)
movsd %xmm0, 0x8(%r9)
subsd %xmm10, %xmm0
movsd %xmm7, (%r9,%r8,8)
movsd %xmm0, 0x8(%r9,%r8,8)
decq %rax
je 0x29a9a
addb $-0x2, %sil
movq $-0x1, %r9
movl %esi, %ecx
shlq %cl, %r9
movq %r9, %rcx
notq %rcx
movsd (%rdx,%rcx,8), %xmm0
movsd 0x8(%rdx), %xmm1
leaq (,%r9,8), %rcx
negq %rcx
addq %r9, %r9
notq %r9
addq %r8, %r9
addq $0x3, %r8
movl $0x8, %esi
movsd (%rdi,%rsi,2), %xmm7
movsd 0x8(%rdi,%rsi,2), %xmm9
movsd -0x8(%rdi,%r9,8), %xmm4
movsd (%rdi,%r9,8), %xmm8
movsd -0x8(%rdi,%rcx,2), %xmm3
movsd (%rdi,%r8,8), %xmm5
movapd %xmm7, %xmm2
addsd %xmm4, %xmm2
movapd %xmm9, %xmm6
subsd %xmm8, %xmm6
addsd %xmm8, %xmm9
subsd %xmm7, %xmm4
movapd %xmm0, %xmm8
mulsd %xmm4, %xmm8
mulsd %xmm1, %xmm4
movapd %xmm3, %xmm7
addsd %xmm5, %xmm3
movapd %xmm0, %xmm11
mulsd %xmm3, %xmm11
movapd %xmm1, %xmm10
mulsd %xmm1, %xmm3
mulsd %xmm9, %xmm1
addsd %xmm2, %xmm1
addsd %xmm1, %xmm8
mulsd %xmm0, %xmm9
movapd %xmm6, %xmm1
subsd %xmm9, %xmm1
movsd -0x10(%rdi,%rcx,2), %xmm12
addsd %xmm1, %xmm4
movsd -0x8(%rdi,%r8,8), %xmm9
addsd %xmm2, %xmm2
subsd %xmm8, %xmm2
addsd %xmm6, %xmm6
movsd %xmm8, (%rdi,%rsi,2)
movsd %xmm4, 0x8(%rdi,%rsi,2)
subsd %xmm6, %xmm4
movapd %xmm12, %xmm6
addsd %xmm9, %xmm6
subsd %xmm5, %xmm7
subsd %xmm12, %xmm9
addsd %xmm6, %xmm11
mulsd %xmm9, %xmm10
addsd %xmm11, %xmm10
movapd %xmm7, %xmm1
subsd %xmm3, %xmm1
mulsd %xmm0, %xmm9
addsd %xmm1, %xmm9
addsd %xmm6, %xmm6
subsd %xmm10, %xmm6
addsd %xmm7, %xmm7
movsd %xmm2, -0x8(%rdi,%r9,8)
movsd %xmm4, (%rdi,%r9,8)
movsd 0x8(%rdx,%rsi), %xmm1
movsd -0x10(%rdx,%rcx), %xmm0
movsd %xmm10, -0x10(%rdi,%rcx,2)
movsd %xmm9, -0x8(%rdi,%rcx,2)
subsd %xmm7, %xmm9
movsd %xmm6, -0x8(%rdi,%r8,8)
movsd %xmm9, (%rdi,%r8,8)
addq $-0x8, %rcx
addq $0x8, %rsi
addq $-0x2, %r9
addq $0x2, %r8
decq %rax
jne 0x29953
retq