// File: kebwi[P]Trifid/src/FFT/fft2d.cpp
// Function: fft3d(double*, long, long, long)
void fft3d(Float_t *data, long M3, long M2, long M){
/* Compute 2D complex fft and return results in-place	*/
/* INPUTS */
/* *data = input data array	*/
/* M3 = log2 of fft size number of pages */
/* M2 = log2 of fft size number of rows */
/* M = log2 of fft size number of columns */
/* OUTPUTS */
/* *data = output data array	*/
long i1;
long i2;
const long N = POW2(M);
const long N2 = POW2(M2);
const long N3 = POW2(M3);
if((M3>0)&&(M2>0)&&(M>0)){
	ffts(data, M, N3*N2);
	if (M>2)
		for (i2=0; i2<N3; i2++){
			for (i1=0; i1<N; i1+=4){
				cxpose(data + i2*2*POW2(M2+M) + i1*2, N, Array2d[M2], N2, N2, 4);
				ffts(Array2d[M2], M2, 4);
				cxpose(Array2d[M2], N2, data + i2*2*POW2(M2+M) + i1*2, N, 4, N2);
			}
		}
	else{
		for (i2=0; i2<N3; i2++){
			cxpose(data + i2*2*POW2(M2+M), N, Array2d[M2], N2, N2, N);
			ffts(Array2d[M2], M2, N);
			cxpose(Array2d[M2], N2, data + i2*2*POW2(M2+M), N, N, N2);
		}
	}
	if ((M2+M)>2)
		for (i1=0; i1<POW2(M2+M); i1+=4){
			cxpose(data + i1*2, POW2(M2+M), Array2d[M3], N3, N3, 4);
			ffts(Array2d[M3], M3, 4);
			cxpose(Array2d[M3], N3, data + i1*2, POW2(M2+M), 4, N3);
		}
	else{
		cxpose(data, POW2(M2+M), Array2d[M3], N3, N3, POW2(M2+M));
		ffts(Array2d[M3], M3, POW2(M2+M));
		cxpose(Array2d[M3], N3, data, POW2(M2+M), POW2(M2+M), N3);
	}
}
else
	if(M3==0) fft2d(data, M2, M);
	else
		if(M2==0) fft2d(data, M3, M);
		else
			if(M==0) fft2d(data, M3, M2);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x20(%rbp), %rcx
movl $0x1, %eax
shlq %cl, %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rcx
movl $0x1, %eax
shlq %cl, %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rcx
movl $0x1, %eax
shlq %cl, %rax
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x10(%rbp)
jle 0x38ffb
cmpq $0x0, -0x18(%rbp)
jle 0x38ffb
cmpq $0x0, -0x20(%rbp)
jle 0x38ffb
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x48(%rbp), %rdx
imulq -0x40(%rbp), %rdx
callq 0x3a7b0
cmpq $0x2, -0x20(%rbp)
jle 0x38d67
movq $0x0, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x48(%rbp), %rax
jge 0x38d62
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x38(%rbp), %rax
jge 0x38d4f
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rax
shlq %rax
movq -0x18(%rbp), %rcx
addq -0x20(%rbp), %rcx
movl $0x1, %edx
shlq %cl, %rdx
movq %rdx, %rcx
imulq %rcx, %rax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x28(%rbp), %rax
shlq %rax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x38(%rbp), %rsi
movq -0x18(%rbp), %rcx
leaq 0x24014(%rip), %rax     # 0x5ccc0
movq (%rax,%rcx,8), %rdx
movq -0x40(%rbp), %rcx
movq -0x40(%rbp), %r8
movl $0x4, %r9d
callq 0x48240
movq -0x18(%rbp), %rcx
leaq 0x23ff2(%rip), %rax     # 0x5ccc0
movq (%rax,%rcx,8), %rdi
movq -0x18(%rbp), %rsi
movl $0x4, %edx
callq 0x3a7b0
movq -0x18(%rbp), %rcx
leaq 0x23fd5(%rip), %rax     # 0x5ccc0
movq (%rax,%rcx,8), %rdi
movq -0x40(%rbp), %rsi
movq -0x8(%rbp), %rdx
movq -0x30(%rbp), %rax
shlq %rax
movq -0x18(%rbp), %rcx
addq -0x20(%rbp), %rcx
movl $0x1, %r8d
shlq %cl, %r8
movq %r8, %rcx
imulq %rcx, %rax
shlq $0x3, %rax
addq %rax, %rdx
movq -0x28(%rbp), %rax
shlq %rax
shlq $0x3, %rax
addq %rax, %rdx
movq -0x38(%rbp), %rcx
movq -0x40(%rbp), %r9
movl $0x4, %r8d
callq 0x48240
movq -0x28(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x28(%rbp)
jmp 0x38c58
jmp 0x38d51
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x38c42
jmp 0x38e47
movq $0x0, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x48(%rbp), %rax
jge 0x38e45
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rax
shlq %rax
movq -0x18(%rbp), %rcx
addq -0x20(%rbp), %rcx
movl $0x1, %edx
shlq %cl, %rdx
movq %rdx, %rcx
imulq %rcx, %rax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x38(%rbp), %rsi
movq -0x18(%rbp), %rcx
leaq 0x23f0b(%rip), %rax     # 0x5ccc0
movq (%rax,%rcx,8), %rdx
movq -0x40(%rbp), %rcx
movq -0x40(%rbp), %r8
movq -0x38(%rbp), %r9
callq 0x48240
movq -0x18(%rbp), %rcx
leaq 0x23eeb(%rip), %rax     # 0x5ccc0
movq (%rax,%rcx,8), %rdi
movq -0x18(%rbp), %rsi
movq -0x38(%rbp), %rdx
callq 0x3a7b0
movq -0x18(%rbp), %rcx
leaq 0x23ecf(%rip), %rax     # 0x5ccc0
movq (%rax,%rcx,8), %rdi
movq -0x40(%rbp), %rsi
movq -0x8(%rbp), %rdx
movq -0x30(%rbp), %rax
shlq %rax
movq -0x18(%rbp), %rcx
addq -0x20(%rbp), %rcx
movl $0x1, %r8d
shlq %cl, %r8
movq %r8, %rcx
imulq %rcx, %rax
shlq $0x3, %rax
addq %rax, %rdx
movq -0x38(%rbp), %rcx
movq -0x38(%rbp), %r8
movq -0x40(%rbp), %r9
callq 0x48240
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x38d6f
jmp 0x38e47
movq -0x18(%rbp), %rax
addq -0x20(%rbp), %rax
cmpq $0x2, %rax
jle 0x38f3f
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq -0x18(%rbp), %rcx
addq -0x20(%rbp), %rcx
movl $0x1, %edx
shlq %cl, %rdx
movq %rdx, %rcx
cmpq %rcx, %rax
jae 0x38f3a
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
shlq %rax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x18(%rbp), %rcx
addq -0x20(%rbp), %rcx
movl $0x1, %esi
shlq %cl, %rsi
movq -0x10(%rbp), %rcx
leaq 0x23e12(%rip), %rax     # 0x5ccc0
movq (%rax,%rcx,8), %rdx
movq -0x48(%rbp), %rcx
movq -0x48(%rbp), %r8
movl $0x4, %r9d
callq 0x48240
movq -0x10(%rbp), %rcx
leaq 0x23df0(%rip), %rax     # 0x5ccc0
movq (%rax,%rcx,8), %rdi
movq -0x10(%rbp), %rsi
movl $0x4, %edx
callq 0x3a7b0
movq -0x10(%rbp), %rcx
leaq 0x23dd3(%rip), %rax     # 0x5ccc0
movq (%rax,%rcx,8), %rdi
movq -0x48(%rbp), %rsi
movq -0x8(%rbp), %rdx
movq -0x28(%rbp), %rax
shlq %rax
shlq $0x3, %rax
addq %rax, %rdx
movq -0x18(%rbp), %rcx
addq -0x20(%rbp), %rcx
movl $0x1, %eax
shlq %cl, %rax
movq %rax, %rcx
movq -0x48(%rbp), %r9
movl $0x4, %r8d
callq 0x48240
movq -0x28(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x28(%rbp)
jmp 0x38e61
jmp 0x38ff9
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rcx
addq -0x20(%rbp), %rcx
movl $0x1, %esi
shlq %cl, %rsi
movq -0x10(%rbp), %rcx
leaq 0x23d62(%rip), %rax     # 0x5ccc0
movq (%rax,%rcx,8), %rdx
movq -0x48(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x48(%rbp), %r8
movq -0x18(%rbp), %rcx
addq -0x20(%rbp), %rcx
movl $0x1, %r9d
shlq %cl, %r9
movq -0x58(%rbp), %rcx
callq 0x48240
movq -0x10(%rbp), %rcx
leaq 0x23d2d(%rip), %rax     # 0x5ccc0
movq (%rax,%rcx,8), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rcx
addq -0x20(%rbp), %rcx
movl $0x1, %edx
shlq %cl, %rdx
callq 0x3a7b0
movq -0x10(%rbp), %rcx
leaq 0x23d05(%rip), %rax     # 0x5ccc0
movq (%rax,%rcx,8), %rdi
movq -0x48(%rbp), %rsi
movq -0x8(%rbp), %rdx
movq -0x18(%rbp), %rcx
addq -0x20(%rbp), %rcx
movl $0x1, %eax
shlq %cl, %rax
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rcx
addq -0x20(%rbp), %rcx
movl $0x1, %r8d
shlq %cl, %r8
movq -0x50(%rbp), %rcx
movq -0x48(%rbp), %r9
callq 0x48240
jmp 0x3904d
cmpq $0x0, -0x10(%rbp)
jne 0x39015
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x385f0
jmp 0x3904b
cmpq $0x0, -0x18(%rbp)
jne 0x3902f
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x385f0
jmp 0x39049
cmpq $0x0, -0x20(%rbp)
jne 0x39047
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x385f0
jmp 0x39049
jmp 0x3904b
jmp 0x3904d
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)