LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/cram_io.c
// Function: cram_free_slice_header
void cram_free_slice_header(cram_block_slice_hdr *hdr) {
    if (!hdr)
        return;

    if (hdr->block_content_ids)
        free(hdr->block_content_ids);

    free(hdr);

    return;
}

// Assembly:
testq %rdi, %rdi
je 0x43610
pushq %rbx
movq %rdi, %rbx
movq 0x30(%rdi), %rdi
callq 0x45c0
movq %rbx, %rdi
popq %rbx
jmp 0x45c0
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/cram_io.c
// Function: cram_new_slice
cram_slice *cram_new_slice(enum cram_content_type type, int nrecs) {
    cram_slice *s = calloc(1, sizeof(*s));
    if (!s)
        return NULL;

    if (!(s->hdr = (cram_block_slice_hdr *)calloc(1, sizeof(*s->hdr))))
        goto err;
    s->hdr->content_type = type;

    s->hdr_block = NULL;
    s->block = NULL;
    s->block_by_id = NULL;
    s->last_apos = 0;
    if (!(s->crecs = malloc(nrecs * sizeof(cram_record))))  goto err;
    s->cigar_alloc = 1024;
    if (!(s->cigar = malloc(s->cigar_alloc * sizeof(*s->cigar)))) goto err;
    s->ncigar = 0;

    if (!(s->seqs_blk = cram_new_block(EXTERNAL, 0)))       goto err;
    if (!(s->qual_blk = cram_new_block(EXTERNAL, DS_QS)))   goto err;
    if (!(s->name_blk = cram_new_block(EXTERNAL, DS_RN)))   goto err;
    if (!(s->aux_blk  = cram_new_block(EXTERNAL, DS_aux)))  goto err;
    if (!(s->base_blk = cram_new_block(EXTERNAL, DS_IN)))   goto err;
    if (!(s->soft_blk = cram_new_block(EXTERNAL, DS_SC)))   goto err;

    s->features = NULL;
    s->nfeatures = s->afeatures = 0;

#ifndef TN_external
    s->TN = NULL;
    s->nTN = s->aTN = 0;
#endif

    // Volatile keys as we do realloc in dstring
    if (!(s->pair_keys = string_pool_create(8192))) goto err;
    if (!(s->pair[0] = kh_init(m_s2i)))             goto err;
    if (!(s->pair[1] = kh_init(m_s2i)))             goto err;

#ifdef BA_external
    s->BA_len = 0;
#endif

    return s;

 err:
    if (s)
        cram_free_slice(s);

    return NULL;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movl %edi, %r14d
pushq $0x1
popq %rdi
movl $0xf0, %esi
callq 0x4300
testq %rax, %rax
je 0x4374f
movq %rax, %rbx
pushq $0x1
popq %rdi
pushq $0x50
popq %rsi
callq 0x4300
movq %rax, (%rbx)
testq %rax, %rax
je 0x43747
movl %r14d, (%rax)
movslq %ebp, %rax
imulq $0x90, %rax, %rdi
callq 0x4680
movq %rax, 0x30(%rbx)
testq %rax, %rax
je 0x43747
movl $0x400, 0x40(%rbx)      # imm = 0x400
movl $0x1000, %edi           # imm = 0x1000
callq 0x4680
movq %rax, 0x38(%rbx)
testq %rax, %rax
je 0x43747
pushq $0x4
popq %rdi
xorl %esi, %esi
callq 0x3f426
movq %rax, 0x70(%rbx)
testq %rax, %rax
je 0x43747
pushq $0x4
popq %rdi
pushq $0xc
popq %rsi
callq 0x3f426
movq %rax, 0x78(%rbx)
testq %rax, %rax
je 0x43747
pushq $0x4
popq %rdi
pushq $0xb
popq %rsi
callq 0x3f426
movq %rax, 0x68(%rbx)
testq %rax, %rax
je 0x43747
pushq $0x4
popq %rdi
pushq $0x1
popq %rsi
callq 0x3f426
movq %rax, 0x90(%rbx)
testq %rax, %rax
je 0x43747
pushq $0x4
popq %rdi
pushq $0xd
popq %rsi
callq 0x3f426
movq %rax, 0x80(%rbx)
testq %rax, %rax
je 0x43747
pushq $0x4
popq %rdi
pushq $0xe
popq %rsi
callq 0x3f426
movq %rax, 0x88(%rbx)
testq %rax, %rax
je 0x43747
movl $0x2000, %edi           # imm = 0x2000
callq 0x4925c
movq %rax, 0x98(%rbx)
testq %rax, %rax
je 0x43747
callq 0x43594
movq %rax, 0xa0(%rbx)
testq %rax, %rax
je 0x43747
callq 0x43594
movq %rax, 0xa8(%rbx)
testq %rax, %rax
jne 0x43751
movq %rbx, %rdi
callq 0x42611
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/cram_io.c
// Function: cram_read_file_def
cram_file_def *cram_read_file_def(cram_fd *fd) {
    cram_file_def *def = malloc(sizeof(*def));
    if (!def)
        return NULL;

    if (26 != hread(fd->fp, &def->magic[0], 26)) {
        free(def);
        return NULL;
    }

    if (memcmp(def->magic, "CRAM", 4) != 0) {
        free(def);
        return NULL;
    }

    if (def->major_version > 4) {
        hts_log_error("CRAM version number mismatch. Expected 1.x, 2.x, 3.x or 4.x, got %d.%d",
                      def->major_version, def->minor_version);
        free(def);
        return NULL;
    }

    fd->first_container += 26;
    fd->curr_position = fd->first_container;
    fd->last_slice = 0;

    return def;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
pushq $0x1a
popq %rdi
callq 0x4680
testq %rax, %rax
je 0x439f2
movq %rax, %rbx
movq (%r14), %rdi
pushq $0x1a
popq %rdx
movq %rax, %rsi
callq 0x3e674
cmpq $0x1a, %rax
jne 0x439ea
cmpl $0x4d415243, (%rbx)     # imm = 0x4D415243
jne 0x439ea
movzbl 0x4(%rbx), %ecx
cmpl $0x5, %ecx
jb 0x439ff
movzbl 0x5(%rbx), %r8d
leaq 0x3963a(%rip), %rsi     # 0x7d013
leaq 0x39646(%rip), %rdx     # 0x7d026
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x110c6
movq %rbx, %rdi
callq 0x45c0
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x8880(%r14), %rax
addq $0x1a, %rax
movq %rax, 0x8880(%r14)
movq %rax, 0x8888(%r14)
andl $0x0, 0x8894(%r14)
jmp 0x439f4
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/cram_io.h
// Function: block_resize
static inline int block_resize(cram_block *b, size_t len) {
    if (b->alloc > len)
        return 0;

#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    // Removal of extra padding causes many more reallocs, but detects
    // more buffer overruns.
    return block_resize_exact(b, len?len:1);
#endif

    size_t alloc = b->alloc+800;
    alloc = MAX(alloc + (alloc>>2), len);
    return block_resize_exact(b, alloc);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq 0x28(%rdi), %rax
xorl %ebx, %ebx
cmpq %rsi, %rax
ja 0x445d5
movq %rsi, %r14
movq %rdi, %r15
leaq 0x320(%rax), %rcx
shrq $0x2, %rcx
addq %rcx, %rax
addq $0x320, %rax            # imm = 0x320
cmpq %rsi, %rax
cmovaq %rax, %r14
movq 0x20(%rdi), %rdi
movq %r14, %rsi
callq 0x4840
testq %rax, %rax
je 0x445d2
movq %r14, 0x28(%r15)
movq %rax, 0x20(%r15)
jmp 0x445d5
pushq $-0x1
popq %rbx
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/cram_io.c
// Function: cram_open
cram_fd *cram_open(const char *filename, const char *mode) {
    hFILE *fp;
    cram_fd *fd;
    char fmode[3]= { mode[0], '\0', '\0' };

    if (strlen(mode) > 1 && (mode[1] == 'b' || mode[1] == 'c')) {
        fmode[1] = 'b';
    }

    fp = hopen(filename, fmode);
    if (!fp)
        return NULL;

    fd = cram_dopen(fp, filename, mode);
    if (!fd)
        hclose_abruptly(fp);

    return fd;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movb (%rsi), %al
movb %al, 0x5(%rsp)
andw $0x0, 0x6(%rsp)
movq %rsi, %rdi
callq 0x41d0
cmpq $0x2, %rax
jb 0x44613
movb 0x1(%rbx), %al
andb $-0x2, %al
cmpb $0x62, %al
jne 0x44613
movb $0x62, 0x6(%rsp)
xorl %r15d, %r15d
leaq 0x5(%rsp), %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0xe19b
testq %rax, %rax
je 0x4464e
movq %rax, %r12
movq %rax, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x4465d
movq %rax, %r15
testq %rax, %rax
jne 0x4464e
movq %r12, %rdi
callq 0xd94c
xorl %r15d, %r15d
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/cram_io.c
// Function: cram_flush
int cram_flush(cram_fd *fd) {
    if (!fd)
        return -1;

    int ret = 0;

    if (fd->mode == 'w' && fd->ctr) {
        if(fd->ctr->slice)
            cram_update_curr_slice(fd->ctr, fd->version);

        if (-1 == cram_flush_container_mt(fd, fd->ctr))
            ret = -1;

        cram_free_container(fd->ctr);
        if (fd->ctr_mt == fd->ctr)
            fd->ctr_mt = NULL;
        fd->ctr = NULL;
    }

    return ret;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x44e5b
movq %rdi, %rbx
xorl %ebp, %ebp
cmpl $0x77, 0x8(%rdi)
jne 0x44e5e
movq 0x38(%rbx), %rsi
testq %rsi, %rsi
je 0x44e5e
cmpq $0x0, 0x90(%rsi)
je 0x44e29
movl 0xc(%rbx), %eax
movq %rsi, %rdi
movl %eax, %esi
callq 0x3afd5
movq 0x38(%rbx), %rsi
movq %rbx, %rdi
callq 0x432eb
xorl %ebp, %ebp
cmpl $-0x1, %eax
sete %bpl
movq 0x38(%rbx), %rdi
callq 0x4237d
movq 0x40(%rbx), %rax
cmpq 0x38(%rbx), %rax
jne 0x44e52
andq $0x0, 0x40(%rbx)
negl %ebp
andq $0x0, 0x38(%rbx)
jmp 0x44e5e
pushq $-0x1
popq %rbp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/cram_io.c
// Function: cram_check_EOF
int cram_check_EOF(cram_fd *fd)
{
    // Byte 9 in these templates is & with 0x0f to resolve differences
    // between ITF-8 interpretations between early Java and C
    // implementations of CRAM
    static const unsigned char TEMPLATE_2_1[30] = {
        0x0b, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xe0,
        0x45, 0x4f, 0x46, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
        0x01, 0x00, 0x06, 0x06, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00
    };
    static const unsigned char TEMPLATE_3[38] = {
        0x0f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xe0,
        0x45, 0x4f, 0x46, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x05,
        0xbd, 0xd9, 0x4f, 0x00, 0x01, 0x00, 0x06, 0x06, 0x01, 0x00,
        0x01, 0x00, 0x01, 0x00, 0xee, 0x63, 0x01, 0x4b
    };

    unsigned char buf[38]; // max(sizeof TEMPLATE_*)

    uint8_t major = CRAM_MAJOR_VERS(fd->version);
    uint8_t minor = CRAM_MINOR_VERS(fd->version);

    const unsigned char *template;
    ssize_t template_len;
    if ((major < 2) ||
        (major == 2 && minor == 0)) {
        return 3; // No EOF support in cram versions less than 2.1
    } else if (major == 2 && minor == 1) {
        template = TEMPLATE_2_1;
        template_len = sizeof TEMPLATE_2_1;
    } else {
        template = TEMPLATE_3;
        template_len = sizeof TEMPLATE_3;
    }

    off_t offset = htell(fd->fp);
    if (hseek(fd->fp, -template_len, SEEK_END) < 0) {
        if (errno == ESPIPE) {
            hclearerr(fd->fp);
            return 2;
        }
        else {
            return -1;
        }
    }
    if (hread(fd->fp, buf, template_len) != template_len) return -1;
    if (hseek(fd->fp, offset, SEEK_SET) < 0) return -1;
    buf[8] &= 0x0f;
    return (memcmp(template, buf, template_len) == 0)? 1 : 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl 0xc(%rdi), %ecx
movzbl %ch, %eax
pushq $0x3
popq %rbp
cmpl $0x2, %eax
jb 0x45db3
xorl $0x2, %eax
movzbl %cl, %ecx
movl %ecx, %edx
orl %eax, %edx
je 0x45db3
movq %rdi, %rbx
xorl $0x1, %ecx
xorl %r12d, %r12d
xorl %edx, %edx
orl %eax, %ecx
setne %r13b
leaq 0x36b65(%rip), %rax     # 0x7c880
leaq 0x36b7e(%rip), %r14     # 0x7c8a0
cmoveq %rax, %r14
sete %dl
leaq -0x26(,%rdx,8), %rsi
movq (%rdi), %rdi
movq 0x28(%rdi), %r15
addq 0x8(%rdi), %r15
subq (%rdi), %r15
pushq $0x2
popq %rbp
movl %ebp, %edx
callq 0xd7cb
testq %rax, %rax
js 0x45d9d
movb %r13b, %r12b
leaq 0x1e(,%r12,8), %r12
movq (%rbx), %rdi
movq %rsp, %rsi
movq %r12, %rdx
callq 0x3e674
pushq $-0x1
popq %rbp
cmpq %r12, %rax
jne 0x45db3
movq (%rbx), %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0xd7cb
testq %rax, %rax
js 0x45db3
movq %rsp, %rsi
andb $0xf, 0x8(%rsi)
movq %r14, %rdi
movq %r12, %rdx
callq 0x44d0
xorl %ebp, %ebp
testl %eax, %eax
sete %bpl
jmp 0x45db3
callq 0x4050
cmpl $0x1d, (%rax)
jne 0x45db0
movq (%rbx), %rax
andl $0x0, 0x34(%rax)
jmp 0x45db3
pushq $-0x1
popq %rbp
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/cram_io.c
// Function: mkdir_prefix
static void mkdir_prefix(char *path, int mode) {
    char *cp = strrchr(path, '/');
    if (!cp)
        return;

    *cp = 0;
    if (is_directory(path)) {
        *cp = '/';
        return;
    }

    if (mkdir(path, mode) == 0) {
        chmod(path, mode);
        *cp = '/';
        return;
    }

    mkdir_prefix(path, mode);
    mkdir(path, mode);
    chmod(path, mode);
    *cp = '/';
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x98, %rsp
movq %rdi, %rbx
pushq $0x2f
popq %rsi
callq 0x4530
testq %rax, %rax
je 0x46914
movq %rax, %r14
movb $0x0, (%rax)
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x4420
testl %eax, %eax
jne 0x468dd
movl $0xf000, %eax           # imm = 0xF000
andl 0x20(%rsp), %eax
cmpl $0x4000, %eax           # imm = 0x4000
je 0x46910
movq %rbx, %rdi
movl $0x3ff, %esi            # imm = 0x3FF
callq 0x41e0
testl %eax, %eax
je 0x46903
movq %rbx, %rdi
callq 0x4689c
movq %rbx, %rdi
movl $0x3ff, %esi            # imm = 0x3FF
callq 0x41e0
movq %rbx, %rdi
movl $0x3ff, %esi            # imm = 0x3FF
callq 0x4430
movb $0x2f, (%r14)
addq $0x98, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/cram_io.c
// Function: uint7_get_32
static int64_t uint7_get_32(char **cp, const char *endp, int *err) {
    uint32_t val;
    int nb = var_get_u32((uint8_t *)(*cp), (const uint8_t *)endp, &val);
    (*cp) += nb;
    if (!nb && err) *err = 1;
    return val;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r14
movq (%rdi), %rdi
leaq 0x4(%rsp), %rdx
callq 0x47051
cltq
addq %rax, (%r14)
testl %eax, %eax
setne %al
testq %rbx, %rbx
sete %cl
orb %al, %cl
jne 0x46950
movl $0x1, (%rbx)
movl 0x4(%rsp), %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/cram_io.c
// Function: sint7_get_32
static int64_t sint7_get_32(char **cp, const char *endp, int *err) {
    int32_t val;
    int nb = var_get_s32((uint8_t *)(*cp), (const uint8_t *)endp, &val);
    (*cp) += nb;
    if (!nb && err) *err = 1;
    return val;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movq %rdi, %r14
movq (%rdi), %rdi
leaq 0xc(%rsp), %r15
movq %r15, %rdx
callq 0x47051
movl (%r15), %ecx
cltq
addq %rax, (%r14)
testl %eax, %eax
setne %al
testq %rbx, %rbx
sete %dl
orb %al, %dl
jne 0x46998
movl $0x1, (%rbx)
movl %ecx, %eax
shrl %eax
andl $0x1, %ecx
negl %ecx
xorl %eax, %ecx
movslq %ecx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/cram_io.c
// Function: uint7_get_64
static int64_t uint7_get_64(char **cp, const char *endp, int *err) {
    uint64_t val;
    int nb = var_get_u64((uint8_t *)(*cp), (const uint8_t *)endp, &val);
    (*cp) += nb;
    if (!nb && err) *err = 1;
    return val;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r14
movq (%rdi), %rdi
movq %rsp, %rdx
callq 0x470d7
cltq
addq %rax, (%r14)
testl %eax, %eax
setne %al
testq %rbx, %rbx
sete %cl
orb %al, %cl
jne 0x469df
movl $0x1, (%rbx)
movq (%rsp), %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/cram_io.c
// Function: sint7_get_64
static int64_t sint7_get_64(char **cp, const char *endp, int *err) {
    int64_t val;
    int nb = var_get_s64((uint8_t *)(*cp), (const uint8_t *)endp, &val);
    (*cp) += nb;
    if (!nb && err) *err = 1;
    return val;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movq %rdi, %r14
movq (%rdi), %rdi
leaq 0x8(%rsp), %r15
movq %r15, %rdx
callq 0x470d7
movl %eax, %ecx
movq (%r15), %rax
movslq %ecx, %rcx
addq %rcx, (%r14)
testl %ecx, %ecx
setne %cl
testq %rbx, %rbx
sete %dl
orb %cl, %dl
jne 0x46a2a
movl $0x1, (%rbx)
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
negq %rax
xorq %rcx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/cram_io.c
// Function: uint7_decode_crc32
static int uint7_decode_crc32(cram_fd *fd, int32_t *val_p, uint32_t *crc) {
    uint8_t b[5], i = 0;
    int c;
    uint32_t v = 0;

#ifdef VARINT2
    b[0] = hgetc(fd->fp);
    if (b[0] < 177) {
    } else if (b[0] < 241) {
        b[1] = hgetc(fd->fp);
    } else if (b[0] < 249) {
        b[1] = hgetc(fd->fp);
        b[2] = hgetc(fd->fp);
    } else {
        int n = b[0]+2, z = 1;
        while (n-- >= 249)
            b[z++] = hgetc(fd->fp);
    }
    i = var_get_u32(b, NULL, &v);
#else
//    // Little endian
//    int s = 0;
//    do {
//        b[i++] = c = hgetc(fd->fp);
//        if (c < 0)
//            return -1;
//        v |= (c & 0x7f) << s;
//      s += 7;
//    } while (i < 5 && (c & 0x80));

    // Big endian, see also htscodecs/varint.h
    do {
        b[i++] = c = hgetc(fd->fp);
        if (c < 0)
            return -1;
        v = (v<<7) | (c & 0x7f);
    } while (i < 5 && (c & 0x80));
#endif
    *crc = crc32(*crc, b, i);

    *val_p = v;
    return i;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r14
movq %rsi, 0x10(%rsp)
movq %rdi, %r15
xorl %r12d, %r12d
pushq $-0x1
popq %rbp
xorl %r13d, %r13d
movq (%r15), %rdi
callq 0x3e519
movb %al, 0xb(%rsp,%r12)
testl %eax, %eax
js 0x46bfe
leaq 0x1(%r12), %rbx
movl %r13d, %ecx
shll $0x7, %ecx
movl %eax, %r13d
andl $0x7f, %r13d
orl %ecx, %r13d
cmpq $0x3, %r12
ja 0x46be2
movq %rbx, %r12
andl $0x80, %eax
jne 0x46bac
movl (%r14), %edi
leaq 0xb(%rsp), %rsi
movl %ebx, %edx
callq 0x4320
movl %eax, (%r14)
movq 0x10(%rsp), %rax
movl %r13d, (%rax)
movl %ebx, %ebp
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/cram/cram_io.c
// Function: uint7_decode_crc64
static int uint7_decode_crc64(cram_fd *fd, int64_t *val_p, uint32_t *crc) {
    uint8_t b[10], i = 0;
    int c;
    uint64_t v = 0;

#ifdef VARINT2
    b[0] = hgetc(fd->fp);
    if (b[0] < 177) {
    } else if (b[0] < 241) {
        b[1] = hgetc(fd->fp);
    } else if (b[0] < 249) {
        b[1] = hgetc(fd->fp);
        b[2] = hgetc(fd->fp);
    } else {
        int n = b[0]+2, z = 1;
        while (n-- >= 249)
            b[z++] = hgetc(fd->fp);
    }
    i = var_get_u64(b, NULL, &v);
#else
//    // Little endian
//    int s = 0;
//    do {
//        b[i++] = c = hgetc(fd->fp);
//        if (c < 0)
//            return -1;
//        v |= (c & 0x7f) << s;
//      s += 7;
//    } while (i < 10 && (c & 0x80));

    // Big endian, see also htscodecs/varint.h
    do {
        b[i++] = c = hgetc(fd->fp);
        if (c < 0)
            return -1;
        v = (v<<7) | (c & 0x7f);
    } while (i < 5 && (c & 0x80));
#endif
    *crc = crc32(*crc, b, i);

    *val_p = v;
    return i;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r14
movq %rsi, (%rsp)
movq %rdi, %r15
xorl %r12d, %r12d
pushq $-0x1
popq %rbp
xorl %r13d, %r13d
movq (%r15), %rdi
callq 0x3e519
movb %al, 0xe(%rsp,%r12)
testl %eax, %eax
js 0x46d19
leaq 0x1(%r12), %rbx
movq %r13, %rcx
shlq $0x7, %rcx
movl %eax, %r13d
andl $0x7f, %r13d
orq %rcx, %r13
cmpq $0x3, %r12
ja 0x46cfe
movq %rbx, %r12
andl $0x80, %eax
jne 0x46cc7
movl (%r14), %edi
leaq 0xe(%rsp), %rsi
movl %ebx, %edx
callq 0x4320
movl %eax, (%r14)
movq (%rsp), %rax
movq %r13, (%rax)
movl %ebx, %ebp
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/cram/cram_io.c
// Function: safe_itf8_get
static int64_t safe_itf8_get(char **cp, const char *endp, int *err) {
    const unsigned char *up = (unsigned char *)*cp;

    if (endp && endp - *cp < 5 &&
        (*cp >= endp || endp - *cp < itf8_bytes[up[0]>>4])) {
        if (err) *err = 1;
        return 0;
    }

    if (up[0] < 0x80) {
        (*cp)++;
        return up[0];
    } else if (up[0] < 0xc0) {
        (*cp)+=2;
        return ((up[0] <<8) |  up[1])                           & 0x3fff;
    } else if (up[0] < 0xe0) {
        (*cp)+=3;
        return ((up[0]<<16) | (up[1]<< 8) |  up[2])             & 0x1fffff;
    } else if (up[0] < 0xf0) {
        (*cp)+=4;
        uint32_t uv = (((uint32_t)up[0]<<24) | (up[1]<<16) | (up[2]<<8) | up[3]) & 0x0fffffff;
        return (int32_t)uv;
    } else {
        (*cp)+=5;
        uint32_t uv = (((uint32_t)up[0] & 0x0f)<<28) | (up[1]<<20) | (up[2]<<12) | (up[3]<<4) | (up[4] & 0x0f);
        return (int32_t)uv;
    }
}

// Assembly:
movq (%rdi), %rcx
testq %rsi, %rsi
je 0x46d67
movq %rsi, %rax
subq %rcx, %rax
cmpq $0x4, %rax
jg 0x46d67
cmpq %rsi, %rcx
jae 0x46d59
movzbl (%rcx), %esi
shrl $0x4, %esi
leaq 0x356f0(%rip), %r8      # 0x7c440
movslq (%r8,%rsi,4), %rsi
cmpq %rsi, %rax
jge 0x46d67
testq %rdx, %rdx
je 0x46d64
movl $0x1, (%rdx)
xorl %eax, %eax
retq
movb (%rcx), %al
testb %al, %al
js 0x46d78
leaq 0x1(%rcx), %rax
movq %rax, (%rdi)
movzbl (%rcx), %eax
retq
cmpb $-0x41, %al
ja 0x46d92
leaq 0x2(%rcx), %rax
movq %rax, (%rdi)
movzbl (%rcx), %eax
movzbl 0x1(%rcx), %ecx
andl $0x3f, %eax
shll $0x8, %eax
jmp 0x46ddf
cmpb $-0x21, %al
ja 0x46db5
leaq 0x3(%rcx), %rax
movq %rax, (%rdi)
movzbl (%rcx), %eax
movzbl 0x1(%rcx), %edx
shll $0x8, %edx
movzbl 0x2(%rcx), %ecx
andl $0x1f, %eax
shll $0x10, %eax
orl %edx, %eax
jmp 0x46ddf
cmpb $-0x11, %al
ja 0x46de3
leaq 0x4(%rcx), %rax
movq %rax, (%rdi)
movzbl (%rcx), %eax
movzbl 0x1(%rcx), %edx
shll $0x10, %edx
movzbl 0x2(%rcx), %esi
shll $0x8, %esi
movzbl 0x3(%rcx), %ecx
andl $0xf, %eax
shll $0x18, %eax
orl %edx, %eax
orl %esi, %eax
orq %rcx, %rax
retq
leaq 0x5(%rcx), %rax
movq %rax, (%rdi)
movzbl (%rcx), %eax
shll $0x1c, %eax
movzbl 0x1(%rcx), %edx
shll $0x14, %edx
cltq
orq %rdx, %rax
movzbl 0x2(%rcx), %edx
shll $0xc, %edx
orq %rax, %rdx
movzbl 0x3(%rcx), %esi
shll $0x4, %esi
orq %rdx, %rsi
movzbl 0x4(%rcx), %eax
andl $0xf, %eax
orq %rsi, %rax
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/../htscodecs/htscodecs/varint.h
// Function: var_get_u32
static inline
int var_get_u32(uint8_t *cp, const uint8_t *endp, uint32_t *i) {
    uint8_t *op = cp, c;
    uint32_t j = 0;

    if (!endp || endp - cp >= 6) {
        // Known maximum loop count helps optimiser.
        // NB: this helps considerably at -O3 level, but may harm -O2.
        // (However we optimise for those that want optimal code.)
        int n = 5;
        do {
            c = *cp++;
            j = (j<<7) | (c & 0x7f);
        } while ((c & 0x80) && n-- > 0);
    } else {
        if (cp >= endp) {
            *i = 0;
            return 0;
        }

        if (*cp < 128) {
            *i = *cp;
            return 1;
        }

        do {
            c = *cp++;
            j = (j<<7) | (c & 0x7f);
        } while ((c & 0x80) && cp < endp);
    }

    *i = j;
    return cp-op;
}

// Assembly:
testq %rsi, %rsi
setne %al
movq %rsi, %rcx
subq %rdi, %rcx
cmpq $0x6, %rcx
setl %cl
testb %cl, %al
jne 0x47097
xorl %esi, %esi
xorl %ecx, %ecx
movzbl (%rdi,%rsi), %r8d
movl %ecx, %eax
shll $0x7, %eax
movl %r8d, %ecx
andl $0x7f, %ecx
orl %eax, %ecx
leaq 0x1(%rsi), %rax
testb %r8b, %r8b
jns 0x4708f
cmpl $0x5, %esi
movq %rax, %rsi
jne 0x4706c
addq %rdi, %rax
movl %ecx, (%rdx)
subl %edi, %eax
retq
cmpq %rsi, %rdi
jae 0x470a9
movsbl (%rdi), %eax
testl %eax, %eax
js 0x470af
movl %eax, (%rdx)
pushq $0x1
popq %rax
retq
andl $0x0, (%rdx)
xorl %eax, %eax
retq
xorl %ecx, %ecx
movq %rdi, %rax
movzbl (%rax), %r8d
incq %rax
movl %ecx, %r9d
shll $0x7, %r9d
movl %r8d, %ecx
andl $0x7f, %ecx
orl %r9d, %ecx
testb %r8b, %r8b
jns 0x47092
cmpq %rsi, %rax
jb 0x470b4
jmp 0x47092
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/../htscodecs/htscodecs/varint.h
// Function: var_get_u64
static inline
int var_get_u64(uint8_t *cp, const uint8_t *endp, uint64_t *i) {
    uint8_t *op = cp, c;
    uint64_t j = 0;

    if (!endp || endp - cp >= 11) {
        int n = 10;
        do {
            c = *cp++;
            j = (j<<7) | (c & 0x7f);
        } while ((c & 0x80) && n-- > 0);
    } else {
        if (cp >= endp) {
            *i = 0;
            return 0;
        }

        do {
            c = *cp++;
            j = (j<<7) | (c & 0x7f);
        } while ((c & 0x80) && cp < endp);
    }

    *i = j;
    return cp-op;
}

// Assembly:
testq %rsi, %rsi
setne %al
movq %rsi, %rcx
subq %rdi, %rcx
cmpq $0xb, %rcx
setl %cl
testb %cl, %al
jne 0x47121
xorl %esi, %esi
xorl %ecx, %ecx
movzbl (%rdi,%rsi), %r8d
movq %rcx, %rax
shlq $0x7, %rax
movl %r8d, %ecx
andl $0x7f, %ecx
orq %rax, %rcx
leaq 0x1(%rsi), %rax
testb %r8b, %r8b
jns 0x47118
cmpl $0xa, %esi
movq %rax, %rsi
jne 0x470f2
addq %rdi, %rax
movq %rcx, (%rdx)
subl %edi, %eax
retq
cmpq %rsi, %rdi
jae 0x4714e
xorl %ecx, %ecx
movq %rdi, %rax
movzbl (%rax), %r8d
incq %rax
movq %rcx, %r9
shlq $0x7, %r9
movl %r8d, %ecx
andl $0x7f, %ecx
orq %r9, %rcx
testb %r8b, %r8b
jns 0x4711b
cmpq %rsi, %rax
jb 0x4712b
jmp 0x4711b
andq $0x0, (%rdx)
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/htscodecs/htscodecs/varint.h
// Function: var_put_u32
static inline
int var_put_u32(uint8_t *cp, const uint8_t *endp, uint32_t i) {
    if (endp && (endp-cp) < 5)
        return var_put_u32_safe(cp, endp, i);

    if (i < (1<<7)) {
        *cp = i;
        return 1;
    } else if (i < (1<<14)) {
        *cp++ = ((i>> 7) & 0x7f) | 128;
        *cp++ =   i      & 0x7f;
        return 2;
    } else if (i < (1<<21)) {
        *cp++ = ((i>>14) & 0x7f) | 128;
        *cp++ = ((i>> 7) & 0x7f) | 128;
        *cp++ =   i      & 0x7f;
        return 3;
    } else if (i < (1<<28)) {
        *cp++ = ((i>>21) & 0x7f) | 128;
        *cp++ = ((i>>14) & 0x7f) | 128;
        *cp++ = ((i>> 7) & 0x7f) | 128;
        *cp++ =   i      & 0x7f;
        return 4;
    } else {
        *cp++ = ((i>>28) & 0x7f) | 128;
        *cp++ = ((i>>21) & 0x7f) | 128;
        *cp++ = ((i>>14) & 0x7f) | 128;
        *cp++ = ((i>> 7) & 0x7f) | 128;
        *cp++ =   i      & 0x7f;
    }

    return 5;
}

// Assembly:
cmpl $0x7f, %esi
ja 0x5eec9
movb %sil, (%rdi)
pushq $0x1
jmp 0x5ef6c
movl %esi, %eax
cmpl $0x3fff, %esi           # imm = 0x3FFF
ja 0x5eee9
shrl $0x7, %eax
orb $-0x80, %al
movb %al, (%rdi)
andb $0x7f, %sil
movb %sil, 0x1(%rdi)
pushq $0x2
jmp 0x5ef6c
cmpl $0x1fffff, %esi         # imm = 0x1FFFFF
ja 0x5ef0e
shrl $0xe, %eax
orb $-0x80, %al
movb %al, (%rdi)
movl %esi, %eax
shrl $0x7, %eax
orb $-0x80, %al
movb %al, 0x1(%rdi)
andb $0x7f, %sil
movb %sil, 0x2(%rdi)
pushq $0x3
jmp 0x5ef6c
cmpl $0xfffffff, %esi        # imm = 0xFFFFFFF
ja 0x5ef3d
shrl $0x15, %eax
orb $-0x80, %al
movb %al, (%rdi)
movl %esi, %eax
shrl $0xe, %eax
orb $-0x80, %al
movb %al, 0x1(%rdi)
movl %esi, %eax
shrl $0x7, %eax
orb $-0x80, %al
movb %al, 0x2(%rdi)
andb $0x7f, %sil
movb %sil, 0x3(%rdi)
pushq $0x4
jmp 0x5ef6c
shrl $0x1c, %eax
orb $-0x80, %al
movb %al, (%rdi)
movl %esi, %eax
shrl $0x15, %eax
orb $-0x80, %al
movb %al, 0x1(%rdi)
movl %esi, %eax
shrl $0xe, %eax
orb $-0x80, %al
movb %al, 0x2(%rdi)
movl %esi, %eax
shrl $0x7, %eax
orb $-0x80, %al
movb %al, 0x3(%rdi)
andb $0x7f, %sil
movb %sil, 0x4(%rdi)
pushq $0x5
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/cram_stats.c
// Function: cram_stats_add
int cram_stats_add(cram_stats *st, int64_t val) {
    st->nsamp++;

    //assert(val >= 0);

    if (val < MAX_STAT_VAL && val >= 0) {
        st->freqs[val]++;
    } else {
        khint_t k;
        int r;

        if (!st->h) {
            st->h = kh_init(m_i2i);
            if (!st->h)
                return -1;
        }

        k = kh_put(m_i2i, st->h, val, &r);
        if (r == 0)
            kh_val(st->h, k)++;
        else if (r != -1)
            kh_val(st->h, k) = 1;
        else
            return -1;
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
incl 0x1008(%rdi)
cmpq $0x3ff, %rsi            # imm = 0x3FF
ja 0x47592
incl (%rbx,%r14,4)
jmp 0x4772d
movq 0x1000(%rbx), %r15
pushq $-0x1
popq %rbp
testq %r15, %r15
jne 0x475bf
pushq $0x1
popq %rdi
pushq $0x28
popq %rsi
callq 0x4300
movq %rax, %r15
movq %rax, 0x1000(%rbx)
testq %rax, %rax
je 0x4772f
movl 0x8(%r15), %eax
cmpl 0xc(%r15), %eax
jb 0x475ec
movl (%r15), %esi
movl 0x4(%r15), %eax
addl %eax, %eax
cmpl %eax, %esi
jbe 0x475da
decl %esi
jmp 0x475dc
incl %esi
movq %r15, %rdi
callq 0x47b7d
testl %eax, %eax
js 0x4772f
movl (%r15), %esi
leal -0x1(%rsi), %r8d
movq %r14, %rdi
shrq $0x21, %rdi
movl %r14d, %eax
shll $0xb, %eax
xorl %eax, %edi
xorl %r14d, %edi
andl %r8d, %edi
movq 0x10(%r15), %rax
movl %edi, %ecx
shrl $0x4, %ecx
movl (%rax,%rcx,4), %edx
leal (%rdi,%rdi), %ecx
shrl %cl, %edx
testb $0x2, %dl
je 0x47622
movl %edi, %edx
jmp 0x4769b
pushq $0x1
popq %r10
movl %edi, %r9d
movl %esi, %edx
movl %r9d, %ecx
shrl $0x4, %ecx
movl (%rax,%rcx,4), %r11d
leal (%r9,%r9), %ecx
andl $0x1e, %ecx
movl %r11d, %ebp
shrl %cl, %ebp
testb $0x2, %bpl
jne 0x4767b
testb $0x1, %bpl
jne 0x4765a
movq 0x18(%r15), %r12
movl %r9d, %r13d
cmpq %r14, (%r12,%r13,8)
je 0x4767b
btl %ecx, %r11d
cmovbl %r9d, %edx
addl %r10d, %r9d
andl %r8d, %r9d
incl %r10d
cmpl %edi, %r9d
jne 0x4762b
movb $0x1, %cl
movl %esi, %r8d
cmpl %esi, %edx
je 0x4768b
jmp 0x4769b
shrl %cl, %r11d
testb $0x2, %r11b
sete %cl
movl %edx, %r8d
movl %r9d, %edi
cmpl %esi, %r8d
cmovel %edi, %r8d
testb %cl, %cl
cmovnel %edi, %r8d
movl %r8d, %edx
movl %edx, %esi
shrl $0x4, %esi
movl (%rax,%rsi,4), %edi
leal (%rdx,%rdx), %ecx
andl $0x1e, %ecx
movl %edi, %r8d
shrl %cl, %r8d
testb $0x2, %r8b
jne 0x476cd
testb $0x1, %r8b
jne 0x476fd
movq 0x1000(%rbx), %rax
movq 0x20(%rax), %rax
movl %edx, %ecx
incl (%rax,%rcx,4)
jmp 0x4772d
movq 0x18(%r15), %r8
movl %edx, %edx
pushq $0x3
popq %r9
shll %cl, %r9d
movq %r14, (%r8,%rdx,8)
notl %r9d
andl %r9d, %edi
movl %edi, (%rax,%rsi,4)
movq 0x4(%r15), %xmm0
pcmpeqd %xmm1, %xmm1
psubd %xmm1, %xmm0
movq %xmm0, 0x4(%r15)
jmp 0x4771b
movq 0x18(%r15), %r8
pushq $0x3
popq %r9
shll %cl, %r9d
movl %edx, %edx
movq %r14, (%r8,%rdx,8)
notl %r9d
andl %r9d, %edi
movl %edi, (%rax,%rsi,4)
incl 0x4(%r15)
movq 0x1000(%rbx), %rax
movq 0x20(%rax), %rax
movl $0x1, (%rax,%rdx,4)
xorl %ebp, %ebp
movl %ebp, %eax
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/cram/cram_stats.c
// Function: cram_stats_del
void cram_stats_del(cram_stats *st, int64_t val) {
    st->nsamp--;

    //assert(val >= 0);

    if (val < MAX_STAT_VAL && val >= 0) {
        st->freqs[val]--;
        assert(st->freqs[val] >= 0);
    } else if (st->h) {
        khint_t k = kh_get(m_i2i, st->h, val);

        if (k != kh_end(st->h)) {
            if (--kh_val(st->h, k) == 0)
                kh_del(m_i2i, st->h, k);
        } else {
            hts_log_warning("Failed to remove val %"PRId64" from cram_stats", val);
            st->nsamp++;
        }
    } else {
        hts_log_warning("Failed to remove val %"PRId64" from cram_stats", val);
        st->nsamp++;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rax
movq %rdi, %rbx
decl 0x1008(%rdi)
cmpq $0x3ff, %rsi            # imm = 0x3FF
ja 0x4778a
movl (%rbx,%rax,4), %ecx
leal -0x1(%rcx), %edx
movl %edx, (%rbx,%rax,4)
testl %ecx, %ecx
jg 0x47830
leaq 0x35ee0(%rip), %rdi     # 0x7d654
leaq 0x35eed(%rip), %rsi     # 0x7d668
leaq 0x35ef8(%rip), %rcx     # 0x7d67a
pushq $0x57
popq %rdx
callq 0x42f0
movq 0x1000(%rbx), %rsi
testq %rsi, %rsi
je 0x4780f
movl (%rsi), %edi
testl %edi, %edi
je 0x47809
leal -0x1(%rdi), %r8d
movq %rax, %r9
shrq $0x21, %r9
movl %eax, %ecx
shll $0xb, %ecx
xorl %ecx, %r9d
xorl %eax, %r9d
andl %r8d, %r9d
movq 0x10(%rsi), %r10
pushq $0x1
popq %r11
movl %r9d, %edx
movl %edx, %ecx
shrl $0x4, %ecx
movl (%r10,%rcx,4), %ebp
leal (%rdx,%rdx), %ecx
andl $0x1e, %ecx
movl %ebp, %r14d
shrl %cl, %r14d
testb $0x2, %r14b
jne 0x477fe
testb $0x1, %r14b
jne 0x477ee
movq 0x18(%rsi), %r14
movl %edx, %r15d
cmpq %rax, (%r14,%r15,8)
je 0x477fe
addl %r11d, %edx
andl %r8d, %edx
incl %r11d
cmpl %r9d, %edx
jne 0x477c0
jmp 0x4780f
shrl %cl, %ebp
testb $0x3, %bpl
cmovnel %edi, %edx
jmp 0x4780b
xorl %edx, %edx
cmpl %edi, %edx
jne 0x4783b
leaq 0x35e8f(%rip), %rsi     # 0x7d6a5
leaq 0x35e97(%rip), %rdx     # 0x7d6b4
pushq $0x3
popq %rdi
movq %rax, %rcx
xorl %eax, %eax
callq 0x110c6
incl 0x1008(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x20(%rsi), %rax
movl %edx, %ecx
decl (%rax,%rcx,4)
jne 0x47830
cmpl %edx, (%rsi)
je 0x47830
movq 0x10(%rsi), %rax
movl %edx, %edi
shrl $0x4, %edi
movl (%rax,%rdi,4), %r8d
addl %edx, %edx
andl $0x1e, %edx
movl %r8d, %r9d
movl %edx, %ecx
shrl %cl, %r9d
testb $0x3, %r9b
jne 0x47830
btsl %edx, %r8d
movl %r8d, (%rax,%rdi,4)
decl 0x4(%rsi)
jmp 0x47830
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/mFILE.c
// Function: mstdin
mFILE *mstdin(void) {
    if (m_channel[0])
        return m_channel[0];

    m_channel[0] = mfcreate(NULL, 0);
    if (NULL == m_channel[0]) return NULL;
    m_channel[0]->fp = stdin;
    return m_channel[0];
}

// Assembly:
pushq %rbx
movq 0x572b0(%rip), %rbx     # 0x9f0d0
testq %rbx, %rbx
jne 0x47e4c
xorl %ebx, %ebx
xorl %edi, %edi
xorl %esi, %esi
callq 0x47e51
movq %rax, 0x57299(%rip)     # 0x9f0d0
testq %rax, %rax
je 0x47e4c
movq 0x5618d(%rip), %rcx     # 0x9dfd0
movq (%rcx), %rcx
movq %rcx, (%rax)
movq %rax, %rbx
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/mFILE.c
// Function: mfcreate
mFILE *mfcreate(char *data, int size) {
    mFILE *mf = (mFILE *)malloc(sizeof(*mf));
    if (NULL == mf) return NULL;
    mf->fp = NULL;
    mf->data = data;
    mf->alloced = size;
    mf->size = size;
    mf->eof = 0;
    mf->offset = 0;
    mf->flush_pos = 0;
    mf->mode = MF_READ | MF_WRITE;
    return mf;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
pushq $0x38
popq %rdi
callq 0x4680
testq %rax, %rax
je 0x47e8f
andq $0x0, (%rax)
movq %r14, 0x8(%rax)
movslq %ebx, %rcx
movq %rcx, 0x10(%rax)
movq %rcx, 0x20(%rax)
movabsq $0x300000000, %rcx      # imm = 0x300000000
movq %rcx, 0x18(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/mFILE.c
// Function: mstdout
mFILE *mstdout(void) {
    if (m_channel[1])
        return m_channel[1];

    m_channel[1] = mfcreate(NULL, 0);
    if (NULL == m_channel[1]) return NULL;
    m_channel[1]->fp = stdout;
    m_channel[1]->mode = MF_WRITE;
    return m_channel[1];
}

// Assembly:
pushq %rbx
movq 0x57241(%rip), %rbx     # 0x9f0e0
testq %rbx, %rbx
jne 0x47ed2
xorl %ebx, %ebx
xorl %edi, %edi
xorl %esi, %esi
callq 0x47e51
movq %rax, 0x5722a(%rip)     # 0x9f0e0
testq %rax, %rax
je 0x47ed2
movq 0x560ee(%rip), %rcx     # 0x9dfb0
movq (%rcx), %rcx
movq %rcx, (%rax)
movl $0x2, 0x1c(%rax)
movq %rax, %rbx
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/mFILE.c
// Function: mstderr
mFILE *mstderr(void) {
    if (m_channel[2])
        return m_channel[2];

    m_channel[2] = mfcreate(NULL, 0);
    if (NULL == m_channel[2]) return NULL;
    m_channel[2]->fp = stderr;
    m_channel[2]->mode = MF_WRITE;
    return m_channel[2];
}

// Assembly:
pushq %rbx
movq 0x57211(%rip), %rbx     # 0x9f0f0
testq %rbx, %rbx
jne 0x47f12
xorl %ebx, %ebx
xorl %edi, %edi
xorl %esi, %esi
callq 0x47e51
movq %rax, 0x571fa(%rip)     # 0x9f0f0
testq %rax, %rax
je 0x47f12
movq 0x560d6(%rip), %rcx     # 0x9dfd8
movq (%rcx), %rcx
movq %rcx, (%rax)
movl $0x2, 0x1c(%rax)
movq %rax, %rbx
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/mFILE.c
// Function: mfrecreate
void mfrecreate(mFILE *mf, char *data, int size) {
    if (mf->data)
        free(mf->data);
    mf->data = data;
    mf->size = size;
    mf->alloced = size;
    mf->eof = 0;
    mf->offset = 0;
    mf->flush_pos = 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movq 0x8(%rdi), %rdi
callq 0x45c0
movq %r14, 0x8(%r15)
movslq %ebx, %rax
movq %rax, 0x20(%r15)
movq %rax, 0x10(%r15)
andl $0x0, 0x18(%r15)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%r15)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/mFILE.c
// Function: mfload
static char *mfload(FILE *fp, const char *fn, size_t *size, int binary) {
    struct stat sb;
    char *data = NULL;
    size_t allocated = 0, used = 0;
    int bufsize = 8192;

#ifdef _WIN32
    if (binary)
        _setmode(_fileno(fp), _O_BINARY);
    else
        _setmode(_fileno(fp), _O_TEXT);
#endif

    if (fn && -1 != stat(fn, &sb)) {
        data = malloc(allocated = sb.st_size);
        if (!data)
            return NULL;
        bufsize = sb.st_size;
    } else {
        fn = NULL;
    }

    do {
        size_t len;
        if (used + bufsize > allocated) {
            allocated += bufsize;
            char *datan = realloc(data, allocated);
            if (datan) {
                data = datan;
            } else {
                free(data);
                return NULL;
            }
        }
        len = fread(data + used, 1, allocated - used, fp);
        if (len > 0)
            used += len;
    } while (!feof(fp) && (fn == NULL || used < sb.st_size));

    *size = used;

    return data;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rdx, %r15
movq %rdi, %r14
movb $0x1, %al
movl %eax, 0x4(%rsp)
movl $0x2000, %ebp           # imm = 0x2000
testq %rsi, %rsi
je 0x48173
leaq 0x18(%rsp), %rbx
movq %rsi, %rdi
movq %rbx, %rsi
callq 0x4420
movq 0x30(%rbx), %r12
cmpl $-0x1, %eax
je 0x4817c
movq %r12, %rdi
callq 0x4680
testq %rax, %rax
je 0x481f9
movq %rax, %rbx
movq %r15, 0x8(%rsp)
movslq %r12d, %rbp
movl $0x0, 0x4(%rsp)
movq %r12, 0x10(%rsp)
jmp 0x4818b
movq %r15, 0x8(%rsp)
xorl %ebx, %ebx
jmp 0x48188
movq %r12, 0x10(%rsp)
movq %r15, 0x8(%rsp)
xorl %ebx, %ebx
xorl %r12d, %r12d
xorl %r15d, %r15d
leaq (%r15,%rbp), %rax
cmpq %r12, %rax
jbe 0x481af
addq %rbp, %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0x4840
movq %rax, %r13
testq %rax, %rax
jne 0x481b2
jmp 0x481f1
movq %rbx, %r13
leaq (%r15,%r13), %rdi
movq %r12, %rdx
subq %r15, %rdx
pushq $0x1
popq %rsi
movq %r14, %rcx
callq 0x4790
addq %rax, %r15
movq %r14, %rdi
callq 0x47d0
cmpq 0x10(%rsp), %r15
setb %cl
testl %eax, %eax
jne 0x481e7
orb 0x4(%rsp), %cl
movq %r13, %rbx
jne 0x4818e
movq 0x8(%rsp), %rax
movq %r15, (%rax)
jmp 0x481fc
movq %rbx, %rdi
callq 0x45c0
xorl %r13d, %r13d
movq %r13, %rax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/mFILE.c
// Function: mfflush
int mfflush(mFILE *mf) {
    if (!mf->fp)
        return 0;

    /* FIXME: only do this when opened in write mode */
    if (mf == m_channel[1] || mf == m_channel[2]) {
        if (mf->flush_pos < mf->size) {
            size_t bytes = mf->size - mf->flush_pos;
            if (fwrite(mf->data + mf->flush_pos, 1, bytes, mf->fp) < bytes)
                return -1;
            if (0 != fflush(mf->fp))
                return -1;
        }

        /* Stdout & stderr are non-seekable streams so throw away the data */
        mf->offset = mf->size = mf->flush_pos = 0;
    }

    /* only flush when opened in write mode */
    if (mf->mode & MF_WRITE) {
        if (mf->flush_pos < mf->size) {
            size_t bytes = mf->size - mf->flush_pos;
            if (!(mf->mode & MF_MODEX)) {
                fseek(mf->fp, mf->flush_pos, SEEK_SET);
            }
            if (fwrite(mf->data + mf->flush_pos, 1, bytes, mf->fp) < bytes)
                return -1;
            if (0 != fflush(mf->fp))
                return -1;
        }
        if (ftell(mf->fp) != -1 &&
            ftruncate(fileno(mf->fp), ftell(mf->fp)) == -1)
            return -1;
        mf->flush_pos = mf->size;
    }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq (%rdi), %rcx
testq %rcx, %rcx
je 0x48371
movq %rdi, %r14
pushq $-0x1
popq %rbx
cmpq %rdi, 0x56e51(%rip)     # 0x9f0e0
je 0x4829a
cmpq %r14, 0x56e58(%rip)     # 0x9f0f0
jne 0x482de
movq 0x20(%r14), %r15
movq 0x30(%r14), %rdi
subq %rdi, %r15
jbe 0x482cf
addq 0x8(%r14), %rdi
pushq $0x1
popq %rsi
movq %r15, %rdx
callq 0x49b0
cmpq %r15, %rax
jb 0x48373
movq (%r14), %rdi
callq 0x45a0
testl %eax, %eax
jne 0x48373
leaq 0x20(%r14), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
andq $0x0, 0x10(%rax)
movl 0x1c(%r14), %edx
testb $0x2, %dl
je 0x48371
movq 0x30(%r14), %rax
movq (%r14), %rcx
movq 0x20(%r14), %r15
subq %rax, %r15
jbe 0x4833a
testb $0x20, %dl
jne 0x48314
movq %rcx, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x4540
movq (%r14), %rcx
movq 0x30(%r14), %rax
addq 0x8(%r14), %rax
pushq $0x1
popq %rsi
movq %rax, %rdi
movq %r15, %rdx
callq 0x49b0
cmpq %r15, %rax
jb 0x48373
movq (%r14), %rdi
callq 0x45a0
testl %eax, %eax
jne 0x48373
movq (%r14), %rcx
movq %rcx, %rdi
callq 0x4030
cmpq $-0x1, %rax
je 0x48369
movq (%r14), %rdi
callq 0x44f0
movl %eax, %ebp
movq (%r14), %rdi
callq 0x4030
movl %ebp, %edi
movq %rax, %rsi
callq 0x46b0
cmpl $-0x1, %eax
je 0x48373
movq 0x20(%r14), %rax
movq %rax, 0x30(%r14)
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/mFILE.c
// Function: mfdestroy
int mfdestroy(mFILE *mf) {
    if (!mf)
        return -1;

    if (mf->data)
        free(mf->data);
    free(mf);

    return 0;
}

// Assembly:
testq %rdi, %rdi
je 0x4839e
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x45c0
movq %rbx, %rdi
callq 0x45c0
xorl %eax, %eax
popq %rbx
retq
pushq $-0x1
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/mFILE.c
// Function: mfdetach
int mfdetach(mFILE *mf) {
    if (!mf)
        return -1;

    mfflush(mf);
    if (mf->mode & MF_MMAP)
        return -1;

    if (mf->fp) {
        fclose(mf->fp);
        mf->fp = NULL;
    }

    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
pushq $-0x1
popq %rbx
testq %rdi, %rdi
je 0x483d0
movq %rdi, %r14
callq 0x4826f
testb $0x40, 0x1c(%r14)
jne 0x483d0
movq (%r14), %rdi
xorl %ebx, %ebx
testq %rdi, %rdi
je 0x483d0
callq 0x44b0
andq $0x0, (%r14)
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/mFILE.c
// Function: mfsteal
void *mfsteal(mFILE *mf, size_t *size_out) {
    void *data;

    if (!mf) return NULL;

    data = mf->data;

    if (NULL != size_out) *size_out = mf->size;

    if (mfdetach(mf) != 0)
        return NULL;

    mf->data = NULL;
    mfdestroy(mf);

    return data;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x48402
movq %rdi, %r14
movq 0x8(%rdi), %rbx
testq %rsi, %rsi
je 0x483f6
movq 0x20(%r14), %rax
movq %rax, (%rsi)
movq %r14, %rdi
callq 0x483a2
testl %eax, %eax
je 0x48406
xorl %ebx, %ebx
jmp 0x48413
andq $0x0, 0x8(%r14)
movq %r14, %rdi
callq 0x48380
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/mFILE.c
// Function: mfseek
int mfseek(mFILE *mf, long offset, int whence) {
    switch (whence) {
    case SEEK_SET:
        mf->offset = offset;
        break;
    case SEEK_CUR:
        mf->offset += offset;
        break;
    case SEEK_END:
        mf->offset = mf->size + offset;
        break;
    default:
        errno = EINVAL;
        return -1;
    }

    mf->eof = 0;
    return 0;
}

// Assembly:
cmpl $0x2, %edx
je 0x48446
cmpl $0x1, %edx
je 0x48440
testl %edx, %edx
je 0x4844a
pushq %rax
callq 0x4050
movl $0x16, (%rax)
pushq $-0x1
popq %rax
addq $0x8, %rsp
retq
addq %rsi, 0x28(%rdi)
jmp 0x4844e
addq 0x20(%rdi), %rsi
movq %rsi, 0x28(%rdi)
andl $0x0, 0x18(%rdi)
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/mFILE.c
// Function: mfread
size_t mfread(void *ptr, size_t size, size_t nmemb, mFILE *mf) {
    size_t len;
    char *cptr = (char *)ptr;

    if (mf == m_channel[0]) init_mstdin();

    if (mf->size <= mf->offset)
        return 0;

    len = size * nmemb <= mf->size - mf->offset
        ? size * nmemb
        : mf->size - mf->offset;
    if (!size)
        return 0;

    memcpy(cptr, &mf->data[mf->offset], len);
    mf->offset += len;

    if (len != size * nmemb) {
        mf->eof = 1;
    }

    return len / size;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r12
cmpq %rcx, 0x56c2d(%rip)     # 0x9f0d0
jne 0x484aa
callq 0x48505
movq 0x20(%r14), %rbp
movq 0x28(%r14), %rsi
subq %rsi, %rbp
jbe 0x484f4
imulq %rbx, %r15
cmpq %rbp, %r15
movq %rbp, %r13
cmovbq %r15, %r13
testq %rbx, %rbx
je 0x484f4
addq 0x8(%r14), %rsi
movq %r12, %rdi
movq %r13, %rdx
callq 0x43c0
addq %r13, 0x28(%r14)
cmpq %rbp, %r15
jbe 0x484ea
movl $0x1, 0x18(%r14)
movq %r13, %rax
xorl %edx, %edx
divq %rbx
jmp 0x484f6
xorl %eax, %eax
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/cram/mFILE.c
// Function: init_mstdin
static void init_mstdin(void) {
    static int done_stdin = 0;
    if (done_stdin)
        return;

    m_channel[0]->data = mfload(stdin, NULL, &m_channel[0]->size, 1);
    m_channel[0]->mode = MF_READ;
    done_stdin = 1;
}

// Assembly:
cmpb $0x0, 0x56bec(%rip)     # 0x9f0f8
jne 0x48548
pushq %rax
movq 0x55aba(%rip), %rax     # 0x9dfd0
movq (%rax), %rdi
movq 0x56bb0(%rip), %rdx     # 0x9f0d0
addq $0x20, %rdx
xorl %esi, %esi
callq 0x48108
movq 0x56b9e(%rip), %rcx     # 0x9f0d0
movq %rax, 0x8(%rcx)
movl $0x1, 0x1c(%rcx)
movb $0x1, 0x56bb4(%rip)     # 0x9f0f8
addq $0x8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/mFILE.c
// Function: mfwrite
size_t mfwrite(void *ptr, size_t size, size_t nmemb, mFILE *mf) {
    if (!(mf->mode & MF_WRITE))
        return 0;

    /* Append mode => forced all writes to end of file */
    if (mf->mode & MF_APPEND)
        mf->offset = mf->size;

    /* Make sure we have enough room */
    while (size * nmemb + mf->offset > mf->alloced) {
        size_t new_alloced = mf->alloced ? mf->alloced * 2 : 1024;
        void * new_data = realloc(mf->data, new_alloced);
        if (NULL == new_data) return 0;
        mf->alloced = new_alloced;
        mf->data    = new_data;
    }

    /* Record where we need to reflush from */
    if (mf->offset < mf->flush_pos)
        mf->flush_pos = mf->offset;

    /* Copy the data over */
    memcpy(&mf->data[mf->offset], ptr, size * nmemb);
    mf->offset += size * nmemb;
    if (mf->size < mf->offset)
        mf->size = mf->offset;

    return nmemb;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl 0x1c(%rcx), %eax
testb $0x2, %al
jne 0x4856f
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rcx, %r14
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r12
testb $0x4, %al
je 0x48587
movq 0x20(%r14), %rax
movq %rax, 0x28(%r14)
imulq %rbx, %r15
movq 0x10(%r14), %r13
movl $0x400, %ebp            # imm = 0x400
movq 0x28(%r14), %rdi
leaq (%rdi,%r15), %rax
cmpq %r13, %rax
jbe 0x485c8
testq %r13, %r13
leaq (%r13,%r13), %r13
cmoveq %rbp, %r13
movq 0x8(%r14), %rdi
movq %r13, %rsi
callq 0x4840
testq %rax, %rax
je 0x4855b
movq %r13, 0x10(%r14)
movq %rax, 0x8(%r14)
jmp 0x48594
cmpq 0x30(%r14), %rdi
jae 0x485d2
movq %rdi, 0x30(%r14)
addq 0x8(%r14), %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x43c0
addq 0x28(%r14), %r15
movq %r15, 0x28(%r14)
cmpq %r15, 0x20(%r14)
jae 0x4855d
movq %r15, 0x20(%r14)
jmp 0x4855d
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/mFILE.c
// Function: mfgetc
int mfgetc(mFILE *mf) {
    if (mf == m_channel[0]) init_mstdin();
    if (mf->offset < mf->size) {
        return (unsigned char)mf->data[mf->offset++];
    }

    mf->eof = 1;
    return -1;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpq %rdi, 0x56ac9(%rip)     # 0x9f0d0
jne 0x4860e
callq 0x48505
movq 0x28(%rbx), %rax
cmpq 0x20(%rbx), %rax
jae 0x4862a
movq 0x8(%rbx), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, 0x28(%rbx)
movzbl (%rcx,%rax), %eax
jmp 0x48634
movl $0x1, 0x18(%rbx)
pushq $-0x1
popq %rax
popq %rbx
retq