// File: /workspace/github_cpp_makefile_star2_O3/kebwi[P]Trifid/src/main.cpp
// Function: testFourierConvolution(int)
void testFourierConvolution(int method)
{
	if (method == 0)
	{
		if (sInputFilenames.size() < 2)
			die("Please enter two PGM files to convolve");
		
		ImageReal img1, img2;
		img1.readFile(sInputFilenames[0]);
		img2.readFile(sInputFilenames[1]);
		
		ImageReal convolvedImgReal;
		convolveImages(img1, img2, convolvedImgReal);
		
		convolvedImgReal.normalize(1, false);
		
		convolvedImgReal.setFilename(img1.filename());
		convolvedImgReal.appendFilename("_conv");
		convolvedImgReal.writeFile(1);
	}
	else if (method == 1)
	{
		if (sInputFilenames.size() < 1)
			die("Please enter one PGM file to convolve with the steerable pyramid filters");
		
		ImageReal img1;
		img1.readFile(sInputFilenames[0]);
		
		SteerablePyramid steerPyr;
		steerPyr.DoFullWaveletAnalysis(img1.img(), img1.width(), img1.height(), false);
		
		ImageReal img1SynthReal(img1.width(), img1.height());
		steerPyr.DoFullWaveletSynthesis(img1SynthReal.img());
		
		Float_t mse, psnr;
		calc1ChnlMSE_PSNR(img1, img1SynthReal, mse, psnr);
		cout << "MSE/PSNR: " << mse << setw(14) << psnr << endl;
		
		//---------------------
		
		steerPyr.DoFullWaveletAnalysis(img1.img(), img1.width(), img1.height(), true);
		
		steerPyr.DoFullWaveletSynthesis(img1SynthReal.img());
		
		calc1ChnlMSE_PSNR(img1, img1SynthReal, mse, psnr);
		cout << "MSE/PSNR: " << mse << setw(14) << psnr << endl;
	}
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x198, %rsp            # imm = 0x198
cmpl $0x1, %edi
je 0x99f1
testl %edi, %edi
jne 0x9c1f
movq 0x2dd5d(%rip), %rax     # 0x37540
subq 0x2dd4e(%rip), %rax     # 0x37538
cmpq $0x20, %rax
jbe 0x9c2a
leaq 0x128(%rsp), %rdi
callq 0xcf0c
leaq 0x28(%rsp), %rdi
callq 0xcf0c
movq 0x2dd26(%rip), %rax     # 0x37538
leaq 0x118(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x108(%rsp), %rdi
callq 0xa92c
leaq 0x128(%rsp), %rdi
leaq 0x108(%rsp), %rsi
callq 0xd5da
movq 0x108(%rsp), %rdi
cmpq %r14, %rdi
je 0x9867
movq 0x118(%rsp), %rsi
incq %rsi
callq 0x3310
movq 0x2dcca(%rip), %rax     # 0x37538
leaq 0xf8(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x20(%rax), %rsi
movq 0x28(%rax), %rdx
addq %rsi, %rdx
leaq 0xe8(%rsp), %rdi
callq 0xa92c
leaq 0x28(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
callq 0xd5da
movq 0xe8(%rsp), %rdi
cmpq %r14, %rdi
je 0x98c1
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0x3310
leaq 0x68(%rsp), %rdi
callq 0xcf0c
leaq 0x128(%rsp), %rdi
leaq 0x28(%rsp), %rsi
leaq 0x68(%rsp), %rdx
callq 0x19de8
leaq 0x68(%rsp), %rdi
movsd 0x20769(%rip), %xmm0    # 0x2a058
xorl %esi, %esi
callq 0xd158
leaq 0xd8(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x130(%rsp), %rsi
movq 0x138(%rsp), %rdx
addq %rsi, %rdx
leaq 0xc8(%rsp), %rdi
callq 0xa92c
leaq 0x68(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
callq 0xce40
movq 0xc8(%rsp), %rdi
cmpq %r14, %rdi
je 0x9951
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x3310
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x21174(%rip), %rsi     # 0x2aad5
leaq 0x21172(%rip), %rdx     # 0x2aada
leaq 0x8(%rsp), %rdi
callq 0xa9c2
leaq 0x68(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xce5a
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x9998
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3310
leaq 0x178(%rsp), %rdi
leaq 0x68(%rsp), %rsi
movl $0x1, %edx
callq 0xd9fc
leaq 0x188(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x99d0
movq 0x188(%rsp), %rsi
incq %rsi
callq 0x3310
leaq 0x68(%rsp), %rdi
callq 0xd038
leaq 0x28(%rsp), %rdi
callq 0xd038
leaq 0x128(%rsp), %rdi
jmp 0x9c1a
movq 0x2db48(%rip), %rax     # 0x37540
cmpq 0x2db39(%rip), %rax     # 0x37538
je 0x9c36
leaq 0x28(%rsp), %rdi
callq 0xcf0c
movq 0x2db22(%rip), %rax     # 0x37538
leaq 0xb8(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0xa8(%rsp), %rdi
callq 0xa92c
leaq 0x28(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0xd5da
movq 0xa8(%rsp), %rdi
cmpq %r14, %rdi
je 0x9a68
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x3310
leaq 0x128(%rsp), %rdi
callq 0x1ab34
movq 0x60(%rsp), %rsi
movl 0x50(%rsp), %edx
movl 0x54(%rsp), %ecx
leaq 0x128(%rsp), %rdi
xorl %r8d, %r8d
callq 0x1d788
movl 0x50(%rsp), %esi
movl 0x54(%rsp), %edx
leaq 0x68(%rsp), %rdi
callq 0xcfba
movq 0xa0(%rsp), %rsi
leaq 0x128(%rsp), %rdi
callq 0x1e372
leaq 0x28(%rsp), %rdi
leaq 0x68(%rsp), %rsi
leaq 0x8(%rsp), %rdx
movq %rsp, %rcx
callq 0x22d74
movq 0x2d4f9(%rip), %rdi     # 0x36fd0
leaq 0x20fc1(%rip), %rsi     # 0x2aa9f
movl $0xa, %edx
callq 0x3360
movsd 0x8(%rsp), %xmm0
movq 0x2d4db(%rip), %rdi     # 0x36fd0
callq 0x3480
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0xe, 0x10(%rax,%rcx)
movsd (%rsp), %xmm0
movq %rax, %rdi
callq 0x3480
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x32e0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31f0
movq 0x60(%rsp), %rsi
movl 0x50(%rsp), %edx
movl 0x54(%rsp), %ecx
leaq 0x128(%rsp), %rdi
movl $0x1, %r8d
callq 0x1d788
movq 0xa0(%rsp), %rsi
leaq 0x128(%rsp), %rdi
callq 0x1e372
leaq 0x28(%rsp), %rdi
leaq 0x68(%rsp), %rsi
leaq 0x8(%rsp), %rdx
movq %rsp, %rcx
callq 0x22d74
movq 0x2d43c(%rip), %rdi     # 0x36fd0
leaq 0x20f04(%rip), %rsi     # 0x2aa9f
movl $0xa, %edx
callq 0x3360
movsd 0x8(%rsp), %xmm0
movq 0x2d41e(%rip), %rdi     # 0x36fd0
callq 0x3480
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0xe, 0x10(%rax,%rcx)
movsd (%rsp), %xmm0
movq %rax, %rdi
callq 0x3480
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x32e0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31f0
leaq 0x68(%rsp), %rdi
callq 0xd038
leaq 0x128(%rsp), %rdi
callq 0x1aeae
leaq 0x28(%rsp), %rdi
callq 0xd038
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r14
retq
leaq 0x20e7d(%rip), %rdi     # 0x2aaae
callq 0x403c
leaq 0x20e9e(%rip), %rdi     # 0x2aadb
callq 0x403c
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x9d06
movq 0x18(%rsp), %rsi
jmp 0x9c76
movq %rax, %rbx
movq 0xc8(%rsp), %rdi
cmpq %r14, %rdi
je 0x9d06
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x3310
jmp 0x9d06
jmp 0x9d24
jmp 0x9cfe
jmp 0x9ca6
movq %rax, %rbx
movq 0xe8(%rsp), %rdi
cmpq %r14, %rdi
je 0x9d10
movq 0xf8(%rsp), %rsi
jmp 0x9cc8
movq %rax, %rbx
jmp 0x9d31
jmp 0x9cf4
movq %rax, %rbx
movq 0x108(%rsp), %rdi
cmpq %r14, %rdi
je 0x9d10
movq 0x118(%rsp), %rsi
incq %rsi
callq 0x3310
jmp 0x9d10
movq %rax, %rbx
movq 0xa8(%rsp), %rdi
cmpq %r14, %rdi
je 0x9d3e
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x3310
jmp 0x9d3e
movq %rax, %rbx
jmp 0x9d3e
movq %rax, %rbx
jmp 0x9d1a
movq %rax, %rbx
jmp 0x9d10
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0xd038
leaq 0x28(%rsp), %rdi
callq 0xd038
leaq 0x128(%rsp), %rdi
jmp 0x9d43
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0xd038
leaq 0x128(%rsp), %rdi
callq 0x1aeae
leaq 0x28(%rsp), %rdi
callq 0xd038
movq %rbx, %rdi
callq 0x3500