// File: /workspace/github_cpp_makefile_star2_O1/kebwi[P]Trifid/src/FFT/fftlib.cpp
// Function: iffts1(double*, long, long, double*, short*)
void iffts1(Float_t *ioptr, long M, long Rows, Float_t *Utbl, short *BRLow){
/* Compute in-place inverse complex fft on the rows of the input array	*/
/* INPUTS */
/* *ioptr = input data array	*/
/* M = log2 of fft size	*/
/* Rows = number of rows in ioptr array (use Rows of 1 if ioptr is a 1 dimensional array)	*/
/* *Utbl = cosine table	*/
/* *BRLow = bit reversed counter table	*/
/* OUTPUTS */
/* *ioptr = output data array	*/

long 	StageCnt;
long 	NDiffU;
const Float_t scale = 1.0/POW2(M);

switch (M){
case 0:
	break;
case 1:
	for (;Rows>0;Rows--){
		ifft2pt(ioptr, scale);				/* a 2 pt fft */
		ioptr += 2*POW2(M);
	}
	break;
case 2:
	for (;Rows>0;Rows--){
		ifft4pt(ioptr, scale);				/* a 4 pt fft */
		ioptr += 2*POW2(M);
	}
	break;
case 3:
	for (;Rows>0;Rows--){
		ifft8pt(ioptr, scale);				/* an 8 pt fft */
		ioptr += 2*POW2(M);
	}
	break;
default:
	for (;Rows>0;Rows--){

		scbitrevR2(ioptr, M, BRLow, scale);	/* bit reverse and first radix 2 stage */
		
		StageCnt = (M-1) / 3;		// number of radix 8 stages
		NDiffU = 2;				// one radix 2 stage already complete

		if ( (M-1-(StageCnt * 3)) == 1 ){
			ibfR2(ioptr, M, NDiffU);				/* 1 radix 2 stage */
			NDiffU *= 2;
		}

		if ( (M-1-(StageCnt * 3)) == 2 ){
			ibfR4(ioptr, M, NDiffU);			/* 1 radix 4 stage */
			NDiffU *= 4;
		}

		if (M <= MCACHE)
			ibfstages(ioptr, M, Utbl, 1, NDiffU, StageCnt);		/*  RADIX 8 Stages	*/

		else{
			ifftrecurs(ioptr, M, Utbl, 1, NDiffU, StageCnt);		/*  RADIX 8 Stages	*/
		}

		ioptr += 2*POW2(M);
	}
}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rcx, %r9
movq %rsi, %r15
movl $0x1, %esi
movl %r15d, %ecx
shlq %cl, %rsi
movq %rdx, %r14
movq %rdi, %rbx
movq %r15, %rax
shlq $0x34, %rax
movabsq $0x3ff0000000000000, %rcx # imm = 0x3FF0000000000000
subq %rax, %rcx
movq %rcx, %xmm0
cmpq $0x3, %r15
movq %xmm0, 0x18(%rsp)
ja 0x2556c
leaq 0xa54d(%rip), %rax      # 0x2f8e0
movslq (%rax,%r15,4), %rcx
addq %rax, %rcx
jmpq *%rcx
testq %r14, %r14
jle 0x2579e
movl $0x2, %eax
movl %r15d, %ecx
shlq %cl, %rax
addq $0x18, %rbx
shlq $0x3, %rax
incq %r14
movsd -0x18(%rbx), %xmm6
movsd -0x10(%rbx), %xmm1
movsd -0x8(%rbx), %xmm2
movsd (%rbx), %xmm3
movapd %xmm6, %xmm4
addsd %xmm2, %xmm4
movapd %xmm1, %xmm5
addsd %xmm3, %xmm5
subsd %xmm2, %xmm6
subsd %xmm3, %xmm1
mulsd %xmm0, %xmm4
movsd %xmm4, -0x18(%rbx)
mulsd %xmm0, %xmm5
movsd %xmm5, -0x10(%rbx)
mulsd %xmm0, %xmm6
movsd %xmm6, -0x8(%rbx)
mulsd %xmm0, %xmm1
movsd %xmm1, (%rbx)
addq %rax, %rbx
decq %r14
cmpq $0x1, %r14
jg 0x253bb
jmp 0x2579e
testq %r14, %r14
jle 0x2579e
movl $0x2, %eax
movl %r15d, %ecx
shlq %cl, %rax
addq $0x38, %rbx
shlq $0x3, %rax
incq %r14
movsd -0x38(%rbx), %xmm10
movsd -0x30(%rbx), %xmm3
movsd -0x18(%rbx), %xmm4
movsd -0x10(%rbx), %xmm5
movsd -0x28(%rbx), %xmm6
movsd -0x20(%rbx), %xmm7
movsd -0x8(%rbx), %xmm8
movsd (%rbx), %xmm9
movapd %xmm10, %xmm2
addsd %xmm4, %xmm2
movapd %xmm3, %xmm1
addsd %xmm5, %xmm1
subsd %xmm4, %xmm10
subsd %xmm5, %xmm3
movapd %xmm6, %xmm4
subsd %xmm8, %xmm4
movapd %xmm7, %xmm5
subsd %xmm9, %xmm5
addsd %xmm8, %xmm6
addsd %xmm9, %xmm7
movapd %xmm2, %xmm8
addsd %xmm6, %xmm8
movapd %xmm1, %xmm9
addsd %xmm7, %xmm9
subsd %xmm6, %xmm2
subsd %xmm7, %xmm1
movapd %xmm10, %xmm6
addsd %xmm5, %xmm6
movapd %xmm3, %xmm7
subsd %xmm4, %xmm7
subsd %xmm5, %xmm10
addsd %xmm3, %xmm4
mulsd %xmm0, %xmm8
movsd %xmm8, -0x38(%rbx)
mulsd %xmm0, %xmm9
movsd %xmm9, -0x30(%rbx)
mulsd %xmm0, %xmm10
movsd %xmm10, -0x28(%rbx)
mulsd %xmm0, %xmm4
movsd %xmm4, -0x20(%rbx)
mulsd %xmm0, %xmm2
movsd %xmm2, -0x18(%rbx)
mulsd %xmm0, %xmm1
movsd %xmm1, -0x10(%rbx)
mulsd %xmm0, %xmm6
movsd %xmm6, -0x8(%rbx)
mulsd %xmm0, %xmm7
movsd %xmm7, (%rbx)
addq %rax, %rbx
decq %r14
cmpq $0x1, %r14
jg 0x25439
jmp 0x2579e
testq %r14, %r14
jle 0x2579e
movl $0x2, %r12d
movl %r15d, %ecx
shlq %cl, %r12
shlq $0x3, %r12
incq %r14
movq %rbx, %rdi
callq 0x287b5
movq 0x18(%rsp), %xmm0
addq %r12, %rbx
decq %r14
cmpq $0x1, %r14
jg 0x2554d
jmp 0x2579e
movq %rsi, 0x8(%rsp)
movq %r9, 0x10(%rsp)
testq %r14, %r14
jle 0x2579e
leaq -0x1(%r15), %rax
movabsq $0x5555555555555556, %rcx # imm = 0x5555555555555556
imulq %rcx
movq %rdx, %rbp
shrq $0x3f, %rbp
addq %rdx, %rbp
leaq (,%rbp,2), %rax
addq %rbp, %rax
negq %rax
leaq (%r15,%rax), %rcx
decq %rcx
xorl %eax, %eax
movq %rcx, 0x30(%rsp)
cmpq $0x1, %rcx
sete %al
setne %dl
cmpq $0x3, %r15
setb %sil
movl $0x2, %edi
movl %r15d, %ecx
shlq %cl, %rdi
movq %rdi, 0x28(%rsp)
shrq $0x3, 0x8(%rsp)
orb %dl, %sil
movb %sil, 0x7(%rsp)
leaq 0x2(,%rax,2), %rax
movq %rax, 0x20(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
movq %r8, %r13
movq %r8, %rdx
callq 0x28ab0
movq 0x20(%rsp), %r12
cmpb $0x0, 0x7(%rsp)
jne 0x25739
movq 0x8(%rsp), %rax
movq %rbx, %rcx
movsd 0x20(%rcx), %xmm0
movsd (%rcx), %xmm1
movsd 0x8(%rcx), %xmm2
movsd 0x28(%rcx), %xmm3
movsd 0x40(%rcx), %xmm4
movsd 0x60(%rcx), %xmm5
movsd 0x48(%rcx), %xmm6
movsd 0x68(%rcx), %xmm7
movapd %xmm1, %xmm8
addsd %xmm0, %xmm8
movapd %xmm2, %xmm9
addsd %xmm3, %xmm9
subsd %xmm0, %xmm1
subsd %xmm3, %xmm2
movapd %xmm4, %xmm0
addsd %xmm5, %xmm0
movapd %xmm6, %xmm3
addsd %xmm7, %xmm3
subsd %xmm5, %xmm4
subsd %xmm7, %xmm6
movsd %xmm8, (%rcx)
movsd %xmm9, 0x8(%rcx)
movsd %xmm1, 0x20(%rcx)
movsd %xmm2, 0x28(%rcx)
movsd %xmm0, 0x40(%rcx)
movsd %xmm3, 0x48(%rcx)
movsd %xmm4, 0x60(%rcx)
movsd %xmm6, 0x68(%rcx)
movsd 0x10(%rcx), %xmm0
movsd 0x38(%rcx), %xmm1
movsd 0x18(%rcx), %xmm2
movsd 0x30(%rcx), %xmm3
movsd 0x50(%rcx), %xmm4
movsd 0x78(%rcx), %xmm5
movsd 0x58(%rcx), %xmm6
movsd 0x70(%rcx), %xmm7
movapd %xmm0, %xmm8
subsd %xmm1, %xmm8
movapd %xmm2, %xmm9
addsd %xmm3, %xmm9
addsd %xmm1, %xmm0
subsd %xmm3, %xmm2
movapd %xmm4, %xmm1
subsd %xmm5, %xmm1
movapd %xmm6, %xmm3
addsd %xmm7, %xmm3
addsd %xmm5, %xmm4
subsd %xmm7, %xmm6
movsd %xmm8, 0x10(%rcx)
movsd %xmm9, 0x18(%rcx)
movsd %xmm0, 0x30(%rcx)
movsd %xmm2, 0x38(%rcx)
movsd %xmm1, 0x50(%rcx)
movsd %xmm3, 0x58(%rcx)
movsd %xmm4, 0x70(%rcx)
movsd %xmm6, 0x78(%rcx)
subq $-0x80, %rcx
decq %rax
jne 0x2561c
movl $0x4, %r12d
cmpq $0x2, 0x30(%rsp)
jne 0x25753
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x28f99
shll $0x2, %r12d
movq 0x10(%rsp), %rdx
movl $0x1, %ecx
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %r8
movq %rbp, %r9
cmpq $0xa, %r15
ja 0x25776
callq 0x2793c
jmp 0x2577b
callq 0x2528f
movq 0x28(%rsp), %rax
leaq (%rbx,%rax,8), %rbx
leaq -0x1(%r14), %rax
cmpq $0x1, %r14
movq %rax, %r14
movsd 0x18(%rsp), %xmm0
movq %r13, %r8
jg 0x255f3
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq