// File: /workspace/github_c_makefile_star2_O2/lh3[P]fermi2/unpack.c
// Function: hts_readlines
char **hts_readlines(const char *fn, int64_t *_n)
{
	int64_t m = 0, n = 0;
	int dret;
	char **s = 0;
	gzFile fp;
	if ((fp = gzopen(fn, "r")) != 0) { // read from file
		kstream_t *ks;
		kstring_t str;
		str.s = 0; str.l = str.m = 0;
		ks = ks_init(fp);
		while (ks_getuntil(ks, KS_SEP_LINE, &str, &dret) >= 0) {
			if (str.l == 0) continue;
			if (m == n) {
				m = m? m<<1 : 16;
				s = (char**)realloc(s, m * sizeof(void*));
			}
			s[n++] = strdup(str.s);
		}
		ks_destroy(ks);
		gzclose(fp);
		s = (char**)realloc(s, n * sizeof(void*));
		free(str.s);
	} else if (*fn == ':') { // read from string
		const char *q, *p;
		for (q = p = fn + 1;; ++p)
			if (*p == ',' || *p == 0) {
				if (m == n) {
					m = m? m<<1 : 16;
					s = (char**)realloc(s, m * sizeof(void*));
				}
				s[n] = (char*)calloc(p - q + 1, 1);
				strncpy(s[n++], q, p - q);
				q = p + 1;
				if (*p == 0) break;
			}
	} else return 0;
	s = (char**)realloc(s, n * sizeof(void*));
	*_n = n;
	return s;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x1459c(%rip), %rsi     # 0x193a4
callq 0x22b0
testq %rax, %rax
je 0x4ef7
movq %rbx, 0x18(%rsp)
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %r14
movaps %xmm0, (%r14)
movq %rax, 0x8(%rsp)
movq %rax, %rdi
callq 0xbf98
movq %rax, %r12
xorl %r15d, %r15d
pushq $0x2
popq %rbp
leaq 0x34(%rsp), %rbx
movq $0x0, (%rsp)
xorl %r13d, %r13d
movq %r12, %rdi
movl %ebp, %esi
movq %r14, %rdx
movq %rbx, %rcx
xorl %r8d, %r8d
callq 0xbfed
testl %eax, %eax
js 0x4ebf
cmpl $0x0, 0x20(%rsp)
je 0x4e4d
cmpq %r15, %r13
jne 0x4e99
leaq (%r15,%r15), %rcx
testq %r15, %r15
pushq $0x10
popq %rax
cmoveq %rax, %rcx
movq %rcx, 0x10(%rsp)
leaq (,%rcx,8), %rsi
movq (%rsp), %rdi
callq 0x2260
movq %rax, %r13
jmp 0x4ea2
movq %r13, 0x10(%rsp)
movq (%rsp), %r13
movq 0x28(%rsp), %rdi
callq 0x2340
movq %r13, (%rsp)
movq %rax, (%r13,%r15,8)
incq %r15
movq 0x10(%rsp), %r13
jmp 0x4e4d
movq %r12, %rdi
callq 0xbfd1
movq 0x8(%rsp), %rdi
callq 0x2030
leaq (,%r15,8), %rbx
movq (%rsp), %rdi
movq %rbx, %rsi
callq 0x2260
movq %rax, %r12
movq 0x28(%rsp), %rdi
callq 0x2040
jmp 0x4fbb
cmpb $0x3a, (%r14)
jne 0x4fab
movq %rbx, 0x18(%rsp)
leaq 0x1(%r14), %rbx
addq $0x2, %r14
xorl %r15d, %r15d
movq $0x0, (%rsp)
movq $0x0, 0x8(%rsp)
movq %rbx, %r13
movzbl -0x1(%r14), %eax
cmpl $0x2c, %eax
je 0x4f33
testl %eax, %eax
jne 0x4fa0
cmpq %r15, 0x8(%rsp)
jne 0x4f63
leaq (%r15,%r15), %rcx
testq %r15, %r15
pushq $0x10
popq %rax
cmoveq %rax, %rcx
movq %rcx, 0x8(%rsp)
leaq (,%rcx,8), %rsi
movq (%rsp), %rdi
callq 0x2260
movq %rax, %rbp
jmp 0x4f67
movq (%rsp), %rbp
movq %rbx, %r12
subq %r13, %rbx
leaq 0x1(%rbx), %rdi
pushq $0x1
popq %rsi
callq 0x2190
movq %rbp, (%rsp)
movq %rax, (%rbp,%r15,8)
incq %r15
movq %rax, %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x2060
cmpb $0x0, -0x1(%r14)
je 0x4faf
movq %r14, %r13
movq %r12, %rbx
incq %r14
incq %rbx
jmp 0x4f25
xorl %eax, %eax
jmp 0x4fce
leaq (,%r15,8), %rbx
movq (%rsp), %r12
movq %r12, %rdi
movq %rbx, %rsi
callq 0x2260
movq 0x18(%rsp), %rcx
movq %r15, (%rcx)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq