// File: /workspace/github_cpp_makefile_star2_O1/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:
movsd %xmm0, -0x8(%rsp)
movsd (%rdi), %xmm11
movsd 0x8(%rdi), %xmm0
movsd 0x10(%rdi), %xmm7
movsd 0x18(%rdi), %xmm5
movsd 0x20(%rdi), %xmm9
movsd 0x28(%rdi), %xmm1
movsd 0x60(%rdi), %xmm3
movsd 0x68(%rdi), %xmm6
movsd 0x70(%rdi), %xmm4
movsd 0x78(%rdi), %xmm2
movapd %xmm11, %xmm14
addsd %xmm0, %xmm14
subsd %xmm0, %xmm11
movapd %xmm9, %xmm10
addsd %xmm3, %xmm10
movapd %xmm1, %xmm8
subsd %xmm6, %xmm8
subsd %xmm3, %xmm9
addsd %xmm6, %xmm1
movsd 0x5da0(%rip), %xmm3     # 0x2f8a8
movapd %xmm9, %xmm0
mulsd %xmm3, %xmm0
addsd %xmm10, %xmm0
mulsd %xmm3, %xmm1
addsd %xmm1, %xmm0
mulsd 0x5d79(%rip), %xmm9     # 0x2f8a0
addsd %xmm8, %xmm9
addsd %xmm1, %xmm9
addsd %xmm8, %xmm8
movapd %xmm9, %xmm1
subsd %xmm8, %xmm1
movapd %xmm7, %xmm3
addsd %xmm4, %xmm3
movapd %xmm5, %xmm8
subsd %xmm2, %xmm8
subsd %xmm4, %xmm7
addsd %xmm2, %xmm5
movsd 0x5d5e(%rip), %xmm6     # 0x2f8c0
movapd %xmm7, %xmm12
mulsd %xmm6, %xmm12
addsd %xmm3, %xmm12
movsd 0x5d4f(%rip), %xmm4     # 0x2f8c8
movapd %xmm5, %xmm2
mulsd %xmm4, %xmm2
addsd %xmm12, %xmm2
mulsd 0x5d22(%rip), %xmm7     # 0x2f8b0
addsd %xmm8, %xmm7
mulsd %xmm6, %xmm5
addsd %xmm7, %xmm5
addsd %xmm8, %xmm8
movapd %xmm5, %xmm7
subsd %xmm8, %xmm7
movsd %xmm7, -0x28(%rsp)
movsd 0x30(%rdi), %xmm7
movsd 0x50(%rdi), %xmm8
movapd %xmm7, %xmm13
addsd %xmm8, %xmm13
subsd %xmm8, %xmm7
movsd 0x38(%rdi), %xmm15
movsd 0x58(%rdi), %xmm8
movapd %xmm15, %xmm12
subsd %xmm8, %xmm12
addsd %xmm8, %xmm15
movapd %xmm7, %xmm8
mulsd %xmm4, %xmm8
addsd %xmm13, %xmm8
mulsd %xmm15, %xmm6
addsd %xmm8, %xmm6
mulsd %xmm4, %xmm15
mulsd 0x5cae(%rip), %xmm7     # 0x2f8b8
addsd %xmm12, %xmm7
addsd %xmm7, %xmm15
addsd %xmm12, %xmm12
movapd %xmm15, %xmm4
subsd %xmm12, %xmm4
movsd 0x40(%rdi), %xmm8
addsd %xmm8, %xmm8
movapd %xmm14, %xmm7
addsd %xmm8, %xmm14
subsd %xmm8, %xmm7
movsd 0x48(%rdi), %xmm8
addsd %xmm8, %xmm8
movapd %xmm11, %xmm12
subsd %xmm8, %xmm12
addsd %xmm8, %xmm11
addsd %xmm10, %xmm10
subsd %xmm0, %xmm10
movapd %xmm0, %xmm8
subsd %xmm10, %xmm8
addsd %xmm0, %xmm10
movapd %xmm9, %xmm0
subsd %xmm1, %xmm0
addsd %xmm9, %xmm1
movapd %xmm14, %xmm9
addsd %xmm10, %xmm9
movsd %xmm9, -0x18(%rsp)
subsd %xmm10, %xmm14
movapd %xmm12, %xmm9
addsd %xmm1, %xmm9
movsd %xmm9, -0x20(%rsp)
subsd %xmm1, %xmm12
movapd %xmm7, %xmm9
addsd %xmm0, %xmm9
subsd %xmm0, %xmm7
movsd %xmm7, -0x10(%rsp)
movapd %xmm11, %xmm10
subsd %xmm8, %xmm10
addsd %xmm11, %xmm8
addsd %xmm3, %xmm3
subsd %xmm2, %xmm3
addsd %xmm13, %xmm13
subsd %xmm6, %xmm13
movapd %xmm13, %xmm1
addsd %xmm2, %xmm1
subsd %xmm13, %xmm2
movapd %xmm4, %xmm13
addsd %xmm5, %xmm13
subsd %xmm4, %xmm5
movapd %xmm6, %xmm11
subsd %xmm3, %xmm11
addsd %xmm3, %xmm6
movapd %xmm15, %xmm4
movsd -0x28(%rsp), %xmm0
subsd %xmm0, %xmm4
addsd %xmm0, %xmm15
movapd %xmm1, %xmm3
addsd %xmm6, %xmm3
subsd %xmm6, %xmm1
movapd %xmm13, %xmm0
addsd %xmm15, %xmm0
subsd %xmm15, %xmm13
movapd %xmm2, %xmm6
addsd %xmm4, %xmm6
subsd %xmm4, %xmm2
movapd %xmm5, %xmm4
subsd %xmm11, %xmm4
addsd %xmm5, %xmm11
movsd -0x18(%rsp), %xmm7
movapd %xmm7, %xmm5
subsd %xmm3, %xmm5
addsd %xmm7, %xmm3
movsd -0x20(%rsp), %xmm7
movapd %xmm7, %xmm15
subsd %xmm0, %xmm15
addsd %xmm7, %xmm0
movapd %xmm14, %xmm7
addsd %xmm13, %xmm7
movsd %xmm7, -0x28(%rsp)
subsd %xmm13, %xmm14
movapd %xmm12, %xmm13
subsd %xmm1, %xmm13
addsd %xmm12, %xmm1
mulsd 0x5b04(%rip), %xmm2     # 0x2f8a8
movapd %xmm2, %xmm12
movsd -0x10(%rsp), %xmm7
addsd %xmm7, %xmm12
mulsd 0x5ae3(%rip), %xmm11    # 0x2f8a0
addsd %xmm11, %xmm12
addsd %xmm8, %xmm2
subsd %xmm11, %xmm2
movsd 0x5acb(%rip), %xmm11    # 0x2f8a0
mulsd %xmm11, %xmm6
mulsd %xmm11, %xmm4
movapd %xmm10, %xmm11
subsd %xmm6, %xmm11
addsd %xmm9, %xmm6
addsd %xmm4, %xmm6
addsd %xmm11, %xmm4
movsd -0x8(%rsp), %xmm11
mulsd %xmm11, %xmm3
movsd %xmm3, (%rdi)
mulsd %xmm11, %xmm0
movsd %xmm0, 0x8(%rdi)
movapd %xmm7, %xmm0
addsd %xmm7, %xmm0
subsd %xmm12, %xmm0
mulsd %xmm11, %xmm0
movsd %xmm0, 0x10(%rdi)
addsd %xmm8, %xmm8
subsd %xmm2, %xmm8
mulsd %xmm11, %xmm8
movsd %xmm8, 0x18(%rdi)
mulsd %xmm11, %xmm14
movsd %xmm14, 0x20(%rdi)
mulsd %xmm11, %xmm1
movsd %xmm1, 0x28(%rdi)
addsd %xmm9, %xmm9
subsd %xmm6, %xmm9
mulsd %xmm11, %xmm9
movsd %xmm9, 0x30(%rdi)
addsd %xmm10, %xmm10
subsd %xmm4, %xmm10
mulsd %xmm11, %xmm10
movsd %xmm10, 0x38(%rdi)
mulsd %xmm11, %xmm5
movsd %xmm5, 0x40(%rdi)
mulsd %xmm11, %xmm15
movsd %xmm15, 0x48(%rdi)
mulsd %xmm11, %xmm12
movsd %xmm12, 0x50(%rdi)
mulsd %xmm11, %xmm2
movsd %xmm2, 0x58(%rdi)
movsd -0x28(%rsp), %xmm0
mulsd %xmm11, %xmm0
movsd %xmm0, 0x60(%rdi)
mulsd %xmm11, %xmm13
movsd %xmm13, 0x68(%rdi)
mulsd %xmm11, %xmm6
movsd %xmm6, 0x70(%rdi)
mulsd %xmm11, %xmm4
movsd %xmm4, 0x78(%rdi)
retq