// File: /workspace/github_cpp_makefile_star2_O2/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 $0x318, %rsp            # imm = 0x318
movq %rsi, %r15
movq %rdi, 0x8(%rsp)
cmpb $0x1, 0x6(%rdi)
jne 0x12259
leaq 0x1b722(%rip), %rsi     # 0x2d94e
leaq 0x58(%rsp), %rdi
leaq 0x198(%rsp), %rdx
callq 0x5160
leaq 0x2f28b(%rip), %rdi     # 0x414d0
leaq 0x58(%rsp), %rsi
callq 0x2c0bc
leaq 0x58(%rsp), %rdi
callq 0x5908
movq 0x8(%rsp), %rbx
movb $0x1, 0x6(%rbx)
leaq 0x198(%rsp), %rdi
pushq $0x8
popq %rdx
movq %r15, %rsi
callq 0x5770
leaq 0x48(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
xorl %r15d, %r15d
movb %r15b, (%rax)
movb %r15b, 0x5(%rbx)
leaq 0x10(%rbx), %rax
movq %rax, 0x10(%rsp)
leaq 0x38(%rsp), %r12
pushq $0x9
popq %rbp
leaq 0x1b603(%rip), %r13     # 0x2d8a8
leaq 0x2f224(%rip), %rbx     # 0x414d0
movl $0x0, 0x4(%rsp)
movq 0x198(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x2, 0x1b8(%rsp,%rax)
jne 0x12594
leaq 0x198(%rsp), %rdi
movq %r12, %rsi
movl %ebp, %edx
callq 0x5870
cmpl $0x8, %r15d
ja 0x12570
movl %r15d, %eax
movslq (%r13,%rax,4), %rax
addq %r13, %rax
jmpq *%rax
movq %r12, %rdi
leaq 0x1b664(%rip), %rsi     # 0x2d965
callq 0x12f17
testb %al, %al
je 0x1258c
leaq 0x178(%rsp), %rdi
leaq 0x1b64f(%rip), %rsi     # 0x2d96c
movq %r12, %rdx
callq 0x967d
movq %rbx, %r14
movq %rbx, %rdi
leaq 0x178(%rsp), %rbx
movq %rbx, %rsi
callq 0x2c0bc
movq %rbx, %rdi
callq 0x5908
movq %r14, %rbx
jmp 0x1258c
movq %r12, %rdi
leaq 0x1b6b2(%rip), %rsi     # 0x2da07
callq 0x12f17
testb %al, %al
je 0x1258c
leaq 0xf8(%rsp), %rdi
leaq 0x1b69a(%rip), %rsi     # 0x2da0b
movq %r12, %rdx
callq 0x967d
movq %rbx, %rdi
leaq 0xf8(%rsp), %r14
movq %r14, %rsi
callq 0x2c0bc
jmp 0x12566
movq %r12, %rdi
leaq 0x1b61f(%rip), %rsi     # 0x2d9ba
callq 0x12f17
testb %al, %al
je 0x1258c
leaq 0x138(%rsp), %rdi
leaq 0x1b606(%rip), %rsi     # 0x2d9bd
movq %r12, %rdx
callq 0x967d
movq %rbx, %rdi
leaq 0x138(%rsp), %r14
movq %r14, %rsi
callq 0x2c0bc
jmp 0x12566
movq %r12, %rdi
leaq 0x1b5fe(%rip), %rsi     # 0x2d9df
callq 0x12f17
testb %al, %al
je 0x1258c
leaq 0x118(%rsp), %rdi
leaq 0x1b5e6(%rip), %rsi     # 0x2d9e3
movq %r12, %rdx
callq 0x967d
movq %rbx, %rdi
leaq 0x118(%rsp), %r14
movq %r14, %rsi
callq 0x2c0bc
jmp 0x12566
movq %r12, %rdi
leaq 0x1cf3d(%rip), %rsi     # 0x2f364
callq 0x12f17
testb %al, %al
je 0x1258c
leaq 0x98(%rsp), %rdi
leaq 0x1b643(%rip), %rsi     # 0x2da86
movq %r12, %rdx
callq 0x967d
movq %rbx, %rdi
leaq 0x98(%rsp), %r14
movq %r14, %rsi
callq 0x2c0bc
jmp 0x12566
movq %r12, %rdi
leaq 0x1b525(%rip), %rsi     # 0x2d992
callq 0x12f17
testb %al, %al
je 0x1258c
leaq 0x158(%rsp), %rdi
leaq 0x1b50d(%rip), %rsi     # 0x2d996
movq %r12, %rdx
callq 0x967d
movq %rbx, %rdi
leaq 0x158(%rsp), %r14
movq %r14, %rsi
callq 0x2c0bc
jmp 0x12566
movq %r12, %rdi
leaq 0x1b57b(%rip), %rsi     # 0x2da2e
callq 0x12f17
testb %al, %al
je 0x1258c
leaq 0xd8(%rsp), %rdi
leaq 0x1b564(%rip), %rsi     # 0x2da33
movq %r12, %rdx
callq 0x967d
movq %rbx, %rdi
leaq 0xd8(%rsp), %r14
movq %r14, %rsi
callq 0x2c0bc
jmp 0x12566
movq %r12, %rdi
leaq 0x1b561(%rip), %rsi     # 0x2da57
callq 0x12f17
testb %al, %al
je 0x1258c
leaq 0xb8(%rsp), %rdi
leaq 0x1b54c(%rip), %rsi     # 0x2da5e
movq %r12, %rdx
callq 0x967d
movq %rbx, %rdi
leaq 0xb8(%rsp), %r14
movq %r14, %rsi
callq 0x2c0bc
jmp 0x12566
movq %r12, %rdi
leaq 0x1b572(%rip), %rsi     # 0x2daab
callq 0x12f17
testb %al, %al
je 0x12583
leaq 0x78(%rsp), %rdi
leaq 0x1b564(%rip), %rsi     # 0x2dab2
movq %r12, %rdx
callq 0x967d
movq %rbx, %rdi
leaq 0x78(%rsp), %r14
movq %r14, %rsi
callq 0x2c0bc
movq %r14, %rdi
callq 0x5908
jmp 0x1258c
movq 0x10(%rsp), %rdi
movq %r12, %rsi
callq 0xfda2
incl 0x4(%rsp)
jmp 0x1258c
movq 0x8(%rsp), %rax
movb $0x1, 0x5(%rax)
incl %r15d
jmp 0x122b4
movq 0x8(%rsp), %rcx
movl 0x4(%rsp), %eax
movl %eax, 0x58(%rcx)
testl %eax, %eax
sete %al
andb 0x5(%rcx), %al
cmpb $0x1, %al
jne 0x125dd
leaq 0x1b525(%rip), %rsi     # 0x2dad8
leaq 0x18(%rsp), %rdi
leaq 0x3(%rsp), %rdx
callq 0x5160
leaq 0x2ef07(%rip), %rdi     # 0x414d0
leaq 0x18(%rsp), %rsi
callq 0x2c0bc
leaq 0x18(%rsp), %rdi
callq 0x5908
leaq 0x38(%rsp), %rdi
callq 0x5908
leaq 0x198(%rsp), %rdi
callq 0x5910
addq $0x318, %rsp            # imm = 0x318
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
jmp 0x126a2
jmp 0x126a9
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x5908
jmp 0x126c3
movq %rax, %rbx
jmp 0x126c3
movq %rax, %rbx
leaq 0xd8(%rsp), %rdi
jmp 0x126a2
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
jmp 0x126a2
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
jmp 0x126a2
movq %rax, %rbx
leaq 0x178(%rsp), %rdi
jmp 0x126a2
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
jmp 0x126a2
movq %rax, %rbx
leaq 0x138(%rsp), %rdi
jmp 0x126a2
movq %rax, %rbx
leaq 0xf8(%rsp), %rdi
jmp 0x126a2
movq %rax, %rbx
leaq 0x158(%rsp), %rdi
jmp 0x126a2
movq %rax, %rbx
leaq 0x118(%rsp), %rdi
callq 0x5908
jmp 0x126ac
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x5908
leaq 0x198(%rsp), %rdi
callq 0x5910
movq %rbx, %rdi
callq 0x5800
nop