// File: /workspace/github_cpp_makefile_star2_O2/superyuan[P]refeditor/DiploidConstructor.cpp
// Function: main
int main(int argc, char *argv[])
{	
	string chrName = "", chrNameB = "";
	CLineFields inputReferenceGenomeFile;
	CLineFields genotypesFile;

	if (parseParameters (argc, argv) == false) 	{
		cerr << "Version: 1.0-r7" << endl;
		cerr << "Contact: shuaiyuan.emory@gmail.com" << endl << endl;		
		cerr << "Usage: " << argv[0] <<" -r haploid.fa -g genotypes -l length -o diploid.fa" << endl << endl;
		cerr << "Convert haploid reference genome to diploid reference genome according to the genotypes and sequencing read length" << endl << endl;
		cerr << "Example: " << argv[0] << " -r hg19.fa -g known.genotypes -l 36 -o diploid.fa" << endl;
		cerr << endl << "Parameters (mandatory): " << endl;
		cerr << "  -r\t\thaploid reference genome file " << endl;
		cerr << "  -g\t\tgenotypes file" << endl;
		cerr << "  -l\t\tread length" << endl;
		cerr << "  -o\t\toutput diploid reference genome file " << endl;
		cerr << endl << "Parameters (optional): " << endl;
		cerr << "  -d\t\tmaximal deletion in a read and mapped to alternative alleles [default=0]" << endl;
		cerr << "  -s\t\tsex of the individual [default=\"m\"]" << endl;
		exit(-1);
	}
	
	if (inputReferenceGenomeFile.openFile(inputReferenceGenomeFileName)==false) {
		cerr << "Can not open file: " << inputReferenceGenomeFileName << endl;
		exit (-1);
	}

	if (genotypesFile.openFile(genotypesFileName)==false) {
		cerr << "Can not open file: " << genotypesFileName << endl;
		exit (-1);
	}	

	// step 1: read haploid reference genome file, double the total number of chromosomes.
	bool readin = false;
	inputReferenceGenomeFile.readline();
	while (inputReferenceGenomeFile.endofFile()==false) {
		if (inputReferenceGenomeFile.line[0]=='>') {
			chrName = inputReferenceGenomeFile.line.substr(1);
			chrNameB = chrName+"b";
			if (chrName != "chrY" || gender=='m') {
				chrMap[chrName] = "";
				chrMap[chrNameB] = "";
				chrNameList.push_back(chrName);			
				chrNameList.push_back(chrNameB);
				readin = true;
			} else {
				readin = false;  // skip chromosome Y for female individuals.
			}
		} else if (readin){
			
			chrMap[chrName] += inputReferenceGenomeFile.line;
			chrMap[chrNameB] += inputReferenceGenomeFile.line;
		}
		inputReferenceGenomeFile.readline();
	}	
	inputReferenceGenomeFile.closeFile();

	// step 2: use genotype file to modify the chromosomes. double the chromosome numbers.
	if (genotypesFile.isOpen()) {
		int refColumn = -1, altColumn=-1;
		genotypesFile.readline();
		while(genotypesFile.endofFile()==false) {

			if ((genotypesFile.field.size()>=5) && (genotypesFile.field[3].length()==1) && (genotypesFile.field[4].length()==1))
			{
				unsigned int pos = atoi(genotypesFile.field[2].c_str());
				chrName = genotypesFile.field[1];
				chrNameB = chrName+"b";
			
				if (chrMap[chrName].length()<pos) {
					cerr << "Warning!!! genotype is out of range at: " << chrName << ": " << genotypesFile.field[2] << endl;
				} else {
					// decide which is ref and which is non-ref
					if (toupper(chrMap[chrName][pos-1]) == toupper(genotypesFile.field[4][0])) {
						refColumn = 4;
						altColumn = 3;
					}
					else {
						refColumn = 3;
						altColumn = 4;
					}

					// if genotype is alt/alt, then we still need to change reference allele.
					if (chrMap[chrName][pos-1] >='A' && chrMap[chrName][pos-1] <='Z') {
						chrMap[chrName][pos-1] = toupper(genotypesFile.field[refColumn][0]);
						chrMap[chrNameB][pos-1] = toupper(genotypesFile.field[altColumn][0]);
					}
					else {
						chrMap[chrName][pos-1] = tolower(genotypesFile.field[refColumn][0]);
						chrMap[chrNameB][pos-1] = tolower(genotypesFile.field[altColumn][0]);
					}
				}
			}
			genotypesFile.readline();
		}
		genotypesFile.closeFile();
	} 
	contextLength = 2*readLength - 1 + 2*maxDeletion;
	outputReferenceGenomeFile.open(outputReferenceGenomeFileName);
	dipmapFile.open(dipmapFileName);

	// step 3: create mini chromosomes and append them to the end of reference allele.
	for (int i=0; i<(int)chrNameList.size(); i++) {
		chrName = chrNameList[i];		
		if (chrName[chrName.length()-1] == 'b')
			extendFromDiploid(chrName);
	}

	// step 4: print out the reference allele, which has already been extended by mini chromosomes.
	for (int i=0; i<(int)chrNameList.size(); i++) {
		chrName = chrNameList[i];		
		if (chrName[chrName.length()-1] != 'b')
			printHaploid(chrName);
	}
	outputReferenceGenomeFile << endl;
	dipmapFile.close();
	outputReferenceGenomeFile.close();
	
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x288, %rsp            # imm = 0x288
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x2c41(%rip), %r14      # 0x527a
leaq 0x60(%rsp), %rdi
leaq 0x188(%rsp), %rdx
movq %r14, %rsi
callq 0x3832
leaq 0x148(%rsp), %rdi
leaq 0x188(%rsp), %rdx
movq %r14, %rsi
callq 0x3832
leaq 0x188(%rsp), %rdi
callq 0x4648
leaq 0xc0(%rsp), %rdi
callq 0x4648
leaq 0x2c24(%rip), %r13      # 0x52ab
movq 0x592a(%rip), %r15      # 0x7fb8
leaq 0x296f(%rip), %r12      # 0x5004
movl %ebp, 0x30(%rsp)
movl %ebp, %edi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x2080
leal -0x6c(%rax), %ecx
cmpl $0x7, %ecx
ja 0x26c7
movslq (%r12,%rcx,4), %rax
addq %r12, %rax
jmpq *%rax
movq (%r15), %rdi
callq 0x2310
movl %eax, 0x5f8b(%rip)      # 0x8650
jmp 0x2699
cmpl $0x64, %eax
je 0x2773
cmpl $0x67, %eax
je 0x275f
cmpl $-0x1, %eax
je 0x2786
cmpl $0x3f, %eax
jne 0x2699
jmp 0x342e
movq (%r15), %rsi
leaq 0x5b5a(%rip), %rdi      # 0x8250
callq 0x21f0
jmp 0x2699
movq (%r15), %rax
movb (%rax), %al
movb %al, 0x5b10(%rip)       # 0x8218
jmp 0x2699
movq %r12, %rbp
movq (%r15), %r12
leaq 0x5c39(%rip), %rdi      # 0x8350
movq %r12, %rsi
callq 0x21f0
movq %r15, %r14
movq %rbx, %r15
leaq 0x5d24(%rip), %rbx      # 0x8450
movq %rbx, %rdi
movq %r12, %rsi
movq %rbp, %r12
movl 0x30(%rsp), %ebp
callq 0x21f0
movq %rbx, %rdi
callq 0x20e0
movabsq $0x70616d7069642e, %rcx # imm = 0x70616D7069642E
movq %rcx, (%rax,%rbx)
movq %r15, %rbx
movq %r14, %r15
jmp 0x2699
movq (%r15), %rsi
leaq 0x5de7(%rip), %rdi      # 0x8550
callq 0x21f0
jmp 0x2699
movq (%r15), %rdi
callq 0x2310
movl %eax, 0x5ed3(%rip)      # 0x8654
jmp 0x2699
cmpb $0x0, 0x5ac3(%rip)      # 0x8250
je 0x342e
cmpb $0x0, 0x5db6(%rip)      # 0x8550
je 0x342e
cmpb $0x0, 0x5ba9(%rip)      # 0x8350
je 0x342e
cmpl $0x0, 0x5e9c(%rip)      # 0x8650
je 0x342e
leaq 0x5a8f(%rip), %rsi      # 0x8250
leaq 0x188(%rsp), %rdi
callq 0x459c
testb %al, %al
je 0x3624
leaq 0x5d73(%rip), %rsi      # 0x8550
leaq 0xc0(%rsp), %rdi
callq 0x459c
testb %al, %al
je 0x3650
leaq 0x2a80(%rip), %rsi      # 0x5279
leaq 0x228(%rsp), %rdi
leaq 0x40(%rsp), %rdx
callq 0x3832
leaq 0x188(%rsp), %rdi
pushq $0x1
popq %rsi
leaq 0x228(%rsp), %rdx
callq 0x4678
leaq 0x228(%rsp), %rdi
callq 0x2418
xorl %ebp, %ebp
leaq 0x188(%rsp), %r14
leaq 0x40(%rsp), %r15
leaq 0x60(%rsp), %r13
leaq 0x148(%rsp), %r12
leaq 0x268(%rsp), %rbx
movq %r14, %rdi
callq 0x4664
testb %al, %al
jne 0x29bd
movq 0x1a8(%rsp), %rax
cmpb $0x3e, (%rax)
jne 0x2945
movq %r15, %rdi
leaq 0x1a8(%rsp), %rsi
pushq $0x1
popq %rdx
pushq $-0x1
popq %rcx
callq 0x2230
movq %r13, %rdi
movq %r15, %rsi
callq 0x2280
movq %r15, %rdi
callq 0x2418
movq %r15, %rdi
movq %r13, %rsi
leaq 0x29d0(%rip), %rdx      # 0x527b
callq 0x386d
movq %r12, %rdi
movq %r15, %rsi
callq 0x2280
movq %r15, %rdi
callq 0x2418
movq %r13, %rdi
leaq 0x29b0(%rip), %rsi      # 0x527d
callq 0x38a5
cmpb $0x6d, 0x593f(%rip)     # 0x8218
sete %cl
orb %cl, %al
cmpb $0x1, %al
jne 0x298e
leaq 0x6173(%rip), %rdi      # 0x8a60
movq %r13, %rsi
callq 0x38b0
movq %rax, %rdi
leaq 0x297b(%rip), %rsi      # 0x527a
callq 0x23e0
leaq 0x6155(%rip), %rdi      # 0x8a60
movq %r12, %rsi
callq 0x38b0
movq %rax, %rdi
leaq 0x295d(%rip), %rsi      # 0x527a
callq 0x23e0
leaq 0x6167(%rip), %rdi      # 0x8a90
movq %r13, %rsi
callq 0x3916
movb $0x1, %bpl
leaq 0x6155(%rip), %rdi      # 0x8a90
movq %r12, %rsi
callq 0x3916
jmp 0x2990
testb $0x1, %bpl
je 0x298e
leaq 0x610e(%rip), %rdi      # 0x8a60
movq %r13, %rsi
callq 0x38b0
movq %rax, %rdi
leaq 0x1a8(%rsp), %rsi
callq 0x23f0
leaq 0x60ef(%rip), %rdi      # 0x8a60
movq %r12, %rsi
callq 0x38b0
movb $0x1, %bpl
movq %rax, %rdi
leaq 0x1a8(%rsp), %rsi
callq 0x23f0
jmp 0x2990
xorl %ebp, %ebp
movq %rbx, %rdi
leaq 0x28df(%rip), %rsi      # 0x5279
movq %r15, %rdx
callq 0x3832
movq %r14, %rdi
pushq $0x1
popq %rsi
movq %rbx, %rdx
callq 0x4678
movq %rbx, %rdi
callq 0x2418
jmp 0x2854
leaq 0x188(%rsp), %rdi
callq 0x45f0
leaq 0xc0(%rsp), %rdi
callq 0x45fa
testb %al, %al
je 0x2cb5
leaq 0x2893(%rip), %rsi      # 0x5279
leaq 0x208(%rsp), %rdi
leaq 0x40(%rsp), %rdx
callq 0x3832
leaq 0xc0(%rsp), %rdi
pushq $0x1
popq %rsi
leaq 0x208(%rsp), %rdx
callq 0x4678
leaq 0x208(%rsp), %rdi
callq 0x2418
leaq 0x60(%rsp), %rbx
leaq 0x40(%rsp), %r14
leaq 0xc0(%rsp), %rdi
callq 0x4664
testb %al, %al
jne 0x2ca8
movq 0xc0(%rsp), %r15
movq 0xc8(%rsp), %rax
subq %r15, %rax
cmpq $0x81, %rax
jb 0x2c6e
cmpq $0x1, 0x68(%r15)
jne 0x2c6e
cmpq $0x1, 0x88(%r15)
jne 0x2c6e
movq 0x40(%r15), %rdi
callq 0x2310
movl %eax, %r13d
addq $0x20, %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2110
movq %r14, %r12
movq %r14, %rdi
movq %rbx, %r15
movq %rbx, %rsi
leaq 0x27d9(%rip), %rdx      # 0x527b
callq 0x386d
leaq 0x148(%rsp), %rdi
movq %r12, %rsi
callq 0x2280
movq %r12, %rdi
callq 0x2418
leaq 0x5f9a(%rip), %rdi      # 0x8a60
movq %r15, %rsi
callq 0x38b0
movl %r13d, %ecx
cmpq %rcx, 0x8(%rax)
jae 0x2b25
movq 0x5512(%rip), %rdi      # 0x7ff0
leaq 0x279d(%rip), %rsi      # 0x5282
callq 0x2200
movq %rax, %rdi
movq %rbx, %rsi
callq 0x21e0
movq %rax, %rdi
leaq 0x26ea(%rip), %rsi      # 0x51e9
callq 0x2200
movq 0xc0(%rsp), %rsi
addq $0x40, %rsi
movq %rax, %rdi
callq 0x21e0
movq %rax, %rdi
callq 0x20f0
jmp 0x2c6e
leaq 0x5f34(%rip), %rdi      # 0x8a60
movq %rbx, %rsi
callq 0x38b0
decl %r13d
movq (%rax), %rax
movsbl (%rax,%r13), %edi
callq 0x23c0
movl %eax, %r15d
movq 0xc0(%rsp), %rax
movq 0x80(%rax), %rax
movsbl (%rax), %edi
callq 0x23c0
xorl %r12d, %r12d
cmpl %eax, %r15d
sete %bpl
leaq 0x5ef1(%rip), %rdi      # 0x8a60
movq %rbx, %rsi
callq 0x38b0
movb %bpl, %r12b
pushq $0x4
popq %rbp
subq %r12, %rbp
addq $0x3, %r12
movq (%rax), %rax
cmpb $0x41, (%rax,%r13)
jl 0x2c08
leaq 0x5ecb(%rip), %rdi      # 0x8a60
movq %rbx, %rsi
callq 0x38b0
movq (%rax), %rax
cmpb $0x5a, (%rax,%r13)
jg 0x2c08
movq 0xc0(%rsp), %rax
shll $0x5, %r12d
movq (%rax,%r12), %rax
movsbl (%rax), %edi
callq 0x23c0
movl %eax, %r15d
leaq 0x5e97(%rip), %rdi      # 0x8a60
movq %rbx, %rsi
callq 0x38b0
movq (%rax), %rax
movb %r15b, (%rax,%r13)
movq 0xc0(%rsp), %rax
shll $0x5, %ebp
movq (%rax,%rbp), %rax
movsbl (%rax), %edi
callq 0x23c0
movl %eax, %r15d
leaq 0x5e67(%rip), %rdi      # 0x8a60
leaq 0x148(%rsp), %rsi
callq 0x38b0
jmp 0x2c67
movq 0xc0(%rsp), %rax
shll $0x5, %r12d
movq (%rax,%r12), %rax
movsbl (%rax), %edi
callq 0x22e0
movl %eax, %r15d
leaq 0x5e36(%rip), %rdi      # 0x8a60
movq %rbx, %rsi
callq 0x38b0
movq (%rax), %rax
movb %r15b, (%rax,%r13)
movq 0xc0(%rsp), %rax
shll $0x5, %ebp
movq (%rax,%rbp), %rax
movsbl (%rax), %edi
callq 0x22e0
movl %eax, %r15d
leaq 0x5e06(%rip), %rdi      # 0x8a60
leaq 0x148(%rsp), %rsi
callq 0x38b0
movq (%rax), %rax
movb %r15b, (%rax,%r13)
leaq 0x248(%rsp), %r15
movq %r15, %rdi
leaq 0x25f9(%rip), %rsi      # 0x5279
movq %r14, %rdx
callq 0x3832
leaq 0xc0(%rsp), %rdi
pushq $0x1
popq %rsi
movq %r15, %rdx
callq 0x4678
movq %r15, %rdi
callq 0x2418
jmp 0x2a27
leaq 0xc0(%rsp), %rdi
callq 0x45f0
movl 0x5999(%rip), %eax      # 0x8654
addl 0x598f(%rip), %eax      # 0x8650
leal -0x1(,%rax,2), %eax
movl %eax, 0x5d8a(%rip)      # 0x8a58
leaq 0x5b83(%rip), %rdi      # 0x8858
leaq 0x5674(%rip), %rsi      # 0x8350
pushq $0x10
popq %rdx
callq 0x2040
leaq 0x596d(%rip), %rdi      # 0x8658
leaq 0x575e(%rip), %rsi      # 0x8450
pushq $0x10
popq %rdx
callq 0x2040
xorl %edx, %edx
leaq 0x168(%rsp), %rbx
leaq 0x1e8(%rsp), %r15
movq 0x5d85(%rip), %rax      # 0x8a98
movq 0x5d76(%rip), %rsi      # 0x8a90
movq %rax, %rcx
subq %rsi, %rcx
shrq $0x5, %rcx
movslq %ecx, %rcx
cmpq %rcx, %rdx
jge 0x321a
movq %rdx, 0x20(%rsp)
movq %rdx, %rax
shlq $0x5, %rax
addq %rax, %rsi
leaq 0x60(%rsp), %rdi
callq 0x2110
movq 0x60(%rsp), %rax
movq 0x68(%rsp), %rcx
cmpb $0x62, -0x1(%rax,%rcx)
jne 0x320d
leaq 0x108(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x22c0
movq 0x108(%rsp), %rax
movq 0x110(%rsp), %rcx
cmpb $0x62, -0x1(%rax,%rcx)
jne 0x35ee
leaq 0x40(%rsp), %rdi
leaq 0x257d(%rip), %rsi      # 0x5314
leaq 0xa0(%rsp), %rdx
callq 0x3832
leaq 0x5cb5(%rip), %rdi      # 0x8a60
leaq 0x108(%rsp), %rsi
callq 0x38b0
leaq 0xa0(%rsp), %rdi
movq %rax, %rsi
callq 0x22c0
movq 0x110(%rsp), %rcx
decq %rcx
movq %rbx, %rdi
leaq 0x108(%rsp), %rsi
xorl %edx, %edx
callq 0x2230
leaq 0x5c74(%rip), %rdi      # 0x8a60
movq %rbx, %rsi
callq 0x38b0
leaq 0x128(%rsp), %rdi
movq %rax, %rsi
callq 0x22c0
movl 0x584a(%rip), %eax      # 0x8654
addl 0x5840(%rip), %eax      # 0x8650
movq %rax, 0x28(%rsp)
movl 0xa8(%rsp), %eax
testl %eax, %eax
movl $0x0, %edx
movl %eax, 0x38(%rsp)
cmovgl %eax, %edx
xorl %eax, %eax
movq %rdx, 0x100(%rsp)
cmpq %rdx, %rax
je 0x31d4
movq %rax, 0x18(%rsp)
movq 0xa0(%rsp), %rax
movq 0x18(%rsp), %rcx
movb (%rax,%rcx), %al
movq 0x128(%rsp), %rcx
movq 0x18(%rsp), %rsi
cmpb (%rcx,%rsi), %al
movq 0x18(%rsp), %rax
je 0x31cc
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
andq $0x0, 0x10(%rsp)
movaps %xmm0, 0x80(%rsp)
andq $0x0, 0x90(%rsp)
movl %eax, %ebx
subl 0x28(%rsp), %ebx
movq %rax, %rcx
pushq $-0x1
popq %rax
cmovsl %eax, %ebx
leal 0x1(%rbx), %edx
movl %ecx, %eax
subl %edx, %eax
movslq %eax, %rcx
movq %r15, %rdi
leaq 0x128(%rsp), %rsi
callq 0x2230
movq %rsp, %rdi
movq %r15, %rsi
callq 0x3a14
movq %r15, %rdi
callq 0x2418
addl $0x2, %ebx
movl %ebx, 0x1e8(%rsp)
leaq 0x80(%rsp), %rdi
movq %r15, %rsi
callq 0x3bf2
movq 0xa0(%rsp), %rax
movq 0x18(%rsp), %r13
movsbl (%rax,%r13), %esi
movq (%rsp), %rdi
callq 0x21c0
movq 0x28(%rsp), %rax
leal (%rax,%r13), %ecx
movl 0x38(%rsp), %eax
cmpl %eax, %ecx
cmovgel %eax, %ecx
movl %ecx, 0x3c(%rsp)
movq 0x20(%rsp), %r12
incq %r13
movq 0x8(%rsp), %rax
subq (%rsp), %rax
shrq $0x5, %rax
cmpl %r13d, 0x3c(%rsp)
jle 0x309c
movq 0xa0(%rsp), %rcx
movb (%rcx,%r13), %cl
movq 0x128(%rsp), %rdx
cmpb (%rdx,%r13), %cl
jne 0x2f9b
testl %eax, %eax
movl $0x0, %ebx
cmovgl %eax, %ebx
shlq $0x5, %rbx
xorl %r14d, %r14d
cmpq %r14, %rbx
je 0x2f17
movq (%rsp), %rsi
addq %r14, %rsi
movq 0x128(%rsp), %rax
movsbl (%rax,%r13), %edx
movq %r15, %rdi
callq 0x39de
movq (%rsp), %rdi
addq %r14, %rdi
movq %r15, %rsi
callq 0x2280
movq %r15, %rdi
callq 0x2418
addq $0x20, %r14
jmp 0x2f5d
movslq %eax, %r14
testl %eax, %eax
movl $0x0, %ecx
cmovgl %eax, %ecx
shlq $0x5, %r14
shlq $0x5, %rcx
movq %rcx, 0x30(%rsp)
pushq $0x1
popq %rbp
xorl %ebx, %ebx
cmpq %rbx, 0x30(%rsp)
je 0x2f12
movq (%rsp), %rsi
movl (%rsi,%rbp,8), %r12d
addq %rbx, %rsi
subl 0x28(%rsp), %r12d
pushq $-0x1
popq %rax
cmovsl %eax, %r12d
incl %r12d
movq %r15, %rdi
movq %r12, %rdx
pushq $-0x1
popq %rcx
callq 0x2230
movq %rsp, %rdi
movq %r15, %rsi
callq 0x3a14
movq %r15, %rdi
callq 0x2418
movq 0x80(%rsp), %rax
addl -0x1(%rax,%rbp), %r12d
movl %r12d, 0x1e8(%rsp)
leaq 0x80(%rsp), %rdi
movq %r15, %rsi
callq 0x3bf2
movq (%rsp), %rsi
addq %rbx, %rsi
movq 0x128(%rsp), %rax
movsbl (%rax,%r13), %edx
movq %r15, %rdi
callq 0x39de
movq (%rsp), %rdi
addq %rbx, %rdi
movq %r15, %rsi
callq 0x2280
movq %r15, %rdi
callq 0x2418
movq (%rsp), %rsi
addq %r14, %rsi
movq 0xa0(%rsp), %rax
movsbl (%rax,%r13), %edx
movq %r15, %rdi
callq 0x39de
movq (%rsp), %rdi
addq %r14, %rdi
movq %r15, %rsi
callq 0x2280
movq %r15, %rdi
callq 0x2418
addq $0x20, %r14
addq $0x20, %rbx
addq $0x4, %rbp
jmp 0x2fba
testl %eax, %eax
movl $0x0, %ebp
cmovgl %eax, %ebp
pushq $0x8
popq %r13
xorl %r14d, %r14d
cmpq %r14, %rbp
je 0x31a2
leaq 0x559b(%rip), %rdi      # 0x8658
leaq 0x168(%rsp), %rsi
callq 0x21e0
movq %rax, %rdi
leaq 0x21a5(%rip), %rsi      # 0x5279
callq 0x2200
movq %rax, %r12
leaq 0x597d(%rip), %rdi      # 0x8a60
leaq 0x168(%rsp), %rsi
callq 0x38b0
movq 0x8(%rax), %rsi
incq %rsi
movq %r12, %rdi
callq 0x2150
movq %rax, %rdi
leaq 0x2170(%rip), %rsi      # 0x5279
callq 0x2200
movq (%rsp), %rcx
movq (%rcx,%r13), %rsi
movq %rax, %rdi
callq 0x2150
movq %rax, %rdi
leaq 0x2151(%rip), %rsi      # 0x5279
callq 0x2200
movq (%rsp), %rbx
leaq 0x5928(%rip), %rdi      # 0x8a60
leaq 0x168(%rsp), %rsi
callq 0x38b0
leaq (%rbx,%r13), %rsi
addq $-0x8, %rsi
movq %rax, %rdi
callq 0x23f0
leaq 0x5904(%rip), %rdi      # 0x8a60
leaq 0x168(%rsp), %rsi
callq 0x38b0
movq %rax, %rdi
leaq 0x40(%rsp), %rsi
callq 0x23f0
movq 0x80(%rsp), %rax
movl (%rax,%r14,4), %esi
leaq 0x54cf(%rip), %rdi      # 0x8658
callq 0x2370
movq %rax, %rdi
callq 0x20f0
incq %r14
addq $0x20, %r13
jmp 0x30ad
leaq 0x80(%rsp), %rdi
callq 0x3d7e
movq %rsp, %rdi
callq 0x3810
leaq 0x168(%rsp), %rbx
movq 0x100(%rsp), %rdx
movq 0x18(%rsp), %rax
incq %rax
jmp 0x2e34
leaq 0x128(%rsp), %rdi
callq 0x2418
movq %rbx, %rdi
callq 0x2418
leaq 0xa0(%rsp), %rdi
callq 0x2418
leaq 0x40(%rsp), %rdi
callq 0x2418
leaq 0x108(%rsp), %rdi
callq 0x2418
movq 0x20(%rsp), %rdx
incq %rdx
jmp 0x2d0c
leaq 0x60(%rsp), %r14
leaq 0x1c8(%rsp), %r15
leaq 0x587a(%rip), %r12      # 0x8aa8
leaq 0x5623(%rip), %r13      # 0x8858
pushq $0x3c
popq %rbp
xorl %ebx, %ebx
subq %rsi, %rax
shrq $0x5, %rax
cltq
cmpq %rax, %rbx
jge 0x33c5
movq %rbx, %rax
shlq $0x5, %rax
addq %rax, %rsi
movq %r14, %rdi
callq 0x2110
movq 0x60(%rsp), %rax
movq 0x68(%rsp), %rcx
cmpb $0x62, -0x1(%rax,%rcx)
je 0x3360
movq %r15, %rdi
movq %r14, %rsi
callq 0x22c0
movb 0x5844(%rip), %al       # 0x8ac8
testb %al, %al
je 0x3376
movq 0x1c8(%rsp), %rax
movq 0x1d0(%rsp), %rcx
cmpb $0x62, -0x1(%rax,%rcx)
je 0x3607
leaq 0x57b2(%rip), %rdi      # 0x8a60
movq %r15, %rsi
callq 0x38b0
leaq 0x40(%rsp), %rdi
movq %rax, %rsi
callq 0x22c0
movq %r13, %rdi
movq %r12, %rsi
callq 0x21e0
movq %rax, %rdi
leaq 0x2097(%rip), %rsi      # 0x536f
callq 0x2200
movq %rax, %rdi
movq %r15, %rsi
callq 0x21e0
movq %r12, %rdi
leaq 0x207f(%rip), %rsi      # 0x5371
callq 0x23e0
movl 0x48(%rsp), %r14d
testl %r14d, %r14d
movl $0x0, %eax
cmovlel %eax, %r14d
xorl %r15d, %r15d
movl %r15d, %eax
xorl %edx, %edx
divl %ebp
cmpq %r15, %r14
je 0x3341
imull $-0x3c, %eax, %eax
addl %r15d, %eax
jne 0x332a
movq %r13, %rdi
movq %r12, %rsi
callq 0x21e0
movq 0x40(%rsp), %rax
movsbl (%rax,%r15), %esi
movq %r13, %rdi
callq 0x2260
incq %r15
jmp 0x330b
leaq 0x40(%rsp), %rdi
callq 0x2418
leaq 0x1c8(%rsp), %r15
movq %r15, %rdi
callq 0x2418
leaq 0x60(%rsp), %r14
incq %rbx
movq 0x572e(%rip), %rax      # 0x8a98
movq 0x571f(%rip), %rsi      # 0x8a90
jmp 0x323a
leaq 0x574b(%rip), %rdi      # 0x8ac8
callq 0x23a0
testl %eax, %eax
je 0x328c
movq %r12, %rdi
leaq 0x1ee6(%rip), %rsi      # 0x527a
leaq 0x40(%rsp), %rdx
callq 0x3832
movq 0x4c0b(%rip), %rdi      # 0x7fb0
movq %r12, %rsi
leaq 0x4e61(%rip), %rdx      # 0x8210
callq 0x21d0
leaq 0x570d(%rip), %rdi      # 0x8ac8
callq 0x2130
jmp 0x328c
leaq 0x548c(%rip), %rdi      # 0x8858
callq 0x20f0
leaq 0x5280(%rip), %rdi      # 0x8658
callq 0x22d0
leaq 0x5474(%rip), %rdi      # 0x8858
callq 0x22d0
leaq 0xc0(%rsp), %rdi
callq 0x3942
leaq 0x188(%rsp), %rdi
callq 0x3942
leaq 0x148(%rsp), %rdi
callq 0x2418
leaq 0x60(%rsp), %rdi
callq 0x2418
xorl %eax, %eax
addq $0x288, %rsp            # imm = 0x288
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x4bbb(%rip), %rdi      # 0x7ff0
leaq 0x1be8(%rip), %rsi      # 0x5024
callq 0x2200
movq %rax, %rdi
callq 0x20f0
movq 0x4ba0(%rip), %rdi      # 0x7ff0
leaq 0x1bdd(%rip), %rsi      # 0x5034
callq 0x2200
movq %rax, %rdi
callq 0x20f0
movq %rax, %rdi
callq 0x20f0
movq 0x4b7d(%rip), %rdi      # 0x7ff0
leaq 0x1bdd(%rip), %rsi      # 0x5057
callq 0x2200
movq (%rbx), %rsi
movq %rax, %rdi
callq 0x2200
leaq 0x1bce(%rip), %rsi      # 0x505f
movq %rax, %rdi
callq 0x2200
movq %rax, %rdi
callq 0x20f0
movq %rax, %rdi
callq 0x20f0
movq 0x4b40(%rip), %rdi      # 0x7ff0
leaq 0x1bdc(%rip), %rsi      # 0x5093
callq 0x2200
movq %rax, %rdi
callq 0x20f0
movq %rax, %rdi
callq 0x20f0
movq 0x4b1d(%rip), %rdi      # 0x7ff0
leaq 0x1c2c(%rip), %rsi      # 0x5106
callq 0x2200
movq (%rbx), %rsi
movq %rax, %rdi
callq 0x2200
leaq 0x1c1f(%rip), %rsi      # 0x5110
movq %rax, %rdi
callq 0x2200
movq %rax, %rdi
callq 0x20f0
movq 0x4ae8(%rip), %rdi      # 0x7ff0
callq 0x20f0
leaq 0x1c2f(%rip), %rsi      # 0x5143
movq %rax, %rdi
callq 0x2200
movq %rax, %rdi
callq 0x20f0
movq 0x4ac5(%rip), %rdi      # 0x7ff0
leaq 0x1c2a(%rip), %rsi      # 0x515c
callq 0x2200
movq %rax, %rdi
callq 0x20f0
movq 0x4aaa(%rip), %rdi      # 0x7ff0
leaq 0x1c34(%rip), %rsi      # 0x5181
callq 0x2200
movq %rax, %rdi
callq 0x20f0
movq 0x4a8f(%rip), %rdi      # 0x7ff0
leaq 0x1c2e(%rip), %rsi      # 0x5196
callq 0x2200
movq %rax, %rdi
callq 0x20f0
movq 0x4a74(%rip), %rdi      # 0x7ff0
leaq 0x1c25(%rip), %rsi      # 0x51a8
callq 0x2200
movq %rax, %rdi
callq 0x20f0
movq 0x4a59(%rip), %rdi      # 0x7ff0
callq 0x20f0
leaq 0x1c31(%rip), %rsi      # 0x51d4
movq %rax, %rdi
callq 0x2200
movq %rax, %rdi
callq 0x20f0
movq 0x4a36(%rip), %rdi      # 0x7ff0
leaq 0x1c2b(%rip), %rsi      # 0x51ec
callq 0x2200
movq %rax, %rdi
callq 0x20f0
movq 0x4a1b(%rip), %rdi      # 0x7ff0
leaq 0x1c5f(%rip), %rsi      # 0x523b
callq 0x2200
movq %rax, %rdi
callq 0x20f0
jmp 0x367a
leaq 0x1cc3(%rip), %rdi      # 0x52b8
leaq 0x1ce3(%rip), %rsi      # 0x52df
leaq 0x1cf3(%rip), %rcx      # 0x52f6
pushq $0x59
jmp 0x361e
leaq 0x1d25(%rip), %rdi      # 0x5333
leaq 0x1cca(%rip), %rsi      # 0x52df
leaq 0x1d3a(%rip), %rcx      # 0x5356
pushq $0x4b
popq %rdx
callq 0x2140
movq 0x49c5(%rip), %rdi      # 0x7ff0
leaq 0x1c33(%rip), %rsi      # 0x5265
callq 0x2200
leaq 0x4c12(%rip), %rsi      # 0x8250
movq %rax, %rdi
callq 0x2200
movq %rax, %rdi
callq 0x20f0
jmp 0x367a
movq 0x4999(%rip), %rdi      # 0x7ff0
leaq 0x1c07(%rip), %rsi      # 0x5265
callq 0x2200
leaq 0x4ee6(%rip), %rsi      # 0x8550
movq %rax, %rdi
callq 0x2200
movq %rax, %rdi
callq 0x20f0
pushq $-0x1
popq %rdi
callq 0x2270
movq %rax, %rbx
leaq 0x543c(%rip), %rdi      # 0x8ac8
callq 0x2120
jmp 0x3754
jmp 0x3737
movq %rax, %rbx
leaq 0x208(%rsp), %rdi
jmp 0x37cb
jmp 0x3737
movq %rax, %rbx
leaq 0x228(%rsp), %rdi
jmp 0x37cb
jmp 0x3737
movq %rax, %rbx
jmp 0x37dd
movq %rax, %rbx
jmp 0x37ea
movq %rax, %rbx
jmp 0x37f7
jmp 0x3737
jmp 0x3737
movq %rax, %rbx
jmp 0x37c3
movq %rax, %rbx
jmp 0x37ac
jmp 0x3737
jmp 0x3737
movq %rax, %rbx
leaq 0x248(%rsp), %rdi
jmp 0x37cb
jmp 0x3737
jmp 0x3737
jmp 0x3737
movq %rax, %rbx
jmp 0x3754
movq %rax, %rbx
jmp 0x37b9
movq %rax, %rbx
jmp 0x379f
jmp 0x3737
jmp 0x3737
jmp 0x3737
movq %rax, %rbx
leaq 0x268(%rsp), %rdi
jmp 0x37cb
jmp 0x3747
jmp 0x3737
movq %rax, %rbx
jmp 0x37d0
jmp 0x3768
jmp 0x377a
jmp 0x377a
jmp 0x377a
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x2418
leaq 0x1c8(%rsp), %rdi
jmp 0x37cb
jmp 0x377a
jmp 0x377a
jmp 0x377a
jmp 0x377a
jmp 0x377a
movq %rax, %rbx
leaq 0x1e8(%rsp), %rdi
callq 0x2418
jmp 0x377d
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x3d7e
movq %rsp, %rdi
callq 0x3810
leaq 0x128(%rsp), %rdi
callq 0x2418
leaq 0x168(%rsp), %rdi
callq 0x2418
leaq 0xa0(%rsp), %rdi
callq 0x2418
leaq 0x40(%rsp), %rdi
callq 0x2418
leaq 0x108(%rsp), %rdi
callq 0x2418
leaq 0xc0(%rsp), %rdi
callq 0x3942
leaq 0x188(%rsp), %rdi
callq 0x3942
leaq 0x148(%rsp), %rdi
callq 0x2418
leaq 0x60(%rsp), %rdi
callq 0x2418
movq %rbx, %rdi
callq 0x2380
nop