// File: /workspace/github_cpp_makefile_star2_O3/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 $0xe8, %rsp
movq %rdi, %rbx
addq $0x4b0, %rdi            # imm = 0x4B0
xorl %r14d, %r14d
movq %rdi, 0x70(%rsp)
xorl %esi, %esi
callq 0xf332
movq %r14, 0x20(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq %r14, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movl 0x8(%rbx), %esi
leaq 0x78(%rsp), %rdi
leaq 0x48(%rsp), %rdx
callq 0x1efae
movl $0x0, (%rsp)
cmpl $0x0, 0x8(%rbx)
je 0x1d053
leaq 0x58(%rsp), %r14
xorl %r13d, %r13d
leaq 0x48(%rsp), %rbp
movq %r13, %r15
shlq $0x5, %r15
movq 0x758(%rbx), %rdi
addq %r15, %rdi
leaq 0x1cfe8(%rip), %rsi     # 0x39ed7
callq 0x50e0
testl %eax, %eax
je 0x1cf2d
movq 0x758(%rbx), %rdi
addq %r15, %rdi
leaq 0x1c2e4(%rip), %rsi     # 0x391ed
callq 0x50e0
testl %eax, %eax
je 0x1cf2d
addq 0x758(%rbx), %r15
movq %r15, %rdi
movl $0x3a, %esi
leaq 0x30(%rsp), %rdx
callq 0x16a0a
jmp 0x1cf7c
movq 0x498(%rbx), %r12
movq 0x4a0(%rbx), %r15
movq %r14, 0x48(%rsp)
movq %rbp, %rdi
leaq 0x1c2a3(%rip), %rsi     # 0x391ed
leaq 0x1c29d(%rip), %rdx     # 0x391ee
callq 0xc85e
subq %r12, %r15
sarq $0x5, %r15
leaq 0x30(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x1f52e
movq 0x48(%rsp), %rdi
cmpq %r14, %rdi
je 0x1cf7c
callq 0x5410
leaq (,%r13,2), %r15
addq %r13, %r15
leaq (,%r15,8), %rdi
addq 0x78(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0xf35e
movq %r13, 0x28(%rsp)
movq 0x78(%rsp), %rax
movq 0x8(%rax,%r15,8), %r12
subq (%rax,%r15,8), %r12
shrq $0x5, %r12
movl %r12d, %ecx
movq 0x498(%rbx), %rax
movq 0x4a0(%rbx), %rsi
movq %rsi, %rdx
subq %rax, %rdx
sarq $0x5, %rdx
cmpq %rcx, %rdx
jbe 0x1d03d
incl %r12d
movq 0x78(%rsp), %r13
movq %r14, 0x48(%rsp)
movq %rbp, %rdi
leaq 0x1c201(%rip), %rsi     # 0x391ed
leaq 0x1c1fb(%rip), %rdx     # 0x391ee
callq 0xc85e
leaq (,%r15,8), %rdi
addq %r13, %rdi
movq %rbp, %rsi
callq 0x1341e
movq 0x48(%rsp), %rdi
cmpq %r14, %rdi
je 0x1d01a
callq 0x5410
movl %r12d, %ecx
movq 0x498(%rbx), %rax
movq 0x4a0(%rbx), %rsi
movq %rsi, %rdx
subq %rax, %rdx
sarq $0x5, %rdx
incl %r12d
cmpq %rcx, %rdx
ja 0x1cfd8
movq 0x28(%rsp), %r13
incq %r13
movl 0x8(%rbx), %ecx
cmpq %rcx, %r13
jb 0x1ced7
jmp 0x1d061
movq 0x498(%rbx), %rax
movq 0x4a0(%rbx), %rsi
subq %rax, %rsi
leaq 0x640(%rbx), %rdi
sarq $0x5, %rsi
callq 0x1b294
leaq 0x658(%rbx), %rdi
movq 0x4a0(%rbx), %rsi
subq 0x498(%rbx), %rsi
sarq $0x5, %rsi
movq %rdi, 0x98(%rsp)
callq 0x1b294
leaq 0x688(%rbx), %rdi
movq 0x4a0(%rbx), %rsi
subq 0x498(%rbx), %rsi
sarq $0x5, %rsi
movq %rdi, 0x90(%rsp)
callq 0x1b294
movq 0x498(%rbx), %rsi
cmpq %rsi, 0x4a0(%rbx)
je 0x1d47e
leaq 0x1c0(%rbx), %rbp
leaq 0x1c8(%rbx), %rax
movq %rax, 0xa0(%rsp)
leaq 0xd0(%rbx), %rax
movq %rax, 0x28(%rsp)
leaq 0xb8(%rsp), %r15
xorl %r12d, %r12d
movq %rbp, 0x68(%rsp)
movq %r12, %r14
shlq $0x5, %r14
addq %r14, %rsi
movq %rbp, %rdi
callq 0x18140
cmpq 0xa0(%rsp), %rax
je 0x1d232
movl (%rsp), %eax
movq 0x640(%rbx), %rcx
movl %eax, (%rcx,%r12,4)
movq 0x498(%rbx), %rsi
addq %r14, %rsi
movq %rbp, %rdi
callq 0x177e8
movq %rbx, %rdi
leaq 0x10(%rsp), %rsi
movq %rax, %rdx
movl $0x1, %ecx
callq 0x1fbd8
movq 0x4b8(%rbx), %rsi
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rcx
movq 0x70(%rsp), %rdi
callq 0x1bd8c
leaq 0x10(%rsp), %rdi
xorl %esi, %esi
callq 0xf332
leaq 0x30(%rsp), %rdi
xorl %esi, %esi
callq 0x1300e
movq 0x498(%rbx), %rsi
addq %r14, %rsi
movq %rbp, %rdi
callq 0x177e8
movq 0x28(%rsp), %rdi
movq %rax, %rsi
callq 0x17782
movl 0x88(%rax), %eax
movl %eax, 0xc(%rsp)
movq 0x498(%rbx), %rsi
addq %r14, %rsi
movq %rbp, %rdi
callq 0x177e8
movq 0x28(%rsp), %rdi
movq %rax, %rsi
callq 0x17782
movl 0x44(%rax), %eax
movl %eax, 0x4(%rsp)
cmpl $0x0, 0x8(%rbx)
je 0x1d20d
xorl %r13d, %r13d
xorl %ebp, %ebp
movq 0x78(%rsp), %rax
movq (%rax,%r13), %rsi
addq %r14, %rsi
leaq 0x30(%rsp), %rdi
callq 0x13084
incq %rbp
movl 0x8(%rbx), %eax
addq $0x18, %r13
cmpq %rax, %rbp
jb 0x1d1e8
cmpl 0x630(%rbx), %r12d
jne 0x1d28b
movq %rbx, %rdi
leaq 0x10(%rsp), %rsi
leaq 0x30(%rsp), %rdx
callq 0x20002
movq 0x68(%rsp), %rbp
jmp 0x1d3b8
addq 0x498(%rbx), %r14
leaq 0x48(%rsp), %r13
movq %r13, %rdi
leaq 0x1bf3c(%rip), %rsi     # 0x39184
movq %r14, %rdx
callq 0xb777
movq %r13, %rdi
leaq 0x1bf38(%rip), %rsi     # 0x39192
callq 0x5870
movq %r15, 0xa8(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x1d2c0
movq %rdx, 0xa8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xb8(%rsp)
jmp 0x1d2c7
movl 0xc(%rsp), %eax
cmpl $0x1, %eax
movq 0x68(%rsp), %rbp
je 0x1d327
testl %eax, %eax
jne 0x1d33f
movq %rbx, %rdi
leaq 0x10(%rsp), %rsi
leaq 0x30(%rsp), %rdx
movl 0x4(%rsp), %ecx
callq 0x20624
jmp 0x1d3b8
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
movq %rdx, 0xb0(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x2c1bf(%rip), %rdi     # 0x494a8
leaq 0xa8(%rsp), %rsi
callq 0x371c0
movq 0xa8(%rsp), %rdi
cmpq %r15, %rdi
je 0x1d308
callq 0x5410
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x1d31c
callq 0x5410
incl 0x4cc(%rbx)
jmp 0x1d45d
movq %rbx, %rdi
leaq 0x10(%rsp), %rsi
leaq 0x30(%rsp), %rdx
movl 0x4(%rsp), %ecx
callq 0x20d84
jmp 0x1d3b8
andl $-0x2, %eax
cmpl $0x2, %eax
jne 0x1d35f
movq %rbx, %rdi
leaq 0x10(%rsp), %rsi
leaq 0x30(%rsp), %rdx
movl 0x4(%rsp), %ecx
callq 0x1fdd4
jmp 0x1d3b8
leaq 0xd8(%rsp), %rax
movq %rax, 0xc8(%rsp)
leaq 0xc8(%rsp), %r14
movq %r14, %rdi
leaq 0x1be48(%rip), %rsi     # 0x391c9
leaq 0x1be62(%rip), %rdx     # 0x391ea
callq 0xc85e
leaq 0x2c114(%rip), %rdi     # 0x494a8
movq %r14, %rsi
xorl %edx, %edx
callq 0x36ec8
movq 0xc8(%rsp), %rdi
leaq 0xd8(%rsp), %rax
cmpq %rax, %rdi
je 0x1d3b8
callq 0x5410
movl $0x0, (%rsp)
movq %rbx, %rdi
movq %rsp, %rsi
leaq 0x10(%rsp), %rdx
leaq 0xc(%rsp), %rcx
leaq 0x8(%rsp), %r8
callq 0x21396
movl 0xc(%rsp), %eax
movq 0x98(%rsp), %rcx
movq (%rcx), %rcx
movl %eax, (%rcx,%r12,4)
decl %eax
cmpl $0x6, %eax
ja 0x1d427
leaq 0x1bd62(%rip), %rcx     # 0x3915c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl 0x8(%rsp), %eax
jmp 0x1d418
movl 0x8(%rsp), %eax
shll $0x2, %eax
jmp 0x1d418
movl 0x8(%rsp), %eax
addl %eax, %eax
movq 0x90(%rsp), %rcx
movq (%rcx), %rcx
movl %eax, (%rcx,%r12,4)
movq 0x4b8(%rbx), %rsi
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rcx
movq 0x70(%rsp), %rdi
callq 0x1bd8c
leaq 0x10(%rsp), %rdi
xorl %esi, %esi
callq 0xf332
movl 0x4b8(%rbx), %eax
subl 0x4b0(%rbx), %eax
movl %eax, (%rsp)
incl %r12d
movq 0x498(%rbx), %rsi
movq 0x4a0(%rbx), %rax
subq %rsi, %rax
sarq $0x5, %rax
cmpq %r12, %rax
ja 0x1d106
movb $0x1, 0x3de(%rbx)
leaq 0x78(%rsp), %rdi
callq 0x1b5c0
leaq 0x30(%rsp), %rdi
callq 0xc4da
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x1d4a8
callq 0x5410
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x1d536
movq %rax, %rbx
movq 0xc8(%rsp), %rdi
leaq 0xd8(%rsp), %rax
jmp 0x1d4fc
jmp 0x1d529
jmp 0x1d529
movq %rax, %rbx
movq 0xa8(%rsp), %rdi
cmpq %r15, %rdi
je 0x1d4f2
callq 0x5410
jmp 0x1d4f2
movq %rax, %rbx
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
jne 0x1d522
jmp 0x1d52c
jmp 0x1d529
jmp 0x1d529
jmp 0x1d515
jmp 0x1d529
jmp 0x1d529
jmp 0x1d529
jmp 0x1d529
jmp 0x1d529
jmp 0x1d529
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r14, %rdi
je 0x1d52c
callq 0x5410
jmp 0x1d52c
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0x1b5c0
leaq 0x30(%rsp), %rdi
callq 0xc4da
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x1d54f
callq 0x5410
movq %rbx, %rdi
callq 0x57d0
nop