// File: /workspace/github_c_makefile_star2_O3/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 0x17223(%rip), %rsi     # 0x1d3bc
callq 0x22b0
testq %rax, %rax
je 0x6283
movq %rax, %r15
movq %rbx, 0x18(%rsp)
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %r14
movaps %xmm0, (%r14)
movq %rax, %rdi
callq 0xdba4
movq %rax, %r12
xorl %ebx, %ebx
leaq 0x34(%rsp), %rbp
xorl %r13d, %r13d
movq $0x0, 0x8(%rsp)
movq %r12, %rdi
movl $0x2, %esi
movq %r14, %rdx
movq %rbp, %rcx
xorl %r8d, %r8d
callq 0xdbfd
testl %eax, %eax
js 0x624e
cmpl $0x0, 0x20(%rsp)
je 0x61d9
movq %r15, 0x10(%rsp)
cmpq %rbx, 0x8(%rsp)
jne 0x6230
leaq (%rbx,%rbx), %rcx
testq %rbx, %rbx
movl $0x10, %eax
cmoveq %rax, %rcx
movq %rcx, 0x8(%rsp)
leaq (,%rcx,8), %rsi
movq %r13, %rdi
callq 0x2260
movq %rax, %r15
jmp 0x6233
movq %r13, %r15
movq 0x28(%rsp), %rdi
callq 0x2340
movq %r15, %r13
movq %rax, (%r15,%rbx,8)
incq %rbx
movq 0x10(%rsp), %r15
jmp 0x61d9
movq %r12, %rdi
callq 0xdbe1
movq %r15, %rdi
callq 0x2030
leaq (,%rbx,8), %r14
movq %r13, %rdi
movq %r14, %rsi
callq 0x2260
movq %rax, %r12
movq 0x28(%rsp), %rdi
callq 0x2040
jmp 0x634e
cmpb $0x3a, (%r14)
jne 0x633d
movq %rbx, 0x18(%rsp)
leaq 0x1(%r14), %r13
addq $0x2, %r14
xorl %ebx, %ebx
movq $0x0, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movq %r13, %rbp
movzbl -0x1(%r14), %eax
cmpl $0x2c, %eax
je 0x62bf
testl %eax, %eax
jne 0x6332
cmpq %rbx, 0x10(%rsp)
jne 0x62f2
leaq (%rbx,%rbx), %rcx
testq %rbx, %rbx
movl $0x10, %eax
cmoveq %rax, %rcx
movq %rcx, 0x10(%rsp)
leaq (,%rcx,8), %rsi
movq 0x8(%rsp), %rdi
callq 0x2260
movq %rax, %r15
jmp 0x62f7
movq 0x8(%rsp), %r15
movq %r13, %r12
subq %rbp, %r13
leaq 0x1(%r13), %rdi
movl $0x1, %esi
callq 0x2190
movq %r15, 0x8(%rsp)
movq %rax, (%r15,%rbx,8)
incq %rbx
movq %rax, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x2060
cmpb $0x0, -0x1(%r14)
je 0x6341
movq %r14, %rbp
movq %r12, %r13
incq %r14
incq %r13
jmp 0x62b1
xorl %eax, %eax
jmp 0x6361
leaq (,%rbx,8), %r14
movq 0x8(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x2260
movq 0x18(%rsp), %rcx
movq %rbx, (%rcx)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq