// File: /workspace/github_cpp_makefile_star2_O2/kebwi[P]Trifid/src/main.cpp
// Function: programBehaviorRGBImagePairStats()
void programBehaviorRGBImagePairStats()
{
	//Keep track of the first image, it is the baseline for stat calculations
	Image3ChnlReal rgbImg1;
	rgbImg1.readFile(sInputFilenames[0]);
	int width = rgbImg1.width(), height = rgbImg1.height();
	int totalPixels = width * height;
	
	//RGB to Lab the first image
	Image3ChnlReal labImg1(width, height);
	rgbImgToLabImg(1, rgbImg1, labImg1);
	
	//Normalize Lab, this is for Lab PSNR.
	//Instead of normalizing and getting Lab PSNR,
	//it would be better to get Lab MSE instead.
	Image3ChnlReal labImg1Norm = labImg1;
	Float_t minVal = (*labImg1Norm[0])[0];
	for (int c = 0; c < 3; c++)
		for (int i = 0; i < totalPixels; i++)
			if ((*labImg1Norm[c])[i] < minVal)
				minVal = (*labImg1Norm[c])[i];
	if (minVal < 0)
		for (int c = 0; c < 3; c++)
			for (int i = 0; i < totalPixels; i++)
				(*labImg1Norm[c])[i] -= minVal;
	labImg1Norm.normalize(1.0, true, false);
	
	//Calculate the stats for each image
	Image3ChnlReal labImg2Norm(width, height);
	vector<ImageStats> imageStats(sInputFilenames.size() - 1);
	Float_t mse;
	for (int imageIdx = 1; imageIdx < sInputFilenames.size(); imageIdx++)
	{
		imageStats[imageIdx - 1].rgbImg.readFile(sInputFilenames[imageIdx]);
		
		calcRGB_MSE_PSNR(rgbImg1, imageStats[imageIdx - 1].rgbImg, mse, imageStats[imageIdx - 1].rgbPsnr);
		cout << "Image Index " << imageIdx
			<< "    mse: " << mse
			<< "    psnr: " << imageStats[imageIdx - 1].rgbPsnr;
		
		calc1ChnlMSE_PSNR(*rgbImg1[0], *imageStats[imageIdx - 1].rgbImg[0], mse, imageStats[imageIdx - 1].rPsnr);
		
		calc1ChnlMSE_PSNR(*rgbImg1[1], *imageStats[imageIdx - 1].rgbImg[1], mse, imageStats[imageIdx - 1].gPsnr);
		
		calc1ChnlMSE_PSNR(*rgbImg1[2], *imageStats[imageIdx - 1].rgbImg[2], mse, imageStats[imageIdx - 1].bPsnr);
		
		rgbImgToLabImg(1, imageStats[imageIdx - 1].rgbImg, imageStats[imageIdx - 1].labImg);
		labImg2Norm = imageStats[imageIdx - 1].labImg;
		minVal = (*labImg2Norm[0])[0];
		for (int c = 0; c < 3; c++)
			for (int i = 0; i < totalPixels; i++)
				if ((*labImg2Norm[c])[i] < minVal)
					minVal = (*labImg2Norm[c])[i];
		if (minVal < 0)
			for (int c = 0; c < 3; c++)
				for (int i = 0; i < totalPixels; i++)
					(*labImg2Norm[c])[i] -= minVal;
		labImg2Norm.normalize(1.0, true, false);
		
		//LAB PSNR isn't a justified stat in the literature.  I just made it up for my own curiosity.
		//calcRGB_MSE_PSNR(labImg1Norm, labImg2Norm, mse, imageStats[imageIdx - 1].labPsnr);
		//cout << "    labPsnr: " << imageStats[imageIdx - 1].labPsnr;
		
		imageStats[imageIdx - 1].labDeltaE = calcImgLabDeltaE(labImg1, imageStats[imageIdx - 1].labImg);
		cout << "    labDeltaE: " << imageStats[imageIdx - 1].labDeltaE;
		cout << endl;
	}
	
	//Mark the min and max stats
	Float_t minV, maxV;
	int minIdx, maxIdx;
	
	minV = maxV = imageStats[0].rPsnr;
	for (int i = 0; i < imageStats.size(); i++)
	{
		if (imageStats[i].rPsnr < minV)
			minV = imageStats[i].rPsnr;
		if (imageStats[i].rPsnr > maxV)
			maxV = imageStats[i].rPsnr;
	}
	for (int i = 0; i < imageStats.size(); i++)
	{
		if (imageStats[i].rPsnr == minV)
			imageStats[i].minRPsnr = true;
		if (imageStats[i].rPsnr == maxV)
			imageStats[i].maxRPsnr = true;
	}
	
	minV = maxV = imageStats[0].gPsnr;
	for (int i = 0; i < imageStats.size(); i++)
	{
		if (imageStats[i].gPsnr < minV)
			minV = imageStats[i].gPsnr;
		if (imageStats[i].gPsnr > maxV)
			maxV = imageStats[i].gPsnr;
	}
	for (int i = 0; i < imageStats.size(); i++)
	{
		if (imageStats[i].gPsnr == minV)
			imageStats[i].minGPsnr = true;
		if (imageStats[i].gPsnr == maxV)
			imageStats[i].maxGPsnr = true;
	}
	
	minV = maxV = imageStats[0].bPsnr;
	for (int i = 0; i < imageStats.size(); i++)
	{
		if (imageStats[i].bPsnr < minV)
			minV = imageStats[i].bPsnr;
		if (imageStats[i].bPsnr > maxV)
			maxV = imageStats[i].bPsnr;
	}
	for (int i = 0; i < imageStats.size(); i++)
	{
		if (imageStats[i].bPsnr == minV)
			imageStats[i].minBPsnr = true;
		if (imageStats[i].bPsnr == maxV)
			imageStats[i].maxBPsnr = true;
	}
	
	minV = maxV = imageStats[0].rgbPsnr;
	for (int i = 0; i < imageStats.size(); i++)
	{
		if (imageStats[i].rgbPsnr < minV)
			minV = imageStats[i].rgbPsnr;
		if (imageStats[i].rgbPsnr > maxV)
			maxV = imageStats[i].rgbPsnr;
	}
	for (int i = 0; i < imageStats.size(); i++)
	{
		if (imageStats[i].rgbPsnr == minV)
			imageStats[i].minRGBPsnr = true;
		if (imageStats[i].rgbPsnr == maxV)
			imageStats[i].maxRGBPsnr = true;
	}
	
	minV = maxV = imageStats[0].labPsnr;
	for (int i = 0; i < imageStats.size(); i++)
	{
		if (imageStats[i].labPsnr < minV)
			minV = imageStats[i].labPsnr;
		if (imageStats[i].labPsnr > maxV)
			maxV = imageStats[i].labPsnr;
	}
	for (int i = 0; i < imageStats.size(); i++)
	{
		if (imageStats[i].labPsnr == minV)
			imageStats[i].minLabPsnr = true;
		if (imageStats[i].labPsnr == maxV)
			imageStats[i].maxLabPsnr = true;
	}
	
	minV = maxV = imageStats[0].labDeltaE;
	for (int i = 0; i < imageStats.size(); i++)
	{
		if (imageStats[i].labDeltaE < minV)
			minV = imageStats[i].labDeltaE;
		if (imageStats[i].labDeltaE > maxV)
			maxV = imageStats[i].labDeltaE;
	}
	for (int i = 0; i < imageStats.size(); i++)
	{
		if (imageStats[i].labDeltaE == minV)
			imageStats[i].minLabDeltaE = true;
		if (imageStats[i].labDeltaE == maxV)
			imageStats[i].maxLabDeltaE = true;
	}
	
	//Write the file names
	cout << endl << "Filename order:" << endl;
	for (int imageIdx = 1; imageIdx < sInputFilenames.size(); imageIdx++)
		cout << (char)('A' + (imageIdx - 1)) << ": " << sInputFilenames[imageIdx] << endl;
	
	//Write the results
	cout << endl << "Results:" << endl;
	cout << "                      ";
	for (int imageIdx = 1; imageIdx < sInputFilenames.size(); imageIdx++)
		cout << setw(12) << (char)('A' + (imageIdx - 1));
	cout << endl;
	
	for (int i = 0; i < 6; i++)
	{
		//LAB PSNR isn't a justified stat in the literature.  I just made it up for my own curiosity.
		if (i == 4)
			continue;
		
		switch (i)
		{
			case 0: cout << "Red PSNR (dB):        "; break;
			case 1: cout << "Green PSNR (dB):      "; break;
			case 2: cout << "Blue PSNR (dB):       "; break;
			case 3: cout << "RGB PSNR (dB):        "; break;
			case 4: cout << "Lab PSNR (dB):        "; break;
			case 5: cout << "Lab Delta E:          "; break;
		}
		
		//Write the stats
		for (int j = 0; j < imageStats.size(); j++)
		{
			switch (i)
			{
				case 0:
					cout << setw(12) << imageStats[j].rPsnr;
					break;
				case 1:
					cout << setw(12) << imageStats[j].gPsnr;
					break;
				case 2:
					cout << setw(12) << imageStats[j].bPsnr;
					break;
				case 3:
					cout << setw(12) << imageStats[j].rgbPsnr;
					break;
				case 4:
					cout << setw(12) << imageStats[j].labPsnr;
					break;
				case 5:
					cout << setw(12) << imageStats[j].labDeltaE;
					break;
			}
		}
		cout << endl;
		
		//Mark the best and worst
		cout << "                      ";
		for (int j = 0; j < imageStats.size(); j++)
		{
			bool markWorst = false, markBest = false;
			switch (i)
			{
				case 0:
					if (imageStats[j].minRPsnr)
						markWorst = true;
					if (imageStats[j].maxRPsnr)
						markBest = true;
					break;
				case 1:
					if (imageStats[j].minGPsnr)
						markWorst = true;
					if (imageStats[j].maxGPsnr)
						markBest = true;
					break;
				case 2:
					if (imageStats[j].minBPsnr)
						markWorst = true;
					if (imageStats[j].maxBPsnr)
						markBest = true;
					break;
				case 3:
					if (imageStats[j].minRGBPsnr)
						markWorst = true;
					if (imageStats[j].maxRGBPsnr)
						markBest = true;
					break;
				case 4:
					if (imageStats[j].minLabPsnr)
						markWorst = true;
					if (imageStats[j].maxLabPsnr)
						markBest = true;
					break;
				case 5:
					if (imageStats[j].maxLabDeltaE)
						markWorst = true;
					if (imageStats[j].minLabDeltaE)
						markBest = true;
					break;
			}
			if (markWorst && markBest)
				markWorst = false;
			
			if (markWorst)
				cout << setw(12) << "-- WORST --";
			else if (markBest)
				cout << setw(12) << "=== BEST ===";
			else cout << setw(12) << "";
		}
		cout << endl;
	}
	
	//Write the results sorted
	cout << endl << "Name sorted:" << endl;
	cout << setw(15) << "RGB PSNR" << setw(15) << "Lab Delta E" << endl;
	for (int i = 0; i < imageStats.size(); i++)
		cout << setw(15) << imageStats[i].rgbPsnr << setw(15) << imageStats[i].labDeltaE << "    " << imageStats[i].rgbImg.filename() << endl;
	
	cout << endl << "Name sorted, tab delimited (for easy copy/paste to spread sheet):" << endl;
	cout << "RGB PSNR" << '\t' << "Lab Delta E" << endl;
	for (int i = 0; i < imageStats.size(); i++)
		cout << imageStats[i].rgbPsnr << '\t' << imageStats[i].labDeltaE << endl;
	
	cout << endl << "RGB Psnr sorted:" << endl;
	cout << setw(15) << "RGB PSNR" << setw(15) << "Lab Delta E" << endl;
	sort(imageStats.begin(), imageStats.end(), ImageStats::RGBPsnrSorter());
	for (int i = 0; i < imageStats.size(); i++)
		cout << setw(15) << imageStats[i].rgbPsnr << setw(15) << imageStats[i].labDeltaE << "    " << imageStats[i].rgbImg.filename() << endl;
	
	cout << endl << "RGB Psnr sorted, tab delimited (for easy copy/paste to spread sheet):" << endl;
	cout << "RGB PSNR" << '\t' << "Lab Delta E" << endl;
	for (int i = 0; i < imageStats.size(); i++)
		cout << imageStats[i].rgbPsnr << '\t' << imageStats[i].labDeltaE << endl;
	
	cout << endl << "Lab Delta E sorted:" << endl;
	cout << setw(15) << "RGB PSNR" << setw(15) << "Lab Delta E" << endl;
	sort(imageStats.begin(), imageStats.end(), ImageStats::LabDeltaESorter());
	for (int i = 0; i < imageStats.size(); i++)
		cout << setw(15) << imageStats[i].rgbPsnr << setw(15) << imageStats[i].labDeltaE << "    " << imageStats[i].rgbImg.filename() << endl;
	
	cout << endl << "Lab Delta E sorted, tab delimited (for easy copy/paste to spread sheet):" << endl;
	cout << "RGB PSNR" << '\t' << "Lab Delta E" << endl;
	for (int i = 0; i < imageStats.size(); i++)
		cout << imageStats[i].rgbPsnr << '\t' << imageStats[i].labDeltaE << endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1c8, %rsp            # imm = 0x1C8
leaq 0x48(%rsp), %rdi
callq 0xb390
movq 0x2a3ba(%rip), %rsi     # 0x30528
leaq 0x98(%rsp), %rdi
callq 0x33b0
leaq 0x48(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0xb9be
leaq 0x98(%rsp), %rdi
callq 0x3548
movl 0x70(%rsp), %ebx
movl 0x74(%rsp), %ebp
leaq 0x108(%rsp), %rdi
movl %ebx, %esi
movl %ebp, %edx
callq 0xb5a8
movsd 0x1be9d(%rip), %xmm0    # 0x22058
leaq 0x48(%rsp), %rdi
leaq 0x108(%rsp), %rsi
callq 0xfd37
leaq 0x178(%rsp), %rdi
leaq 0x108(%rsp), %rsi
callq 0xb45c
movl %ebp, %r15d
imull %ebx, %r15d
movq 0x1b0(%rsp), %rax
movq (%rax), %rcx
movq 0x38(%rcx), %rcx
movsd (%rcx), %xmm0
xorl %ecx, %ecx
testl %r15d, %r15d
cmovlel %ecx, %r15d
cmpq $0x3, %rcx
je 0x6231
xorl %edx, %edx
cmpq %rdx, %r15
je 0x622c
movq (%rax,%rcx,8), %rsi
movq 0x38(%rsi), %rsi
movsd (%rsi,%rdx,8), %xmm1
minsd %xmm0, %xmm1
incq %rdx
movapd %xmm1, %xmm0
jmp 0x620d
incq %rcx
jmp 0x6205
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
jbe 0x626a
xorl %ecx, %ecx
cmpq $0x3, %rcx
je 0x626a
xorl %edx, %edx
cmpq %rdx, %r15
je 0x6265
movq (%rax,%rcx,8), %rsi
movq 0x38(%rsi), %rsi
movsd (%rsi,%rdx,8), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, (%rsi,%rdx,8)
incq %rdx
jmp 0x6245
incq %rcx
jmp 0x623d
leaq 0x178(%rsp), %rdi
movsd 0x1bdde(%rip), %xmm0    # 0x22058
pushq $0x1
popq %rsi
xorl %edx, %edx
callq 0xb8ec
leaq 0xb8(%rsp), %rdi
movl %ebx, %esi
movl %ebp, %edx
callq 0xb5a8
movq 0x2a294(%rip), %rsi     # 0x30530
subq 0x2a285(%rip), %rsi     # 0x30528
sarq $0x5, %rsi
decq %rsi
leaq 0x8(%rsp), %rdi
leaq 0x28(%rsp), %rdx
callq 0x8612
pushq $0x1
popq %rbx
leaq 0x158(%rsp), %rdi
leaq 0x20(%rsp), %r12
movq 0x2a260(%rip), %rax     # 0x30530
movq 0x2a251(%rip), %rsi     # 0x30528
subq %rsi, %rax
sarq $0x5, %rax
cmpq %rbx, %rax
jbe 0x6559
movq 0x8(%rsp), %rbp
movq %rbx, %rax
shlq $0x5, %rax
addq %rax, %rsi
movq %rdi, %r13
callq 0x33b0
leaq -0x1(%rbx), %rax
imulq $0xe0, %rax, %r14
addq %r14, %rbp
movq %rbp, %rdi
movq %r13, %rbp
movq %r13, %rsi
callq 0xb9be
movq %rbp, %rdi
callq 0x3548
movq 0x8(%rsp), %rsi
leaq (%rsi,%r14), %rcx
addq $0xb8, %rcx
addq %r14, %rsi
leaq 0x48(%rsp), %rdi
movq %r12, %rdx
callq 0x1bf43
movq 0x29c87(%rip), %rdi     # 0x2ffd0
leaq 0x1c52b(%rip), %rsi     # 0x2287b
callq 0x32c0
movq %rax, %rdi
movl %ebx, %esi
callq 0x34b0
movq %rax, %rdi
leaq 0x1c51f(%rip), %rsi     # 0x22888
callq 0x32c0
movsd 0x20(%rsp), %xmm0
movq %rax, %rdi
callq 0x3460
movq %rax, %rdi
leaq 0x1c50c(%rip), %rsi     # 0x22892
callq 0x32c0
movq 0x8(%rsp), %rcx
movsd 0xb8(%rcx,%r14), %xmm0
movq %rax, %rdi
callq 0x3460
movq 0x80(%rsp), %rax
movq (%rax), %rdi
movq 0x8(%rsp), %rax
leaq (%rax,%r14), %rcx
addq $0xa0, %rcx
movq -0x68(%rcx), %rax
movq (%rax), %rsi
movq %r12, %rdx
callq 0x1be7a
movq 0x80(%rsp), %rax
movq 0x8(%rax), %rdi
movq 0x8(%rsp), %rax
leaq (%rax,%r14), %rcx
addq $0xa8, %rcx
movq -0x70(%rcx), %rax
movq 0x8(%rax), %rsi
movq %r12, %rdx
callq 0x1be7a
movq 0x80(%rsp), %rax
movq 0x10(%rax), %rdi
movq 0x8(%rsp), %rax
leaq (%rax,%r14), %rcx
addq $0xb0, %rcx
movq -0x78(%rcx), %rax
movq 0x10(%rax), %rsi
movq %r12, %rdx
callq 0x1be7a
movq 0x8(%rsp), %rdi
leaq (%rdi,%r14), %rsi
addq $0x50, %rsi
addq %r14, %rdi
movsd 0x1bc1c(%rip), %xmm0    # 0x22058
callq 0xfd37
movq 0x8(%rsp), %rax
leaq (%rax,%r14), %rsi
addq $0x50, %rsi
leaq 0xb8(%rsp), %rdi
callq 0xb538
movq 0xf0(%rsp), %rax
movq (%rax), %rcx
movq 0x38(%rcx), %rcx
movsd (%rcx), %xmm0
xorl %ecx, %ecx
cmpq $0x3, %rcx
je 0x649c
xorl %edx, %edx
cmpq %rdx, %r15
je 0x6497
movq (%rax,%rcx,8), %rsi
movq 0x38(%rsi), %rsi
movsd (%rsi,%rdx,8), %xmm1
minsd %xmm0, %xmm1
incq %rdx
movapd %xmm1, %xmm0
jmp 0x6478
incq %rcx
jmp 0x6470
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
jbe 0x64d5
xorl %ecx, %ecx
cmpq $0x3, %rcx
je 0x64d5
xorl %edx, %edx
cmpq %rdx, %r15
je 0x64d0
movq (%rax,%rcx,8), %rsi
movq 0x38(%rsi), %rsi
movsd (%rsi,%rdx,8), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, (%rsi,%rdx,8)
incq %rdx
jmp 0x64b0
incq %rcx
jmp 0x64a8
leaq 0xb8(%rsp), %rdi
movsd 0x1bb73(%rip), %xmm0    # 0x22058
pushq $0x1
popq %rsi
xorl %edx, %edx
callq 0xb8ec
movq 0x8(%rsp), %rax
leaq (%rax,%r14), %rsi
addq $0x50, %rsi
leaq 0x108(%rsp), %rdi
callq 0x1b89d
movq 0x8(%rsp), %rax
movsd %xmm0, 0xc8(%rax,%r14)
movq 0x29ab1(%rip), %rdi     # 0x2ffd0
leaq 0x1c377(%rip), %rsi     # 0x2289d
callq 0x32c0
movq 0x8(%rsp), %rcx
movsd 0xc8(%rcx,%r14), %xmm0
movq %rax, %rdi
callq 0x3460
movq 0x29a87(%rip), %rdi     # 0x2ffd0
callq 0x3120
incq %rbx
movq %r13, %rdi
jmp 0x62c9
movq 0x8(%rsp), %rcx
movq 0x10(%rsp), %rax
leaq 0xa0(%rcx), %rsi
movsd 0xa0(%rcx), %xmm0
subq %rcx, %rax
movl $0xe0, %edi
cqto
idivq %rdi
movq %rax, %rdx
movapd %xmm0, %xmm1
subq $0x1, %rdx
jb 0x65ad
movsd (%rsi), %xmm2
movapd %xmm2, %xmm3
minsd %xmm1, %xmm3
maxsd %xmm0, %xmm2
addq $0xe0, %rsi
movapd %xmm2, %xmm0
movapd %xmm3, %xmm1
jmp 0x6586
leaq 0xd6(%rcx), %rdx
movq %rax, %rsi
subq $0x1, %rsi
jb 0x65e2
movsd -0x36(%rdx), %xmm2
ucomisd %xmm1, %xmm2
jne 0x65ce
jp 0x65ce
movb $0x1, -0x6(%rdx)
ucomisd %xmm0, %xmm2
jne 0x65d9
jp 0x65d9
movb $0x1, (%rdx)
addq $0xe0, %rdx
jmp 0x65b7
leaq 0xa8(%rcx), %rdx
movsd 0xa8(%rcx), %xmm0
movq %rax, %rsi
movapd %xmm0, %xmm1
subq $0x1, %rsi
jb 0x661f
movsd (%rdx), %xmm2
movapd %xmm2, %xmm3
minsd %xmm1, %xmm3
maxsd %xmm0, %xmm2
addq $0xe0, %rdx
movapd %xmm2, %xmm0
movapd %xmm3, %xmm1
jmp 0x65f8
leaq 0xd7(%rcx), %rdx
movq %rax, %rsi
subq $0x1, %rsi
jb 0x6654
movsd -0x2f(%rdx), %xmm2
ucomisd %xmm1, %xmm2
jne 0x6640
jp 0x6640
movb $0x1, -0x6(%rdx)
ucomisd %xmm0, %xmm2
jne 0x664b
jp 0x664b
movb $0x1, (%rdx)
addq $0xe0, %rdx
jmp 0x6629
leaq 0xb0(%rcx), %rdx
movsd 0xb0(%rcx), %xmm0
movq %rax, %rsi
movapd %xmm0, %xmm1
subq $0x1, %rsi
jb 0x6691
movsd (%rdx), %xmm2
movapd %xmm2, %xmm3
minsd %xmm1, %xmm3
maxsd %xmm0, %xmm2
addq $0xe0, %rdx
movapd %xmm2, %xmm0
movapd %xmm3, %xmm1
jmp 0x666a
leaq 0xd8(%rcx), %rdx
movq %rax, %rsi
subq $0x1, %rsi
jb 0x66c6
movsd -0x28(%rdx), %xmm2
ucomisd %xmm1, %xmm2
jne 0x66b2
jp 0x66b2
movb $0x1, -0x6(%rdx)
ucomisd %xmm0, %xmm2
jne 0x66bd
jp 0x66bd
movb $0x1, (%rdx)
addq $0xe0, %rdx
jmp 0x669b
leaq 0xb8(%rcx), %rdx
movsd 0xb8(%rcx), %xmm0
movq %rax, %rsi
movapd %xmm0, %xmm1
subq $0x1, %rsi
jb 0x6703
movsd (%rdx), %xmm2
movapd %xmm2, %xmm3
minsd %xmm1, %xmm3
maxsd %xmm0, %xmm2
addq $0xe0, %rdx
movapd %xmm2, %xmm0
movapd %xmm3, %xmm1
jmp 0x66dc
leaq 0xd9(%rcx), %rdx
movq %rax, %rsi
subq $0x1, %rsi
jb 0x6738
movsd -0x21(%rdx), %xmm2
ucomisd %xmm1, %xmm2
jne 0x6724
jp 0x6724
movb $0x1, -0x6(%rdx)
ucomisd %xmm0, %xmm2
jne 0x672f
jp 0x672f
movb $0x1, (%rdx)
addq $0xe0, %rdx
jmp 0x670d
leaq 0xc0(%rcx), %rdx
movsd 0xc0(%rcx), %xmm0
movq %rax, %rsi
movapd %xmm0, %xmm1
subq $0x1, %rsi
jb 0x6775
movsd (%rdx), %xmm2
movapd %xmm2, %xmm3
minsd %xmm1, %xmm3
maxsd %xmm0, %xmm2
addq $0xe0, %rdx
movapd %xmm2, %xmm0
movapd %xmm3, %xmm1
jmp 0x674e
leaq 0xda(%rcx), %rdx
movq %rax, %rsi
subq $0x1, %rsi
jb 0x67aa
movsd -0x1a(%rdx), %xmm2
ucomisd %xmm1, %xmm2
jne 0x6796
jp 0x6796
movb $0x1, -0x6(%rdx)
ucomisd %xmm0, %xmm2
jne 0x67a1
jp 0x67a1
movb $0x1, (%rdx)
addq $0xe0, %rdx
jmp 0x677f
leaq 0xc8(%rcx), %rdx
movsd 0xc8(%rcx), %xmm0
movq %rax, %rsi
movapd %xmm0, %xmm1
subq $0x1, %rsi
jb 0x67e7
movsd (%rdx), %xmm2
movapd %xmm2, %xmm3
minsd %xmm1, %xmm3
maxsd %xmm0, %xmm2
addq $0xe0, %rdx
movapd %xmm2, %xmm0
movapd %xmm3, %xmm1
jmp 0x67c0
addq $0xdb, %rcx
subq $0x1, %rax
jb 0x6819
movsd -0x13(%rcx), %xmm2
ucomisd %xmm1, %xmm2
jne 0x6805
jp 0x6805
movb $0x1, -0x6(%rcx)
ucomisd %xmm0, %xmm2
jne 0x6810
jp 0x6810
movb $0x1, (%rcx)
addq $0xe0, %rcx
jmp 0x67ee
movq 0x297b0(%rip), %rdi     # 0x2ffd0
callq 0x3120
leaq 0x1c081(%rip), %rsi     # 0x228ad
movq %rax, %rdi
callq 0x32c0
movq %rax, %rdi
callq 0x3120
pushq $0x1
popq %r15
pushq $0x20
popq %r12
movq 0x29785(%rip), %rbx     # 0x2ffd0
leaq 0x1c84b(%rip), %r14     # 0x2309d
movq 0x29cd7(%rip), %rax     # 0x30530
subq 0x29cc8(%rip), %rax     # 0x30528
sarq $0x5, %rax
cmpq %r15, %rax
jbe 0x68a6
leal 0x40(%r15), %eax
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3320
movq %rax, %rdi
movq %r14, %rsi
callq 0x32c0
movq 0x29c9e(%rip), %rsi     # 0x30528
addq %r12, %rsi
movq %rax, %rdi
callq 0x3270
movq %rax, %rdi
callq 0x3120
incq %r15
addq $0x20, %r12
jmp 0x6852
movq 0x29723(%rip), %rdi     # 0x2ffd0
callq 0x3120
leaq 0x1c004(%rip), %rsi     # 0x228bd
movq %rax, %rdi
callq 0x32c0
movq %rax, %rdi
callq 0x3120
movq 0x29700(%rip), %rbx     # 0x2ffd0
leaq 0x1bfef(%rip), %rsi     # 0x228c6
movq %rbx, %rdi
callq 0x32c0
pushq $0x1
popq %r14
movq 0x29c46(%rip), %rax     # 0x30530
subq 0x29c37(%rip), %rax     # 0x30528
sarq $0x5, %rax
cmpq %r14, %rax
jbe 0x691e
movq (%rbx), %rax
movq -0x18(%rax), %rax
movq $0xc, 0x10(%rbx,%rax)
leal 0x40(%r14), %eax
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3320
incq %r14
jmp 0x68e3
movq 0x296ab(%rip), %rdi     # 0x2ffd0
callq 0x3120
xorl %ebp, %ebp
leaq 0x1bfc1(%rip), %rsi     # 0x228f4
movl %ebp, %eax
leaq 0x1b790(%rip), %rcx     # 0x220cc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rax, %rbx
jmp 0x72e9
jmp 0x694f
movq %rax, %rbx
jmp 0x72f6
jmp 0x6959
movq %rax, %rbx
jmp 0x7303
jmp 0x6978
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0x3548
jmp 0x7310
movq %rax, %rbx
jmp 0x7310
jmp 0x72dc
movq %rax, %rbx
leaq 0x158(%rsp), %rdi
jmp 0x72c7
jmp 0x72dc
jmp 0x72dc
jmp 0x72dc
leaq 0x1bf32(%rip), %rsi     # 0x228dd
jmp 0x69cb
jmp 0x72dc
leaq 0x1bf52(%rip), %rsi     # 0x2290b
jmp 0x69cb
leaq 0x1bf60(%rip), %rsi     # 0x22922
jmp 0x69cb
leaq 0x1bf6e(%rip), %rsi     # 0x22939
movq 0x295fe(%rip), %rbx     # 0x2ffd0
movq %rbx, %rdi
callq 0x32c0
movl $0xc8, %r14d
xorl %r15d, %r15d
movl %ebp, %r12d
leaq 0x1b713(%rip), %r13     # 0x22100
movq 0x8(%rsp), %rcx
movq 0x10(%rsp), %rax
subq %rcx, %rax
cqto
movl $0xe0, %esi
idivq %rsi
cmpq %r15, %rax
jbe 0x6b00
cmpl $0x5, %ebp
ja 0x6af1
movslq (%r13,%r12,4), %rax
addq %r13, %rax
jmpq *%rax
movq (%rbx), %rax
movq -0x18(%rax), %rax
movq $0xc, 0x10(%rbx,%rax)
imulq $0xe0, %r15, %rax
addq %rax, %rcx
addq $0xa0, %rcx
jmp 0x6ae5
movq (%rbx), %rax
movq -0x18(%rax), %rax
movq $0xc, 0x10(%rbx,%rax)
imulq $0xe0, %r15, %rax
addq %rax, %rcx
addq $0xc0, %rcx
jmp 0x6ae5
movq (%rbx), %rax
movq -0x18(%rax), %rax
movq $0xc, 0x10(%rbx,%rax)
imulq $0xe0, %r15, %rax
addq %rax, %rcx
addq $0xb0, %rcx
jmp 0x6ae5
movq (%rbx), %rax
movq -0x18(%rax), %rax
movq $0xc, 0x10(%rbx,%rax)
imulq $0xe0, %r15, %rax
addq %rax, %rcx
addq $0xb8, %rcx
jmp 0x6ae5
movq (%rbx), %rax
movq -0x18(%rax), %rax
movq $0xc, 0x10(%rbx,%rax)
imulq $0xe0, %r15, %rax
addq %rax, %rcx
addq $0xa8, %rcx
jmp 0x6ae5
movq (%rbx), %rax
movq -0x18(%rax), %rax
movq $0xc, 0x10(%rbx,%rax)
addq %r14, %rcx
movsd (%rcx), %xmm0
movq %rbx, %rdi
callq 0x3460
incq %r15
addq $0xe0, %r14
jmp 0x69ed
movq 0x294c9(%rip), %rdi     # 0x2ffd0
callq 0x3120
movq 0x294bd(%rip), %rbx     # 0x2ffd0
leaq 0x1bdac(%rip), %rsi     # 0x228c6
movq %rbx, %rdi
callq 0x32c0
movl $0xdb, %r13d
xorl %r14d, %r14d
leaq 0x1b5b6(%rip), %r15     # 0x220e8
movq 0x8(%rsp), %rcx
movq 0x10(%rsp), %rax
subq %rcx, %rax
cqto
movl $0xe0, %esi
idivq %rsi
cmpq %r14, %rax
jbe 0x6c2c
cmpl $0x5, %ebp
ja 0x6bc3
movslq (%r15,%r12,4), %rax
addq %r15, %rax
jmpq *%rax
movb -0xb(%rcx,%r13), %al
cmpb $0x0, -0x5(%rcx,%r13)
jne 0x6b7c
jmp 0x6b98
movb -0x7(%rcx,%r13), %al
cmpb $0x0, -0x1(%rcx,%r13)
je 0x6b98
movb $0x1, %cl
leaq 0x1bdd7(%rip), %rsi     # 0x2295c
testb %al, %al
je 0x6b9e
jmp 0x6bca
movb -0x9(%rcx,%r13), %al
cmpb $0x0, -0x3(%rcx,%r13)
jne 0x6b7c
testb %al, %al
je 0x6bb8
xorl %ecx, %ecx
testb %al, %al
leaq 0x1bdb5(%rip), %rsi     # 0x2295c
leaq 0x1bda2(%rip), %rdx     # 0x22950
cmovneq %rdx, %rsi
testb %cl, %cl
je 0x6bbf
jmp 0x6bca
leaq 0x1bd91(%rip), %rsi     # 0x22950
testb %al, %al
jne 0x6bca
leaq 0x1bc7a(%rip), %rsi     # 0x22844
movq (%rbx), %rax
movq -0x18(%rax), %rax
movq $0xc, 0x10(%rbx,%rax)
movq %rbx, %rdi
callq 0x32c0
incq %r14
addq $0xe0, %r13
jmp 0x6b32
movb -0x8(%rcx,%r13), %al
cmpb $0x0, -0x2(%rcx,%r13)
jne 0x6b7c
jmp 0x6b98
movb -0xa(%rcx,%r13), %al
cmpb $0x0, -0x4(%rcx,%r13)
jne 0x6b7c
jmp 0x6b98
movb (%rcx,%r13), %al
cmpb $0x1, -0x6(%rcx,%r13)
je 0x6b7c
jmp 0x6b98
movq 0x2939d(%rip), %rdi     # 0x2ffd0
callq 0x3120
incl %ebp
movl %ebp, %eax
leaq 0x1b489(%rip), %rcx     # 0x220cc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
leaq 0x1bca3(%rip), %rsi     # 0x228f4
jmpq *%rax
movq 0x29376(%rip), %rbx     # 0x2ffd0
movq %rbx, %rdi
callq 0x3120
leaq 0x1bd00(%rip), %rsi     # 0x22969
movq %rax, %rdi
callq 0x32c0
movq %rax, %rdi
callq 0x3120
movq (%rbx), %rax
movq -0x18(%rax), %rax
movq $0xf, 0x10(%rbx,%rax)
leaq 0x1bce6(%rip), %rsi     # 0x22976
movq %rbx, %rdi
callq 0x32c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0xf, 0x10(%rax,%rcx)
leaq 0x1bcd0(%rip), %rsi     # 0x2297f
movq %rax, %rdi
callq 0x32c0
movq %rax, %rdi
callq 0x3120
xorl %r13d, %r13d
movl $0xe0, %ebp
leaq 0x28(%rsp), %r15
xorl %r14d, %r14d
movq 0x8(%rsp), %rcx
movq 0x10(%rsp), %rax
subq %rcx, %rax
cqto
idivq %rbp
cmpq %r14, %rax
jbe 0x6d84
movq (%rbx), %rax
movq -0x18(%rax), %rax
movq $0xf, 0x10(%rbx,%rax)
movsd 0xb8(%rcx,%r13), %xmm0
movq %rbx, %rdi
callq 0x3460
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0xf, 0x10(%rax,%rcx)
movq 0x8(%rsp), %rcx
movsd 0xc8(%rcx,%r13), %xmm0
movq %rax, %rdi
callq 0x3460
movq %rax, %rdi
leaq 0x1bb9b(%rip), %rsi     # 0x228d8
callq 0x32c0
movq %rax, %r12
movq 0x8(%rsp), %rax
leaq (%rax,%r13), %rsi
addq $0x8, %rsi
movq %r15, %rdi
callq 0x33b0
movq %r12, %rdi
movq %r15, %rsi
callq 0x3270
movq %rax, %rdi
callq 0x3120
movq %r15, %rdi
callq 0x3548
incq %r14
addq $0xe0, %r13
jmp 0x6ccf
movq 0x29245(%rip), %rdi     # 0x2ffd0
callq 0x3120
leaq 0x1bbf4(%rip), %rsi     # 0x2298b
movq %rax, %rdi
callq 0x32c0
movq %rax, %rdi
callq 0x3120
movq 0x29222(%rip), %rdi     # 0x2ffd0
leaq 0x1bbc1(%rip), %rsi     # 0x22976
callq 0x32c0
pushq $0x9
popq %rsi
movq %rax, %rdi
callq 0x3320
leaq 0x1bbb3(%rip), %rsi     # 0x2297f
movq %rax, %rdi
callq 0x32c0
movq %rax, %rdi
callq 0x3120
xorl %r14d, %r14d
movl $0xe0, %r15d
movq 0x291e4(%rip), %rbx     # 0x2ffd0
pushq $0x9
popq %rbp
xorl %r12d, %r12d
movq 0x8(%rsp), %rcx
movq 0x10(%rsp), %rax
subq %rcx, %rax
cqto
idivq %r15
cmpq %r12, %rax
jbe 0x6e50
movsd 0xb8(%rcx,%r14), %xmm0
movq %rbx, %rdi
callq 0x3460
movq %rax, %rdi
movl %ebp, %esi
callq 0x3320
movq 0x8(%rsp), %rcx
movsd 0xc8(%rcx,%r14), %xmm0
movq %rax, %rdi
callq 0x3460
movq %rax, %rdi
callq 0x3120
incq %r12
addq $0xe0, %r14
jmp 0x6df2
movq 0x29179(%rip), %rbx     # 0x2ffd0
movq %rbx, %rdi
callq 0x3120
leaq 0x1bb67(%rip), %rsi     # 0x229cd
movq %rax, %rdi
callq 0x32c0
movq %rax, %rdi
callq 0x3120
movq (%rbx), %rax
movq -0x18(%rax), %rax
movq $0xf, 0x10(%rbx,%rax)
leaq 0x1bae9(%rip), %rsi     # 0x22976
movq %rbx, %rdi
callq 0x32c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0xf, 0x10(%rax,%rcx)
leaq 0x1bad3(%rip), %rsi     # 0x2297f
movq %rax, %rdi
callq 0x32c0
movq %rax, %rdi
callq 0x3120
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x920c
xorl %r13d, %r13d
movl $0xe0, %ebp
leaq 0x28(%rsp), %r15
xorl %r14d, %r14d
movq 0x8(%rsp), %rcx
movq 0x10(%rsp), %rax
subq %rcx, %rax
cqto
idivq %rbp
cmpq %r14, %rax
jbe 0x6f90
movq (%rbx), %rax
movq -0x18(%rax), %rax
movq $0xf, 0x10(%rbx,%rax)
movsd 0xb8(%rcx,%r13), %xmm0
movq %rbx, %rdi
callq 0x3460
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0xf, 0x10(%rax,%rcx)
movq 0x8(%rsp), %rcx
movsd 0xc8(%rcx,%r13), %xmm0
movq %rax, %rdi
callq 0x3460
movq %rax, %rdi
leaq 0x1b98f(%rip), %rsi     # 0x228d8
callq 0x32c0
movq %rax, %r12
movq 0x8(%rsp), %rax
leaq (%rax,%r13), %rsi
addq $0x8, %rsi
movq %r15, %rdi
callq 0x33b0
movq %r12, %rdi
movq %r15, %rsi
callq 0x3270
movq %rax, %rdi
callq 0x3120
movq %r15, %rdi
callq 0x3548
incq %r14
addq $0xe0, %r13
jmp 0x6edb
movq 0x29039(%rip), %rdi     # 0x2ffd0
callq 0x3120
leaq 0x1ba3b(%rip), %rsi     # 0x229de
movq %rax, %rdi
callq 0x32c0
movq %rax, %rdi
callq 0x3120
movq 0x29016(%rip), %rdi     # 0x2ffd0
leaq 0x1b9b5(%rip), %rsi     # 0x22976
callq 0x32c0
pushq $0x9
popq %rsi
movq %rax, %rdi
callq 0x3320
leaq 0x1b9a7(%rip), %rsi     # 0x2297f
movq %rax, %rdi
callq 0x32c0
movq %rax, %rdi
callq 0x3120
xorl %r14d, %r14d
movl $0xe0, %r15d
movq 0x28fd8(%rip), %rbx     # 0x2ffd0
pushq $0x9
popq %rbp
xorl %r12d, %r12d
movq 0x8(%rsp), %rcx
movq 0x10(%rsp), %rax
subq %rcx, %rax
cqto
idivq %r15
cmpq %r12, %rax
jbe 0x705c
movsd 0xb8(%rcx,%r14), %xmm0
movq %rbx, %rdi
callq 0x3460
movq %rax, %rdi
movl %ebp, %esi
callq 0x3320
movq 0x8(%rsp), %rcx
movsd 0xc8(%rcx,%r14), %xmm0
movq %rax, %rdi
callq 0x3460
movq %rax, %rdi
callq 0x3120
incq %r12
addq $0xe0, %r14
jmp 0x6ffe
movq 0x28f6d(%rip), %rbx     # 0x2ffd0
movq %rbx, %rdi
callq 0x3120
leaq 0x1b9b2(%rip), %rsi     # 0x22a24
movq %rax, %rdi
callq 0x32c0
movq %rax, %rdi
callq 0x3120
movq (%rbx), %rax
movq -0x18(%rax), %rax
movq $0xf, 0x10(%rbx,%rax)
leaq 0x1b8dd(%rip), %rsi     # 0x22976
movq %rbx, %rdi
callq 0x32c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0xf, 0x10(%rax,%rcx)
leaq 0x1b8c7(%rip), %rsi     # 0x2297f
movq %rax, %rdi
callq 0x32c0
movq %rax, %rdi
callq 0x3120
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x9abf
xorl %r13d, %r13d
movl $0xe0, %ebp
leaq 0x28(%rsp), %r15
xorl %r14d, %r14d
movq 0x8(%rsp), %rcx
movq 0x10(%rsp), %rax
subq %rcx, %rax
cqto
idivq %rbp
cmpq %r14, %rax
jbe 0x719c
movq (%rbx), %rax
movq -0x18(%rax), %rax
movq $0xf, 0x10(%rbx,%rax)
movsd 0xb8(%rcx,%r13), %xmm0
movq %rbx, %rdi
callq 0x3460
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0xf, 0x10(%rax,%rcx)
movq 0x8(%rsp), %rcx
movsd 0xc8(%rcx,%r13), %xmm0
movq %rax, %rdi
callq 0x3460
movq %rax, %rdi
leaq 0x1b783(%rip), %rsi     # 0x228d8
callq 0x32c0
movq %rax, %r12
movq 0x8(%rsp), %rax
leaq (%rax,%r13), %rsi
addq $0x8, %rsi
movq %r15, %rdi
callq 0x33b0
movq %r12, %rdi
movq %r15, %rsi
callq 0x3270
movq %rax, %rdi
callq 0x3120
movq %r15, %rdi
callq 0x3548
incq %r14
addq $0xe0, %r13
jmp 0x70e7
movq 0x28e2d(%rip), %rdi     # 0x2ffd0
callq 0x3120
leaq 0x1b889(%rip), %rsi     # 0x22a38
movq %rax, %rdi
callq 0x32c0
movq %rax, %rdi
callq 0x3120
movq 0x28e0a(%rip), %rdi     # 0x2ffd0
leaq 0x1b7a9(%rip), %rsi     # 0x22976
callq 0x32c0
pushq $0x9
popq %rsi
movq %rax, %rdi
callq 0x3320
leaq 0x1b79b(%rip), %rsi     # 0x2297f
movq %rax, %rdi
callq 0x32c0
movq %rax, %rdi
callq 0x3120
xorl %r14d, %r14d
movl $0xe0, %r15d
movq 0x28dcc(%rip), %rbx     # 0x2ffd0
pushq $0x9
popq %rbp
xorl %r12d, %r12d
movq 0x8(%rsp), %rcx
movq 0x10(%rsp), %rax
subq %rcx, %rax
cqto
idivq %r15
cmpq %r12, %rax
jbe 0x7268
movsd 0xb8(%rcx,%r14), %xmm0
movq %rbx, %rdi
callq 0x3460
movq %rax, %rdi
movl %ebp, %esi
callq 0x3320
movq 0x8(%rsp), %rcx
movsd 0xc8(%rcx,%r14), %xmm0
movq %rax, %rdi
callq 0x3460
movq %rax, %rdi
callq 0x3120
incq %r12
addq $0xe0, %r14
jmp 0x720a
leaq 0x8(%rsp), %rdi
callq 0x8664
leaq 0xb8(%rsp), %rdi
callq 0xb686
leaq 0x178(%rsp), %rdi
callq 0xb686
leaq 0x108(%rsp), %rdi
callq 0xb686
leaq 0x48(%rsp), %rdi
callq 0xb686
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x72dc
jmp 0x72dc
jmp 0x72dc
jmp 0x72bf
jmp 0x72bf
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x3548
jmp 0x72df
jmp 0x72dc
jmp 0x72dc
jmp 0x72dc
jmp 0x72dc
jmp 0x72dc
jmp 0x72dc
jmp 0x72dc
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x8664
leaq 0xb8(%rsp), %rdi
callq 0xb686
leaq 0x178(%rsp), %rdi
callq 0xb686
leaq 0x108(%rsp), %rdi
callq 0xb686
leaq 0x48(%rsp), %rdi
callq 0xb686
movq %rbx, %rdi
callq 0x34d0