// File: /workspace/github_cpp_makefile_star2_O2/kebwi[P]Trifid/src/FFT/fftlib.cpp
// Function: ifrstage(double*, long, double*)
inline void ifrstage(Float_t *ioptr, long M, Float_t *Utbl){
/*	Start RIFFT		*/

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 = f0r + f0i;
	t0i = f0r - f0i;
	t1r = f4r + f4r;
	t1i = -f4i - f4i;

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

	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
		f1	-     t1     -w0-   f1

		f2	-	 t0		-	f2
		f3	-     t1	   -iw0-  f3
				*/

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 = f0r - f5r;
	t1i = f0i + f5i;

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

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

	f1r = t0r - w0r * t1r - w0i * t1i;
	f1i = t0i + w0i * t1r - w0r * 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
pushq $0x1
popq %rax
movq %rax, %r8
shlq %cl, %r8
movq %r8, %r9
leal -0x3(%rsi), %ecx
shlq %cl, %rax
andq $-0x2, %r9
leaq (%rdi,%r9,4), %r9
movsd (%rdi), %xmm3
movsd 0x8(%rdi), %xmm0
movsd (%rdi,%r8,8), %xmm4
movsd 0x8(%rdi,%r8,8), %xmm1
movapd %xmm3, %xmm5
addsd %xmm0, %xmm5
subsd %xmm0, %xmm3
addsd %xmm4, %xmm4
movapd 0x1f6c(%rip), %xmm0     # 0x23470
movapd %xmm1, %xmm6
xorpd %xmm0, %xmm6
subsd %xmm1, %xmm6
movsd (%rdx,%rax,8), %xmm7
movapd %xmm7, %xmm8
xorpd %xmm0, %xmm8
movupd (%r9), %xmm2
movupd (%r9,%r8,8), %xmm1
movapd %xmm2, %xmm9
addpd %xmm1, %xmm9
subpd %xmm1, %xmm2
movapd %xmm2, %xmm1
movsd %xmm9, %xmm1            # xmm1 = xmm9[0],xmm1[1]
movsd %xmm5, (%rdi)
movsd %xmm3, 0x8(%rdi)
movsd %xmm4, (%rdi,%r8,8)
movsd %xmm6, 0x8(%rdi,%r8,8)
unpcklpd %xmm7, %xmm8            # xmm8 = xmm8[0],xmm7[0]
unpcklpd %xmm2, %xmm2            # xmm2 = xmm2[0,0]
mulpd %xmm8, %xmm2
addpd %xmm1, %xmm2
unpcklpd %xmm7, %xmm7            # xmm7 = xmm7[0,0]
unpckhpd %xmm9, %xmm9            # xmm9 = xmm9[1,1]
mulpd %xmm7, %xmm9
subpd %xmm9, %xmm2
xorpd %xmm2, %xmm0
shufpd $0x2, %xmm2, %xmm0      # xmm0 = xmm0[0],xmm2[1]
mulpd 0x5343(%rip), %xmm1     # 0x268d0
addpd %xmm0, %xmm1
movupd %xmm2, (%r9)
leal -0x2(%rsi), %ecx
pushq $-0x1
popq %rsi
shlq %cl, %rsi
movupd %xmm1, (%r9,%r8,8)
movq %rsi, %rcx
notq %rcx
movsd (%rdx,%rcx,8), %xmm2
movhps 0x8(%rdx), %xmm2        # xmm2 = xmm2[0,1],mem[0,1]
leaq (,%rsi,8), %rcx
negq %rcx
addq %rsi, %rsi
negq %rsi
addq %r8, %rsi
addq $-0x2, %rsi
addq $0x2, %r8
decq %rax
pushq $0x10
popq %r9
movaps 0x1e92(%rip), %xmm0     # 0x23470
movapd 0x52ea(%rip), %xmm1     # 0x268d0
subq $0x1, %rax
jb 0x216ff
movaps %xmm2, %xmm5
xorps %xmm0, %xmm5
pshufd $0xee, %xmm5, %xmm7     # xmm7 = xmm5[2,3,2,3]
movupd -0x10(%rdi,%rcx,2), %xmm3
movupd (%rdi,%r8,8), %xmm4
movapd %xmm3, %xmm6
addpd %xmm4, %xmm6
subpd %xmm4, %xmm3
movapd %xmm3, %xmm4
movsd %xmm6, %xmm4            # xmm4 = xmm6[0],xmm4[1]
movupd -0x10(%rdi,%r9,2), %xmm10
movupd (%rdi,%rsi,8), %xmm9
movapd %xmm10, %xmm8
addpd %xmm9, %xmm8
subpd %xmm9, %xmm10
movapd %xmm10, %xmm9
movsd %xmm8, %xmm9            # xmm9 = xmm8[0],xmm9[1]
movaps %xmm5, %xmm11
mulsd %xmm10, %xmm11
addsd %xmm8, %xmm11
unpckhpd %xmm8, %xmm8            # xmm8 = xmm8[1,1]
mulsd %xmm8, %xmm7
mulsd %xmm5, %xmm8
shufps $0x4e, %xmm2, %xmm5     # xmm5 = xmm5[2,3],xmm2[0,1]
unpckhpd %xmm6, %xmm6            # xmm6 = xmm6[1,1]
mulpd %xmm2, %xmm6
unpckhpd %xmm2, %xmm2            # xmm2 = xmm2[1,1]
addsd %xmm11, %xmm7
mulsd %xmm10, %xmm2
unpckhpd %xmm10, %xmm10          # xmm10 = xmm10[1,1]
addsd %xmm2, %xmm10
addsd %xmm10, %xmm8
movsd %xmm7, -0x10(%rdi,%r9,2)
xorpd %xmm0, %xmm7
unpcklpd %xmm8, %xmm7            # xmm7 = xmm7[0],xmm8[0]
mulpd %xmm1, %xmm9
addpd %xmm7, %xmm9
movsd %xmm8, -0x8(%rdi,%r9,2)
movupd %xmm9, (%rdi,%rsi,8)
unpcklpd %xmm3, %xmm3            # xmm3 = xmm3[0,0]
mulpd %xmm5, %xmm3
addpd %xmm4, %xmm3
subpd %xmm6, %xmm3
movapd %xmm3, %xmm2
xorpd %xmm0, %xmm2
shufpd $0x2, %xmm3, %xmm2      # xmm2 = xmm2[0],xmm3[1]
mulpd %xmm1, %xmm4
addpd %xmm2, %xmm4
movsd -0x10(%rdx,%rcx), %xmm2
movhps (%rdx,%r9), %xmm2       # xmm2 = xmm2[0,1],mem[0,1]
movupd %xmm3, -0x10(%rdi,%rcx,2)
movupd %xmm4, (%rdi,%r8,8)
addq $0x8, %r9
addq $0x2, %r8
addq $-0x8, %rcx
addq $-0x2, %rsi
jmp 0x215e6
retq