LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/hfile.c
// Function: hfile_list_schemes
HTSLIB_EXPORT
int hfile_list_schemes(const char *plugin, const char *sc_list[], int *nschemes)
{
    pthread_mutex_lock(&plugins_lock);
    if (!schemes && load_hfile_plugins() < 0) {
        pthread_mutex_unlock(&plugins_lock);
        return -1;
    }
    pthread_mutex_unlock(&plugins_lock);

    khiter_t k;
    int ns = 0;

    for (k = kh_begin(schemes); k != kh_end(schemes); k++) {
        if (!kh_exist(schemes, k))
            continue;

        const struct hFILE_scheme_handler *s = kh_value(schemes, k);
        if (plugin && strcmp(s->provider, plugin) != 0)
            continue;

        if (ns < *nschemes)
            sc_list[ns] = kh_key(schemes, k);
        ns++;
    }

    if (*nschemes > ns)
        *nschemes = ns;

    return ns;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movq %rsi, 0x10(%rsp)
movq %rdi, %r15
leaq 0xa6c1c(%rip), %rdi     # 0xb67d0
callq 0x4750
cmpq $0x0, 0xa6c37(%rip)     # 0xb67f8
jne 0xfbd0
callq 0xfc8e
testl %eax, %eax
js 0xfc6c
movq %rbx, 0x8(%rsp)
leaq 0xa6bf4(%rip), %rdi     # 0xb67d0
callq 0x4340
movq 0xa6c10(%rip), %r12     # 0xb67f8
movl (%r12), %r13d
testq %r13, %r13
je 0xfc5d
xorl %r14d, %r14d
xorl %ebx, %ebx
xorl %ebp, %ebp
movq 0x10(%r12), %rax
movl %ebx, %ecx
shrl $0x4, %ecx
movl (%rax,%rcx,4), %eax
movl %r14d, %ecx
andb $0x1e, %cl
shrl %cl, %eax
testb $0x3, %al
jne 0xfc4f
testq %r15, %r15
je 0xfc2f
movq 0x20(%r12), %rax
movq (%rax,%rbx,8), %rax
movq 0x10(%rax), %rdi
movq %r15, %rsi
callq 0x46c0
testl %eax, %eax
jne 0xfc4f
movq 0x8(%rsp), %rax
cmpl (%rax), %ebp
jge 0xfc4d
movq 0x18(%r12), %rax
movq (%rax,%rbx,8), %rax
movslq %ebp, %rcx
movq 0x10(%rsp), %rdx
movq %rax, (%rdx,%rcx,8)
incl %ebp
incq %rbx
addl $0x2, %r14d
cmpq %rbx, %r13
jne 0xfbf8
jmp 0xfc5f
xorl %ebp, %ebp
movq 0x8(%rsp), %rax
cmpl %ebp, (%rax)
jle 0xfc7d
movl %ebp, (%rax)
jmp 0xfc7d
leaq 0xa6b5d(%rip), %rdi     # 0xb67d0
callq 0x4340
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/hfile.c
// Function: hfile_list_plugins
HTSLIB_EXPORT
int hfile_list_plugins(const char *plist[], int *nplugins)
{
    pthread_mutex_lock(&plugins_lock);
    if (!schemes && load_hfile_plugins() < 0) {
        pthread_mutex_unlock(&plugins_lock);
        return -1;
    }
    pthread_mutex_unlock(&plugins_lock);

    int np = 0;
    if (*nplugins)
        plist[np++] = "built-in";

    struct hFILE_plugin_list *p = plugins;
    while (p) {
        if (np < *nplugins)
            plist[np] = p->plugin.name;

        p = p->next;
        np++;
    }

    if (*nplugins > np)
        *nplugins = np;

    return np;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xa6a88(%rip), %rdi     # 0xb67d0
callq 0x4750
cmpq $0x0, 0xa6aa3(%rip)     # 0xb67f8
jne 0xfd60
callq 0xfc8e
testl %eax, %eax
js 0xfdb6
leaq 0xa6a69(%rip), %rdi     # 0xb67d0
callq 0x4340
movslq (%rbx), %rcx
testq %rcx, %rcx
je 0xfd85
leaq 0x857b0(%rip), %rax     # 0x9552b
movq %rax, (%r14)
movl $0x1, %eax
jmp 0xfd87
xorl %eax, %eax
movq 0xa6a72(%rip), %rdx     # 0xb6800
testq %rdx, %rdx
je 0xfdae
movl %eax, %eax
cmpq %rcx, %rax
jge 0xfda2
movq 0x10(%rdx), %rsi
movq %rsi, (%r14,%rax,8)
incq %rax
movq 0x20(%rdx), %rdx
testq %rdx, %rdx
jne 0xfd95
cmpl %eax, %ecx
jle 0xfdc7
movl %eax, (%rbx)
jmp 0xfdc7
leaq 0xa6a13(%rip), %rdi     # 0xb67d0
callq 0x4340
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/hfile.c
// Function: hfile_has_plugin
HTSLIB_EXPORT
int hfile_has_plugin(const char *name)
{
    pthread_mutex_lock(&plugins_lock);
    if (!schemes && load_hfile_plugins() < 0) {
        pthread_mutex_unlock(&plugins_lock);
        return -1;
    }
    pthread_mutex_unlock(&plugins_lock);

    struct hFILE_plugin_list *p = plugins;
    while (p) {
        if (strcmp(p->plugin.name, name) == 0)
            return 1;
        p = p->next;
    }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0xa69f3(%rip), %rdi     # 0xb67d0
callq 0x4750
cmpq $0x0, 0xa6a0e(%rip)     # 0xb67f8
jne 0xfdf5
callq 0xfc8e
testl %eax, %eax
js 0xfe2c
leaq 0xa69d4(%rip), %rdi     # 0xb67d0
callq 0x4340
movq 0xa69f8(%rip), %r14     # 0xb6800
xorl %ebp, %ebp
testq %r14, %r14
je 0xfe3d
movq 0x10(%r14), %rdi
movq %rbx, %rsi
callq 0x46c0
testl %eax, %eax
je 0xfe25
movq 0x20(%r14), %r14
jmp 0xfe0a
movl $0x1, %ebp
jmp 0xfe3d
leaq 0xa699d(%rip), %rdi     # 0xb67d0
callq 0x4340
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/hfile.c
// Function: hopen
hFILE *hopen(const char *fname, const char *mode, ...)
{
    const struct hFILE_scheme_handler *handler = find_scheme_handler(fname);
    if (handler) {
        if (strchr(mode, ':') == NULL
            || handler->priority < 2000
            || handler->vopen == NULL) {
            return handler->open(fname, mode);
        }
        else {
            hFILE *fp;
            va_list arg;
            va_start(arg, mode);
            fp = handler->vopen(fname, mode, arg);
            va_end(arg);
            return fp;
        }
    }
    else if (strcmp(fname, "-") == 0) return hopen_fd_stdinout(mode);
    else return hopen_fd(fname, mode);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %rsi, %rbx
movq %rdi, %r14
movq %rdx, 0x10(%rsp)
movq %rcx, 0x18(%rsp)
movq %r8, 0x20(%rsp)
movq %r9, 0x28(%rsp)
testb %al, %al
je 0xfea0
movaps %xmm0, 0x30(%rsp)
movaps %xmm1, 0x40(%rsp)
movaps %xmm2, 0x50(%rsp)
movaps %xmm3, 0x60(%rsp)
movaps %xmm4, 0x70(%rsp)
movaps %xmm5, 0x80(%rsp)
movaps %xmm6, 0x90(%rsp)
movaps %xmm7, 0xa0(%rsp)
callq 0xff90
testq %rax, %rax
je 0xff1c
movq %rax, %r15
movq %rbx, %rdi
movl $0x3a, %esi
callq 0x4190
testq %rax, %rax
je 0xff04
cmpl $0x7d0, 0x18(%r15)      # imm = 0x7D0
jl 0xff04
cmpq $0x0, 0x20(%r15)
je 0xff04
movq %rsp, %rax
leaq 0xb0(%rsp), %rdx
movq %rax, 0x10(%rdx)
leaq 0x140(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rdx)
movq %r14, %rdi
movq %rbx, %rsi
callq *0x20(%r15)
jmp 0xff82
movq (%r15), %rax
movq %r14, %rdi
movq %rbx, %rsi
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r14
popq %r15
popq %rbp
jmpq *%rax
cmpb $0x2d, (%r14)
jne 0xff29
cmpb $0x0, 0x1(%r14)
je 0xff41
movq %r14, %rdi
movq %rbx, %rsi
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x10138
movq %rbx, %rdi
movl $0x72, %esi
callq 0x4190
xorl %ebp, %ebp
testq %rax, %rax
sete %bpl
leaq 0x857a0(%rip), %rdx     # 0x956fe
leaq 0xb0(%rsp), %r14
movl $0x65, %esi
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x4800
movl %ebp, %edi
movq %r14, %rsi
callq 0xf570
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/hfile.c
// Function: hopen_fd
static hFILE *hopen_fd(const char *filename, const char *mode)
{
    hFILE_fd *fp = NULL;
    int fd = open(filename, hfile_oflags(mode), 0666);
    if (fd < 0) goto error;

    fp = (hFILE_fd *) hfile_init(sizeof (hFILE_fd), mode, blksize(fd));
    if (fp == NULL) goto error;

    fp->fd = fd;
    fp->is_socket = 0;
    fp->is_shared = 0;
    fp->base.backend = &fd_backend;
    return &fp->base;

error:
    if (fd >= 0) { int save = errno; (void) close(fd); errno = save; }
    hfile_destroy((hFILE *) fp);
    return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x98, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0xf61f
xorl %r15d, %r15d
movq %rbx, %rdi
movl %eax, %esi
movl $0x1b6, %edx            # imm = 0x1B6
xorl %eax, %eax
callq 0x4330
testl %eax, %eax
js 0x101db
movl %eax, %ebx
leaq 0x8(%rsp), %rsi
movl %eax, %edi
callq 0x4890
testl %eax, %eax
je 0x10181
xorl %edx, %edx
jmp 0x1019b
movl $0xf000, %eax           # imm = 0xF000
andl 0x20(%rsp), %eax
movl $0x20000, %edx          # imm = 0x20000
cmpl $0x1000, %eax           # imm = 0x1000
je 0x1019b
movq 0x40(%rsp), %rdx
movl $0x40, %edi
movq %r14, %rsi
callq 0xecc0
testq %rax, %rax
je 0x101c4
movq %rax, %r15
movl %ebx, 0x38(%rax)
andb $-0x4, 0x3c(%rax)
leaq 0xa5632(%rip), %rax     # 0xb57f0
movq %rax, 0x20(%r15)
jmp 0x101db
callq 0x4050
movq %rax, %r14
movl (%rax), %ebp
movl %ebx, %edi
callq 0x49c0
movl %ebp, (%r14)
xorl %r15d, %r15d
movq %r15, %rax
addq $0x98, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/hfile.c
// Function: knet_open
HTSLIB_EXPORT
knetFile *knet_open(const char *fn, const char *mode) {
    knetFile *fp = calloc(1, sizeof(*fp));
    if (!fp) return NULL;
    if (!(fp->hf = hopen(fn, mode))) {
        free(fp);
        return NULL;
    }

    // FD backend is the only one implementing knet_fileno
    fp->fd = fp->hf->backend == &fd_backend
        ? ((hFILE_fd *)fp->hf)->fd
        : -1;

    return fp;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
movl $0x1, %edi
movl $0x88, %esi
callq 0x4300
testq %rax, %rax
je 0x104f7
movq %rax, %rbx
movq %r15, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0xfe44
movq %rax, 0x80(%rbx)
testq %rax, %rax
je 0x104ef
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
leaq 0xa530f(%rip), %rdx     # 0xb57f0
cmpq %rdx, 0x20(%rax)
jne 0x104ea
movl 0x38(%rax), %ecx
movl %ecx, 0x4(%rbx)
jmp 0x104f9
movq %rbx, %rdi
callq 0x45c0
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/hfile.c
// Function: knet_dopen
HTSLIB_EXPORT
knetFile *knet_dopen(int fd, const char *mode) {
    knetFile *fp = calloc(1, sizeof(*fp));
    if (!fp) return NULL;
    if (!(fp->hf = hdopen(fd, mode))) {
        free(fp);
        return NULL;
    }
    fp->fd = fd;
    return fp;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movl %edi, %ebp
movl $0x1, %edi
movl $0x88, %esi
callq 0x4300
testq %rax, %rax
je 0x10545
movq %rax, %rbx
movl %ebp, %edi
movq %r14, %rsi
callq 0xf570
movq %rax, 0x80(%rbx)
testq %rax, %rax
je 0x1053d
movl %ebp, 0x4(%rbx)
jmp 0x10547
movq %rbx, %rdi
callq 0x45c0
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/hfile.c
// Function: knet_seek
HTSLIB_EXPORT
off_t knet_seek(knetFile *fp, off_t off, int whence) {
    off_t r = hseek(fp->hf, off, whence);
    if (r >= 0)
        fp->offset = r;
    return r;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x80(%rdi), %rdi
callq 0xf3b3
testq %rax, %rax
js 0x105e6
movq %rax, 0x8(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/hfile.c
// Function: fd_read
static ssize_t fd_read(hFILE *fpv, void *buffer, size_t nbytes)
{
    hFILE_fd *fp = (hFILE_fd *) fpv;
    ssize_t n;
    do {
        n = fp->is_socket? recv(fp->fd, buffer, nbytes, 0)
                         : read(fp->fd, buffer, nbytes);
    } while (n < 0 && errno == EINTR);
    return n;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
testb $0x1, 0x3c(%r15)
movl 0x38(%r15), %edi
movq %r14, %rsi
movq %rbx, %rdx
jne 0x10636
callq 0x4710
jmp 0x1063d
xorl %ecx, %ecx
callq 0x4140
movq %rax, %r12
testq %rax, %rax
jns 0x1064f
callq 0x4050
cmpl $0x4, (%rax)
je 0x1061e
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/hfile.c
// Function: fd_write
static ssize_t fd_write(hFILE *fpv, const void *buffer, size_t nbytes)
{
    hFILE_fd *fp = (hFILE_fd *) fpv;
    ssize_t n;
    do {
        n = fp->is_socket?  send(fp->fd, buffer, nbytes, 0)
                         : write(fp->fd, buffer, nbytes);
    } while (n < 0 && errno == EINTR);
#ifdef _WIN32
        // On windows we have no SIGPIPE.  Instead write returns
        // EINVAL.  We check for this and our fd being a pipe.
        // If so, we raise SIGTERM instead of SIGPIPE.  It's not
        // ideal, but I think the only alternative is extra checking
        // in every single piece of code.
        if (n < 0 && errno == EINVAL &&
            GetLastError() == ERROR_NO_DATA &&
            GetFileType((HANDLE)_get_osfhandle(fp->fd)) == FILE_TYPE_PIPE) {
            raise(SIGTERM);
        }
#endif
    return n;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
testb $0x1, 0x3c(%r15)
movl 0x38(%r15), %edi
movq %r14, %rsi
movq %rbx, %rdx
jne 0x10687
callq 0x4180
jmp 0x1068e
xorl %ecx, %ecx
callq 0x4230
movq %rax, %r12
testq %rax, %rax
jns 0x106a0
callq 0x4050
cmpl $0x4, (%rax)
je 0x1066f
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/hfile.c
// Function: hopen_mem
static hFILE *hopen_mem(const char *url, const char *mode)
{
    size_t length, size;
    char *buffer;
    const char *data, *comma = strchr(url, ',');
    if (comma == NULL) { errno = EINVAL; return NULL; }
    data = comma+1;

    // TODO Implement write modes
    if (strchr(mode, 'r') == NULL) { errno = EROFS; return NULL; }

    if (comma - url >= 7 && cmp_prefix(";base64", &comma[-7]) == 0) {
        size = hts_base64_decoded_length(strlen(data));
        buffer = malloc(size);
        if (buffer == NULL) return NULL;
        hts_decode_base64(buffer, &length, data);
    }
    else {
        size = strlen(data) + 1;
        buffer = malloc(size);
        if (buffer == NULL) return NULL;
        hts_decode_percent(buffer, &length, data);
    }
    hFILE* hf;

    if(!(hf = create_hfile_mem(buffer, mode, length, size))){
        free(buffer);
        return NULL;
    }

    return hf;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r12
movl $0x2c, %esi
callq 0x4190
testq %rax, %rax
je 0x10a4f
movq %rax, %r15
movq %rbx, %rdi
movl $0x72, %esi
callq 0x4190
testq %rax, %rax
je 0x10ab1
leaq 0x1(%r15), %r14
movq %r15, %rax
subq %r12, %rax
cmpq $0x7, %rax
jl 0x10a5c
callq 0x40c0
movq (%rax), %rax
movb $0x3b, %sil
movq $-0x7, %rcx
leaq 0x84c68(%rip), %rdx     # 0x9566b
movzbl (%r15,%rcx), %edi
cmpb (%rax,%rdi,4), %sil
jne 0x10a5c
movb 0x8(%rcx,%rdx), %sil
incq %rcx
jne 0x10a03
movq %r14, %rdi
callq 0x41d0
movq %rax, %rdi
callq 0x34c24
movq %rax, %r15
movq %rax, %rdi
callq 0x4680
testq %rax, %rax
je 0x10ac6
movq %rax, %r12
movq %rsp, %rsi
movq %rax, %rdi
movq %r14, %rdx
callq 0x34c31
jmp 0x10a88
callq 0x4050
movl $0x16, (%rax)
jmp 0x10ac6
movq %r14, %rdi
callq 0x41d0
movq %rax, %r15
incq %r15
movq %r15, %rdi
callq 0x4680
testq %rax, %rax
je 0x10ac6
movq %rax, %r12
movq %rsp, %rsi
movq %rax, %rdi
movq %r14, %rdx
callq 0x34b74
movq (%rsp), %rcx
movl $0x38, %edi
movq %rbx, %rsi
movq %r12, %rdx
movq %r15, %r8
callq 0xeda0
testq %rax, %rax
je 0x10abe
leaq 0xa4d6d(%rip), %rcx     # 0xb5818
movq %rcx, 0x20(%rax)
jmp 0x10ac8
callq 0x4050
movl $0x1e, (%rax)
jmp 0x10ac6
movq %r12, %rdi
callq 0x45c0
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/hfile.c
// Function: hopen_fd_fileuri
static hFILE *hopen_fd_fileuri(const char *url, const char *mode)
{
    if (strncmp(url, "file://localhost/", 17) == 0) url += 16;
    else if (strncmp(url, "file:///", 8) == 0) url += 7;
    else { errno = EPROTONOSUPPORT; return NULL; }

#if defined(_WIN32) || defined(__MSYS__)
    // For cases like C:/foo
    if (url[0] == '/' && url[1] && url[2] == ':' && url[3] == '/') url++;
#endif

    return hopen_fd(url, mode);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x84b8e(%rip), %rsi     # 0x95673
movl $0x11, %edx
callq 0x4210
testl %eax, %eax
je 0x10b20
leaq 0x84b8b(%rip), %rsi     # 0x95685
movl $0x8, %edx
movq %r14, %rdi
callq 0x4210
testl %eax, %eax
je 0x10b27
callq 0x4050
movl $0x5d, (%rax)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movl $0x10, %eax
jmp 0x10b2c
movl $0x7, %eax
addq %rax, %r14
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x10138
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/hfile.c
// Function: init_add_plugin
static int init_add_plugin(void *obj, int (*init)(struct hFILE_plugin *),
                           const char *pluginname)
{
    struct hFILE_plugin_list *p = malloc (sizeof (struct hFILE_plugin_list));
    if (p == NULL) {
        hts_log_debug("Failed to allocate memory for plugin \"%s\"", pluginname);
        return -1;
    }

    p->plugin.api_version = 1;
    p->plugin.obj = obj;
    p->plugin.name = NULL;
    p->plugin.destroy = NULL;

    int ret = (*init)(&p->plugin);

    if (ret != 0) {
        hts_log_debug("Initialisation failed for plugin \"%s\": %d", pluginname, ret);
        free(p);
        return ret;
    }

    hts_log_debug("Loaded \"%s\"", pluginname);

    p->next = plugins, plugins = p;
    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r15
movl $0x28, %edi
callq 0x4680
testq %rax, %rax
je 0x10d39
movq %rax, %r14
movl $0x1, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movq $0x0, 0x18(%rax)
movq %rax, %rdi
callq *%r15
leaq 0x8497f(%rip), %rsi     # 0x9568e
testl %eax, %eax
je 0x10d5b
leaq 0x849ae(%rip), %rdx     # 0x956c8
movl $0x5, %edi
movq %rbx, %rcx
movl %eax, %r8d
xorl %eax, %eax
callq 0x13de5
movq %r14, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x45c0
leaq 0x8494e(%rip), %rsi     # 0x9568e
leaq 0x84957(%rip), %rdx     # 0x9569e
movl $0x5, %edi
movq %rbx, %rcx
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0x13de5
leaq 0x84990(%rip), %rdx     # 0x956f2
movl $0x5, %edi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x13de5
movq 0xa5a88(%rip), %rax     # 0xb6800
movq %rax, 0x20(%r14)
movq %r14, 0xa5a7d(%rip)     # 0xb6800
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/hts.c
// Function: hts_test_feature
const char *hts_test_feature(unsigned int id) {
    unsigned int feat = hts_features();

    switch (id) {
    case HTS_FEATURE_CONFIGURE:
        return feat & HTS_FEATURE_CONFIGURE ? "yes" : NULL;
    case HTS_FEATURE_PLUGINS:
        return feat & HTS_FEATURE_PLUGINS ? "yes" : NULL;
    case HTS_FEATURE_LIBCURL:
        return feat & HTS_FEATURE_LIBCURL ? "yes" : NULL;
    case HTS_FEATURE_S3:
        return feat & HTS_FEATURE_S3 ? "yes" : NULL;
    case HTS_FEATURE_GCS:
        return feat & HTS_FEATURE_GCS ? "yes" : NULL;
    case HTS_FEATURE_LIBDEFLATE:
        return feat & HTS_FEATURE_LIBDEFLATE ? "yes" : NULL;
    case HTS_FEATURE_BZIP2:
        return feat & HTS_FEATURE_BZIP2 ? "yes" : NULL;
    case HTS_FEATURE_LZMA:
        return feat & HTS_FEATURE_LZMA ? "yes" : NULL;

    case HTS_FEATURE_HTSCODECS:
        return htscodecs_version();

    case HTS_FEATURE_CC:
        return HTS_CC;
    case HTS_FEATURE_CFLAGS:
        return HTS_CFLAGS;
    case HTS_FEATURE_LDFLAGS:
        return HTS_LDFLAGS;
    case HTS_FEATURE_CPPFLAGS:
        return HTS_CPPFLAGS;

    default:
        fprintf(stderr, "Unknown feature code: %u\n", id);
    }

    return NULL;
}

// Assembly:
pushq %rbx
movl %edi, %edx
cmpl $0x3fffff, %edi         # imm = 0x3FFFFF
jg 0x115cd
xorl %ebx, %ebx
cmpl $0xfff, %edx            # imm = 0xFFF
jg 0x115f6
leal -0x1(%rdx), %eax
cmpl $0x2, %eax
jb 0x1164e
cmpl $0x400, %edx            # imm = 0x400
je 0x1160e
cmpl $0x800, %edx            # imm = 0x800
je 0x1164e
jmp 0x11653
cmpl $0xfffffff, %edx        # imm = 0xFFFFFFF
jg 0x11617
cmpl $0x400000, %edx         # imm = 0x400000
je 0x1160e
cmpl $0x800000, %edx         # imm = 0x800000
je 0x11641
cmpl $0x8000000, %edx        # imm = 0x8000000
jne 0x11653
leaq 0x846c3(%rip), %rbx     # 0x95cb7
jmp 0x1164e
cmpl $0x1000, %edx           # imm = 0x1000
je 0x1164e
cmpl $0x100000, %edx         # imm = 0x100000
je 0x1164e
cmpl $0x200000, %edx         # imm = 0x200000
jne 0x11653
leaq 0x8469e(%rip), %rbx     # 0x95cb3
jmp 0x1164e
cmpl $0x10000000, %edx       # imm = 0x10000000
je 0x11638
cmpl $0x20000000, %edx       # imm = 0x20000000
je 0x11647
cmpl $0x40000000, %edx       # imm = 0x40000000
jne 0x11653
leaq 0x8468c(%rip), %rbx     # 0x95cc2
jmp 0x1164e
leaq 0x8467c(%rip), %rbx     # 0x95cbb
jmp 0x1164e
popq %rbx
jmp 0x61520
leaq 0x8471f(%rip), %rbx     # 0x95d6d
movq %rbx, %rax
popq %rbx
retq
movq 0xa497e(%rip), %rax     # 0xb5fd8
movq (%rax), %rdi
leaq 0x84672(%rip), %rsi     # 0x95cd6
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x4700
jmp 0x1164e
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/hts.c
// Function: parse_version
static void
parse_version(htsFormat *fmt, const unsigned char *u, const unsigned char *ulim)
{
    const char *s    = (const char *) u;
    const char *slim = (const char *) ulim;
    short v;

    fmt->version.major = fmt->version.minor = -1;

    for (v = 0; s < slim && isdigit_c(*s); s++)
        v = 10 * v + *s - '0';

    if (s < slim) {
        fmt->version.major = v;
        if (*s == '.') {
            s++;
            for (v = 0; s < slim && isdigit_c(*s); s++)
                v = 10 * v + *s - '0';
            if (s < slim)
                fmt->version.minor = v;
        }
        else
            fmt->version.minor = 0;
    }
}

// Assembly:
movl $0xffffffff, 0x8(%rdi)  # imm = 0xFFFFFFFF
cmpq %rdx, %rsi
jae 0x1224f
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
callq 0x4510
movq (%rax), %rax
xorl %ecx, %ecx
movzbl (%r15), %edx
testb $0x8, 0x1(%rax,%rdx,2)
je 0x1220b
movsbl %dl, %edx
addl %ecx, %ecx
leal (%rcx,%rcx,4), %ecx
movswl %dx, %edx
addl %edx, %ecx
addl $-0x30, %ecx
incq %r15
cmpq %r14, %r15
jne 0x121e6
jmp 0x1224a
movw %cx, 0x8(%rbx)
cmpb $0x2e, (%r15)
jne 0x12244
incq %r15
cmpq %r14, %r15
jae 0x1224a
xorl %ecx, %ecx
movzbl (%r15), %edx
testb $0x8, 0x1(%rax,%rdx,2)
je 0x12246
movsbl %dl, %edx
addl %ecx, %ecx
leal (%rcx,%rcx,4), %ecx
movswl %dx, %edx
addl %edx, %ecx
addl $-0x30, %ecx
incq %r15
cmpq %r14, %r15
jb 0x1221f
jmp 0x1224a
xorl %ecx, %ecx
movw %cx, 0xa(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/hts.c
// Function: is_fastaq
static int is_fastaq(const unsigned char *u, const unsigned char *ulim)
{
    const unsigned char *eol = memchr(u, '\n', ulim - u);

    // Check that the first line is entirely textual
    if (! is_text_only(u, eol? eol : ulim)) return 0;

    // If the first line is very long, consider the file to indeed be FASTA/Q
    if (eol == NULL) return 1;

    u = eol+1; // Now points to the first character of the second line

    // Scan over all base-encoding letters (including 'N' but not SEQ's '=')
    while (u < ulim && (seq_nt16_table[*u] != 15 || toupper(*u) == 'N')) {
        if (*u == '=') return 0;
        u++;
    }

    return (u == ulim || *u == '\r' || *u == '\n')? 1 : 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r15
movq %rsi, %rdx
subq %rdi, %rdx
movl $0xa, %esi
callq 0x4550
movq %rax, %r14
testq %rax, %rax
cmoveq %rbx, %rax
cmpq %r15, %rax
jbe 0x1229f
movl $0x2600, %ecx           # imm = 0x2600
movb (%r15), %dl
cmpb $0x1f, %dl
ja 0x12297
cmpb $0xd, %dl
ja 0x122db
movzbl %dl, %edx
btl %edx, %ecx
jae 0x122db
incq %r15
cmpq %rax, %r15
jne 0x12282
movl $0x1, %ebp
testq %r14, %r14
je 0x122f3
incq %r14
leaq 0x836ad(%rip), %r15     # 0x95960
cmpq %rbx, %r14
jae 0x122df
movzbl (%r14), %r12d
cmpb $0xf, (%r12,%r15)
jne 0x122d2
callq 0x40a0
movq (%rax), %rax
cmpl $0x4e, (%rax,%r12,4)
jne 0x122df
incq %r14
cmpl $0x3d, %r12d
jne 0x122b3
xorl %ebp, %ebp
jmp 0x122f3
cmpq %rbx, %r14
je 0x122f3
movb (%r14), %al
cmpb $0xd, %al
je 0x122f3
xorl %ebp, %ebp
cmpb $0xa, %al
sete %bpl
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/hts.c
// Function: hts_opt_apply
int hts_opt_apply(htsFile *fp, hts_opt *opts) {
    hts_opt *last = NULL;

    for (; opts;  opts = (last=opts)->next) {
        switch (opts->opt) {
            case CRAM_OPT_REFERENCE:
                if (!(fp->fn_aux = strdup(opts->val.s)))
                    return -1;
                // fall through
            case CRAM_OPT_VERSION:
            case CRAM_OPT_PREFIX:
            case HTS_OPT_FILTER:
            case FASTQ_OPT_AUX:
            case FASTQ_OPT_BARCODE:
                if (hts_set_opt(fp,  opts->opt,  opts->val.s) != 0)
                    return -1;
                break;
            default:
                if (hts_set_opt(fp,  opts->opt,  opts->val.i) != 0)
                    return -1;
                break;
        }
    }

    return 0;
}

// Assembly:
testq %rsi, %rsi
je 0x13dd4
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl 0x8(%rbx), %ebp
cmpl $0x68, %ebp
jg 0x13d8f
cmpl $0x1, %ebp
je 0x13da4
cmpl $0x6, %ebp
je 0x13da4
cmpl $0x9, %ebp
jne 0x13dc3
movq 0x10(%rbx), %rdi
callq 0x4930
movq %rax, 0x30(%r14)
testq %rax, %rax
jne 0x13da4
jmp 0x13dd7
cmpl $0x69, %ebp
je 0x13da4
cmpl $0x3e9, %ebp            # imm = 0x3E9
je 0x13da4
cmpl $0x3eb, %ebp            # imm = 0x3EB
jne 0x13dc3
movq 0x10(%rbx), %rdx
movq %r14, %rdi
movl %ebp, %esi
xorl %eax, %eax
callq 0x14876
testl %eax, %eax
jne 0x13dd7
movq 0x18(%rbx), %rbx
testq %rbx, %rbx
jne 0x13d64
jmp 0x13dde
movl 0x10(%rbx), %edx
movq %r14, %rdi
movl %ebp, %esi
xorl %eax, %eax
callq 0x14876
jmp 0x13db4
xorl %eax, %eax
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x13de0
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/hts.c
// Function: hts_log
void hts_log(enum htsLogLevel severity, const char *context, const char *format, ...)
{
    int save_errno = errno;
    if (severity <= hts_verbose) {
        va_list argptr;

        fprintf(stderr, "[%c::%s] ", get_severity_tag(severity), context);

        va_start(argptr, format);
        vfprintf(stderr, format, argptr);
        va_end(argptr);

        fprintf(stderr, "\n");
    }
    errno = save_errno;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rdx, %r14
movq %rsi, %r15
movl %edi, %ebp
movq %rcx, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
testb %al, %al
je 0x13e48
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
callq 0x4050
movq %rax, %rbx
movl (%rax), %r12d
cmpl %ebp, 0xa2927(%rip)     # 0xb6780
jae 0x13e70
movl %r12d, (%rbx)
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xa2161(%rip), %r13     # 0xb5fd8
movq (%r13), %rdi
decl %ebp
movl $0x2a, %edx
cmpl $0x5, %ebp
ja 0x13e93
movl %ebp, %eax
leaq 0x81dac(%rip), %rcx     # 0x95c3c
movl (%rcx,%rax,4), %edx
leaq 0x82b82(%rip), %rsi     # 0x96a1c
movq %r15, %rcx
xorl %eax, %eax
callq 0x4700
movabsq $0x3000000018, %rax     # imm = 0x3000000018
movq %rsp, %rdx
movq %rax, (%rdx)
leaq 0x110(%rsp), %rax
movq %rax, 0x8(%rdx)
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rdx)
movq (%r13), %rdi
movq %r14, %rsi
callq 0x4690
movq (%r13), %rsi
movl $0xa, %edi
callq 0x4630
jmp 0x13e5b
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/hts.c
// Function: hts_opt_free
void hts_opt_free(hts_opt *opts) {
    hts_opt *last = NULL;
    while (opts) {
        opts = (last=opts)->next;
        free(last->arg);
        free(last);
    }
}

// Assembly:
testq %rdi, %rdi
je 0x14e8b
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rbx), %rdi
movq 0x18(%rbx), %r14
callq 0x45c0
movq %rbx, %rdi
callq 0x45c0
movq %r14, %rbx
testq %r14, %r14
jne 0x14e68
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/hts.c
// Function: hts_parse_opt_list
int hts_parse_opt_list(htsFormat *fmt, const char *str) {
    while (str && *str) {
        const char *str_start;
        int len;
        char arg[8001];

        while (*str && *str == ',')
            str++;

        for (str_start = str; *str && *str != ','; str++);
        len = str - str_start;

        // Produce a nul terminated copy of the option
        strncpy(arg, str_start, len < 8000 ? len : 8000);
        arg[len < 8000 ? len : 8000] = '\0';

        if (hts_opt_add((hts_opt **)&fmt->specific, arg) != 0)
            return -1;

        if (*str)
            str++;
    }

    return 0;
}

// Assembly:
xorl %eax, %eax
testq %rsi, %rsi
je 0x14f3b
cmpb $0x0, (%rsi)
je 0x14f3b
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1f50, %rsp           # imm = 0x1F50
movq %rdi, %rbx
addq $0x18, %rbx
movl $0x1f40, %ebp           # imm = 0x1F40
movq %rsp, %r14
decq %rsi
movb 0x1(%rsi), %cl
incq %rsi
cmpb $0x2c, %cl
je 0x14ec1
xorl %eax, %eax
movq %rsi, %r12
testb %cl, %cl
je 0x14ee9
movzbl %cl, %ecx
cmpl $0x2c, %ecx
je 0x14ee9
movb 0x1(%r12), %cl
incq %r12
incl %eax
jmp 0x14ed1
cmpl %ebp, %eax
cmovgel %ebp, %eax
movslq %eax, %r15
movq %r14, %rdi
movq %r15, %rdx
callq 0x4250
movb $0x0, (%rsp,%r15)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x13eef
testl %eax, %eax
jne 0x14f27
cmpb $0x1, (%r12)
sbbq $-0x1, %r12
cmpb $0x0, (%r12)
movq %r12, %rsi
jne 0x14ebe
xorl %eax, %eax
jmp 0x14f2c
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x1f50, %rsp           # imm = 0x1F50
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/hts.c
// Function: hts_idx_destroy
void hts_idx_destroy(hts_idx_t *idx)
{
    khint_t k;
    int i;
    if (idx == 0) return;

    // For HTS_FMT_CRAI, idx actually points to a different type -- see sam.c
    if (idx->fmt == HTS_FMT_CRAI) {
        hts_cram_idx_t *cidx = (hts_cram_idx_t *) idx;
        cram_index_free(cidx->cram);
        free(cidx);
        return;
    }

    for (i = 0; i < idx->m; ++i) {
        bidx_t *bidx = idx->bidx[i];
        free(idx->lidx[i].offset);
        if (bidx == 0) continue;
        for (k = kh_begin(bidx); k != kh_end(bidx); ++k)
            if (kh_exist(bidx, k))
                free(kh_value(bidx, k).list);
        kh_destroy(bin, bidx);
    }
    free(idx->bidx); free(idx->lidx); free(idx->meta);
    free(idx);
}

// Assembly:
testq %rdi, %rdi
je 0x152e6
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
cmpl $0x3, (%rdi)
jne 0x152e7
movq 0x8(%rbx), %rdi
callq 0x49d49
jmp 0x153a9
retq
cmpl $0x0, 0x18(%rbx)
jle 0x1538e
xorl %r15d, %r15d
movq 0x28(%rbx), %rax
movq 0x30(%rbx), %rcx
movq (%rax,%r15,8), %r14
leaq (%r15,%r15,2), %rax
movq 0x10(%rcx,%rax,8), %rdi
callq 0x45c0
testq %r14, %r14
je 0x1537e
movl (%r14), %eax
testl %eax, %eax
je 0x1535b
xorl %ebp, %ebp
xorl %r12d, %r12d
movq 0x10(%r14), %rcx
movl %r12d, %edx
shrl $0x4, %edx
movl (%rcx,%rdx,4), %edx
movl %ebp, %ecx
andb $0x1e, %cl
shrl %cl, %edx
testb $0x3, %dl
jne 0x15350
movq 0x20(%r14), %rax
movl %r12d, %ecx
leaq (%rcx,%rcx,2), %rcx
movq 0x10(%rax,%rcx,8), %rdi
callq 0x45c0
movl (%r14), %eax
incl %r12d
addl $0x2, %ebp
cmpl %eax, %r12d
jne 0x1531f
movq 0x18(%r14), %rdi
callq 0x45c0
movq 0x10(%r14), %rdi
callq 0x45c0
movq 0x20(%r14), %rdi
callq 0x45c0
movq %r14, %rdi
callq 0x45c0
incq %r15
movslq 0x18(%rbx), %rax
cmpq %rax, %r15
jl 0x152f4
movq 0x28(%rbx), %rdi
callq 0x45c0
movq 0x30(%rbx), %rdi
callq 0x45c0
movq 0x38(%rbx), %rdi
callq 0x45c0
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x45c0
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/hts.c
// Function: hts_set_threads
int hts_set_threads(htsFile *fp, int n)
{
    if (fp->format.format == sam) {
        return sam_set_threads(fp, n);
    } else if (fp->format.compression == bgzf) {
        return bgzf_mt(hts_get_bgzfp(fp), n, 256/*unused*/);
    } else if (fp->format.format == cram) {
        return hts_set_opt(fp, CRAM_OPT_NTHREADS, n);
    }
    else return 0;
}

// Assembly:
movl %esi, %edx
movl 0x4c(%rdi), %eax
cmpl $0x3, %eax
jne 0x1544c
movl %edx, %esi
jmp 0x2932e
cmpl $0x2, 0x54(%rdi)
jne 0x1545b
testb $0x10, (%rdi)
jne 0x1546c
xorl %edi, %edi
jmp 0x15470
cmpl $0x6, %eax
jne 0x1547c
movl $0xe, %esi
xorl %eax, %eax
jmp 0x14876
movq 0x38(%rdi), %rdi
movl %edx, %esi
movl $0x100, %edx            # imm = 0x100
jmp 0xcb25
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/hts.c
// Function: hts_set_thread_pool
int hts_set_thread_pool(htsFile *fp, htsThreadPool *p) {
    if (fp->format.format == sam || fp->format.format == text_format) {
        return sam_set_thread_pool(fp, p);
    } else if (fp->format.compression == bgzf) {
        return bgzf_thread_pool(hts_get_bgzfp(fp), p->pool, p->qsize);
    } else if (fp->format.format == cram) {
        return hts_set_opt(fp, CRAM_OPT_THREAD_POOL, p);
    }
    else return 0;
}

// Assembly:
movq %rsi, %rdx
movl 0x4c(%rdi), %eax
movl %eax, %ecx
andl $-0x2, %ecx
cmpl $0x2, %ecx
jne 0x15497
movq %rdx, %rsi
jmp 0x29246
cmpl $0x2, 0x54(%rdi)
jne 0x154a6
testb $0x10, (%rdi)
jne 0x154b7
xorl %edi, %edi
jmp 0x154bb
cmpl $0x6, %eax
jne 0x154c6
movl $0xf, %esi
xorl %eax, %eax
jmp 0x14876
movq 0x38(%rdi), %rdi
movq (%rdx), %rsi
movl 0x8(%rdx), %edx
jmp 0xc26c
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/hts.c
// Function: hts_set_filter_expression
int hts_set_filter_expression(htsFile *fp, const char *expr)
{
    if (fp->filter)
        hts_filter_free(fp->filter);

    if (!expr)
        return 0;

    return (fp->filter = hts_filter_init(expr))
        ? 0 : -1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x80(%rdi), %rdi
testq %rdi, %rdi
je 0x15500
callq 0x1cb69
testq %r14, %r14
je 0x15521
movq %r14, %rdi
callq 0x1cb10
movq %rax, %rcx
movq %rax, 0x80(%rbx)
xorl %eax, %eax
cmpq $0x1, %rcx
sbbl %eax, %eax
jmp 0x15523
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/hts.c
// Function: hts_set_fai_filename
int hts_set_fai_filename(htsFile *fp, const char *fn_aux)
{
    free(fp->fn_aux);
    if (fn_aux) {
        fp->fn_aux = strdup(fn_aux);
        if (fp->fn_aux == NULL) return -1;
    }
    else fp->fn_aux = NULL;

    if (fp->format.format == cram)
        if (cram_set_option(fp->fp.cram, CRAM_OPT_REFERENCE, fp->fn_aux))
            return -1;

    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x30(%rdi), %rdi
callq 0x45c0
testq %r14, %r14
je 0x15568
movq %r14, %rdi
callq 0x4930
movq %rax, 0x30(%rbx)
testq %rax, %rax
jne 0x15572
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x15598
movq $0x0, 0x30(%rbx)
xorl %eax, %eax
cmpl $0x6, 0x4c(%rbx)
jne 0x15596
movq 0x38(%rbx), %rdi
movl $0x9, %esi
movq %rax, %rdx
xorl %eax, %eax
callq 0x5348c
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %ecx, %ecx
jne 0x15598
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/hts.c
// Function: hts_open_tmpfile
hFILE *hts_open_tmpfile(const char *fname, const char *mode, kstring_t *tmpname)
{
    int pid = (int) getpid();
    unsigned ptr = (uintptr_t) tmpname;
    int n = 0;
    hFILE *fp = NULL;

    do {
        // Attempt to further uniquify the temporary filename
        unsigned t = ((unsigned) time(NULL)) ^ ((unsigned) clock()) ^ ptr;
        n++;

        ks_clear(tmpname);
        if (ksprintf(tmpname, "%s.tmp_%d_%d_%u", fname, pid, n, t) < 0) break;

        fp = hopen(tmpname->s, mode);
    } while (fp == NULL && errno == EEXIST && n < 100);

    return fp;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r14
movq %rsi, 0x10(%rsp)
movq %rdi, %r12
movq $0x0, 0x8(%rsp)
callq 0x4740
movl %eax, %ebp
xorl %r15d, %r15d
xorl %edi, %edi
callq 0x4450
movq %rax, %r13
callq 0x4310
xorl %r14d, %eax
xorl %eax, %r13d
leal 0x1(%r15), %ebx
movq $0x0, (%r14)
movq %r14, %rdi
leaq 0x80d38(%rip), %rsi     # 0x9632e
movq %r12, %rdx
movl %ebp, %ecx
movl %ebx, %r8d
movl %r13d, %r9d
xorl %eax, %eax
callq 0x9ab7
testl %eax, %eax
js 0x1563b
movq 0x10(%r14), %rdi
movq 0x10(%rsp), %rsi
xorl %eax, %eax
callq 0xfe44
testq %rax, %rax
jne 0x15636
callq 0x4050
cmpl $0x62, %r15d
ja 0x1563b
cmpl $0x11, (%rax)
movl %ebx, %r15d
je 0x155cc
jmp 0x1563b
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/hts.c
// Function: hts_getline
int hts_getline(htsFile *fp, int delimiter, kstring_t *str)
{
    int ret;
    if (! (delimiter == KS_SEP_LINE || delimiter == '\n')) {
        hts_log_error("Unexpected delimiter %d", delimiter);
        abort();
    }

    switch (fp->format.compression) {
    case no_compression:
        str->l = 0;
        ret = kgetline2(str, (kgets_func2 *) hgetln, fp->fp.hfile);
        if (ret >= 0) ret = (str->l <= INT_MAX)? (int) str->l : INT_MAX;
        else if (herrno(fp->fp.hfile)) ret = -2, errno = herrno(fp->fp.hfile);
        else ret = -1;
        break;

    case gzip:
    case bgzf:
        ret = bgzf_getline(fp->fp.bgzf, '\n', str);
        break;

    default:
        abort();
    }

    ++fp->lineno;
    return ret;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %eax
andl $-0x9, %eax
cmpl $0x2, %eax
jne 0x157c5
movq %rdx, %r14
movq %rdi, %rbx
movl 0x54(%rdi), %eax
leal -0x1(%rax), %ecx
cmpl $0x2, %ecx
jae 0x15768
movq 0x38(%rbx), %rdi
movl $0xa, %esi
movq %r14, %rdx
callq 0xdb70
jmp 0x157bc
testl %eax, %eax
jne 0x157e1
movq $0x0, (%r14)
movq 0x38(%rbx), %rdx
leaq 0x68(%rip), %rsi        # 0x157e6
movq %r14, %rdi
callq 0x9f20
testl %eax, %eax
js 0x1579e
movq (%r14), %rcx
testq $-0x80000000, %rcx      # imm = 0x80000000
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cmovel %ecx, %eax
jmp 0x157bc
movq 0x38(%rbx), %rax
movl 0x34(%rax), %ebp
testl %ebp, %ebp
je 0x157b7
callq 0x4050
movl %ebp, (%rax)
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
jmp 0x157bc
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
incq 0x8(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
movl %esi, %ecx
leaq 0x80b70(%rip), %rsi     # 0x9633e
leaq 0x80b75(%rip), %rdx     # 0x9634a
movl $0x1, %edi
xorl %eax, %eax
callq 0x13de5
callq 0x4270
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/hts.c
// Function: hts_file_type
int hts_file_type(const char *fname)
{
    int len = strlen(fname);
    if ( !strcasecmp(".vcf.gz",fname+len-7) ) return FT_VCF_GZ;
    if ( !strcasecmp(".vcf",fname+len-4) ) return FT_VCF;
    if ( !strcasecmp(".bcf",fname+len-4) ) return FT_BCF_GZ;
    if ( !strcmp("-",fname) ) return FT_STDIN;

    hFILE *f = hopen(fname, "r");
    if (f == NULL) return 0;

    htsFormat fmt;
    if (hts_detect_format2(f, fname, &fmt) < 0) { hclose_abruptly(f); return 0; }
    if (hclose(f) < 0) return 0;

    switch (fmt.format) {
    case vcf: return (fmt.compression == no_compression)? FT_VCF : FT_VCF_GZ;
    case bcf: return (fmt.compression == no_compression)? FT_BCF : FT_BCF_GZ;
    default:  return 0;
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
callq 0x41d0
movslq %eax, %r14
leaq (%rbx,%r14), %rsi
addq $-0x7, %rsi
leaq 0x80564(%rip), %rdi     # 0x9640c
callq 0x4520
testl %eax, %eax
je 0x15f4d
addq %rbx, %r14
addq $-0x4, %r14
leaq 0x80551(%rip), %rdi     # 0x96414
movq %r14, %rsi
callq 0x4520
testl %eax, %eax
je 0x15f54
leaq 0x8053f(%rip), %rdi     # 0x96419
movq %r14, %rsi
callq 0x4520
testl %eax, %eax
je 0x15f5b
movzbl (%rbx), %eax
subl $0x2d, %eax
jne 0x15ef2
movzbl 0x1(%rbx), %eax
negl %eax
testl %eax, %eax
je 0x15f62
leaq 0x826cc(%rip), %rsi     # 0x985cb
xorl %ebp, %ebp
movq %rbx, %rdi
xorl %eax, %eax
callq 0xfe44
testq %rax, %rax
je 0x15f7f
movq %rax, %r14
movq %rsp, %rdx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x116ab
movq %r14, %rdi
testl %eax, %eax
js 0x15f69
callq 0xf4df
xorl %ebp, %ebp
testl %eax, %eax
js 0x15f7f
movl 0x4(%rsp), %eax
cmpl $0x9, %eax
je 0x15f72
cmpl $0x8, %eax
jne 0x15f7f
cmpl $0x1, 0xc(%rsp)
movl $0x3, %ebp
jmp 0x15f7c
movl $0x3, %ebp
jmp 0x15f7f
movl $0x2, %ebp
jmp 0x15f7f
movl $0x5, %ebp
jmp 0x15f7f
movl $0x8, %ebp
jmp 0x15f7f
callq 0xf53f
xorl %ebp, %ebp
jmp 0x15f7f
cmpl $0x1, 0xc(%rsp)
movl $0x5, %ebp
sbbl $0x0, %ebp
movl %ebp, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/hts.c
// Function: hts_check_EOF
int hts_check_EOF(htsFile *fp)
{
    if (fp->format.compression == bgzf)
        return bgzf_check_EOF(hts_get_bgzfp(fp));
    else if (fp->format.format == cram)
        return cram_check_EOF(fp->fp.cram);
    else
        return 3;
}

// Assembly:
cmpl $0x2, 0x54(%rdi)
jne 0x15f9c
testb $0x10, (%rdi)
jne 0x15fab
xorl %edi, %edi
jmp 0xd6bc
cmpl $0x6, 0x4c(%rdi)
jne 0x15fb4
movq 0x38(%rdi), %rdi
jmp 0x53fa8
movq 0x38(%rdi), %rdi
jmp 0xd6bc
movl $0x3, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/hts.c
// Function: hts_idx_init
hts_idx_t *hts_idx_init(int n, int fmt, uint64_t offset0, int min_shift, int n_lvls)
{
    hts_idx_t *idx;
    idx = (hts_idx_t*)calloc(1, sizeof(hts_idx_t));
    if (idx == NULL) return NULL;
    idx->fmt = fmt;
    idx->min_shift = min_shift;
    idx->n_lvls = n_lvls;
    idx->n_bins = ((1<<(3 * n_lvls + 3)) - 1) / 7;
    idx->z.save_tid = idx->z.last_tid = -1;
    idx->z.save_bin = idx->z.last_bin = 0xffffffffu;
    idx->z.save_off = idx->z.last_off = idx->z.off_beg = idx->z.off_end = offset0;
    idx->z.last_coor = 0xffffffffu;
    if (n) {
        idx->n = idx->m = n;
        idx->bidx = (bidx_t**)calloc(n, sizeof(bidx_t*));
        if (idx->bidx == NULL) { free(idx); return NULL; }
        idx->lidx = (lidx_t*) calloc(n, sizeof(lidx_t));
        if (idx->lidx == NULL) { free(idx->bidx); free(idx); return NULL; }
    }
    idx->tbi_n = -1;
    idx->last_tbi_tid = -1;
    idx->otf_fp = NULL;
    return idx;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %r15d
movl %ecx, %r12d
movq %rdx, %r14
movl %esi, %r13d
movl %edi, %ebp
movl $0x1, %edi
movl $0xa0, %esi
callq 0x4300
testq %rax, %rax
je 0x1609a
movq %rax, %rbx
movl %r13d, (%rax)
movl %r12d, 0x4(%rax)
leal (%r15,%r15,2), %ecx
addb $0x3, %cl
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
shll %cl, %eax
movl %r15d, 0x8(%rbx)
notl %eax
movl $0x92492493, %ecx       # imm = 0x92492493
imulq %rax, %rcx
shrq $0x22, %rcx
movl %ecx, 0xc(%rbx)
movq $-0x1, %rax
movq %rax, 0x58(%rbx)
movq %rax, 0x48(%rbx)
movq %r14, 0x80(%rbx)
movq %r14, 0x78(%rbx)
movq %r14, 0x68(%rbx)
movq %r14, 0x70(%rbx)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %rax, 0x50(%rbx)
testl %ebp, %ebp
je 0x16080
movl %ebp, 0x18(%rbx)
movl %ebp, 0x14(%rbx)
movslq %ebp, %r15
movl $0x8, %esi
movq %r15, %rdi
callq 0x4300
movq %rax, 0x28(%rbx)
testq %rax, %rax
je 0x16092
movq %rax, %r14
movl $0x18, %esi
movq %r15, %rdi
callq 0x4300
movq %rax, 0x30(%rbx)
testq %rax, %rax
je 0x1608a
movq $-0x1, 0x40(%rbx)
jmp 0x1609c
movq %r14, %rdi
callq 0x45c0
movq %rbx, %rdi
callq 0x45c0
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/hts.c
// Function: insert_to_b
static inline int insert_to_b(bidx_t *b, int bin, uint64_t beg, uint64_t end)
{
    khint_t k;
    bins_t *l;
    int absent;
    k = kh_put(bin, b, bin, &absent);
    if (absent < 0) return -1; // Out of memory
    l = &kh_value(b, k);
    if (absent) {
        l->m = 1; l->n = 0;
        l->list = (hts_pair64_t*)calloc(l->m, sizeof(hts_pair64_t));
        if (!l->list) {
            kh_del(bin, b, k);
            return -1;
        }
    } else if (l->n == l->m) {
        uint32_t new_m = l->m ? l->m << 1 : 1;
        hts_pair64_t *new_list = realloc(l->list, new_m * sizeof(hts_pair64_t));
        if (!new_list) return -1;
        l->list = new_list;
        l->m = new_m;
    }
    l->list[l->n].u = beg;
    l->list[l->n++].v = end;
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, %r15
movq %rdi, %r12
leaq 0x4(%rsp), %rbx
movq %rbx, %rdx
callq 0x1bfb9
movl %eax, %ebp
movl (%rbx), %eax
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %eax, %eax
js 0x167a8
movl %ebp, %ecx
leaq (%rcx,%rcx,2), %r13
shlq $0x3, %r13
addq 0x20(%r12), %r13
testl %eax, %eax
je 0x1671c
movq $0x1, (%r13)
movl $0x1, %edi
movl $0x10, %esi
callq 0x4300
movq %rax, 0x10(%r13)
testq %rax, %rax
je 0x16758
xorl %ecx, %ecx
jmp 0x1678d
movl 0x4(%r13), %ecx
cmpl (%r13), %ecx
jne 0x16789
leal (%rcx,%rcx), %eax
testl %ecx, %ecx
movl $0x1, %r12d
cmovnel %eax, %r12d
movq 0x10(%r13), %rdi
movq %r12, %rsi
shlq $0x4, %rsi
callq 0x4840
testq %rax, %rax
je 0x167a8
movq %rax, 0x10(%r13)
movl %r12d, (%r13)
movl 0x4(%r13), %ecx
jmp 0x1678d
cmpl %ebp, (%r12)
je 0x167a8
movq 0x10(%r12), %rax
movl %ebp, %edx
shrl $0x4, %edx
movl (%rax,%rdx,4), %esi
addl %ebp, %ebp
andl $0x1e, %ebp
movl %esi, %edi
movl %ebp, %ecx
shrl %cl, %edi
testb $0x3, %dil
jne 0x167a8
btsl %ebp, %esi
movl %esi, (%rax,%rdx,4)
decl 0x4(%r12)
jmp 0x167a8
movq 0x10(%r13), %rax
movslq %ecx, %rcx
movq %rcx, %rdx
shlq $0x4, %rdx
movq %r15, (%rax,%rdx)
incl %ecx
movl %ecx, 0x4(%r13)
movq %r14, 0x8(%rax,%rdx)
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/hts.c
// Function: update_loff
static void update_loff(hts_idx_t *idx, int i, int free_lidx)
{
    bidx_t *bidx = idx->bidx[i];
    lidx_t *lidx = &idx->lidx[i];
    khint_t k;
    int l;
    // the last entry is always valid
    for (l=lidx->n-2; l >= 0; l--) {
        if (lidx->offset[l] == (uint64_t)-1)
            lidx->offset[l] = lidx->offset[l+1];
    }
    if (bidx == 0) return;
    for (k = kh_begin(bidx); k != kh_end(bidx); ++k) // set loff
        if (kh_exist(bidx, k))
        {
            if ( kh_key(bidx, k) < idx->n_bins )
            {
                int bot_bin = hts_bin_bot(kh_key(bidx, k), idx->n_lvls);
                // disable linear index if bot_bin out of bounds
                kh_val(bidx, k).loff = bot_bin < lidx->n ? lidx->offset[bot_bin] : 0;
            }
            else
                kh_val(bidx, k).loff = 0;
        }
    if (free_lidx) {
        free(lidx->offset);
        lidx->m = lidx->n = 0;
        lidx->offset = 0;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movslq %esi, %rcx
movq 0x28(%rdi), %rax
movq 0x30(%rdi), %rsi
movq (%rax,%rcx,8), %rax
leaq (%rcx,%rcx,2), %rcx
leaq (%rsi,%rcx,8), %rbx
movl (%rbx), %esi
addl $-0x2, %esi
js 0x167fd
movq 0x10(%rbx), %rcx
movl %esi, %esi
incq %rsi
cmpq $-0x1, -0x8(%rcx,%rsi,8)
jne 0x167f8
movq (%rcx,%rsi,8), %r8
movq %r8, -0x8(%rcx,%rsi,8)
decq %rsi
jg 0x167e7
testq %rax, %rax
je 0x168ce
movl (%rax), %esi
testq %rsi, %rsi
je 0x168b3
movq 0x10(%rax), %r8
xorl %r9d, %r9d
movl $0x92492493, %r10d      # imm = 0x92492493
movl %r9d, %ecx
shrl $0x4, %ecx
movl (%r8,%rcx,4), %r11d
leal (%r9,%r9), %ecx
shrl %cl, %r11d
testb $0x3, %r11b
jne 0x168a7
movq 0x18(%rax), %rcx
movl (%rcx,%r9,4), %r11d
cmpl 0xc(%rdi), %r11d
jae 0x16898
xorl %r14d, %r14d
testl %r11d, %r11d
je 0x1685f
movl %r11d, %ecx
incl %r14d
decl %ecx
movl %ecx, %ebp
sarl $0x3, %ebp
cmpl $0x7, %ecx
movl %ebp, %ecx
ja 0x1684e
leal (%r14,%r14,2), %ecx
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
shll %cl, %r15d
movl 0x8(%rdi), %ecx
notl %r15d
imulq %r10, %r15
shrq $0x22, %r15
subl %r15d, %r11d
subl %r14d, %ecx
leal (%rcx,%rcx,2), %ecx
shll %cl, %r11d
movslq %r11d, %rcx
cmpq %rcx, (%rbx)
jle 0x16898
movq 0x10(%rbx), %r11
movq (%r11,%rcx,8), %rcx
jmp 0x1689a
xorl %ecx, %ecx
movq 0x20(%rax), %r11
leaq (%r9,%r9,2), %r14
movq %rcx, 0x8(%r11,%r14,8)
incq %r9
cmpq %rsi, %r9
jne 0x1681e
testl %edx, %edx
je 0x168ce
movq 0x10(%rbx), %rdi
callq 0x45c0
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq