// File: /workspace/github_cpp_makefile_star2_O2/kebwi[P]Trifid/src/FFT/fft2d.cpp
// Function: rifft2d(double*, long, long)
void rifft2d(Float_t *data, long M2, long M){
/* Compute 2D real ifft and return results in-place	*/
/* The input must be in the order as outout from rfft2d */
/* INPUTS */
/* *data = input data array	*/
/* M2 = log2 of fft size number of rows out */
/* M = log2 of fft size number of columns out */
/* OUTPUTS */
/* *data = output data array	*/
long i1;
if((M2>0)&&(M>0)){
	if (M==1){
		cxpose(data, POW2(M)/2, Array2d[M2], POW2(M2), POW2(M2), 1);
		riffts(Array2d[M2], M2, 2);
		xpose(Array2d[M2], POW2(M2), Array2d[M2]+POW2(M2)*2, 2, 2, POW2(M2));
		cxpose(Array2d[M2]+POW2(M2)*2, POW2(M2), data, POW2(M)/2, 1, POW2(M2));
	}
	else if (M==2){
		cxpose(data, POW2(M)/2, Array2d[M2], POW2(M2), POW2(M2), 1);
		riffts(Array2d[M2], M2, 2);
		xpose(Array2d[M2], POW2(M2), Array2d[M2]+POW2(M2)*2, 2, 2, POW2(M2)); 
		cxpose(Array2d[M2]+POW2(M2)*2, POW2(M2), data, POW2(M)/2, 1, POW2(M2));

		cxpose(data + 2, POW2(M)/2, Array2d[M2], POW2(M2), POW2(M2), 1);
		iffts(Array2d[M2], M2, 1);
		cxpose(Array2d[M2], POW2(M2), data + 2, POW2(M)/2, 1, POW2(M2));
	}
	else{
		cxpose(data, POW2(M)/2, Array2d[M2], POW2(M2), POW2(M2), 1);
		riffts(Array2d[M2], M2, 2);
		xpose(Array2d[M2], POW2(M2), Array2d[M2]+POW2(M2)*2, 2, 2, POW2(M2));
		cxpose(Array2d[M2]+POW2(M2)*2, POW2(M2), data, POW2(M)/2, 1, POW2(M2));

		cxpose(data + 2, POW2(M)/2, Array2d[M2], POW2(M2), POW2(M2), 3);
		iffts(Array2d[M2], M2, 3);
		cxpose(Array2d[M2], POW2(M2), data + 2, POW2(M)/2, 3, POW2(M2));
		for (i1=4; i1<POW2(M)/2; i1+=4){
			cxpose(data + i1*2, POW2(M)/2, Array2d[M2], POW2(M2), POW2(M2), 4);
			iffts(Array2d[M2], M2, 4);
			cxpose(Array2d[M2], POW2(M2), data + i1*2, POW2(M)/2, 4, POW2(M2));
		}
	}
	riffts(data, M, POW2(M2));
}
else
	riffts(data, M2+M, 1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %r8
movq %rdi, %r14
testq %rsi, %rsi
setle %al
testq %rdx, %rdx
setle %cl
orb %al, %cl
jne 0x1d296
cmpq $0x2, %r8
movq %r8, 0x20(%rsp)
je 0x1d2a7
cmpq $0x1, %r8
jne 0x1d386
leaq 0x159da(%rip), %rax     # 0x32be0
movq (%rax,%rsi,8), %rdx
movq %rax, %rbx
pushq $0x1
popq %r13
movq %rsi, %r15
movq %r13, %r12
movl %r15d, %ecx
shlq %cl, %r12
movq %r14, %rdi
movq %r13, %rsi
movq %r12, %rcx
movq %r12, %r8
movq %r13, %r9
callq 0x21836
movq (%rbx,%r15,8), %rdi
movq %r14, %rbx
pushq $0x2
popq %r14
movq %r15, %rsi
movq %r14, %rdx
callq 0x1d811
movq %r14, %rbp
movl %r15d, %ecx
shlq %cl, %rbp
leaq 0x15989(%rip), %rax     # 0x32be0
movq (%rax,%r15,8), %rdi
leaq (%rdi,%rbp,8), %rdx
shlq $0x3, %rbp
movq %r12, %rsi
movq %r14, %rcx
movq %r14, %r8
movq %rbx, %r14
movq %r12, %r9
callq 0x21700
leaq 0x15962(%rip), %rax     # 0x32be0
addq (%rax,%r15,8), %rbp
movq %rbp, %rdi
movq %r12, %rsi
movq %rbx, %rdx
movq %r13, %rcx
movq %r13, %r8
jmp 0x1d379
addq %rsi, %r8
pushq $0x1
popq %rdx
movq %r14, %rdi
movq %r8, %rsi
jmp 0x1d519
leaq 0x15932(%rip), %rax     # 0x32be0
movq (%rax,%rsi,8), %rdx
movq %rax, %rbx
pushq $0x1
popq %rax
movq %rsi, %r15
movq %rax, %r12
movq %rax, %r9
movl %r15d, %ecx
shlq %cl, %r12
pushq $0x2
popq %rbp
movq %r14, %rdi
movq %rbp, %rsi
movq %r12, %rcx
movq %r12, %r8
callq 0x21836
movq (%rbx,%r15,8), %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x1d811
movq %r14, %r13
movq %rbp, %r14
movl %r15d, %ecx
shlq %cl, %r14
movq (%rbx,%r15,8), %rdi
leaq (%rdi,%r14,8), %rdx
shlq $0x3, %r14
movq %r12, %rsi
movq %rbp, %rcx
movq %rbp, %r8
movq %r12, %r9
callq 0x21700
addq (%rbx,%r15,8), %r14
movq %r14, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %rbp, %rcx
pushq $0x1
popq %rbx
movq %rbx, %r8
movq %r12, %r9
callq 0x21836
leaq 0x10(%r13), %r14
leaq 0x158a4(%rip), %rbp     # 0x32be0
movq (%rbp,%r15,8), %rdx
movq %r14, %rdi
pushq $0x2
popq %rsi
movq %r12, %rcx
movq %r12, %r8
movq %rbx, %r9
callq 0x21836
movq (%rbp,%r15,8), %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x1d7b6
movq (%rbp,%r15,8), %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %r13, %r14
pushq $0x2
popq %rcx
movq %rbx, %r8
movq %r12, %r9
callq 0x21836
jmp 0x1d50e
pushq $0x1
popq %r9
movq %r9, %r13
movl %r8d, %ecx
shlq %cl, %r13
shrq %r13
leaq 0x15843(%rip), %rax     # 0x32be0
movq (%rax,%rsi,8), %rdx
movq %rax, %rbx
movq %rsi, %r15
movq %r9, %r12
movl %r15d, %ecx
shlq %cl, %r12
movq %r14, %rdi
movq %r13, %rsi
movq %r12, %rcx
movq %r12, %r8
callq 0x21836
movq (%rbx,%r15,8), %rdi
pushq $0x2
popq %rbp
movq %r15, %rsi
movq %rbp, %rdx
callq 0x1d811
movq %r14, %rbx
movq %rbp, %r14
movl %r15d, %ecx
shlq %cl, %r14
leaq 0x157fa(%rip), %rax     # 0x32be0
movq (%rax,%r15,8), %rdi
leaq (%rdi,%r14,8), %rdx
shlq $0x3, %r14
movq %r12, %rsi
movq %rbp, %rcx
movq %rbp, %r8
movq %r12, %r9
callq 0x21700
leaq 0x157d6(%rip), %rax     # 0x32be0
addq (%rax,%r15,8), %r14
movq %r14, %rdi
movq %r12, %rsi
movq %rbx, %rdx
movq %r13, %rcx
pushq $0x1
popq %r8
movq %r12, %r9
callq 0x21836
leaq 0x10(%rbx), %r14
leaq 0x157af(%rip), %rbp     # 0x32be0
movq (%rbp,%r15,8), %rdx
pushq $0x3
popq %r9
movq %r14, %rdi
movq %r13, %rsi
movq %r12, %rcx
movq %r12, %r8
callq 0x21836
movq (%rbp,%r15,8), %rdi
movq %r15, %rsi
pushq $0x3
popq %rdx
callq 0x1d7b6
movq %r15, 0x28(%rsp)
movq (%rbp,%r15,8), %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %r13, 0x10(%rsp)
movq %r13, %rcx
pushq $0x3
popq %r8
movq %r12, 0x8(%rsp)
movq %r12, %r9
callq 0x21836
movq %rbx, 0x18(%rsp)
leaq 0x40(%rbx), %rbp
pushq $0x4
popq %rax
movq 0x28(%rsp), %r12
movq 0x10(%rsp), %rbx
movq 0x8(%rsp), %r13
pushq $0x4
popq %r14
cmpq 0x10(%rsp), %rax
jae 0x1d504
movq %rax, 0x30(%rsp)
leaq 0x1572a(%rip), %r15     # 0x32be0
movq (%r15,%r12,8), %rdx
movq %rbp, %rdi
movq %rbx, %rsi
movq %r13, %rcx
movq %r13, %r8
movq %r14, %r9
callq 0x21836
movq (%r15,%r12,8), %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x1d7b6
movq (%r15,%r12,8), %rdi
movq %r13, %rsi
movq %rbp, %rdx
movq %rbx, %rcx
movq %r14, %r8
movq %r13, %r9
callq 0x21836
movq 0x30(%rsp), %rax
addq $0x4, %rax
addq $0x40, %rbp
jmp 0x1d4a3
movq 0x18(%rsp), %r14
movq 0x8(%rsp), %r12
movq %r14, %rdi
movq 0x20(%rsp), %rsi
movq %r12, %rdx
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1d811