// File: /workspace/github_cpp_makefile_star2_O1/auton1[P]viterbi/viterbi.cpp
// Function: main
int main(int argc, char *argv[])
{
	time_t start,end;
	time(&start);

	// The following turns off sync between C and C++ streams.
	// Apparently it's faster to turn sync off, and as I don't use C streams, it's okay to turn off.
	ios_base::sync_with_stdio(false);

	parameters params(argc, argv);
	params.print_help();
	params.read_parameters();
	params.max_alleles = 2;	// Only use biallelic sites

	LOG.open(params.stream_out, params.stream_err, params.output_prefix);
	LOG.printLOG("\nViterbi - " + VCFTOOLS_VERSION + "\n");
	LOG.printLOG("(C) Adam Auton 2014\n\n");

	params.print_params();

	vector<vector<bool> > input_haplotypes;
	vector<unsigned int> positions;
	vector<string> alleles;
	vector<string> haplotype_names;
	
	// Read input haplotypes from VCF
	for (unsigned int ui=0; ui<params.vcf_filenames.size(); ui++)
	{
		LOG.printLOG("Reading " + params.vcf_filenames[ui] + "\n");
		variant_file *vf;
		if (params.vcf_format[ui])
			vf = new vcf_file(params, params.vcf_filenames[ui], ui);
		else
			vf = new bcf_file(params, params.vcf_filenames[ui], ui);

		vf->apply_filters(params);
		LOG.printLOG("After filtering, kept " + output_log::int2str(vf->N_kept_individuals()) + " out of " + output_log::int2str(vf->meta_data.N_indv) + " Individuals\n");

		if (ui==0)
		{
			vf->read_file(params, input_haplotypes, positions, haplotype_names, alleles);
			LOG.printLOG("After filtering, kept " + header::int2str(positions.size()) + " out of a possible " + header::int2str(vf->N_total_sites()) + " Sites\n");
		}
		else
		{
			int passed_sites = vf->add_file(params, input_haplotypes, positions, haplotype_names, alleles);
			LOG.printLOG("After filtering, kept " + header::int2str(passed_sites) + " out of a possible " + header::int2str(vf->N_total_sites()) + " Sites\n");
		}

		if (vf->N_total_sites() <= 0)
			LOG.warning("File does not contain any sites");
		else if (vf->N_kept_sites() <= 0)
			LOG.warning("No data left for analysis!");
		delete vf;
	}
	
	vector<vector<bool> > new_haplotypes;
	vector<unsigned int> new_positions;
	new_haplotypes.resize(haplotype_names.size());
	
	for (unsigned int ui=0; ui<positions.size(); ui++)
	{
		int allele_count = 0;
		for (unsigned int uj=0; uj<haplotype_names.size(); uj++)
			if (input_haplotypes[uj][ui])
				allele_count++;

		if (allele_count > 1 && allele_count < (haplotype_names.size()-1))
		{
			new_positions.push_back(positions[ui]);

			for (unsigned int uj=0; uj<haplotype_names.size(); uj++)
				new_haplotypes[uj].push_back(input_haplotypes[uj][ui]);
		}
		else
			LOG.one_off_warning("\tWarning: Skipping singletons.");
	}
	
	positions = new_positions;
	input_haplotypes = new_haplotypes;

	if (params.vcf_filenames.size() > 1)
		LOG.printLOG("Kept "+ header::int2str(positions.size()) + " sites that are contained in all files\n");
	if (positions.size() == 0)
		LOG.error("No data left for analysis!");
	
	string CHROM = *(params.chrs_to_keep.begin());

	vector<int> alt_allele_counts;
	alt_allele_counts.resize(input_haplotypes[0].size(), 0);
	for (unsigned int uj=0; uj<input_haplotypes[0].size(); uj++)
	{
		for (unsigned int uk=0; uk<input_haplotypes.size(); uk++)
			alt_allele_counts[uj] += input_haplotypes[uk][uj];
//		cout << positions[uj] << " " << alt_allele_counts[uj] << endl;
	}

	vector<double> map;
	if (params.map_filename == "")
	{
		set_genetic_map_at_positions(positions, params.recomb_rate, map);
	}
	else
	{
		read_genetic_map_at_positions(params.map_filename, positions, map);
	}

	if (params.run_viterbi == true)
	{
		cout << "#HAP\tCOPY\tCHR\tSTART\tEND\tN_SNPS\tMIN_ALLELE_COUNT\tMIN_ALLELE_POS\tEXACT_HAP_COUNT\tHAP_COUNT_1_PRCT_MISMATCH" << endl;
		for (int i=0; i<input_haplotypes.size(); i++)
		{
			string indv = haplotype_names[i].substr(0, haplotype_names[i].size()-2);
			if ((params.viterbi_indv.size() > 0) && (params.viterbi_indv.find(indv) == params.viterbi_indv.end()))
			{
				continue;
			}

			LOG.printLOG("Running Viterbi on " + haplotype_names[i] + "\n");
			vector<int> viterbi_path;
			viterbi(input_haplotypes, map, i, params, viterbi_path);

			// Process the viterbi path
			int N_exact_match;
			int N_one_prct_mismatch;
			int min_pos = positions[0];
			int max_pos = positions[0];
			int start_idx = 0;
			int current_haplotype = viterbi_path[0];
			int N_SNPs = 1;
			int min_freq = numeric_limits<int>::max();
			int min_freq_idx = 0;
			if (input_haplotypes[i][0] == 1)
				min_freq = alt_allele_counts[0];
			else
				min_freq = (int)input_haplotypes.size() - alt_allele_counts[0];

			for (int j=1; j<viterbi_path.size(); j++)
			{
				if (viterbi_path[j] != current_haplotype)
				{	// Output haplotype

					// Get haplotype frequency
					get_haplotype_count(input_haplotypes, i, start_idx, j-1, N_exact_match, N_one_prct_mismatch);

					cout << haplotype_names[i] << "\t" << haplotype_names[current_haplotype];
					cout << "\t" << CHROM;
					cout << "\t" << min_pos << "\t" << max_pos << "\t" << N_SNPs;
					cout << "\t" << min_freq << "\t" << positions[min_freq_idx];
					cout << "\t" << N_exact_match << "\t" << N_one_prct_mismatch << endl;
					// Reset
					min_pos = positions[j];	// Haplotype is left shifted
					max_pos = positions[j];
					start_idx = j;
					current_haplotype = viterbi_path[j];
					N_SNPs = 1;
					min_freq = numeric_limits<int>::max();
					min_freq_idx = j;
					if (input_haplotypes[i][j] == 1)
						min_freq = alt_allele_counts[j];
					else
						min_freq = (int)input_haplotypes.size() - alt_allele_counts[j];
				}
				else
				{
					max_pos = positions[j];
					N_SNPs++;
					if (input_haplotypes[i][j] == 1)
					{
						if (alt_allele_counts[j] < min_freq)
						{
							min_freq = alt_allele_counts[j];
							min_freq_idx = j;
						}
					}
					else
					{
						if (((int)input_haplotypes.size() - alt_allele_counts[j]) < min_freq)
						{
							min_freq = (int)input_haplotypes.size() - alt_allele_counts[j];
							min_freq_idx = j;
						}
					}

				}
			}
			// Output last haplotype
			get_haplotype_count(input_haplotypes, i, start_idx, viterbi_path.size()-1, N_exact_match, N_one_prct_mismatch);
			cout << haplotype_names[i] << "\t" << haplotype_names[viterbi_path[viterbi_path.size()-1]];
			cout << "\t" << CHROM;
			cout << "\t" << min_pos << "\t" << max_pos << "\t" << N_SNPs;
			cout << "\t" << min_freq << "\t" << positions[min_freq_idx];
			cout << "\t" << N_exact_match << "\t" << N_one_prct_mismatch << endl;
		}
	}
	else
	{
		cout << "#HAP\tCOPY\tCHR\tPOS\tPROB" << endl;
		for (int i=0; i<input_haplotypes.size(); i++)
		{
			string indv = haplotype_names[i].substr(0, haplotype_names[i].size()-2);
			if ((params.viterbi_indv.size() > 0) && (params.viterbi_indv.find(indv) == params.viterbi_indv.end()))
			{
				continue;
			}

			LOG.printLOG("Running Forward-backward on " + haplotype_names[i] + "\n");
			vector<int> post_path;
			vector<double> post_prob;
			fwdbck(input_haplotypes, map, i, params, post_path, post_prob);

			for (int j=0; j<positions.size(); j++)
			{
				cout << haplotype_names[i] << "\t" << haplotype_names[post_path[j]];
				cout << "\t" << CHROM << "\t" << positions[j] << "\t" << post_prob[j];
				cout << endl;
			}
		}
	}

	time(&end);
	double running_time = difftime(end,start);
	LOG.printLOG("Run Time = " + output_log::dbl2str_fixed(running_time, 2) + " seconds\n");
	LOG.close();
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x8c8, %rsp            # imm = 0x8C8
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x268(%rsp), %rdi
callq 0x5400
xorl %edi, %edi
callq 0x5170
leaq 0x378(%rsp), %r14
movq %r14, %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x2f57c
movq %r14, %rdi
callq 0x36ca4
leaq 0x378(%rsp), %rdi
callq 0x3006e
leaq 0x608(%rsp), %rcx
movl $0x2, -0x88(%rcx)
movzbl 0x1a5(%rcx), %esi
movzbl 0x1a4(%rcx), %edx
leaq 0x40f0d(%rip), %rdi     # 0x4a4a8
callq 0x37124
leaq 0x2fb8f(%rip), %rsi     # 0x39136
leaq 0x40eda(%rip), %rdx     # 0x4a488
movq %rsp, %rdi
callq 0xb7dd
leaq 0x2fb99(%rip), %rsi     # 0x39156
movq %rsp, %rdi
callq 0x5870
leaq 0x300(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x95f5
movq %rdx, 0x2f0(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x300(%rsp)
jmp 0x95fc
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
leaq 0x2f0(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x40e86(%rip), %rdi     # 0x4a4a8
callq 0x371c8
movq 0x2f0(%rsp), %rdi
cmpq %r14, %rdi
je 0x9639
callq 0x5410
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x964c
callq 0x5410
leaq 0x360(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x2fae3(%rip), %rsi     # 0x39142
leaq 0x2faf1(%rip), %rdx     # 0x39157
leaq 0x350(%rsp), %rdi
callq 0xc868
leaq 0x40e2e(%rip), %rdi     # 0x4a4a8
leaq 0x350(%rsp), %rsi
callq 0x371c8
movq 0x350(%rsp), %rdi
cmpq %r14, %rdi
je 0x9699
callq 0x5410
leaq 0x378(%rsp), %rdi
callq 0x32208
xorps %xmm0, %xmm0
movaps %xmm0, 0x90(%rsp)
xorl %r14d, %r14d
movq %r14, 0xa0(%rsp)
movq %r14, 0xc0(%rsp)
movaps %xmm0, 0xb0(%rsp)
movq %r14, 0x260(%rsp)
movaps %xmm0, 0x250(%rsp)
movq %r14, 0xe0(%rsp)
movaps %xmm0, 0xd0(%rsp)
movq 0x7d0(%rsp), %rdx
cmpq %rdx, 0x7d8(%rsp)
je 0xa0da
leaq 0x58(%rsp), %r13
movq %rsp, %r15
leaq 0x100(%rsp), %r12
movq %r14, %rbx
shlq $0x5, %rbx
addq %rbx, %rdx
movq %r15, %rdi
leaq 0x2fa32(%rip), %rsi     # 0x39158
callq 0xb7dd
movq %r15, %rdi
leaq 0x2fa21(%rip), %rsi     # 0x39156
callq 0x5870
leaq 0x220(%rsp), %rsi
movq %rsi, 0x210(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x976e
movq %rdx, 0x210(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x220(%rsp)
jmp 0x9774
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x218(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x40d12(%rip), %rdi     # 0x4a4a8
leaq 0x210(%rsp), %rsi
callq 0x371c8
movq 0x210(%rsp), %rdi
leaq 0x220(%rsp), %rax
cmpq %rax, %rdi
je 0x97bd
callq 0x5410
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x97d0
callq 0x5410
movq 0x7e8(%rsp), %rax
movq %r14, %rcx
shrq $0x6, %rcx
movq (%rax,%rcx,8), %rax
btq %r14, %rax
jae 0x9816
movl $0x470, %edi            # imm = 0x470
callq 0x5460
movq %rax, %rbp
addq 0x7d0(%rsp), %rbx
movq %rax, %rdi
leaq 0x378(%rsp), %rsi
movq %rbx, %rdx
movl %r14d, %ecx
callq 0x106f4
jmp 0x9841
movl $0x468, %edi            # imm = 0x468
callq 0x5460
movq %rax, %rbp
addq 0x7d0(%rsp), %rbx
movq %rax, %rdi
leaq 0x378(%rsp), %rsi
movq %rbx, %rdx
movl %r14d, %ecx
callq 0xe620
movq %rbp, %rdi
leaq 0x378(%rsp), %rsi
callq 0x2e908
movq %rbp, %rdi
callq 0x114e6
movq %r12, %rdi
movl %eax, %esi
callq 0x375de
movl $0x16, %r8d
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
leaq 0x2f8ea(%rip), %rcx     # 0x39161
callq 0x54d0
leaq 0x30(%rsp), %rsi
movq %rsi, 0x20(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x98a4
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
jmp 0x98aa
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x28(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x20(%rsp), %rdi
leaq 0x2f8aa(%rip), %rsi     # 0x39178
callq 0x5870
movq %r13, 0x48(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x98f6
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
jmp 0x98fe
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
movq %rdx, 0x50(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movl 0x2a8(%rbp), %esi
leaq 0x70(%rsp), %rdi
callq 0x375de
movq 0x48(%rsp), %rcx
movl $0xf, %esi
cmpq %r13, %rcx
je 0x993a
movq 0x58(%rsp), %rsi
movq 0x50(%rsp), %r8
movq 0x78(%rsp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rsi, %rax
jbe 0x996e
movl $0xf, %esi
leaq 0x80(%rsp), %rdi
cmpq %rdi, 0x70(%rsp)
je 0x9969
movq 0x80(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x997f
movq 0x70(%rsp), %rsi
leaq 0x48(%rsp), %rdi
callq 0x50f0
jmp 0x998d
leaq 0x70(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x54d0
leaq 0x10(%rsp), %rsi
movq %rsi, (%rsp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0x99b0
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x99b6
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x8(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
movq %r15, %rdi
leaq 0x2f7a4(%rip), %rsi     # 0x39181
callq 0x5870
leaq 0x200(%rsp), %rsi
movq %rsi, 0x1f0(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x9a16
movq %rdx, 0x1f0(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x200(%rsp)
jmp 0x9a1c
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x1f8(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x40a6a(%rip), %rdi     # 0x4a4a8
leaq 0x1f0(%rsp), %rsi
callq 0x371c8
movq 0x1f0(%rsp), %rdi
leaq 0x200(%rsp), %rax
cmpq %rax, %rdi
je 0x9a65
callq 0x5410
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x9a78
callq 0x5410
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x9a8f
callq 0x5410
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x9a9e
callq 0x5410
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x9ab2
callq 0x5410
movq 0x100(%rsp), %rdi
leaq 0x110(%rsp), %rax
cmpq %rax, %rdi
je 0x9acc
callq 0x5410
testl %r14d, %r14d
je 0x9b5c
movq %rbp, %rdi
leaq 0x378(%rsp), %rsi
leaq 0x90(%rsp), %rdx
leaq 0xb0(%rsp), %rcx
leaq 0xd0(%rsp), %r8
leaq 0x250(%rsp), %r9
callq 0x12448
movq %r12, %rdi
movl %eax, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x17284
movl $0x16, %r8d
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
leaq 0x2f639(%rip), %rcx     # 0x39161
callq 0x54d0
leaq 0x30(%rsp), %rsi
movq %rsi, 0x20(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x9bf5
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
jmp 0x9bfb
movq %rbp, %rdi
leaq 0x378(%rsp), %rsi
leaq 0x90(%rsp), %rdx
leaq 0xb0(%rsp), %rcx
leaq 0xd0(%rsp), %r8
leaq 0x250(%rsp), %r9
callq 0x11c44
movq 0xb8(%rsp), %rsi
subq 0xb0(%rsp), %rsi
shrq $0x2, %rsi
movq %r12, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x17284
movl $0x16, %r8d
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
leaq 0x2f5a0(%rip), %rcx     # 0x39161
callq 0x54d0
leaq 0x30(%rsp), %rsi
movq %rsi, 0x20(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x9dba
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
jmp 0x9dc0
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x28(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x20(%rsp), %rdi
leaq 0x2f570(%rip), %rsi     # 0x3918f
callq 0x5870
movq %r13, 0x48(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x9c47
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
jmp 0x9c4f
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
movq %rdx, 0x50(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %rbp, %rdi
callq 0x11532
leaq 0x70(%rsp), %rdi
movl %eax, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x17284
movq 0x48(%rsp), %rcx
movl $0xf, %esi
cmpq %r13, %rcx
je 0x9c94
movq 0x58(%rsp), %rsi
movq 0x50(%rsp), %r8
movq 0x78(%rsp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rsi, %rax
jbe 0x9cc8
movl $0xf, %esi
leaq 0x80(%rsp), %rdi
cmpq %rdi, 0x70(%rsp)
je 0x9cc3
movq 0x80(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x9cd9
movq 0x70(%rsp), %rsi
leaq 0x48(%rsp), %rdi
callq 0x50f0
jmp 0x9ce7
leaq 0x70(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x54d0
leaq 0x10(%rsp), %rsi
movq %rsi, (%rsp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0x9d0a
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x9d10
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x8(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
movq %r15, %rdi
leaq 0x2f46c(%rip), %rsi     # 0x391a3
callq 0x5870
leaq 0x1c0(%rsp), %rsi
movq %rsi, 0x1b0(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x9d70
movq %rdx, 0x1b0(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x1c0(%rsp)
jmp 0x9d76
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x1b8(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x40710(%rip), %rdi     # 0x4a4a8
leaq 0x1b0(%rsp), %rsi
callq 0x371c8
movq 0x1b0(%rsp), %rdi
leaq 0x1c0(%rsp), %rax
jmp 0x9f7a
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x28(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x20(%rsp), %rdi
leaq 0x2f3ab(%rip), %rsi     # 0x3918f
callq 0x5870
movq %r13, 0x48(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x9e0c
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
jmp 0x9e14
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
movq %rdx, 0x50(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %rbp, %rdi
callq 0x11532
leaq 0x70(%rsp), %rdi
movl %eax, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x17284
movq 0x48(%rsp), %rcx
movl $0xf, %esi
cmpq %r13, %rcx
je 0x9e59
movq 0x58(%rsp), %rsi
movq 0x50(%rsp), %r8
movq 0x78(%rsp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rsi, %rax
jbe 0x9e8d
movl $0xf, %esi
leaq 0x80(%rsp), %rdi
cmpq %rdi, 0x70(%rsp)
je 0x9e88
movq 0x80(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x9e9e
movq 0x70(%rsp), %rsi
leaq 0x48(%rsp), %rdi
callq 0x50f0
jmp 0x9eac
leaq 0x70(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x54d0
leaq 0x10(%rsp), %rsi
movq %rsi, (%rsp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0x9ecf
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x9ed5
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x8(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
movq %r15, %rdi
leaq 0x2f2a7(%rip), %rsi     # 0x391a3
callq 0x5870
leaq 0x1e0(%rsp), %rsi
movq %rsi, 0x1d0(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x9f35
movq %rdx, 0x1d0(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x1e0(%rsp)
jmp 0x9f3b
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x1d8(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x4054b(%rip), %rdi     # 0x4a4a8
leaq 0x1d0(%rsp), %rsi
callq 0x371c8
movq 0x1d0(%rsp), %rdi
leaq 0x1e0(%rsp), %rax
cmpq %rax, %rdi
je 0x9f84
callq 0x5410
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x9f97
callq 0x5410
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x9fae
callq 0x5410
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x9fbd
callq 0x5410
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x9fd1
callq 0x5410
movq 0x100(%rsp), %rdi
leaq 0x110(%rsp), %rax
cmpq %rax, %rdi
je 0x9feb
callq 0x5410
movq %rbp, %rdi
callq 0x11532
testl %eax, %eax
jle 0xa056
movq %rbp, %rdi
callq 0x1152a
testl %eax, %eax
jg 0xa0ad
leaq 0x280(%rsp), %rax
movq %rax, 0x270(%rsp)
leaq 0x270(%rsp), %rbx
movq %rbx, %rdi
leaq 0x2f1a2(%rip), %rsi     # 0x391cb
leaq 0x2f1b5(%rip), %rdx     # 0x391e5
callq 0xc868
leaq 0x4046c(%rip), %rdi     # 0x4a4a8
movq %rbx, %rsi
callq 0x3749c
movq 0x270(%rsp), %rdi
leaq 0x280(%rsp), %rax
jmp 0xa0a3
leaq 0x2a0(%rsp), %rax
movq %rax, 0x290(%rsp)
leaq 0x290(%rsp), %rbx
movq %rbx, %rdi
leaq 0x2f133(%rip), %rsi     # 0x391ab
leaq 0x2f14b(%rip), %rdx     # 0x391ca
callq 0xc868
leaq 0x4041d(%rip), %rdi     # 0x4a4a8
movq %rbx, %rsi
callq 0x3749c
movq 0x290(%rsp), %rdi
leaq 0x2a0(%rsp), %rax
cmpq %rax, %rdi
je 0xa0ad
callq 0x5410
movq (%rbp), %rax
movq %rbp, %rdi
callq *0x38(%rax)
incl %r14d
movq 0x7d0(%rsp), %rdx
movq 0x7d8(%rsp), %rax
subq %rdx, %rax
sarq $0x5, %rax
cmpq %r14, %rax
ja 0x9712
leaq 0x100(%rsp), %rdi
xorps %xmm0, %xmm0
movaps %xmm0, (%rdi)
xorl %eax, %eax
movq %rax, 0x10(%rdi)
movq %rax, 0x80(%rsp)
movaps %xmm0, 0x70(%rsp)
movq 0xd8(%rsp), %rsi
subq 0xd0(%rsp), %rsi
sarq $0x5, %rsi
callq 0xc232
movq 0xb0(%rsp), %rax
cmpq %rax, 0xb8(%rsp)
je 0xa2c0
xorl %r12d, %r12d
leaq 0x340(%rsp), %r14
leaq 0x330(%rsp), %r13
movq 0xd8(%rsp), %rsi
movq 0xd0(%rsp), %rdi
movq %rsi, %rdx
subq %rdi, %rdx
sarq $0x5, %rdx
movl $0x0, %ecx
cmpq %rdi, %rsi
je 0xa1a3
movq 0x90(%rsp), %rsi
movl $0x1, %edi
movl %r12d, %ecx
shlq %cl, %rdi
movq %r12, %r8
shrq $0x6, %r8
xorl %ecx, %ecx
movl $0x1, %r9d
movq (%rsi), %r10
movq (%r10,%r8,8), %r10
andq %rdi, %r10
cmpq $0x1, %r10
sbbl $-0x1, %ecx
movl %r9d, %r10d
addq $0x28, %rsi
incl %r9d
cmpq %r10, %rdx
ja 0xa183
cmpl $0x2, %ecx
jl 0xa1d4
decq %rdx
movl %ecx, %ecx
cmpq %rcx, %rdx
jbe 0xa1d4
leaq (%rax,%r12,4), %rdx
movq 0x78(%rsp), %rsi
cmpq 0x80(%rsp), %rsi
je 0xa21c
movl (%rdx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x78(%rsp)
jmp 0xa226
movq %r14, 0x330(%rsp)
movq %r13, %rdi
leaq 0x2f000(%rip), %rsi     # 0x391e6
leaq 0x2f017(%rip), %rdx     # 0x39204
callq 0xc868
leaq 0x402af(%rip), %rdi     # 0x4a4a8
movq %r13, %rsi
callq 0x37516
movq 0x330(%rsp), %rdi
cmpq %r14, %rdi
je 0xa29d
callq 0x5410
jmp 0xa29d
leaq 0x70(%rsp), %rdi
callq 0xdd9c
movq 0xd8(%rsp), %rax
cmpq 0xd0(%rsp), %rax
je 0xa29d
movl $0x1, %r15d
movl %r12d, %ecx
shlq %cl, %r15
movq %r12, %rbx
shrq $0x6, %rbx
movl $0x1, %ebp
xorl %eax, %eax
shlq $0x3, %rax
leaq (%rax,%rax,4), %rax
movq 0x100(%rsp), %rdi
addq %rax, %rdi
movq 0x90(%rsp), %rcx
movq (%rcx,%rax), %rax
xorl %esi, %esi
testq %r15, (%rax,%rbx,8)
setne %sil
callq 0xc26e
movq 0xd8(%rsp), %rcx
subq 0xd0(%rsp), %rcx
movl %ebp, %eax
sarq $0x5, %rcx
incl %ebp
cmpq %rax, %rcx
ja 0xa252
incl %r12d
movq 0xb0(%rsp), %rax
movq 0xb8(%rsp), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %r12, %rcx
ja 0xa13d
leaq 0xb0(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0xc2bc
leaq 0x90(%rsp), %rdi
leaq 0x100(%rsp), %rsi
callq 0xc38a
movq 0x7d8(%rsp), %rax
subq 0x7d0(%rsp), %rax
cmpq $0x21, %rax
jb 0xa42b
movq 0xb8(%rsp), %rsi
subq 0xb0(%rsp), %rsi
shrq $0x2, %rsi
leaq 0x48(%rsp), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x17284
leaq 0x2eeda(%rip), %rcx     # 0x39205
leaq 0x48(%rsp), %rdi
movl $0x5, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x54d0
leaq 0x10(%rsp), %rsi
movq %rsi, (%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xa365
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0xa36b
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rsp, %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x2ee7f(%rip), %rsi     # 0x3920b
callq 0x5870
leaq 0x2e0(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xa3c1
movq %rdx, 0x2d0(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x2e0(%rsp)
jmp 0xa3c8
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
leaq 0x2d0(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x400ba(%rip), %rdi     # 0x4a4a8
callq 0x371c8
movq 0x2d0(%rsp), %rdi
cmpq %r14, %rdi
je 0xa405
callq 0x5410
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0xa418
callq 0x5410
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xa42b
callq 0x5410
movq 0xb8(%rsp), %rax
cmpq 0xb0(%rsp), %rax
jne 0xa48f
leaq 0x320(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x2ed7b(%rip), %rsi     # 0x391cb
leaq 0x2ed8e(%rip), %rdx     # 0x391e5
leaq 0x310(%rsp), %rdi
callq 0xc868
leaq 0x4003d(%rip), %rdi     # 0x4a4a8
leaq 0x310(%rsp), %rsi
movl $0x1, %edx
callq 0x3721e
movq 0x310(%rsp), %rdi
cmpq %r14, %rdi
je 0xa48f
callq 0x5410
movq 0x3e8(%rsp), %rax
movq %rsp, %rdi
leaq 0x10(%rsp), %rcx
movq %rcx, (%rdi)
movq 0x20(%rax), %rsi
movq 0x28(%rax), %rdx
addq %rsi, %rdx
callq 0xc7d8
xorps %xmm0, %xmm0
leaq 0x150(%rsp), %rdi
movaps %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movq 0x90(%rsp), %rax
movq 0x10(%rax), %rcx
subq (%rax), %rcx
movl 0x18(%rax), %eax
leaq (%rax,%rcx,8), %rsi
leaq 0x48(%rsp), %rdx
movl $0x0, (%rdx)
callq 0xbb1a
movq 0x90(%rsp), %rax
movq 0x10(%rax), %rdx
subq (%rax), %rdx
shlq $0x3, %rdx
movl 0x18(%rax), %ecx
addq %rdx, %rcx
je 0xa586
movq 0x98(%rsp), %rsi
movq %rsi, %rcx
subq %rax, %rcx
sarq $0x3, %rcx
movabsq $-0x3333333333333333, %rdi # imm = 0xCCCCCCCCCCCCCCCD
imulq %rcx, %rdi
xorl %ecx, %ecx
movq 0x150(%rsp), %r8
cmpq %rax, %rsi
je 0xa578
movq %rcx, %r9
movl $0x1, %r10d
shlq %cl, %r10
shrq $0x6, %r9
movl (%r8,%rcx,4), %r11d
movl $0x1, %ebx
movq %rax, %r14
movq (%r14), %r15
movq (%r15,%r9,8), %r15
andq %r10, %r15
cmpq $0x1, %r15
sbbl $-0x1, %r11d
movl %ebx, %r15d
addq $0x28, %r14
incl %ebx
cmpq %r15, %rdi
ja 0xa554
movl %r11d, (%r8,%rcx,4)
incl %ecx
movl 0x18(%rax), %r9d
addq %rdx, %r9
cmpq %rcx, %r9
ja 0xa533
xorps %xmm0, %xmm0
movaps %xmm0, 0x170(%rsp)
movq $0x0, 0x180(%rsp)
leaq 0x870(%rsp), %rbx
leaq 0x30953(%rip), %rsi     # 0x3aeff
movq %rbx, %rdi
callq 0x50e0
testl %eax, %eax
je 0xa5d2
leaq 0xb0(%rsp), %rsi
leaq 0x170(%rsp), %rdx
movq %rbx, %rdi
callq 0x6a35
jmp 0xa5f0
movsd 0x890(%rsp), %xmm0
leaq 0xb0(%rsp), %rdi
leaq 0x170(%rsp), %rsi
callq 0x69ac
cmpb $0x1, 0x8a4(%rsp)
jne 0xae15
movq 0x3f9c3(%rip), %rbx     # 0x49fc8
leaq 0x2ec27(%rip), %rsi     # 0x39233
movl $0x68, %edx
movq %rbx, %rdi
callq 0x54f0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x5440
movsbl %al, %esi
movq 0x3f991(%rip), %rdi     # 0x49fc8
callq 0x5040
movq %rax, %rdi
callq 0x52c0
movq 0x98(%rsp), %rax
cmpq 0x90(%rsp), %rax
je 0xb175
leaq 0x1a0(%rsp), %r13
xorl %r15d, %r15d
leaq 0x48(%rsp), %rbx
leaq 0x20(%rsp), %r14
movq 0xd0(%rsp), %rsi
movq %r15, %rax
shlq $0x5, %rax
movq 0x8(%rsi,%rax), %rcx
movq %rax, 0x128(%rsp)
addq %rax, %rsi
addq $-0x2, %rcx
movq %rbx, %rdi
xorl %edx, %edx
callq 0x5480
cmpq $0x0, 0x860(%rsp)
je 0xa6c8
leaq 0x838(%rsp), %rdi
movq %rbx, %rsi
callq 0xe596
leaq 0x840(%rsp), %rcx
cmpq %rcx, %rax
je 0xadce
movq 0xd0(%rsp), %rdx
addq 0x128(%rsp), %rdx
movq %r14, %rdi
leaq 0x2ebba(%rip), %rsi     # 0x3929c
callq 0xb7dd
movq %r14, %rdi
leaq 0x2ea65(%rip), %rsi     # 0x39156
callq 0x5870
movq %r13, 0x190(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xa722
movq %rdx, 0x190(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x1a0(%rsp)
jmp 0xa72a
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
movq %rdx, 0x198(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x3fd5c(%rip), %rdi     # 0x4a4a8
leaq 0x190(%rsp), %rsi
callq 0x371c8
movq 0x190(%rsp), %rdi
cmpq %r13, %rdi
je 0xa76b
callq 0x5410
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0xa77f
callq 0x5410
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
leaq 0x90(%rsp), %rdi
leaq 0x170(%rsp), %rsi
movl %r15d, %edx
leaq 0x378(%rsp), %rcx
movq %r14, %r8
callq 0x82e1
movq 0x90(%rsp), %rax
leaq (%r15,%r15,4), %rcx
movq %rcx, 0xf8(%rsp)
movq (%rax,%rcx,8), %rcx
testb $0x1, (%rcx)
jne 0xa7f1
movq 0x98(%rsp), %rcx
subq %rax, %rcx
shrq $0x3, %rcx
imull $0xcccccccd, %ecx, %edi # imm = 0xCCCCCCCD
movq 0x150(%rsp), %rax
subl (%rax), %edi
jmp 0xa7fb
movq 0x150(%rsp), %rax
movl (%rax), %edi
movq 0xb0(%rsp), %rax
movl (%rax), %r14d
movq 0x20(%rsp), %rax
movq 0x28(%rsp), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq $0x2, %rcx
movl %r14d, 0xf0(%rsp)
jb 0xab99
movq %r15, 0x168(%rsp)
movq 0x20(%rsp), %rcx
movl (%rcx), %r15d
movl $0x1, %ebx
xorl %r12d, %r12d
movl $0x0, 0x68(%rsp)
xorl %edx, %edx
movq %r12, %rbp
incq %r12
cmpl %r15d, 0x4(%rax,%rbp,4)
jne 0xa8a1
movq 0xb0(%rsp), %rax
movl 0x4(%rax,%rbp,4), %r14d
incl %ebx
movq 0x90(%rsp), %rax
movq 0xf8(%rsp), %rcx
movq (%rax,%rcx,8), %rcx
movq %r12, %rsi
shrq $0x6, %rsi
movq (%rcx,%rsi,8), %rcx
btq %r12, %rcx
jae 0xaaed
movq 0x150(%rsp), %rax
movl 0x4(%rax,%rbp,4), %eax
jmp 0xab0e
movl %edi, 0xac(%rsp)
leaq 0x90(%rsp), %rdi
movq 0x168(%rsp), %rsi
movl %ebp, %ecx
leaq 0x130(%rsp), %r8
leaq 0xf4(%rsp), %r9
callq 0x939a
movq 0xd0(%rsp), %rax
movq 0x128(%rsp), %rcx
movq (%rax,%rcx), %rsi
movq 0x8(%rax,%rcx), %rdx
movq 0x3f6d9(%rip), %rdi     # 0x49fc8
callq 0x54f0
movq %rax, %r13
movl $0x1, %edx
movq %rax, %rdi
leaq 0x305f8(%rip), %rsi     # 0x3aefe
callq 0x54f0
movslq %r15d, %rax
movq 0xd0(%rsp), %rcx
shlq $0x5, %rax
movq (%rcx,%rax), %rsi
movq 0x8(%rcx,%rax), %rdx
movq %r13, %rdi
callq 0x54f0
movl $0x1, %edx
movq 0x3f691(%rip), %rdi     # 0x49fc8
leaq 0x305c0(%rip), %rsi     # 0x3aefe
callq 0x54f0
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq 0x3f675(%rip), %rdi     # 0x49fc8
callq 0x54f0
movl $0x1, %edx
movq 0x3f664(%rip), %rdi     # 0x49fc8
leaq 0x30593(%rip), %rsi     # 0x3aefe
callq 0x54f0
movq 0x3f651(%rip), %rdi     # 0x49fc8
movl 0xf0(%rsp), %esi
callq 0x57a0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x30569(%rip), %rsi     # 0x3aefe
callq 0x54f0
movq %r15, %rdi
movl %r14d, %esi
callq 0x57a0
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x30547(%rip), %rsi     # 0x3aefe
callq 0x54f0
movq %r14, %rdi
movl %ebx, %esi
callq 0x57a0
movl $0x1, %edx
movq 0x3f5f6(%rip), %rdi     # 0x49fc8
leaq 0x30525(%rip), %rsi     # 0x3aefe
callq 0x54f0
movq 0x3f5e3(%rip), %rdi     # 0x49fc8
movl 0xac(%rsp), %esi
callq 0x57a0
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
leaq 0x304fb(%rip), %rsi     # 0x3aefe
callq 0x54f0
movslq 0x68(%rsp), %rax
movq 0xb0(%rsp), %rcx
movl (%rcx,%rax,4), %esi
movq %rbx, %rdi
callq 0x52b0
movl $0x1, %edx
movq 0x3f59c(%rip), %rdi     # 0x49fc8
leaq 0x304cb(%rip), %rsi     # 0x3aefe
callq 0x54f0
movl 0x130(%rsp), %esi
movq 0x3f582(%rip), %rdi     # 0x49fc8
callq 0x57a0
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
leaq 0x304a1(%rip), %rsi     # 0x3aefe
callq 0x54f0
movl 0xf4(%rsp), %esi
movq %rbx, %rdi
callq 0x57a0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x5440
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x52c0
movq 0xb0(%rsp), %rax
movl 0x4(%rax,%rbp,4), %r14d
movq 0x20(%rsp), %rax
movl 0x4(%rax,%rbp,4), %r15d
movq 0x90(%rsp), %rax
movq 0xf8(%rsp), %rcx
movq (%rax,%rcx,8), %rcx
movq %r12, %rdx
shrq $0x6, %rdx
movq (%rcx,%rdx,8), %rcx
btq %r12, %rcx
movl %r14d, 0xf0(%rsp)
jae 0xab23
movq 0x150(%rsp), %rax
movl 0x4(%rax,%rbp,4), %edi
jmp 0xab44
movq 0x98(%rsp), %rcx
subq %rax, %rcx
shrq $0x3, %rcx
imull $0xcccccccd, %ecx, %eax # imm = 0xCCCCCCCD
movq 0x150(%rsp), %rcx
subl 0x4(%rcx,%rbp,4), %eax
leal 0x1(%rbp), %ecx
cmpl %edi, %eax
cmovll %eax, %edi
movl 0x68(%rsp), %eax
cmovll %ecx, %eax
movl %eax, 0x68(%rsp)
jmp 0xab59
movq 0x98(%rsp), %rcx
subq %rax, %rcx
shrq $0x3, %rcx
imull $0xcccccccd, %ecx, %edi # imm = 0xCCCCCCCD
movq 0x150(%rsp), %rax
subl 0x4(%rax,%rbp,4), %edi
movl $0x1, %ebx
movl %r12d, %edx
movl %r12d, 0x68(%rsp)
leaq 0x1a0(%rsp), %r13
movq 0x20(%rsp), %rax
movq 0x28(%rsp), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
addq $0x2, %rbp
cmpq %rbp, %rcx
ja 0xa84b
movl %edi, 0xac(%rsp)
movl %ebx, 0xf8(%rsp)
movslq 0x68(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0x168(%rsp), %r15
jmp 0xabb6
movl %edi, 0xac(%rsp)
movl $0x1, 0xf8(%rsp)
xorl %edx, %edx
movq $0x0, 0x68(%rsp)
decl %ecx
leaq 0x90(%rsp), %rdi
movq %r15, %r12
movl %r15d, %esi
leaq 0x130(%rsp), %r8
leaq 0xf4(%rsp), %r9
callq 0x939a
movq 0xd0(%rsp), %rax
movq 0x128(%rsp), %rcx
movq (%rax,%rcx), %rsi
movq 0x8(%rax,%rcx), %rdx
movq 0x3f3cd(%rip), %rdi     # 0x49fc8
callq 0x54f0
movq %rax, %rbp
movl $0x1, %edx
movq %rax, %rdi
leaq 0x302ec(%rip), %rsi     # 0x3aefe
callq 0x54f0
movq 0x28(%rsp), %rax
movslq -0x4(%rax), %rax
movq 0xd0(%rsp), %rcx
shlq $0x5, %rax
movq (%rcx,%rax), %rsi
movq 0x8(%rcx,%rax), %rdx
movq %rbp, %rdi
callq 0x54f0
movl $0x1, %edx
movq 0x3f37f(%rip), %rdi     # 0x49fc8
leaq 0x302ae(%rip), %rsi     # 0x3aefe
callq 0x54f0
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq 0x3f363(%rip), %rdi     # 0x49fc8
callq 0x54f0
movl $0x1, %edx
movq 0x3f352(%rip), %rdi     # 0x49fc8
leaq 0x30281(%rip), %rsi     # 0x3aefe
callq 0x54f0
movq 0x3f33f(%rip), %rdi     # 0x49fc8
movl 0xf0(%rsp), %esi
callq 0x57a0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x30257(%rip), %rsi     # 0x3aefe
callq 0x54f0
movq %r15, %rdi
movl %r14d, %esi
callq 0x57a0
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x30235(%rip), %rsi     # 0x3aefe
callq 0x54f0
movq %r14, %rdi
movl 0xf8(%rsp), %esi
callq 0x57a0
movl $0x1, %edx
movq 0x3f2df(%rip), %rdi     # 0x49fc8
leaq 0x3020e(%rip), %rsi     # 0x3aefe
callq 0x54f0
movq 0x3f2cc(%rip), %rdi     # 0x49fc8
movl 0xac(%rsp), %esi
callq 0x57a0
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
leaq 0x301e4(%rip), %rsi     # 0x3aefe
callq 0x54f0
movq 0xb0(%rsp), %rax
movq 0x68(%rsp), %rcx
movl (%rax,%rcx,4), %esi
movq %rbx, %rdi
callq 0x52b0
movl $0x1, %edx
movq 0x3f285(%rip), %rdi     # 0x49fc8
leaq 0x301b4(%rip), %rsi     # 0x3aefe
callq 0x54f0
movl 0x130(%rsp), %esi
movq 0x3f26b(%rip), %rdi     # 0x49fc8
callq 0x57a0
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
leaq 0x3018a(%rip), %rsi     # 0x3aefe
callq 0x54f0
movl 0xf4(%rsp), %esi
movq %rbx, %rdi
callq 0x57a0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x5440
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x52c0
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0xadc1
callq 0x5410
movq %r12, %r15
leaq 0x48(%rsp), %rbx
leaq 0x20(%rsp), %r14
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0xade2
callq 0x5410
movq 0x98(%rsp), %rax
subq 0x90(%rsp), %rax
incq %r15
sarq $0x3, %rax
movabsq $-0x3333333333333333, %rcx # imm = 0xCCCCCCCCCCCCCCCD
imulq %rcx, %rax
cmpq %r15, %rax
ja 0xa66f
jmp 0xb175
movq 0x3f1ac(%rip), %rbx     # 0x49fc8
leaq 0x2e48d(%rip), %rsi     # 0x392b0
movl $0x16, %edx
movq %rbx, %rdi
callq 0x54f0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x5440
movsbl %al, %esi
movq 0x3f17a(%rip), %rbx     # 0x49fc8
movq %rbx, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x52c0
movq 0x98(%rsp), %rax
cmpq 0x90(%rsp), %rax
je 0xb175
leaq 0x240(%rsp), %r13
leaq 0x48(%rsp), %rbp
leaq 0x30076(%rip), %r14     # 0x3aefe
xorl %r15d, %r15d
movq 0xd0(%rsp), %rsi
movq %r15, %r12
shlq $0x5, %r12
movq 0x8(%rsi,%r12), %rcx
addq %r12, %rsi
addq $-0x2, %rcx
movq %rbp, %rdi
xorl %edx, %edx
callq 0x5480
cmpq $0x0, 0x860(%rsp)
je 0xaedc
leaq 0x838(%rsp), %rdi
movq %rbp, %rsi
callq 0xe596
leaq 0x840(%rsp), %rcx
cmpq %rcx, %rax
je 0xb133
movq 0xd0(%rsp), %rdx
addq %r12, %rdx
leaq 0x20(%rsp), %rbp
movq %rbp, %rdi
leaq 0x2e3d1(%rip), %rsi     # 0x392c7
callq 0xb7dd
movq %rbp, %rdi
leaq 0x2e251(%rip), %rsi     # 0x39156
callq 0x5870
movq %r13, 0x230(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xaf36
movq %rdx, 0x230(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x240(%rsp)
jmp 0xaf3e
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
movq %rdx, 0x238(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x3f548(%rip), %rdi     # 0x4a4a8
leaq 0x230(%rsp), %rsi
callq 0x371c8
movq 0x230(%rsp), %rdi
cmpq %r13, %rdi
je 0xaf7f
callq 0x5410
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
leaq 0x20(%rsp), %r13
je 0xaf98
callq 0x5410
xorl %eax, %eax
movq %rax, 0x30(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq %rax, 0x140(%rsp)
movaps %xmm0, 0x130(%rsp)
leaq 0x90(%rsp), %rdi
leaq 0x170(%rsp), %rsi
movl %r15d, %edx
leaq 0x378(%rsp), %rcx
movq %r13, %r8
leaq 0x130(%rsp), %r9
callq 0x716f
movq 0xb8(%rsp), %rax
cmpq 0xb0(%rsp), %rax
je 0xb105
xorl %r13d, %r13d
movq 0xd0(%rsp), %rax
movq (%rax,%r12), %rsi
movq 0x8(%rax,%r12), %rdx
movq %rbx, %rdi
callq 0x54f0
movq %rax, %rbp
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x54f0
movq 0x20(%rsp), %rax
movslq (%rax,%r13,4), %rax
movq 0xd0(%rsp), %rcx
shlq $0x5, %rax
movq (%rcx,%rax), %rsi
movq 0x8(%rcx,%rax), %rdx
movq %rbp, %rdi
callq 0x54f0
movl $0x1, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x54f0
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x54f0
movq %rax, %rbp
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x54f0
movq 0xb0(%rsp), %rax
movl (%rax,%r13,4), %esi
movq %rbp, %rdi
callq 0x52b0
movq %rax, %rbp
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x54f0
movq 0x130(%rsp), %rax
movsd (%rax,%r13,8), %xmm0
movq %rbp, %rdi
callq 0x56e0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x5440
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x52c0
incq %r13
movq 0xb8(%rsp), %rax
subq 0xb0(%rsp), %rax
sarq $0x2, %rax
cmpq %r13, %rax
ja 0xaffb
movq 0x130(%rsp), %rdi
testq %rdi, %rdi
je 0xb117
callq 0x5410
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
leaq 0x240(%rsp), %r13
leaq 0x48(%rsp), %rbp
je 0xb133
callq 0x5410
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0xb147
callq 0x5410
movq 0x98(%rsp), %rax
subq 0x90(%rsp), %rax
incq %r15
sarq $0x3, %rax
movabsq $-0x3333333333333333, %rcx # imm = 0xCCCCCCCCCCCCCCCD
imulq %rcx, %rax
cmpq %r15, %rax
ja 0xae8b
leaq 0x370(%rsp), %rbx
movq %rbx, %rdi
callq 0x5400
movq (%rbx), %rdi
movq 0x268(%rsp), %rsi
callq 0x51c0
leaq 0x20(%rsp), %rdi
movl $0x2, %esi
callq 0x3779a
leaq 0x2e139(%rip), %rcx     # 0x392e4
leaq 0x20(%rsp), %rdi
movl $0xb, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x54d0
leaq 0x58(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xb1e6
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
jmp 0xb1ed
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
leaq 0x48(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x2df0b(%rip), %rsi     # 0x3911b
callq 0x5870
leaq 0x2c0(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xb245
movq %rdx, 0x2b0(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x2c0(%rsp)
jmp 0xb24c
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
leaq 0x2b0(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x3f236(%rip), %rdi     # 0x4a4a8
callq 0x371c8
movq 0x2b0(%rsp), %rdi
cmpq %r15, %rdi
je 0xb289
callq 0x5410
movq 0x48(%rsp), %rdi
cmpq %r14, %rdi
je 0xb298
callq 0x5410
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xb2ab
callq 0x5410
leaq 0x3f1f6(%rip), %rdi     # 0x4a4a8
callq 0x371be
movq 0x170(%rsp), %rdi
testq %rdi, %rdi
je 0xb2c9
callq 0x5410
movq 0x150(%rsp), %rdi
testq %rdi, %rdi
je 0xb2db
callq 0x5410
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0xb2ee
callq 0x5410
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0xb2fd
callq 0x5410
leaq 0x100(%rsp), %rdi
callq 0xc4c8
leaq 0xd0(%rsp), %rdi
callq 0xc4f0
leaq 0x250(%rsp), %rdi
callq 0xc4f0
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0xb336
callq 0x5410
leaq 0x90(%rsp), %rdi
callq 0xc4c8
leaq 0x378(%rsp), %rdi
callq 0xc534
xorl %eax, %eax
addq $0x8c8, %rsp            # imm = 0x8C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x310(%rsp), %rdi
jmp 0xb560
jmp 0xb691
movq %rax, %rbx
movq 0x2d0(%rsp), %rdi
cmpq %r14, %rdi
je 0xb393
callq 0x5410
jmp 0xb393
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0xb3ab
callq 0x5410
jmp 0xb3ab
movq %rax, %rbx
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
jmp 0xb700
jmp 0xb691
jmp 0xb548
movq %rax, %rbx
movq 0x2b0(%rsp), %rdi
cmpq %r15, %rdi
je 0xb3dd
callq 0x5410
jmp 0xb3dd
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r14, %rdi
je 0xb3f1
callq 0x5410
jmp 0xb3f1
movq %rax, %rbx
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
jmp 0xb6c9
jmp 0xb548
movq %rax, %rbx
jmp 0xb6e5
jmp 0xb691
movq %rax, %rbx
movq 0x350(%rsp), %rdi
cmpq %r14, %rdi
jne 0xb454
jmp 0xb75f
jmp 0xb46a
movq %rax, %rbx
movq 0x2f0(%rsp), %rdi
cmpq %r14, %rdi
je 0xb442
callq 0x5410
jmp 0xb442
movq %rax, %rbx
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xb75f
callq 0x5410
jmp 0xb75f
jmp 0xb46a
jmp 0xb691
jmp 0xb691
movq %rax, %rbx
jmp 0xb75f
movq %rax, %rbx
movq 0x270(%rsp), %rdi
leaq 0x280(%rsp), %rax
jmp 0xb672
jmp 0xb687
jmp 0xb548
jmp 0xb53e
jmp 0xb53e
jmp 0xb687
movq %rax, %rbx
movq 0x1d0(%rsp), %rdi
leaq 0x1e0(%rsp), %rax
jmp 0xb606
movq %rax, %rbx
movq 0x290(%rsp), %rdi
leaq 0x2a0(%rsp), %rax
jmp 0xb672
jmp 0xb5ee
jmp 0xb687
jmp 0xb5e2
jmp 0xb573
jmp 0xb5e9
jmp 0xb5da
jmp 0xb69b
movq %rax, %rbx
movq 0x230(%rsp), %rdi
jmp 0xb517
jmp 0xb523
jmp 0xb53e
jmp 0xb696
movq %rax, %rbx
movq 0x190(%rsp), %rdi
cmpq %r13, %rdi
je 0xb526
callq 0x5410
jmp 0xb526
movq %rax, %rbx
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
jne 0xb6ba
jmp 0xb6bf
movq %rax, %rbx
jmp 0xb6bf
jmp 0xb548
movq %rax, %rbx
jmp 0xb6d3
jmp 0xb691
movq %rax, %rbx
movq 0x330(%rsp), %rdi
cmpq %r14, %rdi
jne 0xb705
jmp 0xb70a
jmp 0xb687
movq %rax, %rbx
movq %rbp, %rdi
jmp 0xb67b
jmp 0xb5e9
jmp 0xb5da
jmp 0xb5ee
jmp 0xb5e2
movq %rax, %rbx
movq 0x1b0(%rsp), %rdi
leaq 0x1c0(%rsp), %rax
jmp 0xb606
jmp 0xb687
jmp 0xb63c
jmp 0xb687
movq %rax, %rbx
jmp 0xb5cc
movq %rax, %rbx
movq 0x210(%rsp), %rdi
leaq 0x220(%rsp), %rax
cmpq %rax, %rdi
je 0xb5cc
callq 0x5410
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
jmp 0xb672
movq %rax, %rbx
jmp 0xb662
movq %rax, %rbx
jmp 0xb64e
jmp 0xb63c
movq %rax, %rbx
jmp 0xb623
movq %rax, %rbx
jmp 0xb610
movq %rax, %rbx
movq 0x1f0(%rsp), %rdi
leaq 0x200(%rsp), %rax
cmpq %rax, %rdi
je 0xb610
callq 0x5410
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0xb623
callq 0x5410
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0xb63f
callq 0x5410
jmp 0xb63f
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0xb64e
callq 0x5410
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0xb662
callq 0x5410
movq 0x100(%rsp), %rdi
leaq 0x110(%rsp), %rax
cmpq %rax, %rdi
je 0xb726
callq 0x5410
jmp 0xb726
jmp 0xb687
movq %rax, %rbx
jmp 0xb726
jmp 0xb696
movq %rax, %rbx
jmp 0xb70a
movq %rax, %rbx
jmp 0xb6b0
movq %rax, %rbx
movq 0x130(%rsp), %rdi
testq %rdi, %rdi
je 0xb6b0
callq 0x5410
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0xb6bf
callq 0x5410
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0xb6d3
callq 0x5410
movq 0x170(%rsp), %rdi
testq %rdi, %rdi
je 0xb6e5
callq 0x5410
movq 0x150(%rsp), %rdi
testq %rdi, %rdi
je 0xb6f7
callq 0x5410
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0xb70a
callq 0x5410
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0xb719
callq 0x5410
leaq 0x100(%rsp), %rdi
callq 0xc4c8
leaq 0xd0(%rsp), %rdi
callq 0xc4f0
leaq 0x250(%rsp), %rdi
callq 0xc4f0
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0xb752
callq 0x5410
leaq 0x90(%rsp), %rdi
callq 0xc4c8
leaq 0x378(%rsp), %rdi
callq 0xc534
movq %rbx, %rdi
callq 0x57d0