// File: karel-brinda[P]ococo/ext/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
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
movq $0x0, -0x38(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x147d3
movq -0x10(%rbp), %rdi
leaq 0x67341(%rip), %rsi     # 0x7b9ef
callq 0x62d50
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0x146cb
movq $0x0, -0x8(%rbp)
jmp 0x1491a
movq $0x0, -0x50(%rbp)
movq $0x0, -0x58(%rbp)
movq $0x0, -0x60(%rbp)
movq -0x40(%rbp), %rdi
callq 0x10c30
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rdi
movl $0x2, %esi
leaq -0x60(%rbp), %rdx
leaq -0x2c(%rbp), %rcx
callq 0x14630
cmpl $0x0, %eax
jl 0x147b3
cmpq $0x0, -0x60(%rbp)
jne 0x14718
jmp 0x146f0
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x24(%rbp), %eax
jle 0x14791
movl -0x28(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
sarl %eax
orl -0x24(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
sarl $0x2, %eax
orl -0x24(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
sarl $0x4, %eax
orl -0x24(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
sarl $0x8, %eax
orl -0x24(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
sarl $0x10, %eax
orl -0x24(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movq -0x38(%rbp), %rdi
movslq -0x24(%rbp), %rsi
shlq $0x3, %rsi
callq 0x4990
movq %rax, -0x38(%rbp)
movq -0x50(%rbp), %rdi
callq 0x4aa0
movq %rax, %rdx
movq -0x38(%rbp), %rax
movl -0x28(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0x146f0
movq -0x48(%rbp), %rdi
callq 0x10c90
movq -0x40(%rbp), %rdi
callq 0x65880
movq -0x50(%rbp), %rdi
callq 0x46a0
jmp 0x148f4
movq -0x10(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2c, %eax
je 0x147ff
movq -0x70(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x148d6
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x24(%rbp), %eax
jle 0x14878
movl -0x28(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
sarl %eax
orl -0x24(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
sarl $0x2, %eax
orl -0x24(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
sarl $0x4, %eax
orl -0x24(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
sarl $0x8, %eax
orl -0x24(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
sarl $0x10, %eax
orl -0x24(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movq -0x38(%rbp), %rdi
movslq -0x24(%rbp), %rsi
shlq $0x3, %rsi
callq 0x4990
movq %rax, -0x38(%rbp)
movq -0x70(%rbp), %rdi
movq -0x68(%rbp), %rax
subq %rax, %rdi
addq $0x1, %rdi
movl $0x1, %esi
callq 0x4370
movq %rax, %rdx
movq -0x38(%rbp), %rax
movl -0x28(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x38(%rbp), %rax
movl -0x28(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
movq -0x68(%rbp), %rsi
movq -0x70(%rbp), %rdx
movq -0x68(%rbp), %rax
subq %rax, %rdx
callq 0x42c0
movq -0x70(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x68(%rbp)
movq -0x70(%rbp), %rax
cmpb $0x0, (%rax)
jne 0x148e1
jmp 0x148f2
movq -0x70(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x70(%rbp)
jmp 0x147e3
jmp 0x148f4
movq -0x38(%rbp), %rdi
movslq -0x28(%rbp), %rsi
shlq $0x3, %rsi
callq 0x4990
movq %rax, -0x38(%rbp)
movl -0x28(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x38(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)