// File: /workspace/github_cpp_makefile_star2_O2/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, %r15d
leaq 0x4aa7(%rip), %rbx      # 0x8161
leaq 0x128(%rsp), %rdi
leaq 0x1e0(%rsp), %rdx
movq %rbx, %rsi
callq 0x437a
leaq 0x1a0(%rsp), %rdi
leaq 0x1e0(%rsp), %rdx
movq %rbx, %rsi
callq 0x437a
leaq 0x148(%rsp), %rdi
callq 0x55f4
xorl %ebx, %ebx
testl %r15d, %r15d
cmovlel %ebx, %r15d
movq $0x0, 0x18(%rsp)
xorl %r13d, %r13d
xorl %eax, %eax
movl $0x0, 0x8(%rsp)
movq $0x0, 0x58(%rsp)
movl $0x0, 0x10(%rsp)
movq $0x0, 0x68(%rsp)
movq $0x0, 0x60(%rsp)
movq %r15, 0x120(%rsp)
movzbl %al, %ebp
cmpq %rbx, %r15
je 0x38f4
movq (%r14,%rbx,8), %r12
cmpb $0x2d, (%r12)
jne 0x38ec
cmpb $0x68, 0x1(%r12)
jne 0x3770
cmpb $0x0, 0x2(%r12)
je 0x4167
cmpb $0x3f, 0x1(%r12)
jne 0x3784
cmpb $0x0, 0x2(%r12)
je 0x4167
movq %r12, %rdi
leaq 0x4892(%rip), %rsi      # 0x8020
callq 0x3330
testl %eax, %eax
je 0x4167
movq %r12, %rdi
leaq 0x4881(%rip), %rsi      # 0x8026
callq 0x3330
testl %eax, %eax
jne 0x37c7
movq 0x8(%r14,%rbx,8), %rsi
leaq 0x460(%rsp), %rdi
callq 0x3240
movb $0x1, %al
movq %rax, 0x60(%rsp)
movq %r12, %rdi
leaq 0x485c(%rip), %rsi      # 0x802d
callq 0x3330
testl %eax, %eax
jne 0x37f3
movq 0x8(%r14,%rbx,8), %rsi
leaq 0x560(%rsp), %rdi
callq 0x3240
movb $0x1, %al
movq %rax, 0x68(%rsp)
movq %r12, %rdi
leaq 0x4835(%rip), %rsi      # 0x8032
callq 0x3330
testl %eax, %eax
jne 0x381c
movq 0x8(%r14,%rbx,8), %rsi
leaq 0x128(%rsp), %rdi
callq 0x34c0
movq (%r14,%rbx,8), %r12
movq %r12, %rdi
leaq 0x4816(%rip), %rsi      # 0x803c
callq 0x3330
testl %eax, %eax
jne 0x384c
movq 0x8(%r14,%rbx,8), %rsi
leaq 0x1a0(%rsp), %rdi
callq 0x34c0
movq (%r14,%rbx,8), %r12
movb $0x1, %al
movq %rax, 0x58(%rsp)
movq %r13, %r15
movq %r12, %rdi
leaq 0x47ea(%rip), %rsi      # 0x8043
callq 0x3330
testl %eax, %eax
jne 0x3870
movq 0x8(%r14,%rbx,8), %rdi
callq 0x33c0
movl %eax, 0x10(%rsp)
movq %r12, %rdi
leaq 0x47d4(%rip), %rsi      # 0x804e
callq 0x3330
testl %eax, %eax
movl 0x8(%rsp), %eax
movzbl %al, %eax
pushq $0x1
popq %r13
cmovel %r13d, %eax
movl %eax, 0x8(%rsp)
movq %r12, %rdi
leaq 0x47be(%rip), %rsi      # 0x805c
callq 0x3330
testl %eax, %eax
cmovel %r13d, %ebp
movq %r12, %rdi
leaq 0x47b9(%rip), %rsi      # 0x806c
callq 0x3330
testl %eax, %eax
je 0x38c0
movzbl %r15b, %r13d
movq %r12, %rdi
leaq 0x47b2(%rip), %rsi      # 0x807c
callq 0x3330
pushq $0x1
popq %rcx
testl %eax, %eax
je 0x38db
movzbl 0x18(%rsp), %ecx
movl %ecx, %eax
movq %rax, 0x18(%rsp)
movl %ebp, %eax
movq 0x120(%rsp), %r15
incq %rbx
jmp 0x3741
movq 0x58(%rsp), %rbx
testb $0x1, %bl
jne 0x3912
leaq 0x4782(%rip), %rsi      # 0x8087
leaq 0x1a0(%rsp), %rdi
callq 0x34c0
movq 0x60(%rsp), %rax
andb 0x68(%rsp), %al
testb $0x1, %al
je 0x414c
movq 0x128(%rsp), %rdi
movq 0x130(%rsp), %rsi
addq %rdi, %rsi
movq %rdi, %rdx
callq 0x43b5
leaq 0x1c0(%rsp), %rdi
leaq 0x128(%rsp), %rsi
callq 0x3300
leaq 0x3e0(%rsp), %rdi
leaq 0x1c0(%rsp), %rsi
callq 0x5086
leaq 0x1c0(%rsp), %rdi
callq 0x3110
movq 0x865c(%rip), %rdi      # 0xbfd8
leaq 0x4720(%rip), %rsi      # 0x80a3
callq 0x3250
movq %rax, %rdi
callq 0x3120
leaq 0x4765(%rip), %rsi      # 0x80fc
leaq 0x460(%rsp), %rdi
callq 0x3060
testq %rax, %rax
jne 0x39c6
leaq 0x4705(%rip), %rsi      # 0x80b5
leaq 0x460(%rsp), %rdi
callq 0x3060
testq %rax, %rax
je 0x4173
movq 0x860b(%rip), %rdi      # 0xbfd8
leaq 0x46e8(%rip), %rsi      # 0x80bc
callq 0x3250
movq %rax, %rdi
callq 0x3120
testb $0x1, %bl
jne 0x3a13
andl $0x1, %ebp
movzbl %r13b, %ecx
andl $0x1, %ecx
movzbl 0x18(%rsp), %r8d
andl $0x1, %r8d
leaq 0x148(%rsp), %rdi
leaq 0x460(%rsp), %rsi
movl %ebp, %edx
callq 0x5c82
jmp 0x3a47
andl $0x1, %ebp
movzbl %r13b, %r8d
andl $0x1, %r8d
movzbl 0x18(%rsp), %r9d
andl $0x1, %r9d
leaq 0x148(%rsp), %rdi
leaq 0x460(%rsp), %rsi
leaq 0x1a0(%rsp), %rdx
movl %ebp, %ecx
callq 0x5770
movq 0x858a(%rip), %rdi      # 0xbfd8
leaq 0x46ab(%rip), %rsi      # 0x8100
callq 0x3250
movq %rax, %rdi
callq 0x3120
xorl %r13d, %r13d
movq 0x856c(%rip), %rbx      # 0xbfd8
leaq 0x46a5(%rip), %r14      # 0x8118
leaq 0x46a4(%rip), %r15      # 0x811e
movl %r13d, %r13d
movq 0x158(%rsp), %rax
subq 0x150(%rsp), %rax
sarq $0x5, %rax
cmpq %r13, %rax
jbe 0x3ae8
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3250
movq 0x150(%rsp), %rcx
movq %r13, %r12
shlq $0x5, %r12
movq 0x8(%rcx,%r12), %rsi
movq %rax, %rdi
callq 0x31b0
movq %rax, %rdi
movq %r15, %rsi
callq 0x3250
addq 0x168(%rsp), %r12
movq %rax, %rdi
movq %r12, %rsi
callq 0x3220
movq %rax, %rdi
callq 0x3120
incl %r13d
jmp 0x3a7a
movq 0x84e9(%rip), %rdi      # 0xbfd8
leaq 0x4633(%rip), %rsi      # 0x8129
callq 0x3250
movq %rax, %rdi
callq 0x3120
xorps %xmm0, %xmm0
leaq 0x100(%rsp), %rax
movaps %xmm0, (%rax)
andq $0x0, 0x10(%rax)
leaq 0x40(%rsp), %rax
movaps %xmm0, (%rax)
andq $0x0, 0x10(%rax)
leaq 0xe0(%rsp), %rax
andq $0x0, 0x10(%rax)
movaps %xmm0, (%rax)
andq $0x0, 0xd0(%rsp)
movaps %xmm0, 0xc0(%rsp)
andq $0x0, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
andq $0x0, 0xa0(%rsp)
movaps %xmm0, 0x90(%rsp)
xorl %r15d, %r15d
leaq 0x70(%rsp), %r13
leaq 0x1e0(%rsp), %rbx
leaq 0xa8(%rsp), %r14
leaq 0x7(%rsp), %r12
movl %r15d, %ebp
movq 0x150(%rsp), %rax
movq 0x158(%rsp), %rcx
subq %rax, %rcx
sarq $0x5, %rcx
cmpq %rbp, %rcx
jbe 0x3cc2
andq $0x0, 0x1f0(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x1e0(%rsp)
shlq $0x5, %rbp
movq (%rax,%rbp), %rdx
movq 0x3e8(%rsp), %rcx
movq %r13, %rdi
leaq 0x3e0(%rsp), %rsi
movl 0x10(%rsp), %r8d
callq 0x52de
movq %rbx, %rdi
movq %r13, %rsi
callq 0x4620
movq %r13, %rdi
callq 0x45ec
movq 0x1e8(%rsp), %rsi
subq 0x1e0(%rsp), %rsi
sarq $0x2, %rsi
addq 0x168(%rsp), %rbp
movq %r13, %rdi
movq %rbp, %rdx
movq %r14, %rcx
callq 0x43e4
movq 0x48(%rsp), %rsi
movq 0x1e0(%rsp), %rdx
movq 0x1e8(%rsp), %rcx
leaq 0x40(%rsp), %rdi
callq 0x443a
movq 0x108(%rsp), %rsi
movq 0x70(%rsp), %rdx
movq 0x78(%rsp), %rcx
leaq 0x100(%rsp), %rdi
callq 0x445a
movq 0x1e8(%rsp), %rsi
subq 0x1e0(%rsp), %rsi
sarq $0x2, %rsi
movl %r15d, 0xc(%rsp)
movq %r14, %rdi
leaq 0xc(%rsp), %rdx
movq %r12, %rcx
callq 0x447a
movq 0xe8(%rsp), %rsi
movq 0xa8(%rsp), %rdx
movq 0xb0(%rsp), %rcx
leaq 0xe0(%rsp), %rdi
callq 0x443a
movq %r14, %rdi
callq 0x45ec
movq %r13, %rdi
callq 0x44d0
movq %rbx, %rdi
callq 0x45ec
incl %r15d
jmp 0x3b7d
movq 0x830f(%rip), %rdi      # 0xbfd8
leaq 0x446d(%rip), %rsi      # 0x813d
callq 0x3250
movq %rax, %rdi
callq 0x3120
xorl %ebp, %ebp
leaq 0x70(%rsp), %r14
leaq 0x1e0(%rsp), %r12
leaq 0xa8(%rsp), %r13
leaq 0x90(%rsp), %rbx
movl %ebp, %r15d
movq 0x150(%rsp), %rax
movq 0x158(%rsp), %rcx
subq %rax, %rcx
sarq $0x5, %rcx
cmpq %r15, %rcx
jbe 0x3e3c
andq $0x0, 0x1f0(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x1e0(%rsp)
shlq $0x5, %r15
movq (%rax,%r15), %rdx
movq 0x408(%rsp), %rcx
movq %r14, %rdi
leaq 0x3e0(%rsp), %rsi
movl 0x10(%rsp), %r8d
callq 0x52de
movq %r12, %rdi
movq %r14, %rsi
callq 0x4620
movq %r14, %rdi
callq 0x45ec
movq 0x1e8(%rsp), %rsi
subq 0x1e0(%rsp), %rsi
sarq $0x2, %rsi
addq 0x168(%rsp), %r15
movq %r14, %rdi
movq %r15, %rdx
movq %r13, %rcx
callq 0x43e4
movq 0x28(%rsp), %rsi
movq 0x1e0(%rsp), %rdx
movq 0x1e8(%rsp), %rcx
leaq 0x20(%rsp), %rdi
callq 0x443a
movq 0xc8(%rsp), %rsi
movq 0x70(%rsp), %rdx
movq 0x78(%rsp), %rcx
leaq 0xc0(%rsp), %rdi
callq 0x445a
movq 0x1e8(%rsp), %rsi
subq 0x1e0(%rsp), %rsi
sarq $0x2, %rsi
movl %ebp, 0xc(%rsp)
movq %r13, %rdi
leaq 0xc(%rsp), %rdx
leaq 0x7(%rsp), %rcx
callq 0x447a
movq 0x98(%rsp), %rsi
movq 0xa8(%rsp), %rdx
movq 0xb0(%rsp), %rcx
movq %rbx, %rdi
callq 0x443a
movq %r13, %rdi
callq 0x45ec
movq %r14, %rdi
callq 0x44d0
movq %r12, %rdi
callq 0x45ec
incl %ebp
jmp 0x3cfc
leaq 0x1e0(%rsp), %rdi
callq 0x3430
leaq 0x1e0(%rsp), %rdi
leaq 0x560(%rsp), %rsi
pushq $0x10
popq %rdx
callq 0x3050
movq 0x130(%rsp), %r12
movslq %r12d, %rax
movq %rax, 0x10(%rsp)
xorl %ebx, %ebx
leaq 0x1e0(%rsp), %r14
leaq 0x42de(%rip), %r15      # 0x8160
leaq 0x70(%rsp), %r13
movl %ebx, %ebx
movq 0x48(%rsp), %rax
subq 0x40(%rsp), %rax
sarq $0x2, %rax
cmpq %rbx, %rax
jbe 0x3f89
movq %rbx, %rsi
shlq $0x5, %rsi
addq 0x100(%rsp), %rsi
movq %r14, %rdi
callq 0x3220
movq %rax, %rdi
movq %r15, %rsi
callq 0x3250
movq 0x40(%rsp), %rcx
movl (%rcx,%rbx,4), %esi
movq %rax, %rdi
callq 0x3440
movq %rax, %rdi
movq %r15, %rsi
callq 0x3250
movq 0x40(%rsp), %rcx
movl (%rcx,%rbx,4), %esi
addl %r12d, %esi
movq %rax, %rdi
callq 0x3440
movq %rax, %rdi
leaq 0x4264(%rip), %rsi      # 0x815e
callq 0x3250
movq %rax, %rbp
movq 0xe0(%rsp), %rax
movslq (%rax,%rbx,4), %rsi
shlq $0x5, %rsi
addq 0x150(%rsp), %rsi
movq 0x40(%rsp), %rax
movslq (%rax,%rbx,4), %rdx
movq %r13, %rdi
movq 0x10(%rsp), %rcx
callq 0x3280
movq %rbp, %rdi
movq %r13, %rsi
callq 0x3220
movq %r13, %rdi
callq 0x3110
testb $0x1, 0x8(%rsp)
je 0x3f7a
movq %r14, %rdi
movq %r15, %rsi
callq 0x3250
movq 0xe0(%rsp), %rcx
movslq (%rcx,%rbx,4), %rcx
movq 0x150(%rsp), %rdx
shlq $0x5, %rcx
movq 0x8(%rdx,%rcx), %rsi
movq %rax, %rdi
callq 0x31b0
movq %r14, %rdi
callq 0x3120
incl %ebx
jmp 0x3e87
xorl %ebx, %ebx
leaq 0x1e0(%rsp), %r14
leaq 0x41c6(%rip), %r15      # 0x8160
leaq 0x70(%rsp), %r13
movl %ebx, %ebx
movq 0x28(%rsp), %rax
subq 0x20(%rsp), %rax
sarq $0x2, %rax
cmpq %rbx, %rax
jbe 0x40a1
movq %rbx, %rsi
shlq $0x5, %rsi
addq 0xc0(%rsp), %rsi
movq %r14, %rdi
callq 0x3220
movq %rax, %rdi
movq %r15, %rsi
callq 0x3250
movq 0x20(%rsp), %rcx
movl (%rcx,%rbx,4), %esi
movq %rax, %rdi
callq 0x3440
movq %rax, %rdi
movq %r15, %rsi
callq 0x3250
movq 0x20(%rsp), %rcx
movl (%rcx,%rbx,4), %esi
addl %r12d, %esi
movq %rax, %rdi
callq 0x3440
movq %rax, %rdi
leaq 0x4150(%rip), %rsi      # 0x8162
callq 0x3250
movq %rax, %rbp
movq 0x90(%rsp), %rax
movslq (%rax,%rbx,4), %rsi
shlq $0x5, %rsi
addq 0x150(%rsp), %rsi
movq 0x20(%rsp), %rax
movslq (%rax,%rbx,4), %rdx
movq %r13, %rdi
movq 0x10(%rsp), %rcx
callq 0x3280
movq %rbp, %rdi
movq %r13, %rsi
callq 0x3220
movq %r13, %rdi
callq 0x3110
testb $0x1, 0x8(%rsp)
je 0x4092
movq %r14, %rdi
movq %r15, %rsi
callq 0x3250
movq 0x90(%rsp), %rcx
movslq (%rcx,%rbx,4), %rcx
movq 0x150(%rsp), %rdx
shlq $0x5, %rcx
movq 0x8(%rdx,%rcx), %rsi
movq %rax, %rdi
callq 0x31b0
movq %r14, %rdi
callq 0x3120
incl %ebx
jmp 0x3f9f
leaq 0x1e0(%rsp), %rdi
callq 0x3340
leaq 0x1e0(%rsp), %rdi
callq 0x3390
leaq 0x90(%rsp), %rdi
callq 0x45ec
leaq 0x20(%rsp), %rdi
callq 0x45ec
leaq 0xc0(%rsp), %rdi
callq 0x44d0
leaq 0xe0(%rsp), %rdi
callq 0x45ec
leaq 0x40(%rsp), %rdi
callq 0x45ec
leaq 0x100(%rsp), %rdi
callq 0x44d0
leaq 0x3e0(%rsp), %rdi
callq 0x5108
leaq 0x148(%rsp), %rdi
callq 0x572c
leaq 0x1a0(%rsp), %rdi
callq 0x3110
leaq 0x128(%rsp), %rdi
callq 0x3110
pushq $0x1
popq %rax
addq $0x668, %rsp            # imm = 0x668
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x7e85(%rip), %rdi      # 0xbfd8
leaq 0x3f31(%rip), %rsi      # 0x808b
callq 0x3250
movq %rax, %rdi
callq 0x3120
callq 0x42c9
xorl %edi, %edi
callq 0x32a0
movq 0x7e5e(%rip), %rdi      # 0xbfd8
leaq 0x3f4d(%rip), %rsi      # 0x80ce
callq 0x3250
movq %rax, %rdi
callq 0x3120
jmp 0x416c
jmp 0x4235
jmp 0x4235
jmp 0x41c3
movq %rax, %rbx
leaq 0x1c0(%rsp), %rdi
callq 0x3110
jmp 0x429a
jmp 0x41cc
movq %rax, %rbx
jmp 0x42a7
movq %rax, %rbx
jmp 0x42b4
movq %rax, %rbx
jmp 0x4245
jmp 0x41cc
jmp 0x422e
movq %rax, %rbx
jmp 0x429a
jmp 0x41d8
jmp 0x4235
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x3110
jmp 0x4238
jmp 0x4235
jmp 0x421c
jmp 0x41f7
jmp 0x420d
jmp 0x420d
jmp 0x420d
jmp 0x421c
jmp 0x421c
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0x45ec
jmp 0x4210
jmp 0x420d
jmp 0x420d
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x44d0
jmp 0x421f
movq %rax, %rbx
leaq 0x1e0(%rsp), %rdi
callq 0x45ec
jmp 0x4245
movq %rax, %rbx
jmp 0x428d
jmp 0x4235
movq %rax, %rbx
leaq 0x1e0(%rsp), %rdi
callq 0x3390
leaq 0x90(%rsp), %rdi
callq 0x45ec
leaq 0x20(%rsp), %rdi
callq 0x45ec
leaq 0xc0(%rsp), %rdi
callq 0x44d0
leaq 0xe0(%rsp), %rdi
callq 0x45ec
leaq 0x40(%rsp), %rdi
callq 0x45ec
leaq 0x100(%rsp), %rdi
callq 0x44d0
leaq 0x3e0(%rsp), %rdi
callq 0x5108
leaq 0x148(%rsp), %rdi
callq 0x572c
leaq 0x1a0(%rsp), %rdi
callq 0x3110
leaq 0x128(%rsp), %rdi
callq 0x3110
movq %rbx, %rdi
callq 0x3470