// File: 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:
subq $0x208, %rsp            # imm = 0x208
movq %rdi, 0x200(%rsp)
movq 0x200(%rsp), %rdi
movq %rdi, 0x60(%rsp)
addq $0x8, %rdi
callq 0x61a0
movq %rax, %rdi
leaq 0x170(%rsp), %rsi
callq 0x69a0
movl %eax, 0x16c(%rsp)
cmpl $0x0, 0x16c(%rsp)
je 0x25a4e
leaq 0x4ebb2(%rip), %rdi     # 0x7458f
callq 0x6440
movq 0x60(%rsp), %rdx
addq $0x8, %rdx
leaq 0x4eba8(%rip), %rsi     # 0x7459a
leaq 0x148(%rsp), %rdi
movq %rdi, 0x58(%rsp)
callq 0xe8d0
movq 0x58(%rsp), %rsi
leaq 0x6dbf0(%rip), %rdi     # 0x93600
xorl %edx, %edx
callq 0x712f0
jmp 0x25a19
leaq 0x148(%rsp), %rdi
callq 0x6b50
jmp 0x25a4e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x140(%rsp)
movl %eax, 0x13c(%rsp)
leaq 0x148(%rsp), %rdi
callq 0x6b50
jmp 0x25e15
movl 0x188(%rsp), %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0x8000, %eax           # imm = 0x8000
je 0x25acd
movq 0x60(%rsp), %rdx
addq $0x8, %rdx
leaq 0x4eb47(%rip), %rsi     # 0x745b8
leaq 0x118(%rsp), %rdi
movq %rdi, 0x50(%rsp)
callq 0xe8d0
movq 0x50(%rsp), %rsi
leaq 0x6db71(%rip), %rdi     # 0x93600
xorl %edx, %edx
callq 0x712f0
jmp 0x25a98
leaq 0x118(%rsp), %rdi
callq 0x6b50
jmp 0x25acd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x140(%rsp)
movl %eax, 0x13c(%rsp)
leaq 0x118(%rsp), %rdi
callq 0x6b50
jmp 0x25e15
movq 0x60(%rsp), %rdi
addq $0x8, %rdi
movq %rdi, 0x38(%rsp)
callq 0x6350
movq 0x38(%rsp), %rsi
movq %rax, %rdx
addq $-0x4, %rdx
leaq 0xf8(%rsp), %rdi
movq %rdi, 0x40(%rsp)
movq $-0x1, %rcx
callq 0x6580
movq 0x40(%rsp), %rdi
leaq 0x4eace(%rip), %rsi     # 0x745df
callq 0xea20
movb %al, 0x4f(%rsp)
jmp 0x25b1c
leaq 0xf8(%rsp), %rdi
callq 0x6b50
movb 0x4f(%rsp), %al
testb $0x1, %al
jne 0x25b36
jmp 0x25c09
leaq 0xd7(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0x69f0
movq 0x30(%rsp), %rdx
leaq 0x4ea90(%rip), %rsi     # 0x745e4
leaq 0xd8(%rsp), %rdi
callq 0x67c0
jmp 0x25b63
leaq 0x6da96(%rip), %rdi     # 0x93600
leaq 0xd8(%rsp), %rsi
movl $0x1, %edx
callq 0x712f0
jmp 0x25b7e
leaq 0xd8(%rsp), %rdi
callq 0x6b50
leaq 0xd7(%rsp), %rdi
callq 0x65f0
jmp 0x25c09
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x140(%rsp)
movl %eax, 0x13c(%rsp)
leaq 0xf8(%rsp), %rdi
callq 0x6b50
jmp 0x25e15
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x140(%rsp)
movl %eax, 0x13c(%rsp)
jmp 0x25bf7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x140(%rsp)
movl %eax, 0x13c(%rsp)
leaq 0xd8(%rsp), %rdi
callq 0x6b50
leaq 0xd7(%rsp), %rdi
callq 0x65f0
jmp 0x25e15
movq 0x60(%rsp), %rax
testb $0x1, 0x28(%rax)
jne 0x25e02
movq 0x60(%rsp), %rdi
addq $0x8, %rdi
movq %rdi, 0x18(%rsp)
callq 0x6350
movq 0x18(%rsp), %rsi
movq %rax, %rdx
addq $-0x3, %rdx
leaq 0xb0(%rsp), %rdi
movq %rdi, 0x20(%rsp)
movq $-0x1, %rcx
callq 0x6580
movq 0x20(%rsp), %rdi
leaq 0x4e7d6(%rip), %rsi     # 0x74432
callq 0xea20
movb %al, 0x2f(%rsp)
jmp 0x25c67
leaq 0xb0(%rsp), %rdi
callq 0x6b50
movb 0x2f(%rsp), %al
testb $0x1, %al
jne 0x25c81
jmp 0x25d54
leaq 0x8f(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x69f0
movq 0x10(%rsp), %rdx
leaq 0x4e97d(%rip), %rsi     # 0x7461c
leaq 0x90(%rsp), %rdi
callq 0x67c0
jmp 0x25cae
leaq 0x6d94b(%rip), %rdi     # 0x93600
leaq 0x90(%rsp), %rsi
movl $0x1, %edx
callq 0x712f0
jmp 0x25cc9
leaq 0x90(%rsp), %rdi
callq 0x6b50
leaq 0x8f(%rsp), %rdi
callq 0x65f0
jmp 0x25d54
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x140(%rsp)
movl %eax, 0x13c(%rsp)
leaq 0xb0(%rsp), %rdi
callq 0x6b50
jmp 0x25e15
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x140(%rsp)
movl %eax, 0x13c(%rsp)
jmp 0x25d42
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x140(%rsp)
movl %eax, 0x13c(%rsp)
leaq 0x90(%rsp), %rdi
callq 0x6b50
leaq 0x8f(%rsp), %rdi
callq 0x65f0
jmp 0x25e15
movq 0x60(%rsp), %rdi
movq %rdi, %rax
addq $0x38, %rax
movq %rax, 0x8(%rsp)
addq $0x8, %rdi
callq 0x61a0
movq 0x8(%rsp), %rdi
movq %rax, %rsi
movl $0x8, %edx
callq 0x62c0
movq 0x60(%rsp), %rdi
addq $0x38, %rdi
callq 0x68d0
testb $0x1, %al
jne 0x25df0
movq 0x60(%rsp), %rdx
addq $0x8, %rdx
leaq 0x4e6d1(%rip), %rsi     # 0x74473
leaq 0x68(%rsp), %rdi
movq %rdi, (%rsp)
callq 0xe8d0
movq (%rsp), %rsi
leaq 0x6d845(%rip), %rdi     # 0x93600
xorl %edx, %edx
callq 0x712f0
jmp 0x25dc4
leaq 0x68(%rsp), %rdi
callq 0x6b50
jmp 0x25df0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x140(%rsp)
movl %eax, 0x13c(%rsp)
leaq 0x68(%rsp), %rdi
callq 0x6b50
jmp 0x25e15
movq 0x60(%rsp), %rax
movq %rax, %rcx
addq $0x38, %rcx
movq %rcx, 0x30(%rax)
jmp 0x25e0d
movq 0x60(%rsp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
addq $0x208, %rsp            # imm = 0x208
retq
movq 0x140(%rsp), %rdi
callq 0x69e0
nopw %cs:(%rax,%rax)