// File: auton1[P]viterbi/bcf_file.cpp
// Function: bcf_file::read_header()
void bcf_file::read_header()
{
	uint32_t len_text;

	read(&len_text, 1, sizeof(uint32_t));
	char *header_array = new char[(uint32_t)len_text];
	read(header_array, len_text, 1);

	string header(header_array);
	delete [] header_array;
	string line;
	unsigned int line_index = 0;
	header.erase( header.find_last_not_of(" \f\n\r\t\v\0" ) + 1 );

	istringstream iss(header);
	line_index += meta_data.add_FILTER_descriptor("ID=PASS,Description=PASS", line_index);

	while (getline(iss, line))
	{
		if (line[0] == '#')
		{
			if (line[1] == '#')
				meta_data.parse_meta(line, line_index);
			else
				meta_data.parse_header(line);
		}
	}
}

// Assembly:
subq $0x288, %rsp            # imm = 0x288
movq %rdi, 0x280(%rsp)
movq 0x280(%rsp), %rdi
movq %rdi, 0x50(%rsp)
leaq 0x27c(%rsp), %rsi
movl $0x1, %edx
movl $0x4, %ecx
callq 0x20230
movl 0x27c(%rsp), %eax
movl %eax, %edi
callq 0x6030
movq 0x50(%rsp), %rdi
movq %rax, 0x270(%rsp)
movq 0x270(%rsp), %rsi
movl 0x27c(%rsp), %edx
movl $0x1, %ecx
callq 0x20230
movq 0x270(%rsp), %rax
movq %rax, 0x58(%rsp)
leaq 0x24f(%rsp), %rdi
movq %rdi, 0x60(%rsp)
callq 0x69f0
movq 0x58(%rsp), %rsi
movq 0x60(%rsp), %rdx
leaq 0x250(%rsp), %rdi
callq 0x67c0
jmp 0x1f7ef
leaq 0x24f(%rsp), %rdi
callq 0x65f0
movq 0x270(%rsp), %rax
movq %rax, 0x48(%rsp)
cmpq $0x0, %rax
je 0x1f819
movq 0x48(%rsp), %rdi
callq 0x6750
leaq 0x218(%rsp), %rdi
callq 0x67e0
movl $0x0, 0x214(%rsp)
leaq 0x54cf1(%rip), %rsi     # 0x74529
leaq 0x250(%rsp), %rdi
movq %rdi, 0x38(%rsp)
movq $-0x1, %rdx
movq %rdx, 0x40(%rsp)
callq 0x6a30
movq 0x38(%rsp), %rdi
movq 0x40(%rsp), %rdx
movq %rax, %rsi
incq %rsi
callq 0x60f0
jmp 0x1f86d
leaq 0x90(%rsp), %rdi
leaq 0x250(%rsp), %rsi
movl $0x8, %edx
callq 0x6930
jmp 0x1f889
movq 0x50(%rsp), %rax
addq $0x250, %rax            # imm = 0x250
movq %rax, 0x28(%rsp)
leaq 0x6f(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0x69f0
movq 0x30(%rsp), %rdx
leaq 0x54c5c(%rip), %rsi     # 0x74510
leaq 0x70(%rsp), %rdi
callq 0x67c0
jmp 0x1f8c0
movq 0x28(%rsp), %rdi
movl 0x214(%rsp), %edx
leaq 0x70(%rsp), %rsi
callq 0x2d200
movl %eax, 0x24(%rsp)
jmp 0x1f8dc
movl 0x24(%rsp), %eax
addl 0x214(%rsp), %eax
movl %eax, 0x214(%rsp)
leaq 0x70(%rsp), %rdi
callq 0x6b50
leaq 0x6f(%rsp), %rdi
callq 0x65f0
leaq 0x90(%rsp), %rdi
leaq 0x218(%rsp), %rsi
callq 0x60c0
movq %rax, 0x18(%rsp)
jmp 0x1f91e
movq 0x18(%rsp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x6700
movb %al, 0x17(%rsp)
jmp 0x1f938
movb 0x17(%rsp), %al
testb $0x1, %al
jne 0x1f945
jmp 0x1fa77
xorl %eax, %eax
movl %eax, %esi
leaq 0x218(%rsp), %rdi
callq 0x6b20
movq %rax, 0x8(%rsp)
jmp 0x1f95d
movq 0x8(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x23, %eax
jne 0x1fa72
leaq 0x218(%rsp), %rdi
movl $0x1, %esi
callq 0x6b20
movq %rax, (%rsp)
jmp 0x1f986
movq (%rsp), %rax
movsbl (%rax), %eax
cmpl $0x23, %eax
jne 0x1fa53
movq 0x50(%rsp), %rdi
addq $0x250, %rdi            # imm = 0x250
leaq 0x218(%rsp), %rsi
leaq 0x214(%rsp), %rdx
callq 0x2bb40
jmp 0x1f9b9
jmp 0x1fa70
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x240(%rsp)
movl %eax, 0x23c(%rsp)
leaq 0x24f(%rsp), %rdi
callq 0x65f0
jmp 0x1facd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x240(%rsp)
movl %eax, 0x23c(%rsp)
jmp 0x1fab3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x240(%rsp)
movl %eax, 0x23c(%rsp)
jmp 0x1fa31
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x240(%rsp)
movl %eax, 0x23c(%rsp)
leaq 0x70(%rsp), %rdi
callq 0x6b50
leaq 0x6f(%rsp), %rdi
callq 0x65f0
jmp 0x1faa6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x240(%rsp)
movl %eax, 0x23c(%rsp)
jmp 0x1faa6
movq 0x50(%rsp), %rdi
addq $0x250, %rdi            # imm = 0x250
leaq 0x218(%rsp), %rsi
callq 0x2f1a0
jmp 0x1fa6e
jmp 0x1fa70
jmp 0x1fa72
jmp 0x1f902
leaq 0x90(%rsp), %rdi
callq 0x6b48
leaq 0x218(%rsp), %rdi
callq 0x6b50
leaq 0x250(%rsp), %rdi
callq 0x6b50
addq $0x288, %rsp            # imm = 0x288
retq
leaq 0x90(%rsp), %rdi
callq 0x6b48
leaq 0x218(%rsp), %rdi
callq 0x6b50
leaq 0x250(%rsp), %rdi
callq 0x6b50
movq 0x240(%rsp), %rdi
callq 0x69e0
nopw (%rax,%rax)