// File: kebwi[P]Trifid/src/main.cpp
// Function: main
int main(int argc, char* argv[])
{
	//Sorta kinda verify the enum labels
	assert(skProgramBehaviorLabels[PB_NUM_PROGRAM_BEHAVIORS] == "PB_NUM_PROGRAM_BEHAVIORS");
	assert(skIdealShrinkageMethodLabels[NUM_IDEAL_SHRINKAGE_METHODS] == "NUM_IDEAL_SHRINKAGE_METHODS");
	
	//setiosflags(ios::showpoint | ios::fixed);
	cout.setf(ios::fixed);
	cout.precision(6);	//std out default I believe, therefore a pointless, but illustrative, command
	
	//Uncomment this line to get a random seed.
	//Pass a seed into SeedRandom to set the seed explicitly.
	//SeedRandom();
	
	if (!processArgsFromFile(argc, argv))
		processArgs(argc, argv);
	
	//Clearly mark a new run in the run log or console window
	writeSeparator('#', 100, 4);
	
	switch (sProgramBehavior)
	{
		case PB_TEST_FOURIER:
			fourierTest();  //FourierTransform.cpp
			break;
		case PB_TEST_FOURIER_CONVOLUTION:
			testFourierConvolution(0);
			break;
		case PB_TEST_RGB_XYZ_LAB:
			testRGBXYZLABRoutines();	//ImageProcs.cpp
			break;
		//========================================
		case PB_NOISIFY:
			programBehaviorNoisify();
			break;
		case PB_DENOISE:
			programBehaviorDenoise();
			break;
		case PB_GRAY_IMG_PAIR_STATS:
			programBehavior1ChnlImagePairStats();
			break;
		case PB_RGB_IMG_PAIR_STATS:
			programBehaviorRGBImagePairStats();
			break;
		//========================================
		case PB_NONE:
		default:
			die("Please specify a program behavior flag.");
	}
	
	cout << endl << "Program is complete" << endl;
	
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq 0x4c493(%rip), %rdi     # 0x5a410
addq $0x100, %rdi            # imm = 0x100
leaq 0x3b2c8(%rip), %rsi     # 0x49253
callq 0xe570
testb $0x1, %al
jne 0xdf96
jmp 0xdf98
jmp 0xdfb7
leaq 0x3bc5b(%rip), %rdi     # 0x49bfa
leaq 0x3b343(%rip), %rsi     # 0x492e9
movl $0x546, %edx            # imm = 0x546
leaq 0x3bc98(%rip), %rcx     # 0x49c4a
callq 0x4240
leaq 0x4c572(%rip), %rdi     # 0x5a530
addq $0x60, %rdi
leaq 0x3b2be(%rip), %rsi     # 0x49287
callq 0xe570
testb $0x1, %al
jne 0xdfd4
jmp 0xdfd6
jmp 0xdff5
leaq 0x3bc84(%rip), %rdi     # 0x49c61
leaq 0x3b305(%rip), %rsi     # 0x492e9
movl $0x547, %edx            # imm = 0x547
leaq 0x3bc5a(%rip), %rcx     # 0x49c4a
callq 0x4240
movq 0x4bfd4(%rip), %rax     # 0x59fd0
movq (%rax), %rax
movq 0x4bfca(%rip), %rdi     # 0x59fd0
addq -0x18(%rax), %rdi
movl $0x4, %esi
callq 0xf2e0
movq 0x4bfb5(%rip), %rax     # 0x59fd0
movq (%rax), %rax
movq 0x4bfab(%rip), %rdi     # 0x59fd0
addq -0x18(%rax), %rdi
movl $0x6, %esi
callq 0xf310
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x7d40
testb $0x1, %al
jne 0xe04f
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x6460
movl $0x23, %edi
movl $0x64, %esi
movl $0x4, %edx
callq 0x82a0
movl 0x4c6d7(%rip), %eax     # 0x5a740
movq %rax, -0x18(%rbp)
subq $0x7, %rax
ja 0xe0bc
movq -0x18(%rbp), %rax
leaq 0x3b12a(%rip), %rcx     # 0x491a8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
callq 0x28900
jmp 0xe0c8
xorl %edi, %edi
callq 0xd8c0
jmp 0xe0c8
callq 0x1e690
jmp 0xe0c8
callq 0x8b00
jmp 0xe0c8
callq 0x9280
jmp 0xe0c8
callq 0x9590
jmp 0xe0c8
callq 0x9a50
jmp 0xe0c8
jmp 0xe0bc
leaq 0x3bbf9(%rip), %rdi     # 0x49cbc
callq 0x5360
movq 0x4bf01(%rip), %rdi     # 0x59fd0
movq 0x4bee2(%rip), %rsi     # 0x59fb8
callq 0x43d0
movq %rax, %rdi
leaq 0x3bbff(%rip), %rsi     # 0x49ce4
callq 0x4390
movq %rax, %rdi
movq 0x4bec4(%rip), %rsi     # 0x59fb8
callq 0x43d0
xorl %eax, %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)