LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/bgzf.c
// Function: bgzf_seek
int64_t bgzf_seek(BGZF* fp, int64_t pos, int where)
{
    if (fp->is_write || where != SEEK_SET || fp->is_gzip) {
        fp->errcode |= BGZF_ERR_MISUSE;
        return -1;
    }

    // This is a flag to indicate we've jumped elsewhere in the stream, to act
    // as a hint to any other code which is wrapping up bgzf for its own
    // purposes.  We may not be able to tell when seek happens as it can be
    // done on our behalf, eg by the iterator.
    //
    // This is never cleared here.  Any tool that needs to handle it is also
    // responsible for clearing it.
    fp->seeked = pos;

    return bgzf_seek_common(fp, pos >> 16, pos & 0xFFFF);
}

// Assembly:
movl (%rdi), %eax
testl %eax, %eax
js 0xd9ce
movl %eax, %ecx
andl $0x20000, %ecx          # imm = 0x20000
orl %edx, %ecx
jne 0xd9ce
movq %rsi, 0x68(%rdi)
movq %rsi, %rax
sarq $0x10, %rax
movzwl %si, %edx
movq %rax, %rsi
jmp 0xd9db
orl $0x8, %eax
movl %eax, (%rdi)
movq $-0x1, %rax
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/bgzf.c
// Function: bgzf_is_bgzf
int bgzf_is_bgzf(const char *fn)
{
    uint8_t buf[16];
    int n;
    hFILE *fp;
    if ((fp = hopen(fn, "r")) == 0) return 0;
    n = hread(fp, buf, 16);
    if (hclose(fp) < 0) return 0;
    if (n != 16) return 0;
    return check_header(buf) == 0? 1 : 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0x8dab6(%rip), %rsi     # 0x9b5c4
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x10014
testq %rax, %rax
je 0xdb8d
movq %rax, %r14
movq 0x8(%rax), %rsi
movq 0x10(%rax), %r12
subq %rsi, %r12
cmpq $0x10, %r12
movl $0x10, %r15d
cmovbq %r12, %r15
movq %rsp, %rdi
movq %r15, %rdx
callq 0x43c0
addq %r15, 0x8(%r14)
cmpq $0xf, %r12
ja 0xdb6a
testb $0x2, 0x30(%r14)
je 0xdb6a
movq %rsp, %rsi
movl $0x10, %edx
movq %r14, %rdi
movq %r15, %rcx
callq 0xf2cd
movq %rax, %r15
movq %r14, %rdi
callq 0xf6d0
testl %eax, %eax
js 0xdb8d
movl %r15d, %eax
cmpl $0x10, %eax
jne 0xdb8d
movq %rsp, %rdi
callq 0xbc0e
xorl %ebx, %ebx
testl %eax, %eax
sete %bl
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/bgzf.c
// Function: bgzf_getc
int bgzf_getc(BGZF *fp)
{
    if (fp->block_offset+1 < fp->block_length) {
        fp->uncompressed_address++;
        return ((unsigned char*)fp->uncompressed_block)[fp->block_offset++];
    }

    int c;
    if (fp->block_offset >= fp->block_length) {
        if (bgzf_read_block(fp) != 0) return -2; /* error */
        if (fp->block_length == 0) return -1; /* end-of-file */
    }
    c = ((unsigned char*)fp->uncompressed_block)[fp->block_offset++];
    if (fp->block_offset == fp->block_length) {
        fp->block_address = bgzf_htell(fp);
        fp->block_offset = 0;
        fp->block_length = 0;
    }
    fp->uncompressed_address++;
    return c;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movslq 0x10(%rdi), %rax
leal 0x1(%rax), %ecx
movl 0x8(%rdi), %edx
cmpl %edx, %ecx
jge 0xdbd1
incq 0x20(%rbx)
movq 0x28(%rbx), %rdx
movl %ecx, 0x10(%rbx)
movzbl (%rdx,%rax), %ebp
jmp 0xdc17
cmpl %edx, %eax
jge 0xdc06
movq 0x28(%rbx), %rax
movslq 0x10(%rbx), %rcx
leal 0x1(%rcx), %edx
movl %edx, 0x10(%rbx)
movzbl (%rax,%rcx), %ebp
cmpl 0x8(%rbx), %edx
jne 0xdc00
movq %rbx, %rdi
callq 0xb812
movq %rax, 0x18(%rbx)
xorl %eax, %eax
movl %eax, 0x10(%rbx)
movl %eax, 0x8(%rbx)
incq 0x20(%rbx)
jmp 0xdc17
movq %rbx, %rdi
callq 0xae60
movl $0xfffffffe, %ebp       # imm = 0xFFFFFFFE
testl %eax, %eax
je 0xdc20
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
cmpl $0x0, 0x8(%rbx)
jne 0xdbd5
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0xdc17
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/bgzf.c
// Function: bgzf_index_build_init
int bgzf_index_build_init(BGZF *fp)
{
    bgzf_index_destroy(fp);
    fp->idx = (bgzidx_t*) calloc(1,sizeof(bgzidx_t));
    if ( !fp->idx ) return -1;
    fp->idx_build_otf = 1;  // build index on the fly
    return 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0xd752
movl $0x1, %edi
movl $0x18, %esi
callq 0x4300
movq %rax, 0x50(%rbx)
testq %rax, %rax
je 0xde44
movl $0x1, 0x58(%rbx)
xorl %eax, %eax
jmp 0xde49
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/bgzf.c
// Function: bgzf_index_dump
int bgzf_index_dump(BGZF *fp, const char *bname, const char *suffix)
{
    const char *name = bname, *msg = NULL;
    char *tmp = NULL;
    hFILE *idx = NULL;

    if (!fp->idx) {
        hts_log_error("Called for BGZF handle with no index");
        errno = EINVAL;
        return -1;
    }

    if ( suffix )
    {
        tmp = get_name_suffix(bname, suffix);
        if ( !tmp ) return -1;
        name = tmp;
    }

    idx = hopen(name, "wb");
    if ( !idx ) {
        msg = "Error opening";
        goto fail;
    }

    if (bgzf_index_dump_hfile(fp, idx, name) != 0) goto fail;

    if (hclose(idx) < 0)
    {
        idx = NULL;
        msg = "Error on closing";
        goto fail;
    }

    free(tmp);
    return 0;

 fail:
    if (msg != NULL) {
        hts_log_error("%s %s : %s", msg, name, strerror(errno));
    }
    if (idx) hclose_abruptly(idx);
    free(tmp);
    return -1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
cmpq $0x0, 0x50(%rdi)
je 0xe192
movq %rsi, %r14
movq %rdi, %r13
testq %rdx, %rdx
je 0xe1bc
movq %r14, %rdi
movq %rdx, %rsi
callq 0xe27f
movq %rax, %r14
movq %rax, %rbx
testq %rax, %rax
jne 0xe1be
jmp 0xe247
leaq 0x89c81(%rip), %rsi     # 0x97e1a
leaq 0x89c3c(%rip), %rdx     # 0x97ddc
movl $0x1, %edi
xorl %eax, %eax
callq 0x14378
callq 0x4050
movl $0x16, (%rax)
jmp 0xe247
xorl %ebx, %ebx
leaq 0x89c65(%rip), %rsi     # 0x97e2a
xorl %r12d, %r12d
movq %r14, %rdi
xorl %eax, %eax
callq 0x10014
testq %rax, %rax
je 0xe1f4
movq %rax, %r15
movq %r13, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0xde4b
testl %eax, %eax
je 0xe25a
movb $0x1, %r12b
xorl %r13d, %r13d
jmp 0xe1fe
leaq 0x89c32(%rip), %r13     # 0x97e2d
xorl %r15d, %r15d
testb %r12b, %r12b
jne 0xe232
callq 0x4050
movl (%rax), %edi
callq 0x4150
leaq 0x89c04(%rip), %rsi     # 0x97e1a
leaq 0x89c2f(%rip), %rdx     # 0x97e4c
movl $0x1, %edi
movq %r13, %rcx
movq %r14, %r8
movq %rax, %r9
xorl %eax, %eax
callq 0x14378
testq %r15, %r15
je 0xe23f
movq %r15, %rdi
callq 0xf730
movq %rbx, %rdi
callq 0x45c0
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
movl %r12d, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %r15, %rdi
callq 0xf6d0
xorl %r12d, %r12d
testl %eax, %eax
js 0xe273
movq %rbx, %rdi
callq 0x45c0
jmp 0xe24d
leaq 0x89bc1(%rip), %r13     # 0x97e3b
jmp 0xe1fb
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/bgzf.c
// Function: get_name_suffix
static char * get_name_suffix(const char *bname, const char *suffix)
{
    size_t len = strlen(bname) + strlen(suffix) + 1;
    char *buff = malloc(len);
    if (!buff) return NULL;
    snprintf(buff, len, "%s%s", bname, suffix);
    return buff;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x41d0
movq %rax, %r15
movq %rbx, %rdi
callq 0x41d0
leaq (%r15,%rax), %r12
incq %r12
movq %r12, %rdi
callq 0x4680
testq %rax, %rax
je 0xe2d0
movq %rax, %r15
leaq 0x8abb5(%rip), %rdx     # 0x98e70
movq %rax, %rdi
movq %r12, %rsi
movq %r14, %rcx
movq %rbx, %r8
xorl %eax, %eax
callq 0x4800
jmp 0xe2d3
xorl %r15d, %r15d
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/bgzf.c
// Function: bgzf_index_load
int bgzf_index_load(BGZF *fp, const char *bname, const char *suffix)
{
    const char *name = bname, *msg = NULL;
    char *tmp = NULL;
    hFILE *idx = NULL;
    if ( suffix )
    {
        tmp = get_name_suffix(bname, suffix);
        if ( !tmp ) return -1;
        name = tmp;
    }

    idx = hopen(name, "rb");
    if ( !idx ) {
        msg = "Error opening";
        goto fail;
    }

    if (bgzf_index_load_hfile(fp, idx, name) != 0) goto fail;

    if (hclose(idx) != 0) {
        idx = NULL;
        msg = "Error closing";
        goto fail;
    }

    free(tmp);
    return 0;

 fail:
    if (msg != NULL) {
        hts_log_error("%s %s : %s", msg, name, strerror(errno));
    }
    if (idx) hclose_abruptly(idx);
    free(tmp);
    return -1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %r13
testq %rdx, %rdx
je 0xe551
movq %r14, %rdi
movq %rdx, %rsi
callq 0xe27f
movq %rax, %r14
movq %rax, %rbx
testq %rax, %rax
jne 0xe553
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
jmp 0xe5fa
xorl %ebx, %ebx
leaq 0x89929(%rip), %rsi     # 0x97e83
xorl %r15d, %r15d
movq %r14, %rdi
xorl %eax, %eax
callq 0x10014
testq %rax, %rax
je 0xe58c
movq %rax, %r12
movq %r13, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0xe2e2
xorl %r15d, %r15d
testl %eax, %eax
je 0xe595
movb $0x1, %r15b
xorl %r13d, %r13d
jmp 0xe5ab
leaq 0x8989a(%rip), %r13     # 0x97e2d
jmp 0xe5a8
movq %r12, %rdi
callq 0xf6d0
testl %eax, %eax
je 0xe5f2
leaq 0x898de(%rip), %r13     # 0x97e86
xorl %r12d, %r12d
testb %r15b, %r15b
jne 0xe5df
callq 0x4050
movl (%rax), %edi
callq 0x4150
leaq 0x898d1(%rip), %rsi     # 0x97e94
leaq 0x89882(%rip), %rdx     # 0x97e4c
movl $0x1, %edi
movq %r13, %rcx
movq %r14, %r8
movq %rax, %r9
xorl %eax, %eax
callq 0x14378
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
testq %r12, %r12
je 0xe5f2
movq %r12, %rdi
callq 0xf730
movq %rbx, %rdi
callq 0x45c0
movl %r15d, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/bgzf.c
// Function: bgzf_decode_func
static void *bgzf_decode_func(void *arg) {
    bgzf_job *j = (bgzf_job *)arg;

    j->uncomp_len = BGZF_MAX_BLOCK_SIZE;
    uint32_t crc = le_to_u32((uint8_t *)j->comp_data + j->comp_len-8);
    int ret = bgzf_uncompress(j->uncomp_data, &j->uncomp_len,
                              j->comp_data+18, j->comp_len-18, crc);
    if (ret != 0)
        j->errcode |= BGZF_ERR_ZLIB;

    return arg;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x20010(%rdi), %rsi
movq $0x10000, 0x20010(%rdi) # imm = 0x10000
movq 0x10008(%rdi), %rcx
movl (%rdi,%rcx), %r8d
addq $0x10010, %rdi          # imm = 0x10010
leaq 0x1a(%rbx), %rdx
addq $-0x12, %rcx
callq 0xe7a8
testl %eax, %eax
je 0xec9d
orb $0x1, 0x20018(%rbx)
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/bgzf.c
// Function: job_cleanup
static void job_cleanup(void *arg) {
    bgzf_job *j = (bgzf_job *)arg;
    mtaux_t *mt = j->fp->mt;
    pthread_mutex_lock(&mt->job_pool_m);
    pool_free(mt->job_pool, j);
    pthread_mutex_unlock(&mt->job_pool_m);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rax
movq 0x48(%rax), %r15
leaq 0x30(%r15), %r14
movq %r14, %rdi
callq 0x4750
movq (%r15), %rdi
movq %rbx, %rsi
callq 0x5a8fd
movq %r14, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x4340
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/bgzf.c
// Function: bgzf_mt_seek
static void bgzf_mt_seek(BGZF *fp) {
    mtaux_t *mt = fp->mt;

    hts_tpool_process_reset(mt->out_queue, 0);
    pthread_mutex_lock(&mt->job_pool_m);
    mt->errcode = 0;

    if (hseek(fp->fp, mt->block_address, SEEK_SET) < 0)
        mt->errcode = errno;

    pthread_mutex_unlock(&mt->job_pool_m);
    mt->command = SEEK_DONE;
    pthread_cond_signal(&mt->command_c);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r15
movq 0x48(%rdi), %rbx
movq 0x20(%rbx), %rdi
xorl %esi, %esi
callq 0x376d4
leaq 0x30(%rbx), %r14
movq %r14, %rdi
callq 0x4750
movl $0x0, 0x6c(%rbx)
movq 0x40(%r15), %rdi
movq 0x70(%rbx), %rsi
xorl %edx, %edx
callq 0xf583
testq %rax, %rax
jns 0xed1d
callq 0x4050
movl (%rax), %eax
movl %eax, 0x6c(%rbx)
movq %r14, %rdi
callq 0x4340
movl $0x2, 0xd8(%rbx)
addq $0xa8, %rbx
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x4040
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/bgzf.c
// Function: bgzf_mt_eof
static void bgzf_mt_eof(BGZF *fp) {
    mtaux_t *mt = fp->mt;

    pthread_mutex_lock(&mt->job_pool_m);
    mt->eof = bgzf_check_EOF_common(fp);
    pthread_mutex_unlock(&mt->job_pool_m);
    mt->command = HAS_EOF_DONE;
    pthread_cond_signal(&mt->command_c);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x48(%rdi), %r14
leaq 0x30(%r14), %r15
movq %r15, %rdi
callq 0x4750
movq %rbx, %rdi
callq 0xd888
movl %eax, 0x78(%r14)
movq %r15, %rdi
callq 0x4340
movl $0x4, 0xd8(%r14)
addq $0xa8, %r14
movq %r14, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x4040
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/bgzf.c
// Function: bgzf_encode_level0_func
static void *bgzf_encode_level0_func(void *arg) {
    bgzf_job *j = (bgzf_job *)arg;
    uint32_t crc;
    j->comp_len = j->uncomp_len + BLOCK_HEADER_LENGTH + BLOCK_FOOTER_LENGTH + 5;

    // Data will have already been copied in to
    // j->comp_data + BLOCK_HEADER_LENGTH + 5

    // Add preamble
    memcpy(j->comp_data, g_magic, BLOCK_HEADER_LENGTH);
    u16_to_le(j->comp_len-1, j->comp_data + 16);

    // Deflate uncompressed data header
    j->comp_data[BLOCK_HEADER_LENGTH] = 1; // BFINAL=1, BTYPE=00; see RFC1951
    u16_to_le(j->uncomp_len, j->comp_data + BLOCK_HEADER_LENGTH + 1);
    u16_to_le(~j->uncomp_len, j->comp_data + BLOCK_HEADER_LENGTH + 3);

    // Trailer (CRC, uncompressed length)
    crc = hts_crc32(0, j->comp_data + BLOCK_HEADER_LENGTH + 5, j->uncomp_len);
    u32_to_le(crc, j->comp_data +  j->comp_len - 8);
    u32_to_le(j->uncomp_len, j->comp_data + j->comp_len - 4);

    return arg;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x20010(%rdi), %rdx
leaq 0x1f(%rdx), %rax
movq %rax, 0x10008(%rdi)
movaps 0x88b81(%rip), %xmm0    # 0x97930
movups %xmm0, 0x8(%rdi)
leal 0x1e(%rdx), %eax
movw %ax, 0x18(%rdi)
movb $0x1, 0x1a(%rdi)
movw %dx, 0x1b(%rdi)
movl %edx, %eax
notl %eax
movw %ax, 0x1d(%rdi)
leaq 0x1f(%rdi), %rsi
xorl %edi, %edi
callq 0x4320
movq 0x10008(%rbx), %rcx
movl %eax, (%rbx,%rcx)
movl 0x20010(%rbx), %eax
movl %eax, 0x4(%rbx,%rcx)
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/bgzf.c
// Function: bgzf_encode_func
static void *bgzf_encode_func(void *arg) {
    bgzf_job *j = (bgzf_job *)arg;

    j->comp_len = BGZF_MAX_BLOCK_SIZE;
    int ret = bgzf_compress(j->comp_data, &j->comp_len,
                            j->uncomp_data, j->uncomp_len,
                            j->fp->compress_level);
    if (ret != 0)
        j->errcode |= BGZF_ERR_ZLIB;

    return arg;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x10008(%rdi), %rsi
movq $0x10000, 0x10008(%rdi) # imm = 0x10000
addq $0x8, %rdi
leaq 0x10010(%rbx), %rdx
movq 0x20010(%rbx), %rcx
movq (%rbx), %rax
movl (%rax), %r8d
shll $0x3, %r8d
sarl $0x17, %r8d
callq 0xabe8
testl %eax, %eax
je 0xee34
orb $0x1, 0x20018(%rbx)
movq %rbx, %rax
popq %rbx
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/hfile.c
// Function: hfile_init
HTSLIB_EXPORT
hFILE *hfile_init(size_t struct_size, const char *mode, size_t capacity)
{
    hFILE *fp = (hFILE *) malloc(struct_size);
    if (fp == NULL) goto error;

    const int maxcap = 128*1024;

    if (capacity == 0) capacity = maxcap;
    // FIXME For now, clamp input buffer sizes so mpileup doesn't eat memory
    if (strchr(mode, 'r') && capacity > maxcap) capacity = maxcap;

#ifdef HAVE_POSIX_MEMALIGN
    fp->buffer = NULL;
    if (posix_memalign((void **)&fp->buffer, 256, capacity) < 0)
        goto error;
#else
    fp->buffer = (char *) malloc(capacity);
    if (fp->buffer == NULL) goto error;
#endif

    fp->begin = fp->end = fp->buffer;
    fp->limit = &fp->buffer[capacity];

    fp->offset = 0;
    fp->at_eof = 0;
    fp->mobile = 1;
    fp->readonly = (strchr(mode, 'r') && ! strchr(mode, '+'));
    fp->preserve = 0;
    fp->has_errno = 0;
    return fp;

error:
    hfile_destroy(fp);
    return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r12
movq %rsi, %r14
callq 0x4680
movq %rax, %rbx
testq %rax, %rax
je 0xeed9
testq %r12, %r12
movl $0x20000, %r15d         # imm = 0x20000
cmoveq %r15, %r12
movq %r14, %rdi
movl $0x72, %esi
callq 0x4190
cmpq %r15, %r12
cmovbq %r12, %r15
movq %rax, %r13
testq %rax, %rax
cmoveq %r12, %r15
movq %r15, %rdi
callq 0x4680
movq %rax, (%rbx)
testq %rax, %rax
je 0xeed9
addq %rax, %r15
movb 0x30(%rbx), %bpl
andb $-0x4, %bpl
orb $0x2, %bpl
movq %rax, 0x10(%rbx)
movq %rax, 0x8(%rbx)
movq %r15, 0x18(%rbx)
movq $0x0, 0x28(%rbx)
movb %bpl, 0x30(%rbx)
testq %r13, %r13
je 0xeee5
movq %r14, %rdi
movl $0x2b, %esi
callq 0x4190
testq %rax, %rax
sete %al
shlb $0x2, %al
jmp 0xeee7
movq %rbx, %rdi
callq 0xef0b
xorl %ebx, %ebx
jmp 0xeef9
xorl %eax, %eax
andb $-0xe, %bpl
orb %al, %bpl
movb %bpl, 0x30(%rbx)
movl $0x0, 0x34(%rbx)
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_O1/samtools[P]htslib/hfile.c
// Function: hfile_destroy
HTSLIB_EXPORT
void hfile_destroy(hFILE *fp)
{
    int save = errno;
    if (fp) free(fp->buffer);
    free(fp);
    errno = save;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x4050
movq %rax, %r14
movl (%rax), %ebp
testq %rbx, %rbx
je 0xef29
movq (%rbx), %rdi
callq 0x45c0
movq %rbx, %rdi
callq 0x45c0
movl %ebp, (%r14)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/hfile.c
// Function: hfile_init_fixed
hFILE *hfile_init_fixed(size_t struct_size, const char *mode,
                        char *buffer, size_t buf_filled, size_t buf_size)
{
    hFILE *fp = (hFILE *) malloc(struct_size);
    if (fp == NULL) return NULL;

    fp->buffer = fp->begin = buffer;
    fp->end = &fp->buffer[buf_filled];
    fp->limit = &fp->buffer[buf_size];

    fp->offset = 0;
    fp->at_eof = 1;
    fp->mobile = 0;
    fp->readonly = (strchr(mode, 'r') && ! strchr(mode, '+'));
    fp->preserve = 0;
    fp->has_errno = 0;
    return fp;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r15
movq %rcx, %r13
movq %rdx, %r12
movq %rsi, %r14
callq 0x4680
testq %rax, %rax
je 0xefb3
movq %rax, %rbx
movq %r12, 0x8(%rax)
movq %r12, (%rax)
addq %r12, %r13
movq %r13, 0x10(%rax)
addq %r12, %r15
movq %r15, 0x18(%rax)
movq $0x0, 0x28(%rax)
movb 0x30(%rax), %bpl
andb $-0x4, %bpl
incb %bpl
movb %bpl, 0x30(%rax)
movq %r14, %rdi
movl $0x72, %esi
callq 0x4190
testq %rax, %rax
je 0xefb7
movq %r14, %rdi
movl $0x2b, %esi
callq 0x4190
testq %rax, %rax
sete %al
shlb $0x2, %al
jmp 0xefb9
xorl %ebx, %ebx
jmp 0xefcb
xorl %eax, %eax
andb $-0xf, %bpl
orb %al, %bpl
movb %bpl, 0x30(%rbx)
movl $0x0, 0x34(%rbx)
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_O1/samtools[P]htslib/hfile.c
// Function: hfile_set_blksize
HTSLIB_EXPORT
int hfile_set_blksize(hFILE *fp, size_t bufsiz) {
    char *buffer;
    ptrdiff_t curr_used;
    if (!fp) return -1;
    curr_used = (fp->begin > fp->end ? fp->begin : fp->end) - fp->buffer;
    if (bufsiz == 0) bufsiz = 32768;

    // Ensure buffer resize will not erase live data
    if (bufsiz < curr_used)
        return -1;

    if (!(buffer = (char *) realloc(fp->buffer, bufsiz))) return -1;

    fp->begin  = buffer + (fp->begin - fp->buffer);
    fp->end    = buffer + (fp->end   - fp->buffer);
    fp->buffer = buffer;
    fp->limit  = &fp->buffer[bufsiz];

    return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testq %rdi, %rdi
je 0xf04d
movq %rdi, %rbx
movq 0x8(%rdi), %rax
movq 0x10(%rdi), %rcx
cmpq %rcx, %rax
cmovaq %rax, %rcx
movq (%rdi), %rdi
subq %rdi, %rcx
testq %rsi, %rsi
movl $0x8000, %r14d          # imm = 0x8000
cmovneq %rsi, %r14
cmpq %rcx, %r14
jb 0xf04d
movq %r14, %rsi
callq 0x4840
testq %rax, %rax
je 0xf04d
movq (%rbx), %rcx
movq 0x8(%rbx), %rdx
subq %rcx, %rdx
addq %rax, %rdx
movq %rdx, 0x8(%rbx)
movq 0x10(%rbx), %rdx
subq %rcx, %rdx
addq %rax, %rdx
movq %rdx, 0x10(%rbx)
movq %rax, (%rbx)
addq %rax, %r14
movq %r14, 0x18(%rbx)
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/hfile.c
// Function: refill_buffer
static ssize_t refill_buffer(hFILE *fp)
{
    ssize_t n;

    // Move any unread characters to the start of the buffer
    if (fp->mobile && fp->begin > fp->buffer) {
        fp->offset += fp->begin - fp->buffer;
        memmove(fp->buffer, fp->begin, fp->end - fp->begin);
        fp->end = &fp->buffer[fp->end - fp->begin];
        fp->begin = fp->buffer;
    }

    // Read into the available buffer space at fp->[end,limit)
    if (fp->at_eof || fp->end == fp->limit) n = 0;
    else {
        n = fp->backend->read(fp, fp->end, fp->limit - fp->end);
        if (n < 0) { fp->has_errno = errno; return n; }
        else if (n == 0) fp->at_eof = 1;
    }

    fp->end += n;
    return n;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
testb $0x2, 0x30(%rdi)
je 0xf0bc
movq (%rbx), %rdi
movq 0x8(%rbx), %rsi
movq %rsi, %rax
subq %rdi, %rax
jbe 0xf0bc
addq %rax, 0x28(%rbx)
movq 0x10(%rbx), %rdx
subq %rsi, %rdx
callq 0x4830
movq 0x10(%rbx), %rax
subq 0x8(%rbx), %rax
movq (%rbx), %rcx
addq %rcx, %rax
movq %rax, 0x10(%rbx)
movq %rcx, 0x8(%rbx)
testb $0x1, 0x30(%rbx)
jne 0xf0e9
movq 0x10(%rbx), %rsi
movq 0x18(%rbx), %rdx
cmpq %rdx, %rsi
je 0xf0e9
movq 0x20(%rbx), %rax
subq %rsi, %rdx
movq %rbx, %rdi
callq *(%rax)
movq %rax, %r14
testq %rax, %rax
js 0xf0fb
jne 0xf0ec
orb $0x1, 0x30(%rbx)
xorl %r14d, %r14d
addq %r14, 0x10(%rbx)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
callq 0x4050
movl (%rax), %eax
movl %eax, 0x34(%rbx)
jmp 0xf0f0
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/hfile.c
// Function: hgetdelim
ssize_t hgetdelim(char *buffer, size_t size, int delim, hFILE *fp)
{
    char *found;
    size_t n, copied = 0;
    ssize_t got;

    if (size < 1 || size > SSIZE_MAX) {
        fp->has_errno = errno = EINVAL;
        return -1;
    }
    if (writebuffer_is_nonempty(fp)) {
        fp->has_errno = errno = EBADF;
        return -1;
    }

    --size; /* to allow space for the NUL terminator */

    do {
        n = fp->end - fp->begin;
        if (n > size - copied) n = size - copied;

        /* Look in the hFILE buffer for the delimiter */
        found = memchr(fp->begin, delim, n);
        if (found != NULL) {
            n = found - fp->begin + 1;
            memcpy(buffer + copied, fp->begin, n);
            buffer[n + copied] = '\0';
            fp->begin += n;
            return n + copied;
        }

        /* No delimiter yet, copy as much as we can and refill if necessary */
        memcpy(buffer + copied, fp->begin, n);
        fp->begin += n;
        copied += n;

        if (copied == size) { /* Output buffer full */
            buffer[copied] = '\0';
            return copied;
        }

        got = refill_buffer(fp);
    } while (got > 0);

    if (got < 0) return -1; /* Error on refill. */

    buffer[copied] = '\0';  /* EOF, return anything that was copied. */
    return copied;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %rbx
movl %edx, 0x14(%rsp)
movq %rdi, 0x8(%rsp)
testq %rsi, %rsi
jle 0xf13c
movq 0x8(%rbx), %rax
cmpq 0x10(%rbx), %rax
jbe 0xf164
callq 0x4050
movl $0x9, %ecx
jmp 0xf146
callq 0x4050
movl $0x16, %ecx
movl %ecx, (%rax)
movl %ecx, 0x34(%rbx)
movq $-0x1, %r14
movq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rsi, %r15
decq %r15
xorl %r14d, %r14d
movq 0x8(%rbx), %r13
movq 0x10(%rbx), %rax
subq %r13, %rax
movq %r15, %r12
subq %r14, %r12
cmpq %r12, %rax
cmovbq %rax, %r12
movq %r13, %rdi
movl 0x14(%rsp), %esi
movq %r12, %rdx
callq 0x4550
testq %rax, %rax
jne 0xf1d7
movq 0x8(%rsp), %rax
leaq (%rax,%r14), %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x43c0
addq %r12, 0x8(%rbx)
addq %r12, %r14
cmpq %r15, %r14
je 0xf1c8
movq %rbx, %rdi
callq 0xf07a
testq %rax, %rax
jg 0xf16d
js 0xf14b
movq 0x8(%rsp), %rax
movb $0x0, (%rax,%r14)
jmp 0xf152
movq %rax, %rbp
subq %r13, %rbp
leaq 0x1(%rbp), %r15
movq 0x8(%rsp), %r12
leaq (%r12,%r14), %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x43c0
addq %rbp, %r14
incq %r14
movb $0x0, (%r12,%r14)
addq %r15, 0x8(%rbx)
jmp 0xf152
// File: /workspace/github_c_makefile_star2_O1/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 0xf234
movq %rdi, %r14
movl %esi, %esi
movl $0xa, %edx
movq %rbx, %rcx
callq 0xf107
movq %rax, %rcx
xorl %eax, %eax
testq %rcx, %rcx
cmovgq %r14, %rax
jmp 0xf245
callq 0x4050
movl $0x16, %ecx
movl %ecx, (%rax)
movl %ecx, 0x34(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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
movl $0x1, %ebp
cmpq %rbx, %r13
jae 0xf2a2
movq %r15, %rdi
callq 0xf07a
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 0xf26e
cmpl $0x3, %ecx
jne 0xf2bb
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_O1/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
subq $0x18, %rsp
movq %rcx, %rbx
movq %rdx, %r14
movq %rdi, %r15
movq 0x18(%rdi), %r13
subq (%rdi), %r13
movq %rsi, %r12
addq %rcx, %r12
subq %rcx, %r14
movl $0x0, 0xc(%rsp)
leaq (%r14,%r14), %rax
cmpq %r13, %rax
jb 0xf35d
testb $0x1, 0x30(%r15)
jne 0xf35d
movq 0x20(%r15), %rax
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq *(%rax)
movq %rax, %rbp
testq %rax, %rax
js 0xf346
movl $0x1, %eax
jne 0xf333
orb $0x1, 0x30(%r15)
movl 0xc(%rsp), %eax
addq %rbp, 0x28(%r15)
addq %rbp, %r12
subq %rbp, %r14
addq %rbp, %rbx
movl %eax, 0xc(%rsp)
jmp 0xf356
callq 0x4050
movl (%rax), %eax
movl %eax, 0x34(%r15)
movq %rbp, 0x10(%rsp)
testq %rbp, %rbp
jns 0xf2fc
jmp 0xf3d3
cmpl $0x0, 0xc(%rsp)
je 0xf37a
movq (%r15), %rax
movq 0x8(%r15), %rcx
subq %rax, %rcx
addq %rcx, 0x28(%r15)
movq %rax, 0x10(%r15)
movq %rax, 0x8(%r15)
testq %r14, %r14
je 0xf3ce
testb $0x1, 0x30(%r15)
jne 0xf3ce
movq %r15, %rdi
callq 0xf07a
movq %rax, %rbp
testq %rax, %rax
js 0xf3c2
movq 0x8(%r15), %rsi
movq 0x10(%r15), %r13
subq %rsi, %r13
cmpq %r14, %r13
cmovaeq %r14, %r13
movq %r12, %rdi
movq %r13, %rdx
callq 0x43c0
addq %r13, 0x8(%r15)
addq %r13, %r12
subq %r13, %r14
addq %r13, %rbx
jmp 0xf3c7
movq %rbp, 0x10(%rsp)
testq %rbp, %rbp
jns 0xf37a
jmp 0xf3d3
movq %rbx, 0x10(%rsp)
movq 0x10(%rsp), %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 %rbx
pushq %rax
movq %rdi, %rbx
callq 0xf42c
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testq %rax, %rax
js 0xf423
movq 0x20(%rbx), %rax
movq 0x18(%rax), %rax
xorl %ebp, %ebp
testq %rax, %rax
je 0xf423
movq %rbx, %rdi
callq *%rax
testl %eax, %eax
jns 0xf423
callq 0x4050
movl (%rax), %eax
movl %eax, 0x34(%rbx)
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %r14
movq 0x8(%rbx), %rdx
cmpq %rdx, %r14
jae 0xf478
movq 0x20(%rbx), %rax
subq %r14, %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq *0x8(%rax)
movq %rax, %r12
testq %rax, %rax
js 0xf464
addq %r12, %r14
addq %r12, 0x28(%rbx)
jmp 0xf471
callq 0x4050
movl (%rax), %eax
movl %eax, 0x34(%rbx)
movq %r12, %r15
testq %r12, %r12
jns 0xf43a
jmp 0xf482
movq (%rbx), %rax
movq %rax, 0x8(%rbx)
xorl %r15d, %r15d
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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, %r14
movq 0x18(%rdi), %rbx
subq (%rdi), %rbx
callq 0xf42c
testq %rax, %rax
js 0xf53a
addq %rbp, %r15
movq %r12, (%rsp)
subq %rbp, %r12
leaq (%r12,%r12), %rax
cmpq %rbx, %rax
jb 0xf53f
movq 0x20(%r14), %rax
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq *0x8(%rax)
movq %rax, %rbp
testq %rax, %rax
js 0xf525
addq %rbp, 0x28(%r14)
addq %rbp, %r15
subq %rbp, %r12
jmp 0xf533
callq 0x4050
movl (%rax), %eax
movl %eax, 0x34(%r14)
movq %rbp, %r13
testq %rbp, %rbp
jns 0xf4f8
jmp 0xf556
movq %rax, %r13
jmp 0xf556
movq 0x8(%r14), %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x43c0
addq %r12, 0x8(%r14)
movq (%rsp), %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_O1/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 0xf6f2
movq %rbx, %rdi
callq 0xf3e7
testl %eax, %eax
jns 0xf6f2
movl 0x34(%rbx), %ebp
testb $0x8, 0x30(%rbx)
jne 0xf715
movq 0x20(%rbx), %rax
movq %rbx, %rdi
callq *0x20(%rax)
testl %eax, %eax
jns 0xf70d
callq 0x4050
movl (%rax), %ebp
movq %rbx, %rdi
callq 0xef0b
testl %ebp, %ebp
je 0xf727
callq 0x4050
movl %ebp, (%rax)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0xf729
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xf760
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 0xef0b
movl %ebp, (%r14)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
subq $0x90, %rsp
movq %rsi, %rbx
movl %edi, %ebp
movq %rsp, %rsi
callq 0x4890
testl %eax, %eax
je 0xf781
xorl %edx, %edx
jmp 0xf79b
movl $0xf000, %eax           # imm = 0xF000
andl 0x18(%rsp), %eax
movl $0x20000, %edx          # imm = 0x20000
cmpl $0x1000, %eax           # imm = 0x1000
je 0xf79b
movq 0x38(%rsp), %rdx
movl $0x40, %edi
movq %rbx, %rsi
callq 0xee3c
testq %rax, %rax
je 0xf802
movq %rax, %r14
movl %ebp, 0x38(%rax)
movq %rbx, %rdi
movl $0x73, %esi
callq 0x4190
testq %rax, %rax
setne %al
movb 0x3c(%r14), %bpl
andb $-0x2, %bpl
orb %al, %bpl
movb %bpl, 0x3c(%r14)
movq %rbx, %rdi
movl $0x53, %esi
callq 0x4190
testq %rax, %rax
setne %al
addb %al, %al
andb $-0x3, %bpl
orb %al, %bpl
movb %bpl, 0x3c(%r14)
leaq 0xa8fc4(%rip), %rax     # 0xb87c0
movq %rax, 0x20(%r14)
jmp 0xf805
xorl %r14d, %r14d
movq %r14, %rax
addq $0x90, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 %ecx, %ecx
xorl %eax, %eax
movzbl (%rdi), %edx
cmpl $0x71, %edx
jle 0xf833
cmpl $0x78, %edx
je 0xf844
cmpl $0x77, %edx
je 0xf84b
cmpl $0x72, %edx
jne 0xf862
xorl %ecx, %ecx
jmp 0xf862
cmpl $0x2b, %edx
je 0xf857
cmpl $0x61, %edx
jne 0xf85e
orl $0x440, %eax            # imm = 0x440
jmp 0xf850
orl $0x80, %eax
jmp 0xf862
orl $0x240, %eax            # imm = 0x240
movl $0x1, %ecx
jmp 0xf862
movl $0x2, %ecx
jmp 0xf862
testl %edx, %edx
je 0xf867
incq %rdi
jmp 0xf818
orl %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xa8f77(%rip), %rax     # 0xb87e8
cmpq %rax, 0x20(%rdi)
je 0xf88a
pushq %rax
callq 0x4050
movl $0x16, (%rax)
xorl %eax, %eax
addq $0x8, %rsp
retq
testq %rsi, %rsi
je 0xf899
movq (%rdi), %rax
subq 0x18(%rdi), %rax
movq %rax, (%rsi)
movq (%rdi), %rax
retq
// File: /workspace/github_c_makefile_star2_O1/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
leaq 0xa8f40(%rip), %rax     # 0xb87e8
cmpq %rax, 0x20(%rdi)
je 0xf8bd
callq 0x4050
movl $0x16, (%rax)
xorl %eax, %eax
jmp 0xf8cf
testq %rsi, %rsi
je 0xf8cc
movq (%rbx), %rax
subq 0x18(%rbx), %rax
movq %rax, (%rsi)
movq (%rbx), %rax
testq %rax, %rax
je 0xf8db
movq $0x0, (%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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:
movl (%rdx), %ecx
cmpq $0x28, %rcx
ja 0xf928
movq %rcx, %rax
addq 0x10(%rdx), %rax
addl $0x8, %ecx
movl %ecx, (%rdx)
jmp 0xf934
movq 0x8(%rdx), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rdx)
pushq %rbx
movq (%rax), %rbx
movl (%rdx), %ecx
cmpq $0x28, %rcx
ja 0xf94e
movq %rcx, %rax
addq 0x10(%rdx), %rax
addl $0x8, %ecx
movl %ecx, (%rdx)
jmp 0xf95a
movq 0x8(%rdx), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rdx)
movq (%rax), %rcx
movl $0x38, %edi
movq %rbx, %rdx
movq %rcx, %r8
callq 0xef39
testq %rax, %rax
je 0xf97f
leaq 0xa8e6f(%rip), %rcx     # 0xb87e8
movq %rcx, 0x20(%rax)
jmp 0xf981
xorl %eax, %eax
testq %rax, %rax
jne 0xf990
movq %rbx, %rdi
callq 0x45c0
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x8888a(%rip), %rsi     # 0x98514
movl $0x9, %edx
callq 0x4210
xorl %ecx, %ecx
testl %eax, %eax
sete %cl
leaq (%rcx,%rcx,8), %rcx
addq %rbx, %rcx
leaq 0x888ad(%rip), %rsi     # 0x98556
leaq 0x888b6(%rip), %rdx     # 0x98566
leaq 0x88867(%rip), %r8      # 0x9851e
movl $0x1, %edi
xorl %eax, %eax
callq 0x14378
callq 0x4050
movl $0x5d, (%rax)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r14
pushq %rbx
pushq %rax
leaq 0xa9af0(%rip), %rdi     # 0xb97d0
callq 0x4750
movq 0xa9b0c(%rip), %rbx     # 0xb97f8
testq %rbx, %rbx
je 0xfd1f
movq 0x18(%rbx), %rdi
callq 0x45c0
movq 0x10(%rbx), %rdi
callq 0x45c0
movq 0x20(%rbx), %rdi
callq 0x45c0
movq %rbx, %rdi
callq 0x45c0
movq $0x0, 0xa9ad9(%rip) # 0xb97f8
movq 0xa9ada(%rip), %rbx     # 0xb9800
testq %rbx, %rbx
je 0xfd51
movq 0x18(%rbx), %rax
testq %rax, %rax
je 0xfd36
callq *%rax
movq 0x20(%rbx), %r14
movq %r14, 0xa9abf(%rip)     # 0xb9800
movq %rbx, %rdi
callq 0x45c0
movq %r14, %rbx
testq %r14, %r14
jne 0xfd2b
leaq 0xa9a78(%rip), %rdi     # 0xb97d0
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x4340
// File: /workspace/github_c_makefile_star2_O1/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 0xa9a4c(%rip), %rdi     # 0xb97d0
callq 0x4750
cmpq $0x0, 0xa9a67(%rip)     # 0xb97f8
jne 0xfda0
callq 0xfe5e
testl %eax, %eax
js 0xfe3c
movq %rbx, 0x8(%rsp)
leaq 0xa9a24(%rip), %rdi     # 0xb97d0
callq 0x4340
movq 0xa9a40(%rip), %r12     # 0xb97f8
movl (%r12), %r13d
testq %r13, %r13
je 0xfe2d
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 0xfe1f
testq %r15, %r15
je 0xfdff
movq 0x20(%r12), %rax
movq (%rax,%rbx,8), %rax
movq 0x10(%rax), %rdi
movq %r15, %rsi
callq 0x46c0
testl %eax, %eax
jne 0xfe1f
movq 0x8(%rsp), %rax
cmpl (%rax), %ebp
jge 0xfe1d
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 0xfdc8
jmp 0xfe2f
xorl %ebp, %ebp
movq 0x8(%rsp), %rax
cmpl %ebp, (%rax)
jle 0xfe4d
movl %ebp, (%rax)
jmp 0xfe4d
leaq 0xa998d(%rip), %rdi     # 0xb97d0
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_O1/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 0xa98b8(%rip), %rdi     # 0xb97d0
callq 0x4750
cmpq $0x0, 0xa98d3(%rip)     # 0xb97f8
jne 0xff30
callq 0xfe5e
testl %eax, %eax
js 0xff86
leaq 0xa9899(%rip), %rdi     # 0xb97d0
callq 0x4340
movslq (%rbx), %rcx
testq %rcx, %rcx
je 0xff55
leaq 0x885a0(%rip), %rax     # 0x984eb
movq %rax, (%r14)
movl $0x1, %eax
jmp 0xff57
xorl %eax, %eax
movq 0xa98a2(%rip), %rdx     # 0xb9800
testq %rdx, %rdx
je 0xff7e
movl %eax, %eax
cmpq %rcx, %rax
jge 0xff72
movq 0x10(%rdx), %rsi
movq %rsi, (%r14,%rax,8)
incq %rax
movq 0x20(%rdx), %rdx
testq %rdx, %rdx
jne 0xff65
cmpl %eax, %ecx
jle 0xff97
movl %eax, (%rbx)
jmp 0xff97
leaq 0xa9843(%rip), %rdi     # 0xb97d0
callq 0x4340
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xa9823(%rip), %rdi     # 0xb97d0
callq 0x4750
cmpq $0x0, 0xa983e(%rip)     # 0xb97f8
jne 0xffc5
callq 0xfe5e
testl %eax, %eax
js 0xfffc
leaq 0xa9804(%rip), %rdi     # 0xb97d0
callq 0x4340
movq 0xa9828(%rip), %r14     # 0xb9800
xorl %ebp, %ebp
testq %r14, %r14
je 0x1000d
movq 0x10(%r14), %rdi
movq %rbx, %rsi
callq 0x46c0
testl %eax, %eax
je 0xfff5
movq 0x20(%r14), %r14
jmp 0xffda
movl $0x1, %ebp
jmp 0x1000d
leaq 0xa97cd(%rip), %rdi     # 0xb97d0
callq 0x4340
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq