// File: /workspace/github_cpp_makefile_star2_O3/kebwi[P]Trifid/src/main.cpp
// Function: processArgs(int, char**)
void processArgs(int argc, char **argv)
{
	if (argc < 2)
		die("Enter -h flag to display help.");
	
	for (int argIdx = 1; argIdx < argc; argIdx++)
	{
		string prevArg(argv[argIdx - 1]);
		string argStr(argv[argIdx]);
		
		if (argStr[0] == '-')// && isalpha(argStr[1]))	//Flag
		{
			if (argStr.length() < 2)
				die("Flag is too short");
			if (argStr[1] != '-')	//A short flag
			{
				for (int charIdx = 1; charIdx < argStr.length(); charIdx++)
				{
					switch (argStr[charIdx])
					{
						case 'h':
							cout << "-" << argStr[charIdx] << " flag detected" << endl;
							displayHelp();
							exit(0);	//displayHelp() should exit the program
							break;
						case 'v':
							gVerbose = true;
							cout << "-" << argStr[charIdx] << " flag detected" << endl;
							break;
						case 'i':
							gGenerateIntermediateImages = true;
							cout << "-" << argStr[charIdx] << " flag detected" << endl;
							break;
						case 'N':	//Add noise to a pgm image
							cout << "-" << argStr[charIdx] << " flag detected" << endl;
							if (sProgramBehavior != PB_NONE)
								die("Please specify only one program behavior flag");
							sProgramBehavior = PB_NOISIFY;
							break;
						case 'n':	//Denoise a set of images
							cout << "-" << argStr[charIdx] << " flag detected" << endl;
							if (sProgramBehavior != PB_NONE && sProgramBehavior != PB_DENOISE)
								die("Please specify only one program behavior flag");
							sProgramBehavior = PB_DENOISE;
							break;
						case 'b':
							cout << "-" << argStr[charIdx] << " flag detected" << endl;
							if (sProgramBehavior != PB_NOISIFY)
								die("-b only works with -N");
							sBayerize = true;
							break;
						case 's':
							cout << "-" << argStr[charIdx] << " flag detected" << endl;
							if (sProgramBehavior != PB_DENOISE)
								die("-s only works with -n");
							break;
						default:
							die(string("Unknown flag: " + argStr).c_str());
					}	//switch argStr[charIdx]
				}	//Loop over flag chars
			}
			else	//argStr[1] == '-'
			{
				assert(argStr.length() >= 2);
				assert(argStr[0] == '-' && argStr[1] == '-');
				if (argStr.length() < 3)
					die("Flag is too short");
				
				if (argStr == "--testFT")
				{
					cout << argStr << " flag detected" << endl;
					if (sProgramBehavior != PB_NONE)
						die("Please specify only one program behavior flag");
					sProgramBehavior = PB_TEST_FOURIER;
				}
				else if (argStr == "--testFTconv")
				{
					cout << argStr << " flag detected" << endl;
					if (sProgramBehavior != PB_NONE)
						die("Please specify only one program behavior flag");
					sProgramBehavior = PB_TEST_FOURIER_CONVOLUTION;
				}
				else if (argStr == "--testColor")
				{
					cout << argStr << " flag detected" << endl;
					if (sProgramBehavior != PB_NONE)
						die("Please specify only one program behavior flag");
					sProgramBehavior = PB_TEST_RGB_XYZ_LAB;
				}
				else if (argStr == "--grayStat")
				{
					cout << argStr << " flag detected" << endl;
					if (sProgramBehavior != PB_NONE)
						die("Please specify only one program behavior flag");
					sProgramBehavior = PB_GRAY_IMG_PAIR_STATS;
				}
				else if (argStr == "--rgbStat")
				{
					cout << argStr << " flag detected" << endl;
					if (sProgramBehavior != PB_NONE)
						die("Please specify only one program behavior flag");
					sProgramBehavior = PB_RGB_IMG_PAIR_STATS;
				}
				else die(string("Unknown flag: " + argStr).c_str());
			}
		}
		else	//Nonflag
		{
			if (prevArg == "-N")
			{
				//Noise params file
				sNoiseParamsFilename = argStr;
				cout << "Noise params filename arg read: " << sNoiseParamsFilename << endl;
			}
			else if (prevArg == "-s")
			{
				//Denoise threshold
				
				string color = argStr.substr(0, 1);
				if (color[0] < '0' || color[0] > '3')
					die("Invalid shrinkage color argument");
				int colorIdx = color[0] - '1';
				
				string levelStr = argStr.substr(1, 2);
				
				char levelType = levelStr[0];
				if (levelType != 'A' && levelType != 'H' && levelType != 'B')
					die("Invalid shrinkage level type ('A' or 'H' or 'B')");
				
				int level = 0;
				if (levelType == 'B')
					level = levelStr[1] - '0';
				if (levelType == 'B' && (level < 0 || level > 9))
					die("Invalid shrinkage level (only levels 0-9 can be used with level type 'B')");
				
				sManualShrinkageThresholdStr += "-";
				sManualShrinkageThresholdStr += argStr;
				
				int thresholdStartPos = 2;
				if (levelType == 'B')
					thresholdStartPos = 3;
				stringstream ss(argStr.substr(thresholdStartPos, argStr.length() - thresholdStartPos));
				Float_t threshold;
				ss >> threshold;
				
				if (levelType == 'A')	//All levels
				{
					if (colorIdx > -1)
					{
						if (gManualShrinkageThresholds[colorIdx].size() < 11)
							gManualShrinkageThresholds[colorIdx].resize(11);
						for (int i = 0; i <= 9; i++)
							gManualShrinkageThresholds[colorIdx][i] = threshold;
					}
					else
					{
						for (int i = 0; i < 3; i++)
						{
							if (gManualShrinkageThresholds[i].size() < 11)
								gManualShrinkageThresholds[i].resize(11);
							for (int j = 0; j <= 9; j++)
								gManualShrinkageThresholds[i][j] = threshold;
						}
					}
					string colorName = "RGB";
					if (colorIdx == 0)
						colorName = "red";
					else if (colorIdx == 1)
						colorName = "green";
					else if (colorIdx == 2)
						colorName = "blue";
					cout << "All levels threshold argument read for color " << colorName
						<< ": " << threshold << endl;
				}
				else if (levelType == 'H')
				{
					if (colorIdx > -1)
					{
						if (gManualShrinkageThresholds[colorIdx].size() < 1)
							gManualShrinkageThresholds[colorIdx].resize(1);
						gManualShrinkageThresholds[colorIdx][0] = threshold;
					}
					else
					{
						for (int i = 0; i < 3; i++)
						{
							if (gManualShrinkageThresholds[i].size() < 1)
								gManualShrinkageThresholds[i].resize(1);
							gManualShrinkageThresholds[i][0] = threshold;
						}
					}
					string colorName = "RGB";
					if (colorIdx == 0)
						colorName = "red";
					else if (colorIdx == 1)
						colorName = "green";
					else if (colorIdx == 2)
						colorName = "blue";
					cout << "H threshold argument read for color " << colorName
						<< ": " << threshold << endl;
				}
				else
				{
					assert(levelType == 'B');
					
					if (colorIdx > -1)
					{
						if (gManualShrinkageThresholds[colorIdx].size() < level + 2)
							gManualShrinkageThresholds[colorIdx].resize(level + 2);
						gManualShrinkageThresholds[colorIdx][level + 1] = threshold;
					}
					else
					{
						for (int i = 0; i < 3; i++)
						{
							if (gManualShrinkageThresholds[i].size() < level + 2)
								gManualShrinkageThresholds[i].resize(level + 2);
							gManualShrinkageThresholds[i][level + 1] = threshold;
						}
					}
					string colorName = "RGB";
					if (colorIdx == 0)
						colorName = "red";
					else if (colorIdx == 1)
						colorName = "green";
					else if (colorIdx == 2)
						colorName = "blue";
					cout << "B threshold argument read for color " << colorName
						<< ", level " << level << ": " << threshold << endl;
				}
			}
			else
			{
				string filename(argv[argIdx]);
				sInputFilenames.push_back(filename);
				cout << "Input filename arg read: " << filename << endl;
			}
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x258, %rsp            # imm = 0x258
movq %rsi, 0x60(%rsp)
cmpl $0x2, %edi
jl 0x5b1b
movl %edi, %eax
movq %rax, 0x88(%rsp)
movl $0x1, %r15d
leaq 0xb0(%rsp), %r12
leaq 0xd0(%rsp), %rbp
leaq 0x259fc(%rip), %rax     # 0x2a553
movq %rax, 0x50(%rsp)
movq 0x3246d(%rip), %rbx     # 0x36fd0
movq 0x60(%rsp), %r14
movq -0x8(%r14,%r15,8), %rsi
movq %r12, %rdi
movq %rbp, %rdx
callq 0x9ee4
movq (%r14,%r15,8), %rsi
leaq 0x28(%rsp), %rdi
movq %rbp, %rdx
callq 0x9ee4
movq 0x28(%rsp), %rax
cmpb $0x2d, (%rax)
jne 0x4c9e
movq 0x30(%rsp), %rcx
cmpq $0x1, %rcx
jbe 0x5aa8
cmpb $0x2d, 0x1(%rax)
jne 0x4d6d
cmpq $0x2, %rcx
leaq 0x28(%rsp), %r14
je 0x5aa8
movq %r14, %rdi
leaq 0x2571d(%rip), %rsi     # 0x2a2e6
callq 0x30c0
testl %eax, %eax
je 0x5205
movq %r14, %rdi
leaq 0x25737(%rip), %rsi     # 0x2a317
callq 0x30c0
testl %eax, %eax
je 0x5271
movq %r14, %rdi
leaq 0x25746(%rip), %rsi     # 0x2a33d
callq 0x30c0
testl %eax, %eax
je 0x54aa
movq %r14, %rdi
leaq 0x25879(%rip), %rsi     # 0x2a487
callq 0x30c0
testl %eax, %eax
je 0x5516
movq %r14, %rdi
leaq 0x258bc(%rip), %rsi     # 0x2a4e1
callq 0x30c0
testl %eax, %eax
jne 0x5af5
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq %rbx, %rdi
callq 0x3360
movq %rax, %r14
movl $0xe, %edx
movq %rax, %rdi
leaq 0x2590f(%rip), %rsi     # 0x2a565
callq 0x3360
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x32e0
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31f0
cmpl $0x0, 0x329ef(%rip)     # 0x37678
jne 0x5a9c
movl $0x7, 0x329df(%rip)     # 0x37678
jmp 0x5987
movq %r12, %rdi
leaq 0x2590d(%rip), %rsi     # 0x2a5b5
callq 0x30c0
testl %eax, %eax
je 0x5112
movq %r12, %rdi
leaq 0x2595e(%rip), %rsi     # 0x2a61d
callq 0x30c0
testl %eax, %eax
je 0x517c
movq 0x60(%rsp), %rax
movq (%rax,%r15,8), %rsi
movq %rbp, %rdi
leaq 0x68(%rsp), %rdx
callq 0x9ee4
leaq 0x3284f(%rip), %rdi     # 0x37538
movq %rbp, %rsi
callq 0xa068
movl $0x19, %edx
movq %rbx, %rdi
leaq 0x25a5d(%rip), %rsi     # 0x2a75d
callq 0x3360
movq 0xd0(%rsp), %rsi
movq 0xd8(%rsp), %rdx
movq %rbx, %rdi
callq 0x3360
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x32e0
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31f0
movq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rax
cmpq %rax, %rdi
je 0x5987
movq 0xe0(%rsp), %rsi
jmp 0x597f
movl $0x1, %r12d
movq 0x28(%rsp), %rax
movzbl (%rax,%r12), %eax
cmpl $0x6d, %eax
jg 0x4e31
cmpl $0x67, %eax
jg 0x4eba
cmpl $0x4e, %eax
je 0x5069
cmpl $0x62, %eax
jne 0x5a76
movl $0x1, %edx
movq %rbx, %rdi
leaq 0x25bbe(%rip), %rsi     # 0x2a96e
callq 0x3360
movq 0x28(%rsp), %rax
movb (%rax,%r12), %al
movb %al, 0xd0(%rsp)
movl $0x1, %edx
movq %rbx, %rdi
leaq 0xd0(%rsp), %rsi
callq 0x3360
movq %rax, %r14
movl $0xe, %edx
movq %rax, %rdi
leaq 0x25779(%rip), %rsi     # 0x2a565
callq 0x3360
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x32e0
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31f0
cmpl $0x4, 0x32859(%rip)     # 0x37678
jne 0x5a6a
movb $0x1, 0x32850(%rip)     # 0x3767c
jmp 0x50f7
cmpl $0x6e, %eax
je 0x4fd0
cmpl $0x73, %eax
je 0x4f47
cmpl $0x76, %eax
jne 0x5a76
movb $0x1, 0x3269d(%rip)     # 0x374f0
movl $0x1, %edx
movq %rbx, %rdi
leaq 0x25b0c(%rip), %rsi     # 0x2a96e
callq 0x3360
movq 0x28(%rsp), %rax
movb (%rax,%r12), %al
movb %al, 0xd0(%rsp)
movl $0x1, %edx
movq %rbx, %rdi
leaq 0xd0(%rsp), %rsi
callq 0x3360
movq %rax, %rbp
movl $0xe, %edx
movq %rax, %rdi
leaq 0x256c7(%rip), %rsi     # 0x2a565
callq 0x3360
movq (%rbp), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x32e0
jmp 0x4f2f
cmpl $0x69, %eax
jne 0x59fc
movb $0x1, 0x32627(%rip)     # 0x374f1
movl $0x1, %edx
movq %rbx, %rdi
leaq 0x25a95(%rip), %rsi     # 0x2a96e
callq 0x3360
movq 0x28(%rsp), %rax
movb (%rax,%r12), %al
movb %al, 0xd0(%rsp)
movl $0x1, %edx
movq %rbx, %rdi
leaq 0xd0(%rsp), %rsi
callq 0x3360
movq %rax, %rbp
movl $0xe, %edx
movq %rax, %rdi
leaq 0x25650(%rip), %rsi     # 0x2a565
callq 0x3360
movq (%rbp), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x32e0
movsbl %al, %esi
movq %rbp, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31f0
jmp 0x50f7
movl $0x1, %edx
movq %rbx, %rdi
leaq 0x25a18(%rip), %rsi     # 0x2a96e
callq 0x3360
movq 0x28(%rsp), %rax
movb (%rax,%r12), %al
movb %al, 0xd0(%rsp)
movl $0x1, %edx
movq %rbx, %rdi
leaq 0xd0(%rsp), %rsi
callq 0x3360
movq %rax, %r14
movl $0xe, %edx
movq %rax, %rdi
leaq 0x255d3(%rip), %rsi     # 0x2a565
callq 0x3360
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x32e0
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31f0
cmpl $0x5, 0x326b3(%rip)     # 0x37678
je 0x50f7
jmp 0x5a61
movl $0x1, %edx
movq %rbx, %rdi
leaq 0x2598f(%rip), %rsi     # 0x2a96e
callq 0x3360
movq 0x28(%rsp), %rax
movb (%rax,%r12), %al
movb %al, 0xd0(%rsp)
movl $0x1, %edx
movq %rbx, %rdi
leaq 0xd0(%rsp), %rsi
callq 0x3360
movq %rax, %r14
movl $0xe, %edx
movq %rax, %rdi
leaq 0x2554a(%rip), %rsi     # 0x2a565
callq 0x3360
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x32e0
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31f0
movl 0x3262b(%rip), %eax     # 0x37678
cmpl $0x5, %eax
je 0x505a
testl %eax, %eax
jne 0x59f3
movl $0x5, 0x32614(%rip)     # 0x37678
jmp 0x50f7
movl $0x1, %edx
movq %rbx, %rdi
leaq 0x258f6(%rip), %rsi     # 0x2a96e
callq 0x3360
movq 0x28(%rsp), %rax
movb (%rax,%r12), %al
movb %al, 0xd0(%rsp)
movl $0x1, %edx
movq %rbx, %rdi
leaq 0xd0(%rsp), %rsi
callq 0x3360
movq %rax, %r14
movl $0xe, %edx
movq %rax, %rdi
leaq 0x254b1(%rip), %rsi     # 0x2a565
callq 0x3360
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x32e0
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31f0
cmpl $0x0, 0x32591(%rip)     # 0x37678
jne 0x59f3
movl $0x4, 0x32581(%rip)     # 0x37678
incq %r12
cmpq %r12, 0x30(%rsp)
leaq 0xd0(%rsp), %rbp
ja 0x4d73
jmp 0x5987
leaq 0x323ff(%rip), %rdi     # 0x37518
leaq 0x28(%rsp), %rsi
callq 0x3170
movl $0x20, %edx
movq %rbx, %rdi
leaq 0x254ca(%rip), %rsi     # 0x2a5fc
callq 0x3360
movq 0x323da(%rip), %rsi     # 0x37518
movq 0x323db(%rip), %rdx     # 0x37520
movq %rbx, %rdi
callq 0x3360
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x32e0
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31f0
jmp 0x5987
movl $0x1, %ecx
leaq 0x68(%rsp), %rdi
leaq 0x28(%rsp), %r14
movq %r14, %rsi
xorl %edx, %edx
callq 0x3330
movq 0x68(%rsp), %rax
movzbl (%rax), %eax
movq %rax, 0x48(%rsp)
addl $-0x34, %eax
cmpb $-0x5, %al
jbe 0x5ab2
movl $0x1, %edx
movl $0x2, %ecx
leaq 0x90(%rsp), %rdi
movq %r14, %rsi
callq 0x3330
movq 0x90(%rsp), %rax
movzbl (%rax), %r14d
movq $0x0, 0x58(%rsp)
cmpl $0x41, %r14d
je 0x52f6
cmpl $0x42, %r14d
je 0x52dd
movl $0x0, %r12d
cmpl $0x48, %r14d
je 0x52f9
jmp 0x5abe
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq %rbx, %rdi
callq 0x3360
movq %rax, %r14
movl $0xe, %edx
movq %rax, %rdi
leaq 0x2533c(%rip), %rsi     # 0x2a565
callq 0x3360
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x32e0
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31f0
cmpl $0x0, 0x3241c(%rip)     # 0x37678
jne 0x5a9c
movl $0x1, 0x3240c(%rip)     # 0x37678
jmp 0x5987
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq %rbx, %rdi
callq 0x3360
movq %rax, %r14
movl $0xe, %edx
movq %rax, %rdi
leaq 0x252d0(%rip), %rsi     # 0x2a565
callq 0x3360
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x32e0
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31f0
cmpl $0x0, 0x323b0(%rip)     # 0x37678
jne 0x5a9c
movl $0x2, 0x323a0(%rip)     # 0x37678
jmp 0x5987
movsbl 0x1(%rax), %eax
addl $-0x30, %eax
movb $0x1, %r12b
movq %rax, 0x58(%rsp)
cmpl $0xa, %eax
jb 0x52f9
jmp 0x5aca
xorl %r12d, %r12d
leaq 0x32298(%rip), %r13     # 0x37598
movq %r13, %rdi
leaq 0x25664(%rip), %rsi     # 0x2a96e
callq 0x3540
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq %r13, %rdi
callq 0x30d0
movzbl %r12b, %edx
orq $0x2, %rdx
movq 0x30(%rsp), %rcx
subq %rdx, %rcx
movq %rsp, %r13
movq %r13, %rdi
leaq 0x28(%rsp), %rsi
callq 0x3330
movq %rbp, %rdi
movq %r13, %rsi
movl $0x18, %edx
callq 0x3460
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x536c
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3310
movq %rbp, %rdi
leaq 0x20(%rsp), %rsi
callq 0x31d0
movq 0x48(%rsp), %rax
addl $-0x31, %eax
cmpl $0x48, %r14d
je 0x53f4
cmpl $0x41, %r14d
jne 0x5441
cmpb $0x30, 0x48(%rsp)
jbe 0x5582
movl %eax, %eax
leaq (%rax,%rax,2), %rcx
leaq 0x321a7(%rip), %rdx     # 0x37550
movq (%rdx,%rcx,8), %rax
movq 0x8(%rdx,%rcx,8), %rdx
subq %rax, %rdx
cmpq $0x57, %rdx
ja 0x53d6
leaq 0x3218e(%rip), %rax     # 0x37550
leaq (%rax,%rcx,8), %r14
movl $0xb, %esi
movq %r14, %rdi
callq 0xa036
movq (%r14), %rax
movsd 0x20(%rsp), %xmm0
movlhps %xmm0, %xmm0            # xmm0 = xmm0[0,0]
xorl %ecx, %ecx
movups %xmm0, (%rax,%rcx,8)
addq $0x2, %rcx
cmpq $0xa, %rcx
jne 0x53e1
jmp 0x55df
cmpb $0x30, 0x48(%rsp)
jbe 0x56ad
movl %eax, %eax
leaq (%rax,%rax,2), %rcx
leaq 0x32144(%rip), %rdx     # 0x37550
movq (%rdx,%rcx,8), %rax
cmpq %rax, 0x8(%rdx,%rcx,8)
jne 0x5432
leaq 0x32132(%rip), %rax     # 0x37550
leaq (%rax,%rcx,8), %r14
movl $0x1, %esi
movq %r14, %rdi
callq 0xa036
movq (%r14), %rax
movsd 0x20(%rsp), %xmm0
movsd %xmm0, (%rax)
jmp 0x56f1
testb %r12b, %r12b
je 0x5ad6
cmpb $0x30, 0x48(%rsp)
jbe 0x57bf
movl %eax, %eax
leaq (%rax,%rax,2), %rcx
leaq 0x320ee(%rip), %rdx     # 0x37550
movq (%rdx,%rcx,8), %rax
movq 0x8(%rdx,%rcx,8), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movq 0x58(%rsp), %rsi
addl $0x2, %esi
cmpq %rsi, %rdx
jae 0x5495
leaq 0x320ca(%rip), %rax     # 0x37550
leaq (%rax,%rcx,8), %r14
movq %r14, %rdi
callq 0xa036
movq (%r14), %rax
movsd 0x20(%rsp), %xmm0
movl 0x58(%rsp), %ecx
movsd %xmm0, 0x8(%rax,%rcx,8)
jmp 0x581a
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq %rbx, %rdi
callq 0x3360
movq %rax, %r14
movl $0xe, %edx
movq %rax, %rdi
leaq 0x25097(%rip), %rsi     # 0x2a565
callq 0x3360
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x32e0
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31f0
cmpl $0x0, 0x32177(%rip)     # 0x37678
jne 0x5a9c
movl $0x3, 0x32167(%rip)     # 0x37678
jmp 0x5987
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq %rbx, %rdi
callq 0x3360
movq %rax, %r14
movl $0xe, %edx
movq %rax, %rdi
leaq 0x2502b(%rip), %rsi     # 0x2a565
callq 0x3360
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x32e0
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31f0
cmpl $0x0, 0x3210b(%rip)     # 0x37678
jne 0x5a9c
movl $0x6, 0x320fb(%rip)     # 0x37678
jmp 0x5987
xorl %r12d, %r12d
leaq (%r12,%r12,2), %rcx
leaq 0x31fc0(%rip), %rdx     # 0x37550
movq (%rdx,%rcx,8), %rax
movq 0x8(%rdx,%rcx,8), %rdx
subq %rax, %rdx
cmpq $0x57, %rdx
ja 0x55bd
leaq 0x31fa7(%rip), %rax     # 0x37550
leaq (%rax,%rcx,8), %r14
movl $0xb, %esi
movq %r14, %rdi
callq 0xa036
movq (%r14), %rax
movsd 0x20(%rsp), %xmm0
movlhps %xmm0, %xmm0            # xmm0 = xmm0[0,0]
xorl %ecx, %ecx
movups %xmm0, (%rax,%rcx,8)
addq $0x2, %rcx
cmpq $0xa, %rcx
jne 0x55c8
incq %r12
cmpq $0x3, %r12
jne 0x5585
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq %rsp, %rdi
leaq 0x250ca(%rip), %rsi     # 0x2a6bc
leaq 0x250c6(%rip), %rdx     # 0x2a6bf
callq 0xa9c2
movq 0x48(%rsp), %rax
addb $-0x31, %al
cmpb $0x3, %al
jae 0x5634
movzbl %al, %eax
shll $0x3, %eax
leaq 0x31592(%rip), %rcx     # 0x36ba8
movq (%rax,%rcx), %rcx
leaq 0x24b0f(%rip), %rdx     # 0x2a130
movq (%rax,%rdx), %r8
movq 0x8(%rsp), %rdx
movq %rsp, %rdi
xorl %esi, %esi
callq 0x3430
movl $0x2d, %edx
movq %rbx, %rdi
leaq 0x25088(%rip), %rsi     # 0x2a6cb
callq 0x3360
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x3360
movq %rax, %r14
movl $0x2, %edx
movq %rax, %rdi
leaq 0x25a42(%rip), %rsi     # 0x2b0ad
callq 0x3360
movsd 0x20(%rsp), %xmm0
movq %r14, %rdi
callq 0x3480
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x32e0
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31f0
jmp 0x590f
xorl %r12d, %r12d
leaq 0x31e99(%rip), %rcx     # 0x37550
movq (%r12,%rcx), %rax
cmpq %rax, 0x8(%r12,%rcx)
jne 0x56dd
leaq 0x31e87(%rip), %rax     # 0x37550
leaq (%rax,%r12), %r14
movl $0x1, %esi
movq %r14, %rdi
callq 0xa036
movq (%r14), %rax
movsd 0x20(%rsp), %xmm0
movsd %xmm0, (%rax)
addq $0x18, %r12
cmpq $0x48, %r12
jne 0x56b0
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq %rsp, %rdi
leaq 0x24fb8(%rip), %rsi     # 0x2a6bc
leaq 0x24fb4(%rip), %rdx     # 0x2a6bf
callq 0xa9c2
movq 0x48(%rsp), %rax
addb $-0x31, %al
cmpb $0x3, %al
jae 0x5746
movzbl %al, %eax
shll $0x3, %eax
leaq 0x31480(%rip), %rcx     # 0x36ba8
movq (%rax,%rcx), %rcx
leaq 0x249fd(%rip), %rdx     # 0x2a130
movq (%rax,%rdx), %r8
movq 0x8(%rsp), %rdx
movq %rsp, %rdi
xorl %esi, %esi
callq 0x3430
movl $0x24, %edx
movq %rbx, %rdi
leaq 0x24fa4(%rip), %rsi     # 0x2a6f9
callq 0x3360
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x3360
movq %rax, %r14
movl $0x2, %edx
movq %rax, %rdi
leaq 0x25930(%rip), %rsi     # 0x2b0ad
callq 0x3360
movsd 0x20(%rsp), %xmm0
movq %r14, %rdi
callq 0x3480
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x32e0
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31f0
jmp 0x590f
movq 0x58(%rsp), %rax
leal 0x2(%rax), %r14d
movl %eax, %ebp
xorl %r13d, %r13d
leaq 0x31d7c(%rip), %rcx     # 0x37550
movq (%r13,%rcx), %rax
movq 0x8(%r13,%rcx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r14, %rcx
jae 0x5804
leaq 0x31d5f(%rip), %rax     # 0x37550
leaq (%rax,%r13), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0xa036
movq (%r12), %rax
movsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x8(%rax,%rbp,8)
addq $0x18, %r13
cmpq $0x48, %r13
jne 0x57cd
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq %rsp, %rdi
leaq 0x24e8f(%rip), %rsi     # 0x2a6bc
leaq 0x24e8b(%rip), %rdx     # 0x2a6bf
callq 0xa9c2
movq 0x48(%rsp), %rax
addb $-0x31, %al
cmpb $0x3, %al
leaq 0xd0(%rsp), %rbp
jae 0x5877
movzbl %al, %eax
shll $0x3, %eax
leaq 0x3134f(%rip), %rcx     # 0x36ba8
movq (%rax,%rcx), %rcx
leaq 0x248cc(%rip), %rdx     # 0x2a130
movq (%rax,%rdx), %r8
movq 0x8(%rsp), %rdx
movq %rsp, %rdi
xorl %esi, %esi
callq 0x3430
movl $0x24, %edx
movq %rbx, %rdi
leaq 0x24ea9(%rip), %rsi     # 0x2a72f
callq 0x3360
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x3360
movq %rax, %r14
movl $0x8, %edx
movq %rax, %rdi
leaq 0x24ea6(%rip), %rsi     # 0x2a754
callq 0x3360
movq %r14, %rdi
movq 0x58(%rsp), %rsi
callq 0x34e0
movq %rax, %r14
movl $0x2, %edx
movq %rax, %rdi
leaq 0x257db(%rip), %rsi     # 0x2b0ad
callq 0x3360
movsd 0x20(%rsp), %xmm0
movq %r14, %rdi
callq 0x3480
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x32e0
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31f0
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x592a
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3310
movq %rbp, %rdi
movq 0x31674(%rip), %rsi     # 0x36fa8
callq 0x3220
leaq 0x150(%rsp), %rdi
callq 0x30e0
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x596b
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x3310
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x5987
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3310
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x59a3
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3310
movq 0xb0(%rsp), %rdi
leaq 0xc0(%rsp), %rax
cmpq %rax, %rdi
leaq 0xb0(%rsp), %r12
je 0x59d0
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x3310
incq %r15
cmpq 0x88(%rsp), %r15
jne 0x4b63
addq $0x258, %rsp            # imm = 0x258
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x24b7a(%rip), %rdi     # 0x2a574
jmp 0x5a71
cmpl $0x68, %eax
jne 0x5a76
movq 0x315c8(%rip), %rdi     # 0x36fd0
leaq 0x24f5f(%rip), %rsi     # 0x2a96e
movl $0x1, %edx
callq 0x3360
movq 0x28(%rsp), %rax
movb (%rax,%r12), %al
leaq 0xd0(%rsp), %rsi
movb %al, (%rsi)
movq 0x3159d(%rip), %rdi     # 0x36fd0
movl $0x1, %edx
callq 0x3360
movq %rax, %rbx
leaq 0x24b1e(%rip), %rsi     # 0x2a565
movl $0xe, %edx
movq %rax, %rdi
callq 0x3360
movq %rbx, %rdi
callq 0x3140
callq 0x42c6
leaq 0x24b50(%rip), %rdi     # 0x2a5b8
jmp 0x5a71
leaq 0x24b31(%rip), %rdi     # 0x2a5a2
callq 0x403c
leaq 0x24b51(%rip), %rsi     # 0x2a5ce
leaq 0xd0(%rsp), %rdi
leaq 0x28(%rsp), %rdx
callq 0x9fad
movq 0xd0(%rsp), %rdi
callq 0x403c
leaq 0x24ad1(%rip), %rax     # 0x2a574
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rdi
callq 0x403c
leaq 0x24b67(%rip), %rdi     # 0x2a620
callq 0x403c
leaq 0x24b7c(%rip), %rdi     # 0x2a641
callq 0x403c
leaq 0x24ba1(%rip), %rdi     # 0x2a672
callq 0x403c
leaq 0x24c41(%rip), %rdi     # 0x2a71e
leaq 0x24791(%rip), %rsi     # 0x2a275
leaq 0x24af2(%rip), %rcx     # 0x2a5dd
movl $0x1c9, %edx            # imm = 0x1C9
callq 0x31c0
leaq 0x24ad2(%rip), %rsi     # 0x2a5ce
leaq 0xd0(%rsp), %rdi
leaq 0x28(%rsp), %rdx
callq 0x9fad
movq 0xd0(%rsp), %rdi
callq 0x403c
leaq 0x24a12(%rip), %rdi     # 0x2a534
callq 0x403c
jmp 0x5c07
jmp 0x5c35
jmp 0x5b7d
jmp 0x5b7d
jmp 0x5b70
jmp 0x5b7d
jmp 0x5b70
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x5bc1
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3310
jmp 0x5bc1
jmp 0x5b70
jmp 0x5b64
jmp 0x5c35
movq %rax, %rbx
jmp 0x5be6
jmp 0x5b7d
jmp 0x5c35
movq %rax, %rbx
jmp 0x5bc1
jmp 0x5b7d
jmp 0x5b82
jmp 0x5b82
jmp 0x5b7d
movq %rax, %rbx
jmp 0x5ba0
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x5ba0
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3310
movq 0x31401(%rip), %rsi     # 0x36fa8
leaq 0xd0(%rsp), %rdi
callq 0x3220
leaq 0x150(%rsp), %rdi
callq 0x30e0
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x5be6
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x3310
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x5c38
movq 0x78(%rsp), %rsi
jmp 0x5c27
jmp 0x5c07
jmp 0x5c35
movq %rax, %rbx
jmp 0x5c54
jmp 0x5c35
movq %rax, %rbx
movq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rax
cmpq %rax, %rdi
je 0x5c38
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x3310
jmp 0x5c38
jmp 0x5c35
jmp 0x5c35
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x5c54
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3310
movq 0xb0(%rsp), %rdi
leaq 0xc0(%rsp), %rax
cmpq %rax, %rdi
je 0x5c79
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x3310
movq %rbx, %rdi
callq 0x3500