// File: /workspace/github_cpp_makefile_star2_O3/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 0x10e23
movl $0xf000, %eax           # imm = 0xF000
andl 0xe0(%rsp), %eax
cmpl $0x8000, %eax           # imm = 0x8000
je 0x10c83
leaq 0x27a4f(%rip), %rsi     # 0x38698
leaq 0x88(%rsp), %r15
movq %r15, %rdi
movq %r14, %rdx
callq 0xb777
leaq 0x38845(%rip), %rdi     # 0x494a8
movq %r15, %rsi
xorl %edx, %edx
callq 0x36ec8
leaq 0x98(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10c83
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 0x27a16(%rip), %rsi     # 0x386bf
movq %r15, %rdi
callq 0x50e0
movl %eax, %ebp
movq (%r15), %rdi
leaq 0x78(%rsp), %r12
cmpq %r12, %rdi
je 0x10cc5
callq 0x5410
testl %ebp, %ebp
jne 0x10d10
leaq 0x38(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x279eb(%rip), %rsi     # 0x386c4
leaq 0x27a1b(%rip), %rdx     # 0x386fb
leaq 0x28(%rsp), %r15
movq %r15, %rdi
callq 0xc85e
leaq 0x387b4(%rip), %rdi     # 0x494a8
movq %r15, %rsi
movl $0x1, %edx
callq 0x36ec8
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x10d10
callq 0x5410
cmpb $0x0, 0x28(%rbx)
je 0x10d24
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
jmp 0x10e11
movq 0x10(%rbx), %rdx
addq $-0x3, %rdx
leaq 0x68(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movq $-0x1, %rcx
callq 0x5480
leaq 0x2777d(%rip), %rsi     # 0x384c7
movq %r15, %rdi
callq 0x50e0
movl %eax, %ebp
movq (%r15), %rdi
cmpq %r12, %rdi
je 0x10d61
callq 0x5410
testl %ebp, %ebp
jne 0x10dad
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x27986(%rip), %rsi     # 0x386fc
leaq 0x279c3(%rip), %rdx     # 0x38740
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0xc85e
leaq 0x38717(%rip), %rdi     # 0x494a8
movq %r15, %rsi
movl $0x1, %edx
callq 0x36ec8
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x10dad
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 0x10e0d
leaq 0x2772f(%rip), %rsi     # 0x38508
leaq 0x48(%rsp), %r12
movq %r12, %rdi
movq %r14, %rdx
callq 0xb777
leaq 0x386b8(%rip), %rdi     # 0x494a8
movq %r12, %rsi
xorl %edx, %edx
callq 0x36ec8
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10e0d
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 0x27845(%rip), %rdi     # 0x3866f
callq 0x5390
leaq 0x27844(%rip), %rsi     # 0x3867a
leaq 0xa8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rdx
callq 0xb777
leaq 0x38658(%rip), %rdi     # 0x494a8
movq %r15, %rsi
xorl %edx, %edx
callq 0x36ec8
leaq 0xb8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10c2f
callq 0x5410
jmp 0x10c2f
movq %rax, %rbx
leaq 0xb8(%rsp), %rax
jmp 0x10eb9
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
jne 0x10ec2
jmp 0x10ec7
movq %rax, %rbx
leaq 0x58(%rsp), %rax
jmp 0x10eb9
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
jne 0x10ec2
jmp 0x10ec7
movq %rax, %rbx
leaq 0x98(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10ec7
callq 0x5410
movq %rbx, %rdi
callq 0x57d0
nop