// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/htslib/hts.c
// Function: hts_readlist
char **hts_readlist(const char *string, int is_file, int *_n)
{
    int m = 0, n = 0, dret;
    char **s = 0;
    if ( is_file )
    {
#if KS_BGZF
        BGZF *fp = bgzf_open(string, "r");
#else
        gzFile fp = gzopen(string, "r");
#endif
        if ( !fp ) return NULL;

        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;
            n++;
            hts_expand(char*,n,m,s);
            s[n-1] = strdup(str.s);
        }
        ks_destroy(ks);
#if KS_BGZF
        bgzf_close(fp);
#else
        gzclose(fp);
#endif
        free(str.s);
    }
    else
    {
        const char *q = string, *p = string;
        while ( 1 )
        {
            if (*p == ',' || *p == 0)
            {
                n++;
                hts_expand(char*,n,m,s);
                s[n-1] = (char*)calloc(p - q + 1, 1);
                strncpy(s[n-1], q, p - q);
                q = p + 1;
            }
            if ( !*p ) break;
            p++;
        }
    }
    s = (char**)realloc(s, n * sizeof(char*));
    *_n = n;
    return s;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, %rbx
testl %esi, %esi
je 0x4eb1e
leaq 0x4754b(%rip), %rsi     # 0x95f09
callq 0x66abc
xorl %r15d, %r15d
testq %rax, %rax
je 0x4eb0c
movq %rax, %r13
movq %rbx, 0x20(%rsp)
movl $0x1, %edi
movl $0x28, %esi
callq 0x6470
movq %rax, %r12
xorps %xmm0, %xmm0
leaq 0x30(%rsp), %rbp
movaps %xmm0, (%rbp)
movq $0x0, 0x10(%rbp)
movq %r13, 0x18(%rax)
movl $0x40000, 0x8(%rax)     # imm = 0x40000
movl $0x10000, %edi          # imm = 0x10000
callq 0x69d0
movq %rax, 0x20(%r12)
leaq 0x2c(%rsp), %rbx
xorl %r14d, %r14d
movq $0x0, 0x8(%rsp)
movq %r12, %rdi
movl $0x2, %esi
movq %rbp, %rdx
movq %rbx, %rcx
xorl %r8d, %r8d
callq 0x4c505
testl %eax, %eax
js 0x4ead0
cmpq $0x0, 0x30(%rsp)
je 0x4ea28
movslq %r15d, %rax
cmpq %rax, %r14
movq %r13, 0x18(%rsp)
jge 0x4ea62
movq 0x8(%rsp), %r13
jmp 0x4eaa4
movl %r14d, %eax
shrl %eax
orl %r14d, %eax
movl %eax, %ecx
shrl $0x2, %ecx
orl %eax, %ecx
movl %ecx, %eax
shrl $0x4, %eax
orl %ecx, %eax
movl %eax, %ecx
shrl $0x8, %ecx
orl %eax, %ecx
movl %ecx, %r15d
shrl $0x10, %r15d
orl %ecx, %r15d
movslq %r15d, %rax
incl %r15d
leaq 0x8(,%rax,8), %rsi
movq 0x8(%rsp), %rdi
callq 0x6c80
movq %rax, %r13
leaq 0x1(%r14), %rax
movq %rax, 0x10(%rsp)
movq 0x40(%rsp), %rdi
callq 0x6dd0
movq %r13, 0x8(%rsp)
movq %rax, (%r13,%r14,8)
movq 0x10(%rsp), %r14
movq 0x18(%rsp), %r13
jmp 0x4ea28
movq %r12, %rdi
callq 0x4c4e9
movq %r13, %rdi
callq 0x68235
movq 0x40(%rsp), %rdi
callq 0x68a0
movq %r14, %r13
movslq %r13d, %rbx
leaq (,%rbx,8), %rsi
movq 0x8(%rsp), %rdi
callq 0x6c80
movq %rax, %r15
movq 0x20(%rsp), %rax
movl %ebx, (%rax)
movq %r15, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, 0x20(%rsp)
leaq 0x1(%rdi), %rcx
xorl %r15d, %r15d
movq %rdi, %r12
movq $0x0, 0x8(%rsp)
movl $0x0, 0x10(%rsp)
movzbl -0x1(%rcx), %eax
cmpl $0x2c, %eax
je 0x4eb4f
testl %eax, %eax
jne 0x4ebf5
cmpl 0x10(%rsp), %r15d
movq %rcx, 0x18(%rsp)
jge 0x4eb62
movq 0x8(%rsp), %rbp
jmp 0x4ebaa
movl %r15d, %eax
sarl %eax
orl %r15d, %eax
movl %eax, %ecx
sarl $0x2, %ecx
orl %eax, %ecx
movl %ecx, %eax
sarl $0x4, %eax
orl %ecx, %eax
movl %eax, %ecx
sarl $0x8, %ecx
orl %eax, %ecx
movl %ecx, %edx
sarl $0x10, %edx
orl %ecx, %edx
movslq %edx, %rax
incl %edx
movl %edx, 0x10(%rsp)
leaq 0x8(,%rax,8), %rsi
movq %rdi, %rbx
movq 0x8(%rsp), %rdi
callq 0x6c80
movq %rbx, %rdi
movq %rax, %rbp
leal 0x1(%r15), %r13d
movq %r12, %rbx
subq %rdi, %rbx
movq %rdi, %r14
leaq 0x1(%rbx), %rdi
movl $0x1, %esi
callq 0x6470
movslq %r15d, %rcx
movq %rbp, 0x8(%rsp)
movq %rax, (%rbp,%rcx,8)
movq %rax, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x6380
movq 0x18(%rsp), %rcx
cmpb $0x0, -0x1(%rcx)
movq %rcx, %rdi
movl %r13d, %r15d
je 0x4eaed
incq %rcx
incq %r12
jmp 0x4eb3e