LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_io.c
// Function: cram_block_size
uint32_t cram_block_size(cram_block *b) {
    unsigned char dat[100], *cp = dat;;
    uint32_t sz;

    *cp++ = b->method;
    *cp++ = b->content_type;
    cp += itf8_put((char*)cp, b->content_id);
    cp += itf8_put((char*)cp, b->comp_size);
    cp += itf8_put((char*)cp, b->uncomp_size);

    sz = cp-dat + 4;
    sz += b->method == RAW ? b->uncomp_size : b->comp_size;

    return sz;
}

// Assembly:
movl 0xc(%rdi), %edx
movl $0x1, %ecx
movl $0x1, %eax
cmpl $0x80, %edx
jb 0x4c979
movl $0x2, %eax
cmpl $0x4000, %edx           # imm = 0x4000
jb 0x4c979
movl $0x3, %eax
cmpl $0x200000, %edx         # imm = 0x200000
jb 0x4c979
cmpl $0x10000000, %edx       # imm = 0x10000000
movl $0x5, %eax
sbbq $0x0, %rax
movl 0x10(%rdi), %edx
cmpl $0x80, %edx
jb 0x4c9ad
movl $0x2, %ecx
cmpl $0x4000, %edx           # imm = 0x4000
jb 0x4c9ad
movl $0x3, %ecx
cmpl $0x200000, %edx         # imm = 0x200000
jb 0x4c9ad
cmpl $0x10000000, %edx       # imm = 0x10000000
movl $0x5, %ecx
sbbq $0x0, %rcx
movl (%rdi), %esi
leaq 0x10(%rdi), %rdx
movl 0x14(%rdi), %r9d
addq $0x14, %rdi
movl $0x1, %r8d
cmpl $0x80, %r9d
jb 0x4c9f9
movl $0x2, %r8d
cmpl $0x4000, %r9d           # imm = 0x4000
jb 0x4c9f9
movl $0x3, %r8d
cmpl $0x200000, %r9d         # imm = 0x200000
jb 0x4c9f9
cmpl $0x10000000, %r9d       # imm = 0x10000000
movl $0x5, %r8d
sbbq $0x0, %r8
leaq -0x68(%rsp), %r9
addl %r9d, %eax
addl %ecx, %r8d
addl %eax, %r8d
testl %esi, %esi
cmoveq %rdi, %rdx
movl (%rdx), %eax
subl %r9d, %r8d
addl %r8d, %eax
addl $0x6, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/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
movq %rdi, %rbx
movl %esi, 0xc(%rsp)
testb $0x2, 0x30(%rdi)
movq 0x18(%rdi), %r14
jne 0x4ce4a
movq %r14, %rax
subq 0x8(%rbx), %rax
cmpq $0x3, %rax
ja 0x4ce4a
subq (%rbx), %r14
addq $0x4, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0xee24
movq 0x18(%rbx), %r14
movq %r14, 0x10(%rbx)
movq 0x8(%rbx), %rdi
subq %rdi, %r14
cmpq $0x4, %r14
ja 0x4ce5c
cmpq (%rbx), %rdi
je 0x4ce83
cmpq $0x4, %r14
movl $0x4, %r15d
cmovbq %r14, %r15
leaq 0xc(%rsp), %rsi
movq %r15, %rdx
callq 0x43c0
addq %r15, 0x8(%rbx)
cmpq $0x3, %r14
jbe 0x4ce86
jmp 0x4ce9e
xorl %r15d, %r15d
leaq 0xc(%rsp), %rsi
movl $0x4, %edx
movq %rbx, %rdi
movq %r15, %rcx
callq 0xf300
movq %rax, %r15
xorl %eax, %eax
cmpq $0x4, %r15
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_O3/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 0x4ced6
pushq %rbx
movq %rdi, %rbx
movq 0x20(%rdi), %rdi
testq %rdi, %rdi
je 0x4cecd
callq 0x45c0
movq %rbx, %rdi
popq %rbx
jmp 0x45c0
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x4df5f
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x4dea7
callq 0x57ec7
movq 0x8(%rbx), %r14
testq %r14, %r14
je 0x4df2a
movl (%r14), %eax
testl %eax, %eax
je 0x4df07
xorl %ebp, %ebp
xorl %r12d, %r12d
movq 0x10(%r14), %rcx
movl %r12d, %edx
shrl $0x4, %edx
movl (%rcx,%rdx,4), %edx
movl %ebp, %ecx
andb $0x1e, %cl
shrl %cl, %edx
testb $0x3, %dl
jne 0x4defc
movq 0x20(%r14), %rcx
movl %r12d, %edx
movq (%rcx,%rdx,8), %r15
testq %r15, %r15
je 0x4defc
movq %r15, %rdi
callq 0x4df60
movq %r15, %rdi
callq 0x45c0
movq 0x8(%rbx), %r14
movl (%r14), %eax
incl %r12d
addl $0x2, %ebp
cmpl %eax, %r12d
jne 0x4debc
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 0x4df38
callq 0x45c0
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x4df46
callq 0xd3cd
leaq 0x38(%rbx), %rdi
callq 0x4590
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x45c0
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x4df75
callq 0x56e28
leaq 0x38(%rbx), %r14
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0x4df8e
cmpq $0x0, 0x40(%rbx)
jne 0x4df8e
callq 0x45c0
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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 $0x48, %rsp
movq %rdi, %rbx
movq 0x38(%rsi), %rax
movq %rax, 0x8(%rsp)
movq 0x10(%rdi), %rdi
testq %rdi, %rdi
je 0x4dfc5
callq 0x45c0
cmpq $0x0, 0x60(%rbx)
je 0x4dfd4
movq $0x0, 0x60(%rbx)
movq 0x8(%rsp), %rax
movl 0x28(%rax), %ebp
movslq %ebp, %rdi
movl $0x8, %esi
callq 0x4300
movq %rax, 0x10(%rbx)
testq %rax, %rax
je 0x4e165
movl %ebp, 0x18(%rbx)
testl %ebp, %ebp
jle 0x4e161
xorl %ecx, %ecx
movq %rbx, 0x20(%rsp)
movl %ebp, 0x1c(%rsp)
movq 0x8(%rbx), %rdx
movq 0x8(%rsp), %rax
movq 0x30(%rax), %rax
movq %rcx, 0x28(%rsp)
leaq (%rcx,%rcx,2), %rcx
movq (%rax,%rcx,8), %r8
movq %rdx, 0x10(%rsp)
movl (%rdx), %edx
movl $0x0, %ebx
testl %edx, %edx
je 0x4e0f5
movb (%r8), %cl
testb %cl, %cl
je 0x4e063
leaq 0x1(%r8), %rax
movl $0x811c9dc5, %r14d      # imm = 0x811C9DC5
movzbl %cl, %ecx
xorl %r14d, %ecx
imull $0x1000193, %ecx, %r14d # imm = 0x1000193
movb (%rax), %cl
incq %rax
testb %cl, %cl
jne 0x4e04b
jmp 0x4e069
movl $0x811c9dc5, %r14d      # imm = 0x811C9DC5
movq %rdx, 0x30(%rsp)
leal -0x1(%rdx), %r15d
andl %r15d, %r14d
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rsi
movl $0x1, %r13d
movl %r14d, %ebx
movq %r8, 0x40(%rsp)
movq %rsi, 0x38(%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 0x4e0e4
testb $0x1, %al
jne 0x4e0d4
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rax
movl %ebx, %ecx
movq (%rax,%rcx,8), %rdi
movq %r8, %rsi
callq 0x46c0
movq 0x38(%rsp), %rsi
movq 0x40(%rsp), %r8
testl %eax, %eax
je 0x4e0e4
addl %r13d, %ebx
andl %r15d, %ebx
incl %r13d
cmpl %r14d, %ebx
jne 0x4e091
jmp 0x4e0f9
movl %ebp, %ecx
shrl %cl, %r12d
testb $0x3, %r12b
movq 0x30(%rsp), %rdx
cmovnel %edx, %ebx
cmpl %edx, %ebx
jne 0x4e12a
movl $0x3, %edi
leaq 0x4cf18(%rip), %rsi     # 0x9b01d
leaq 0x4cf19(%rip), %rdx     # 0x9b025
movq %r8, %rcx
xorl %eax, %eax
callq 0x13de5
movq 0x8(%rsp), %rax
movl 0x28(%rax), %ebp
movq 0x20(%rsp), %rbx
movq 0x28(%rsp), %rcx
jmp 0x4e152
movq 0x10(%rsp), %rax
movq 0x20(%rax), %rax
movl %ebx, %ecx
movq (%rax,%rcx,8), %rax
movq 0x20(%rsp), %rbx
movq 0x10(%rbx), %rcx
movq 0x28(%rsp), %rdx
movq %rax, (%rcx,%rdx,8)
movq %rdx, %rcx
movl 0x1c(%rsp), %ebp
incq %rcx
movslq %ebp, %rax
cmpq %rax, %rcx
jl 0x4e008
xorl %eax, %eax
jmp 0x4e16a
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x4e1c3
movq %rsi, %r14
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
cmpq %rsi, %rdi
je 0x4e1b7
testq %rdi, %rdi
je 0x4e1a6
callq 0x22102
movq %r14, %rdi
callq 0x2223d
movq %rax, 0x18(%rbx)
testq %rax, %rax
je 0x4e1c3
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x4e1d0
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x4ce6d(%rip), %rsi     # 0x9b5b3
movl $0x7, %edx
callq 0x4210
leaq 0x7(%r14), %rbx
testl %eax, %eax
cmovneq %r14, %rbx
testl %ebp, %ebp
jne 0x4e76a
movq %rbx, %rdi
callq 0x101ec
testl %eax, %eax
je 0x4e7cc
leaq 0x49e5a(%rip), %rsi     # 0x985cb
movq %rbx, %rdi
callq 0xa550
testq %rax, %rax
je 0x4e80e
movq %rax, %r14
testb $0x40, 0x3(%rax)
je 0x4e819
leaq 0x52ed2(%rip), %rdx     # 0xa1668
movq %r14, %rdi
movq %rbx, %rsi
callq 0xe3ef
testl %eax, %eax
jns 0x4e819
leaq 0x4ce16(%rip), %rsi     # 0x9b5c2
leaq 0x4ce1d(%rip), %rdx     # 0x9b5d0
movl $0x1, %edi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x13de5
movq %r14, %rdi
callq 0xd3cd
jmp 0x4e816
leaq 0x4cde8(%rip), %rdx     # 0x9b5bb
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 0x4e76a
movq %rbx, %rdi
callq 0x82299
testl %eax, %eax
jne 0x4e816
jmp 0x4e76a
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_O3/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 0x4f45f
movq 0x50(%rbx), %rdi
cmpl $0x0, 0x220(%rbx)
jle 0x4f467
xorl %edx, %edx
cmpl $0x72, 0x8(%rbx)
setne %dl
jmp 0x4f46c
xorl %r15d, %r15d
xorl %r14d, %r14d
jmp 0x4f495
movl $0x1, %edx
callq 0x4f513
movq %rax, 0x50(%rbx)
xorl %r14d, %r14d
testq %rax, %rax
je 0x4f483
movq 0x20(%rax), %r15
jmp 0x4f486
xorl %r15d, %r15d
cmpq $0x1, %r15
sbbl %r14d, %r14d
movq %rbx, %rdi
callq 0x4f9f4
movq %r15, 0x80(%rbx)
movq 0x50(%rbx), %rdi
testq %rdi, %rdi
je 0x4f4be
testq %r15, %r15
jne 0x4f4e5
cmpl $0x0, 0x18(%rdi)
jne 0x4f4e5
cmpq $0x0, 0x18(%rbx)
je 0x4f4e5
callq 0x4de72
jmp 0x4f4c5
cmpq $0x0, 0x18(%rbx)
je 0x4f4e5
callq 0x4fc28
movq %rax, 0x50(%rbx)
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x4f506
movq %rbx, %rdi
callq 0x4e1d0
cmpl $-0x1, %eax
je 0x4f506
movq 0x18(%rbx), %rsi
testq %rsi, %rsi
je 0x4f4fc
movq 0x50(%rbx), %rdi
callq 0x4df9d
cmpl $-0x1, %eax
je 0x4f501
movl %r14d, %ebp
jmp 0x4f506
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_O3/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 0x4fc90
movq %rax, %rbx
movl $0x2000, %edi           # imm = 0x2000
callq 0x57e90
movq %rax, (%rbx)
testq %rax, %rax
je 0x4fc88
movl $0x1, 0x30(%rbx)
movl $0xffffffff, 0x68(%rbx) # imm = 0xFFFFFFFF
movl $0x1, %edi
movl $0x28, %esi
callq 0x4300
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x4fc88
movq %rbx, %rdi
addq $0x38, %rdi
xorl %esi, %esi
callq 0x4780
jmp 0x4fc92
movq %rbx, %rdi
callq 0x4de72
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebp
movl %edi, %r14d
movl $0x1, %edi
movl $0x2a0, %esi            # imm = 0x2A0
callq 0x4300
testq %rax, %rax
je 0x4fd7e
movq %rax, %rbx
movl $0xfffffffe, 0x78(%rax) # imm = 0xFFFFFFFE
movl %ebp, %eax
imull %r14d, %eax
movl %eax, 0x6c(%rbx)
movl %r14d, 0x64(%rbx)
movl %ebp, 0x58(%rbx)
movl $0x1, %eax
movl %eax, 0x98(%rbx)
movl %eax, 0xb4(%rbx)
movl $0xffffffff, 0xe8(%rbx) # imm = 0xFFFFFFFF
cmpl %eax, %ebp
adcl $0x0, %ebp
movslq %ebp, %rdi
movl $0x8, %esi
callq 0x4300
movq %rax, 0x88(%rbx)
testq %rax, %rax
je 0x4fd76
movq %rax, %r14
callq 0x4fd8e
movq %rax, 0x48(%rbx)
testq %rax, %rax
je 0x4fd6e
movl $0x2a, %r15d
callq 0x56024
movq %rax, (%rbx,%r15,8)
testq %rax, %rax
je 0x4fd6e
incq %r15
cmpq $0x46, %r15
jne 0x4fd25
movl $0x1, %edi
movl $0x28, %esi
callq 0x4300
movq %rax, 0x270(%rbx)
testq %rax, %rax
je 0x4fd6e
movq $0x0, 0x278(%rbx)
movl $0x0, 0x29c(%rbx)
jmp 0x4fd80
movq %r14, %rdi
callq 0x45c0
movq %rbx, %rdi
callq 0x45c0
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x4fe23
movq %rax, %rbx
movl $0x5, %edi
xorl %esi, %esi
callq 0x4c675
movq %rax, 0x50(%rbx)
testq %rax, %rax
je 0x4fe1b
movq %rax, %r14
movl $0x1, %edi
movl $0x28, %esi
callq 0x4300
movq %rax, 0x68(%rbx)
testq %rax, %rax
je 0x4fe13
movq %rax, %r15
movl $0x2000, %edi           # imm = 0x2000
callq 0x57e90
movq %rax, 0x70(%rbx)
testq %rax, %rax
jne 0x4fe25
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 0x4ceb6
movq %rbx, %rdi
callq 0x45c0
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/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 0x50005
callq 0x45c0
movq 0x78(%rbx), %r14
testq %r14, %r14
je 0x50031
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 0x50061
movq 0x10(%r14), %rdi
movq 0x18(%r14), %r12
testq %rdi, %rdi
je 0x50051
callq *0x20(%rdi)
movq %r14, %rdi
callq 0x45c0
movq %r12, %r14
testq %r12, %r12
jne 0x50041
incq %r15
cmpq $0x20, %r15
jne 0x50034
xorl %r15d, %r15d
movq 0x180(%rbx,%r15,8), %r14
testq %r14, %r14
je 0x5009a
movq 0x10(%r14), %rdi
movq 0x18(%r14), %r12
testq %rdi, %rdi
je 0x5008a
callq *0x20(%rdi)
movq %r14, %rdi
callq 0x45c0
movq %r12, %r14
testq %r12, %r12
jne 0x5007a
incq %r15
cmpq $0x20, %r15
jne 0x5006d
movl $0x50, %r14d
movq (%rbx,%r14,8), %rdi
testq %rdi, %rdi
je 0x500b5
callq *0x20(%rdi)
incq %r14
cmpq $0x7f, %r14
jne 0x500a9
movq 0x60(%rbx), %rdi
testq %rdi, %rdi
je 0x500cc
callq 0x45c0
movq 0x50(%rbx), %rdi
testq %rdi, %rdi
je 0x500da
callq 0x4ceb6
movq 0x68(%rbx), %r14
testq %r14, %r14
je 0x50106
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 0x50114
callq 0x57ec7
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x45c0
// File: /workspace/github_c_makefile_star2_O3/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 0x50321
movl %esi, %r14d
xorl %r15d, %r15d
movq (%rbx,%r15,8), %rdi
callq 0x22b2b
incq %r15
cmpq %r15, %r14
jne 0x50310
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x45c0
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_io.c
// Function: cram_flush_container2
static int cram_flush_container2(cram_fd *fd, cram_container *c) {
    int i, j;

    if (c->curr_slice > 0 && !c->slices)
        return -1;

    //fprintf(stderr, "Writing container %d, sum %u\n", c->record_counter, sum);

    off_t c_offset = htell(fd->fp); // File offset of container

    /* Write the container struct itself */
    if (0 != cram_write_container(fd, c))
        return -1;

    off_t hdr_size = htell(fd->fp) - c_offset;

    /* And the compression header */
    if (0 != cram_write_block(fd, c->comp_hdr_block))
        return -1;

    /* Followed by the slice blocks */
    off_t file_offset = htell(fd->fp);
    for (i = 0; i < c->curr_slice; i++) {
        cram_slice *s = c->slices[i];
        off_t spos = file_offset - c_offset - hdr_size;

        if (0 != cram_write_block(fd, s->hdr_block))
            return -1;

        for (j = 0; j < s->hdr->num_blocks; j++) {
            if (0 != cram_write_block(fd, s->block[j]))
                return -1;
        }

        file_offset = htell(fd->fp);
        off_t sz = file_offset - c_offset - hdr_size - spos;

        if (fd->idxfp) {
            if (cram_index_slice(fd, c, s, fd->idxfp, c_offset, spos, sz) < 0)
                return -1;
        }
    }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r14
cmpl $0x0, 0x5c(%rsi)
jle 0x50df3
cmpq $0x0, 0x88(%rbx)
je 0x50e2e
movq (%r14), %rax
movq 0x28(%rax), %r15
addq 0x8(%rax), %r15
subq (%rax), %r15
movq %r14, %rdi
movq %rbx, %rsi
callq 0x50a28
testl %eax, %eax
jne 0x50e2e
movq (%r14), %rax
movq (%rax), %r13
movq 0x28(%rax), %r12
addq 0x8(%rax), %r12
movq 0x50(%rbx), %rsi
movq %r14, %rdi
callq 0x4ca19
testl %eax, %eax
je 0x50e42
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x0, 0x5c(%rbx)
jle 0x50f1c
movq (%r14), %rax
movq 0x28(%rax), %rdx
addq 0x8(%rax), %rdx
subq %r12, %r13
movq %r13, 0x8(%rsp)
subq (%rax), %rdx
xorl %ebp, %ebp
movq %rdx, 0x10(%rsp)
movq 0x88(%rbx), %rax
movq (%rax,%rbp,8), %r12
movq 0x8(%r12), %rsi
movq %r14, %rdi
callq 0x4ca19
testl %eax, %eax
jne 0x50e2e
movq (%r12), %rax
cmpl $0x0, 0x28(%rax)
jle 0x50eb7
xorl %r13d, %r13d
movq 0x10(%r12), %rax
movq (%rax,%r13,8), %rsi
movq %r14, %rdi
callq 0x4ca19
testl %eax, %eax
jne 0x50e2e
incq %r13
movq (%r12), %rax
movslq 0x28(%rax), %rax
cmpq %rax, %r13
jl 0x50e92
movq (%r14), %rax
movq 0x28(%rax), %r13
addq 0x8(%rax), %r13
subq (%rax), %r13
movq 0x8988(%r14), %rcx
testq %rcx, %rcx
je 0x50f02
movq 0x8(%rsp), %rax
movq 0x10(%rsp), %rdx
leaq (%rax,%rdx), %r9
movq %r13, %rax
subq %rdx, %rax
movq %rax, (%rsp)
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
movq %r15, %r8
callq 0x4a1b0
testl %eax, %eax
js 0x50e2e
incq %rbp
movslq 0x5c(%rbx), %rcx
xorl %eax, %eax
movq %r13, %rdx
cmpq %rcx, %rbp
jl 0x50e64
jmp 0x50e33
xorl %eax, %eax
jmp 0x50e33
// File: /workspace/github_c_makefile_star2_O3/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 0x50fab
xorl %eax, %eax
movq 0x90(%rbx,%rax,8), %rcx
testq %rcx, %rcx
je 0x50f7f
movl $0x3e7, 0x4(%rcx)       # imm = 0x3E7
incq %rax
cmpq $0x2f, %rax
jne 0x50f6b
leaq 0x88c8(%rbx), %r14
movq %r14, %rdi
callq 0x4340
movq 0x88c0(%rbx), %rdi
callq 0x36d84
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 0x50ff8
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 0x50fbc
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x51357
pushq %rbx
movq %rdi, %rbx
movq 0x30(%rdi), %rdi
testq %rdi, %rdi
je 0x5134e
callq 0x45c0
movq %rbx, %rdi
popq %rbx
jmp 0x45c0
retq
// File: /workspace/github_c_makefile_star2_O3/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
movl $0x1, %edi
movl $0xf0, %esi
callq 0x4300
testq %rax, %rax
je 0x514cf
movq %rax, %rbx
movl $0x1, %edi
movl $0x50, %esi
callq 0x4300
movq %rax, (%rbx)
testq %rax, %rax
je 0x514c7
movl %r14d, (%rax)
movslq %ebp, %rax
shlq $0x4, %rax
leaq (%rax,%rax,8), %rdi
callq 0x4680
movq %rax, 0x30(%rbx)
testq %rax, %rax
je 0x514c7
movl $0x400, 0x40(%rbx)      # imm = 0x400
movl $0x1000, %edi           # imm = 0x1000
callq 0x4680
movq %rax, 0x38(%rbx)
testq %rax, %rax
je 0x514c7
movl $0x4, %edi
xorl %esi, %esi
callq 0x4c675
movq %rax, 0x70(%rbx)
testq %rax, %rax
je 0x514c7
movl $0x4, %edi
movl $0xc, %esi
callq 0x4c675
movq %rax, 0x78(%rbx)
testq %rax, %rax
je 0x514c7
movl $0x4, %edi
movl $0xb, %esi
callq 0x4c675
movq %rax, 0x68(%rbx)
testq %rax, %rax
je 0x514c7
movl $0x4, %edi
movl $0x1, %esi
callq 0x4c675
movq %rax, 0x90(%rbx)
testq %rax, %rax
je 0x514c7
movl $0x4, %edi
movl $0xd, %esi
callq 0x4c675
movq %rax, 0x80(%rbx)
testq %rax, %rax
je 0x514c7
movl $0x4, %edi
movl $0xe, %esi
callq 0x4c675
movq %rax, 0x88(%rbx)
testq %rax, %rax
je 0x514c7
movl $0x2000, %edi           # imm = 0x2000
callq 0x57e90
movq %rax, 0x98(%rbx)
testq %rax, %rax
je 0x514c7
movl $0x1, %edi
movl $0x28, %esi
callq 0x4300
movq %rax, 0xa0(%rbx)
testq %rax, %rax
je 0x514c7
movl $0x1, %edi
movl $0x28, %esi
callq 0x4300
movq %rax, 0xa8(%rbx)
testq %rax, %rax
jne 0x514d1
movq %rbx, %rdi
callq 0x50127
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
movl $0x1a, %r15d
movl $0x1a, %edi
callq 0x4680
testq %rax, %rax
je 0x5181a
movq %rax, %rbx
movq (%r14), %r12
movq 0x8(%r12), %r13
movq 0x10(%r12), %rbp
subq %r13, %rbp
cmpq $0x1a, %rbp
cmovbq %rbp, %r15
movq %rax, %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x43c0
addq %r15, %r13
movq %r13, 0x8(%r12)
cmpq $0x19, %rbp
ja 0x517dc
testb $0x2, 0x30(%r12)
je 0x517dc
movl $0x1a, %edx
movq %r12, %rdi
movq %rbx, %rsi
movq %r15, %rcx
callq 0xf129
movq %rax, %r15
cmpq $0x1a, %r15
jne 0x51812
cmpl $0x4d415243, (%rbx)     # imm = 0x4D415243
jne 0x51812
movzbl 0x4(%rbx), %ecx
cmpl $0x5, %ecx
jb 0x5182e
movzbl 0x5(%rbx), %r8d
leaq 0x49a19(%rip), %rsi     # 0x9b218
leaq 0x49a25(%rip), %rdx     # 0x9b22b
movl $0x1, %edi
xorl %eax, %eax
callq 0x13de5
movq %rbx, %rdi
callq 0x45c0
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8880(%r14), %rax
addq $0x1a, %rax
movq %rax, 0x8880(%r14)
movq %rax, 0x8888(%r14)
movl $0x0, 0x8894(%r14)
jmp 0x5181c
// File: /workspace/github_c_makefile_star2_O3/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 0x5266f
movb 0x1(%rbx), %al
andb $-0x2, %al
cmpb $0x62, %al
jne 0x5266f
movb $0x62, 0x6(%rsp)
xorl %r15d, %r15d
leaq 0x5(%rsp), %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0xfe44
testq %rax, %rax
je 0x526aa
movq %rax, %r12
movq %rax, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x526b9
movq %rax, %r15
testq %rax, %rax
jne 0x526aa
movq %r12, %rdi
callq 0xf53f
xorl %r15d, %r15d
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x530a3
movq %rdi, %rbx
xorl %ebp, %ebp
cmpl $0x77, 0x8(%rdi)
jne 0x530a8
movq 0x38(%rbx), %rsi
testq %rsi, %rsi
je 0x530a8
cmpq $0x0, 0x90(%rsi)
je 0x5306b
movl 0xc(%rbx), %eax
movq %rsi, %rdi
movl %eax, %esi
callq 0x47686
movq 0x38(%rbx), %rsi
movq %rbx, %rdi
callq 0x51009
xorl %ebp, %ebp
cmpl $-0x1, %eax
sete %bpl
movq 0x38(%rbx), %rdi
callq 0x4fe2e
movq 0x40(%rbx), %rax
cmpq 0x38(%rbx), %rax
jne 0x53097
movq $0x0, 0x40(%rbx)
negl %ebp
movq $0x0, 0x38(%rbx)
jmp 0x530a8
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x54ca7
movq %rax, %r14
movb $0x0, (%rax)
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x4420
testl %eax, %eax
jne 0x54c70
movl $0xf000, %eax           # imm = 0xF000
andl 0x20(%rsp), %eax
cmpl $0x4000, %eax           # imm = 0x4000
je 0x54ca3
movq %rbx, %rdi
movl $0x3ff, %esi            # imm = 0x3FF
callq 0x41e0
testl %eax, %eax
je 0x54c96
movq %rbx, %rdi
callq 0x54c2d
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_O3/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 0x54d00
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 0x54cf8
cmpl $0x5, %esi
movq %r8, %rsi
jne 0x54cd2
addq %rax, %r8
subl %eax, %r8d
jmp 0x54d1c
xorl %ecx, %ecx
movl $0x0, %r8d
cmpq %rsi, %rax
jae 0x54d1c
movsbl (%rax), %ecx
testl %ecx, %ecx
js 0x54d38
incq %rax
movq %rax, (%rdi)
jmp 0x54d35
movslq %r8d, %rsi
addq %rsi, %rax
movq %rax, (%rdi)
testq %rdx, %rdx
je 0x54d35
testl %r8d, %r8d
jne 0x54d35
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 0x54cfb
cmpq %rsi, %r8
jb 0x54d3d
jmp 0x54cfb
// File: /workspace/github_c_makefile_star2_O3/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), %rcx
testq %rsi, %rsi
setne %al
movq %rsi, %r8
subq %rcx, %r8
cmpq $0x6, %r8
setl %r8b
testb %r8b, %al
jne 0x54dae
xorl %esi, %esi
xorl %eax, %eax
movzbl (%rcx,%rsi), %r9d
movl %eax, %r8d
shll $0x7, %r8d
movl %r9d, %eax
andl $0x7f, %eax
orl %r8d, %eax
leaq 0x1(%rsi), %r8
testb %r9b, %r9b
jns 0x54da6
cmpl $0x5, %esi
movq %r8, %rsi
jne 0x54d80
addq %rcx, %r8
subl %ecx, %r8d
jmp 0x54dca
xorl %eax, %eax
movl $0x0, %r8d
cmpq %rsi, %rcx
jae 0x54dca
movsbl (%rcx), %eax
testl %eax, %eax
js 0x54df1
incq %rcx
movq %rcx, (%rdi)
jmp 0x54de3
movslq %r8d, %rsi
addq %rsi, %rcx
movq %rcx, (%rdi)
testq %rdx, %rdx
je 0x54de3
testl %r8d, %r8d
jne 0x54de3
movl $0x1, (%rdx)
movl %eax, %ecx
shrl %ecx
andl $0x1, %eax
negl %eax
xorl %ecx, %eax
cltq
retq
xorl %eax, %eax
movq %rcx, %r8
movzbl (%r8), %r9d
incq %r8
movl %eax, %r10d
shll $0x7, %r10d
movl %r9d, %eax
andl $0x7f, %eax
orl %r10d, %eax
testb %r9b, %r9b
jns 0x54da9
cmpq %rsi, %r8
jb 0x54df6
jmp 0x54da9
// File: /workspace/github_c_makefile_star2_O3/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 0x54e67
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 0x54e5f
cmpl $0xa, %esi
movq %r8, %rsi
jne 0x54e39
addq %rcx, %r8
subl %ecx, %r8d
jmp 0x54e97
xorl %eax, %eax
cmpq %rsi, %rcx
jae 0x54e94
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 0x54e62
cmpq %rsi, %r8
jb 0x54e71
jmp 0x54e62
xorl %r8d, %r8d
movslq %r8d, %rsi
addq %rsi, %rcx
movq %rcx, (%rdi)
testq %rdx, %rdx
je 0x54eb0
testl %r8d, %r8d
jne 0x54eb0
movl $0x1, (%rdx)
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x54eff
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 0x54ef7
cmpl $0xa, %esi
movq %r8, %rsi
jne 0x54ed1
addq %rcx, %r8
subl %ecx, %r8d
jmp 0x54f2f
xorl %eax, %eax
cmpq %rsi, %rcx
jae 0x54f2c
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 0x54efa
cmpq %rsi, %r8
jb 0x54f09
jmp 0x54efa
xorl %r8d, %r8d
movslq %r8d, %rsi
addq %rsi, %rcx
movq %rcx, (%rdi)
testq %rdx, %rdx
je 0x54f48
testl %r8d, %r8d
jne 0x54f48
movl $0x1, (%rdx)
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
negq %rax
xorq %rcx, %rax
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x54fde
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 0x54f7a
leaq (,%rsi,8), %r9
subq %rsi, %r9
xorl %eax, %eax
cmpq %rcx, %r9
jl 0x54fdd
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 0x54fb5
retq
cmpl $0x7f, %edx
ja 0x54feb
movb %dl, (%rdi)
movl $0x1, %eax
retq
movl %edx, %eax
cmpl $0x3fff, %edx           # imm = 0x3FFF
ja 0x55008
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 0x5502d
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 0x5505c
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_O3/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 0x55200
movb %sil, 0xe(%rsp)
movl $0x1, %ebp
jmp 0x552c1
movl %esi, %eax
cmpl $0x3fff, %esi           # imm = 0x3FFF
ja 0x55226
shrl $0x7, %eax
orb $-0x80, %al
movb %al, 0xe(%rsp)
andb $0x7f, %sil
movb %sil, 0xf(%rsp)
movl $0x2, %ebp
jmp 0x552c1
cmpl $0x1fffff, %esi         # imm = 0x1FFFFF
ja 0x55252
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 0x552c1
cmpl $0xfffffff, %esi        # imm = 0xFFFFFFF
ja 0x55289
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 0x552c1
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 0x28(%rbx), %rax
movq 0x30(%rbx), %rdi
leaq (%rdi,%r14), %r15
cmpq %r15, %rax
jbe 0x552db
movq 0x20(%rbx), %rax
jmp 0x55313
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 0x55334
movq %r15, 0x28(%rbx)
movq %rax, 0x20(%rbx)
movq 0x30(%rbx), %rdi
addq %rax, %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 0x55327
// File: /workspace/github_c_makefile_star2_O3/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 0x55364
movb %sil, 0xe(%rsp)
movl $0x1, %ebp
jmp 0x55425
movl %esi, %eax
cmpl $0x3fff, %esi           # imm = 0x3FFF
ja 0x5538a
shrl $0x7, %eax
orb $-0x80, %al
movb %al, 0xe(%rsp)
andb $0x7f, %sil
movb %sil, 0xf(%rsp)
movl $0x2, %ebp
jmp 0x55425
cmpl $0x1fffff, %esi         # imm = 0x1FFFFF
ja 0x553b6
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 0x55425
cmpl $0xfffffff, %esi        # imm = 0xFFFFFFF
ja 0x553ed
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 0x55425
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 0x28(%rbx), %rax
movq 0x30(%rbx), %rdi
leaq (%rdi,%r14), %r15
cmpq %r15, %rax
jbe 0x5543f
movq 0x20(%rbx), %rax
jmp 0x55477
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 0x55498
movq %r15, 0x28(%rbx)
movq %rax, 0x20(%rbx)
movq 0x30(%rbx), %rdi
addq %rax, %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 0x5548b