// File: /workspace/github_cpp_makefile_star2_O2/auton1[P]viterbi/vcf_entry.cpp
// Function: vcf_entry::parse_FORMAT()
void vcf_entry::parse_FORMAT()
{
	FORMAT_binary.resize(0);
	vector<char> tmp_vector;
	vector<string> tmp_split;
	vector< vector<string> > format_matrix(N_indv);

	unsigned int type, number, size, position=0;

	for (unsigned int ui=0; ui<N_indv; ui++)
	{
		if ( (GENOTYPE_str[ui] != "") and (GENOTYPE_str[ui] != ".") )
			header::tokenize(GENOTYPE_str[ui],':', tmp_split);
		else
			tmp_split.assign(FORMAT.size(),".");
		format_matrix[ui] = tmp_split;

		for (unsigned int uj=format_matrix[ui].size(); uj<FORMAT.size(); uj++)
			format_matrix[ui].push_back(".");
	}

	FORMAT_positions.resize(FORMAT.size()); FORMAT_types.resize(FORMAT.size()); FORMAT_skip.resize(FORMAT.size());

	for (unsigned int ui=0; ui<FORMAT.size(); ui++)
	{
		if (entry_header.FORMAT_reverse_map.find(FORMAT[ui]) == entry_header.FORMAT_reverse_map.end())
		{
			LOG.one_off_warning("FORMAT value " + FORMAT[ui] + " is not defined in the header and will not be encoded.");
			N_FORMAT_removed++;
			continue;
		}
		FORMAT_positions[ui] = position;
		make_typed_int(tmp_vector, entry_header.FORMAT_reverse_map[ FORMAT[ui] ], true );
		FORMAT_binary.insert(FORMAT_binary.end(), tmp_vector.begin(), tmp_vector.end() );

		tmp_vector.resize(0);
		tmp_split.resize(0);

		type = entry_header.FORMAT_map[ entry_header.FORMAT_reverse_map[FORMAT[ui]] ].Type;
		number = entry_header.FORMAT_map[ entry_header.FORMAT_reverse_map[FORMAT[ui]] ].N_entries;

		for (unsigned int uj=0; uj<N_indv; uj++)
			tmp_split.push_back( format_matrix[uj][ui] );

		if ((int)ui == GT_idx)
			make_typed_GT_vector(tmp_vector, tmp_split );
		else if (type == Integer)
			make_typed_int_vector(tmp_vector, tmp_split, number );
		else if (type == Float)
			make_typed_float_vector(tmp_vector, tmp_split, number );
		else if ( (type == Character) or (type == String) )
			make_typed_string_vector(tmp_vector, tmp_split, number );
		else
			LOG.error("Invalid type in FORMAT definition", 0);

		position = 0;
		get_type(&position, tmp_vector, type, size);
		FORMAT_types[ui] = type;

		if ( (type == 1) || (type == 7) )
			FORMAT_skip[ui] = size*sizeof(int8_t);
		else if (type == 2)
			FORMAT_skip[ui] = size*sizeof(int16_t);
		else if ( (type == 3) || (type == 5) )
			FORMAT_skip[ui] = size*sizeof(int32_t);

		FORMAT_binary.insert(FORMAT_binary.end(), tmp_vector.begin(), tmp_vector.end() );
		tmp_vector.resize(0);
		position = FORMAT_binary.size();
	}
	parsed_FORMAT_binary = true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movq %rdi, %rbx
addq $0x4b0, %rdi            # imm = 0x4B0
movq %rdi, 0x48(%rsp)
xorl %esi, %esi
callq 0xcc7c
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
andq $0x0, 0x30(%rsp)
movaps %xmm0, 0x50(%rsp)
andq $0x0, 0x60(%rsp)
movl 0x8(%rbx), %esi
leaq 0x68(%rsp), %rdi
leaq 0x98(%rsp), %rdx
callq 0x19826
andl $0x0, 0xc(%rsp)
xorl %r15d, %r15d
leaq 0x98(%rsp), %r13
leaq 0x1f(%rsp), %rbp
movl 0x8(%rbx), %eax
cmpq %rax, %r15
jae 0x17def
movq %r15, %r14
shlq $0x5, %r14
movq 0x758(%rbx), %rdi
addq %r14, %rdi
leaq 0x1714f(%rip), %rsi     # 0x2ee37
callq 0x12f17
testb %al, %al
je 0x17d24
movq 0x758(%rbx), %rdi
addq %r14, %rdi
leaq 0x1642b(%rip), %rsi     # 0x2e12d
callq 0x12f17
testb %al, %al
je 0x17d24
addq 0x758(%rbx), %r14
movq %r14, %rdi
pushq $0x3a
popq %rsi
leaq 0x50(%rsp), %rdx
callq 0x126cc
jmp 0x17d69
movq %r15, %r12
movq 0x498(%rbx), %r15
movq 0x4a0(%rbx), %r14
movq %r13, %rdi
leaq 0x163ee(%rip), %rsi     # 0x2e12d
movq %rbp, %rdx
callq 0x5160
subq %r15, %r14
sarq $0x5, %r14
leaq 0x50(%rsp), %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x19cfa
movq %r13, %rdi
callq 0x5908
movq %r12, %r15
imulq $0x18, %r15, %r12
movq 0x68(%rsp), %rdi
addq %r12, %rdi
leaq 0x50(%rsp), %rsi
callq 0xcca8
movq %r15, 0x38(%rsp)
movq 0x68(%rsp), %rax
movq 0x8(%rax,%r12), %r15
subq (%rax,%r12), %r15
shrq $0x5, %r15
movl %r15d, %eax
movq 0x4a0(%rbx), %rcx
subq 0x498(%rbx), %rcx
sarq $0x5, %rcx
cmpq %rax, %rcx
jbe 0x17de2
movq 0x68(%rsp), %r14
movq %r13, %rdi
leaq 0x1636e(%rip), %rsi     # 0x2e12d
movq %rbp, %rdx
callq 0x5160
addq %r12, %r14
movq %r14, %rdi
movq %r13, %rsi
callq 0x10122
movq %r13, %rdi
callq 0x5908
incl %r15d
jmp 0x17d96
movq 0x38(%rsp), %r15
incq %r15
jmp 0x17cc4
leaq 0x640(%rbx), %rdi
movq 0x4a0(%rbx), %rsi
subq 0x498(%rbx), %rsi
sarq $0x5, %rsi
callq 0x162cc
leaq 0x658(%rbx), %rdi
movq 0x4a0(%rbx), %rsi
subq 0x498(%rbx), %rsi
sarq $0x5, %rsi
movq %rdi, 0x88(%rsp)
callq 0x162cc
leaq 0x688(%rbx), %rdi
movq 0x4a0(%rbx), %rsi
subq 0x498(%rbx), %rsi
sarq $0x5, %rsi
movq %rdi, 0x80(%rsp)
callq 0x162cc
leaq 0x1c0(%rbx), %r13
leaq 0x1c8(%rbx), %rax
movq %rax, 0x90(%rsp)
leaq 0xd0(%rbx), %rax
movq %rax, 0x38(%rsp)
xorl %r12d, %r12d
leaq 0x50(%rsp), %r15
movq %r13, 0x40(%rsp)
movl %r12d, %r12d
movq 0x498(%rbx), %rsi
movq 0x4a0(%rbx), %rax
subq %rsi, %rax
sarq $0x5, %rax
cmpq %r12, %rax
jbe 0x1817a
movq %r12, %r14
shlq $0x5, %r14
addq %r14, %rsi
movq %r13, %rdi
callq 0x13a1a
cmpq 0x90(%rsp), %rax
je 0x17fce
movl 0xc(%rsp), %eax
movq 0x640(%rbx), %rcx
movl %eax, (%rcx,%r12,4)
movq 0x498(%rbx), %rsi
addq %r14, %rsi
movq %r13, %rdi
callq 0x1316c
movq %rbx, %rdi
leaq 0x20(%rsp), %rsi
movq %rax, %rdx
pushq $0x1
popq %rcx
callq 0x1a272
movq 0x4b8(%rbx), %rsi
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rcx
movq 0x48(%rsp), %rdi
callq 0x163d4
leaq 0x20(%rsp), %rdi
xorl %esi, %esi
callq 0xcc7c
movq %r15, %rdi
xorl %esi, %esi
callq 0xfd72
movq 0x498(%rbx), %rsi
addq %r14, %rsi
movq %r13, %rdi
callq 0x1316c
movq 0x38(%rsp), %rdi
movq %rax, %rsi
callq 0x1311e
movl 0x88(%rax), %eax
movl %eax, 0x18(%rsp)
movq 0x498(%rbx), %rsi
addq %r14, %rsi
movq %r13, %rdi
callq 0x1316c
movq 0x38(%rsp), %rdi
movq %rax, %rsi
callq 0x1311e
movl 0x44(%rax), %eax
movl %eax, 0x10(%rsp)
xorl %r13d, %r13d
xorl %ebp, %ebp
movl 0x8(%rbx), %eax
cmpq %rax, %rbp
jae 0x17fa7
movq 0x68(%rsp), %rax
movq (%rax,%r13), %rsi
addq %r14, %rsi
movq %r15, %rdi
callq 0xfda2
incq %rbp
addq $0x18, %r13
jmp 0x17f82
cmpl 0x630(%rbx), %r12d
jne 0x18038
movq %rbx, %rdi
leaq 0x20(%rsp), %rsi
movq %r15, %rdx
callq 0x1a5a2
movq 0x40(%rsp), %r13
jmp 0x180cc
addq 0x498(%rbx), %r14
leaq 0x98(%rsp), %rbp
movq %rbp, %rdi
leaq 0x160dd(%rip), %rsi     # 0x2e0c4
movq %r14, %rdx
callq 0x967d
leaq 0xd8(%rsp), %r14
movq %r14, %rdi
movq %rbp, %rsi
leaq 0x160ce(%rip), %rdx     # 0x2e0d2
callq 0x98b6
leaq 0x294c0(%rip), %rdi     # 0x414d0
movq %r14, %rsi
callq 0x2c10c
movq %r14, %rdi
callq 0x5908
leaq 0x98(%rsp), %rdi
callq 0x5908
incl 0x4cc(%rbx)
jmp 0x18172
movl 0x18(%rsp), %eax
cmpl $0x1, %eax
movq 0x40(%rsp), %r13
je 0x18060
testl %eax, %eax
jne 0x18076
movq %rbx, %rdi
leaq 0x20(%rsp), %rsi
movq %r15, %rdx
movl 0x10(%rsp), %ecx
callq 0x1aa5a
jmp 0x180cc
movq %rbx, %rdi
leaq 0x20(%rsp), %rsi
movq %r15, %rdx
movl 0x10(%rsp), %ecx
callq 0x1b06a
jmp 0x180cc
andl $-0x2, %eax
cmpl $0x2, %eax
jne 0x18094
movq %rbx, %rdi
leaq 0x20(%rsp), %rsi
movq %r15, %rdx
movl 0x10(%rsp), %ecx
callq 0x1a400
jmp 0x180cc
leaq 0xb8(%rsp), %r14
movq %r14, %rdi
leaq 0x16063(%rip), %rsi     # 0x2e109
leaq 0x98(%rsp), %rdx
callq 0x5160
leaq 0x29416(%rip), %rdi     # 0x414d0
movq %r14, %rsi
xorl %edx, %edx
callq 0x2bf18
movq %r14, %rdi
callq 0x5908
andl $0x0, 0xc(%rsp)
movq %rbx, %rdi
leaq 0xc(%rsp), %rsi
leaq 0x20(%rsp), %rdx
leaq 0x18(%rsp), %rcx
leaq 0x14(%rsp), %r8
callq 0x1b4ec
movl 0x18(%rsp), %eax
movq 0x88(%rsp), %rcx
movq (%rcx), %rcx
movl %eax, (%rcx,%r12,4)
decl %eax
cmpl $0x6, %eax
ja 0x1813b
leaq 0x15f8e(%rip), %rcx     # 0x2e09c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl 0x14(%rsp), %eax
jmp 0x1812c
movl 0x14(%rsp), %eax
shll $0x2, %eax
jmp 0x1812c
movl 0x14(%rsp), %eax
addl %eax, %eax
movq 0x80(%rsp), %rcx
movq (%rcx), %rcx
movl %eax, (%rcx,%r12,4)
movq 0x4b8(%rbx), %rsi
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rcx
movq 0x48(%rsp), %rdi
callq 0x163d4
leaq 0x20(%rsp), %rdi
xorl %esi, %esi
callq 0xcc7c
movl 0x4b8(%rbx), %eax
subl 0x4b0(%rbx), %eax
movl %eax, 0xc(%rsp)
incl %r12d
jmp 0x17e88
movb $0x1, 0x3de(%rbx)
leaq 0x68(%rsp), %rdi
callq 0x16562
leaq 0x50(%rsp), %rdi
callq 0x9f1c
leaq 0x20(%rsp), %rdi
callq 0xe88a
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x1820c
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
jmp 0x181f8
jmp 0x181ff
jmp 0x181ff
movq %rax, %rbx
leaq 0xd8(%rsp), %rdi
callq 0x5908
jmp 0x181f0
jmp 0x181ed
jmp 0x181ff
jmp 0x181ff
jmp 0x181ff
jmp 0x181ff
jmp 0x181ed
jmp 0x181ff
jmp 0x181ff
jmp 0x181ff
jmp 0x181ff
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0x5908
jmp 0x18202
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x16562
leaq 0x50(%rsp), %rdi
callq 0x9f1c
leaq 0x20(%rsp), %rdi
callq 0xe88a
movq %rbx, %rdi
callq 0x5800