LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/cram/cram_io.c
// Function: int32_get_blk
int int32_get_blk(cram_block *b, int32_t *val) {
    if (b->uncomp_size - BLOCK_SIZE(b) < 4)
        return -1;

    uint32_t v =
         ((uint32_t) b->data[b->byte  ])        |
        (((uint32_t) b->data[b->byte+1]) <<  8) |
        (((uint32_t) b->data[b->byte+2]) << 16) |
        (((uint32_t) b->data[b->byte+3]) << 24);
    // Avoid implementation-defined behaviour on negative values
    *val = v < 0x80000000U ? (int32_t) v : -((int32_t) (0xffffffffU - v)) - 1;
    BLOCK_SIZE(b) += 4;
    return 4;
}

// Assembly:
movslq 0x14(%rdi), %rdx
movq 0x30(%rdi), %rcx
subq %rcx, %rdx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq $0x4, %rdx
jb 0x4eb9e
movq 0x20(%rdi), %rax
movl (%rax,%rcx), %eax
movl %eax, (%rsi)
addq $0x4, %rcx
movq %rcx, 0x30(%rdi)
movl $0x4, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/cram/cram_io.c
// Function: int32_put_blk
int int32_put_blk(cram_block *b, int32_t val) {
    unsigned char cp[4];
    uint32_t v = val;
    cp[0] = ( v      & 0xff);
    cp[1] = ((v>>8)  & 0xff);
    cp[2] = ((v>>16) & 0xff);
    cp[3] = ((v>>24) & 0xff);

    BLOCK_APPEND(b, cp, 4);
    return 0;

 block_err:
    return -1;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
movq 0x28(%rdi), %rax
movq 0x30(%rdi), %r14
addq $0x4, %r14
cmpq %r14, %rax
ja 0x4ebed
leaq 0x320(%rax), %rcx
shrq $0x2, %rcx
addq %rcx, %rax
addq $0x320, %rax            # imm = 0x320
cmpq %r14, %rax
cmovaq %rax, %r14
movq 0x20(%rbx), %rdi
movq %r14, %rsi
callq 0x4840
testq %rax, %rax
je 0x4ec20
movq %r14, 0x28(%rbx)
movq %rax, 0x20(%rbx)
movl %ebp, %eax
shrl $0x8, %eax
movl %ebp, %ecx
shrl $0x10, %ecx
movl %ebp, %edx
shrl $0x18, %edx
movq 0x20(%rbx), %rsi
movq 0x30(%rbx), %rdi
movb %bpl, (%rsi,%rdi)
movb %al, 0x1(%rsi,%rdi)
movb %cl, 0x2(%rsi,%rdi)
movb %dl, 0x3(%rsi,%rdi)
addq $0x4, 0x30(%rbx)
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x4ec1b
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/cram/cram_io.c
// Function: cram_new_block
cram_block *cram_new_block(enum cram_content_type content_type,
                           int content_id) {
    cram_block *b = malloc(sizeof(*b));
    if (!b)
        return NULL;
    b->method = b->orig_method = RAW;
    b->content_type = content_type;
    b->content_id = content_id;
    b->comp_size = 0;
    b->uncomp_size = 0;
    b->data = NULL;
    b->alloc = 0;
    b->byte = 0;
    b->bit = 7; // MSB
    b->crc32 = 0;
    b->idx = 0;
    b->m = NULL;

    return b;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebx
movl %edi, %ebp
movl $0x50, %edi
callq 0x4680
testq %rax, %rax
je 0x4ee7f
xorl %ecx, %ecx
movq %rcx, (%rax)
movl %ebp, 0x8(%rax)
movl %ebx, 0xc(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, 0x20(%rax)
movq %rcx, 0x30(%rax)
movl $0x7, 0x38(%rax)
movq %rcx, 0x40(%rax)
jmp 0x4ee81
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/cram/cram_io.c
// Function: int32_decode
static int int32_decode(cram_fd *fd, int32_t *val) {
    int32_t i;
    if (4 != hread(fd->fp, &i, 4))
        return -1;

    *val = le_int4(i);
    return 4;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq (%rdi), %r15
movq 0x8(%r15), %r12
movq 0x10(%r15), %r13
subq %r12, %r13
cmpq $0x4, %r13
movl $0x4, %r14d
cmovbq %r13, %r14
leaq 0xc(%rsp), %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x43c0
addq %r14, %r12
movq %r12, 0x8(%r15)
cmpq $0x3, %r13
ja 0x4f0f2
testb $0x2, 0x30(%r15)
je 0x4f0f2
leaq 0xc(%rsp), %rsi
movl $0x4, %edx
movq %r15, %rdi
movq %r14, %rcx
callq 0xf2cd
movq %rax, %r14
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq $0x4, %r14
jne 0x4f108
movl 0xc(%rsp), %eax
movl %eax, (%rbx)
movl $0x4, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/cram/cram_io.c
// Function: int32_encode
static int int32_encode(cram_fd *fd, int32_t val) {
    uint32_t v = le_int4(val);
    if (4 != hwrite(fd->fp, &v, 4))
        return -1;

    return 4;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %esi, 0xc(%rsp)
movq (%rdi), %rbx
testb $0x2, 0x30(%rbx)
jne 0x4f7b1
movq 0x18(%rbx), %rsi
movq %rsi, %rax
subq 0x8(%rbx), %rax
cmpq $0x3, %rax
ja 0x4f7b1
subq (%rbx), %rsi
addq $0x4, %rsi
movq %rbx, %rdi
callq 0xefdd
movq 0x18(%rbx), %rax
movq %rax, 0x10(%rbx)
movq 0x8(%rbx), %rdi
movq 0x18(%rbx), %r15
subq %rdi, %r15
cmpq $0x4, %r15
ja 0x4f7c7
cmpq (%rbx), %rdi
je 0x4f7fe
cmpq $0x4, %r15
movl $0x4, %r14d
cmovbq %r15, %r14
leaq 0xc(%rsp), %rsi
movq %r14, %rdx
callq 0x43c0
addq %r14, 0x8(%rbx)
cmpq $0x3, %r15
ja 0x4f815
leaq 0xc(%rsp), %rsi
movl $0x4, %edx
movq %rbx, %rdi
movq %r14, %rcx
jmp 0x4f80d
leaq 0xc(%rsp), %rsi
movl $0x4, %edx
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0xf4c6
movq %rax, %r14
xorl %eax, %eax
cmpq $0x4, %r14
sete %al
leal (%rax,%rax,4), %eax
decl %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/cram/cram_io.c
// Function: cram_free_block
void cram_free_block(cram_block *b) {
    if (!b)
        return;
    if (b->data)
        free(b->data);
    free(b);
}

// Assembly:
testq %rdi, %rdi
je 0x4f84d
pushq %rbx
movq %rdi, %rbx
movq 0x20(%rdi), %rdi
testq %rdi, %rdi
je 0x4f844
callq 0x45c0
movq %rbx, %rdi
popq %rbx
jmp 0x45c0
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/cram/cram_io.c
// Function: cram_new_metrics
cram_metrics *cram_new_metrics(void) {
    cram_metrics *m = calloc(1, sizeof(*m));
    if (!m)
        return NULL;
    m->trial = NTRIALS-1;
    m->next_trial = TRIAL_SPAN/2; // learn quicker at start
    m->method = RAW;
    m->strat = 0;
    m->revised_method = 0;
    m->unpackable = 0;

    return m;
}

// Assembly:
pushq %rax
movl $0x1, %edi
movl $0x228, %esi            # imm = 0x228
callq 0x4300
movq %rax, %rcx
xorl %eax, %eax
testq %rcx, %rcx
je 0x507b0
movabsq $0x2300000002, %rdx     # imm = 0x2300000002
movq %rdx, (%rcx)
movq $0x0, 0x94(%rcx)
movl %eax, 0x9c(%rcx)
movl %eax, 0x220(%rcx)
movq %rcx, %rax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/cram/cram_io.c
// Function: refs_free
void refs_free(refs_t *r) {
    RP("refs_free()\n");

    if (--r->count > 0)
        return;

    if (!r)
        return;

    if (r->pool)
        string_pool_destroy(r->pool);

    if (r->h_meta) {
        khint_t k;

        for (k = kh_begin(r->h_meta); k != kh_end(r->h_meta); k++) {
            ref_entry *e;

            if (!kh_exist(r->h_meta, k))
                continue;
            if (!(e = kh_val(r->h_meta, k)))
                continue;
            ref_entry_free_seq(e);
            free(e);
        }

        kh_destroy(refs, r->h_meta);
    }

    if (r->ref_id)
        free(r->ref_id);

    if (r->fp)
        bgzf_close(r->fp);

    pthread_mutex_destroy(&r->lock);

    free(r);
}

// Assembly:
movl 0x30(%rdi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x30(%rdi)
cmpl $0x2, %eax
setge %al
testq %rdi, %rdi
sete %cl
orb %al, %cl
jne 0x508d6
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x5081f
callq 0x5a947
cmpq $0x0, 0x8(%rbx)
je 0x5089f
movq 0x8(%rbx), %r14
cmpl $0x0, (%r14)
je 0x5087c
xorl %ebp, %ebp
xorl %r15d, %r15d
movq 0x10(%r14), %rax
movl %r15d, %ecx
shrl $0x4, %ecx
movl (%rax,%rcx,4), %eax
movl %ebp, %ecx
andb $0x1e, %cl
shrl %cl, %eax
testb $0x3, %al
jne 0x5086d
movq 0x20(%r14), %rax
movl %r15d, %ecx
movq (%rax,%rcx,8), %r14
testq %r14, %r14
je 0x5086d
movq %r14, %rdi
callq 0x508d7
movq %r14, %rdi
callq 0x45c0
incl %r15d
movq 0x8(%rbx), %r14
addl $0x2, %ebp
cmpl (%r14), %r15d
jne 0x50835
movq 0x18(%r14), %rdi
callq 0x45c0
movq 0x10(%r14), %rdi
callq 0x45c0
movq 0x20(%r14), %rdi
callq 0x45c0
movq %r14, %rdi
callq 0x45c0
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x508ad
callq 0x45c0
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x508bb
callq 0xd4a4
leaq 0x38(%rbx), %rdi
callq 0x4590
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x45c0
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/cram/cram_io.c
// Function: ref_entry_free_seq
static void ref_entry_free_seq(ref_entry *e) {
    if (e->mf)
        mfclose(e->mf);
    if (e->seq && !e->mf)
        free(e->seq);

    e->seq = NULL;
    e->mf = NULL;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x40(%rdi), %rdi
testq %rdi, %rdi
je 0x508ec
callq 0x59884
leaq 0x38(%rbx), %r14
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0x50905
cmpq $0x0, 0x40(%rbx)
jne 0x50905
callq 0x45c0
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/cram/cram_io.c
// Function: refs2id
int refs2id(refs_t *r, sam_hdr_t *hdr) {
    int i;
    sam_hrecs_t *h = hdr->hrecs;

    if (r->ref_id)
        free(r->ref_id);
    if (r->last)
        r->last = NULL;

    r->ref_id = calloc(h->nref, sizeof(*r->ref_id));
    if (!r->ref_id)
        return -1;

    r->nref = h->nref;
    for (i = 0; i < h->nref; i++) {
        khint_t k = kh_get(refs, r->h_meta, h->ref[i].name);
        if (k != kh_end(r->h_meta)) {
            r->ref_id[i] = kh_val(r->h_meta, k);
        } else {
            hts_log_warning("Unable to find ref name '%s'", h->ref[i].name);
        }
    }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %r14
movq 0x38(%rsi), %r15
movq 0x10(%rdi), %rdi
testq %rdi, %rdi
je 0x50937
callq 0x45c0
cmpq $0x0, 0x60(%r14)
je 0x50946
movq $0x0, 0x60(%r14)
movl 0x28(%r15), %ebx
movslq %ebx, %rdi
movl $0x8, %esi
callq 0x4300
movq %rax, 0x10(%r14)
testq %rax, %rax
je 0x50ac4
movl %ebx, 0x18(%r14)
cmpl $0x0, 0x28(%r15)
jle 0x50ac0
xorl %r12d, %r12d
movq %r14, 0x10(%rsp)
movq %r15, 0x8(%rsp)
movq 0x8(%r14), %rdx
movq 0x30(%r15), %rax
leaq (%r12,%r12,2), %rcx
movq (%rax,%rcx,8), %r8
movq %rdx, (%rsp)
movl (%rdx), %edx
movl $0x0, %ebx
testl %edx, %edx
je 0x50a77
movb (%r8), %cl
testb %cl, %cl
movq %r12, 0x20(%rsp)
je 0x509d1
leaq 0x1(%r8), %rax
movl $0x811c9dc5, %r13d      # imm = 0x811C9DC5
movzbl %cl, %ecx
xorl %r13d, %ecx
imull $0x1000193, %ecx, %r13d # imm = 0x1000193
movb (%rax), %cl
incq %rax
testb %cl, %cl
jne 0x509b9
jmp 0x509d7
movl $0x811c9dc5, %r13d      # imm = 0x811C9DC5
movq %rdx, 0x18(%rsp)
leal -0x1(%rdx), %r15d
andl %r15d, %r13d
movq (%rsp), %rax
movq 0x10(%rax), %rsi
movl $0x1, %r14d
movl %r13d, %ebx
movq %r8, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movl %ebx, %eax
shrl $0x4, %eax
movl (%rsi,%rax,4), %r12d
leal (%rbx,%rbx), %ebp
andl $0x1e, %ebp
movl %r12d, %eax
movl %ebp, %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0x50a57
testb $0x1, %al
jne 0x50a40
movq (%rsp), %rax
movq 0x18(%rax), %rax
movl %ebx, %ecx
movq (%rax,%rcx,8), %rdi
movq %r8, %rsi
callq 0x46c0
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %r8
testl %eax, %eax
je 0x50a57
addl %r14d, %ebx
andl %r15d, %ebx
incl %r14d
cmpl %r13d, %ebx
jne 0x509fe
movq 0x18(%rsp), %rdx
movl %edx, %ebx
jmp 0x50a68
movl %ebp, %ecx
shrl %cl, %r12d
testb $0x3, %r12b
movq 0x18(%rsp), %rdx
cmovnel %edx, %ebx
movq 0x10(%rsp), %r14
movq 0x8(%rsp), %r15
movq 0x20(%rsp), %r12
cmpl %edx, %ebx
jne 0x50a9a
movl $0x3, %edi
leaq 0x4d39e(%rip), %rsi     # 0x9de25
leaq 0x4d39f(%rip), %rdx     # 0x9de2d
movq %r8, %rcx
xorl %eax, %eax
callq 0x14378
jmp 0x50ab0
movq (%rsp), %rax
movq 0x20(%rax), %rax
movl %ebx, %ecx
movq (%rax,%rcx,8), %rax
movq 0x10(%r14), %rcx
movq %rax, (%rcx,%r12,8)
incq %r12
movslq 0x28(%r15), %rax
cmpq %rax, %r12
jl 0x50980
xorl %eax, %eax
jmp 0x50ac9
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/cram/cram_io.c
// Function: cram_set_header2
int cram_set_header2(cram_fd *fd, const sam_hdr_t *hdr) {
    if (!fd || !hdr )
        return -1;

    if (fd->header != hdr) {
        if (fd->header)
            sam_hdr_destroy(fd->header);
        fd->header = sam_hdr_dup(hdr);
        if (!fd->header)
            return -1;
    }
    return refs_from_header(fd);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0x50b22
movq %rsi, %r14
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
cmpq %rsi, %rdi
je 0x50b16
testq %rdi, %rdi
je 0x50b05
callq 0x22ae6
movq %r14, %rdi
callq 0x22c39
movq %rax, 0x18(%rbx)
testq %rax, %rax
je 0x50b22
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x50b2f
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/cram/cram_io.c
// Function: bgzf_open_ref
static BGZF *bgzf_open_ref(char *fn, char *mode, int is_md5) {
    BGZF *fp;

    if (strncmp(fn, "file://", 7) == 0)
        fn += 7;

    if (!is_md5 && !hisremote(fn)) {
        char fai_file[PATH_MAX];

        snprintf(fai_file, PATH_MAX, "%s.fai", fn);
        if (access(fai_file, R_OK) != 0)
            if (fai_build(fn) != 0)
                return NULL;
    }

    if (!(fp = bgzf_open(fn, mode))) {
        perror(fn);
        return NULL;
    }

    if (fp->is_compressed == 1 && bgzf_index_load(fp, fn, ".gzi") < 0) {
        hts_log_error("Unable to load .gzi index '%s.gzi'", fn);
        bgzf_close(fp);
        return NULL;
    }

    return fp;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x1000, %rsp           # imm = 0x1000
movl %esi, %ebp
movq %rdi, %r14
leaq 0x4d2ed(%rip), %rsi     # 0x9e3bb
movl $0x7, %edx
callq 0x4210
leaq 0x7(%r14), %rbx
testl %eax, %eax
cmovneq %r14, %rbx
testl %ebp, %ebp
jne 0x510f2
movq %rbx, %rdi
callq 0x103cd
testl %eax, %eax
je 0x51154
leaq 0x4a4cb(%rip), %rsi     # 0x9b5c4
movq %rbx, %rdi
callq 0xa4a5
testq %rax, %rax
je 0x51196
movq %rax, %r14
testb $0x40, 0x3(%rax)
je 0x511a1
leaq 0x52dba(%rip), %rdx     # 0xa3ed8
movq %r14, %rdi
movq %rbx, %rsi
callq 0xe51c
testl %eax, %eax
jns 0x511a1
leaq 0x4d296(%rip), %rsi     # 0x9e3ca
leaq 0x4d29d(%rip), %rdx     # 0x9e3d8
movl $0x1, %edi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x14378
movq %r14, %rdi
callq 0xd4a4
jmp 0x5119e
leaq 0x4d268(%rip), %rdx     # 0x9e3c3
movq %rsp, %r14
movl $0x1000, %esi           # imm = 0x1000
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x4800
movq %r14, %rdi
movl $0x4, %esi
callq 0x4880
testl %eax, %eax
je 0x510f2
movq %rbx, %rdi
callq 0x847c1
testl %eax, %eax
jne 0x5119e
jmp 0x510f2
movq %rbx, %rdi
callq 0x43d0
xorl %r14d, %r14d
movq %r14, %rax
addq $0x1000, %rsp           # imm = 0x1000
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/cram/cram_io.c
// Function: cram_load_reference
int cram_load_reference(cram_fd *fd, char *fn) {
    int ret = 0;

    if (fn) {
        fd->refs = refs_load_fai(fd->refs, fn,
                                 !(fd->embed_ref>0 && fd->mode == 'r'));
        fn = fd->refs ? fd->refs->fn : NULL;
        if (!fn)
            ret = -1;
        sanitise_SQ_lines(fd);
    }
    fd->ref_fn = fn;

    if ((!fd->refs || (fd->refs->nref == 0 && !fn)) && fd->header) {
        if (fd->refs)
            refs_free(fd->refs);
        if (!(fd->refs = refs_create()))
            return -1;
        if (-1 == refs_from_header(fd))
            return -1;
    }

    if (fd->header)
        if (-1 == refs2id(fd->refs, fd->header))
            return -1;

    return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
testq %rsi, %rsi
je 0x51f17
movq 0x50(%rbx), %rdi
cmpl $0x0, 0x220(%rbx)
jle 0x51f1f
xorl %edx, %edx
cmpl $0x72, 0x8(%rbx)
setne %dl
jmp 0x51f24
xorl %r15d, %r15d
xorl %r14d, %r14d
jmp 0x51f4d
movl $0x1, %edx
callq 0x51fc7
movq %rax, 0x50(%rbx)
xorl %r14d, %r14d
testq %rax, %rax
je 0x51f3b
movq 0x20(%rax), %r15
jmp 0x51f3e
xorl %r15d, %r15d
cmpq $0x1, %r15
sbbl %r14d, %r14d
movq %rbx, %rdi
callq 0x524ec
movq %r15, 0x80(%rbx)
movq 0x50(%rbx), %rdi
testq %rdi, %rdi
je 0x51f68
testq %r15, %r15
jne 0x51f99
cmpl $0x0, 0x18(%rdi)
jne 0x51f99
cmpq $0x0, 0x18(%rbx)
je 0x51f99
testq %rdi, %rdi
je 0x51f79
callq 0x507eb
callq 0x52713
movq %rax, 0x50(%rbx)
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x51fba
movq %rbx, %rdi
callq 0x50b2f
cmpl $-0x1, %eax
je 0x51fba
movq 0x18(%rbx), %rsi
testq %rsi, %rsi
je 0x51fb0
movq 0x50(%rbx), %rdi
callq 0x50914
cmpl $-0x1, %eax
je 0x51fb5
movl %r14d, %ebp
jmp 0x51fba
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/cram/cram_io.c
// Function: refs_create
static refs_t *refs_create(void) {
    refs_t *r = calloc(1, sizeof(*r));

    RP("refs_create()\n");

    if (!r)
        return NULL;

    if (!(r->pool = string_pool_create(8192)))
        goto err;

    r->ref_id = NULL; // see refs2id() to populate.
    r->count = 1;
    r->last = NULL;
    r->last_id = -1;

    if (!(r->h_meta = kh_init(refs)))
        goto err;

    pthread_mutex_init(&r->lock, NULL);

    return r;

 err:
    refs_free(r);
    return NULL;
}

// Assembly:
pushq %rbx
movl $0x1, %edi
movl $0x70, %esi
callq 0x4300
testq %rax, %rax
je 0x52785
movq %rax, %rbx
movl $0x2000, %edi           # imm = 0x2000
callq 0x5a90c
movq %rax, (%rbx)
testq %rax, %rax
je 0x5277d
xorl %eax, %eax
movq %rax, 0x10(%rbx)
movl $0x1, 0x30(%rbx)
movq %rax, 0x60(%rbx)
movl $0xffffffff, 0x68(%rbx) # imm = 0xFFFFFFFF
movl $0x1, %edi
movl $0x28, %esi
callq 0x4300
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x5277d
movq %rbx, %rdi
addq $0x38, %rdi
xorl %esi, %esi
callq 0x4780
jmp 0x52787
movq %rbx, %rdi
callq 0x507eb
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/cram/cram_io.c
// Function: cram_new_container
cram_container *cram_new_container(int nrec, int nslice) {
    cram_container *c = calloc(1, sizeof(*c));
    enum cram_DS_ID id;

    if (!c)
        return NULL;

    c->curr_ref = -2;

    c->max_c_rec = nrec * nslice;
    c->curr_c_rec = 0;

    c->max_rec = nrec;
    c->record_counter = 0;
    c->num_bases = 0;
    c->s_num_bases = 0;

    c->max_slice = nslice;
    c->curr_slice = 0;

    c->pos_sorted = 1;
    c->max_apos   = 0;
    c->multi_seq  = 0;
    c->qs_seq_orient = 1;
    c->no_ref = 0;
    c->embed_ref = -1; // automatic selection

    c->bams = NULL;

    if (!(c->slices = calloc(nslice != 0 ? nslice : 1, sizeof(cram_slice *))))
        goto err;
    c->slice = NULL;

    if (!(c->comp_hdr = cram_new_compression_header()))
        goto err;
    c->comp_hdr_block = NULL;

    for (id = DS_RN; id < DS_TN; id++)
        if (!(c->stats[id] = cram_stats_create())) goto err;

    //c->aux_B_stats = cram_stats_create();

    if (!(c->tags_used = kh_init(m_tagmap)))
        goto err;
    c->refs_used = 0;
    c->ref_free = 0;

    return c;

 err:
    if (c) {
        if (c->slices)
            free(c->slices);
        free(c);
    }
    return NULL;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movl %edi, %r14d
movl $0x1, %edi
movl $0x2a0, %esi            # imm = 0x2A0
callq 0x4300
movq %rax, %rbx
xorl %eax, %eax
testq %rbx, %rbx
je 0x528b4
movl $0xfffffffe, 0x78(%rbx) # imm = 0xFFFFFFFE
movl %ebp, %ecx
imull %r14d, %ecx
movl %ecx, 0x6c(%rbx)
movl %eax, 0x70(%rbx)
movl %r14d, 0x64(%rbx)
movq %rax, 0x288(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rbx)
movl %ebp, 0x58(%rbx)
movl %eax, 0x5c(%rbx)
movl $0x1, %ecx
movl %ecx, 0x98(%rbx)
movq %rax, 0xa0(%rbx)
movl %eax, 0xac(%rbx)
movl %ecx, 0xb4(%rbx)
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq %rdx, 0xe8(%rbx)
movq %rax, 0xf0(%rbx)
cmpl %ecx, %ebp
adcl %eax, %ebp
movslq %ebp, %rdi
movl $0x8, %esi
callq 0x4300
movq %rax, 0x88(%rbx)
testq %rax, %rax
je 0x5289b
movq $0x0, 0x90(%rbx)
callq 0x528be
movq %rax, 0x48(%rbx)
testq %rax, %rax
je 0x5289b
movq $0x0, 0x50(%rbx)
movl $0x2a, %r14d
callq 0x589ac
movq %rax, (%rbx,%r14,8)
testq %rax, %rax
je 0x5289b
incq %r14
cmpq $0x46, %r14
jne 0x52852
movl $0x1, %edi
movl $0x28, %esi
callq 0x4300
movq %rax, 0x270(%rbx)
testq %rax, %rax
je 0x5289b
movq $0x0, 0x278(%rbx)
movl $0x0, 0x29c(%rbx)
jmp 0x528b6
movq 0x88(%rbx), %rdi
testq %rdi, %rdi
je 0x528ac
callq 0x45c0
movq %rbx, %rdi
callq 0x45c0
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/cram/cram_io.c
// Function: cram_new_compression_header
cram_block_compression_hdr *cram_new_compression_header(void) {
    cram_block_compression_hdr *hdr = calloc(1, sizeof(*hdr));
    if (!hdr)
        return NULL;

    if (!(hdr->TD_blk = cram_new_block(CORE, 0))) {
        free(hdr);
        return NULL;
    }

    if (!(hdr->TD_hash = kh_init(m_s2i))) {
        cram_free_block(hdr->TD_blk);
        free(hdr);
        return NULL;
    }

    if (!(hdr->TD_keys = string_pool_create(8192))) {
        kh_destroy(m_s2i, hdr->TD_hash);
        cram_free_block(hdr->TD_blk);
        free(hdr);
        return NULL;
    }

    return hdr;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl $0x1, %edi
movl $0x418, %esi            # imm = 0x418
callq 0x4300
testq %rax, %rax
je 0x52953
movq %rax, %rbx
movl $0x5, %edi
xorl %esi, %esi
callq 0x4ee42
movq %rax, 0x50(%rbx)
testq %rax, %rax
je 0x5294b
movq %rax, %r14
movl $0x1, %edi
movl $0x28, %esi
callq 0x4300
movq %rax, 0x68(%rbx)
testq %rax, %rax
je 0x52943
movq %rax, %r15
movl $0x2000, %edi           # imm = 0x2000
callq 0x5a90c
movq %rax, 0x70(%rbx)
testq %rax, %rax
jne 0x52955
movq 0x18(%r15), %rdi
callq 0x45c0
movq 0x10(%r15), %rdi
callq 0x45c0
movq 0x20(%r15), %rdi
callq 0x45c0
movq %r15, %rdi
callq 0x45c0
movq %r14, %rdi
callq 0x4f82d
movq %rbx, %rdi
callq 0x45c0
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/cram/cram_io.c
// Function: cram_free_compression_header
void cram_free_compression_header(cram_block_compression_hdr *hdr) {
    int i;

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

    if (hdr->preservation_map)
        kh_destroy(map, hdr->preservation_map);

    for (i = 0; i < CRAM_MAP_HASH; i++) {
        cram_map *m, *m2;
        for (m = hdr->rec_encoding_map[i]; m; m = m2) {
            m2 = m->next;
            if (m->codec)
                m->codec->free(m->codec);
            free(m);
        }
    }

    for (i = 0; i < CRAM_MAP_HASH; i++) {
        cram_map *m, *m2;
        for (m = hdr->tag_encoding_map[i]; m; m = m2) {
            m2 = m->next;
            if (m->codec)
                m->codec->free(m->codec);
            free(m);
        }
    }

    for (i = 0; i < DS_END; i++) {
        if (hdr->codecs[i])
            hdr->codecs[i]->free(hdr->codecs[i]);
    }

    if (hdr->TL)
        free(hdr->TL);
    if (hdr->TD_blk)
        cram_free_block(hdr->TD_blk);
    if (hdr->TD_hash)
        kh_destroy(m_s2i, hdr->TD_hash);
    if (hdr->TD_keys)
        string_pool_destroy(hdr->TD_keys);

    free(hdr);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x20(%rdi), %rdi
testq %rdi, %rdi
je 0x52b3b
callq 0x45c0
movq 0x78(%rbx), %r14
testq %r14, %r14
je 0x52b67
movq 0x18(%r14), %rdi
callq 0x45c0
movq 0x10(%r14), %rdi
callq 0x45c0
movq 0x20(%r14), %rdi
callq 0x45c0
movq %r14, %rdi
callq 0x45c0
xorl %r15d, %r15d
movq 0x80(%rbx,%r15,8), %r14
testq %r14, %r14
je 0x52b97
movq 0x10(%r14), %rdi
movq 0x18(%r14), %r12
testq %rdi, %rdi
je 0x52b87
callq *0x20(%rdi)
movq %r14, %rdi
callq 0x45c0
movq %r12, %r14
testq %r12, %r12
jne 0x52b77
incq %r15
cmpq $0x20, %r15
jne 0x52b6a
xorl %r15d, %r15d
movq 0x180(%rbx,%r15,8), %r14
testq %r14, %r14
je 0x52bd0
movq 0x10(%r14), %rdi
movq 0x18(%r14), %r12
testq %rdi, %rdi
je 0x52bc0
callq *0x20(%rdi)
movq %r14, %rdi
callq 0x45c0
movq %r12, %r14
testq %r12, %r12
jne 0x52bb0
incq %r15
cmpq $0x20, %r15
jne 0x52ba3
movl $0x50, %r14d
movq (%rbx,%r14,8), %rdi
testq %rdi, %rdi
je 0x52beb
callq *0x20(%rdi)
incq %r14
cmpq $0x7f, %r14
jne 0x52bdf
movq 0x60(%rbx), %rdi
testq %rdi, %rdi
je 0x52c02
callq 0x45c0
movq 0x50(%rbx), %rdi
testq %rdi, %rdi
je 0x52c10
callq 0x4f82d
movq 0x68(%rbx), %r14
testq %r14, %r14
je 0x52c3c
movq 0x18(%r14), %rdi
callq 0x45c0
movq 0x10(%r14), %rdi
callq 0x45c0
movq 0x20(%r14), %rdi
callq 0x45c0
movq %r14, %rdi
callq 0x45c0
movq 0x70(%rbx), %rdi
testq %rdi, %rdi
je 0x52c4a
callq 0x5a947
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x45c0
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/cram/cram_io.c
// Function: free_bam_list
static void free_bam_list(bam_seq_t **bams, int max_rec) {
    int i;
    for (i = 0; i < max_rec; i++)
        bam_free(bams[i]);

    free(bams);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
testl %esi, %esi
jle 0x52e59
movl %esi, %r14d
xorl %r15d, %r15d
movq (%rbx,%r15,8), %rdi
callq 0x23544
incq %r15
cmpq %r15, %r14
jne 0x52e48
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x45c0
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/cram/cram_io.c
// Function: reset_metrics
void reset_metrics(cram_fd *fd) {
    int i;

    if (fd->pool) {
        // If multi-threaded we have multiple blocks being
        // compressed already and several on the to-do list
        // (fd->rqueue->pending).  It's tricky to reset the
        // metrics exactly the correct point, so instead we
        // just flush the pool, reset, and then continue again.

        // Don't bother starting a new trial before then though.
        for (i = 0; i < DS_END; i++) {
            cram_metrics *m = fd->m[i];
            if (!m)
                continue;
            m->next_trial = 999;
        }

        pthread_mutex_unlock(&fd->metrics_lock);
        hts_tpool_process_flush(fd->rqueue);
        pthread_mutex_lock(&fd->metrics_lock);
    }

    for (i = 0; i < DS_END; i++) {
        cram_metrics *m = fd->m[i];
        if (!m)
            continue;

        m->trial = NTRIALS;
        m->next_trial = TRIAL_SPAN;
        m->revised_method = 0;
        m->unpackable = 0;

        memset(m->sz, 0, sizeof(m->sz));
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0x0, 0x88b8(%rdi)
je 0x53afa
xorl %eax, %eax
movq 0x90(%rbx,%rax,8), %rcx
testq %rcx, %rcx
je 0x53ace
movl $0x3e7, 0x4(%rcx)       # imm = 0x3E7
incq %rax
cmpq $0x2f, %rax
jne 0x53aba
leaq 0x88c8(%rbx), %r14
movq %r14, %rdi
callq 0x4340
movq 0x88c0(%rbx), %rdi
callq 0x381ae
movq %r14, %rdi
callq 0x4750
xorl %eax, %eax
movabsq $0x4600000003, %rcx     # imm = 0x4600000003
xorps %xmm0, %xmm0
xorl %edx, %edx
movq 0x90(%rbx,%rdx,8), %rsi
testq %rsi, %rsi
je 0x53b47
movq %rcx, (%rsi)
movl %eax, 0x98(%rsi)
movl %eax, 0x220(%rsi)
movups %xmm0, 0xc(%rsi)
movups %xmm0, 0x1c(%rsi)
movups %xmm0, 0x2c(%rsi)
movups %xmm0, 0x3c(%rsi)
movups %xmm0, 0x4c(%rsi)
movups %xmm0, 0x5c(%rsi)
movups %xmm0, 0x6c(%rsi)
movups %xmm0, 0x7c(%rsi)
incq %rdx
cmpq $0x2f, %rdx
jne 0x53b0b
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x53e6b
pushq %rbx
movq %rdi, %rbx
movq 0x30(%rdi), %rdi
testq %rdi, %rdi
je 0x53e62
callq 0x45c0
movq %rbx, %rdi
popq %rbx
jmp 0x45c0
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %r14
movl $0x1a, %r15d
movl $0x1a, %edi
callq 0x4680
testq %rax, %rax
je 0x54354
movq %rax, %rbx
movq (%r14), %r12
movq 0x8(%r12), %rsi
movq 0x10(%r12), %r13
subq %rsi, %r13
cmpq $0x1a, %r13
cmovbq %r13, %r15
movq %rax, %rdi
movq %r15, %rdx
callq 0x43c0
addq %r15, 0x8(%r12)
cmpq $0x19, %r13
ja 0x54316
testb $0x2, 0x30(%r12)
je 0x54316
movl $0x1a, %edx
movq %r12, %rdi
movq %rbx, %rsi
movq %r15, %rcx
callq 0xf2cd
movq %rax, %r15
cmpq $0x1a, %r15
jne 0x5434c
cmpl $0x4d415243, (%rbx)     # imm = 0x4D415243
jne 0x5434c
movzbl 0x4(%rbx), %ecx
cmpl $0x5, %ecx
jb 0x54363
movzbl 0x5(%rbx), %r8d
leaq 0x49ce7(%rip), %rsi     # 0x9e020
leaq 0x49cf3(%rip), %rdx     # 0x9e033
movl $0x1, %edi
xorl %eax, %eax
callq 0x14378
movq %rbx, %rdi
callq 0x45c0
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0x8880(%r14), %rax
addq $0x1a, %rax
movq %rax, 0x8880(%r14)
movq %rax, 0x8888(%r14)
movl $0x0, 0x8894(%r14)
jmp 0x54356
// File: /workspace/github_c_makefile_star2_O1/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)
movw $0x0, 0x6(%rsp)
movq %rsi, %rdi
callq 0x41d0
cmpq $0x2, %rax
jb 0x551c1
movb 0x1(%rbx), %al
andb $-0x2, %al
cmpb $0x62, %al
jne 0x551c1
movb $0x62, 0x6(%rsp)
xorl %r15d, %r15d
leaq 0x5(%rsp), %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0x10014
testq %rax, %rax
je 0x551f9
movq %rax, %r12
movq %rax, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x55208
movq %rax, %r15
testq %rax, %rax
jne 0x551f9
movq %r12, %rdi
callq 0xf730
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/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 0x55a2d
movq %rdi, %rbx
xorl %ebp, %ebp
cmpl $0x77, 0x8(%rdi)
jne 0x55a32
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0x55a32
cmpq $0x0, 0x90(%rdi)
je 0x559f1
movl 0xc(%rbx), %esi
callq 0x49dcb
movq 0x38(%rbx), %rsi
movq %rbx, %rdi
callq 0x53b58
xorl %ebp, %ebp
cmpl $-0x1, %eax
sete %bpl
movq 0x38(%rbx), %rdi
callq 0x5295e
movq 0x40(%rbx), %rax
cmpq 0x38(%rbx), %rax
jne 0x55a21
movq $0x0, 0x40(%rbx)
negl %ebp
movq $0x0, 0x38(%rbx)
jmp 0x55a32
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/cram/cram_io.c
// Function: cram_set_option
int cram_set_option(cram_fd *fd, enum hts_fmt_option opt, ...) {
    int r;
    va_list args;

    va_start(args, opt);
    r = cram_set_voption(fd, opt, args);
    va_end(args);

    return r;
}

// Assembly:
subq $0xd8, %rsp
leaq 0x20(%rsp), %r10
movq %rdx, 0x10(%r10)
movq %rcx, 0x18(%r10)
movq %r8, 0x20(%r10)
movq %r9, 0x28(%r10)
testb %al, %al
je 0x55e65
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsp, %rdx
movq %r10, 0x10(%rdx)
leaq 0xe0(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rdx)
callq 0x55e92
addq $0xd8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/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
movl $0x2f, %esi
callq 0x4530
testq %rax, %rax
je 0x57657
movq %rax, %r14
movb $0x0, (%rax)
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x4420
testl %eax, %eax
jne 0x57620
movl $0xf000, %eax           # imm = 0xF000
andl 0x20(%rsp), %eax
cmpl $0x4000, %eax           # imm = 0x4000
je 0x57653
movq %rbx, %rdi
movl $0x3ff, %esi            # imm = 0x3FF
callq 0x41e0
testl %eax, %eax
je 0x57646
movq %rbx, %rdi
callq 0x575dd
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_O1/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:
movq (%rdi), %rax
testq %rsi, %rsi
setne %cl
movq %rsi, %r8
subq %rax, %r8
cmpq $0x6, %r8
setl %r8b
testb %r8b, %cl
jne 0x576b0
xorl %esi, %esi
xorl %ecx, %ecx
movzbl (%rax,%rsi), %r9d
movl %ecx, %r8d
shll $0x7, %r8d
movl %r9d, %ecx
andl $0x7f, %ecx
orl %r8d, %ecx
leaq 0x1(%rsi), %r8
testb %r9b, %r9b
jns 0x576a8
cmpl $0x5, %esi
movq %r8, %rsi
jne 0x57682
addq %rax, %r8
subl %eax, %r8d
jmp 0x576ca
xorl %ecx, %ecx
movl $0x0, %r8d
cmpq %rsi, %rax
jae 0x576ca
movsbl (%rax), %ecx
testl %ecx, %ecx
js 0x576e6
movl $0x1, %r8d
movslq %r8d, %rsi
addq %rsi, %rax
movq %rax, (%rdi)
testq %rdx, %rdx
je 0x576e3
testl %r8d, %r8d
jne 0x576e3
movl $0x1, (%rdx)
movl %ecx, %eax
retq
xorl %ecx, %ecx
movq %rax, %r8
movzbl (%r8), %r9d
incq %r8
movl %ecx, %r10d
shll $0x7, %r10d
movl %r9d, %ecx
andl $0x7f, %ecx
orl %r10d, %ecx
testb %r9b, %r9b
jns 0x576ab
cmpq %rsi, %r8
jb 0x576eb
jmp 0x576ab
// File: /workspace/github_c_makefile_star2_O1/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:
movq (%rdi), %rax
testq %rsi, %rsi
setne %cl
movq %rsi, %r8
subq %rax, %r8
cmpq $0x6, %r8
setl %r8b
testb %r8b, %cl
jne 0x5775c
xorl %esi, %esi
xorl %ecx, %ecx
movzbl (%rax,%rsi), %r9d
movl %ecx, %r8d
shll $0x7, %r8d
movl %r9d, %ecx
andl $0x7f, %ecx
orl %r8d, %ecx
leaq 0x1(%rsi), %r8
testb %r9b, %r9b
jns 0x57754
cmpl $0x5, %esi
movq %r8, %rsi
jne 0x5772e
addq %rax, %r8
subl %eax, %r8d
jmp 0x57776
xorl %ecx, %ecx
movl $0x0, %r8d
cmpq %rsi, %rax
jae 0x57776
movsbl (%rax), %ecx
testl %ecx, %ecx
js 0x5779e
movl $0x1, %r8d
movslq %r8d, %rsi
addq %rsi, %rax
movq %rax, (%rdi)
testq %rdx, %rdx
je 0x5778f
testl %r8d, %r8d
jne 0x5778f
movl $0x1, (%rdx)
movl %ecx, %eax
shrl %eax
andl $0x1, %ecx
negl %ecx
xorl %eax, %ecx
movslq %ecx, %rax
retq
xorl %ecx, %ecx
movq %rax, %r8
movzbl (%r8), %r9d
incq %r8
movl %ecx, %r10d
shll $0x7, %r10d
movl %r9d, %ecx
andl $0x7f, %ecx
orl %r10d, %ecx
testb %r9b, %r9b
jns 0x57757
cmpq %rsi, %r8
jb 0x577a3
jmp 0x57757
// File: /workspace/github_c_makefile_star2_O1/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:
movq (%rdi), %rcx
testq %rsi, %rsi
setne %al
movq %rsi, %r8
subq %rcx, %r8
cmpq $0xb, %r8
setl %r8b
testb %r8b, %al
jne 0x57814
xorl %esi, %esi
xorl %eax, %eax
movzbl (%rcx,%rsi), %r9d
movq %rax, %r8
shlq $0x7, %r8
movl %r9d, %eax
andl $0x7f, %eax
orq %r8, %rax
leaq 0x1(%rsi), %r8
testb %r9b, %r9b
jns 0x5780c
cmpl $0xa, %esi
movq %r8, %rsi
jne 0x577e6
addq %rcx, %r8
subl %ecx, %r8d
jmp 0x57844
xorl %eax, %eax
cmpq %rsi, %rcx
jae 0x57841
movq %rcx, %r8
movzbl (%r8), %r9d
incq %r8
movq %rax, %r10
shlq $0x7, %r10
movl %r9d, %eax
andl $0x7f, %eax
orq %r10, %rax
testb %r9b, %r9b
jns 0x5780f
cmpq %rsi, %r8
jb 0x5781e
jmp 0x5780f
xorl %r8d, %r8d
movslq %r8d, %rsi
addq %rsi, %rcx
movq %rcx, (%rdi)
testq %rdx, %rdx
je 0x5785d
testl %r8d, %r8d
jne 0x5785d
movl $0x1, (%rdx)
retq
// File: /workspace/github_c_makefile_star2_O1/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:
movq (%rdi), %rcx
testq %rsi, %rsi
setne %al
movq %rsi, %r8
subq %rcx, %r8
cmpq $0xb, %r8
setl %r8b
testb %r8b, %al
jne 0x578ac
xorl %esi, %esi
xorl %eax, %eax
movzbl (%rcx,%rsi), %r9d
movq %rax, %r8
shlq $0x7, %r8
movl %r9d, %eax
andl $0x7f, %eax
orq %r8, %rax
leaq 0x1(%rsi), %r8
testb %r9b, %r9b
jns 0x578a4
cmpl $0xa, %esi
movq %r8, %rsi
jne 0x5787e
addq %rcx, %r8
subl %ecx, %r8d
jmp 0x578dc
xorl %eax, %eax
cmpq %rsi, %rcx
jae 0x578d9
movq %rcx, %r8
movzbl (%r8), %r9d
incq %r8
movq %rax, %r10
shlq $0x7, %r10
movl %r9d, %eax
andl $0x7f, %eax
orq %r10, %rax
testb %r9b, %r9b
jns 0x578a7
cmpq %rsi, %r8
jb 0x578b6
jmp 0x578a7
xorl %r8d, %r8d
movslq %r8d, %rsi
addq %rsi, %rcx
movq %rcx, (%rdi)
testq %rdx, %rdx
je 0x578f5
testl %r8d, %r8d
jne 0x578f5
movl $0x1, (%rdx)
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
negq %rax
xorq %rcx, %rax
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/cram/../htscodecs/htscodecs/varint.h
// Function: uint7_put_32
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:
testq %rsi, %rsi
sete %al
subq %rdi, %rsi
cmpq $0x5, %rsi
setge %cl
orb %al, %cl
jne 0x5798b
movq $-0x1, %r8
xorl %ecx, %ecx
movl %edx, %r9d
movl %edx, %eax
shrl $0x7, %eax
incq %r8
addq $0x7, %rcx
cmpl $0x7f, %r9d
movl %eax, %r9d
ja 0x57927
leaq (,%rsi,8), %r9
subq %rsi, %r9
xorl %eax, %eax
cmpq %rcx, %r9
jl 0x5798a
addq $-0x7, %rcx
cmpq $0x4, %r8
movl $0x4, %esi
cmovbq %r8, %rsi
incq %rsi
xorl %eax, %eax
movl %edx, %r8d
shrl %cl, %r8d
xorl %r9d, %r9d
testl %ecx, %ecx
setne %r9b
andl $0x7f, %r8d
shll $0x7, %r9d
orl %r8d, %r9d
movb %r9b, (%rdi,%rax)
incq %rax
addl $-0x7, %ecx
cmpl %eax, %esi
jne 0x57962
retq
cmpl $0x7f, %edx
ja 0x57998
movb %dl, (%rdi)
movl $0x1, %eax
retq
movl %edx, %eax
cmpl $0x3fff, %edx           # imm = 0x3FFF
ja 0x579b5
shrl $0x7, %eax
orb $-0x80, %al
movb %al, (%rdi)
andb $0x7f, %dl
movb %dl, 0x1(%rdi)
movl $0x2, %eax
retq
cmpl $0x1fffff, %edx         # imm = 0x1FFFFF
ja 0x579da
shrl $0xe, %eax
orb $-0x80, %al
movb %al, (%rdi)
movl %edx, %eax
shrl $0x7, %eax
orb $-0x80, %al
movb %al, 0x1(%rdi)
andb $0x7f, %dl
movb %dl, 0x2(%rdi)
movl $0x3, %eax
retq
cmpl $0xfffffff, %edx        # imm = 0xFFFFFFF
ja 0x57a09
shrl $0x15, %eax
orb $-0x80, %al
movb %al, (%rdi)
movl %edx, %eax
shrl $0xe, %eax
orb $-0x80, %al
movb %al, 0x1(%rdi)
movl %edx, %eax
shrl $0x7, %eax
orb $-0x80, %al
movb %al, 0x2(%rdi)
andb $0x7f, %dl
movb %dl, 0x3(%rdi)
movl $0x4, %eax
retq
shrl $0x1c, %eax
orb $-0x80, %al
movb %al, (%rdi)
movl %edx, %eax
shrl $0x15, %eax
orb $-0x80, %al
movb %al, 0x1(%rdi)
movl %edx, %eax
shrl $0xe, %eax
orb $-0x80, %al
movb %al, 0x2(%rdi)
movl %edx, %eax
shrl $0x7, %eax
orb $-0x80, %al
movb %al, 0x3(%rdi)
andb $0x7f, %dl
movb %dl, 0x4(%rdi)
movl $0x5, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/cram/cram_io.c
// Function: uint7_put_blk_32
static int uint7_put_blk_32(cram_block *blk, int32_t v) {
    uint8_t buf[10];
    int sz = var_put_u32(buf, buf+10, v);
    BLOCK_APPEND(blk, buf, sz);
    return sz;

 block_err:
    return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
cmpl $0x7f, %esi
ja 0x57bad
movb %sil, 0xe(%rsp)
movl $0x1, %ebp
jmp 0x57c6e
movl %esi, %eax
cmpl $0x3fff, %esi           # imm = 0x3FFF
ja 0x57bd3
shrl $0x7, %eax
orb $-0x80, %al
movb %al, 0xe(%rsp)
andb $0x7f, %sil
movb %sil, 0xf(%rsp)
movl $0x2, %ebp
jmp 0x57c6e
cmpl $0x1fffff, %esi         # imm = 0x1FFFFF
ja 0x57bff
shrl $0xe, %eax
orb $-0x80, %al
movb %al, 0xe(%rsp)
movl %esi, %eax
shrl $0x7, %eax
orb $-0x80, %al
movb %al, 0xf(%rsp)
andb $0x7f, %sil
movb %sil, 0x10(%rsp)
movl $0x3, %ebp
jmp 0x57c6e
cmpl $0xfffffff, %esi        # imm = 0xFFFFFFF
ja 0x57c36
shrl $0x15, %eax
orb $-0x80, %al
movb %al, 0xe(%rsp)
movl %esi, %eax
shrl $0xe, %eax
orb $-0x80, %al
movb %al, 0xf(%rsp)
movl %esi, %eax
shrl $0x7, %eax
orb $-0x80, %al
movb %al, 0x10(%rsp)
andb $0x7f, %sil
movb %sil, 0x11(%rsp)
movl $0x4, %ebp
jmp 0x57c6e
shrl $0x1c, %eax
orb $-0x80, %al
movb %al, 0xe(%rsp)
movl %esi, %eax
shrl $0x15, %eax
orb $-0x80, %al
movb %al, 0xf(%rsp)
movl %esi, %eax
shrl $0xe, %eax
orb $-0x80, %al
movb %al, 0x10(%rsp)
movl %esi, %eax
shrl $0x7, %eax
orb $-0x80, %al
movb %al, 0x11(%rsp)
andb $0x7f, %sil
movb %sil, 0x12(%rsp)
movl $0x5, %ebp
movl %ebp, %r14d
movq 0x30(%rbx), %r15
addq %r14, %r15
movq 0x28(%rbx), %rax
cmpq %r15, %rax
ja 0x57cb5
leaq 0x320(%rax), %rcx
shrq $0x2, %rcx
addq %rcx, %rax
addq $0x320, %rax            # imm = 0x320
cmpq %r15, %rax
cmovaq %rax, %r15
movq 0x20(%rbx), %rdi
movq %r15, %rsi
callq 0x4840
testq %rax, %rax
je 0x57cdb
movq %r15, 0x28(%rbx)
movq %rax, 0x20(%rbx)
movq 0x20(%rbx), %rdi
addq 0x30(%rbx), %rdi
leaq 0xe(%rsp), %rsi
movq %r14, %rdx
callq 0x43c0
addq %r14, 0x30(%rbx)
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x57cce
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/cram/cram_io.c
// Function: sint7_put_blk_32
static int sint7_put_blk_32(cram_block *blk, int32_t v) {
    uint8_t buf[10];
    int sz = var_put_s32(buf, buf+10, v);
    BLOCK_APPEND(blk, buf, sz);
    return sz;

 block_err:
    return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leal (%rsi,%rsi), %eax
sarl $0x1f, %esi
xorl %eax, %esi
cmpl $0x7f, %esi
ja 0x57d0b
movb %sil, 0xe(%rsp)
movl $0x1, %ebp
jmp 0x57dcc
movl %esi, %eax
cmpl $0x3fff, %esi           # imm = 0x3FFF
ja 0x57d31
shrl $0x7, %eax
orb $-0x80, %al
movb %al, 0xe(%rsp)
andb $0x7f, %sil
movb %sil, 0xf(%rsp)
movl $0x2, %ebp
jmp 0x57dcc
cmpl $0x1fffff, %esi         # imm = 0x1FFFFF
ja 0x57d5d
shrl $0xe, %eax
orb $-0x80, %al
movb %al, 0xe(%rsp)
movl %esi, %eax
shrl $0x7, %eax
orb $-0x80, %al
movb %al, 0xf(%rsp)
andb $0x7f, %sil
movb %sil, 0x10(%rsp)
movl $0x3, %ebp
jmp 0x57dcc
cmpl $0xfffffff, %esi        # imm = 0xFFFFFFF
ja 0x57d94
shrl $0x15, %eax
orb $-0x80, %al
movb %al, 0xe(%rsp)
movl %esi, %eax
shrl $0xe, %eax
orb $-0x80, %al
movb %al, 0xf(%rsp)
movl %esi, %eax
shrl $0x7, %eax
orb $-0x80, %al
movb %al, 0x10(%rsp)
andb $0x7f, %sil
movb %sil, 0x11(%rsp)
movl $0x4, %ebp
jmp 0x57dcc
shrl $0x1c, %eax
orb $-0x80, %al
movb %al, 0xe(%rsp)
movl %esi, %eax
shrl $0x15, %eax
orb $-0x80, %al
movb %al, 0xf(%rsp)
movl %esi, %eax
shrl $0xe, %eax
orb $-0x80, %al
movb %al, 0x10(%rsp)
movl %esi, %eax
shrl $0x7, %eax
orb $-0x80, %al
movb %al, 0x11(%rsp)
andb $0x7f, %sil
movb %sil, 0x12(%rsp)
movl $0x5, %ebp
movl %ebp, %r14d
movq 0x30(%rbx), %r15
addq %r14, %r15
movq 0x28(%rbx), %rax
cmpq %r15, %rax
ja 0x57e13
leaq 0x320(%rax), %rcx
shrq $0x2, %rcx
addq %rcx, %rax
addq $0x320, %rax            # imm = 0x320
cmpq %r15, %rax
cmovaq %rax, %r15
movq 0x20(%rbx), %rdi
movq %r15, %rsi
callq 0x4840
testq %rax, %rax
je 0x57e39
movq %r15, 0x28(%rbx)
movq %rax, 0x20(%rbx)
movq 0x20(%rbx), %rdi
addq 0x30(%rbx), %rdi
leaq 0xe(%rsp), %rsi
movq %r14, %rdx
callq 0x43c0
addq %r14, 0x30(%rbx)
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x57e2c
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/cram/cram_io.c
// Function: uint7_put_blk_64
static int uint7_put_blk_64(cram_block *blk, int64_t v) {
    uint8_t buf[10];
    int sz = var_put_u64(buf, buf+10, v);
    BLOCK_APPEND(blk, buf, sz);
    return sz;

 block_err:
    return -1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rdx
movq %rdi, %r14
leaq 0x18(%rsp), %rsi
leaq 0xe(%rsp), %rdi
callq 0x586dc
movl %eax, %ebx
movslq %eax, %r15
movq 0x30(%r14), %r12
addq %r15, %r12
movq 0x28(%r14), %rax
cmpq %r12, %rax
ja 0x57ea9
leaq 0x320(%rax), %rcx
shrq $0x2, %rcx
addq %rcx, %rax
addq $0x320, %rax            # imm = 0x320
cmpq %r12, %rax
cmovaq %rax, %r12
movq 0x20(%r14), %rdi
movq %r12, %rsi
callq 0x4840
testq %rax, %rax
je 0x57ec8
movq %r12, 0x28(%r14)
movq %rax, 0x20(%r14)
testl %ebx, %ebx
je 0x57ecd
movq 0x20(%r14), %rdi
addq 0x30(%r14), %rdi
leaq 0xe(%rsp), %rsi
movq %r15, %rdx
callq 0x43c0
addq %r15, 0x30(%r14)
jmp 0x57ecd
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
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/cram/cram_io.c
// Function: sint7_put_blk_64
static int sint7_put_blk_64(cram_block *blk, int64_t v) {
    uint8_t buf[10];
    int sz = var_put_s64(buf, buf+10, v);
    BLOCK_APPEND(blk, buf, sz);
    return sz;

 block_err:
    return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x18(%rsp), %rax
leaq (%rsi,%rsi), %rdx
sarq $0x3f, %rsi
xorq %rsi, %rdx
leaq 0xe(%rsp), %rdi
movq %rax, %rsi
callq 0x586dc
movl %eax, %ebp
movslq %eax, %r14
movq 0x30(%rbx), %r15
addq %r14, %r15
movq 0x28(%rbx), %rax
cmpq %r15, %rax
ja 0x57f4e
leaq 0x320(%rax), %rcx
shrq $0x2, %rcx
addq %rcx, %rax
addq $0x320, %rax            # imm = 0x320
cmpq %r15, %rax
cmovaq %rax, %r15
movq 0x20(%rbx), %rdi
movq %r15, %rsi
callq 0x4840
testq %rax, %rax
je 0x57f6d
movq %r15, 0x28(%rbx)
movq %rax, 0x20(%rbx)
testl %ebp, %ebp
je 0x57f72
movq 0x20(%rbx), %rdi
addq 0x30(%rbx), %rdi
leaq 0xe(%rsp), %rsi
movq %r14, %rdx
callq 0x43c0
addq %r14, 0x30(%rbx)
jmp 0x57f72
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq