// File: kebwi[P]Trifid/src/main.cpp
// Function: programBehavior1ChnlImagePairStats()
void programBehavior1ChnlImagePairStats()
{
	ImageReal grayImg1;
	grayImg1.readFile(sInputFilenames[0]);
	int width = grayImg1.width(), height = grayImg1.height();
	
	//The bit depth should be 12 for RAW files from cameras,
	//but 16 for images created (by scaling by 256) from 8 bit images.
	ImageReal grayImg2(width, height);
	vector<vector<Float_t> > stats(sInputFilenames.size());
	Float_t mse, psnr;
	for (int imageIdx = 1; imageIdx < sInputFilenames.size(); imageIdx++)
	{
		stats[imageIdx].resize(3);
		grayImg2.readFile(sInputFilenames[imageIdx]);
		
		cout << endl;
		
		calc1ChnlMSE_PSNR(grayImg1, grayImg2, mse, psnr);
		stats[imageIdx][0] = mse;
		stats[imageIdx][1] = sqrt(mse);
		stats[imageIdx][2] = psnr;
	}
	
	for (int i = 0; i < 3; i++)
	{
		switch (i)
		{
			case 0:  cout << "MSE:              "; break;
			case 1:  cout << "RMSE:             "; break;
			case 2:  cout << "PSNR (dB):        "; break;
		}
		
		for (int j = 1; j < sInputFilenames.size(); j++)
			cout << setw(12) << stats[j][i];
		cout << endl;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x180, %rsp            # imm = 0x180
leaq -0x40(%rbp), %rdi
callq 0x155e0
leaq 0x5104d(%rip), %rdi     # 0x5a5f8
xorl %eax, %eax
movl %eax, %esi
callq 0xe750
movq %rax, %rsi
leaq -0x60(%rbp), %rdi
callq 0x4180
jmp 0x95c2
leaq -0x40(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x16200
jmp 0x95d1
leaq -0x60(%rbp), %rdi
callq 0x46c8
leaq -0x40(%rbp), %rdi
callq 0xedd0
movl %eax, -0x120(%rbp)
jmp 0x95eb
movl -0x120(%rbp), %eax
movl %eax, -0x70(%rbp)
leaq -0x40(%rbp), %rdi
callq 0xedf0
movl %eax, -0x124(%rbp)
jmp 0x9605
movl -0x124(%rbp), %eax
movl %eax, -0x74(%rbp)
movl -0x70(%rbp), %esi
movl -0x74(%rbp), %edx
leaq -0xb8(%rbp), %rdi
callq 0x15710
jmp 0x9622
leaq 0x50fcf(%rip), %rdi     # 0x5a5f8
callq 0xe730
movq %rax, -0x138(%rbp)
leaq -0xd1(%rbp), %rdi
movq %rdi, -0x130(%rbp)
callq 0xee10
movq -0x138(%rbp), %rsi
movq -0x130(%rbp), %rdx
leaq -0xd0(%rbp), %rdi
callq 0xee30
jmp 0x9664
leaq -0xd1(%rbp), %rdi
callq 0xeea0
movl $0x1, -0xec(%rbp)
movslq -0xec(%rbp), %rax
movq %rax, -0x140(%rbp)
leaq 0x50f69(%rip), %rdi     # 0x5a5f8
callq 0xe730
movq %rax, %rcx
movq -0x140(%rbp), %rax
cmpq %rcx, %rax
jae 0x9885
movslq -0xec(%rbp), %rsi
leaq -0xd0(%rbp), %rdi
callq 0xeec0
movq %rax, %rdi
movl $0x3, %esi
callq 0xe5e0
jmp 0x96c9
movslq -0xec(%rbp), %rsi
leaq 0x50f21(%rip), %rdi     # 0x5a5f8
callq 0xe750
movq %rax, %rsi
leaq -0x110(%rbp), %rdi
callq 0x4180
jmp 0x96ed
leaq -0xb8(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0x16200
jmp 0x9702
leaq -0x110(%rbp), %rdi
callq 0x46c8
movq 0x508bb(%rip), %rdi     # 0x59fd0
movq 0x5089c(%rip), %rsi     # 0x59fb8
callq 0x43d0
jmp 0x9723
leaq -0x40(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
leaq -0xe0(%rbp), %rdx
leaq -0xe8(%rbp), %rcx
callq 0x37940
jmp 0x9743
movsd -0xe0(%rbp), %xmm0
movsd %xmm0, -0x158(%rbp)
movslq -0xec(%rbp), %rsi
leaq -0xd0(%rbp), %rdi
callq 0xeec0
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xe670
movsd -0x158(%rbp), %xmm0
movsd %xmm0, (%rax)
movsd -0xe0(%rbp), %xmm0
callq 0x42c0
movsd %xmm0, -0x150(%rbp)
movslq -0xec(%rbp), %rsi
leaq -0xd0(%rbp), %rdi
callq 0xeec0
movq %rax, %rdi
movl $0x1, %esi
callq 0xe670
movsd -0x150(%rbp), %xmm0
movsd %xmm0, (%rax)
movsd -0xe8(%rbp), %xmm0
movsd %xmm0, -0x148(%rbp)
movslq -0xec(%rbp), %rsi
leaq -0xd0(%rbp), %rdi
callq 0xeec0
movq %rax, %rdi
movl $0x2, %esi
callq 0xe670
movsd -0x148(%rbp), %xmm0
movsd %xmm0, (%rax)
movl -0xec(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xec(%rbp)
jmp 0x967a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x9a34
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x46c8
jmp 0x9a34
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0xd1(%rbp), %rdi
callq 0xeea0
jmp 0x9a28
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x9a1c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x46c8
jmp 0x9a1c
movl $0x0, -0x114(%rbp)
cmpl $0x3, -0x114(%rbp)
jge 0x99f2
movl -0x114(%rbp), %eax
movl %eax, -0x15c(%rbp)
testl %eax, %eax
je 0x98c8
jmp 0x98ae
movl -0x15c(%rbp), %eax
subl $0x1, %eax
je 0x98df
jmp 0x98bb
movl -0x15c(%rbp), %eax
subl $0x2, %eax
je 0x98f6
jmp 0x990d
movq 0x50701(%rip), %rdi     # 0x59fd0
leaq 0x40052(%rip), %rsi     # 0x49928
callq 0x4390
jmp 0x98dd
jmp 0x990d
movq 0x506ea(%rip), %rdi     # 0x59fd0
leaq 0x4004e(%rip), %rsi     # 0x4993b
callq 0x4390
jmp 0x98f4
jmp 0x990d
movq 0x506d3(%rip), %rdi     # 0x59fd0
leaq 0x400f5(%rip), %rsi     # 0x499f9
callq 0x4390
jmp 0x990b
jmp 0x990d
movl $0x1, -0x118(%rbp)
movslq -0x118(%rbp), %rax
movq %rax, -0x168(%rbp)
leaq 0x50ccc(%rip), %rdi     # 0x5a5f8
callq 0xe730
movq %rax, %rcx
movq -0x168(%rbp), %rax
cmpq %rcx, %rax
jae 0x99c7
movl $0xc, %edi
callq 0xe410
movl %eax, -0x16c(%rbp)
jmp 0x9956
movl -0x16c(%rbp), %eax
movl %eax, -0x11c(%rbp)
movl -0x11c(%rbp), %esi
movq 0x50661(%rip), %rdi     # 0x59fd0
callq 0x4430
movq %rax, -0x178(%rbp)
jmp 0x997d
movslq -0x118(%rbp), %rsi
leaq -0xd0(%rbp), %rdi
callq 0xeec0
movq %rax, %rdi
movslq -0x114(%rbp), %rsi
callq 0xe670
movq -0x178(%rbp), %rdi
movsd (%rax), %xmm0
callq 0x4670
jmp 0x99b1
jmp 0x99b3
movl -0x118(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x118(%rbp)
jmp 0x9917
movq 0x50602(%rip), %rdi     # 0x59fd0
movq 0x505e3(%rip), %rsi     # 0x59fb8
callq 0x43d0
jmp 0x99dc
jmp 0x99de
movl -0x114(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x114(%rbp)
jmp 0x988f
leaq -0xd0(%rbp), %rdi
callq 0xeee0
leaq -0xb8(%rbp), %rdi
callq 0x157e0
leaq -0x40(%rbp), %rdi
callq 0x157e0
addq $0x180, %rsp            # imm = 0x180
popq %rbp
retq
leaq -0xd0(%rbp), %rdi
callq 0xeee0
leaq -0xb8(%rbp), %rdi
callq 0x157e0
leaq -0x40(%rbp), %rdi
callq 0x157e0
movq -0x68(%rbp), %rdi
callq 0x4620
nopw %cs:(%rax,%rax)