// File: /workspace/github_cpp_makefile_star2_O1/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 0x9a42
testl %edi, %edi
jne 0x9c70
movq 0x2dd0c(%rip), %rax     # 0x37540
subq 0x2dcfd(%rip), %rax     # 0x37538
cmpq $0x20, %rax
jbe 0x9c7b
leaq 0x128(%rsp), %rdi
callq 0xcfd0
leaq 0x28(%rsp), %rdi
callq 0xcfd0
movq 0x2dcd5(%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 0xa97e
leaq 0x128(%rsp), %rdi
leaq 0x108(%rsp), %rsi
callq 0xd69c
movq 0x108(%rsp), %rdi
cmpq %r14, %rdi
je 0x98b8
movq 0x118(%rsp), %rsi
incq %rsi
callq 0x3310
movq 0x2dc79(%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 0xa97e
leaq 0x28(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
callq 0xd69c
movq 0xe8(%rsp), %rdi
cmpq %r14, %rdi
je 0x9912
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0x3310
leaq 0x68(%rsp), %rdi
callq 0xcfd0
leaq 0x128(%rsp), %rdi
leaq 0x28(%rsp), %rsi
leaq 0x68(%rsp), %rdx
callq 0x1a28f
leaq 0x68(%rsp), %rdi
movsd 0x21718(%rip), %xmm0    # 0x2b058
xorl %esi, %esi
callq 0xd21c
leaq 0xd8(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x130(%rsp), %rsi
movq 0x138(%rsp), %rdx
addq %rsi, %rdx
leaq 0xc8(%rsp), %rdi
callq 0xa97e
leaq 0x68(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
callq 0xcf04
movq 0xc8(%rsp), %rdi
cmpq %r14, %rdi
je 0x99a2
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x3310
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x22145(%rip), %rsi     # 0x2baf7
leaq 0x22143(%rip), %rdx     # 0x2bafc
leaq 0x8(%rsp), %rdi
callq 0xaa0e
leaq 0x68(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xcf1e
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x99e9
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3310
leaq 0x178(%rsp), %rdi
leaq 0x68(%rsp), %rsi
movl $0x1, %edx
callq 0xdabe
leaq 0x188(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x9a21
movq 0x188(%rsp), %rsi
incq %rsi
callq 0x3310
leaq 0x68(%rsp), %rdi
callq 0xd0fc
leaq 0x28(%rsp), %rdi
callq 0xd0fc
leaq 0x128(%rsp), %rdi
jmp 0x9c6b
movq 0x2daf7(%rip), %rax     # 0x37540
cmpq 0x2dae8(%rip), %rax     # 0x37538
je 0x9c87
leaq 0x28(%rsp), %rdi
callq 0xcfd0
movq 0x2dad1(%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 0xa97e
leaq 0x28(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0xd69c
movq 0xa8(%rsp), %rdi
cmpq %r14, %rdi
je 0x9ab9
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x3310
leaq 0x128(%rsp), %rdi
callq 0x1afc0
movq 0x60(%rsp), %rsi
movl 0x50(%rsp), %edx
movl 0x54(%rsp), %ecx
leaq 0x128(%rsp), %rdi
xorl %r8d, %r8d
callq 0x1db64
movl 0x50(%rsp), %esi
movl 0x54(%rsp), %edx
leaq 0x68(%rsp), %rdi
callq 0xd07e
movq 0xa0(%rsp), %rsi
leaq 0x128(%rsp), %rdi
callq 0x1e5f8
leaq 0x28(%rsp), %rdi
leaq 0x68(%rsp), %rsi
leaq 0x8(%rsp), %rdx
movq %rsp, %rcx
callq 0x22fdf
movq 0x2d4a8(%rip), %rdi     # 0x36fd0
leaq 0x21f92(%rip), %rsi     # 0x2bac1
movl $0xa, %edx
callq 0x3360
movsd 0x8(%rsp), %xmm0
movq 0x2d48a(%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 0x1db64
movq 0xa0(%rsp), %rsi
leaq 0x128(%rsp), %rdi
callq 0x1e5f8
leaq 0x28(%rsp), %rdi
leaq 0x68(%rsp), %rsi
leaq 0x8(%rsp), %rdx
movq %rsp, %rcx
callq 0x22fdf
movq 0x2d3eb(%rip), %rdi     # 0x36fd0
leaq 0x21ed5(%rip), %rsi     # 0x2bac1
movl $0xa, %edx
callq 0x3360
movsd 0x8(%rsp), %xmm0
movq 0x2d3cd(%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 0xd0fc
leaq 0x128(%rsp), %rdi
callq 0x1b33a
leaq 0x28(%rsp), %rdi
callq 0xd0fc
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r14
retq
leaq 0x21e4e(%rip), %rdi     # 0x2bad0
callq 0x403c
leaq 0x21e6f(%rip), %rdi     # 0x2bafd
callq 0x403c
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x9d57
movq 0x18(%rsp), %rsi
jmp 0x9cc7
movq %rax, %rbx
movq 0xc8(%rsp), %rdi
cmpq %r14, %rdi
je 0x9d57
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x3310
jmp 0x9d57
jmp 0x9d75
jmp 0x9d4f
jmp 0x9cf7
movq %rax, %rbx
movq 0xe8(%rsp), %rdi
cmpq %r14, %rdi
je 0x9d61
movq 0xf8(%rsp), %rsi
jmp 0x9d19
movq %rax, %rbx
jmp 0x9d82
jmp 0x9d45
movq %rax, %rbx
movq 0x108(%rsp), %rdi
cmpq %r14, %rdi
je 0x9d61
movq 0x118(%rsp), %rsi
incq %rsi
callq 0x3310
jmp 0x9d61
movq %rax, %rbx
movq 0xa8(%rsp), %rdi
cmpq %r14, %rdi
je 0x9d8f
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x3310
jmp 0x9d8f
movq %rax, %rbx
jmp 0x9d8f
movq %rax, %rbx
jmp 0x9d6b
movq %rax, %rbx
jmp 0x9d61
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0xd0fc
leaq 0x28(%rsp), %rdi
callq 0xd0fc
leaq 0x128(%rsp), %rdi
jmp 0x9d94
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0xd0fc
leaq 0x128(%rsp), %rdi
callq 0x1b33a
leaq 0x28(%rsp), %rdi
callq 0xd0fc
movq %rbx, %rdi
callq 0x3500