// File: /workspace/github_cpp_makefile_star2_O3/auton1[P]motiflocation/motiflocation.cpp
// Function: main
int main(int argc, char* argv[])
{
	int i;
	unsigned int ui;
	char filename1[255], outfilename[255];
	string startstr = "";
	string chrom_str = "";
	DNA SequenceSet1;
	bool f1 = false, f2 = false;
	int allowed_mutations = 0;
	bool chosen_chr = false;
	bool output_seqlen = false;
	bool uppercase_only = false, lowercase_only = false;
	bool KG_ref = false;

	for(i = 0; i < argc; i++)
	{
		if(*argv[i] == '-')
		{ 
			if((strcmp(argv[i], "-h") == 0) || (strcmp(argv[i], "-?") == 0) || (strcmp(argv[i], "-help") == 0)) 
			{
				print_help();
				exit (0);
			}
			if(strcmp(argv[i], "-file1") == 0) { strcpy(filename1 , argv[i+1]); f1 = true; }
			if(strcmp(argv[i], "-out") == 0) { strcpy(outfilename , argv[i+1]); f2 = true; }
			if(strcmp(argv[i], "-startstr") == 0) startstr = argv[i+1];
			if(strcmp(argv[i], "-chrom") == 0) {chrom_str = argv[i+1]; chosen_chr = true; }
			if(strcmp(argv[i], "-mutations") == 0) allowed_mutations = atoi(argv[i+1]);
			if(strcmp(argv[i], "-outputseqlen") == 0) output_seqlen = true;
			if(strcmp(argv[i], "-uppercase_only") == 0) uppercase_only = true;
			if(strcmp(argv[i], "-lowercase_only") == 0) lowercase_only = true;
			if(strcmp(argv[i], "-1000G_ref") == 0) KG_ref = true;
		}
	}

	if (chosen_chr == false)
	{
		chrom_str = "n.a";
	}

	if (!((f1 == true) && (f2 == true)))
	{
		cout << "Missing input parameter" << endl;
		print_help();
		exit(0);
	}

	
	std::transform(startstr.begin(), startstr.end(), startstr.begin(), ToLower());

	motif my_motif = motif(startstr);

	cout << "\nReading in Files" << endl;
	if ((strstr( filename1, ".fa" ) != NULL) || (strstr( filename1, ".fa.gz" ) != NULL))
	{
		cout << "File 1 Fasta file" << endl;
		if (chosen_chr == false)
			SequenceSet1.readFASTA(filename1, uppercase_only, lowercase_only, KG_ref);
		else
			SequenceSet1.readFASTA(filename1, chrom_str, uppercase_only, lowercase_only, KG_ref);
	}
	else
	{
		cout << "Appears to not be a fasta file? Should end in .fa" << endl;
		exit(0);
	}

	cout << "Finished reading files\n" << endl;
	for (unsigned int ui=0; ui<SequenceSet1.sequence.size(); ui++)
		cout << "Read " << SequenceSet1.sequence[ui].size() << " bases in " << SequenceSet1.header[ui] << endl;

	cout << "Searching for motif" << endl;
	vector<string> chroms;
	vector<int> positions;
	vector<int> seqnum;
	vector<string> revchroms;
	vector<int> reverse_positions;
	vector<int> revseqnum;

	for (unsigned int ui=0; ui<SequenceSet1.sequence.size(); ui++)
	{
		vector<int> tmp_positions;
		tmp_positions = my_motif.returnMotifLocations(SequenceSet1.sequence[ui].c_str(), my_motif.sequence.c_str(), allowed_mutations);
		vector<string> tmp_chroms(tmp_positions.size(), SequenceSet1.header[ui]);
		positions.insert( positions.end(), tmp_positions.begin(), tmp_positions.end() );
		chroms.insert(chroms.end(), tmp_chroms.begin(), tmp_chroms.end() );
		vector<int> tmp_seqnum(tmp_positions.size(), ui);
		seqnum.insert( seqnum.end(), tmp_seqnum.begin(), tmp_seqnum.end());
	}

	cout << "Searching for reverse complement" << endl;
	for (unsigned int ui=0; ui<SequenceSet1.sequence.size(); ui++)
	{
		vector<int> tmp_positions;
		tmp_positions = my_motif.returnMotifLocations(SequenceSet1.sequence[ui].c_str(), my_motif.complement.c_str(), allowed_mutations);
		vector<string> tmp_chroms(tmp_positions.size(), SequenceSet1.header[ui]);
		reverse_positions.insert( reverse_positions.end(), tmp_positions.begin(), tmp_positions.end() );
		revchroms.insert(revchroms.end(), tmp_chroms.begin(), tmp_chroms.end() );
		vector<int> tmp_seqnum(tmp_positions.size(), ui);
		revseqnum.insert( revseqnum.end(), tmp_seqnum.begin(), tmp_seqnum.end());
	}


	ofstream out_file;
	out_file.open(outfilename);
	//out_file << "chrom\tchromStart\tchromEnd\tstrand\tsequence" << endl;
	int plus = startstr.length();
	for (ui=0; ui < positions.size(); ui++)
	{
		out_file << chroms[ui] << "\t" << positions[ui] << "\t" << positions[ui] + plus << "\t+\t" << SequenceSet1.sequence[seqnum[ui]].substr(positions[ui], plus);
		if (output_seqlen == true)
			out_file << "\t" << SequenceSet1.sequence[seqnum[ui]].size();
		out_file << endl;
	}

	for (ui=0; ui < reverse_positions.size(); ui++)
	{
		out_file << revchroms[ui] << "\t" << reverse_positions[ui] << "\t" << reverse_positions[ui] + plus << "\t-\t" << SequenceSet1.sequence[revseqnum[ui]].substr(reverse_positions[ui], plus);
		if (output_seqlen == true)
			out_file << "\t" << SequenceSet1.sequence[revseqnum[ui]].size();
		out_file << endl;
	}
	out_file.close();
	
	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x668, %rsp            # imm = 0x668
movq %rsi, %r14
movl %edi, %ebx
leaq 0xa0(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x59ec(%rip), %r15      # 0x9181
leaq 0x90(%rsp), %rdi
movq %r15, %rsi
movq %r15, %rdx
callq 0x4b96
leaq 0x110(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x100(%rsp), %rdi
movq %r15, %rsi
movq %r15, %rdx
callq 0x4b96
leaq 0x160(%rsp), %rdi
callq 0x5e70
testl %ebx, %ebx
jle 0x3a2d
movl %ebx, %r15d
xorl %r12d, %r12d
movl $0x0, 0x4c(%rsp)
movq $0x0, 0xf8(%rsp)
movl $0x0, 0x20(%rsp)
movq $0x0, 0xf0(%rsp)
movl $0x0, 0x1c(%rsp)
movl $0x0, 0x10(%rsp)
xorl %r13d, %r13d
xorl %ebx, %ebx
movq %r15, 0x1b8(%rsp)
movq (%r14,%r12,8), %rbp
cmpb $0x2d, (%rbp)
jne 0x3a00
movl %ebx, 0x18(%rsp)
cmpb $0x68, 0x1(%rbp)
jne 0x3849
cmpb $0x0, 0x2(%rbp)
je 0x45b1
cmpb $0x3f, 0x1(%rbp)
jne 0x3859
cmpb $0x0, 0x2(%rbp)
je 0x45b1
movq %rbp, %rdi
leaq 0x57dd(%rip), %rsi      # 0x9040
callq 0x3330
testl %eax, %eax
je 0x45b1
movq %rbp, %rdi
leaq 0x57cc(%rip), %rsi      # 0x9046
callq 0x3330
testl %eax, %eax
jne 0x389b
movq 0x8(%r14,%r12,8), %rsi
leaq 0x460(%rsp), %rdi
callq 0x3230
movb $0x1, %al
movl %eax, 0x4c(%rsp)
movq %rbp, %rdi
leaq 0x57a8(%rip), %rsi      # 0x904d
callq 0x3330
testl %eax, %eax
jne 0x38ca
movq 0x8(%r14,%r12,8), %rsi
leaq 0x560(%rsp), %rdi
callq 0x3230
movb $0x1, %al
movq %rax, 0xf8(%rsp)
movq %rbp, %rdi
leaq 0x577e(%rip), %rsi      # 0x9052
callq 0x3330
testl %eax, %eax
jne 0x390e
movq 0x8(%r14,%r12,8), %rbx
movq 0x98(%rsp), %rbp
movq %rbx, %rdi
callq 0x3100
leaq 0x90(%rsp), %rdi
xorl %esi, %esi
movq %rbp, %rdx
movq %rbx, %rcx
movq %rax, %r8
callq 0x33f0
movq (%r14,%r12,8), %rbp
movq %rbp, %rdi
leaq 0x5744(%rip), %rsi      # 0x905c
callq 0x3330
testl %eax, %eax
jne 0x395c
movq 0x8(%r14,%r12,8), %rbx
movq 0x108(%rsp), %rbp
movq %rbx, %rdi
callq 0x3100
leaq 0x100(%rsp), %rdi
xorl %esi, %esi
movq %rbp, %rdx
movq %rbx, %rcx
movq %rax, %r8
callq 0x33f0
movq (%r14,%r12,8), %rbp
movb $0x1, %al
movq %rax, 0xf0(%rsp)
movl %r13d, %r15d
movq %rbp, %rdi
leaq 0x56fa(%rip), %rsi      # 0x9063
callq 0x3330
testl %eax, %eax
jne 0x3980
movq 0x8(%r14,%r12,8), %rdi
callq 0x3400
movl %eax, 0x20(%rsp)
movq %rbp, %rdi
leaq 0x56e4(%rip), %rsi      # 0x906e
callq 0x3330
testl %eax, %eax
movl 0x1c(%rsp), %eax
movzbl %al, %eax
movl $0x1, %ebx
cmovel %ebx, %eax
movl %eax, 0x1c(%rsp)
movq %rbp, %rdi
leaq 0x56ce(%rip), %rsi      # 0x907c
callq 0x3330
testl %eax, %eax
movl 0x10(%rsp), %eax
movzbl %al, %eax
cmovel %ebx, %eax
movl %eax, 0x10(%rsp)
movq %rbp, %rdi
leaq 0x56bf(%rip), %rsi      # 0x908c
callq 0x3330
movl $0x1, %r13d
testl %eax, %eax
je 0x39e0
movzbl %r15b, %r13d
movq %rbp, %rdi
leaq 0x56b2(%rip), %rsi      # 0x909c
callq 0x3330
testl %eax, %eax
je 0x39f8
movzbl 0x18(%rsp), %ebx
movq 0x1b8(%rsp), %r15
incq %r12
cmpq %r12, %r15
jne 0x3827
movl %r13d, 0x18(%rsp)
movl 0x4c(%rsp), %r14d
andb 0xf8(%rsp), %r14b
testb $0x1, 0xf0(%rsp)
jne 0x3a78
movl %ebx, %r13d
jmp 0x3a53
xorl %r14d, %r14d
movl $0x0, 0x20(%rsp)
movl $0x0, 0x1c(%rsp)
movl $0x0, 0x10(%rsp)
movl $0x0, 0x18(%rsp)
xorl %r13d, %r13d
movb $0x1, %bpl
leaq 0x100(%rsp), %rdi
movq 0x8(%rdi), %rdx
leaq 0x563e(%rip), %rcx      # 0x90a7
movl $0x3, %r8d
xorl %esi, %esi
callq 0x33f0
jmp 0x3a7d
movl %ebx, %r13d
xorl %ebp, %ebp
testb $0x1, %r14b
je 0x458d
movq 0x90(%rsp), %rbx
movq 0x98(%rsp), %r14
testq %r14, %r14
je 0x3ac7
xorl %r12d, %r12d
movsbl (%rbx,%r12), %edi
callq 0x3360
movb %al, (%rbx,%r12)
incq %r12
cmpq %r12, %r14
jne 0x3a9f
movq 0x90(%rsp), %rbx
movq 0x98(%rsp), %rdx
jmp 0x3ac9
xorl %edx, %edx
leaq 0x1d0(%rsp), %r14
movq %r14, -0x10(%r14)
addq %rbx, %rdx
leaq 0x1c0(%rsp), %rdi
movq %rbx, %rsi
callq 0x4b00
leaq 0x1e0(%rsp), %rdi
leaq 0x1c0(%rsp), %rsi
callq 0x57ac
movq 0x1c0(%rsp), %rdi
cmpq %r14, %rdi
je 0x3b1a
movq 0x1d0(%rsp), %rsi
incq %rsi
callq 0x3270
movq 0x94b7(%rip), %rbx      # 0xcfd8
leaq 0x559b(%rip), %rsi      # 0x90c3
movl $0x11, %edx
movq %rbx, %rdi
callq 0x32b0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x3240
movsbl %al, %esi
movq 0x9485(%rip), %rdi      # 0xcfd8
callq 0x3040
movq %rax, %rdi
callq 0x3190
leaq 0x55b5(%rip), %rsi      # 0x911c
leaq 0x460(%rsp), %rdi
callq 0x3070
testq %rax, %rax
jne 0x3b96
leaq 0x5555(%rip), %rsi      # 0x90d5
leaq 0x460(%rsp), %rdi
callq 0x3070
testq %rax, %rax
je 0x45bd
movq 0x943b(%rip), %rbx      # 0xcfd8
leaq 0x5538(%rip), %rsi      # 0x90dc
movl $0x11, %edx
movq %rbx, %rdi
callq 0x32b0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x3240
movsbl %al, %esi
movq 0x9409(%rip), %rdi      # 0xcfd8
callq 0x3040
movq %rax, %rdi
callq 0x3190
testb %bpl, %bpl
je 0x3c10
movzbl 0x10(%rsp), %edx
andl $0x1, %edx
movzbl 0x18(%rsp), %ecx
andl $0x1, %ecx
movzbl %r13b, %r8d
andl $0x1, %r8d
leaq 0x160(%rsp), %rdi
leaq 0x460(%rsp), %rsi
callq 0x6866
jmp 0x3c47
movzbl 0x10(%rsp), %ecx
andl $0x1, %ecx
movzbl 0x18(%rsp), %r8d
andl $0x1, %r8d
movzbl %r13b, %r9d
andl $0x1, %r9d
leaq 0x160(%rsp), %rdi
leaq 0x460(%rsp), %rsi
leaq 0x100(%rsp), %rdx
callq 0x607a
movq 0x938a(%rip), %rbx      # 0xcfd8
leaq 0x54cb(%rip), %rsi      # 0x9120
movl $0x17, %edx
movq %rbx, %rdi
callq 0x32b0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x3240
movsbl %al, %esi
movq 0x9358(%rip), %rdi      # 0xcfd8
callq 0x3040
movq %rax, %rdi
callq 0x3190
movq 0x170(%rsp), %rax
cmpq 0x168(%rsp), %rax
je 0x3d61
movl $0x1, %ebp
xorl %r13d, %r13d
movq 0x9326(%rip), %rbx      # 0xcfd8
leaq 0x547f(%rip), %r14      # 0x9138
leaq 0x547e(%rip), %r15      # 0x913e
movl $0x5, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x32b0
movq 0x168(%rsp), %rax
shlq $0x5, %r13
movq 0x8(%rax,%r13), %rsi
movq %rbx, %rdi
callq 0x3180
movq %rax, %r12
movl $0xa, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x32b0
movq 0x180(%rsp), %rax
movq (%rax,%r13), %rsi
movq 0x8(%rax,%r13), %rdx
movq %r12, %rdi
callq 0x32b0
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x3240
movsbl %al, %esi
movq %r12, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3190
movq 0x170(%rsp), %rax
subq 0x168(%rsp), %rax
movl %ebp, %r13d
sarq $0x5, %rax
incl %ebp
cmpq %r13, %rax
ja 0x3cc0
movq 0x9270(%rip), %rbx      # 0xcfd8
leaq 0x53da(%rip), %rsi      # 0x9149
movl $0x13, %edx
movq %rbx, %rdi
callq 0x32b0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x3240
movsbl %al, %esi
movq 0x923e(%rip), %rdi      # 0xcfd8
callq 0x3040
movq %rax, %rdi
callq 0x3190
xorps %xmm0, %xmm0
movaps %xmm0, 0x140(%rsp)
xorl %r12d, %r12d
movq %r12, 0x150(%rsp)
movq %r12, 0x80(%rsp)
movaps %xmm0, 0x70(%rsp)
movq %r12, 0xe0(%rsp)
movaps %xmm0, 0xd0(%rsp)
movq %r12, 0x130(%rsp)
movaps %xmm0, 0x120(%rsp)
movq %r12, 0x60(%rsp)
movaps %xmm0, 0x50(%rsp)
movq %r12, 0xc0(%rsp)
movaps %xmm0, 0xb0(%rsp)
movq 0x168(%rsp), %rax
cmpq %rax, 0x170(%rsp)
je 0x3f5b
leaq 0x260(%rsp), %r15
xorl %ebx, %ebx
shlq $0x5, %rbx
movq (%rax,%rbx), %rdx
movq 0x1e8(%rsp), %rcx
movq %r15, %rdi
leaq 0x1e0(%rsp), %rsi
movl 0x20(%rsp), %r8d
callq 0x5aa4
movq %r15, %rdi
movq 0x260(%rsp), %r14
movq 0x268(%rsp), %rbp
movq 0x270(%rsp), %rax
movq %rax, 0x10(%rsp)
movq %rbp, %r13
subq %r14, %r13
sarq $0x2, %r13
addq 0x180(%rsp), %rbx
movq %r13, %rsi
movq %rbx, %rdx
leaq 0x28(%rsp), %rbx
movq %rbx, %rcx
callq 0x4886
movq 0x78(%rsp), %rsi
leaq 0x70(%rsp), %rdi
movq %r14, %rdx
movq %rbp, %rcx
callq 0x4d06
movq 0x148(%rsp), %rsi
movq 0x260(%rsp), %rdx
movq 0x268(%rsp), %rcx
leaq 0x140(%rsp), %rdi
callq 0x4f22
movl %r12d, 0x48(%rsp)
movq %rbx, %rdi
movq %r13, %rsi
leaq 0x48(%rsp), %rdx
leaq 0xf(%rsp), %rcx
callq 0x491a
movq 0xd8(%rsp), %rsi
movq 0x28(%rsp), %rdx
movq 0x30(%rsp), %rcx
leaq 0xd0(%rsp), %rdi
callq 0x4d06
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x3f18
movq 0x38(%rsp), %rsi
subq %rdi, %rsi
callq 0x3270
movq %r15, %rdi
callq 0x4a96
testq %r14, %r14
je 0x3f35
movq 0x10(%rsp), %rsi
subq %r14, %rsi
movq %r14, %rdi
callq 0x3270
incl %r12d
movq 0x168(%rsp), %rax
movq 0x170(%rsp), %rcx
subq %rax, %rcx
sarq $0x5, %rcx
movq %r12, %rbx
cmpq %r12, %rcx
ja 0x3e24
movq 0x9076(%rip), %rbx      # 0xcfd8
leaq 0x51f4(%rip), %rsi      # 0x915d
movl $0x20, %edx
movq %rbx, %rdi
callq 0x32b0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x3240
movsbl %al, %esi
movq 0x9044(%rip), %rdi      # 0xcfd8
callq 0x3040
movq %rax, %rdi
callq 0x3190
movq 0x168(%rsp), %rax
cmpq %rax, 0x170(%rsp)
je 0x40fc
xorl %r13d, %r13d
leaq 0x260(%rsp), %r15
xorl %r12d, %r12d
shlq $0x5, %r13
movq (%rax,%r13), %rdx
movq 0x208(%rsp), %rcx
movq %r15, %rdi
leaq 0x1e0(%rsp), %rsi
movl 0x20(%rsp), %r8d
callq 0x5aa4
movq %r15, %rdi
movq 0x260(%rsp), %r14
movq 0x268(%rsp), %rbp
movq 0x270(%rsp), %rax
movq %rax, 0x10(%rsp)
movq %rbp, %rbx
subq %r14, %rbx
sarq $0x2, %rbx
addq 0x180(%rsp), %r13
movq %rbx, %rsi
movq %r13, %rdx
leaq 0x28(%rsp), %r13
movq %r13, %rcx
callq 0x4886
movq 0x58(%rsp), %rsi
leaq 0x50(%rsp), %rdi
movq %r14, %rdx
movq %rbp, %rcx
callq 0x4d06
movq 0x128(%rsp), %rsi
movq 0x260(%rsp), %rdx
movq 0x268(%rsp), %rcx
leaq 0x120(%rsp), %rdi
callq 0x4f22
movl %r12d, 0x48(%rsp)
movq %r13, %rdi
movq %rbx, %rsi
leaq 0x48(%rsp), %rdx
leaq 0xf(%rsp), %rcx
callq 0x491a
movq 0xb8(%rsp), %rsi
movq 0x28(%rsp), %rdx
movq 0x30(%rsp), %rcx
leaq 0xb0(%rsp), %rdi
callq 0x4d06
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x40b9
movq 0x38(%rsp), %rsi
subq %rdi, %rsi
callq 0x3270
movq %r15, %rdi
callq 0x4a96
testq %r14, %r14
je 0x40d6
movq 0x10(%rsp), %rsi
subq %r14, %rsi
movq %r14, %rdi
callq 0x3270
incl %r12d
movq 0x168(%rsp), %rax
movq 0x170(%rsp), %rcx
subq %rax, %rcx
sarq $0x5, %rcx
movq %r12, %r13
cmpq %r12, %rcx
ja 0x3fc5
leaq 0x260(%rsp), %rdi
callq 0x3490
leaq 0x260(%rsp), %rbx
leaq 0x560(%rsp), %rsi
movq %rbx, %rdi
movl $0x10, %edx
callq 0x3060
movq 0x98(%rsp), %r12
movq 0x78(%rsp), %rax
cmpq 0x70(%rsp), %rax
je 0x42bb
movslq %r12d, %rax
movq %rax, 0x20(%rsp)
movl $0x1, %r13d
xorl %r14d, %r14d
leaq 0x502a(%rip), %r15      # 0x9180
movq 0x140(%rsp), %rax
movq %r14, %rcx
shlq $0x5, %rcx
movq (%rax,%rcx), %rsi
movq 0x8(%rax,%rcx), %rdx
movq %rbx, %rdi
callq 0x32b0
movq %rax, %rbp
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x32b0
movq 0x70(%rsp), %rax
movl (%rax,%r14,4), %esi
movq %rbp, %rdi
callq 0x34a0
movq %rax, %rbp
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x32b0
movq 0x70(%rsp), %rax
movl (%rax,%r14,4), %esi
addl %r12d, %esi
movq %rbp, %rdi
callq 0x34a0
movq %rax, %rbp
movl $0x3, %edx
movq %rax, %rdi
leaq 0x4fab(%rip), %rsi      # 0x917e
callq 0x32b0
movq 0xd0(%rsp), %rax
movslq (%rax,%r14,4), %rsi
shlq $0x5, %rsi
addq 0x168(%rsp), %rsi
movq 0x70(%rsp), %rax
movslq (%rax,%r14,4), %rdx
leaq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rcx
callq 0x3290
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq %rbp, %rdi
callq 0x32b0
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x4236
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3270
testb $0x1, 0x1c(%rsp)
je 0x4272
movl $0x1, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x32b0
movq 0xd0(%rsp), %rax
movslq (%rax,%r14,4), %rax
movq 0x168(%rsp), %rcx
shlq $0x5, %rax
movq 0x8(%rcx,%rax), %rsi
movq %rbx, %rdi
callq 0x3180
movq 0x260(%rsp), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3240
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3190
movq 0x78(%rsp), %rax
subq 0x70(%rsp), %rax
movl %r13d, %r14d
sarq $0x2, %rax
incl %r13d
cmpq %r14, %rax
ja 0x4156
movq 0x58(%rsp), %rax
cmpq 0x50(%rsp), %rax
je 0x4448
movslq %r12d, %rax
movq %rax, 0x20(%rsp)
movl $0x1, %r13d
xorl %r14d, %r14d
leaq 0x4e9d(%rip), %r15      # 0x9180
movq 0x120(%rsp), %rax
movq %r14, %rcx
shlq $0x5, %rcx
movq (%rax,%rcx), %rsi
movq 0x8(%rax,%rcx), %rdx
movq %rbx, %rdi
callq 0x32b0
movq %rax, %rbp
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x32b0
movq 0x50(%rsp), %rax
movl (%rax,%r14,4), %esi
movq %rbp, %rdi
callq 0x34a0
movq %rax, %rbp
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x32b0
movq 0x50(%rsp), %rax
movl (%rax,%r14,4), %esi
addl %r12d, %esi
movq %rbp, %rdi
callq 0x34a0
movq %rax, %rbp
movl $0x3, %edx
movq %rax, %rdi
leaq 0x4e22(%rip), %rsi      # 0x9182
callq 0x32b0
movq 0xb0(%rsp), %rax
movslq (%rax,%r14,4), %rsi
shlq $0x5, %rsi
addq 0x168(%rsp), %rsi
movq 0x50(%rsp), %rax
movslq (%rax,%r14,4), %rdx
leaq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rcx
callq 0x3290
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq %rbp, %rdi
callq 0x32b0
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x43c3
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3270
testb $0x1, 0x1c(%rsp)
je 0x43ff
movl $0x1, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x32b0
movq 0xb0(%rsp), %rax
movslq (%rax,%r14,4), %rax
movq 0x168(%rsp), %rcx
shlq $0x5, %rax
movq 0x8(%rcx,%rax), %rsi
movq %rbx, %rdi
callq 0x3180
movq 0x260(%rsp), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3240
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3190
movq 0x58(%rsp), %rax
subq 0x50(%rsp), %rax
movl %r13d, %r14d
sarq $0x2, %rax
incl %r13d
cmpq %r14, %rax
ja 0x42e3
leaq 0x260(%rsp), %rdi
callq 0x3350
movq 0x8b74(%rip), %rax      # 0xcfd0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x268(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x260(%rsp,%rcx)
callq 0x31f0
leaq 0x358(%rsp), %rdi
callq 0x30d0
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x44aa
movq 0xc0(%rsp), %rsi
subq %rdi, %rsi
callq 0x3270
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x44c1
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x3270
leaq 0x120(%rsp), %rdi
callq 0x4a96
movq 0xd0(%rsp), %rdi
testq %rdi, %rdi
je 0x44eb
movq 0xe0(%rsp), %rsi
subq %rdi, %rsi
callq 0x3270
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x4505
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x3270
leaq 0x140(%rsp), %rdi
callq 0x4a96
leaq 0x1e0(%rsp), %rdi
callq 0x5878
leaq 0x160(%rsp), %rdi
callq 0x6028
movq 0x100(%rsp), %rdi
leaq 0x110(%rsp), %rax
cmpq %rax, %rdi
je 0x4551
movq 0x110(%rsp), %rsi
incq %rsi
callq 0x3270
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x4576
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x3270
movl $0x1, %eax
addq $0x668, %rsp            # imm = 0x668
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8a44(%rip), %rdi      # 0xcfd8
leaq 0x4b10(%rip), %rsi      # 0x90ab
movl $0x17, %edx
callq 0x32b0
movq 0x8a2c(%rip), %rdi      # 0xcfd8
callq 0x3110
callq 0x47d3
xorl %edi, %edi
callq 0x32d0
movq 0x8a14(%rip), %rdi      # 0xcfd8
leaq 0x4b23(%rip), %rsi      # 0x90ee
movl $0x31, %edx
callq 0x32b0
movq 0x89fc(%rip), %rdi      # 0xcfd8
callq 0x3110
jmp 0x45b6
jmp 0x46d2
jmp 0x46d2
jmp 0x4677
movq %rax, %rbx
movq 0x1c0(%rsp), %rdi
cmpq %r14, %rdi
je 0x4774
movq 0x1d0(%rsp), %rsi
incq %rsi
callq 0x3270
jmp 0x4774
jmp 0x4631
movq %rax, %rbx
jmp 0x4781
movq %rax, %rbx
jmp 0x47a6
jmp 0x4631
jmp 0x4677
movq %rax, %rbx
jmp 0x4774
jmp 0x46c8
jmp 0x46d2
jmp 0x464a
jmp 0x46d2
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x46d5
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3270
jmp 0x46d5
jmp 0x4677
jmp 0x467c
jmp 0x4685
jmp 0x4685
jmp 0x4685
jmp 0x46ac
movq %rax, %rbx
jmp 0x46e2
movq %rax, %rbx
jmp 0x4695
jmp 0x4685
jmp 0x4685
movq %rax, %rbx
leaq 0x260(%rsp), %rdi
callq 0x4a96
testq %r14, %r14
je 0x46e2
movq 0x10(%rsp), %rsi
subq %r14, %rsi
movq %r14, %rdi
callq 0x3270
jmp 0x46e2
movq %rax, %rbx
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x4688
movq 0x38(%rsp), %rsi
subq %rdi, %rsi
callq 0x3270
jmp 0x4688
movq %rax, %rbx
jmp 0x4767
jmp 0x46d2
movq %rax, %rbx
leaq 0x260(%rsp), %rdi
callq 0x33a0
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x46ff
movq 0xc0(%rsp), %rsi
subq %rdi, %rsi
callq 0x3270
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x4716
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x3270
leaq 0x120(%rsp), %rdi
callq 0x4a96
movq 0xd0(%rsp), %rdi
testq %rdi, %rdi
je 0x4740
movq 0xe0(%rsp), %rsi
subq %rdi, %rsi
callq 0x3270
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x475a
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x3270
leaq 0x140(%rsp), %rdi
callq 0x4a96
leaq 0x1e0(%rsp), %rdi
callq 0x5878
leaq 0x160(%rsp), %rdi
callq 0x6028
movq 0x100(%rsp), %rdi
leaq 0x110(%rsp), %rax
cmpq %rax, %rdi
je 0x47a6
movq 0x110(%rsp), %rsi
incq %rsi
callq 0x3270
leaq 0xa0(%rsp), %rax
movq 0x90(%rsp), %rdi
cmpq %rax, %rdi
je 0x47cb
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x3270
movq %rbx, %rdi
callq 0x34d0