// File: 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
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
jle 0x3a259
cmpq $0x0, -0x18(%rbp)
jle 0x3a259
cmpq $0x1, -0x18(%rbp)
jne 0x39d47
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rcx
movl $0x1, %esi
shlq %cl, %rsi
shrq %rsi
movq -0x10(%rbp), %rcx
leaq 0x2308a(%rip), %rax     # 0x5ccc0
movq (%rax,%rcx,8), %rdx
movq -0x10(%rbp), %rcx
movl $0x1, %eax
shlq %cl, %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rcx
movl $0x1, %r8d
shlq %cl, %r8
movq -0x30(%rbp), %rcx
movl $0x1, %r9d
callq 0x48240
movq -0x10(%rbp), %rcx
leaq 0x2304f(%rip), %rax     # 0x5ccc0
movq (%rax,%rcx,8), %rdi
movq -0x10(%rbp), %rsi
movl $0x2, %edx
callq 0x3a8e0
movq -0x10(%rbp), %rcx
leaq 0x23032(%rip), %rax     # 0x5ccc0
movq (%rax,%rcx,8), %rdi
movq -0x10(%rbp), %rcx
movl $0x1, %esi
shlq %cl, %rsi
movq -0x10(%rbp), %rcx
leaq 0x23017(%rip), %rax     # 0x5ccc0
movq (%rax,%rcx,8), %rdx
movq -0x10(%rbp), %rcx
movl $0x1, %eax
shlq %cl, %rax
shlq %rax
shlq $0x3, %rax
addq %rax, %rdx
movq -0x10(%rbp), %rcx
movl $0x1, %r9d
shlq %cl, %r9
movl $0x2, %r8d
movq %r8, %rcx
callq 0x47ef0
movq -0x10(%rbp), %rcx
leaq 0x22fd7(%rip), %rax     # 0x5ccc0
movq (%rax,%rcx,8), %rdi
movq -0x10(%rbp), %rcx
movl $0x1, %eax
shlq %cl, %rax
shlq %rax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x10(%rbp), %rcx
movl $0x1, %esi
shlq %cl, %rsi
movq -0x8(%rbp), %rdx
movq -0x18(%rbp), %rcx
movl $0x1, %eax
shlq %cl, %rax
shrq %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rcx
movl $0x1, %r9d
shlq %cl, %r9
movq -0x28(%rbp), %rcx
movl $0x1, %r8d
callq 0x48240
jmp 0x3a23e
cmpq $0x2, -0x18(%rbp)
jne 0x39f42
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rcx
movl $0x1, %esi
shlq %cl, %rsi
shrq %rsi
movq -0x10(%rbp), %rcx
leaq 0x22f50(%rip), %rax     # 0x5ccc0
movq (%rax,%rcx,8), %rdx
movq -0x10(%rbp), %rcx
movl $0x1, %eax
shlq %cl, %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rcx
movl $0x1, %r8d
shlq %cl, %r8
movq -0x50(%rbp), %rcx
movl $0x1, %r9d
callq 0x48240
movq -0x10(%rbp), %rcx
leaq 0x22f15(%rip), %rax     # 0x5ccc0
movq (%rax,%rcx,8), %rdi
movq -0x10(%rbp), %rsi
movl $0x2, %edx
callq 0x3a8e0
movq -0x10(%rbp), %rcx
leaq 0x22ef8(%rip), %rax     # 0x5ccc0
movq (%rax,%rcx,8), %rdi
movq -0x10(%rbp), %rcx
movl $0x1, %esi
shlq %cl, %rsi
movq -0x10(%rbp), %rcx
leaq 0x22edd(%rip), %rax     # 0x5ccc0
movq (%rax,%rcx,8), %rdx
movq -0x10(%rbp), %rcx
movl $0x1, %eax
shlq %cl, %rax
shlq %rax
shlq $0x3, %rax
addq %rax, %rdx
movq -0x10(%rbp), %rcx
movl $0x1, %r9d
shlq %cl, %r9
movl $0x2, %r8d
movq %r8, %rcx
callq 0x47ef0
movq -0x10(%rbp), %rcx
leaq 0x22e9d(%rip), %rax     # 0x5ccc0
movq (%rax,%rcx,8), %rdi
movq -0x10(%rbp), %rcx
movl $0x1, %eax
shlq %cl, %rax
shlq %rax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x10(%rbp), %rcx
movl $0x1, %esi
shlq %cl, %rsi
movq -0x8(%rbp), %rdx
movq -0x18(%rbp), %rcx
movl $0x1, %eax
shlq %cl, %rax
shrq %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rcx
movl $0x1, %r9d
shlq %cl, %r9
movq -0x48(%rbp), %rcx
movl $0x1, %r8d
callq 0x48240
movq -0x8(%rbp), %rdi
addq $0x10, %rdi
movq -0x18(%rbp), %rcx
movl $0x1, %esi
shlq %cl, %rsi
shrq %rsi
movq -0x10(%rbp), %rcx
leaq 0x22e22(%rip), %rax     # 0x5ccc0
movq (%rax,%rcx,8), %rdx
movq -0x10(%rbp), %rcx
movl $0x1, %eax
shlq %cl, %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rcx
movl $0x1, %r8d
shlq %cl, %r8
movq -0x40(%rbp), %rcx
movl $0x1, %r9d
callq 0x48240
movq -0x10(%rbp), %rcx
leaq 0x22de7(%rip), %rax     # 0x5ccc0
movq (%rax,%rcx,8), %rdi
movq -0x10(%rbp), %rsi
movl $0x1, %edx
callq 0x3a810
movq -0x10(%rbp), %rcx
leaq 0x22dca(%rip), %rax     # 0x5ccc0
movq (%rax,%rcx,8), %rdi
movq -0x10(%rbp), %rcx
movl $0x1, %esi
shlq %cl, %rsi
movq -0x8(%rbp), %rdx
addq $0x10, %rdx
movq -0x18(%rbp), %rcx
movl $0x1, %eax
shlq %cl, %rax
shrq %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rcx
movl $0x1, %r9d
shlq %cl, %r9
movq -0x38(%rbp), %rcx
movl $0x1, %r8d
callq 0x48240
jmp 0x3a23c
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rcx
movl $0x1, %esi
shlq %cl, %rsi
shrq %rsi
movq -0x10(%rbp), %rcx
leaq 0x22d60(%rip), %rax     # 0x5ccc0
movq (%rax,%rcx,8), %rdx
movq -0x10(%rbp), %rcx
movl $0x1, %eax
shlq %cl, %rax
movq %rax, -0x70(%rbp)
movq -0x10(%rbp), %rcx
movl $0x1, %r8d
shlq %cl, %r8
movq -0x70(%rbp), %rcx
movl $0x1, %r9d
callq 0x48240
movq -0x10(%rbp), %rcx
leaq 0x22d25(%rip), %rax     # 0x5ccc0
movq (%rax,%rcx,8), %rdi
movq -0x10(%rbp), %rsi
movl $0x2, %edx
callq 0x3a8e0
movq -0x10(%rbp), %rcx
leaq 0x22d08(%rip), %rax     # 0x5ccc0
movq (%rax,%rcx,8), %rdi
movq -0x10(%rbp), %rcx
movl $0x1, %esi
shlq %cl, %rsi
movq -0x10(%rbp), %rcx
leaq 0x22ced(%rip), %rax     # 0x5ccc0
movq (%rax,%rcx,8), %rdx
movq -0x10(%rbp), %rcx
movl $0x1, %eax
shlq %cl, %rax
shlq %rax
shlq $0x3, %rax
addq %rax, %rdx
movq -0x10(%rbp), %rcx
movl $0x1, %r9d
shlq %cl, %r9
movl $0x2, %r8d
movq %r8, %rcx
callq 0x47ef0
movq -0x10(%rbp), %rcx
leaq 0x22cad(%rip), %rax     # 0x5ccc0
movq (%rax,%rcx,8), %rdi
movq -0x10(%rbp), %rcx
movl $0x1, %eax
shlq %cl, %rax
shlq %rax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x10(%rbp), %rcx
movl $0x1, %esi
shlq %cl, %rsi
movq -0x8(%rbp), %rdx
movq -0x18(%rbp), %rcx
movl $0x1, %eax
shlq %cl, %rax
shrq %rax
movq %rax, -0x68(%rbp)
movq -0x10(%rbp), %rcx
movl $0x1, %r9d
shlq %cl, %r9
movq -0x68(%rbp), %rcx
movl $0x1, %r8d
callq 0x48240
movq -0x8(%rbp), %rdi
addq $0x10, %rdi
movq -0x18(%rbp), %rcx
movl $0x1, %esi
shlq %cl, %rsi
shrq %rsi
movq -0x10(%rbp), %rcx
leaq 0x22c32(%rip), %rax     # 0x5ccc0
movq (%rax,%rcx,8), %rdx
movq -0x10(%rbp), %rcx
movl $0x1, %eax
shlq %cl, %rax
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rcx
movl $0x1, %r8d
shlq %cl, %r8
movq -0x60(%rbp), %rcx
movl $0x3, %r9d
callq 0x48240
movq -0x10(%rbp), %rcx
leaq 0x22bf7(%rip), %rax     # 0x5ccc0
movq (%rax,%rcx,8), %rdi
movq -0x10(%rbp), %rsi
movl $0x3, %edx
callq 0x3a810
movq -0x10(%rbp), %rcx
leaq 0x22bda(%rip), %rax     # 0x5ccc0
movq (%rax,%rcx,8), %rdi
movq -0x10(%rbp), %rcx
movl $0x1, %esi
shlq %cl, %rsi
movq -0x8(%rbp), %rdx
addq $0x10, %rdx
movq -0x18(%rbp), %rcx
movl $0x1, %eax
shlq %cl, %rax
shrq %rax
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rcx
movl $0x1, %r9d
shlq %cl, %r9
movq -0x58(%rbp), %rcx
movl $0x3, %r8d
callq 0x48240
movq $0x4, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq -0x18(%rbp), %rcx
movl $0x1, %edx
shlq %cl, %rdx
movq %rdx, %rcx
shrq %rcx
cmpq %rcx, %rax
jae 0x3a23a
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
shlq %rax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x18(%rbp), %rcx
movl $0x1, %esi
shlq %cl, %rsi
shrq %rsi
movq -0x10(%rbp), %rcx
leaq 0x22b40(%rip), %rax     # 0x5ccc0
movq (%rax,%rcx,8), %rdx
movq -0x10(%rbp), %rcx
movl $0x1, %eax
shlq %cl, %rax
movq %rax, -0x80(%rbp)
movq -0x10(%rbp), %rcx
movl $0x1, %r8d
shlq %cl, %r8
movq -0x80(%rbp), %rcx
movl $0x4, %r9d
callq 0x48240
movq -0x10(%rbp), %rcx
leaq 0x22b05(%rip), %rax     # 0x5ccc0
movq (%rax,%rcx,8), %rdi
movq -0x10(%rbp), %rsi
movl $0x4, %edx
callq 0x3a810
movq -0x10(%rbp), %rcx
leaq 0x22ae8(%rip), %rax     # 0x5ccc0
movq (%rax,%rcx,8), %rdi
movq -0x10(%rbp), %rcx
movl $0x1, %esi
shlq %cl, %rsi
movq -0x8(%rbp), %rdx
movq -0x20(%rbp), %rax
shlq %rax
shlq $0x3, %rax
addq %rax, %rdx
movq -0x18(%rbp), %rcx
movl $0x1, %eax
shlq %cl, %rax
shrq %rax
movq %rax, -0x78(%rbp)
movq -0x10(%rbp), %rcx
movl $0x1, %r9d
shlq %cl, %r9
movq -0x78(%rbp), %rcx
movl $0x4, %r8d
callq 0x48240
movq -0x20(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x20(%rbp)
jmp 0x3a135
jmp 0x3a23c
jmp 0x3a23e
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rcx
movl $0x1, %edx
shlq %cl, %rdx
callq 0x3a8e0
jmp 0x3a26f
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq -0x18(%rbp), %rsi
movl $0x1, %edx
callq 0x3a8e0
addq $0x80, %rsp
popq %rbp
retq
nopl (%rax,%rax)