// File: /workspace/github_cpp_makefile_star2_O1/auton1[P]viterbi/vcf_file.cpp
// Function: vcf_file::open()
void vcf_file::open()
{
	struct stat buf;

	int i = stat(filename.c_str(), &buf);
	if (i != 0)
	{
		perror("stat error");
		LOG.error("Can't determine file type of " + filename, 0);
	}
	if (!S_ISREG(buf.st_mode))
		LOG.error("Does not appear to be a regular file: " + filename, 0);

	if (filename.substr(filename.size()-4) == ".bcf")
		LOG.error("Filename ends in '.bcf'. Shouldn't you be using --bcf?\n");

	if (!compressed)
	{
		if (filename.substr(filename.size()-3) == ".gz")
			LOG.error("Filename ends in '.gz'. Shouldn't you be using --gzvcf or --gzdiff?\n");
		file_tmp.open(filename.c_str(), ios::in);
		if (!file_tmp.is_open())
			LOG.error("Could not open VCF file: " + filename, 0);

		file_in = &file_tmp;
	}
	else
		open_gz();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x158, %rsp            # imm = 0x158
movq %rdi, %rbx
leaq 0x8(%rdi), %r14
movq 0x8(%rdi), %rdi
leaq 0xc8(%rsp), %rsi
callq 0x5790
testl %eax, %eax
jne 0x10dd9
movl $0xf000, %eax           # imm = 0xF000
andl 0xe0(%rsp), %eax
cmpl $0x8000, %eax           # imm = 0x8000
je 0x10c39
leaq 0x28a99(%rip), %rsi     # 0x39698
leaq 0x88(%rsp), %r15
movq %r15, %rdi
movq %r14, %rdx
callq 0xb7dd
leaq 0x3988f(%rip), %rdi     # 0x4a4a8
movq %r15, %rsi
xorl %edx, %edx
callq 0x3721e
leaq 0x98(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10c39
callq 0x5410
movq 0x10(%rbx), %rdx
addq $-0x4, %rdx
leaq 0x68(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movq $-0x1, %rcx
callq 0x5480
leaq 0x28a60(%rip), %rsi     # 0x396bf
movq %r15, %rdi
callq 0x50e0
movl %eax, %ebp
movq (%r15), %rdi
leaq 0x78(%rsp), %r12
cmpq %r12, %rdi
je 0x10c7b
callq 0x5410
testl %ebp, %ebp
jne 0x10cc6
leaq 0x38(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x28a35(%rip), %rsi     # 0x396c4
leaq 0x28a65(%rip), %rdx     # 0x396fb
leaq 0x28(%rsp), %r15
movq %r15, %rdi
callq 0xc868
leaq 0x397fe(%rip), %rdi     # 0x4a4a8
movq %r15, %rsi
movl $0x1, %edx
callq 0x3721e
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x10cc6
callq 0x5410
cmpb $0x0, 0x28(%rbx)
je 0x10cda
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
jmp 0x10dc7
movq 0x10(%rbx), %rdx
addq $-0x3, %rdx
leaq 0x68(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movq $-0x1, %rcx
callq 0x5480
leaq 0x287c7(%rip), %rsi     # 0x394c7
movq %r15, %rdi
callq 0x50e0
movl %eax, %ebp
movq (%r15), %rdi
cmpq %r12, %rdi
je 0x10d17
callq 0x5410
testl %ebp, %ebp
jne 0x10d63
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x289d0(%rip), %rsi     # 0x396fc
leaq 0x28a0d(%rip), %rdx     # 0x39740
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0xc868
leaq 0x39761(%rip), %rdi     # 0x4a4a8
movq %r15, %rsi
movl $0x1, %edx
callq 0x3721e
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x10d63
callq 0x5410
leaq 0x38(%rbx), %r15
movq 0x8(%rbx), %rsi
movq %r15, %rdi
movl $0x8, %edx
callq 0x5240
leaq 0xb0(%rbx), %rdi
callq 0x50b0
testb %al, %al
jne 0x10dc3
leaq 0x28779(%rip), %rsi     # 0x39508
leaq 0x48(%rsp), %r12
movq %r12, %rdi
movq %r14, %rdx
callq 0xb7dd
leaq 0x39702(%rip), %rdi     # 0x4a4a8
movq %r12, %rsi
xorl %edx, %edx
callq 0x3721e
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10dc3
callq 0x5410
movq %r15, 0x30(%rbx)
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2888f(%rip), %rdi     # 0x3966f
callq 0x5390
leaq 0x2888e(%rip), %rsi     # 0x3967a
leaq 0xa8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rdx
callq 0xb7dd
leaq 0x396a2(%rip), %rdi     # 0x4a4a8
movq %r15, %rsi
xorl %edx, %edx
callq 0x3721e
leaq 0xb8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10be5
callq 0x5410
jmp 0x10be5
movq %rax, %rbx
leaq 0xb8(%rsp), %rax
jmp 0x10e6f
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
jne 0x10e78
jmp 0x10e7d
movq %rax, %rbx
leaq 0x58(%rsp), %rax
jmp 0x10e6f
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
jne 0x10e78
jmp 0x10e7d
movq %rax, %rbx
leaq 0x98(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10e7d
callq 0x5410
movq %rbx, %rdi
callq 0x57d0
nop