// File: /workspace/github_cpp_makefile_star2_O3/kebwi[P]Trifid/src/FFT/fftlib.cpp
// Function: rifft8pt(double*, double)
inline void rifft8pt(Float_t *ioptr, Float_t scale){
/***   RADIX 16 rifft	***/
Float_t w0r = 1.0/MYROOT2; /* cos(pi/4)	*/
Float_t w1r = MYCOSPID8; /* cos(pi/8)	*/
Float_t w1i = MYSINPID8; /* sin(pi/8)	*/
Float_t f0r, f0i, f1r, f1i, f2r, f2i, f3r, f3i;
Float_t f4r, f4i, f5r, f5i, f6r, f6i, f7r, f7i;
Float_t t0r, t0i, t1r, t1i;
const Float_t Two = 2.0;

	/* bit reversed load */
t0r = ioptr[0];
t0i = ioptr[1];
f4r = ioptr[2];
f4i = ioptr[3];
f2r = ioptr[4];
f2i = ioptr[5];
f6r = ioptr[6];
f6i = ioptr[7];
f1r = Two * ioptr[8];
f1i = Two * ioptr[9];
f5r = ioptr[10];
f5i = ioptr[11];
f3r = ioptr[12];
f3i = ioptr[13];
f7r = ioptr[14];
f7i = ioptr[15];


	/* start rfft */
f0r = 	t0r + t0i;    /* compute Re(x[0]) */
f0i = 	t0r - t0i;    /* compute Re(x[N/2]) */

t0r = f2r + f3r;
t0i = f2i - f3i;
t1r = f2r - f3r;
t1i = f2i + f3i;

f2r = t0r - w0r * t1r - w0r * t1i;
f2i = t0i + w0r * t1r - w0r * t1i;
f3r = Two * t0r - f2r;
f3i = f2i - Two * t0i;

t0r = f4r + f7r;
t0i = f4i - f7i;
t1r = f4r - f7r;
t1i = f4i + f7i;

f4r = t0r - w1i * t1r - w1r * t1i;
f4i = t0i + w1r * t1r - w1i * t1i;
f7r = Two * t0r - f4r;
f7i = f4i - Two * t0i;

t0r = f6r + f5r;
t0i = f6i - f5i;
t1r = f6r - f5r;
t1i = f6i + f5i;

f6r = t0r - w1r * t1r - w1i * t1i;
f6i = t0i + w1i * t1r - w1r * t1i;
f5r = Two * t0r - f6r;
f5i = f6i - Two * t0i;

			/* Butterflys		*/
			/*
			f0	-	-	t0	-	-	f0	-	-	f0
			f1*	-  1 -	f1	-	-	f1	-	-	f1
			f2	-	-	f2	-  1 -	f2	-	-	f2
			f3	-  1 -	t1	-  i -	f3	-	-	f3
			f4	-	-	t0	-	-	f4	-  1 -	t0
			f5	-  1 -	f5	-	-	f5	- w3 -	f4
			f6	-	-	f6	-  1 -	f6	-  i -	t1
			f7	-  1 -	t1	-  i -	f7	- iw3-	f6
			*/

t0r = f0r + f1r;
t0i = f0i - f1i;
f1r = f0r - f1r;
f1i = f0i + f1i;

t1r = f2r - f3r;
t1i = f2i - f3i;
f2r = f2r + f3r;
f2i = f2i + f3i;

f0r = t0r + f2r;
f0i = t0i + f2i;
f2r = t0r - f2r;
f2i = t0i - f2i;

f3r = f1r + t1i;
f3i = f1i - t1r;
f1r = f1r - t1i;
f1i = f1i + t1r;


t0r = f4r + f5r;
t0i = f4i + f5i;
f5r = f4r - f5r;
f5i = f4i - f5i;

t1r = f6r - f7r;
t1i = f6i - f7i;
f6r = f6r + f7r;
f6i = f6i + f7i;

f4r = t0r + f6r;
f4i = t0i + f6i;
f6r = t0r - f6r;
f6i = t0i - f6i;

f7r = f5r + t1i;
f7i = f5i - t1r;
f5r = f5r - t1i;
f5i = f5i + t1r;


t0r = f0r - f4r;
t0i = f0i - f4i;
f0r = f0r + f4r;
f0i = f0i + f4i;

t1r = f2r + f6i;
t1i = f2i - f6r;
f2r = f2r - f6i;
f2i = f2i + f6r;

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

f6r = f3r + f7r * w0r + f7i * w0r;
f6i = f3i - f7r * w0r + f7i * w0r;
f3r = f3r * Two - f6r;
f3i = f3i * Two - f6i;

	/* store result */
ioptr[0] = scale*f0r;
ioptr[1] = scale*f0i;
ioptr[2] = scale*f1r;
ioptr[3] = scale*f1i;
ioptr[4] = scale*f2r;
ioptr[5] = scale*f2i;
ioptr[6] = scale*f3r;
ioptr[7] = scale*f3i;
ioptr[8] = scale*t0r;
ioptr[9] = scale*t0i;
ioptr[10] = scale*f4r;
ioptr[11] = scale*f4i;
ioptr[12] = scale*t1r;
ioptr[13] = scale*t1i;
ioptr[14] = scale*f6r;
ioptr[15] = scale*f6i;
}

// Assembly:
movaps %xmm0, -0x18(%rsp)
movupd (%rdi), %xmm1
movupd 0x10(%rdi), %xmm7
movupd 0x20(%rdi), %xmm2
movupd 0x30(%rdi), %xmm6
movapd %xmm1, %xmm3
shufpd $0x1, %xmm1, %xmm3      # xmm3 = xmm3[1],xmm1[0]
movupd 0x40(%rdi), %xmm5
addpd %xmm5, %xmm5
movupd 0x50(%rdi), %xmm9
movupd 0x60(%rdi), %xmm4
movupd 0x70(%rdi), %xmm8
movapd %xmm3, %xmm10
addpd %xmm1, %xmm10
subpd %xmm1, %xmm3
movsd %xmm10, %xmm3           # xmm3 = xmm10[0],xmm3[1]
movapd %xmm2, %xmm1
addpd %xmm4, %xmm1
subpd %xmm4, %xmm2
movapd %xmm2, %xmm4
movsd %xmm1, %xmm4            # xmm4 = xmm1[0],xmm4[1]
unpcklpd %xmm2, %xmm2            # xmm2 = xmm2[0,0]
mulpd 0x5a2a(%rip), %xmm2     # 0x2e9a0
addpd %xmm4, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
mulpd 0x5a2a(%rip), %xmm1     # 0x2e9b0
addpd %xmm2, %xmm1
movapd 0x24ee(%rip), %xmm0     # 0x2b480
movapd %xmm1, %xmm11
xorpd %xmm0, %xmm11
shufpd $0x2, %xmm1, %xmm11     # xmm11 = xmm11[0],xmm1[1]
movapd 0x5985(%rip), %xmm10    # 0x2e930
mulpd %xmm10, %xmm4
addpd %xmm11, %xmm4
movapd %xmm7, %xmm11
addpd %xmm8, %xmm11
subpd %xmm8, %xmm7
movapd %xmm7, %xmm8
movsd %xmm11, %xmm8           # xmm8 = xmm11[0],xmm8[1]
unpcklpd %xmm7, %xmm7            # xmm7 = xmm7[0,0]
mulpd 0x59e6(%rip), %xmm7     # 0x2e9c0
addpd %xmm8, %xmm7
unpckhpd %xmm11, %xmm11          # xmm11 = xmm11[1,1]
mulpd 0x59e3(%rip), %xmm11    # 0x2e9d0
addpd %xmm7, %xmm11
movapd %xmm11, %xmm7
xorpd %xmm0, %xmm7
shufpd $0x2, %xmm11, %xmm7     # xmm7 = xmm7[0],xmm11[1]
mulpd %xmm10, %xmm8
addpd %xmm7, %xmm8
movapd %xmm6, %xmm7
addpd %xmm9, %xmm7
subpd %xmm9, %xmm6
movapd %xmm6, %xmm9
movsd %xmm7, %xmm9            # xmm9 = xmm7[0],xmm9[1]
unpcklpd %xmm6, %xmm6            # xmm6 = xmm6[0,0]
mulpd 0x59b1(%rip), %xmm6     # 0x2e9e0
addpd %xmm9, %xmm6
unpckhpd %xmm7, %xmm7            # xmm7 = xmm7[1,1]
mulpd 0x59b0(%rip), %xmm7     # 0x2e9f0
addpd %xmm6, %xmm7
movapd %xmm7, %xmm6
xorpd %xmm0, %xmm6
shufpd $0x2, %xmm7, %xmm6      # xmm6 = xmm6[0],xmm7[1]
mulpd %xmm10, %xmm9
addpd %xmm6, %xmm9
movapd %xmm3, %xmm15
addpd %xmm5, %xmm15
subpd %xmm5, %xmm3
movapd %xmm3, %xmm10
movsd %xmm15, %xmm10          # xmm10 = xmm15[0],xmm10[1]
movapd %xmm1, %xmm13
addpd %xmm4, %xmm13
movapd %xmm10, %xmm0
addpd %xmm13, %xmm0
movapd %xmm9, %xmm5
addpd %xmm11, %xmm5
movapd %xmm7, %xmm14
movsd %xmm11, %xmm14          # xmm14 = xmm11[0],xmm14[1]
shufpd $0x1, %xmm7, %xmm11     # xmm11 = xmm11[1],xmm7[0]
movapd %xmm8, %xmm12
movsd %xmm9, %xmm12           # xmm12 = xmm9[0],xmm12[1]
shufpd $0x1, %xmm8, %xmm9      # xmm9 = xmm9[1],xmm8[0]
subpd %xmm9, %xmm11
subpd %xmm12, %xmm14
addpd %xmm8, %xmm7
movapd %xmm14, %xmm8
unpckhpd %xmm14, %xmm8           # xmm8 = xmm8[1],xmm14[1]
movapd %xmm14, %xmm12
addsd %xmm8, %xmm12
movapd %xmm11, %xmm9
unpckhpd %xmm11, %xmm9           # xmm9 = xmm9[1],xmm11[1]
subsd %xmm8, %xmm14
movapd %xmm11, %xmm8
subsd %xmm9, %xmm8
addsd %xmm11, %xmm9
movapd %xmm5, %xmm11
addpd %xmm7, %xmm11
movapd %xmm0, %xmm6
addpd %xmm11, %xmm6
movapd -0x18(%rsp), %xmm2
unpcklpd %xmm2, %xmm2            # xmm2 = xmm2[0,0]
mulpd %xmm2, %xmm6
movupd %xmm6, (%rdi)
shufpd $0x2, %xmm15, %xmm3     # xmm3 = xmm3[0],xmm15[1]
subpd %xmm4, %xmm1
shufpd $0x1, %xmm1, %xmm1      # xmm1 = xmm1[1,0]
movapd %xmm3, %xmm4
subpd %xmm1, %xmm4
addpd %xmm3, %xmm1
movapd %xmm1, %xmm6
movsd %xmm4, %xmm6            # xmm6 = xmm4[0],xmm6[1]
mulsd 0x58c5(%rip), %xmm14    # 0x2ea08
unpcklpd %xmm14, %xmm14          # xmm14 = xmm14[0,0]
movapd %xmm6, %xmm15
subpd %xmm14, %xmm15
movapd %xmm9, %xmm14
movapd 0x2321(%rip), %xmm3     # 0x2b480
xorpd %xmm3, %xmm14
unpcklpd %xmm14, %xmm9           # xmm9 = xmm9[0],xmm14[0]
movapd 0x578e(%rip), %xmm14    # 0x2e900
mulpd %xmm14, %xmm9
addpd %xmm15, %xmm9
addpd %xmm6, %xmm6
subpd %xmm9, %xmm6
mulpd %xmm2, %xmm6
movupd %xmm6, 0x10(%rdi)
subpd %xmm13, %xmm10
subpd %xmm7, %xmm5
shufpd $0x1, %xmm5, %xmm5      # xmm5 = xmm5[1,0]
movapd %xmm10, %xmm7
subpd %xmm5, %xmm7
addpd %xmm10, %xmm5
movapd %xmm5, %xmm6
movsd %xmm7, %xmm6            # xmm6 = xmm7[0],xmm6[1]
mulpd %xmm2, %xmm6
movupd %xmm6, 0x20(%rdi)
shufpd $0x2, %xmm4, %xmm1      # xmm1 = xmm1[0],xmm4[1]
xorpd %xmm12, %xmm3
unpcklpd %xmm3, %xmm12           # xmm12 = xmm12[0],xmm3[0]
mulpd %xmm14, %xmm12
mulsd 0x5830(%rip), %xmm8     # 0x2ea08
addpd %xmm1, %xmm12
unpcklpd %xmm8, %xmm8            # xmm8 = xmm8[0,0]
addpd %xmm12, %xmm8
addpd %xmm1, %xmm1
subpd %xmm8, %xmm1
mulpd %xmm2, %xmm1
movupd %xmm1, 0x30(%rdi)
subpd %xmm11, %xmm0
mulpd %xmm2, %xmm0
movupd %xmm0, 0x40(%rdi)
mulpd %xmm2, %xmm9
movupd %xmm9, 0x50(%rdi)
shufpd $0x2, %xmm7, %xmm5      # xmm5 = xmm5[0],xmm7[1]
mulpd %xmm2, %xmm5
movupd %xmm5, 0x60(%rdi)
mulpd %xmm2, %xmm8
movupd %xmm8, 0x70(%rdi)
retq