// File: auton1[P]viterbi/bcf_file.cpp
// Function: bcf_file::open_gz()
void bcf_file::open_gz()
{
	int ret;
	gzMAX_LINE_LEN = 1024*1024;

	if (stream)
		gzfile_in = gzdopen(fileno(stdin), "r");
	else
		gzfile_in = gzopen(filename.c_str(), "rb");

	if (gzfile_in == NULL)
		LOG.error("Could not open BGZF BCF file: " + filename, 0);
	#ifdef ZLIB_VERNUM
		string tmp(ZLIB_VERSION);
		LOG.printLOG("Using zlib version: " + tmp + "\n");
		#if (ZLIB_VERNUM >= 0x1240)
			ret = gzbuffer(gzfile_in, gzMAX_LINE_LEN); // Included in zlib v1.2.4 and makes things MUCH faster
			if (ret != 0)
				LOG.warning("Unable to change zlib buffer size.");
		#else
			LOG.printLOG("Versions of zlib >= 1.2.4 will be *much* faster when reading compressed BCF files.\n");
		#endif
	#endif
}

// Assembly:
subq $0xf8, %rsp
movq %rdi, 0xf0(%rsp)
movq 0xf0(%rsp), %rax
movq %rax, 0x20(%rsp)
movl $0x100000, 0x240(%rax)  # imm = 0x100000
testb $0x1, 0x462(%rax)
je 0x1ff7d
movq 0x73062(%rip), %rax     # 0x92fb8
movq (%rax), %rdi
callq 0x65d0
movl %eax, %edi
leaq 0x54bd5(%rip), %rsi     # 0x74b3c
callq 0x6a20
movq %rax, %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x248(%rax)
jmp 0x1ffa9
movq 0x20(%rsp), %rdi
addq $0x8, %rdi
callq 0x61a0
movq %rax, %rdi
leaq 0x544f8(%rip), %rsi     # 0x7448d
callq 0x6860
movq %rax, %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x248(%rax)
movq 0x20(%rsp), %rax
cmpq $0x0, 0x248(%rax)
jne 0x20024
movq 0x20(%rsp), %rdx
addq $0x8, %rdx
leaq 0x544c8(%rip), %rsi     # 0x74490
leaq 0xc8(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0xe8d0
movq 0x18(%rsp), %rsi
leaq 0x7361a(%rip), %rdi     # 0x93600
xorl %edx, %edx
callq 0x712f0
jmp 0x1ffef
leaq 0xc8(%rsp), %rdi
callq 0x6b50
jmp 0x20024
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc0(%rsp)
movl %eax, 0xbc(%rsp)
leaq 0xc8(%rsp), %rdi
callq 0x6b50
jmp 0x20220
leaq 0x97(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x69f0
movq 0x10(%rsp), %rdx
leaq 0x5446d(%rip), %rsi     # 0x744af
leaq 0x98(%rsp), %rdi
callq 0x67c0
jmp 0x20051
leaq 0x97(%rsp), %rdi
callq 0x65f0
leaq 0x54451(%rip), %rsi     # 0x744b6
leaq 0x50(%rsp), %rdi
leaq 0x98(%rsp), %rdx
callq 0xe8d0
jmp 0x20079
leaq 0x5406b(%rip), %rdx     # 0x740eb
leaq 0x70(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0xf4a0
jmp 0x20091
leaq 0x73568(%rip), %rdi     # 0x93600
leaq 0x70(%rsp), %rsi
callq 0x71280
jmp 0x200a4
leaq 0x70(%rsp), %rdi
callq 0x6b50
leaq 0x50(%rsp), %rdi
callq 0x6b50
movq 0x20(%rsp), %rax
movq 0x248(%rax), %rdi
movl 0x240(%rax), %esi
callq 0x63d0
movl %eax, 0xc(%rsp)
jmp 0x200d5
movl 0xc(%rsp), %eax
movl %eax, 0xec(%rsp)
cmpl $0x0, 0xec(%rsp)
je 0x201fe
leaq 0x2f(%rsp), %rdi
movq %rdi, (%rsp)
callq 0x69f0
movq (%rsp), %rdx
leaq 0x543c4(%rip), %rsi     # 0x744cb
leaq 0x30(%rsp), %rdi
callq 0x67c0
jmp 0x20113
leaq 0x734e6(%rip), %rdi     # 0x93600
leaq 0x30(%rsp), %rsi
callq 0x715a0
jmp 0x20126
leaq 0x30(%rsp), %rdi
callq 0x6b50
leaq 0x2f(%rsp), %rdi
callq 0x65f0
jmp 0x201fe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc0(%rsp)
movl %eax, 0xbc(%rsp)
leaq 0x97(%rsp), %rdi
callq 0x65f0
jmp 0x20220
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc0(%rsp)
movl %eax, 0xbc(%rsp)
jmp 0x20213
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc0(%rsp)
movl %eax, 0xbc(%rsp)
jmp 0x201b2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc0(%rsp)
movl %eax, 0xbc(%rsp)
leaq 0x70(%rsp), %rdi
callq 0x6b50
leaq 0x50(%rsp), %rdi
callq 0x6b50
jmp 0x20213
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc0(%rsp)
movl %eax, 0xbc(%rsp)
jmp 0x201f2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc0(%rsp)
movl %eax, 0xbc(%rsp)
leaq 0x30(%rsp), %rdi
callq 0x6b50
leaq 0x2f(%rsp), %rdi
callq 0x65f0
jmp 0x20213
leaq 0x98(%rsp), %rdi
callq 0x6b50
addq $0xf8, %rsp
retq
leaq 0x98(%rsp), %rdi
callq 0x6b50
movq 0xc0(%rsp), %rdi
callq 0x69e0
nopl (%rax)