// File: /workspace/github_cpp_makefile_star2_O2/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 %r12
pushq %rbx
subq $0x150, %rsp            # imm = 0x150
movq %rdi, %rbx
leaq 0x8(%rdi), %r14
movq 0x8(%rdi), %rdi
leaq 0xc0(%rsp), %rsi
callq 0x57d0
testl %eax, %eax
jne 0xe2d5
movl $0xf000, %eax           # imm = 0xF000
andl 0xd8(%rsp), %eax
cmpl $0x8000, %eax           # imm = 0x8000
je 0xe184
leaq 0x1f485(%rip), %rsi     # 0x2d5d8
leaq 0x80(%rsp), %r15
movq %r15, %rdi
movq %r14, %rdx
callq 0x967d
leaq 0x33363(%rip), %rdi     # 0x414d0
movq %r15, %rsi
xorl %edx, %edx
callq 0x2bf18
leaq 0x80(%rsp), %rdi
callq 0x5908
movq 0x10(%rbx), %rdx
addq $-0x4, %rdx
leaq 0x40(%rsp), %r15
pushq $-0x1
popq %rcx
movq %r15, %rdi
movq %r14, %rsi
callq 0x54c0
leaq 0x1f459(%rip), %rsi     # 0x2d5ff
movq %r15, %rdi
callq 0x96f3
movl %eax, %ebp
movq %r15, %rdi
callq 0x5908
testb %bpl, %bpl
je 0xe1f1
leaq 0x1f440(%rip), %rsi     # 0x2d604
leaq 0x20(%rsp), %rdi
leaq 0x40(%rsp), %rdx
callq 0x5160
leaq 0x332f6(%rip), %rdi     # 0x414d0
leaq 0x20(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x2bf18
leaq 0x20(%rsp), %rdi
callq 0x5908
cmpb $0x0, 0x28(%rbx)
je 0xe205
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
jmp 0xe2c5
movq 0x10(%rbx), %rdx
addq $-0x3, %rdx
leaq 0x40(%rsp), %r15
pushq $-0x1
popq %rcx
movq %r15, %rdi
movq %r14, %rsi
callq 0x54c0
leaq 0x1f22b(%rip), %rsi     # 0x2d452
movq %r15, %rdi
callq 0x96f3
movl %eax, %ebp
movq %r15, %rdi
callq 0x5908
testb %bpl, %bpl
je 0xe26c
leaq 0x1f3f7(%rip), %rsi     # 0x2d63c
movq %rsp, %rdi
leaq 0x40(%rsp), %rdx
callq 0x5160
leaq 0x33277(%rip), %rdi     # 0x414d0
movq %rsp, %rsi
pushq $0x1
popq %rdx
callq 0x2bf18
movq %rsp, %rdi
callq 0x5908
leaq 0x38(%rbx), %r15
movq 0x8(%rbx), %rsi
pushq $0x8
popq %rdx
movq %r15, %rdi
callq 0x5260
leaq 0xb0(%rbx), %rdi
callq 0x50d0
testb %al, %al
jne 0xe2c1
leaq 0x1f1fd(%rip), %rsi     # 0x2d493
leaq 0x60(%rsp), %r12
movq %r12, %rdi
movq %r14, %rdx
callq 0x967d
leaq 0x33223(%rip), %rdi     # 0x414d0
movq %r12, %rsi
xorl %edx, %edx
callq 0x2bf18
leaq 0x60(%rsp), %rdi
callq 0x5908
movq %r15, 0x30(%rbx)
addq $0x150, %rsp            # imm = 0x150
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1f2d3(%rip), %rdi     # 0x2d5af
callq 0x53c0
leaq 0x1f2d2(%rip), %rsi     # 0x2d5ba
leaq 0xa0(%rsp), %r15
movq %r15, %rdi
movq %r14, %rdx
callq 0x967d
leaq 0x331ce(%rip), %rdi     # 0x414d0
movq %r15, %rsi
xorl %edx, %edx
callq 0x2bf18
leaq 0xa0(%rsp), %rdi
callq 0x5908
jmp 0xe139
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
jmp 0xe359
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
jmp 0xe359
movq %rax, %rbx
movq %rsp, %rdi
jmp 0xe359
jmp 0xe349
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
jmp 0xe359
movq %rax, %rbx
jmp 0xe35e
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x5908
movq %rbx, %rdi
callq 0x5800