// File: auton1[P]viterbi/vcf_entry.cpp
// Function: vcf_entry::print_bcf(BGZF*, std::set<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>> const&, bool)
void vcf_entry::print_bcf(BGZF* out, const set<string> &INFO_to_keep, bool keep_all_INFO)
{
	if (fully_parsed == false)
		parse_full_entry();

	if (parsed_FORMAT_binary == false)
		parse_FORMAT();

	vector<char> out_vector, tmp_vector;
	out_vector.resize(8*sizeof(int32_t));
	int vector_pos = 2*sizeof(uint32_t);
	string tmp_string;
	int index;
	vector<string> filter_vector;
	vector<pair< string, string > > tmp_info;

	tmp_string = get_CHROM();
	if (tmp_string == "." or tmp_string == " " or tmp_string == "")
		LOG.error("CHROM value must be defined for all entries.",0);

	if (entry_header.CONTIG_reverse_map.find(tmp_string) == entry_header.CONTIG_reverse_map.end() )
		LOG.error("CHROM value " + tmp_string + " is not defined on contig dictionary.",0);

	int32_t chrom = (int32_t)entry_header.CONTIG_reverse_map[tmp_string];
	memcpy(&out_vector[vector_pos], &chrom, sizeof(chrom));
	vector_pos += sizeof(chrom);

	get_POS_binary(tmp_vector);
	memcpy(&out_vector[vector_pos], &tmp_vector[0], tmp_vector.size());
	vector_pos += tmp_vector.size();
	tmp_vector.resize(0);

	get_rlen(tmp_vector);
	memcpy(&out_vector[vector_pos], &tmp_vector[0], tmp_vector.size());
	vector_pos += tmp_vector.size();
	tmp_vector.resize(0);

	get_QUAL_binary(tmp_vector);
	memcpy(&out_vector[vector_pos], &tmp_vector[0], tmp_vector.size());
	vector_pos += tmp_vector.size();
	tmp_vector.resize(0);

	get_ID_binary(tmp_vector);
	out_vector.insert(out_vector.end(), tmp_vector.begin(), tmp_vector.end());
	tmp_vector.resize(0);

	get_ALLELES_binary(tmp_vector);
	out_vector.insert(out_vector.end(), tmp_vector.begin(), tmp_vector.end());
	tmp_vector.resize(0);

	get_FILTER_vector(filter_vector);
	if (filter_vector.empty())
		make_typed_int_vector(tmp_vector, filter_vector);
	else
	{
		vector<int> index_vector;
		for(unsigned int ui=0; ui<filter_vector.size(); ui++)
		{
			if ( entry_header.FILTER_reverse_map.find( filter_vector[ui] ) == entry_header.FILTER_reverse_map.end() )
				LOG.one_off_warning("FILTER value " + filter_vector[ui] + " is not defined in the header and will not be encoded.");
			else
				index_vector.push_back( entry_header.FILTER_reverse_map[ filter_vector[ui] ] );
		}
		make_typed_int_vector(tmp_vector, index_vector );
	}

	if (tmp_vector.empty())
		make_typed_int(tmp_vector, 0, true);

	out_vector.insert(out_vector.end(), tmp_vector.begin(), tmp_vector.end());

	int map_type, number;
	tmp_info = get_INFO_vector(INFO_to_keep, keep_all_INFO);

	for(unsigned int ui=0; ui<tmp_info.size(); ui++)
	{
		if (entry_header.INFO_reverse_map.find(tmp_info[ui].first) == entry_header.INFO_reverse_map.end())
		{
			LOG.one_off_warning("INFO value " + tmp_info[ui].first + " is not defined in the header and will not be encoded.");
			N_INFO_removed++;
			continue;
		}

		tmp_vector.resize(0);
		index = entry_header.INFO_reverse_map[ tmp_info[ui].first ];
		make_typed_int(tmp_vector, index, true);
		out_vector.insert(out_vector.end(), tmp_vector.begin(), tmp_vector.end());

		tmp_vector.resize(0);
		map_type = entry_header.INFO_map[ index ].Type;
		number = entry_header.INFO_map[ index ].N_entries;

		if (map_type == Integer)
			make_typed_int_vector(tmp_vector, tmp_info[ui].second, number );
		else if (map_type == Float)
			make_typed_float_vector(tmp_vector, tmp_info[ui].second, number );
		else if ( (map_type == Character) or (map_type == String) )
			make_typed_string(tmp_vector, tmp_info[ui].second, true );
		else if (map_type == Flag)
			make_typed_int(tmp_vector, 1, true );
		else
			LOG.error("Invalid type in INFO definition", 0);

		out_vector.insert(out_vector.end(), tmp_vector.begin(), tmp_vector.end());
	}
	tmp_vector.resize(0);
	uint32_t l_shared = (uint32_t)out_vector.size() - (uint32_t)(2*sizeof(uint32_t));
	memcpy(&out_vector[0], &l_shared, sizeof(l_shared));

	tmp_vector.resize(0);
	get_n_allele_info(tmp_vector);
	memcpy(&out_vector[vector_pos], &tmp_vector[0], tmp_vector.size());
	vector_pos += tmp_vector.size();

	tmp_vector.resize(0);
	get_FORMAT_binary(tmp_vector);
	unsigned int key_size, size, type, old_pos, out_size, format_pos = 0;
	unsigned int skip_size = 0;
	for (unsigned int ui=0; ui<(FORMAT.size()-N_FORMAT_removed); ui++)
	{
		format_pos = FORMAT_positions[ui];
		old_pos = format_pos;

		get_typed_int(&format_pos, tmp_vector, type, size);
		get_type(&format_pos, tmp_vector, type, size);
		key_size = format_pos - old_pos;
		out_size = out_vector.size();
		out_vector.resize( out_size + key_size );
		memcpy(&out_vector[out_size], &tmp_vector[old_pos], key_size );

		skip_size = FORMAT_skip[ui];
		for (unsigned int uj=0; uj<N_indv; uj++)
		{
			if (include_indv[uj] == false)
				continue;

			format_pos = FORMAT_positions[ui]+key_size+skip_size*uj;
			out_size = out_vector.size();
			out_vector.resize( out_size + skip_size );
			if ( ((int)ui == GT_idx) and (include_genotype[ui] == false) )
			{
				for (int p = 0; p < (int)skip_size; p++)
				{
					if (p < ploidy[uj])
						out_vector[out_size] = (int8_t)0x80;
					else
						out_vector[out_size] = (int8_t)0x81;
					out_size++;
				}
			}
			else
			{
				memcpy(&out_vector[out_size], &tmp_vector[format_pos], skip_size);
				out_size += skip_size;
			}
		}
	}
	tmp_vector.resize(0);
	get_n_fmt_sample(tmp_vector);
	memcpy(&out_vector[vector_pos], &tmp_vector[0], tmp_vector.size());

	uint32_t l_indv = (uint32_t)out_vector.size() - l_shared - (uint32_t)(2*sizeof(uint32_t));
	memcpy(&out_vector[sizeof(l_shared)], &l_indv, sizeof(l_indv));
	bgzf_write(out, &out_vector[0], out_vector.size());
}

// Assembly:
subq $0x5d8, %rsp            # imm = 0x5D8
movb %cl, %al
movq %rdi, 0x5d0(%rsp)
movq %rsi, 0x5c8(%rsp)
movq %rdx, 0x5c0(%rsp)
andb $0x1, %al
movb %al, 0x5bf(%rsp)
movq 0x5d0(%rsp), %rax
movq %rax, 0x240(%rsp)
movb 0x3d9(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x4109d
movq 0x240(%rsp), %rdi
movq (%rdi), %rax
movl $0x1, %esi
callq *0x18(%rax)
movq 0x240(%rsp), %rax
movb 0x3de(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x410c2
movq 0x240(%rsp), %rdi
callq 0x3f660
leaq 0x5a0(%rsp), %rdi
movq %rdi, 0x238(%rsp)
callq 0x2a300
leaq 0x588(%rsp), %rdi
callq 0x2a300
movq 0x238(%rsp), %rdi
movl $0x20, %esi
callq 0x20910
jmp 0x410f8
movl $0x8, 0x578(%rsp)
leaq 0x558(%rsp), %rdi
callq 0x67e0
leaq 0x538(%rsp), %rdi
callq 0x10260
leaq 0x520(%rsp), %rdi
callq 0x39970
movq 0x240(%rsp), %rsi
leaq 0x500(%rsp), %rdi
callq 0x4a260
jmp 0x41141
leaq 0x558(%rsp), %rdi
movq %rdi, 0x228(%rsp)
leaq 0x500(%rsp), %rsi
movq %rsi, 0x220(%rsp)
callq 0x66c0
movq 0x220(%rsp), %rdi
callq 0x6b50
movq 0x228(%rsp), %rdi
leaq 0x33f5c(%rip), %rsi     # 0x750de
callq 0xea20
movb %al, 0x237(%rsp)
jmp 0x41190
movb 0x237(%rsp), %al
testb $0x1, %al
jne 0x411f4
jmp 0x4119d
leaq 0x32f00(%rip), %rsi     # 0x740a4
leaq 0x558(%rsp), %rdi
callq 0xea20
movb %al, 0x21f(%rsp)
jmp 0x411ba
movb 0x21f(%rsp), %al
testb $0x1, %al
jne 0x411f4
jmp 0x411c7
leaq 0x34b5b(%rip), %rsi     # 0x75d29
leaq 0x558(%rsp), %rdi
callq 0xea20
movb %al, 0x21e(%rsp)
jmp 0x411e4
movb 0x21e(%rsp), %al
testb $0x1, %al
jne 0x411f4
jmp 0x412d6
leaq 0x4df(%rsp), %rdi
movq %rdi, 0x210(%rsp)
callq 0x69f0
movq 0x210(%rsp), %rdx
leaq 0x33ec8(%rip), %rsi     # 0x750e0
leaq 0x4e0(%rsp), %rdi
callq 0x67c0
jmp 0x41227
leaq 0x523d2(%rip), %rdi     # 0x93600
leaq 0x4e0(%rsp), %rsi
xorl %edx, %edx
callq 0x712f0
jmp 0x4123f
leaq 0x4e0(%rsp), %rdi
callq 0x6b50
leaq 0x4df(%rsp), %rdi
callq 0x65f0
jmp 0x412d6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x580(%rsp)
movl %eax, 0x57c(%rsp)
jmp 0x4293e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x580(%rsp)
movl %eax, 0x57c(%rsp)
jmp 0x42917
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x580(%rsp)
movl %eax, 0x57c(%rsp)
jmp 0x412c4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x580(%rsp)
movl %eax, 0x57c(%rsp)
leaq 0x4e0(%rsp), %rdi
callq 0x6b50
leaq 0x4df(%rsp), %rdi
callq 0x65f0
jmp 0x42917
movq 0x240(%rsp), %rdi
addq $0x130, %rdi            # imm = 0x130
leaq 0x558(%rsp), %rsi
callq 0x310f0
movq %rax, 0x208(%rsp)
jmp 0x412fc
movq 0x240(%rsp), %rdi
movq 0x208(%rsp), %rax
movq %rax, 0x4d0(%rsp)
addq $0x10, %rdi
addq $0x120, %rdi            # imm = 0x120
callq 0x31120
movq %rax, 0x4c8(%rsp)
leaq 0x4d0(%rsp), %rdi
leaq 0x4c8(%rsp), %rsi
callq 0x32ab0
testb $0x1, %al
jne 0x4134a
jmp 0x41403
leaq 0x33dbc(%rip), %rsi     # 0x7510d
leaq 0x488(%rsp), %rdi
leaq 0x558(%rsp), %rdx
callq 0xe8d0
jmp 0x41368
leaq 0x33dab(%rip), %rdx     # 0x7511a
leaq 0x4a8(%rsp), %rdi
leaq 0x488(%rsp), %rsi
callq 0xf4a0
jmp 0x41386
leaq 0x52273(%rip), %rdi     # 0x93600
leaq 0x4a8(%rsp), %rsi
xorl %edx, %edx
callq 0x712f0
jmp 0x4139e
leaq 0x4a8(%rsp), %rdi
callq 0x6b50
leaq 0x488(%rsp), %rdi
callq 0x6b50
jmp 0x41403
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x580(%rsp)
movl %eax, 0x57c(%rsp)
jmp 0x413f1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x580(%rsp)
movl %eax, 0x57c(%rsp)
leaq 0x4a8(%rsp), %rdi
callq 0x6b50
leaq 0x488(%rsp), %rdi
callq 0x6b50
jmp 0x42917
movq 0x240(%rsp), %rdi
addq $0x130, %rdi            # imm = 0x130
leaq 0x558(%rsp), %rsi
callq 0x30fe0
movq %rax, 0x200(%rsp)
jmp 0x41429
movq 0x200(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x484(%rsp)
movslq 0x578(%rsp), %rsi
leaq 0x5a0(%rsp), %rdi
callq 0x209b0
movq 0x240(%rsp), %rdi
movl 0x484(%rsp), %ecx
movl %ecx, (%rax)
movl 0x578(%rsp), %eax
addl $0x4, %eax
movl %eax, 0x578(%rsp)
leaq 0x588(%rsp), %rsi
callq 0x4cba0
jmp 0x41480
movslq 0x578(%rsp), %rsi
leaq 0x5a0(%rsp), %rdi
callq 0x209b0
movq %rax, 0x1e0(%rsp)
xorl %eax, %eax
movl %eax, %esi
movq %rsi, 0x1f8(%rsp)
leaq 0x588(%rsp), %rdi
movq %rdi, 0x1f0(%rsp)
callq 0x209b0
movq 0x1f0(%rsp), %rdi
movq %rax, 0x1e8(%rsp)
callq 0x249e0
movq 0x1e0(%rsp), %rdi
movq 0x1e8(%rsp), %rsi
movq %rax, %rdx
callq 0x6430
movq 0x1f0(%rsp), %rdi
callq 0x249e0
movq 0x1f0(%rsp), %rdi
movq 0x1f8(%rsp), %rsi
movq %rax, %rcx
movl 0x578(%rsp), %eax
addl %ecx, %eax
movl %eax, 0x578(%rsp)
callq 0x20910
jmp 0x41522
movq 0x240(%rsp), %rdi
leaq 0x588(%rsp), %rsi
callq 0x4cc00
jmp 0x41539
movslq 0x578(%rsp), %rsi
leaq 0x5a0(%rsp), %rdi
callq 0x209b0
movq %rax, 0x1c0(%rsp)
xorl %eax, %eax
movl %eax, %esi
movq %rsi, 0x1d8(%rsp)
leaq 0x588(%rsp), %rdi
movq %rdi, 0x1d0(%rsp)
callq 0x209b0
movq 0x1d0(%rsp), %rdi
movq %rax, 0x1c8(%rsp)
callq 0x249e0
movq 0x1c0(%rsp), %rdi
movq 0x1c8(%rsp), %rsi
movq %rax, %rdx
callq 0x6430
movq 0x1d0(%rsp), %rdi
callq 0x249e0
movq 0x1d0(%rsp), %rdi
movq 0x1d8(%rsp), %rsi
movq %rax, %rcx
movl 0x578(%rsp), %eax
addl %ecx, %eax
movl %eax, 0x578(%rsp)
callq 0x20910
jmp 0x415db
movq 0x240(%rsp), %rdi
leaq 0x588(%rsp), %rsi
callq 0x4ccc0
jmp 0x415f2
movslq 0x578(%rsp), %rsi
leaq 0x5a0(%rsp), %rdi
callq 0x209b0
movq %rax, 0x1a0(%rsp)
xorl %eax, %eax
movl %eax, %esi
movq %rsi, 0x1b8(%rsp)
leaq 0x588(%rsp), %rdi
movq %rdi, 0x1b0(%rsp)
callq 0x209b0
movq 0x1b0(%rsp), %rdi
movq %rax, 0x1a8(%rsp)
callq 0x249e0
movq 0x1a0(%rsp), %rdi
movq 0x1a8(%rsp), %rsi
movq %rax, %rdx
callq 0x6430
movq 0x1b0(%rsp), %rdi
callq 0x249e0
movq 0x1b0(%rsp), %rdi
movq 0x1b8(%rsp), %rsi
movq %rax, %rcx
movl 0x578(%rsp), %eax
addl %ecx, %eax
movl %eax, 0x578(%rsp)
callq 0x20910
jmp 0x41694
movq 0x240(%rsp), %rdi
leaq 0x588(%rsp), %rsi
callq 0x4ce50
jmp 0x416ab
leaq 0x5a0(%rsp), %rdi
movq %rdi, 0x190(%rsp)
callq 0x27020
movq %rax, 0x470(%rsp)
leaq 0x478(%rsp), %rdi
leaq 0x470(%rsp), %rsi
callq 0x39b20
leaq 0x588(%rsp), %rdi
movq %rdi, 0x188(%rsp)
callq 0x26ff0
movq 0x188(%rsp), %rdi
movq %rax, 0x468(%rsp)
callq 0x27020
movq 0x190(%rsp), %rdi
movq %rax, 0x460(%rsp)
movq 0x478(%rsp), %rsi
movq 0x468(%rsp), %rdx
movq 0x460(%rsp), %rcx
callq 0x39a60
movq %rax, 0x198(%rsp)
jmp 0x4173e
movq 0x198(%rsp), %rax
movq %rax, 0x458(%rsp)
xorl %eax, %eax
movl %eax, %esi
leaq 0x588(%rsp), %rdi
callq 0x20910
jmp 0x41761
movq 0x240(%rsp), %rdi
leaq 0x588(%rsp), %rsi
callq 0x4ce90
jmp 0x41778
leaq 0x5a0(%rsp), %rdi
movq %rdi, 0x178(%rsp)
callq 0x27020
movq %rax, 0x448(%rsp)
leaq 0x450(%rsp), %rdi
leaq 0x448(%rsp), %rsi
callq 0x39b20
leaq 0x588(%rsp), %rdi
movq %rdi, 0x170(%rsp)
callq 0x26ff0
movq 0x170(%rsp), %rdi
movq %rax, 0x440(%rsp)
callq 0x27020
movq 0x178(%rsp), %rdi
movq %rax, 0x438(%rsp)
movq 0x450(%rsp), %rsi
movq 0x440(%rsp), %rdx
movq 0x438(%rsp), %rcx
callq 0x39a60
movq %rax, 0x180(%rsp)
jmp 0x4180b
movq 0x180(%rsp), %rax
movq %rax, 0x430(%rsp)
xorl %eax, %eax
movl %eax, %esi
leaq 0x588(%rsp), %rdi
callq 0x20910
jmp 0x4182e
movq 0x240(%rsp), %rdi
leaq 0x538(%rsp), %rsi
callq 0x4afe0
jmp 0x41845
leaq 0x538(%rsp), %rdi
callq 0x39710
testb $0x1, %al
jne 0x41858
jmp 0x41881
movq 0x240(%rsp), %rdi
leaq 0x588(%rsp), %rsi
leaq 0x538(%rsp), %rdx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x47050
jmp 0x4187c
jmp 0x41af8
leaq 0x418(%rsp), %rdi
callq 0xea00
movl $0x0, 0x414(%rsp)
movl 0x414(%rsp), %eax
movq %rax, 0x168(%rsp)
leaq 0x538(%rsp), %rdi
callq 0x10270
movq %rax, %rcx
movq 0x168(%rsp), %rax
cmpq %rcx, %rax
jae 0x41ab8
movq 0x240(%rsp), %rax
addq $0x160, %rax            # imm = 0x160
movq %rax, 0x158(%rsp)
movl 0x414(%rsp), %eax
movl %eax, %esi
leaq 0x538(%rsp), %rdi
callq 0x10290
movq 0x158(%rsp), %rdi
movq %rax, %rsi
callq 0x310f0
movq %rax, 0x160(%rsp)
jmp 0x4190f
movq 0x240(%rsp), %rdi
movq 0x160(%rsp), %rax
movq %rax, 0x408(%rsp)
addq $0x10, %rdi
addq $0x150, %rdi            # imm = 0x150
callq 0x31120
movq %rax, 0x400(%rsp)
leaq 0x408(%rsp), %rdi
leaq 0x400(%rsp), %rsi
callq 0x32ab0
testb $0x1, %al
jne 0x4195d
jmp 0x41a41
movl 0x414(%rsp), %eax
movl %eax, %esi
leaq 0x538(%rsp), %rdi
callq 0x10290
movq %rax, %rdx
leaq 0x337c3(%rip), %rsi     # 0x75140
leaq 0x3c0(%rsp), %rdi
callq 0xe8d0
jmp 0x4198c
leaq 0x336f0(%rip), %rdx     # 0x75083
leaq 0x3e0(%rsp), %rdi
leaq 0x3c0(%rsp), %rsi
callq 0xf4a0
jmp 0x419aa
leaq 0x51c4f(%rip), %rdi     # 0x93600
leaq 0x3e0(%rsp), %rsi
callq 0x71610
jmp 0x419c0
leaq 0x3e0(%rsp), %rdi
callq 0x6b50
leaq 0x3c0(%rsp), %rdi
callq 0x6b50
jmp 0x41aa0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x580(%rsp)
movl %eax, 0x57c(%rsp)
jmp 0x41ae6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x580(%rsp)
movl %eax, 0x57c(%rsp)
jmp 0x41a2f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x580(%rsp)
movl %eax, 0x57c(%rsp)
leaq 0x3e0(%rsp), %rdi
callq 0x6b50
leaq 0x3c0(%rsp), %rdi
callq 0x6b50
jmp 0x41ae6
movq 0x240(%rsp), %rax
addq $0x160, %rax            # imm = 0x160
movq %rax, 0x148(%rsp)
movl 0x414(%rsp), %eax
movl %eax, %esi
leaq 0x538(%rsp), %rdi
callq 0x10290
movq 0x148(%rsp), %rdi
movq %rax, %rsi
callq 0x30fe0
movq %rax, 0x150(%rsp)
jmp 0x41a87
movq 0x150(%rsp), %rsi
leaq 0x418(%rsp), %rdi
callq 0xea50
jmp 0x41a9e
jmp 0x41aa0
jmp 0x41aa2
movl 0x414(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x414(%rsp)
jmp 0x41899
movq 0x240(%rsp), %rdi
leaq 0x588(%rsp), %rsi
leaq 0x418(%rsp), %rdx
callq 0x476b0
jmp 0x41ad7
leaq 0x418(%rsp), %rdi
callq 0xed70
jmp 0x41af8
leaq 0x418(%rsp), %rdi
callq 0xed70
jmp 0x42917
leaq 0x588(%rsp), %rdi
callq 0x39540
testb $0x1, %al
jne 0x41b0b
jmp 0x41b3c
movq 0x240(%rsp), %rdi
movl $0x0, 0x3bc(%rsp)
leaq 0x588(%rsp), %rsi
leaq 0x3bc(%rsp), %rdx
movl $0x1, %ecx
callq 0x45d20
jmp 0x41b3a
jmp 0x41b3c
leaq 0x5a0(%rsp), %rdi
movq %rdi, 0x138(%rsp)
callq 0x27020
movq %rax, 0x3a8(%rsp)
leaq 0x3b0(%rsp), %rdi
leaq 0x3a8(%rsp), %rsi
callq 0x39b20
leaq 0x588(%rsp), %rdi
movq %rdi, 0x130(%rsp)
callq 0x26ff0
movq 0x130(%rsp), %rdi
movq %rax, 0x3a0(%rsp)
callq 0x27020
movq 0x138(%rsp), %rdi
movq %rax, 0x398(%rsp)
movq 0x3b0(%rsp), %rsi
movq 0x3a0(%rsp), %rdx
movq 0x398(%rsp), %rcx
callq 0x39a60
movq %rax, 0x140(%rsp)
jmp 0x41bcf
movq 0x240(%rsp), %rsi
movq 0x140(%rsp), %rax
movq %rax, 0x390(%rsp)
movq 0x5c0(%rsp), %rdx
movzbl 0x5bf(%rsp), %ecx
andl $0x1, %ecx
leaq 0x370(%rsp), %rdi
callq 0x4b4f0
jmp 0x41c09
leaq 0x520(%rsp), %rdi
leaq 0x370(%rsp), %rsi
callq 0x39980
leaq 0x370(%rsp), %rdi
callq 0x399c0
movl $0x0, 0x36c(%rsp)
movl 0x36c(%rsp), %eax
movq %rax, 0x128(%rsp)
leaq 0x520(%rsp), %rdi
callq 0x39a20
movq %rax, %rcx
movq 0x128(%rsp), %rax
cmpq %rcx, %rax
jae 0x42220
movq 0x240(%rsp), %rax
addq $0x190, %rax            # imm = 0x190
movq %rax, 0x118(%rsp)
movl 0x36c(%rsp), %eax
movl %eax, %esi
leaq 0x520(%rsp), %rdi
callq 0x39a40
movq 0x118(%rsp), %rdi
movq %rax, %rsi
callq 0x310f0
movq %rax, 0x120(%rsp)
jmp 0x41cac
movq 0x240(%rsp), %rdi
movq 0x120(%rsp), %rax
movq %rax, 0x360(%rsp)
addq $0x10, %rdi
addq $0x180, %rdi            # imm = 0x180
callq 0x31120
movq %rax, 0x358(%rsp)
leaq 0x360(%rsp), %rdi
leaq 0x358(%rsp), %rsi
callq 0x32ab0
testb $0x1, %al
jne 0x41cfa
jmp 0x41ddc
movl 0x36c(%rsp), %eax
movl %eax, %esi
leaq 0x520(%rsp), %rdi
callq 0x39a40
movq %rax, %rdx
leaq 0x33434(%rip), %rsi     # 0x7514e
leaq 0x318(%rsp), %rdi
callq 0xe8d0
jmp 0x41d29
leaq 0x33353(%rip), %rdx     # 0x75083
leaq 0x338(%rsp), %rdi
leaq 0x318(%rsp), %rsi
callq 0xf4a0
jmp 0x41d47
leaq 0x518b2(%rip), %rdi     # 0x93600
leaq 0x338(%rsp), %rsi
callq 0x71610
jmp 0x41d5d
leaq 0x338(%rsp), %rdi
callq 0x6b50
leaq 0x318(%rsp), %rdi
callq 0x6b50
movq 0x240(%rsp), %rax
movl 0x4c8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x4c8(%rax)
jmp 0x4220a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x580(%rsp)
movl %eax, 0x57c(%rsp)
jmp 0x41dca
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x580(%rsp)
movl %eax, 0x57c(%rsp)
leaq 0x338(%rsp), %rdi
callq 0x6b50
leaq 0x318(%rsp), %rdi
callq 0x6b50
jmp 0x42917
xorl %eax, %eax
movl %eax, %esi
leaq 0x588(%rsp), %rdi
callq 0x20910
jmp 0x41def
movq 0x240(%rsp), %rax
addq $0x190, %rax            # imm = 0x190
movq %rax, 0x108(%rsp)
movl 0x36c(%rsp), %eax
movl %eax, %esi
leaq 0x520(%rsp), %rdi
callq 0x39a40
movq 0x108(%rsp), %rdi
movq %rax, %rsi
callq 0x30fe0
movq %rax, 0x110(%rsp)
jmp 0x41e35
movq 0x240(%rsp), %rdi
movq 0x110(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x554(%rsp)
leaq 0x588(%rsp), %rsi
leaq 0x554(%rsp), %rdx
movl $0x1, %ecx
callq 0x45d20
jmp 0x41e6a
leaq 0x5a0(%rsp), %rdi
movq %rdi, 0xf8(%rsp)
callq 0x27020
movq %rax, 0x308(%rsp)
leaq 0x310(%rsp), %rdi
leaq 0x308(%rsp), %rsi
callq 0x39b20
leaq 0x588(%rsp), %rdi
movq %rdi, 0xf0(%rsp)
callq 0x26ff0
movq 0xf0(%rsp), %rdi
movq %rax, 0x300(%rsp)
callq 0x27020
movq 0xf8(%rsp), %rdi
movq %rax, 0x2f8(%rsp)
movq 0x310(%rsp), %rsi
movq 0x300(%rsp), %rdx
movq 0x2f8(%rsp), %rcx
callq 0x39a60
movq %rax, 0x100(%rsp)
jmp 0x41efd
movq 0x100(%rsp), %rax
movq %rax, 0x2f0(%rsp)
xorl %eax, %eax
movl %eax, %esi
leaq 0x588(%rsp), %rdi
callq 0x20910
jmp 0x41f20
movq 0x240(%rsp), %rdi
addq $0x70, %rdi
leaq 0x554(%rsp), %rsi
callq 0x30ef0
movq %rax, 0xe8(%rsp)
jmp 0x41f43
movq 0x240(%rsp), %rdi
movq 0xe8(%rsp), %rax
movl 0x88(%rax), %eax
movl %eax, 0x38c(%rsp)
addq $0x70, %rdi
leaq 0x554(%rsp), %rsi
callq 0x30ef0
movq %rax, 0xe0(%rsp)
jmp 0x41f7b
movq 0xe0(%rsp), %rax
movl 0x44(%rax), %eax
movl %eax, 0x388(%rsp)
cmpl $0x0, 0x38c(%rsp)
jne 0x41fd7
movl 0x36c(%rsp), %eax
movl %eax, %esi
leaq 0x520(%rsp), %rdi
callq 0x39a40
movq 0x240(%rsp), %rdi
movq %rax, %rdx
addq $0x20, %rdx
movl 0x388(%rsp), %ecx
leaq 0x588(%rsp), %rsi
callq 0x46a60
jmp 0x41fd2
jmp 0x42167
cmpl $0x1, 0x38c(%rsp)
jne 0x42021
movl 0x36c(%rsp), %eax
movl %eax, %esi
leaq 0x520(%rsp), %rdi
callq 0x39a40
movq 0x240(%rsp), %rdi
movq %rax, %rdx
addq $0x20, %rdx
movl 0x388(%rsp), %ecx
leaq 0x588(%rsp), %rsi
callq 0x47ad0
jmp 0x4201c
jmp 0x42165
cmpl $0x2, 0x38c(%rsp)
je 0x42035
cmpl $0x3, 0x38c(%rsp)
jne 0x42073
movl 0x36c(%rsp), %eax
movl %eax, %esi
leaq 0x520(%rsp), %rdi
callq 0x39a40
movq 0x240(%rsp), %rdi
movq %rax, %rdx
addq $0x20, %rdx
leaq 0x588(%rsp), %rsi
movl $0x1, %ecx
callq 0x45960
jmp 0x4206e
jmp 0x42163
cmpl $0x4, 0x38c(%rsp)
jne 0x420b1
movq 0x240(%rsp), %rdi
movl $0x1, 0x2ec(%rsp)
leaq 0x588(%rsp), %rsi
leaq 0x2ec(%rsp), %rdx
movl $0x1, %ecx
callq 0x45d20
jmp 0x420ac
jmp 0x42161
leaq 0x2c7(%rsp), %rdi
movq %rdi, 0xd8(%rsp)
callq 0x69f0
movq 0xd8(%rsp), %rdx
leaq 0x32f55(%rip), %rsi     # 0x7502a
leaq 0x2c8(%rsp), %rdi
callq 0x67c0
jmp 0x420e4
leaq 0x51515(%rip), %rdi     # 0x93600
leaq 0x2c8(%rsp), %rsi
xorl %edx, %edx
callq 0x712f0
jmp 0x420fc
leaq 0x2c8(%rsp), %rdi
callq 0x6b50
leaq 0x2c7(%rsp), %rdi
callq 0x65f0
jmp 0x42161
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x580(%rsp)
movl %eax, 0x57c(%rsp)
jmp 0x4214f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x580(%rsp)
movl %eax, 0x57c(%rsp)
leaq 0x2c8(%rsp), %rdi
callq 0x6b50
leaq 0x2c7(%rsp), %rdi
callq 0x65f0
jmp 0x42917
jmp 0x42163
jmp 0x42165
jmp 0x42167
leaq 0x5a0(%rsp), %rdi
movq %rdi, 0xc8(%rsp)
callq 0x27020
movq %rax, 0x2b0(%rsp)
leaq 0x2b8(%rsp), %rdi
leaq 0x2b0(%rsp), %rsi
callq 0x39b20
leaq 0x588(%rsp), %rdi
movq %rdi, 0xc0(%rsp)
callq 0x26ff0
movq 0xc0(%rsp), %rdi
movq %rax, 0x2a8(%rsp)
callq 0x27020
movq 0xc8(%rsp), %rdi
movq %rax, 0x2a0(%rsp)
movq 0x2b8(%rsp), %rsi
movq 0x2a8(%rsp), %rdx
movq 0x2a0(%rsp), %rcx
callq 0x39a60
movq %rax, 0xd0(%rsp)
jmp 0x421fa
movq 0xd0(%rsp), %rax
movq %rax, 0x298(%rsp)
movl 0x36c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x36c(%rsp)
jmp 0x41c36
xorl %eax, %eax
movl %eax, %esi
leaq 0x588(%rsp), %rdi
callq 0x20910
jmp 0x42233
leaq 0x5a0(%rsp), %rdi
movq %rdi, 0xb0(%rsp)
callq 0x249e0
movq 0xb0(%rsp), %rdi
addl $-0x8, %eax
movl %eax, 0x294(%rsp)
xorl %eax, %eax
movl %eax, %esi
movq %rsi, 0xb8(%rsp)
callq 0x209b0
movq 0xb8(%rsp), %rsi
movl 0x294(%rsp), %ecx
movl %ecx, (%rax)
leaq 0x588(%rsp), %rdi
callq 0x20910
jmp 0x4228b
movq 0x240(%rsp), %rdi
leaq 0x588(%rsp), %rsi
callq 0x4cd20
jmp 0x422a2
movslq 0x578(%rsp), %rsi
leaq 0x5a0(%rsp), %rdi
callq 0x209b0
movq %rax, 0x90(%rsp)
xorl %eax, %eax
movl %eax, %esi
movq %rsi, 0xa8(%rsp)
leaq 0x588(%rsp), %rdi
movq %rdi, 0xa0(%rsp)
callq 0x209b0
movq 0xa0(%rsp), %rdi
movq %rax, 0x98(%rsp)
callq 0x249e0
movq 0x90(%rsp), %rdi
movq 0x98(%rsp), %rsi
movq %rax, %rdx
callq 0x6430
movq 0xa0(%rsp), %rdi
callq 0x249e0
movq 0xa0(%rsp), %rdi
movq 0xa8(%rsp), %rsi
movq %rax, %rcx
movl 0x578(%rsp), %eax
addl %ecx, %eax
movl %eax, 0x578(%rsp)
callq 0x20910
jmp 0x42344
movq 0x240(%rsp), %rdi
leaq 0x588(%rsp), %rsi
callq 0x4bb20
jmp 0x4235b
movl $0x0, 0x27c(%rsp)
movl $0x0, 0x278(%rsp)
movl $0x0, 0x274(%rsp)
movq 0x240(%rsp), %rdi
movl 0x274(%rsp), %eax
movq %rax, 0x88(%rsp)
addq $0x498, %rdi            # imm = 0x498
callq 0x10270
movq 0x240(%rsp), %rdx
movq %rax, %rcx
movq 0x88(%rsp), %rax
movslq 0x4cc(%rdx), %rdx
subq %rdx, %rcx
cmpq %rcx, %rax
jae 0x427d7
movq 0x240(%rsp), %rdi
addq $0x640, %rdi            # imm = 0x640
movl 0x274(%rsp), %eax
movl %eax, %esi
callq 0xe8b0
movq 0x240(%rsp), %rdi
movl (%rax), %eax
movl %eax, 0x27c(%rsp)
movl 0x27c(%rsp), %eax
movl %eax, 0x284(%rsp)
leaq 0x27c(%rsp), %rsi
leaq 0x588(%rsp), %rdx
leaq 0x288(%rsp), %rcx
leaq 0x28c(%rsp), %r8
callq 0x48bf0
jmp 0x42428
movq 0x240(%rsp), %rdi
leaq 0x27c(%rsp), %rsi
leaq 0x588(%rsp), %rdx
leaq 0x288(%rsp), %rcx
leaq 0x28c(%rsp), %r8
callq 0x489f0
jmp 0x42457
movl 0x27c(%rsp), %eax
movl 0x284(%rsp), %ecx
subl %ecx, %eax
movl %eax, 0x290(%rsp)
leaq 0x5a0(%rsp), %rdi
movq %rdi, 0x80(%rsp)
callq 0x249e0
movq 0x80(%rsp), %rdi
movl %eax, 0x280(%rsp)
movl 0x280(%rsp), %eax
movl 0x290(%rsp), %ecx
addl %ecx, %eax
movl %eax, %esi
callq 0x20910
jmp 0x424ab
movl 0x280(%rsp), %eax
movl %eax, %esi
leaq 0x5a0(%rsp), %rdi
callq 0x209b0
movq %rax, 0x78(%rsp)
movl 0x284(%rsp), %eax
movl %eax, %esi
leaq 0x588(%rsp), %rdi
callq 0x209b0
movq 0x78(%rsp), %rdi
movq %rax, %rsi
movl 0x290(%rsp), %eax
movl %eax, %edx
callq 0x6430
movq 0x240(%rsp), %rdi
addq $0x688, %rdi            # imm = 0x688
movl 0x274(%rsp), %eax
movl %eax, %esi
callq 0xe8b0
movl (%rax), %eax
movl %eax, 0x278(%rsp)
movl $0x0, 0x270(%rsp)
movq 0x240(%rsp), %rcx
movl 0x270(%rsp), %eax
cmpl 0x8(%rcx), %eax
jae 0x427bf
movq 0x240(%rsp), %rdi
addq $0x1f0, %rdi            # imm = 0x1F0
movl 0x270(%rsp), %eax
movl %eax, %esi
callq 0x102b0
movq %rdx, 0x68(%rsp)
movq %rax, 0x70(%rsp)
jmp 0x42564
movq 0x68(%rsp), %rax
movq 0x70(%rsp), %rcx
movq %rcx, 0x260(%rsp)
movq %rax, 0x268(%rsp)
leaq 0x260(%rsp), %rdi
callq 0x10310
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x4259a
jmp 0x427a9
movq 0x240(%rsp), %rdi
addq $0x640, %rdi            # imm = 0x640
movl 0x274(%rsp), %eax
movl %eax, %esi
callq 0xe8b0
movl (%rax), %eax
movl 0x290(%rsp), %ecx
addl %ecx, %eax
movl 0x278(%rsp), %ecx
movl 0x270(%rsp), %edx
imull %edx, %ecx
addl %ecx, %eax
movl %eax, 0x27c(%rsp)
leaq 0x5a0(%rsp), %rdi
movq %rdi, 0x60(%rsp)
callq 0x249e0
movq 0x60(%rsp), %rdi
movl %eax, 0x280(%rsp)
movl 0x280(%rsp), %eax
movl 0x278(%rsp), %ecx
addl %ecx, %eax
movl %eax, %esi
callq 0x20910
jmp 0x42613
movq 0x240(%rsp), %rdx
movl 0x274(%rsp), %ecx
xorl %eax, %eax
cmpl 0x630(%rdx), %ecx
movb %al, 0x5f(%rsp)
jne 0x4268f
movq 0x240(%rsp), %rdi
addq $0x218, %rdi            # imm = 0x218
movl 0x274(%rsp), %eax
movl %eax, %esi
callq 0x102b0
movq %rdx, 0x48(%rsp)
movq %rax, 0x50(%rsp)
jmp 0x42659
movq 0x48(%rsp), %rax
movq 0x50(%rsp), %rcx
movq %rcx, 0x250(%rsp)
movq %rax, 0x258(%rsp)
leaq 0x250(%rsp), %rdi
callq 0x10310
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
sete %al
movb %al, 0x5f(%rsp)
movb 0x5f(%rsp), %al
testb $0x1, %al
jne 0x4269c
jmp 0x4274b
movl $0x0, 0x24c(%rsp)
movl 0x24c(%rsp), %eax
cmpl 0x278(%rsp), %eax
jge 0x42749
movq 0x240(%rsp), %rdi
movl 0x24c(%rsp), %eax
movl %eax, 0x44(%rsp)
addq $0x4e8, %rdi            # imm = 0x4E8
movl 0x270(%rsp), %eax
movl %eax, %esi
callq 0xecf0
movq %rax, %rcx
movl 0x44(%rsp), %eax
cmpl (%rcx), %eax
jge 0x42709
movl 0x280(%rsp), %eax
movl %eax, %esi
leaq 0x5a0(%rsp), %rdi
callq 0x209b0
movb $-0x80, (%rax)
jmp 0x42722
movl 0x280(%rsp), %eax
movl %eax, %esi
leaq 0x5a0(%rsp), %rdi
callq 0x209b0
movb $-0x7f, (%rax)
movl 0x280(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x280(%rsp)
movl 0x24c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x24c(%rsp)
jmp 0x426a7
jmp 0x427a7
movl 0x280(%rsp), %eax
movl %eax, %esi
leaq 0x5a0(%rsp), %rdi
callq 0x209b0
movq %rax, 0x38(%rsp)
movl 0x27c(%rsp), %eax
movl %eax, %esi
leaq 0x588(%rsp), %rdi
callq 0x209b0
movq 0x38(%rsp), %rdi
movq %rax, %rsi
movl 0x278(%rsp), %eax
movl %eax, %edx
callq 0x6430
movl 0x278(%rsp), %eax
addl 0x280(%rsp), %eax
movl %eax, 0x280(%rsp)
jmp 0x427a9
movl 0x270(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x270(%rsp)
jmp 0x42523
jmp 0x427c1
movl 0x274(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x274(%rsp)
jmp 0x4237c
xorl %eax, %eax
movl %eax, %esi
leaq 0x588(%rsp), %rdi
callq 0x20910
jmp 0x427ea
movq 0x240(%rsp), %rdi
leaq 0x588(%rsp), %rsi
callq 0x4cdc0
jmp 0x42801
movslq 0x578(%rsp), %rsi
leaq 0x5a0(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0x209b0
movq %rax, 0x8(%rsp)
xorl %eax, %eax
movl %eax, %esi
movq %rsi, 0x18(%rsp)
leaq 0x588(%rsp), %rdi
movq %rdi, (%rsp)
callq 0x209b0
movq (%rsp), %rdi
movq %rax, 0x10(%rsp)
callq 0x249e0
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq %rax, %rdx
callq 0x6430
movq 0x20(%rsp), %rdi
callq 0x249e0
movq 0x20(%rsp), %rdi
movl 0x294(%rsp), %ecx
subl %ecx, %eax
addl $-0x8, %eax
movl %eax, 0x248(%rsp)
movl $0x4, %esi
callq 0x209b0
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdi
movl 0x248(%rsp), %ecx
movl %ecx, (%rax)
movq 0x5c8(%rsp), %rax
movq %rax, 0x28(%rsp)
callq 0x209b0
movq 0x20(%rsp), %rdi
movq %rax, 0x30(%rsp)
callq 0x249e0
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rsi
movq %rax, %rdx
callq 0x725f0
jmp 0x428ce
leaq 0x520(%rsp), %rdi
callq 0x399c0
leaq 0x538(%rsp), %rdi
callq 0x10cc0
leaq 0x558(%rsp), %rdi
callq 0x6b50
leaq 0x588(%rsp), %rdi
callq 0x267c0
leaq 0x5a0(%rsp), %rdi
callq 0x267c0
addq $0x5d8, %rsp            # imm = 0x5D8
retq
leaq 0x520(%rsp), %rdi
callq 0x399c0
leaq 0x538(%rsp), %rdi
callq 0x10cc0
leaq 0x558(%rsp), %rdi
callq 0x6b50
leaq 0x588(%rsp), %rdi
callq 0x267c0
leaq 0x5a0(%rsp), %rdi
callq 0x267c0
movq 0x580(%rsp), %rdi
callq 0x69e0
nopw %cs:(%rax,%rax)