LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/hfile.c
// Function: hgets
char *hgets(char *buffer, int size, hFILE *fp)
{
    if (size < 1) {
        fp->has_errno = errno = EINVAL;
        return NULL;
    }
    return hgetln(buffer, size, fp) > 0 ? buffer : NULL;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
testl %esi, %esi
jle 0xd4c9
movq %rdi, %r14
movl %esi, %esi
pushq $0xa
popq %rdx
movq %rbx, %rcx
callq 0xd394
movq %rax, %rcx
xorl %eax, %eax
testq %rcx, %rcx
cmovgq %r14, %rax
jmp 0xd4d8
callq 0x4050
pushq $0x16
popq %rcx
movl %ecx, (%rax)
movl %ecx, 0x34(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/hfile.c
// Function: hpeek
ssize_t hpeek(hFILE *fp, void *buffer, size_t nbytes)
{
    size_t n = fp->end - fp->begin;
    while (n < nbytes) {
        ssize_t ret = refill_buffer(fp);
        if (ret < 0) return ret;
        else if (ret == 0) break;
        else n += ret;
    }

    if (n > nbytes) n = nbytes;
    memcpy(buffer, fp->begin, n);
    return n;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x10(%rdi), %r13
subq 0x8(%rdi), %r13
pushq $0x1
popq %rbp
cmpq %rbx, %r13
jae 0xd533
movq %r15, %rdi
callq 0xd305
xorl %ecx, %ecx
testq %rax, %rax
sete %cl
leal (%rcx,%rcx,2), %ecx
movl $0x0, %edx
cmovgq %rax, %rdx
cmovsq %rax, %r12
cmovsl %ebp, %ecx
addq %rdx, %r13
testl %ecx, %ecx
je 0xd4ff
cmpl $0x3, %ecx
jne 0xd54c
cmpq %rbx, %r13
cmovbq %r13, %rbx
movq 0x8(%r15), %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x43c0
movq %rbx, %r12
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/hfile.c
// Function: hread2
HTSLIB_EXPORT
ssize_t hread2(hFILE *fp, void *destv, size_t nbytes, size_t nread)
{
    const size_t capacity = fp->limit - fp->buffer;
    int buffer_invalidated = 0;
    char *dest = (char *) destv;
    dest += nread, nbytes -= nread;

    // Read large requests directly into the destination buffer
    while (nbytes * 2 >= capacity && !fp->at_eof) {
        ssize_t n = fp->backend->read(fp, dest, nbytes);
        if (n < 0) { fp->has_errno = errno; return n; }
        else if (n == 0) fp->at_eof = 1;
        else buffer_invalidated = 1;
        fp->offset += n;
        dest += n, nbytes -= n;
        nread += n;
    }

    if (buffer_invalidated) {
        // Our unread buffer is empty, so begin == end, but our already-read
        // buffer [buffer,begin) is likely non-empty and is no longer valid as
        // its contents are no longer adjacent to the file position indicator.
        // Discard it so that hseek() can't try to take advantage of it.
        fp->offset += fp->begin - fp->buffer;
        fp->begin = fp->end = fp->buffer;
    }

    while (nbytes > 0 && !fp->at_eof) {
        size_t n;
        ssize_t ret = refill_buffer(fp);
        if (ret < 0) return ret;

        n = fp->end - fp->begin;
        if (n > nbytes) n = nbytes;
        memcpy(dest, fp->begin, n);
        fp->begin += n;
        dest += n, nbytes -= n;
        nread += n;
    }

    return nread;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
movq 0x18(%rdi), %rax
subq (%rdi), %rax
movq %rax, (%rsp)
addq %rcx, %r12
subq %rcx, %r15
xorl %ebp, %ebp
leaq (%r15,%r15), %rax
cmpq (%rsp), %rax
jb 0xd5cb
testb $0x1, 0x30(%rbx)
jne 0xd5cb
movq 0x20(%rbx), %rax
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq *(%rax)
movq %rax, %r13
testq %rax, %rax
js 0xd62e
pushq $0x1
popq %rax
jne 0xd5ba
orb $0x1, 0x30(%rbx)
movl %ebp, %eax
addq %r13, 0x28(%rbx)
addq %r13, %r12
subq %r13, %r15
addq %r13, %r14
movl %eax, %ebp
jmp 0xd588
testl %ebp, %ebp
je 0xd5e5
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
subq %rax, %rcx
addq %rcx, 0x28(%rbx)
movq %rax, 0x10(%rbx)
movq %rax, 0x8(%rbx)
testq %r15, %r15
je 0xd629
testb $0x1, 0x30(%rbx)
jne 0xd629
movq %rbx, %rdi
callq 0xd305
testq %rax, %rax
js 0xd63a
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %r13
subq %rsi, %r13
cmpq %r15, %r13
cmovaeq %r15, %r13
movq %r12, %rdi
movq %r13, %rdx
callq 0x43c0
addq %r13, 0x8(%rbx)
addq %r13, %r12
subq %r13, %r15
addq %r13, %r14
jmp 0xd5e5
movq %r14, %r13
jmp 0xd63d
callq 0x4050
movl (%rax), %eax
movl %eax, 0x34(%rbx)
jmp 0xd63d
movq %rax, %r13
movq %r13, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/hfile.c
// Function: hflush
int hflush(hFILE *fp)
{
    if (flush_buffer(fp) < 0) return EOF;
    if (fp->backend->flush) {
        if (fp->backend->flush(fp) < 0) { fp->has_errno = errno; return EOF; }
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0xd690
pushq $-0x1
popq %r14
testq %rax, %rax
js 0xd686
movq 0x20(%rbx), %rax
movq 0x18(%rax), %rax
xorl %ebp, %ebp
testq %rax, %rax
je 0xd689
movq %rbx, %rdi
callq *%rax
testl %eax, %eax
jns 0xd689
callq 0x4050
movl (%rax), %eax
movl %eax, 0x34(%rbx)
movl %r14d, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/hfile.c
// Function: flush_buffer
static ssize_t flush_buffer(hFILE *fp)
{
    const char *buffer = fp->buffer;
    while (buffer < fp->begin) {
        ssize_t n = fp->backend->write(fp, buffer, fp->begin - buffer);
        if (n < 0) { fp->has_errno = errno; return n; }
        buffer += n;
        fp->offset += n;
    }

    fp->begin = fp->buffer;  // Leave the buffer empty
    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %r14
movq 0x8(%rbx), %rdx
cmpq %rdx, %r14
jae 0xd6c5
movq 0x20(%rbx), %rax
subq %r14, %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq *0x8(%rax)
movq %rax, %r15
testq %rax, %rax
js 0xd6d1
addq %r15, %r14
addq %r15, 0x28(%rbx)
jmp 0xd69b
movq (%rbx), %rax
movq %rax, 0x8(%rbx)
xorl %r15d, %r15d
jmp 0xd6db
callq 0x4050
movl (%rax), %eax
movl %eax, 0x34(%rbx)
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/hfile.c
// Function: hwrite2
HTSLIB_EXPORT
ssize_t hwrite2(hFILE *fp, const void *srcv, size_t totalbytes, size_t ncopied)
{
    const char *src = (const char *) srcv;
    ssize_t ret;
    const size_t capacity = fp->limit - fp->buffer;
    size_t remaining = totalbytes - ncopied;
    src += ncopied;

    ret = flush_buffer(fp);
    if (ret < 0) return ret;

    // Write large blocks out directly from the source buffer
    while (remaining * 2 >= capacity) {
        ssize_t n = fp->backend->write(fp, src, remaining);
        if (n < 0) { fp->has_errno = errno; return n; }
        fp->offset += n;
        src += n, remaining -= n;
    }

    // Just buffer any remaining characters
    memcpy(fp->begin, src, remaining);
    fp->begin += remaining;

    return totalbytes;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbp
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %rbx
movq 0x18(%rdi), %r14
subq (%rdi), %r14
callq 0xd690
testq %rax, %rax
js 0xd776
addq %rbp, %r15
movq %r12, (%rsp)
subq %rbp, %r12
leaq (%r12,%r12), %rax
cmpq %r14, %rax
jb 0xd77b
movq 0x20(%rbx), %rax
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq *0x8(%rax)
movq %rax, %r13
testq %rax, %rax
js 0xd794
addq %r13, 0x28(%rbx)
addq %r13, %r15
subq %r13, %r12
jmp 0xd749
movq %rax, %r13
jmp 0xd79e
movq 0x8(%rbx), %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x43c0
addq %r12, 0x8(%rbx)
movq (%rsp), %r13
jmp 0xd79e
callq 0x4050
movl (%rax), %eax
movl %eax, 0x34(%rbx)
movq %r13, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/hfile.c
// Function: hclose
int hclose(hFILE *fp)
{
    int err = fp->has_errno;

    if (writebuffer_is_nonempty(fp) && hflush(fp) < 0) err = fp->has_errno;
    if (!fp->preserve) {
        if (fp->backend->close(fp) < 0) err = errno;
        hfile_destroy(fp);
    }

    if (err) {
        errno = err;
        return EOF;
    }
    else return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x34(%rdi), %ebp
movq 0x8(%rdi), %rax
cmpq 0x10(%rdi), %rax
jbe 0xd910
movq %rbx, %rdi
callq 0xd64f
testl %eax, %eax
jns 0xd910
movl 0x34(%rbx), %ebp
testb $0x8, 0x30(%rbx)
jne 0xd933
movq 0x20(%rbx), %rax
movq %rbx, %rdi
callq *0x20(%rax)
testl %eax, %eax
jns 0xd92b
callq 0x4050
movl (%rax), %ebp
movq %rbx, %rdi
callq 0xd1c4
testl %ebp, %ebp
je 0xd943
callq 0x4050
movl %ebp, (%rax)
pushq $-0x1
popq %rax
jmp 0xd945
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/hfile.c
// Function: hclose_abruptly
void hclose_abruptly(hFILE *fp)
{
    int save = errno;
    if (fp->preserve)
        return;
    if (fp->backend->close(fp) < 0) { /* Ignore subsequent errors */ }
    hfile_destroy(fp);
    errno = save;
}

// Assembly:
testb $0x8, 0x30(%rdi)
jne 0xd97c
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x4050
movq %rax, %r14
movl (%rax), %ebp
movq 0x20(%rbx), %rax
movq %rbx, %rdi
callq *0x20(%rax)
movq %rbx, %rdi
callq 0xd1c4
movl %ebp, (%r14)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/hfile.c
// Function: hdopen
hFILE *hdopen(int fd, const char *mode)
{
    hFILE_fd *fp = (hFILE_fd*) hfile_init(sizeof (hFILE_fd), mode, blksize(fd));
    if (fp == NULL) return NULL;

    fp->fd = fd;
    fp->is_socket = (strchr(mode, 's') != NULL);
    fp->is_shared = (strchr(mode, 'S') != NULL);
    fp->base.backend = &fd_backend;
    return &fp->base;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movl %edi, %ebp
callq 0xd9f5
pushq $0x40
popq %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0xd11c
movq %rax, %rbx
testq %rax, %rax
je 0xd9ed
movl %ebp, 0x38(%rbx)
pushq $0x73
popq %rsi
movq %r14, %rdi
callq 0x4190
testq %rax, %rax
setne %al
movb 0x3c(%rbx), %bpl
andb $-0x2, %bpl
orb %al, %bpl
movb %bpl, 0x3c(%rbx)
pushq $0x53
popq %rsi
movq %r14, %rdi
callq 0x4190
testq %rax, %rax
setne %al
addb %al, %al
andb $-0x3, %bpl
orb %al, %bpl
movb %bpl, 0x3c(%rbx)
leaq 0x8fe07(%rip), %rax     # 0x9d7f0
movq %rax, 0x20(%rbx)
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/hfile.c
// Function: hfile_oflags
HTSLIB_EXPORT
int hfile_oflags(const char *mode)
{
    int rdwr = 0, flags = 0;
    const char *s;
    for (s = mode; *s; s++)
        switch (*s) {
        case 'r': rdwr = O_RDONLY;  break;
        case 'w': rdwr = O_WRONLY; flags |= O_CREAT | O_TRUNC;  break;
        case 'a': rdwr = O_WRONLY; flags |= O_CREAT | O_APPEND;  break;
        case '+': rdwr = O_RDWR;  break;
#ifdef O_CLOEXEC
        case 'e': flags |= O_CLOEXEC;  break;
#endif
#ifdef O_EXCL
        case 'x': flags |= O_EXCL;  break;
#endif
        default:  break;
        }

#ifdef O_BINARY
    flags |= O_BINARY;
#endif

    return rdwr | flags;
}

// Assembly:
xorl %esi, %esi
pushq $0x2
popq %rcx
pushq $0x1
popq %rdx
xorl %eax, %eax
movzbl (%rdi), %r8d
cmpl $0x2b, %r8d
je 0xda6f
cmpl $0x61, %r8d
je 0xda7a
cmpl $0x72, %r8d
je 0xda64
cmpl $0x77, %r8d
je 0xda73
cmpl $0x78, %r8d
je 0xda68
testl %r8d, %r8d
jne 0xda81
jmp 0xda86
xorl %esi, %esi
jmp 0xda81
orl $0x80, %eax
jmp 0xda81
movl %ecx, %esi
jmp 0xda81
orl $0x240, %eax            # imm = 0x240
jmp 0xda7f
orl $0x440, %eax            # imm = 0x440
movl %edx, %esi
incq %rdi
jmp 0xda3b
orl %esi, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/hfile.c
// Function: hfile_mem_get_buffer
char *hfile_mem_get_buffer(hFILE *file, size_t *length) {
    if (file->backend != &mem_backend) {
        errno = EINVAL;
        return NULL;
    }

    if (length)
        *length = file->buffer - file->limit;

    return file->buffer;
}

// Assembly:
leaq 0x8fd88(%rip), %rax     # 0x9d818
cmpq %rax, 0x20(%rdi)
je 0xdaa9
pushq %rax
callq 0x4050
movl $0x16, (%rax)
xorl %eax, %eax
addq $0x8, %rsp
retq
movq (%rdi), %rax
testq %rsi, %rsi
je 0xdabb
movq %rax, %rcx
subq 0x18(%rdi), %rcx
movq %rcx, (%rsi)
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/hfile.c
// Function: hfile_mem_steal_buffer
char *hfile_mem_steal_buffer(hFILE *file, size_t *length) {
    char *buf = hfile_mem_get_buffer(file, length);
    if (buf)
        file->buffer = NULL;
    return buf;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0xda89
testq %rax, %rax
je 0xdace
andq $0x0, (%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/hfile.c
// Function: hopenv_mem
static hFILE *hopenv_mem(const char *filename, const char *mode, va_list args)
{
    char* buffer = va_arg(args, char*);
    size_t sz = va_arg(args, size_t);
    va_end(args);

    hFILE* hf;

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

    return hf;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl (%rdx), %ecx
cmpq $0x29, %rcx
jae 0xdb30
movq 0x10(%rdx), %rdi
movq %rcx, %rax
addq $0x8, %rax
movl %eax, (%rdx)
movq (%rdi,%rcx), %rbx
cmpl $0x20, %ecx
ja 0xdb3f
addq 0x10(%rdx), %rax
addl $0x10, %ecx
movl %ecx, (%rdx)
jmp 0xdb4b
movq 0x8(%rdx), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rdx)
movq (%rax), %rbx
movq 0x8(%rdx), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rdx)
movq (%rax), %rcx
movq %rbx, %rdi
movq %rcx, %rdx
callq 0xe947
movq %rax, %r14
testq %rax, %rax
jne 0xdb69
movq %rbx, %rdi
callq 0x45c0
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/hfile.c
// Function: crypt4gh_needed
static hFILE *crypt4gh_needed(const char *url, const char *mode)
{
    const char *u = strncmp(url, "crypt4gh:", 9) == 0 ? url + 9 : url;
#if defined(ENABLE_PLUGINS)
    const char *enable_plugins = "";
#else
    const char *enable_plugins = "You also need to rebuild HTSlib with plug-ins enabled.\n";
#endif

    hts_log_error("Accessing \"%s\" needs the crypt4gh plug-in.\n"
                  "It can be found at "
                  "https://github.com/samtools/htslib-crypt4gh\n"
                  "%s"
                  "If you have the plug-in, please ensure it can be "
                  "found on your HTS_PATH.",
                  u, enable_plugins);

    errno = EPROTONOSUPPORT;
    return NULL;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x696c7(%rip), %rsi     # 0x77504
pushq $0x9
popq %rdx
callq 0x4210
xorl %ecx, %ecx
testl %eax, %eax
sete %cl
leaq (%rcx,%rcx,8), %rcx
addq %rbx, %rcx
leaq 0x696ec(%rip), %rsi     # 0x77546
leaq 0x696f5(%rip), %rdx     # 0x77556
leaq 0x696a6(%rip), %r8      # 0x7750e
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x110c6
callq 0x4050
movl $0x5d, (%rax)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/hfile.c
// Function: hfile_shutdown
void hfile_shutdown(int do_close_plugin)
{
    pthread_mutex_lock(&plugins_lock);

    if (schemes) {
        kh_destroy(scheme_string, schemes);
        schemes = NULL;
    }

    while (plugins != NULL) {
        struct hFILE_plugin_list *p = plugins;
        if (p->plugin.destroy) p->plugin.destroy();
#ifdef ENABLE_PLUGINS
        if (p->plugin.obj && do_close_plugin) close_plugin(p->plugin.obj);
#endif
        plugins = p->next;
        free(p);
    }

    pthread_mutex_unlock(&plugins_lock);
}

// Assembly:
pushq %rbx
leaq 0x90944(%rip), %rdi     # 0x9e7d0
callq 0x4750
movq 0x90960(%rip), %rbx     # 0x9e7f8
testq %rbx, %rbx
je 0xdee8
movq 0x18(%rbx), %rdi
callq 0x45c0
movq 0x10(%rbx), %rdi
callq 0x45c0
movq 0x20(%rbx), %rdi
callq 0x45c0
movq %rbx, %rdi
callq 0x45c0
andq $0x0, 0x90930(%rip)     # 0x9e7f8
jmp 0xdee8
movq 0x18(%rbx), %rax
testq %rax, %rax
je 0xded5
callq *%rax
movq 0x20(%rbx), %rax
movq %rax, 0x90920(%rip)     # 0x9e800
movq %rbx, %rdi
callq 0x45c0
movq 0x90911(%rip), %rbx     # 0x9e800
testq %rbx, %rbx
jne 0xdeca
leaq 0x908d5(%rip), %rdi     # 0x9e7d0
popq %rbx
jmp 0x4340
// File: /workspace/github_c_makefile_star2_O2/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 0x908af(%rip), %rdi     # 0x9e7d0
callq 0x4750
cmpq $0x0, 0x908ca(%rip)     # 0x9e7f8
jne 0xdf3d
callq 0xdff2
testl %eax, %eax
js 0xdfd2
movq %rbx, 0x8(%rsp)
leaq 0x90887(%rip), %rdi     # 0x9e7d0
callq 0x4340
movq 0x908a3(%rip), %r12     # 0x9e7f8
movl (%r12), %r13d
xorl %r14d, %r14d
xorl %ebx, %ebx
xorl %ebp, %ebp
cmpq %rbx, %r13
je 0xdfc5
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 0xdfbc
testq %r15, %r15
je 0xdf9c
movq 0x20(%r12), %rax
movq (%rax,%rbx,8), %rax
movq 0x10(%rax), %rdi
movq %r15, %rsi
callq 0x46c0
testl %eax, %eax
jne 0xdfbc
movq 0x8(%rsp), %rax
cmpl (%rax), %ebp
jge 0xdfba
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
jmp 0xdf60
movq 0x8(%rsp), %rax
cmpl %ebp, (%rax)
jle 0xdfe1
movl %ebp, (%rax)
jmp 0xdfe1
leaq 0x907f7(%rip), %rdi     # 0x9e7d0
callq 0x4340
pushq $-0x1
popq %rbp
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_O2/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 0x9072a(%rip), %rdi     # 0x9e7d0
callq 0x4750
cmpq $0x0, 0x90745(%rip)     # 0x9e7f8
jne 0xe0be
callq 0xdff2
testl %eax, %eax
js 0xe110
leaq 0x9070b(%rip), %rdi     # 0x9e7d0
callq 0x4340
movslq (%rbx), %rcx
testq %rcx, %rcx
je 0xe0e1
leaq 0x69402(%rip), %rax     # 0x774db
movq %rax, (%r14)
pushq $0x1
popq %rax
jmp 0xe0e3
xorl %eax, %eax
leaq 0x90716(%rip), %rdx     # 0x9e800
movq (%rdx), %rdx
testq %rdx, %rdx
je 0xe108
cmpq %rcx, %rax
jge 0xe0ff
movq 0x10(%rdx), %rsi
movq %rsi, (%r14,%rax,8)
addq $0x20, %rdx
incq %rax
jmp 0xe0ea
cmpl %eax, %ecx
jle 0xe11f
movl %eax, (%rbx)
jmp 0xe11f
leaq 0x906b9(%rip), %rdi     # 0x9e7d0
callq 0x4340
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x9069b(%rip), %rdi     # 0x9e7d0
callq 0x4750
cmpq $0x0, 0x906b6(%rip)     # 0x9e7f8
jne 0xe14d
callq 0xdff2
testl %eax, %eax
js 0xe185
leaq 0x9067c(%rip), %rdi     # 0x9e7d0
callq 0x4340
leaq 0x906a0(%rip), %r14     # 0x9e800
pushq $0x1
popq %rbp
movq (%r14), %r14
testq %r14, %r14
je 0xe181
movq 0x10(%r14), %rdi
movq %rbx, %rsi
callq 0x46c0
addq $0x20, %r14
testl %eax, %eax
jne 0xe163
jmp 0xe194
xorl %ebp, %ebp
jmp 0xe194
leaq 0x90644(%rip), %rdi     # 0x9e7d0
callq 0x4340
pushq $-0x1
popq %rbp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xe1f7
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 0xe2e1
testq %rax, %rax
je 0xe271
movq %rax, %r15
pushq $0x3a
popq %rsi
movq %rbx, %rdi
callq 0x4190
testq %rax, %rax
je 0xe259
cmpl $0x7d0, 0x18(%r15)      # imm = 0x7D0
jl 0xe259
cmpq $0x0, 0x20(%r15)
je 0xe259
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 0xe2d3
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 0xe27e
cmpb $0x0, 0x1(%r14)
je 0xe296
movq %r14, %rdi
movq %rbx, %rsi
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xe472
pushq $0x72
popq %rsi
movq %rbx, %rdi
callq 0x4190
xorl %ebp, %ebp
testq %rax, %rax
sete %bpl
leaq 0x693fd(%rip), %rdx     # 0x776ae
leaq 0xb0(%rsp), %r14
pushq $0x65
popq %rsi
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x4800
movl %ebp, %edi
movq %r14, %rsi
callq 0xd97d
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/hfile.c
// Function: find_scheme_handler
static const struct hFILE_scheme_handler *find_scheme_handler(const char *s)
{
    static const struct hFILE_scheme_handler unknown_scheme =
        { hopen_unknown_scheme, hfile_always_local, "built-in", 0 };

    char scheme[12];
    int i;

    for (i = 0; i < sizeof scheme; i++)
        if (isalnum_c(s[i]) || s[i] == '+' || s[i] == '-' || s[i] == '.')
            scheme[i] = tolower_c(s[i]);
        else if (s[i] == ':') break;
        else return NULL;

    // 1 byte schemes are likely windows C:/foo pathnames
    if (i <= 1 || i >= sizeof scheme) return NULL;
    scheme[i] = '\0';

    pthread_mutex_lock(&plugins_lock);
    if (!schemes && load_hfile_plugins() < 0) {
        pthread_mutex_unlock(&plugins_lock);
        return NULL;
    }
    pthread_mutex_unlock(&plugins_lock);

    khint_t k = kh_get(scheme_string, schemes, scheme);
    return (k != kh_end(schemes))? kh_value(schemes, k) : &unknown_scheme;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %r14
xorl %ebx, %ebx
xorl %r15d, %r15d
cmpq $0xc, %r15
je 0xe44f
movzbl (%r14,%r15), %r12d
callq 0x4510
movq (%rax), %rax
testb $0x8, (%rax,%r12,2)
jne 0xe325
leal -0x2d(%r12), %eax
cmpl $0x2, %eax
jb 0xe325
cmpl $0x2b, %r12d
jne 0xe338
movsbl %r12b, %edi
callq 0xef47
movb %al, 0x14(%rsp,%r15)
incq %r15
jmp 0xe2f7
cmpl $0x3a, %r12d
jne 0xe44f
cmpq $0x2, %r15
jae 0xe34f
xorl %ebx, %ebx
jmp 0xe44f
movb $0x0, 0x14(%rsp,%r15)
leaq 0x90474(%rip), %rdi     # 0x9e7d0
callq 0x4750
cmpq $0x0, 0x9048f(%rip)     # 0x9e7f8
jne 0xe378
callq 0xdff2
testl %eax, %eax
js 0xe461
leaq 0x90451(%rip), %rdi     # 0x9e7d0
callq 0x4340
movq 0x9046d(%rip), %rbx     # 0x9e7f8
movl (%rbx), %eax
testl %eax, %eax
je 0xe433
movq %rax, 0x20(%rsp)
leal -0x1(%rax), %r14d
leaq 0x14(%rsp), %rdi
callq 0xebf5
movl %eax, %esi
movl %r14d, 0x4(%rsp)
andl %r14d, %esi
movq %rbx, 0x8(%rsp)
movq 0x10(%rbx), %rbp
pushq $0x1
popq %r13
movl %esi, %r14d
movl %r14d, %eax
shrl $0x4, %eax
movl (%rbp,%rax,4), %r12d
leal (%r14,%r14), %r15d
andl $0x1e, %r15d
movl %r12d, %eax
movl %r15d, %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0xe419
testb $0x1, %al
jne 0xe407
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rax
movl %r14d, %ecx
movq (%rax,%rcx,8), %rdi
movl %esi, %ebx
leaq 0x14(%rsp), %rsi
callq 0x46c0
movl %ebx, %esi
testl %eax, %eax
je 0xe419
addl %r13d, %r14d
andl 0x4(%rsp), %r14d
incl %r13d
cmpl %esi, %r14d
jne 0xe3c2
jmp 0xe43b
movl %r15d, %ecx
shrl %cl, %r12d
testb $0x3, %r12b
movq 0x20(%rsp), %rax
cmovnel %eax, %r14d
movq 0x8(%rsp), %rbx
jmp 0xe436
xorl %r14d, %r14d
cmpl %eax, %r14d
jne 0xe444
leaq 0x8f4c6(%rip), %rbx     # 0x9d908
jmp 0xe44f
movq 0x20(%rbx), %rax
movl %r14d, %ecx
movq (%rax,%rcx,8), %rbx
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x90368(%rip), %rdi     # 0x9e7d0
callq 0x4340
jmp 0xe348
// File: /workspace/github_c_makefile_star2_O2/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 %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0xda31
movq %rbx, %rdi
movl %eax, %esi
movl $0x1b6, %edx            # imm = 0x1B6
xorl %eax, %eax
callq 0x4330
testl %eax, %eax
js 0xe4e0
movl %eax, %ebx
movl %eax, %edi
callq 0xd9f5
pushq $0x40
popq %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0xd11c
testq %rax, %rax
je 0xe4cc
movq %rax, %r14
movl %ebx, 0x38(%rax)
andb $-0x4, 0x3c(%rax)
leaq 0x8f32a(%rip), %rax     # 0x9d7f0
movq %rax, 0x20(%r14)
jmp 0xe4ea
callq 0x4050
movq %rax, %r14
movl (%rax), %ebp
movl %ebx, %edi
callq 0x49c0
movl %ebp, (%r14)
xorl %r14d, %r14d
xorl %edi, %edi
callq 0xd1c4
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/hfile.c
// Function: haddextension
char *haddextension(struct kstring_t *buffer, const char *filename,
                    int replace, const char *new_extension)
{
    const char *trailing, *end;

    if (find_scheme_handler(filename)) {
        // URL, so alter extensions before any trailing query or fragment parts
        // Allow # symbols in s3 URLs
        trailing = filename + ((strncmp(filename, "s3://", 5) && strncmp(filename, "s3+http://", 10) && strncmp(filename, "s3+https://", 11))  ? strcspn(filename, "?#") : strcspn(filename, "?"));
    }
    else {
        // Local path, so alter extensions at the end of the filename
        trailing = strchr(filename, '\0');
    }

    end = replace? strip_extension(filename, trailing) : trailing;

    buffer->l = 0;
    if (kputsn(filename, end - filename, buffer) >= 0 &&
        kputs(new_extension, buffer) >= 0 &&
        kputs(trailing, buffer) >= 0) return buffer->s;
    else return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %r14
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %rbx
movq %rsi, %rdi
callq 0xe2e1
testq %rax, %rax
je 0xe587
leaq 0x68fb2(%rip), %rsi     # 0x774e4
pushq $0x5
popq %rdx
movq %r15, %rdi
callq 0x4210
testl %eax, %eax
je 0xe576
leaq 0x68fa2(%rip), %rsi     # 0x774ea
pushq $0xa
popq %rdx
movq %r15, %rdi
callq 0x4210
testl %eax, %eax
je 0xe576
leaq 0x68f97(%rip), %rsi     # 0x774f5
pushq $0xb
popq %rdx
movq %r15, %rdi
callq 0x4210
testl %eax, %eax
je 0xe576
leaq 0x68f8d(%rip), %rsi     # 0x77501
jmp 0xe57d
leaq 0x6b9dd(%rip), %rsi     # 0x79f5a
movq %r15, %rdi
callq 0x4090
jmp 0xe58f
movq %r15, %rdi
callq 0x41d0
movq %rax, %r12
addq %r15, %r12
movq %r12, %rsi
testl %ebp, %ebp
je 0xe5ba
movq %r12, %rsi
cmpq %r15, %rsi
jbe 0xe5b7
movzbl -0x1(%rsi), %eax
cmpl $0x2f, %eax
je 0xe5b7
decq %rsi
cmpl $0x2e, %eax
jne 0xe59f
jmp 0xe5ba
movq %r12, %rsi
andq $0x0, (%rbx)
subq %r15, %rsi
movq %r15, %rdi
movq %rbx, %rdx
callq 0xe5ff
testl %eax, %eax
js 0xe5f4
movq %r14, %rdi
movq %rbx, %rsi
callq 0xe69f
testl %eax, %eax
js 0xe5f4
movq %r12, %rdi
movq %rbx, %rsi
callq 0xe69f
testl %eax, %eax
js 0xe5f4
movq 0x10(%rbx), %rax
jmp 0xe5f6
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x1
popq %rdi
movl $0x88, %esi
callq 0x4300
testq %rax, %rax
je 0xe731
movq %rax, %rbx
movq %r15, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0xe19b
movq %rax, 0x80(%rbx)
testq %rax, %rax
je 0xe729
leaq 0x8f0d2(%rip), %rcx     # 0x9d7f0
cmpq %rcx, 0x20(%rax)
je 0xe735
pushq $-0x1
popq %rax
jmp 0xe738
movq %rbx, %rdi
callq 0x45c0
xorl %ebx, %ebx
jmp 0xe73b
movl 0x38(%rax), %eax
movl %eax, 0x4(%rbx)
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x1
popq %rdi
movl $0x88, %esi
callq 0x4300
testq %rax, %rax
je 0xe785
movq %rax, %rbx
movl %ebp, %edi
movq %r14, %rsi
callq 0xd97d
movq %rax, 0x80(%rbx)
testq %rax, %rax
je 0xe77d
movl %ebp, 0x4(%rbx)
jmp 0xe787
movq %rbx, %rdi
callq 0x45c0
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xd7cb
testq %rax, %rax
js 0xe830
movq %rax, 0x8(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xe880
callq 0x4710
jmp 0xe887
xorl %ecx, %ecx
callq 0x4140
movq %rax, %r12
testq %rax, %rax
jns 0xe899
callq 0x4050
cmpl $0x4, (%rax)
je 0xe868
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xe8d1
callq 0x4180
jmp 0xe8d8
xorl %ecx, %ecx
callq 0x4230
movq %rax, %r12
testq %rax, %rax
jns 0xe8ea
callq 0x4050
cmpl $0x4, (%rax)
je 0xe8b9
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r12
pushq $0x2c
popq %rsi
callq 0x4190
testq %rax, %rax
je 0xec78
movq %rax, %r15
pushq $0x72
popq %rsi
movq %rbx, %rdi
callq 0x4190
testq %rax, %rax
je 0xecb8
leaq 0x1(%r15), %r14
movq %r15, %rax
subq %r12, %rax
cmpq $0x7, %rax
jl 0xec88
xorl %r12d, %r12d
leaq 0x689bf(%rip), %r13     # 0x7761b
cmpq $0x7, %r12
je 0xecc5
movsbl -0x7(%r15,%r12), %edi
callq 0xef47
cmpb (%r12,%r13), %al
jne 0xec88
incq %r12
jmp 0xec5c
callq 0x4050
movl $0x16, (%rax)
jmp 0xed18
movq %r14, %rdi
callq 0x41d0
movq %rax, %r15
incq %r15
movq %r15, %rdi
callq 0x4680
testq %rax, %rax
je 0xed18
movq %rax, %r12
leaq 0x8(%rsp), %rsi
movq %rax, %rdi
movq %r14, %rdx
callq 0x2af80
jmp 0xecf8
callq 0x4050
movl $0x1e, (%rax)
jmp 0xed18
movq %r14, %rdi
callq 0x41d0
movq %rax, %rdi
callq 0x2b026
movq %rax, %r15
movq %rax, %rdi
callq 0x4680
testq %rax, %rax
je 0xed18
movq %rax, %r12
leaq 0x8(%rsp), %rsi
movq %rax, %rdi
movq %r14, %rdx
callq 0x2b033
movq 0x8(%rsp), %rdx
movq %r12, %rdi
movq %rbx, %rsi
movq %r15, %rcx
callq 0xe947
testq %rax, %rax
jne 0xed1a
movq %r12, %rdi
callq 0x45c0
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x688ea(%rip), %rsi     # 0x77623
pushq $0x11
popq %rdx
callq 0x4210
testl %eax, %eax
je 0xed70
leaq 0x688e9(%rip), %rsi     # 0x77635
pushq $0x8
popq %rdx
movq %r14, %rdi
callq 0x4210
testl %eax, %eax
je 0xed74
callq 0x4050
movl $0x5d, (%rax)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
pushq $0x10
jmp 0xed76
pushq $0x7
popq %rax
addq %rax, %r14
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xe472
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x28
popq %rdi
callq 0x4680
testq %rax, %rax
je 0xeee8
movq %rax, %r14
movl $0x1, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
andq $0x0, 0x18(%rax)
movq %rax, %rdi
callq *%r15
leaq 0x6877e(%rip), %rsi     # 0x7763e
testl %eax, %eax
je 0xef08
leaq 0x687ad(%rip), %rdx     # 0x77678
pushq $0x5
popq %rdi
movq %rbx, %rcx
movl %eax, %r8d
xorl %eax, %eax
callq 0x110c6
movq %r14, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x45c0
leaq 0x6874f(%rip), %rsi     # 0x7763e
leaq 0x68758(%rip), %rdx     # 0x7764e
pushq $0x5
popq %rdi
movq %rbx, %rcx
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0x110c6
leaq 0x68793(%rip), %rdx     # 0x776a2
pushq $0x5
popq %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x110c6
movq 0x8f8dd(%rip), %rax     # 0x9e800
movq %rax, 0x20(%r14)
movq %r14, 0x8f8d2(%rip)     # 0x9e800
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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
xorl %ebx, %ebx
leal -0x1(%rdx), %eax
cmpl $0x2, %eax
jb 0xf740
cmpl $0x40000000, %edx       # imm = 0x40000000
je 0xf739
cmpl $0x800, %edx            # imm = 0x800
je 0xf740
cmpl $0x1000, %edx           # imm = 0x1000
je 0xf740
cmpl $0x100000, %edx         # imm = 0x100000
je 0xf740
cmpl $0x200000, %edx         # imm = 0x200000
je 0xf70f
cmpl $0x400000, %edx         # imm = 0x400000
je 0xf70f
cmpl $0x800000, %edx         # imm = 0x800000
je 0xf718
cmpl $0x8000000, %edx        # imm = 0x8000000
je 0xf727
cmpl $0x10000000, %edx       # imm = 0x10000000
je 0xf730
cmpl $0x20000000, %edx       # imm = 0x20000000
je 0xf71e
cmpl $0x400, %edx            # imm = 0x400
jne 0xf745
leaq 0x68581(%rip), %rbx     # 0x77c97
jmp 0xf740
popq %rbx
jmp 0x4e59c
leaq 0x68631(%rip), %rbx     # 0x77d56
jmp 0xf740
leaq 0x6856d(%rip), %rbx     # 0x77c9b
jmp 0xf740
leaq 0x68568(%rip), %rbx     # 0x77c9f
jmp 0xf740
leaq 0x68566(%rip), %rbx     # 0x77ca6
movq %rbx, %rax
popq %rbx
retq
movq 0x8e88c(%rip), %rax     # 0x9dfd8
movq (%rax), %rdi
leaq 0x68564(%rip), %rsi     # 0x77cba
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x4700
jmp 0xf740
// File: /workspace/github_c_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
orl $-0x1, 0x8(%rdi)
xorl %r12d, %r12d
cmpq %r14, %r15
jae 0x1032b
movsbl (%r15), %ebp
movl %ebp, %edi
callq 0x15ee4
testl %eax, %eax
je 0x102ea
imull $0xa, %r12d, %eax
movswl %bp, %ecx
leal (%rax,%rcx), %r12d
addl $-0x30, %r12d
incq %r15
jmp 0x102c2
movw %r12w, 0x8(%rbx)
cmpb $0x2e, (%r15)
jne 0x10323
incq %r15
xorl %r12d, %r12d
cmpq %r14, %r15
jae 0x1032b
movsbl (%r15), %ebp
movl %ebp, %edi
callq 0x15ee4
testl %eax, %eax
je 0x10326
imull $0xa, %r12d, %eax
movswl %bp, %ecx
leal (%rax,%rcx), %r12d
addl $-0x30, %r12d
incq %r15
jmp 0x102fb
xorl %r12d, %r12d
movw %r12w, 0xa(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0xa
popq %rsi
callq 0x4550
movq %rax, %r14
testq %rax, %rax
sete %bpl
movq %rax, %rsi
cmoveq %rbx, %rsi
movq %r15, %rdi
callq 0x103f8
testl %eax, %eax
setne %al
sete %cl
orb %bpl, %cl
jne 0x103c4
incq %r14
leaq 0x67590(%rip), %r15     # 0x77910
cmpq %rbx, %r14
jae 0x103ac
movzbl (%r14), %r12d
cmpb $0xf, (%r12,%r15)
jne 0x1039f
callq 0x40a0
movq (%rax), %rax
cmpl $0x4e, (%rax,%r12,4)
jne 0x103ac
incq %r14
cmpl $0x3d, %r12d
jne 0x10380
xorl %eax, %eax
jmp 0x103c4
cmpq %rbx, %r14
je 0x103c2
movb (%r14), %al
cmpb $0xd, %al
sete %cl
cmpb $0xa, %al
sete %al
orb %cl, %al
jmp 0x103c4
movb $0x1, %al
movzbl %al, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/hts.c
// Function: colmatch
static int colmatch(const char *columns, const char *pattern)
{
    int i;
    for (i = 0; columns[i] != '\0'; i++) {
        if (pattern[i] == '+') return i;
        if (! (columns[i] == pattern[i] || pattern[i] == 'Z')) return 0;
    }

    return i;
}

// Assembly:
xorl %eax, %eax
movb (%rdi,%rax), %cl
testb %cl, %cl
je 0x103f7
movb (%rsi,%rax), %dl
cmpb $0x2b, %dl
je 0x103f7
cmpb %dl, %cl
setne %cl
cmpb $0x5a, %dl
setne %dl
testb %dl, %cl
jne 0x103f5
incq %rax
jmp 0x103d2
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
xorl %ebx, %ebx
pushq $-0x1
popq %r12
testq %r14, %r14
je 0x110bb
movl 0x8(%r14), %ebp
cmpl $0x1, %ebp
je 0x1108c
cmpl $0x6, %ebp
je 0x1108c
cmpl $0x3eb, %ebp            # imm = 0x3EB
je 0x1108c
cmpl $0x69, %ebp
je 0x1108c
cmpl $0x3e9, %ebp            # imm = 0x3E9
je 0x1108c
cmpl $0x9, %ebp
jne 0x110a6
movq 0x10(%r14), %rdi
callq 0x4930
movq %rax, 0x30(%r15)
testq %rax, %rax
je 0x110b8
movq 0x10(%r14), %rdx
movq %r15, %rdi
movl %ebp, %esi
xorl %eax, %eax
callq 0x11b3f
testl %eax, %eax
jne 0x110b8
movq 0x18(%r14), %r14
jmp 0x1104d
movl 0x10(%r14), %edx
movq %r15, %rdi
movl %ebp, %esi
xorl %eax, %eax
callq 0x11b3f
jmp 0x1109c
movl %r12d, %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x11129
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, 0x8d646(%rip)     # 0x9e780
jae 0x11151
movl %r12d, (%rbx)
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8ce80(%rip), %r13     # 0x9dfd8
movq (%r13), %rdi
decl %ebp
cmpl $0x5, %ebp
ja 0x11171
movl %ebp, %eax
leaq 0x66ab4(%rip), %rcx     # 0x77c20
movl (%rcx,%rax,4), %edx
jmp 0x11174
pushq $0x2a
popq %rdx
leaq 0x67892(%rip), %rsi     # 0x78a0d
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
pushq $0xa
popq %rdi
callq 0x4630
jmp 0x1113c