// File: /workspace/github_cpp_makefile_star2_O1/auton1[P]viterbi/header.cpp
// Function: header::parse_header(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void header::parse_header(const string &line)
{
	// #CHROM	POS	ID	REF	ALT	QUAL	FILTER	INFO	(FORMAT	NA00001 NA00002 ... )
	if (has_header == true)
		LOG.warning("Multiple Header lines.");

	has_header = true;
	istringstream header(line);
	int count = 0;
	string tmp_str;
	unsigned int N_header_indv = 0;
	has_genotypes = false;
	while (!header.eof())
	{
		getline(header, tmp_str, '\t');
		switch (count)
		{
			case 0: if (tmp_str != "#CHROM") LOG.warning("First Header entry should be #CHROM: " + tmp_str); break;
			case 1: if (tmp_str != "POS") LOG.warning("Second Header entry should be POS: " + tmp_str); break;
			case 2: if (tmp_str != "ID") LOG.warning("Third Header entry should be ID: " + tmp_str); break;
			case 3: if (tmp_str != "REF") LOG.warning("Fourth Header entry should be REF: " + tmp_str); break;
			case 4: if (tmp_str != "ALT") LOG.warning("Fifth Header entry should be ALT: " + tmp_str); break;
			case 5: if (tmp_str != "QUAL") LOG.warning("Sixth Header entry should be QUAL: " + tmp_str); break;
			case 6: if (tmp_str != "FILTER") LOG.warning("Seventh Header entry should be FILTER: " + tmp_str); break;
			case 7: if (tmp_str != "INFO") LOG.warning("Eighth Header entry should be INFO: " + tmp_str); break;
			case 8:
				if (tmp_str != "FORMAT")
					LOG.warning("Ninth Header entry should be FORMAT: " + tmp_str);
				else
					has_genotypes = true;
				break;
			default:
			{
				if (count <= 8)
					LOG.error("Incorrectly formatted header.");
				indv.push_back(tmp_str);
				N_header_indv++;
			}
			break;
		}
		count++;
	}
	N_indv = N_header_indv;

	if ((has_genotypes == true ) && (N_indv == 0))
		LOG.warning("FORMAT field without genotypes?");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x338, %rsp            # imm = 0x338
movq %rsi, %r14
movq %rdi, 0x8(%rsp)
cmpb $0x1, 0x6(%rdi)
jne 0x16459
leaq 0x1a8(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x235ed(%rip), %rsi     # 0x39a0e
leaq 0x235fc(%rip), %rdx     # 0x39a24
leaq 0x198(%rsp), %r15
movq %r15, %rdi
callq 0xc868
leaq 0x34069(%rip), %rdi     # 0x4a4a8
movq %r15, %rsi
callq 0x3749c
movq 0x198(%rsp), %rdi
cmpq %r12, %rdi
je 0x16459
callq 0x5410
movq 0x8(%rsp), %rbx
movb $0x1, 0x6(%rbx)
leaq 0x1b8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movl $0x8, %edx
callq 0x5730
leaq 0x48(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
xorl %r13d, %r13d
movb %r13b, (%rax)
movb %r13b, 0x5(%rbx)
movq (%r15), %rax
movq -0x18(%rax), %rax
testb $0x2, 0x1d8(%rsp,%rax)
jne 0x1687c
movq 0x8(%rsp), %rax
addq $0x10, %rax
movq %rax, 0x10(%rsp)
xorl %r13d, %r13d
leaq 0x1b8(%rsp), %r15
leaq 0x38(%rsp), %r12
leaq 0x33fd9(%rip), %rbx     # 0x4a4a8
leaq 0x23492(%rip), %r14     # 0x39968
xorl %ebp, %ebp
movq %r15, %rdi
movq %r12, %rsi
movl $0x9, %edx
callq 0x5830
cmpl $0x8, %ebp
ja 0x167dd
movl %ebp, %eax
movslq (%r14,%rax,4), %rax
addq %r14, %rax
jmpq *%rax
movq %r12, %rdi
leaq 0x2351f(%rip), %rsi     # 0x39a25
callq 0x50e0
testl %eax, %eax
je 0x16860
leaq 0x158(%rsp), %rdi
leaq 0x2350a(%rip), %rsi     # 0x39a2c
movq %r12, %rdx
callq 0xb7dd
movq %rbx, %rdi
leaq 0x158(%rsp), %rsi
callq 0x3749c
movq 0x158(%rsp), %rdi
leaq 0x168(%rsp), %rax
jmp 0x167ca
movq %r12, %rdi
leaq 0x2356e(%rip), %rsi     # 0x39ac7
callq 0x50e0
testl %eax, %eax
je 0x16860
leaq 0xd8(%rsp), %rdi
leaq 0x23556(%rip), %rsi     # 0x39acb
movq %r12, %rdx
callq 0xb7dd
movq %rbx, %rdi
leaq 0xd8(%rsp), %rsi
callq 0x3749c
movq 0xd8(%rsp), %rdi
leaq 0xe8(%rsp), %rax
jmp 0x167ca
movq %r12, %rdi
leaq 0x234ce(%rip), %rsi     # 0x39a7a
callq 0x50e0
testl %eax, %eax
je 0x16860
leaq 0x118(%rsp), %rdi
leaq 0x234b5(%rip), %rsi     # 0x39a7d
movq %r12, %rdx
callq 0xb7dd
movq %rbx, %rdi
leaq 0x118(%rsp), %rsi
callq 0x3749c
movq 0x118(%rsp), %rdi
leaq 0x128(%rsp), %rax
jmp 0x167ca
movq %r12, %rdi
leaq 0x234a0(%rip), %rsi     # 0x39a9f
callq 0x50e0
testl %eax, %eax
je 0x16860
leaq 0xf8(%rsp), %rdi
leaq 0x23488(%rip), %rsi     # 0x39aa3
movq %r12, %rdx
callq 0xb7dd
movq %rbx, %rdi
leaq 0xf8(%rsp), %rsi
callq 0x3749c
movq 0xf8(%rsp), %rdi
leaq 0x108(%rsp), %rax
jmp 0x167ca
movq %r12, %rdi
leaq 0x24de2(%rip), %rsi     # 0x3b434
callq 0x50e0
testl %eax, %eax
je 0x16860
leaq 0x78(%rsp), %rdi
leaq 0x234db(%rip), %rsi     # 0x39b46
movq %r12, %rdx
callq 0xb7dd
movq %rbx, %rdi
leaq 0x78(%rsp), %rsi
callq 0x3749c
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
jmp 0x167ca
movq %r12, %rdi
leaq 0x233b6(%rip), %rsi     # 0x39a52
callq 0x50e0
testl %eax, %eax
je 0x16860
leaq 0x138(%rsp), %rdi
leaq 0x2339e(%rip), %rsi     # 0x39a56
movq %r12, %rdx
callq 0xb7dd
movq %rbx, %rdi
leaq 0x138(%rsp), %rsi
callq 0x3749c
movq 0x138(%rsp), %rdi
leaq 0x148(%rsp), %rax
jmp 0x167ca
movq %r12, %rdi
leaq 0x233ff(%rip), %rsi     # 0x39aee
callq 0x50e0
testl %eax, %eax
je 0x16860
leaq 0xb8(%rsp), %rdi
leaq 0x233e8(%rip), %rsi     # 0x39af3
movq %r12, %rdx
callq 0xb7dd
movq %rbx, %rdi
leaq 0xb8(%rsp), %rsi
callq 0x3749c
movq 0xb8(%rsp), %rdi
leaq 0xc8(%rsp), %rax
jmp 0x167ca
movq %r12, %rdi
leaq 0x233d5(%rip), %rsi     # 0x39b17
callq 0x50e0
testl %eax, %eax
je 0x16860
leaq 0x98(%rsp), %rdi
leaq 0x233c0(%rip), %rsi     # 0x39b1e
movq %r12, %rdx
callq 0xb7dd
movq %rbx, %rdi
leaq 0x98(%rsp), %rsi
callq 0x3749c
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
jmp 0x167ca
movq %r12, %rdi
leaq 0x233d9(%rip), %rsi     # 0x39b6b
callq 0x50e0
testl %eax, %eax
je 0x16857
leaq 0x58(%rsp), %rdi
leaq 0x233c7(%rip), %rsi     # 0x39b72
movq %r12, %rdx
callq 0xb7dd
movq %rbx, %rdi
leaq 0x58(%rsp), %rsi
callq 0x3749c
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x16860
callq 0x5410
jmp 0x16860
ja 0x16845
movq %r14, %r12
movl %r13d, %r14d
movq %r15, %r13
movq %rbx, %r15
leaq 0x28(%rsp), %rax
movq %rax, 0x18(%rsp)
leaq 0x18(%rsp), %rbx
movq %rbx, %rdi
leaq 0x23394(%rip), %rsi     # 0x39b98
leaq 0x233aa(%rip), %rdx     # 0x39bb5
callq 0xc868
movq %r15, %rdi
movq %rbx, %rsi
movl $0x1, %edx
callq 0x3721e
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
movq %r15, %rbx
movq %r13, %r15
movl %r14d, %r13d
movq %r12, %r14
leaq 0x38(%rsp), %r12
je 0x16845
callq 0x5410
movq 0x10(%rsp), %rdi
movq %r12, %rsi
callq 0x13080
incl %r13d
jmp 0x16860
movq 0x8(%rsp), %rax
movb $0x1, 0x5(%rax)
incl %ebp
movq 0x1b8(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x2, 0x1d8(%rsp,%rax)
je 0x164d8
movq 0x8(%rsp), %rcx
movl %r13d, 0x58(%rcx)
testl %r13d, %r13d
sete %al
andb 0x5(%rcx), %al
cmpb $0x1, %al
jne 0x168df
leaq 0x188(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x23311(%rip), %rsi     # 0x39bb6
leaq 0x23329(%rip), %rdx     # 0x39bd5
leaq 0x178(%rsp), %rdi
callq 0xc868
leaq 0x33be8(%rip), %rdi     # 0x4a4a8
leaq 0x178(%rsp), %rsi
callq 0x3749c
movq 0x178(%rsp), %rdi
cmpq %r14, %rdi
je 0x168df
callq 0x5410
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x168f3
callq 0x5410
movq 0x336be(%rip), %rsi     # 0x49fb8
leaq 0x1b8(%rsp), %rdi
callq 0x5610
leaq 0x230(%rsp), %rdi
callq 0x5100
addq $0x338, %rsp            # imm = 0x338
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x178(%rsp), %rdi
cmpq %r14, %rdi
jne 0x16a36
jmp 0x16a40
jmp 0x16a3d
movq %rax, %rbx
movq 0x198(%rsp), %rdi
cmpq %r12, %rdi
je 0x16a75
callq 0x5410
jmp 0x16a75
movq %rax, %rbx
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
jmp 0x16a31
jmp 0x16a3d
movq %rax, %rbx
movq 0x158(%rsp), %rdi
leaq 0x168(%rsp), %rax
jmp 0x16a31
movq %rax, %rbx
movq 0x138(%rsp), %rdi
leaq 0x148(%rsp), %rax
jmp 0x16a31
movq %rax, %rbx
movq 0x118(%rsp), %rdi
leaq 0x128(%rsp), %rax
jmp 0x16a31
movq %rax, %rbx
movq 0xf8(%rsp), %rdi
leaq 0x108(%rsp), %rax
jmp 0x16a31
movq %rax, %rbx
movq 0xd8(%rsp), %rdi
leaq 0xe8(%rsp), %rax
jmp 0x16a31
movq %rax, %rbx
movq 0xb8(%rsp), %rdi
leaq 0xc8(%rsp), %rax
jmp 0x16a31
movq %rax, %rbx
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
jmp 0x16a31
movq %rax, %rbx
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
jmp 0x16a31
movq %rax, %rbx
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x16a40
callq 0x5410
jmp 0x16a40
movq %rax, %rbx
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x16a54
callq 0x5410
movq 0x3355d(%rip), %rsi     # 0x49fb8
leaq 0x1b8(%rsp), %rdi
callq 0x5610
leaq 0x230(%rsp), %rdi
callq 0x5100
movq %rbx, %rdi
callq 0x57d0
nop