// File: /workspace/github_cpp_makefile_star2_O2/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 $0x18, %rsp
movq %rdx, %rbx
movq %rsi, %r12
movq %rdi, %r14
movq %rsi, %rax
shlq $0x34, %rax
movabsq $0x3ff0000000000000, %rdx # imm = 0x3FF0000000000000
subq %rax, %rdx
movq %rdx, (%rsp)
cmpq $0x3, %rsi
ja 0x1dc8c
leaq 0x8da3(%rip), %rax      # 0x269c8
movslq (%rax,%r12,4), %rcx
addq %rax, %rcx
jmpq *%rcx
testq %rbx, %rbx
jle 0x1dc7d
movq %r14, %rdi
movsd (%rsp), %xmm0
callq 0x20053
addq $0x20, %r14
decq %rbx
jmp 0x1dc2e
testq %rbx, %rbx
jle 0x1dc7d
movq %r14, %rdi
movsd (%rsp), %xmm0
callq 0x200fb
subq $-0x80, %r14
decq %rbx
jmp 0x1dc49
movq %r14, %rdi
movsd (%rsp), %xmm0
callq 0x2007e
addq $0x40, %r14
decq %rbx
testq %rbx, %rbx
jg 0x1dc64
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rcx, 0x10(%rsp)
leaq -0x1(%r12), %rax
pushq $0x3
popq %rcx
cqto
idivq %rcx
movq %rax, 0x8(%rsp)
imulq $-0x3, %rax, %rax
leaq (%rax,%r12), %r15
decq %r15
pushq $0x2
popq %r13
movl %r12d, %ecx
shlq %cl, %r13
shlq $0x3, %r13
testq %rbx, %rbx
jle 0x1dc7d
movq %r14, %rdi
movq %r12, %rsi
movq %r8, %rbp
movq %r8, %rdx
movsd (%rsp), %xmm0
callq 0x202ea
cmpq $0x2, %r15
je 0x1dcf9
pushq $0x2
popq %r8
cmpq $0x1, %r15
jne 0x1dd0b
movq %r14, %rdi
movq %r12, %rsi
pushq $0x2
popq %rdx
callq 0x2053e
pushq $0x4
jmp 0x1dd09
movq %r14, %rdi
movq %r12, %rsi
pushq $0x2
popq %rdx
callq 0x20656
pushq $0x8
popq %r8
movq %r14, %rdi
movq %r12, %rsi
cmpq $0xa, %r12
ja 0x1dd2b
movq 0x10(%rsp), %rdx
pushq $0x1
popq %rcx
movq 0x8(%rsp), %r9
callq 0x1f5c5
jmp 0x1dd3d
movq 0x10(%rsp), %rdx
pushq $0x1
popq %rcx
movq 0x8(%rsp), %r9
callq 0x1db40
decq %rbx
addq %r13, %r14
movq %rbp, %r8
jmp 0x1dcbc