// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/hts.c
// Function: hts_readlines
char **hts_readlines(const char *fn, int *_n)
{
    unsigned int m = 0, n = 0;
    char **s = 0, **s_new;
    BGZF *fp = bgzf_open(fn, "r");
    if ( fp ) { // read from file
        kstring_t str;
        int ret;
        str.s = 0; str.l = str.m = 0;
        while ((ret = bgzf_getline(fp, '\n', &str)) >= 0) {
            if (str.l == 0) continue;
            if (n == 0 && hts_is_utf16_text(&str))
                hts_log_warning("'%s' appears to be encoded as UTF-16", fn);
            if (hts_resize(char *, n + 1, &m, &s, 0) < 0)
                goto err;
            s[n] = strdup(str.s);
            if (!s[n])
                goto err;
            n++;
        }
        if (ret < -1) // Read error
            goto err;
        bgzf_close(fp);
        free(str.s);
    } else if (*fn == ':') { // read from string
        const char *q, *p;
        for (q = p = fn + 1;; ++p)
            if (*p == ',' || *p == 0) {
                if (hts_resize(char *, n + 1, &m, &s, 0) < 0)
                    goto err;
                s[n] = (char*)calloc(p - q + 1, 1);
                if (!s[n])
                    goto err;
                strncpy(s[n++], q, p - q);
                q = p + 1;
                if (*p == 0) break;
            }
    } else return 0;
    // Try to shrink s to the minimum size needed
    s_new = (char**)realloc(s, n * sizeof(char*));
    if (!s_new)
        goto err;

    s = s_new;
    assert(n < INT_MAX); // hts_resize() should ensure this
    *_n = n;
    return s;

 err:
    for (m = 0; m < n; m++)
        free(s[m]);
    free(s);
    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x10(%rbp), %rdi
leaq 0xd433d(%rip), %rsi     # 0xf2af1
callq 0xc090
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x1e8e6
movq $0x0, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movq $0x0, -0x50(%rbp)
movq -0x38(%rbp), %rdi
movl $0xa, %esi
leaq -0x50(%rbp), %rdx
callq 0x10f40
movl %eax, -0x54(%rbp)
cmpl $0x0, %eax
jl 0x1e8c4
cmpq $0x0, -0x50(%rbp)
jne 0x1e807
jmp 0x1e7e0
cmpl $0x0, -0x20(%rbp)
jne 0x1e839
leaq -0x50(%rbp), %rdi
callq 0x1dd90
cmpl $0x0, %eax
je 0x1e839
movq -0x10(%rbp), %rcx
movl $0x3, %edi
leaq 0xd1de1(%rip), %rsi     # 0xf060c
leaq 0xd1d75(%rip), %rdx     # 0xf05a7
movb $0x0, %al
callq 0x1b030
movl -0x20(%rbp), %eax
addl $0x1, %eax
cmpl -0x1c(%rbp), %eax
jbe 0x1e878
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %esi
movl $0x8, %edi
movl $0x4, %edx
leaq -0x1c(%rbp), %rcx
leaq -0x28(%rbp), %r8
xorl %r9d, %r9d
leaq 0xd1da2(%rip), %rax     # 0xf060c
movq %rax, (%rsp)
callq 0x1e4a0
movl %eax, -0x6c(%rbp)
jmp 0x1e87f
xorl %eax, %eax
movl %eax, -0x6c(%rbp)
jmp 0x1e87f
movl -0x6c(%rbp), %eax
cmpl $0x0, %eax
jge 0x1e88c
jmp 0x1ea7c
movq -0x40(%rbp), %rdi
callq 0x4920
movq %rax, %rdx
movq -0x28(%rbp), %rax
movl -0x20(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movq -0x28(%rbp), %rax
movl -0x20(%rbp), %ecx
cmpq $0x0, (%rax,%rcx,8)
jne 0x1e8b6
jmp 0x1ea7c
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x1e7e0
cmpl $-0x1, -0x54(%rbp)
jge 0x1e8cf
jmp 0x1ea7c
movq -0x38(%rbp), %rdi
callq 0x103d0
movq -0x40(%rbp), %rdi
callq 0x45a0
jmp 0x1ea18
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3a, %eax
jne 0x1ea09
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x68(%rbp)
movq %rax, -0x60(%rbp)
movq -0x68(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2c, %eax
je 0x1e922
movq -0x68(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x1e9f4
movl -0x20(%rbp), %eax
addl $0x1, %eax
cmpl -0x1c(%rbp), %eax
jbe 0x1e961
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %esi
movl $0x8, %edi
movl $0x4, %edx
leaq -0x1c(%rbp), %rcx
leaq -0x28(%rbp), %r8
xorl %r9d, %r9d
leaq 0xd1cb9(%rip), %rax     # 0xf060c
movq %rax, (%rsp)
callq 0x1e4a0
movl %eax, -0x70(%rbp)
jmp 0x1e968
xorl %eax, %eax
movl %eax, -0x70(%rbp)
jmp 0x1e968
movl -0x70(%rbp), %eax
cmpl $0x0, %eax
jge 0x1e975
jmp 0x1ea7c
movq -0x68(%rbp), %rdi
movq -0x60(%rbp), %rax
subq %rax, %rdi
addq $0x1, %rdi
movl $0x1, %esi
callq 0x42f0
movq %rax, %rdx
movq -0x28(%rbp), %rax
movl -0x20(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movq -0x28(%rbp), %rax
movl -0x20(%rbp), %ecx
cmpq $0x0, (%rax,%rcx,8)
jne 0x1e9af
jmp 0x1ea7c
movq -0x28(%rbp), %rax
movl -0x20(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x20(%rbp)
movl %ecx, %ecx
movq (%rax,%rcx,8), %rdi
movq -0x60(%rbp), %rsi
movq -0x68(%rbp), %rdx
movq -0x60(%rbp), %rax
subq %rax, %rdx
callq 0x4240
movq -0x68(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x60(%rbp)
movq -0x68(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x1e9f2
jmp 0x1ea07
jmp 0x1e9f4
jmp 0x1e9f6
movq -0x68(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x68(%rbp)
jmp 0x1e906
jmp 0x1ea16
movq $0x0, -0x8(%rbp)
jmp 0x1eab7
jmp 0x1ea18
movq -0x28(%rbp), %rdi
movl -0x20(%rbp), %eax
movl %eax, %esi
shlq $0x3, %rsi
callq 0x4820
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x1ea37
jmp 0x1ea7c
movq -0x30(%rbp), %rax
movq %rax, -0x28(%rbp)
cmpl $0x7fffffff, -0x20(%rbp) # imm = 0x7FFFFFFF
jae 0x1ea4a
jmp 0x1ea69
leaq 0xd1b7b(%rip), %rdi     # 0xf05cc
leaq 0xd1b80(%rip), %rsi     # 0xf05d8
movl $0x86d, %edx            # imm = 0x86D
leaq 0xd1bb6(%rip), %rcx     # 0xf061a
callq 0x42e0
movl -0x20(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x1eab7
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x20(%rbp), %eax
jae 0x1eaa6
movq -0x28(%rbp), %rax
movl -0x1c(%rbp), %ecx
movq (%rax,%rcx,8), %rdi
callq 0x45a0
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x1ea83
movq -0x28(%rbp), %rdi
callq 0x45a0
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)