// File: /workspace/github_cpp_makefile_star2_O2/kebwi[P]Trifid/src/ImageProcs.cpp
// Function: testRGBXYZLABRoutines()
void testRGBXYZLABRoutines()
{
	Float_t minorCutoff = .000001;
	Float_t majorCutoff = .001;
	
	cout.precision(8);
	
	cout << "RGB coordinates specified as input, then run through RGB->XYZ->LAB->XYZ->RGB." << endl
		<< "Final XYZ and RGB difs are presented and compared to originals with minor and major cutoffs: " << endl
		<< minorCutoff << " and " << majorCutoff << "." << endl << endl;
	
	cout << "Display legend:" << endl;
	cout	<< setw(12) << "R in"
			<< setw(12) << "G in"
			<< setw(12) << "B in" << "    "
			<< setw(12) << "X out"
			<< setw(12) << "Y out"
			<< setw(12) << "Z out" << "    " << endl
			<< setw(12) << "R2 out"
			<< setw(12) << "G2 out"
			<< setw(12) << "B2 out" << "    "
			<< setw(12) << "X2 out"
			<< setw(12) << "Y2 out"
			<< setw(12) << "Z2 out" << endl
			<< setw(12) << "|X2 - X|"
			<< setw(12) << "|Y2 - Y|"
			<< setw(12) << "|Z2 - Z|" << "    "
			<< setw(12) << "|R2 - R|"
			<< setw(12) << "|G2 - G|"
			<< setw(12) << "|B2 - B|" << endl << endl;
			
	for (Float_t r = 0; r <= 1.0; r += .25)
		for (Float_t g = 0; g <= 1.0; g += .25)
			for (Float_t b = 0; b <= 1.0; b += .25)
			{
				Float_t x, y, z;
				Float_t l, a, bb;
				Float_t x2, y2, z2;
				Float_t r2, g2, b2;
				
				rgb2xyz(r, g, b, x, y, z);
				xyz2cielab(x, y, z, l, a, bb);
				cielab2xyz(l, a, bb, x2, y2, z2);
				xyz2rgb(x2, y2, z2, r2, g2, b2);
				
				cout	<< setw(12) << r
						<< setw(12) << g
						<< setw(12) << b << "    "
						<< setw(12) << x
						<< setw(12) << y
						<< setw(12) << z << endl
						<< setw(12) << r2
						<< setw(12) << g2
						<< setw(12) << b2 << "    "
						<< setw(12) << x2
						<< setw(12) << y2
						<< setw(12) << z2 << endl
						<< setw(12) << fabs(x2 - x)
						<< setw(12) << fabs(y2 - y)
						<< setw(12) << fabs(z2 - z) << "    "
						<< setw(12) << fabs(r2 - r)
						<< setw(12) << fabs(g2 - g)
						<< setw(12) << fabs(b2 - b) << endl;
				
				if (fabs(r2 - r) > minorCutoff || fabs(g2 - g) > minorCutoff || fabs(b2 - b) > minorCutoff ||
					fabs(x2 - x) > minorCutoff || fabs(y2 - y) > minorCutoff || fabs(z2 - z) > minorCutoff)
					cout << "    -------- minor error in previous test --------" << endl;
				
				if (fabs(r2 - r) > majorCutoff || fabs(g2 - g) > majorCutoff || fabs(b2 - b) > majorCutoff ||
					fabs(x2 - x) > majorCutoff || fabs(y2 - y) > majorCutoff || fabs(z2 - z) > majorCutoff)
					cout << "    ******** MAJOR ERROR IN PREVIOUS TEST ********" << endl;
				
				cout << endl;
			}
	
	exit(0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movq 0x20c9c(%rip), %rbx     # 0x2ffd0
movq (%rbx), %rax
movq -0x18(%rax), %rax
movq $0x8, 0x8(%rbx,%rax)
leaq 0x149df(%rip), %rsi     # 0x23d2a
movq %rbx, %rdi
callq 0x32c0
movq %rax, %rdi
callq 0x3120
leaq 0x14a16(%rip), %rsi     # 0x23d78
movq %rax, %rdi
callq 0x32c0
movq %rax, %rdi
callq 0x3120
movsd 0x1485e(%rip), %xmm0    # 0x23bd8
movq %rax, %rdi
callq 0x3460
leaq 0x14a4d(%rip), %rsi     # 0x23dd6
movq %rax, %rdi
callq 0x32c0
movsd 0x14847(%rip), %xmm0    # 0x23be0
movq %rax, %rdi
callq 0x3460
leaq 0x13e4d(%rip), %rsi     # 0x231f5
movq %rax, %rdi
callq 0x32c0
movq %rax, %rdi
callq 0x3120
movq %rax, %rdi
callq 0x3120
leaq 0x14a15(%rip), %rsi     # 0x23ddc
movq %rbx, %rdi
callq 0x32c0
movq %rax, %rdi
callq 0x3120
movq (%rbx), %rax
movq -0x18(%rax), %rax
pushq $0xc
popq %r15
movq %r15, 0x10(%rbx,%rax)
leaq 0x149fe(%rip), %rsi     # 0x23dec
movq %rbx, %rdi
callq 0x32c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq %r15, 0x10(%rax,%rcx)
leaq 0x149e8(%rip), %rsi     # 0x23df1
movq %rax, %rdi
callq 0x32c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq %r15, 0x10(%rax,%rcx)
leaq 0x149d2(%rip), %rsi     # 0x23df6
movq %rax, %rdi
callq 0x32c0
leaq 0x134a5(%rip), %r14     # 0x228d8
movq %rax, %rdi
movq %r14, %rsi
callq 0x32c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq %r15, 0x10(%rax,%rcx)
leaq 0x149aa(%rip), %rsi     # 0x23dfb
movq %rax, %rdi
callq 0x32c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq %r15, 0x10(%rax,%rcx)
leaq 0x14995(%rip), %rsi     # 0x23e01
movq %rax, %rdi
callq 0x32c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq %r15, 0x10(%rax,%rcx)
leaq 0x14980(%rip), %rsi     # 0x23e07
movq %rax, %rdi
callq 0x32c0
movq %rax, %rdi
movq %r14, %rsi
callq 0x32c0
movq %rax, %rdi
callq 0x3120
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq %r15, 0x10(%rax,%rcx)
leaq 0x14958(%rip), %rsi     # 0x23e0d
movq %rax, %rdi
callq 0x32c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq %r15, 0x10(%rax,%rcx)
leaq 0x14944(%rip), %rsi     # 0x23e14
movq %rax, %rdi
callq 0x32c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq %r15, 0x10(%rax,%rcx)
leaq 0x14930(%rip), %rsi     # 0x23e1b
movq %rax, %rdi
callq 0x32c0
movq %rax, %rdi
movq %r14, %rsi
callq 0x32c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq %r15, 0x10(%rax,%rcx)
leaq 0x14911(%rip), %rsi     # 0x23e22
movq %rax, %rdi
callq 0x32c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq %r15, 0x10(%rax,%rcx)
leaq 0x148fd(%rip), %rsi     # 0x23e29
movq %rax, %rdi
callq 0x32c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq %r15, 0x10(%rax,%rcx)
leaq 0x148e9(%rip), %rsi     # 0x23e30
movq %rax, %rdi
callq 0x32c0
movq %rax, %rdi
callq 0x3120
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq %r15, 0x10(%rax,%rcx)
leaq 0x148cd(%rip), %rsi     # 0x23e37
movq %rax, %rdi
callq 0x32c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq %r15, 0x10(%rax,%rcx)
leaq 0x148bb(%rip), %rsi     # 0x23e40
movq %rax, %rdi
callq 0x32c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq %r15, 0x10(%rax,%rcx)
leaq 0x148a9(%rip), %rsi     # 0x23e49
movq %rax, %rdi
callq 0x32c0
movq %rax, %rdi
movq %r14, %rsi
callq 0x32c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq %r15, 0x10(%rax,%rcx)
leaq 0x1488c(%rip), %rsi     # 0x23e52
movq %rax, %rdi
callq 0x32c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq %r15, 0x10(%rax,%rcx)
leaq 0x1487a(%rip), %rsi     # 0x23e5b
movq %rax, %rdi
callq 0x32c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq %r15, 0x10(%rax,%rcx)
leaq 0x14868(%rip), %rsi     # 0x23e64
movq %rax, %rdi
callq 0x32c0
movq %rax, %rdi
callq 0x3120
movq %rax, %rdi
callq 0x3120
xorpd %xmm0, %xmm0
leaq 0x70(%rsp), %r12
leaq 0x68(%rsp), %r13
leaq 0x60(%rsp), %rbp
movsd 0x12a29(%rip), %xmm1    # 0x22058
ucomisd %xmm0, %xmm1
jb 0xfb06
xorpd %xmm3, %xmm3
movapd %xmm0, 0xc0(%rsp)
movsd 0x12a0a(%rip), %xmm1    # 0x22058
ucomisd %xmm3, %xmm1
jb 0xfaf9
movapd %xmm0, %xmm1
unpcklpd %xmm3, %xmm1            # xmm1 = xmm1[0],xmm3[0]
movapd %xmm1, 0x100(%rsp)
xorpd %xmm2, %xmm2
movapd %xmm3, 0xd0(%rsp)
movsd 0x129da(%rip), %xmm1    # 0x22058
ucomisd %xmm2, %xmm1
jb 0xfaec
movapd %xmm3, %xmm1
leaq 0xb8(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
leaq 0xa8(%rsp), %rdx
movapd %xmm2, 0x50(%rsp)
callq 0xee64
movsd 0xb8(%rsp), %xmm0
movaps %xmm0, 0xf0(%rsp)
movsd 0xb0(%rsp), %xmm1
movsd %xmm1, 0x40(%rsp)
movsd 0xa8(%rsp), %xmm2
movsd %xmm2, 0x48(%rsp)
leaq 0xa0(%rsp), %rdi
leaq 0x98(%rsp), %rsi
leaq 0x90(%rsp), %rdx
callq 0xf06b
movsd 0xa0(%rsp), %xmm0
movsd 0x98(%rsp), %xmm1
movsd 0x90(%rsp), %xmm2
leaq 0x88(%rsp), %rdi
leaq 0x80(%rsp), %rsi
leaq 0x78(%rsp), %rdx
callq 0xf1d1
movsd 0x88(%rsp), %xmm0
movaps %xmm0, 0xe0(%rsp)
movsd 0x80(%rsp), %xmm1
movaps %xmm1, 0x10(%rsp)
movsd 0x78(%rsp), %xmm2
movaps %xmm2, (%rsp)
movq %r12, %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0xef86
movq (%rbx), %rax
movq -0x18(%rax), %rax
movq %r15, 0x10(%rbx,%rax)
movq %rbx, %rdi
movaps 0xc0(%rsp), %xmm0
callq 0x3460
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq %r15, 0x10(%rax,%rcx)
movq %rax, %rdi
movaps 0xd0(%rsp), %xmm0
callq 0x3460
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq %r15, 0x10(%rax,%rcx)
movq %rax, %rdi
movaps 0x50(%rsp), %xmm0
callq 0x3460
movq %rax, %rdi
movq %r14, %rsi
callq 0x32c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq %r15, 0x10(%rax,%rcx)
movq %rax, %rdi
movaps 0xf0(%rsp), %xmm0
callq 0x3460
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq %r15, 0x10(%rax,%rcx)
movq %rax, %rdi
movsd 0x40(%rsp), %xmm0
callq 0x3460
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq %r15, 0x10(%rax,%rcx)
movq %rax, %rdi
movsd 0x48(%rsp), %xmm0
callq 0x3460
movq %rax, %rdi
callq 0x3120
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq %r15, 0x10(%rax,%rcx)
movsd 0x70(%rsp), %xmm0
movaps %xmm0, 0x20(%rsp)
movq %rax, %rdi
callq 0x3460
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq %r15, 0x10(%rax,%rcx)
movsd 0x68(%rsp), %xmm0
movaps %xmm0, 0x110(%rsp)
movq %rax, %rdi
callq 0x3460
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq %r15, 0x10(%rax,%rcx)
movsd 0x60(%rsp), %xmm0
movaps %xmm0, 0x30(%rsp)
movq %rax, %rdi
callq 0x3460
movq %rax, %rdi
movq %r14, %rsi
callq 0x32c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq %r15, 0x10(%rax,%rcx)
movq %rax, %rdi
movaps 0xe0(%rsp), %xmm0
callq 0x3460
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq %r15, 0x10(%rax,%rcx)
movq %rax, %rdi
movaps 0x10(%rsp), %xmm0
callq 0x3460
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq %r15, 0x10(%rax,%rcx)
movq %rax, %rdi
movaps (%rsp), %xmm0
callq 0x3460
movq %rax, %rdi
callq 0x3120
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq %r15, 0x10(%rax,%rcx)
movapd 0x10(%rsp), %xmm2
subsd 0x40(%rsp), %xmm2
movapd 0x12715(%rip), %xmm1    # 0x22010
andpd %xmm1, %xmm2
movapd %xmm2, 0x10(%rsp)
movapd (%rsp), %xmm0
subsd 0x48(%rsp), %xmm0
andpd %xmm1, %xmm0
movapd %xmm0, (%rsp)
movapd 0x20(%rsp), %xmm0
unpcklpd 0x110(%rsp), %xmm0      # xmm0 = xmm0[0],mem[0]
subpd 0x100(%rsp), %xmm0
movapd %xmm0, %xmm3
movapd 0x30(%rsp), %xmm2
unpcklpd 0xe0(%rsp), %xmm2       # xmm2 = xmm2[0],mem[0]
movapd 0x50(%rsp), %xmm0
unpcklpd 0xf0(%rsp), %xmm0       # xmm0 = xmm0[0],mem[0]
subpd %xmm0, %xmm2
andpd %xmm1, %xmm2
movapd %xmm2, 0x30(%rsp)
andpd %xmm1, %xmm3
movapd %xmm3, 0x20(%rsp)
pshufd $0xee, %xmm2, %xmm0     # xmm0 = xmm2[2,3,2,3]
movq %rax, %rdi
callq 0x3460
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq %r15, 0x10(%rax,%rcx)
movq %rax, %rdi
movaps 0x10(%rsp), %xmm0
callq 0x3460
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq %r15, 0x10(%rax,%rcx)
movq %rax, %rdi
movaps (%rsp), %xmm0
callq 0x3460
movq %rax, %rdi
movq %r14, %rsi
callq 0x32c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq %r15, 0x10(%rax,%rcx)
movq %rax, %rdi
movaps 0x20(%rsp), %xmm0
callq 0x3460
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq %r15, 0x10(%rax,%rcx)
pshufd $0xee, 0x20(%rsp), %xmm0 # xmm0 = mem[2,3,2,3]
movq %rax, %rdi
callq 0x3460
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq %r15, 0x10(%rax,%rcx)
movq %rax, %rdi
movaps 0x30(%rsp), %xmm0
callq 0x3460
movq %rax, %rdi
callq 0x3120
movapd 0x1427f(%rip), %xmm1    # 0x23c90
movapd %xmm1, %xmm0
cmpltpd 0x30(%rsp), %xmm0
cmpltpd 0x20(%rsp), %xmm1
shufps $0x88, %xmm0, %xmm1     # xmm1 = xmm1[0,2],xmm0[0,2]
movmskps %xmm1, %eax
testl %eax, %eax
jne 0xfa4d
movapd 0x10(%rsp), %xmm0
ucomisd 0x1419c(%rip), %xmm0    # 0x23bd8
ja 0xfa4d
movapd (%rsp), %xmm0
ucomisd 0x1418d(%rip), %xmm0    # 0x23bd8
jbe 0xfa64
movq %rbx, %rdi
leaq 0x14416(%rip), %rsi     # 0x23e6d
callq 0x32c0
movq %rax, %rdi
callq 0x3120
movapd 0x14234(%rip), %xmm1    # 0x23ca0
movapd %xmm1, %xmm0
cmpltpd 0x20(%rsp), %xmm0
cmpltpd 0x30(%rsp), %xmm1
shufps $0x88, %xmm1, %xmm0     # xmm0 = xmm0[0,2],xmm1[0,2]
movmskps %xmm0, %eax
testl %eax, %eax
jne 0xfaa8
movapd 0x10(%rsp), %xmm0
ucomisd 0x14149(%rip), %xmm0    # 0x23be0
ja 0xfaa8
movapd (%rsp), %xmm0
ucomisd 0x1413a(%rip), %xmm0    # 0x23be0
jbe 0xfabf
movq %rbx, %rdi
leaq 0x143ee(%rip), %rsi     # 0x23ea0
callq 0x32c0
movq %rax, %rdi
callq 0x3120
movq %rbx, %rdi
callq 0x3120
movapd 0x50(%rsp), %xmm2
addsd 0x14113(%rip), %xmm2    # 0x23be8
movapd 0xc0(%rsp), %xmm0
movapd 0xd0(%rsp), %xmm3
jmp 0xf676
addsd 0x140f4(%rip), %xmm3    # 0x23be8
jmp 0xf646
addsd 0x140e7(%rip), %xmm0    # 0x23be8
jmp 0xf627
xorl %edi, %edi
callq 0x3350