// File: /workspace/github_cpp_makefile_star2_O1/auton1[P]viterbi/bcf_entry.cpp
// Function: bcf_entry::read_indv_generic_entry(unsigned int, int const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
void bcf_entry::read_indv_generic_entry(unsigned int indv, const int &idx, string &out)
{
	if (fully_parsed == false)
		parse_full_entry(true);

	if (parsed_FORMAT == false)
		set_FORMAT();

	if(idx == GT_idx)
		parse_genotype_entry(indv, true);

	out = ".";
	ostringstream outstream;
	outstream.str("");

	string tmpstr;
	unsigned int l_pos, type, size;
	bool miss, format_miss;

	l_pos = FORMAT_positions[idx] + FORMAT_skip[idx]*indv;
	type = FORMAT_types[idx];
	size = FORMAT_sizes[idx];

	format_miss = true;
	if(type == 1)
	{
		int8_t tmp;
		if (idx == GT_idx)
		{
			pair<int, int> genotype;
			char phase;

			get_indv_GENOTYPE_ids(indv, genotype);
			phase = get_indv_PHASE(indv);
			if ((genotype.first == -2) && (genotype.second == -2))
				outstream << ".";
			else if ((genotype.first == -1) && (genotype.second == -2))
				outstream << ".";
			else if ((genotype.first > -1) && (genotype.second == -2))
				outstream << header::int2str(genotype.first);
			else if ((genotype.first > -1) && (genotype.second > -1))
				outstream << header::int2str(genotype.first) << phase << header::int2str(genotype.second);
			else
				outstream << header::int2str(genotype.first) << phase << header::int2str(genotype.second);

			tmpstr = outstream.str();
			out = tmpstr;
		}
		else
		{
			format_miss = true;
			for (unsigned int uj=0; uj<size; uj++)
			{
				if (check_end(l_pos, type, line))
					break;

				miss = check_missing(l_pos, type, line);
				if (uj != 0)
					outstream << ",";

				if (miss)
					outstream << ".";
				else
				{
					tmp = *reinterpret_cast<const int8_t*>(&line[l_pos]);
					outstream << int(tmp);
				}
				l_pos += sizeof(int8_t);
				format_miss = format_miss && miss;
			}

			tmpstr = outstream.str();
			if ( (tmpstr.length() > 0) and !format_miss)
				out = tmpstr;
		}
	}
	else if (type == 2)
	{
		int16_t tmp;
		format_miss = true;

		for (unsigned int uj=0; uj<size; uj++)
		{
			if (check_end(l_pos, type, line))
				break;

			miss = check_missing(l_pos, type, line);
			if (uj != 0)
				outstream << ",";

			if (miss)
				outstream << ".";
			else
			{
				tmp = *reinterpret_cast<const int16_t*>(&line[l_pos]);
				outstream << int(tmp);
			}
			l_pos += sizeof(int16_t);
			format_miss = format_miss && miss;
		}

		tmpstr = outstream.str();
		if ( (tmpstr.length() > 0) and !format_miss )
			out = tmpstr;
	}
	else if (type == 3)
	{
		int32_t tmp;
		format_miss = true;

		for (unsigned int uj=0; uj<size; uj++)
		{
			if (check_end(l_pos, type, line))
				break;

			miss = check_missing(l_pos, type, line);
			if (uj != 0)
				outstream << ",";

			if (miss)
				outstream << ".";
			else
			{
				tmp = *reinterpret_cast<const int32_t*>(&line[l_pos]);
				outstream << int(tmp);
			}
			l_pos += sizeof(int32_t);
			format_miss = format_miss && miss;
		}

		tmpstr = outstream.str();
		if ( (tmpstr.length() > 0) and !format_miss )
			out = tmpstr;
	}
	else if (type == 5)
	{
		float tmp;
		format_miss = true;

		for (unsigned int uj=0; uj<size; uj++)
		{
			if (check_end(l_pos, type, line))
				break;

			miss = check_missing(l_pos, type, line);
			if (uj != 0)
				outstream << ",";

			if (miss)
				outstream << ".";
			else
			{
				tmp = *reinterpret_cast<const float*>(&line[l_pos]);
				outstream << float(tmp);
			}
			l_pos += sizeof(float);
			format_miss = format_miss && miss;
		}

		tmpstr = outstream.str();
		if ( (tmpstr.length() > 0) and !format_miss )
			out = tmpstr;
	}
	else if (type == 7)
	{
		stringstream str_stream;
		string tmp_string;
		char tmp = '.';

		for (unsigned int uj=0; uj<size; uj++)
		{
			tmp = *reinterpret_cast<const char*>(&line[l_pos]);
			l_pos += sizeof(char);
			str_stream << tmp;
		}
		tmp_string = str_stream.str();
		tmp_string.erase( remove( tmp_string.begin(), tmp_string.end(), ' ' ), tmp_string.end() );

		if (tmp_string != "")
			out = tmp;
		else
			out = ".";
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x378, %rsp            # imm = 0x378
movq %rcx, %rbx
movq %rdx, %r12
movl %esi, %ebp
movq %rdi, %r15
cmpb $0x0, 0x3d9(%rdi)
jne 0x19923
movq (%r15), %rax
movq %r15, %rdi
movl $0x1, %esi
callq *0x18(%rax)
cmpb $0x0, 0x3dd(%r15)
jne 0x19935
movq %r15, %rdi
callq 0x277b0
movl (%r12), %eax
cmpl 0x630(%r15), %eax
jne 0x1995a
movq (%r15), %rax
movq %r15, %rdi
movl %ebp, %esi
movl $0x1, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq *0x20(%rax)
movq 0x8(%rbx), %rdx
leaq 0x208a8(%rip), %rcx     # 0x3a20d
movl $0x1, %r8d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x5690
leaq 0x200(%rsp), %rdi
callq 0x55d0
leaq 0x88(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x2156a(%rip), %rdx     # 0x3aeff
leaq 0x78(%rsp), %rdi
movq %rdx, %rsi
callq 0xc868
leaq 0x208(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0x5640
movq %rbx, 0x10(%rsp)
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x199d0
callq 0x5410
leaq 0x28(%rsp), %r13
movq %r13, -0x10(%r13)
movq $0x0, -0x8(%r13)
movb $0x0, (%r13)
movslq (%r12), %rax
movq 0x658(%r15), %rcx
movl (%rcx,%rax,4), %ecx
decl %ecx
cmpl $0x6, %ecx
ja 0x1a210
movq 0x688(%r15), %rdx
movl (%rdx,%rax,4), %r12d
imull %ebp, %r12d
movq 0x640(%r15), %rdx
addl (%rdx,%rax,4), %r12d
movq 0x670(%r15), %rdx
movl (%rdx,%rax,4), %ebx
leaq 0x2060a(%rip), %rdx     # 0x3a034
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
cmpl 0x630(%r15), %eax
jne 0x19d41
leaq 0x58(%rsp), %rdx
movq $0x0, (%rdx)
movq %r15, %rdi
movl %ebp, %esi
callq 0x22d94
movq %r15, %rdi
movl %ebp, %esi
callq 0x22ddc
movl %eax, %ebx
movl 0x58(%rsp), %esi
movl 0x5c(%rsp), %eax
cmpl $-0x2, %eax
sete %cl
cmpl $-0x2, %esi
setae %dl
testb %cl, %dl
je 0x1a01e
leaq 0x20788(%rip), %rsi     # 0x3a20d
leaq 0x200(%rsp), %rdi
movl $0x1, %edx
callq 0x54f0
jmp 0x1a1c8
testl %ebx, %ebx
je 0x19e03
leaq 0x3c0(%r15), %rax
movq %rax, 0x8(%rsp)
movb $0x1, %r14b
xorl %r13d, %r13d
movq %r15, %rdi
movl %r12d, %esi
movl $0x3, %edx
movq 0x8(%rsp), %rcx
callq 0x21954
testb %al, %al
jne 0x19e06
movq %r15, %rdi
movl %r12d, %esi
movl $0x3, %edx
movq 0x8(%rsp), %rcx
callq 0x218ae
movl %eax, %ebp
testl %r13d, %r13d
je 0x19b08
movl $0x1, %edx
leaq 0x200(%rsp), %rdi
leaq 0x201a7(%rip), %rsi     # 0x39caa
callq 0x54f0
testb %bpl, %bpl
je 0x19b28
movl $0x1, %edx
leaq 0x200(%rsp), %rdi
leaq 0x206ec(%rip), %rsi     # 0x3a20d
callq 0x54f0
jmp 0x19b43
movl %r12d, %eax
movq 0x8(%rsp), %rcx
movq (%rcx), %rcx
movl (%rcx,%rax), %esi
leaq 0x200(%rsp), %rdi
callq 0x57a0
addl $0x4, %r12d
andb %bpl, %r14b
incl %r13d
cmpl %r13d, %ebx
jne 0x19ab6
jmp 0x19e06
testl %ebx, %ebx
je 0x19e6c
leaq 0x3c0(%r15), %rax
movq %rax, 0x8(%rsp)
xorl %r13d, %r13d
movb $0x1, %r14b
movq %r15, %rdi
movl %r12d, %esi
movl $0x2, %edx
movq 0x8(%rsp), %rcx
callq 0x21954
testb %al, %al
jne 0x19e6f
movq %r15, %rdi
movl %r12d, %esi
movl $0x2, %edx
movq 0x8(%rsp), %rcx
callq 0x218ae
movl %eax, %ebp
testl %r13d, %r13d
je 0x19bc7
movl $0x1, %edx
leaq 0x200(%rsp), %rdi
leaq 0x200e8(%rip), %rsi     # 0x39caa
callq 0x54f0
testb %bpl, %bpl
je 0x19be7
movl $0x1, %edx
leaq 0x200(%rsp), %rdi
leaq 0x2062d(%rip), %rsi     # 0x3a20d
callq 0x54f0
jmp 0x19c03
movl %r12d, %eax
movq 0x8(%rsp), %rcx
movq (%rcx), %rcx
movswl (%rcx,%rax), %esi
leaq 0x200(%rsp), %rdi
callq 0x57a0
addl $0x2, %r12d
andb %bpl, %r14b
incl %r13d
cmpl %r13d, %ebx
jne 0x19b75
jmp 0x19e6f
testl %ebx, %ebx
je 0x19ed5
leaq 0x3c0(%r15), %rax
movq %rax, 0x8(%rsp)
movb $0x1, %r14b
xorl %r13d, %r13d
movq %r15, %rdi
movl %r12d, %esi
movl $0x5, %edx
movq 0x8(%rsp), %rcx
callq 0x21954
testb %al, %al
jne 0x19ed8
movq %r15, %rdi
movl %r12d, %esi
movl $0x5, %edx
movq 0x8(%rsp), %rcx
callq 0x218ae
movl %eax, %ebp
testl %r13d, %r13d
je 0x19c87
movl $0x1, %edx
leaq 0x200(%rsp), %rdi
leaq 0x20028(%rip), %rsi     # 0x39caa
callq 0x54f0
testb %bpl, %bpl
je 0x19ca7
movl $0x1, %edx
leaq 0x200(%rsp), %rdi
leaq 0x2056d(%rip), %rsi     # 0x3a20d
callq 0x54f0
jmp 0x19cc7
movl %r12d, %eax
movq 0x8(%rsp), %rcx
movq (%rcx), %rcx
xorps %xmm0, %xmm0
cvtss2sd (%rcx,%rax), %xmm0
leaq 0x200(%rsp), %rdi
callq 0x56e0
addl $0x4, %r12d
andb %bpl, %r14b
incl %r13d
cmpl %r13d, %ebx
jne 0x19c35
jmp 0x19ed8
leaq 0x78(%rsp), %rdi
callq 0x52e0
leaq 0x48(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
testl %ebx, %ebx
je 0x19f3e
leaq 0x88(%rsp), %r13
leaq 0x58(%rsp), %r14
movl %r12d, %eax
movq 0x3c0(%r15), %rcx
movb (%rcx,%rax), %bpl
movb %bpl, 0x58(%rsp)
movl $0x1, %edx
movq %r13, %rdi
movq %r14, %rsi
callq 0x54f0
incl %r12d
decl %ebx
jne 0x19d12
jmp 0x19f41
testl %ebx, %ebx
je 0x1a062
leaq 0x3c0(%r15), %rax
movq %rax, 0x8(%rsp)
xorl %r13d, %r13d
movb $0x1, 0x7(%rsp)
leal (%r12,%r13), %ebp
movq %r15, %rdi
movl %ebp, %esi
movl $0x1, %edx
movq 0x8(%rsp), %rcx
callq 0x21954
testb %al, %al
jne 0x1a067
movq %r15, %rdi
movl %ebp, %esi
movl $0x1, %edx
movq 0x8(%rsp), %rcx
callq 0x218ae
movl %eax, %r14d
testl %r13d, %r13d
je 0x19db2
movl $0x1, %edx
leaq 0x200(%rsp), %rdi
leaq 0x1fefd(%rip), %rsi     # 0x39caa
callq 0x54f0
testb %r14b, %r14b
je 0x19dd2
movl $0x1, %edx
leaq 0x200(%rsp), %rdi
leaq 0x20442(%rip), %rsi     # 0x3a20d
callq 0x54f0
jmp 0x19ded
movl %ebp, %eax
movq 0x8(%rsp), %rcx
movq (%rcx), %rcx
movsbl (%rcx,%rax), %esi
leaq 0x200(%rsp), %rdi
callq 0x57a0
andb %r14b, 0x7(%rsp)
incl %r13d
cmpl %r13d, %ebx
jne 0x19d5d
jmp 0x1a067
movb $0x1, %r14b
leaq 0x78(%rsp), %rdi
leaq 0x208(%rsp), %rsi
callq 0x56c0
leaq 0x18(%rsp), %rdi
leaq 0x78(%rsp), %rbx
movq %rbx, %rsi
callq 0x5550
movq (%rbx), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
leaq 0x28(%rsp), %r13
je 0x19e44
callq 0x5410
cmpq $0x0, 0x20(%rsp)
sete %al
orb %r14b, %al
testb $0x1, %al
jne 0x1a210
leaq 0x18(%rsp), %rsi
movq 0x10(%rsp), %rdi
callq 0x51f0
jmp 0x1a210
movb $0x1, %r14b
leaq 0x78(%rsp), %rdi
leaq 0x208(%rsp), %rsi
callq 0x56c0
leaq 0x18(%rsp), %rdi
leaq 0x78(%rsp), %rbx
movq %rbx, %rsi
callq 0x5550
movq (%rbx), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
leaq 0x28(%rsp), %r13
je 0x19ead
callq 0x5410
cmpq $0x0, 0x20(%rsp)
sete %al
orb %r14b, %al
testb $0x1, %al
jne 0x1a210
leaq 0x18(%rsp), %rsi
movq 0x10(%rsp), %rdi
callq 0x51f0
jmp 0x1a210
movb $0x1, %r14b
leaq 0x78(%rsp), %rdi
leaq 0x208(%rsp), %rsi
callq 0x56c0
leaq 0x18(%rsp), %rdi
leaq 0x78(%rsp), %rbx
movq %rbx, %rsi
callq 0x5550
movq (%rbx), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
leaq 0x28(%rsp), %r13
je 0x19f16
callq 0x5410
cmpq $0x0, 0x20(%rsp)
sete %al
orb %r14b, %al
testb $0x1, %al
jne 0x1a210
leaq 0x18(%rsp), %rsi
movq 0x10(%rsp), %rdi
callq 0x51f0
jmp 0x1a210
movb $0x2e, %bpl
leaq 0x90(%rsp), %rsi
leaq 0x58(%rsp), %rdi
callq 0x56c0
leaq 0x38(%rsp), %rdi
leaq 0x58(%rsp), %rbx
movq %rbx, %rsi
callq 0x5550
movq (%rbx), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
leaq 0x28(%rsp), %r13
je 0x19f7c
callq 0x5410
movq 0x38(%rsp), %rdi
movq 0x40(%rsp), %rsi
addq %rdi, %rsi
leaq 0x58(%rsp), %rdx
movb $0x20, (%rdx)
callq 0x1bda9
leaq 0x38(%rsp), %rdi
movq %rax, %rcx
subq (%rdi), %rcx
movq %rcx, 0x8(%rdi)
movb $0x0, (%rax)
leaq 0x20f50(%rip), %rsi     # 0x3aeff
callq 0x50e0
movq 0x10(%rsp), %rdi
movq 0x8(%rdi), %rdx
testl %eax, %eax
je 0x19fd3
movsbl %bpl, %r8d
movl $0x1, %ecx
xorl %esi, %esi
callq 0x5860
jmp 0x19fe7
leaq 0x20233(%rip), %rcx     # 0x3a20d
movl $0x1, %r8d
xorl %esi, %esi
callq 0x5690
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x19ffb
callq 0x5410
movq 0x2ff7e(%rip), %rsi     # 0x49f80
leaq 0x78(%rsp), %rdi
callq 0x5330
leaq 0xf8(%rsp), %rdi
callq 0x5100
jmp 0x1a210
cmpl $-0x2, %eax
sete %cl
testl %esi, %esi
setns %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x1a0ce
leaq 0x78(%rsp), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x17284
movq 0x78(%rsp), %rsi
movq 0x80(%rsp), %rdx
leaq 0x200(%rsp), %rdi
callq 0x54f0
jmp 0x1a1b1
movb $0x1, 0x7(%rsp)
leaq 0x78(%rsp), %rdi
leaq 0x208(%rsp), %rsi
leaq 0x28(%rsp), %r13
callq 0x56c0
leaq 0x18(%rsp), %rdi
leaq 0x78(%rsp), %rbx
movq %rbx, %rsi
callq 0x5550
movq (%rbx), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x1a0a5
callq 0x5410
cmpq $0x0, 0x20(%rsp)
sete %al
orb 0x7(%rsp), %al
testb $0x1, %al
jne 0x1a210
leaq 0x18(%rsp), %rsi
movq 0x10(%rsp), %rdi
callq 0x51f0
jmp 0x1a210
orl %esi, %eax
js 0x1a139
leaq 0x78(%rsp), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x17284
movq 0x78(%rsp), %rsi
movq 0x80(%rsp), %rdx
leaq 0x200(%rsp), %rdi
callq 0x54f0
leaq 0x38(%rsp), %rsi
movb %bl, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x54f0
movq %rax, %rbx
movl 0x5c(%rsp), %esi
leaq 0x38(%rsp), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x17284
movq 0x38(%rsp), %rsi
movq 0x40(%rsp), %rdx
movq %rbx, %rdi
callq 0x54f0
jmp 0x1a19e
leaq 0x78(%rsp), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x17284
movq 0x78(%rsp), %rsi
movq 0x80(%rsp), %rdx
leaq 0x200(%rsp), %rdi
callq 0x54f0
leaq 0x38(%rsp), %rsi
movb %bl, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x54f0
movq %rax, %rbx
movl 0x5c(%rsp), %esi
leaq 0x38(%rsp), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x17284
movq 0x38(%rsp), %rsi
movq 0x40(%rsp), %rdx
movq %rbx, %rdi
callq 0x54f0
leaq 0x48(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1a1b1
callq 0x5410
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x1a1c8
callq 0x5410
leaq 0x78(%rsp), %rdi
leaq 0x208(%rsp), %rsi
callq 0x56c0
leaq 0x18(%rsp), %rdi
leaq 0x78(%rsp), %rbx
movq %rbx, %rsi
callq 0x5550
movq (%rbx), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x1a201
callq 0x5410
leaq 0x18(%rsp), %rsi
movq 0x10(%rsp), %rdi
callq 0x51f0
movq 0x18(%rsp), %rdi
cmpq %r13, %rdi
je 0x1a21f
callq 0x5410
movq 0x2fd9a(%rip), %rsi     # 0x49fc0
leaq 0x200(%rsp), %rdi
callq 0x51e0
leaq 0x270(%rsp), %rdi
callq 0x5100
addq $0x378, %rsp            # imm = 0x378
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1a254
movq %rax, %rbx
leaq 0x48(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1a281
callq 0x5410
jmp 0x1a281
jmp 0x1a27e
jmp 0x1a27e
jmp 0x1a30c
jmp 0x1a30c
jmp 0x1a27e
jmp 0x1a27e
movq %rax, %rbx
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x1a30f
callq 0x5410
jmp 0x1a30f
jmp 0x1a30c
jmp 0x1a30c
jmp 0x1a30c
jmp 0x1a30c
jmp 0x1a30c
jmp 0x1a30c
jmp 0x1a30c
jmp 0x1a30c
jmp 0x1a30c
jmp 0x1a30c
jmp 0x1a2d1
jmp 0x1a2d1
jmp 0x1a2d1
jmp 0x1a30c
jmp 0x1a30c
movq %rax, %rbx
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
jmp 0x1a319
movq %rax, %rbx
jmp 0x1a323
jmp 0x1a30c
movq %rax, %rbx
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x1a2e8
callq 0x5410
movq 0x2fc91(%rip), %rsi     # 0x49f80
leaq 0x78(%rsp), %rdi
callq 0x5330
leaq 0xf8(%rsp), %rdi
callq 0x5100
jmp 0x1a30f
jmp 0x1a30c
jmp 0x1a30c
movq %rax, %rbx
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x1a323
callq 0x5410
movq 0x2fc96(%rip), %rsi     # 0x49fc0
leaq 0x200(%rsp), %rdi
callq 0x51e0
leaq 0x270(%rsp), %rdi
callq 0x5100
movq %rbx, %rdi
callq 0x57d0