// File: auton1[P]viterbi/variant_file.cpp
// Function: variant_file::get_contigs(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&)
void variant_file::get_contigs(const string &contigs_file, vector<string> &contig_vector)
{
	if (contigs_file == "")
		LOG.error("Contig declarations in header are necessary for BCF conversion. Use --contigs <filename> to add contigs to the header.");

	ifstream contigs(contigs_file.c_str());
	if (!contigs.is_open())
		LOG.error("Could not open contigs file: " + contigs_file);

	string line;
	int contig_lines = 0;
	contig_vector.resize(0);

	while (getline(contigs, line))
	{
		if (line.find("##contig=")==string::npos)
			LOG.error("Contigs file must contain only contig header lines.");

		contig_vector.push_back(line);
		contig_lines++;
	}

	contigs.close();
	LOG.printLOG("Including "+header::int2str(contig_lines)+" header lines from the contig file.\n");
}

// Assembly:
subq $0x358, %rsp            # imm = 0x358
movq %rdi, 0x350(%rsp)
movq %rsi, 0x348(%rsp)
movq %rdx, 0x340(%rsp)
movq 0x348(%rsp), %rdi
leaq 0x4e52b(%rip), %rsi     # 0x75d29
callq 0xea20
testb $0x1, %al
jne 0x2780c
jmp 0x278b9
leaq 0x31f(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0x69f0
movq 0x28(%rsp), %rdx
leaq 0x4ce72(%rip), %rsi     # 0x7469c
leaq 0x320(%rsp), %rdi
callq 0x67c0
jmp 0x27839
leaq 0x6bdc0(%rip), %rdi     # 0x93600
leaq 0x320(%rsp), %rsi
movl $0x1, %edx
callq 0x712f0
jmp 0x27854
leaq 0x320(%rsp), %rdi
callq 0x6b50
leaq 0x31f(%rsp), %rdi
callq 0x65f0
jmp 0x278b9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x310(%rsp)
movl %eax, 0x30c(%rsp)
jmp 0x278a7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x310(%rsp)
movl %eax, 0x30c(%rsp)
leaq 0x320(%rsp), %rdi
callq 0x6b50
leaq 0x31f(%rsp), %rdi
callq 0x65f0
jmp 0x27c2a
movq 0x348(%rsp), %rdi
callq 0x61a0
movq %rax, %rsi
leaq 0x100(%rsp), %rdi
movq %rdi, 0x18(%rsp)
movl $0x8, %edx
callq 0x6a60
movq 0x18(%rsp), %rdi
callq 0x68d0
movb %al, 0x27(%rsp)
jmp 0x278f0
movb 0x27(%rsp), %al
testb $0x1, %al
jne 0x27985
jmp 0x278fe
movq 0x348(%rsp), %rdx
leaq 0x4ce06(%rip), %rsi     # 0x74713
leaq 0xe0(%rsp), %rdi
callq 0xe8d0
jmp 0x2791c
leaq 0x6bcdd(%rip), %rdi     # 0x93600
leaq 0xe0(%rsp), %rsi
movl $0x1, %edx
callq 0x712f0
jmp 0x27937
leaq 0xe0(%rsp), %rdi
callq 0x6b50
jmp 0x27985
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x310(%rsp)
movl %eax, 0x30c(%rsp)
jmp 0x27c1d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x310(%rsp)
movl %eax, 0x30c(%rsp)
leaq 0xe0(%rsp), %rdi
callq 0x6b50
jmp 0x27c1d
leaq 0xc0(%rsp), %rdi
callq 0x67e0
movl $0x0, 0xbc(%rsp)
movq 0x340(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2a0f0
jmp 0x279b0
jmp 0x279b2
leaq 0x100(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
callq 0x60c0
movq %rax, 0x10(%rsp)
jmp 0x279ce
movq 0x10(%rsp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x6700
movb %al, 0xf(%rsp)
jmp 0x279e8
movb 0xf(%rsp), %al
testb $0x1, %al
jne 0x279f5
jmp 0x27b08
leaq 0xc0(%rsp), %rdi
leaq 0x4cd2d(%rip), %rsi     # 0x74731
xorl %eax, %eax
movl %eax, %edx
callq 0x6b10
cmpq $-0x1, %rax
jne 0x27adb
leaq 0x97(%rsp), %rdi
movq %rdi, (%rsp)
callq 0x69f0
movq (%rsp), %rdx
leaq 0x4cd08(%rip), %rsi     # 0x7473b
leaq 0x98(%rsp), %rdi
callq 0x67c0
jmp 0x27a42
leaq 0x6bbb7(%rip), %rdi     # 0x93600
leaq 0x98(%rsp), %rsi
movl $0x1, %edx
callq 0x712f0
jmp 0x27a5d
leaq 0x98(%rsp), %rdi
callq 0x6b50
leaq 0x97(%rsp), %rdi
callq 0x65f0
jmp 0x27adb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x310(%rsp)
movl %eax, 0x30c(%rsp)
jmp 0x27c10
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x310(%rsp)
movl %eax, 0x30c(%rsp)
jmp 0x27ac9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x310(%rsp)
movl %eax, 0x30c(%rsp)
leaq 0x98(%rsp), %rdi
callq 0x6b50
leaq 0x97(%rsp), %rdi
callq 0x65f0
jmp 0x27c10
movq 0x340(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
callq 0x2a190
jmp 0x27af2
movl 0xbc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xbc(%rsp)
jmp 0x279b2
leaq 0x100(%rsp), %rdi
callq 0x60d0
jmp 0x27b17
movl 0xbc(%rsp), %esi
leaq 0x30(%rsp), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x30500
jmp 0x27b2f
leaq 0x4cc39(%rip), %rsi     # 0x7476f
leaq 0x50(%rsp), %rdi
leaq 0x30(%rsp), %rdx
callq 0xf4f0
jmp 0x27b47
leaq 0x4cc2c(%rip), %rdx     # 0x7477a
leaq 0x70(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0xf4a0
jmp 0x27b5f
leaq 0x6ba9a(%rip), %rdi     # 0x93600
leaq 0x70(%rsp), %rsi
callq 0x71280
jmp 0x27b72
leaq 0x70(%rsp), %rdi
callq 0x6b50
leaq 0x50(%rsp), %rdi
callq 0x6b50
leaq 0x30(%rsp), %rdi
callq 0x6b50
leaq 0xc0(%rsp), %rdi
callq 0x6b50
leaq 0x100(%rsp), %rdi
callq 0x6b38
addq $0x358, %rsp            # imm = 0x358
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x310(%rsp)
movl %eax, 0x30c(%rsp)
jmp 0x27c06
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x310(%rsp)
movl %eax, 0x30c(%rsp)
jmp 0x27bfc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x310(%rsp)
movl %eax, 0x30c(%rsp)
leaq 0x70(%rsp), %rdi
callq 0x6b50
leaq 0x50(%rsp), %rdi
callq 0x6b50
leaq 0x30(%rsp), %rdi
callq 0x6b50
leaq 0xc0(%rsp), %rdi
callq 0x6b50
leaq 0x100(%rsp), %rdi
callq 0x6b38
movq 0x310(%rsp), %rdi
callq 0x69e0
nopw (%rax,%rax)