LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_decode.c
// Function: cram_ds_unique
static int cram_ds_unique(cram_block_compression_hdr *hdr, cram_codec *c,
                          int id) {
    int i, n_id = 0;
    enum cram_encoding e_type = 0;

    for (i = 0; i < DS_END; i++) {
        cram_codec *c;
        int bnum1, bnum2, old_n_id;

        if (!(c = hdr->codecs[i]))
            continue;

        bnum1 = cram_codec_to_id(c, &bnum2);

        old_n_id = n_id;
        if (bnum1 == id) {
            n_id++;
            e_type = c->codec;
        }
        if (bnum2 == id) {
            n_id++;
            e_type = c->codec;
        }

        if (n_id == old_n_id+2)
            n_id--; // len/val in same place counts once only.
    }

    return n_id == 1 ? e_type : 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
xorl %r13d, %r13d
xorl %r15d, %r15d
xorl %ebp, %ebp
movq 0x280(%r14,%r13,8), %r12
testq %r12, %r12
je 0x38c6d
movq %r12, %rdi
leaq 0x4(%rsp), %rsi
callq 0x928be
movl %r15d, %ecx
cmpl %ebx, %eax
jne 0x38c50
leal 0x1(%r15), %ecx
movl (%r12), %ebp
cmpl %ebx, 0x4(%rsp)
jne 0x38c5c
incl %ecx
movl (%r12), %ebp
addl $0x2, %r15d
xorl %eax, %eax
cmpl %r15d, %ecx
sete %al
subl %eax, %ecx
movl %ecx, %r15d
incq %r13
cmpq $0x2f, %r13
jne 0x38c27
xorl %eax, %eax
cmpl $0x1, %r15d
cmovel %ebp, %eax
addq $0x8, %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.h
// Function: cram_get_block_by_id
static inline cram_block *cram_get_block_by_id(cram_slice *slice, int id) {
  //fprintf(stderr, "%d\t%p\n", id, slice->block_by_id);
    uint32_t v = id;
    if (slice->block_by_id && v < 256) {
        return slice->block_by_id[v];
    } else {
        v = 256 + v % 251;
        if (slice->block_by_id &&
            slice->block_by_id[v] &&
            slice->block_by_id[v]->content_id == id)
            return slice->block_by_id[v];

        // Otherwise a linear search in case of collision
        int i;
        for (i = 0; i < slice->hdr->num_blocks; i++) {
            cram_block *b = slice->block[i];
            if (b && b->content_type == EXTERNAL && b->content_id == id)
                return b;
        }
    }
    return NULL;
}

// Assembly:
movq 0x18(%rdi), %rax
testq %rax, %rax
sete %cl
cmpl $0x100, %esi            # imm = 0x100
setae %dl
orb %cl, %dl
jne 0x38cac
movl %esi, %ecx
movq (%rax,%rcx,8), %rax
retq
testq %rax, %rax
je 0x38cdf
movl %esi, %ecx
movl $0x828cbfbf, %edx       # imm = 0x828CBFBF
imulq %rcx, %rdx
shrq $0x27, %rdx
imull $0xfb, %edx, %ecx
movl %esi, %edx
subl %ecx, %edx
shll $0x3, %edx
movq 0x800(%rax,%rdx), %rax
testq %rax, %rax
je 0x38cdf
cmpl %esi, 0xc(%rax)
je 0x38d0f
movq (%rdi), %rax
movslq 0x28(%rax), %rcx
testq %rcx, %rcx
jle 0x38d0d
movq 0x10(%rdi), %rdx
xorl %edi, %edi
movq (%rdx,%rdi,8), %rax
testq %rax, %rax
je 0x38d05
cmpl $0x4, 0x8(%rax)
jne 0x38d05
cmpl %esi, 0xc(%rax)
je 0x38d0f
incq %rdi
cmpq %rdi, %rcx
jne 0x38cf1
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_decode.c
// Function: cram_decode_tlen
static int cram_decode_tlen(cram_fd *fd, cram_container *c, cram_slice *s,
                            cram_block *blk, int64_t *tlen) {
    int out_sz = 1, r = 0;

    if (!c->comp_hdr->codecs[DS_TS]) return -1;
    if (CRAM_MAJOR_VERS(fd->version) < 4) {
        int32_t i32;
        r |= c->comp_hdr->codecs[DS_TS]
            ->decode(s, c->comp_hdr->codecs[DS_TS], blk,
                     (char *)&i32, &out_sz);
        *tlen = i32;
    } else {
        r |= c->comp_hdr->codecs[DS_TS]
            ->decode(s, c->comp_hdr->codecs[DS_TS], blk,
                     (char *)tlen, &out_sz);
    }
    return r;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl $0x1, (%rsp)
testq %rsi, %rsi
je 0x3a585
movq %r8, %rbx
cmpl $0x3ff, 0xc(%rdi)       # imm = 0x3FF
jg 0x3a58c
leaq 0x4(%rsp), %r14
movq %rsp, %r8
movq %rdx, %rdi
movq %rcx, %rdx
movq %r14, %rcx
callq *0x28(%rsi)
movslq (%r14), %rcx
movq %rcx, (%rbx)
jmp 0x3a59b
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x3a59b
movq %rsp, %r8
movq %rdx, %rdi
movq %rcx, %rdx
movq %rbx, %rcx
callq *0x28(%rsi)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_io.h
// Function: block_resize
static inline int block_resize(cram_block *b, size_t len) {
    if (b->alloc > len)
        return 0;

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

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

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq 0x28(%rdi), %rax
xorl %ebx, %ebx
cmpq %rsi, %rax
ja 0x3ad78
movq %rsi, %r14
movq %rdi, %r15
leaq 0x320(%rax), %rcx
shrq $0x2, %rcx
addq %rcx, %rax
addq $0x320, %rax            # imm = 0x320
cmpq %rsi, %rax
cmovaq %rax, %r14
movq 0x20(%rdi), %rdi
movq %r14, %rsi
callq 0x4840
testq %rax, %rax
je 0x3ad73
movq %r14, 0x28(%r15)
movq %rax, 0x20(%r15)
jmp 0x3ad78
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_decode.c
// Function: cram_decode_slice_mt
int cram_decode_slice_mt(cram_fd *fd, cram_container *c, cram_slice *s,
                         sam_hdr_t *bfd) {
    cram_decode_job *j;
    int nonblock;

    if (!fd->pool)
        return cram_decode_slice(fd, c, s, bfd);

    if (!(j = malloc(sizeof(*j))))
        return -1;

    j->fd = fd;
    j->c  = c;
    j->s  = s;
    j->h  = bfd;

    nonblock = hts_tpool_process_sz(fd->rqueue) ? 1 : 0;

    int saved_errno = errno;
    errno = 0;
    if (-1 == hts_tpool_dispatch2(fd->pool, fd->rqueue, cram_decode_slice_thread,
                                  j, nonblock)) {
        /* Would block */
        if (errno != EAGAIN)
            return -1;
        fd->job_pending = j;
    } else {
        fd->job_pending = NULL;
    }
    errno = saved_errno;

    // flush too
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbx
cmpq $0x0, 0x88b8(%rdi)
je 0x3d47e
movl $0x28, %edi
callq 0x4680
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x3d4af
movq %rax, %r14
movq %rbx, (%rax)
movq %r13, 0x8(%rax)
movq %r12, 0x10(%rax)
movq %r15, 0x18(%rax)
movq 0x88c0(%rbx), %rdi
callq 0x360c4
xorl %r12d, %r12d
testl %eax, %eax
setne %r12b
callq 0x4050
movq %rax, %r15
movl (%rax), %r13d
movl $0x0, (%rax)
movq 0x88b8(%rbx), %rdi
movq 0x88c0(%rbx), %rsi
leaq -0xa6(%rip), %rdx       # 0x3d3c3
movq %r14, %rcx
movl %r12d, %r8d
callq 0x36ca6
cmpl $-0x1, %eax
je 0x3d49d
xorl %r14d, %r14d
jmp 0x3d4a3
movq %rbx, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r15, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x38fa2
cmpl $0xb, (%r15)
jne 0x3d4af
movq %r14, 0x8970(%rbx)
movl %r13d, (%r15)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_decode.c
// Function: cram_get_bam_seq
int cram_get_bam_seq(cram_fd *fd, bam_seq_t **bam) {
    cram_record *cr;
    cram_container *c;
    cram_slice *s;

    if (!(cr = cram_get_seq(fd)))
        return -1;

    c = fd->ctr;
    s = c->slice;

    return cram_to_bam(fd->header, fd, s, cr, s->curr_rec-1, bam);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x3e09e
testq %rax, %rax
je 0x3e1e0
movq 0x18(%r14), %rdi
movq 0x38(%r14), %rcx
movq 0x90(%rcx), %rdx
movl 0xe4(%rdx), %r8d
decl %r8d
movq %r14, %rsi
movq %rax, %rcx
movq %rbx, %r9
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3d4c0
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_decode.c
// Function: add_md_char
static inline int add_md_char(cram_slice *s, int decode_md, char c, int32_t *md_dist) {
    if (decode_md) {
        BLOCK_APPEND_UINT(s->aux_blk, *md_dist);
        BLOCK_APPEND_CHAR(s->aux_blk, c);
        *md_dist = 0;
    }
    return 0;

 block_err:
    return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
xorl %ebx, %ebx
testl %esi, %esi
je 0x3e73c
movq %rdi, %r15
movq 0x90(%rdi), %r14
movq %rcx, 0x10(%rsp)
movl (%rcx), %r12d
movq 0x28(%r14), %rax
movq 0x30(%r14), %r13
leaq 0xb(%r13), %rbp
cmpq %rbp, %rax
movl %edx, 0xc(%rsp)
jbe 0x3e674
movq 0x20(%r14), %rax
jmp 0x3e6b0
leaq 0x320(%rax), %rcx
shrq $0x2, %rcx
addq %rcx, %rax
addq $0x320, %rax            # imm = 0x320
cmpq %rbp, %rax
cmovaq %rax, %rbp
movq 0x20(%r14), %rdi
movq %rbp, %rsi
callq 0x4840
testq %rax, %rax
je 0x3e737
movq %rbp, 0x28(%r14)
movq %rax, 0x20(%r14)
movq 0x30(%r14), %r13
addq %rax, %r13
movq %r13, %rdi
movl %r12d, %esi
callq 0x3e7d0
subq %r13, %rax
addq %rax, 0x30(%r14)
movq 0x90(%r15), %r14
movq 0x28(%r14), %rax
movq 0x30(%r14), %rcx
leaq 0x1(%rcx), %r15
cmpq %r15, %rax
jbe 0x3e6e3
movq 0x20(%r14), %rax
jmp 0x3e71f
leaq 0x320(%rax), %rcx
shrq $0x2, %rcx
addq %rcx, %rax
addq $0x320, %rax            # imm = 0x320
cmpq %r15, %rax
cmovaq %rax, %r15
movq 0x20(%r14), %rdi
movq %r15, %rsi
callq 0x4840
testq %rax, %rax
je 0x3e737
movq %r15, 0x28(%r14)
movq %rax, 0x20(%r14)
movq 0x30(%r14), %rcx
leaq 0x1(%rcx), %r15
movq %r15, 0x30(%r14)
movl 0xc(%rsp), %edx
movb %dl, (%rax,%rcx)
movq 0x10(%rsp), %rax
movl $0x0, (%rax)
jmp 0x3e73c
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x18, %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.h
// Function: block_append_uint
static inline int block_append_uint(cram_block *b, unsigned int i) {
    if (block_grow(b, 11) < 0)
        return -1;

    unsigned char *cp = &b->data[b->byte];
    b->byte += append_uint32(cp, i) - cp;
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
movq 0x28(%rdi), %rax
movq 0x30(%rdi), %r14
leaq 0xb(%r14), %r15
cmpq %r15, %rax
jbe 0x3e770
movq 0x20(%rbx), %rax
jmp 0x3e7a8
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 0x3e7c9
movq %r15, 0x28(%rbx)
movq %rax, 0x20(%rbx)
movq 0x30(%rbx), %r14
addq %rax, %r14
movq %r14, %rdi
movl %ebp, %esi
callq 0x3e7d0
subq %r14, %rax
addq %rax, 0x30(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x3e7be
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_encode.c
// Function: cram_update_curr_slice
void cram_update_curr_slice(cram_container *c, int version) {
    cram_slice *s = c->slice;
    if (c->multi_seq) {
        s->hdr->ref_seq_id    = -2;
        s->hdr->ref_seq_start = 0;
        s->hdr->ref_seq_span  = 0;
    } else if (c->curr_ref == -1 && CRAM_ge31(version)) {
        // Spec states span=0, but it broke our range queries.
        // See commit message for this and prior.
        s->hdr->ref_seq_id    = -1;
        s->hdr->ref_seq_start = 0;
        s->hdr->ref_seq_span  = 0;
    } else {
        s->hdr->ref_seq_id    = c->curr_ref;
        s->hdr->ref_seq_start = c->first_base;
        s->hdr->ref_seq_span  = MAX(0, c->last_base - c->first_base + 1);
    }
    s->hdr->num_records   = c->curr_rec;

    if (c->curr_slice == 0) {
        if (c->ref_seq_id != s->hdr->ref_seq_id)
            c->ref_seq_id  = s->hdr->ref_seq_id;
        c->ref_seq_start = c->first_base;
    }

    c->curr_slice++;
}

// Assembly:
movq 0x90(%rdi), %rcx
cmpl $0x0, 0xac(%rdi)
je 0x476ae
movq (%rcx), %rcx
movl $0xfffffffe, 0x4(%rcx)  # imm = 0xFFFFFFFE
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rcx)
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
jmp 0x47709
movl 0x78(%rdi), %eax
cmpl $-0x1, %eax
setne %dl
cmpl $0x301, %esi            # imm = 0x301
setl %sil
movq (%rcx), %rcx
orb %dl, %sil
jne 0x476de
movl $0xffffffff, 0x4(%rcx)  # imm = 0xFFFFFFFF
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rcx)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x47709
movl %eax, 0x4(%rcx)
movq 0xc8(%rdi), %rdx
movq %rdx, 0x8(%rcx)
movq 0xd0(%rdi), %rsi
subq %rdx, %rsi
leaq 0x1(%rsi), %rdx
xorl %r8d, %r8d
cmpq $-0x1, %rsi
cmovgeq %rdx, %r8
movq %r8, 0x10(%rcx)
movl 0x68(%rdi), %edx
movl %edx, 0x18(%rcx)
movl 0x5c(%rdi), %ecx
testl %ecx, %ecx
jne 0x47729
cmpl %eax, 0x4(%rdi)
je 0x4771e
movl %eax, 0x4(%rdi)
movq 0xc8(%rdi), %rax
movq %rax, 0x8(%rdi)
incl %ecx
movl %ecx, 0x5c(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_encode.c
// Function: bam_aux2i_end
static inline int bam_aux2i_end(const uint8_t *aux, const uint8_t *aux_end) {
    int type = *aux++;
    switch (type) {
        case 'c':
            if (aux_end - aux < 1) {
                errno = EINVAL;
                return 0;
            }
            return *(int8_t *)aux;
        case 'C':
            if (aux_end - aux < 1) {
                errno = EINVAL;
                return 0;
            }
            return *aux;
        case 's':
            if (aux_end - aux < 2) {
                errno = EINVAL;
                return 0;
            }
            return le_to_i16(aux);
        case 'S':
            if (aux_end - aux < 2) {
                errno = EINVAL;
                return 0;
            }
            return le_to_u16(aux);
        case 'i':
            if (aux_end - aux < 4) {
                errno = EINVAL;
                return 0;
            }
            return le_to_i32(aux);
        case 'I':
            if (aux_end - aux < 4) {
                errno = EINVAL;
                return 0;
            }
            return le_to_u32(aux);
        default:
            errno = EINVAL;
    }
    return 0;
}

// Assembly:
pushq %rax
movzbl (%rdi), %eax
incq %rdi
cmpl $0x62, %eax
jg 0x481f3
cmpl $0x43, %eax
je 0x4821c
cmpl $0x49, %eax
je 0x4820f
cmpl $0x53, %eax
jne 0x48232
subq %rdi, %rsi
cmpq $0x1, %rsi
jle 0x48232
movzwl (%rdi), %eax
jmp 0x4823f
cmpl $0x73, %eax
je 0x48229
cmpl $0x69, %eax
je 0x4820f
cmpl $0x63, %eax
jne 0x48232
subq %rdi, %rsi
testq %rsi, %rsi
jle 0x48232
movsbl (%rdi), %eax
jmp 0x4823f
subq %rdi, %rsi
cmpq $0x3, %rsi
jle 0x48232
movl (%rdi), %eax
jmp 0x4823f
subq %rdi, %rsi
testq %rsi, %rsi
jle 0x48232
movzbl (%rdi), %eax
jmp 0x4823f
subq %rdi, %rsi
cmpq $0x1, %rsi
jg 0x48241
callq 0x4050
movl $0x16, (%rax)
xorl %eax, %eax
popq %rcx
retq
movswl (%rdi), %eax
jmp 0x4823f
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_encode.c
// Function: cram_add_base
static int cram_add_base(cram_fd *fd, cram_container *c,
                         cram_slice *s, cram_record *r,
                         int pos, char base, char qual) {
    cram_feature f;
    f.B.pos = pos+1;
    f.B.code = 'B';
    f.B.base = base;
    f.B.qual = qual;
    if (cram_stats_add(c->stats[DS_BA], base) < 0) return -1;
    if (cram_stats_add(c->stats[DS_QS], qual) < 0) return -1;
    BLOCK_APPEND_CHAR(s->qual_blk, qual);
    return cram_add_feature(c, s, r, &f);

 block_err:
    return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r9d, %ebp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
incl %ecx
movl %ecx, (%rsp)
movl $0x42, 0x4(%rsp)
movl %r8d, 0x8(%rsp)
movl %r9d, 0xc(%rsp)
movq 0x1e8(%rdi), %rdi
movslq %r8d, %rsi
callq 0x56033
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
testl %eax, %eax
js 0x4888f
movq 0x158(%r15), %rdi
movsbq %bpl, %rsi
callq 0x56033
testl %eax, %eax
js 0x4888f
movq %rbx, 0x10(%rsp)
movq 0x78(%r14), %rbx
movq 0x28(%rbx), %rax
movq 0x30(%rbx), %rcx
leaq 0x1(%rcx), %r13
cmpq %r13, %rax
jbe 0x48835
movq 0x20(%rbx), %rax
jmp 0x48871
leaq 0x320(%rax), %rcx
shrq $0x2, %rcx
addq %rcx, %rax
addq $0x320, %rax            # imm = 0x320
cmpq %r13, %rax
cmovaq %rax, %r13
movq 0x20(%rbx), %rdi
movq %r13, %rsi
callq 0x4840
testq %rax, %rax
je 0x4888f
movq %r13, 0x28(%rbx)
movq %rax, 0x20(%rbx)
movq 0x30(%rbx), %rcx
leaq 0x1(%rcx), %r13
movq %r13, 0x30(%rbx)
movb %bpl, (%rax,%rcx)
movq %rsp, %rcx
movq %r15, %rdi
movq %r14, %rsi
movq 0x10(%rsp), %rdx
callq 0x48b74
movl %eax, %r12d
movl %r12d, %eax
addq $0x18, %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_encode.c
// Function: cram_add_quality
static int cram_add_quality(cram_fd *fd, cram_container *c,
                            cram_slice *s, cram_record *r,
                            int pos, char qual) {
    cram_feature f;
    f.Q.pos = pos+1;
    f.Q.code = 'Q';
    f.Q.qual = qual;
    if (cram_stats_add(c->stats[DS_QS], qual) < 0) return -1;
    BLOCK_APPEND_CHAR(s->qual_blk, qual);
    return cram_add_feature(c, s, r, &f);

 block_err:
    return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r8d, %ebp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
incl %ecx
movl %ecx, 0x8(%rsp)
movl $0x51, 0xc(%rsp)
movl %r8d, 0x10(%rsp)
movq 0x158(%rdi), %rdi
movslq %r8d, %rsi
callq 0x56033
testl %eax, %eax
js 0x48953
movq 0x78(%r14), %r13
movq 0x28(%r13), %rax
movq 0x30(%r13), %rcx
leaq 0x1(%rcx), %r12
cmpq %r12, %rax
jbe 0x488fc
movq 0x20(%r13), %rax
jmp 0x48938
leaq 0x320(%rax), %rcx
shrq $0x2, %rcx
addq %rcx, %rax
addq $0x320, %rax            # imm = 0x320
cmpq %r12, %rax
cmovaq %rax, %r12
movq 0x20(%r13), %rdi
movq %r12, %rsi
callq 0x4840
testq %rax, %rax
je 0x48953
movq %r12, 0x28(%r13)
movq %rax, 0x20(%r13)
movq 0x30(%r13), %rcx
leaq 0x1(%rcx), %r12
movq %r12, 0x30(%r13)
movb %bpl, (%rax,%rcx)
leaq 0x8(%rsp), %rcx
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x48b74
addq $0x18, %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_encode.c
// Function: cram_add_feature
static int cram_add_feature(cram_container *c, cram_slice *s,
                            cram_record *r, cram_feature *f) {
    if (s->nfeatures >= s->afeatures) {
        s->afeatures = s->afeatures ? s->afeatures*2 : 1024;
        s->features = realloc(s->features, s->afeatures*sizeof(*s->features));
        if (!s->features)
            return -1;
    }

    if (!r->nfeature++) {
        r->feature = s->nfeatures;
        if (cram_stats_add(c->stats[DS_FP], f->X.pos) < 0)
            return -1;
    } else {
        if (cram_stats_add(c->stats[DS_FP],
                           f->X.pos - s->features[r->feature + r->nfeature-2].X.pos) < 0)
            return -1;

    }
    if (cram_stats_add(c->stats[DS_FC], f->X.code) < 0)
        return -1;

    s->features[s->nfeatures++] = *f;

    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %r15
movl 0x54(%rsi), %eax
cmpl %eax, 0x50(%rsi)
jb 0x48bbb
leal (%rax,%rax), %ecx
testl %eax, %eax
movl $0x400, %esi            # imm = 0x400
cmovnel %ecx, %esi
movl %esi, 0x54(%r14)
movq 0x48(%r14), %rdi
shlq $0x4, %rsi
callq 0x4840
movq %rax, 0x48(%r14)
testq %rax, %rax
je 0x48c4a
movl 0x88(%r12), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0x88(%r12)
testl %eax, %eax
je 0x48bf9
movq 0x1d8(%r15), %rdi
movslq (%rbx), %rsi
movq 0x48(%r14), %rcx
movl 0x84(%r12), %edx
addl %edx, %eax
decl %eax
shlq $0x4, %rax
movslq (%rcx,%rax), %rax
subq %rax, %rsi
jmp 0x48c0f
movl 0x50(%r14), %eax
movl %eax, 0x84(%r12)
movq 0x1d8(%r15), %rdi
movslq (%rbx), %rsi
callq 0x56033
testl %eax, %eax
js 0x48c4a
movq 0x1d0(%r15), %rdi
movslq 0x4(%rbx), %rsi
callq 0x56033
testl %eax, %eax
js 0x48c4a
movq 0x48(%r14), %rax
movl 0x50(%r14), %ecx
leal 0x1(%rcx), %edx
movl %edx, 0x50(%r14)
shlq $0x4, %rcx
movups (%rbx), %xmm0
movups %xmm0, (%rax,%rcx)
xorl %eax, %eax
jmp 0x48c4f
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_index.c
// Function: kget_int32
static int kget_int32(kstring_t *k, size_t *pos, int32_t *val_p) {
    int sign = 1;
    int32_t val = 0;
    size_t p = *pos;

    while (p < k->l && (k->s[p] == ' ' || k->s[p] == '\t'))
        p++;

    if (p < k->l && k->s[p] == '-')
        sign = -1, p++;

    if (p >= k->l || !(k->s[p] >= '0' && k->s[p] <= '9'))
        return -1;

    while (p < k->l && k->s[p] >= '0' && k->s[p] <= '9') {
        int digit = k->s[p++]-'0';
        val = val*10 + digit;
    }

    *pos = p;
    *val_p = sign*val;

    return 0;
}

// Assembly:
movq (%rdx), %r8
movl $0x1, %r9d
cmpq %rdi, %r8
jae 0x49cae
movzbl (%rsi,%r8), %eax
cmpl $0x20, %eax
je 0x49c8d
cmpl $0x9, %eax
jne 0x49c9b
incq %r8
cmpq %r8, %rdi
jne 0x49c7e
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
xorl %r9d, %r9d
cmpb $0x2d, %al
sete %r9b
addq %r9, %r8
negl %r9d
orl $0x1, %r9d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rdi, %r8
jae 0x49cf7
movb (%rsi,%r8), %r10b
addb $-0x30, %r10b
cmpb $0x9, %r10b
ja 0x49cf7
xorl %eax, %eax
movb (%rsi,%r8), %r10b
addb $-0x30, %r10b
cmpb $0x9, %r10b
ja 0x49cec
incq %r8
movzbl %r10b, %r10d
leal (%rax,%rax,4), %eax
leal (%r10,%rax,2), %eax
cmpq %r8, %rdi
jne 0x49cc8
movq %rdi, %r8
imull %r9d, %eax
movq %r8, (%rdx)
movl %eax, (%rcx)
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_index.c
// Function: link_index
static void link_index(cram_fd *fd) {
    int i;
    cram_index *e_last = NULL;

    for (i = 0; i < fd->index_sz; i++) {
        e_last = link_index_(&fd->index[i], e_last);
    }

    if (e_last)
        e_last->e_next = NULL;
}

// Assembly:
cmpl $0x0, 0x8870(%rdi)
jle 0x49d48
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %r14d, %r14d
xorl %r15d, %r15d
xorl %eax, %eax
movq 0x8878(%rbx), %rdi
addq %r14, %rdi
movq %rax, %rsi
callq 0x4acc5
incq %r15
movslq 0x8870(%rbx), %rcx
addq $0x38, %r14
cmpq %rcx, %r15
jl 0x49d11
testq %rax, %rax
je 0x49d43
movq $0x0, 0x30(%rax)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_index.c
// Function: cram_index_free
void cram_index_free(cram_fd *fd) {
    int i;

    if (!fd->index)
        return;

    for (i = 0; i < fd->index_sz; i++) {
        cram_index_free_recurse(&fd->index[i]);
    }
    free(fd->index);

    fd->index = NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x8878(%rdi), %rdi
testq %rdi, %rdi
je 0x49da5
cmpl $0x0, 0x8870(%rbx)
jle 0x49d95
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x8878(%rbx), %rdi
addq %r14, %rdi
callq 0x49dab
incq %r15
movslq 0x8870(%rbx), %rax
addq $0x38, %r14
cmpq %rax, %r15
jl 0x49d6c
movq 0x8878(%rbx), %rdi
callq 0x45c0
movq $0x0, 0x8878(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_index.c
// Function: cram_index_free_recurse
static void cram_index_free_recurse(cram_index *e) {
    if (e->e) {
        int i;
        for (i = 0; i < e->nslice; i++) {
            cram_index_free_recurse(&e->e[i]);
        }
        free(e->e);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x49df0
cmpl $0x0, (%rbx)
jle 0x49de6
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x8(%rbx), %rdi
addq %r14, %rdi
callq 0x49dab
incq %r15
movslq (%rbx), %rax
addq $0x38, %r14
cmpq %rax, %r15
jl 0x49dc7
movq 0x8(%rbx), %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x45c0
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_index.c
// Function: cram_index_last
cram_index *cram_index_last(cram_fd *fd, int refid, cram_index *from) {
    int slice;

    if (refid+1 < 0 || refid+1 >= fd->index_sz)
        return NULL;

    if (!from)
        from = &fd->index[refid+1];

    // Ref with nothing aligned against it.
    if (!from->e)
        return NULL;

    slice = fd->index[refid+1].nslice - 1;

    // e is the last entry in the nested containment list, but it may
    // contain further slices within it.
    cram_index *e = &from->e[slice];
    while (e->e_next)
        e = e->e_next;

    return e;
}

// Assembly:
cmpl $-0x1, %esi
jl 0x4a036
incl %esi
cmpl 0x8870(%rdi), %esi
jge 0x4a036
movl %esi, %eax
testq %rdx, %rdx
jne 0x4a006
imulq $0x38, %rax, %rdx
addq 0x8878(%rdi), %rdx
movq 0x8(%rdx), %rcx
testq %rcx, %rcx
je 0x4a036
movq 0x8878(%rdi), %rdx
imulq $0x38, %rax, %rax
movslq (%rdx,%rax), %rax
imulq $0x38, %rax, %rax
addq %rax, %rcx
addq $-0x38, %rcx
movq %rcx, %rax
movq 0x30(%rcx), %rcx
testq %rcx, %rcx
jne 0x4a029
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_index.c
// Function: cram_index_query_last
cram_index *cram_index_query_last(cram_fd *fd, int refid, hts_pos_t end) {
    cram_index *e = NULL, *prev_e;
    do {
        prev_e = e;
        e = cram_index_query(fd, refid, end, prev_e);
    } while (e);

    if (!prev_e)
        return NULL;
    e = prev_e;

    // Note: offset of e and e->e_next may be the same if we're using a
    // multi-ref container where a single container generates multiple
    // index entries.
    //
    // We need to keep iterating until offset differs in order to find
    // the genuine file offset for the end of container.
    do {
        prev_e = e;
        e = e->e_next;
    } while (e && e->offset == prev_e->offset);

    return prev_e;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %r15
xorl %eax, %eax
movq %rax, %rbx
movq %r15, %rdi
movl %ebp, %esi
movq %r14, %rdx
movq %rax, %rcx
callq 0x49df6
testq %rax, %rax
jne 0x4a04a
testq %rbx, %rbx
je 0x4a07f
movq %rbx, %rax
movq 0x30(%rbx), %rbx
testq %rbx, %rbx
je 0x4a081
movq 0x28(%rbx), %rcx
cmpq 0x28(%rax), %rcx
je 0x4a067
jmp 0x4a081
xorl %eax, %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_index.c
// Function: cram_seek_to_refpos
int cram_seek_to_refpos(cram_fd *fd, cram_range *r) {
    int ret = 0;
    cram_index *e;

    if (r->refid == HTS_IDX_NONE) {
        ret = -2; goto err;
    }

    // Ideally use an index, so see if we have one.
    if ((e = cram_index_query(fd, r->refid, r->start, NULL))) {
        if (0 != cram_seek(fd, e->offset, SEEK_SET)) {
            ret = -1; goto err;
        }
    } else {
        // Absent from index, but this most likely means it simply has no data.
        ret = -2; goto err;
    }

    pthread_mutex_lock(&fd->range_lock);
    fd->range = *r;
    if (r->refid == HTS_IDX_NOCOOR) {
        fd->range.refid = -1;
        fd->range.start = 0;
    } else if (r->refid == HTS_IDX_START || r->refid == HTS_IDX_REST) {
        fd->range.refid = -2; // special case in cram_next_slice
    }
    pthread_mutex_unlock(&fd->range_lock);

    if (fd->ctr) {
        cram_free_container(fd->ctr);
        if (fd->ctr_mt && fd->ctr_mt != fd->ctr)
            cram_free_container(fd->ctr_mt);
        fd->ctr = NULL;
        fd->ctr_mt = NULL;
        fd->ooc = 0;
        fd->eof = 0;
    }

    return 0;

 err:
    // It's unlikely fd->range will be accessed after EOF or error,
    // but this maintains identical behaviour to the previous code.
    pthread_mutex_lock(&fd->range_lock);
    fd->range = *r;
    pthread_mutex_unlock(&fd->range_lock);
    return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movl (%rsi), %esi
movl $0xfffffffe, %ebp       # imm = 0xFFFFFFFE
cmpl $-0x5, %esi
je 0x4a0cf
movq 0x8(%r14), %rdx
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x49df6
testq %rax, %rax
je 0x4a0cf
movq 0x28(%rax), %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x53001
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testl %eax, %eax
je 0x4a109
leaq 0x8918(%rbx), %r15
movq %r15, %rdi
callq 0x4750
movups (%r14), %xmm0
movups %xmm0, 0x258(%rbx)
movq 0x10(%r14), %rax
movq %rax, 0x268(%rbx)
movq %r15, %rdi
callq 0x4340
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8918(%rbx), %r15
movq %r15, %rdi
callq 0x4750
movq 0x10(%r14), %rax
movq %rax, 0x268(%rbx)
movups (%r14), %xmm0
movups %xmm0, 0x258(%rbx)
movl (%r14), %eax
leal 0x4(%rax), %ecx
cmpl $0x2, %ecx
jae 0x4a148
leaq 0x258(%rbx), %rax
movl $0xfffffffe, (%rax)     # imm = 0xFFFFFFFE
jmp 0x4a162
cmpl $-0x2, %eax
jne 0x4a162
movl $0xffffffff, 0x258(%rbx) # imm = 0xFFFFFFFF
movq $0x0, 0x260(%rbx)
movq %r15, %rdi
callq 0x4340
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0x4a1a9
leaq 0x38(%rbx), %r14
callq 0x4fe2e
movq 0x40(%rbx), %rdi
testq %rdi, %rdi
je 0x4a18f
cmpq (%r14), %rdi
je 0x4a18f
callq 0x4fe2e
xorl %ebp, %ebp
movl %ebp, 0x8978(%rbx)
movl %ebp, 0x8890(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
jmp 0x4a0fc
xorl %ebp, %ebp
jmp 0x4a0fc
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_index.c
// Function: cram_num_containers_between
int64_t cram_num_containers_between(cram_fd *fd,
                                    off_t cstart, off_t cend,
                                    int64_t *first, int64_t *last) {
    int64_t nc = 0, i;
    int64_t last_pos = -99;
    int64_t l_first = -1, l_last = -1;

    for (i = 0; i < fd->index_sz; i++) {
        int j = i+1 == fd->index_sz ? 0 : i+1; // maps "*" to end
        nc += cram_num_containers_between_(&fd->index[j], &last_pos, nc,
                                           cstart, cend, &l_first, &l_last);
    }

    if (first)
        *first = l_first;
    if (last)
        *last = l_last;

    return l_last - l_first + 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r8, 0x28(%rsp)
movq %rcx, 0x20(%rsp)
movq $-0x63, 0x30(%rsp)
movq $-0x1, %rax
movq %rax, 0x10(%rsp)
movq %rax, 0x18(%rsp)
movslq 0x8870(%rdi), %rax
testq %rax, %rax
jle 0x4a8ef
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
xorl %ebp, %ebp
leaq 0x10(%rsp), %r14
xorl %ebx, %ebx
incq %rbx
cmpq %rax, %rbx
movl $0x0, %eax
cmovneq %rbx, %rax
imulq $0x38, %rax, %rdi
addq 0x8878(%r13), %rdi
leaq 0x18(%rsp), %rax
movq %rax, (%rsp)
leaq 0x30(%rsp), %rsi
movq %rbp, %rdx
movq %r12, %rcx
movq %r15, %r8
movq %r14, %r9
callq 0x4a92a
addq %rax, %rbp
movslq 0x8870(%r13), %rax
cmpq %rax, %rbx
jl 0x4a8a7
movq 0x20(%rsp), %rcx
testq %rcx, %rcx
je 0x4a901
movq 0x10(%rsp), %rax
movq %rax, (%rcx)
movq 0x18(%rsp), %rax
movq 0x28(%rsp), %rcx
testq %rcx, %rcx
je 0x4a913
movq %rax, (%rcx)
subq 0x10(%rsp), %rax
incq %rax
addq $0x38, %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_index.c
// Function: cram_num_containers_between_
static int64_t cram_num_containers_between_(cram_index *e, int64_t *last_pos,
                                            int64_t nct,
                                            off_t cstart, off_t cend,
                                            int64_t *first, int64_t *last) {
    int64_t nc = 0, i;

    if (e->offset) {
        if (e->offset != *last_pos) {
            if (e->offset >= cstart && (!cend || e->offset <= cend)) {
                if (first && *first < 0)
                    *first = nct;
                if (last)
                    *last = nct;
            }
            nc++;
        }
        // else a new multi-ref in same container
        *last_pos = e->offset;
    }

    for (i = 0; i < e->nslice; i++)
        nc += cram_num_containers_between_(&e->e[i], last_pos, nc + nct,
                                           cstart, cend, first, last);

    return nc;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, %r15
movq %r8, %r13
movq %rdx, %r10
movq %rsi, %rbp
movq 0x60(%rsp), %r11
movq 0x28(%rdi), %rax
testq %rax, %rax
je 0x4a95c
cmpq (%rbp), %rax
jne 0x4a960
xorl %ebx, %ebx
jmp 0x4a990
xorl %ebx, %ebx
jmp 0x4a998
movl $0x1, %ebx
cmpq %rcx, %rax
jl 0x4a990
testq %r13, %r13
setne %dl
cmpq %r13, %rax
setg %al
testb %al, %dl
jne 0x4a990
testq %r15, %r15
je 0x4a988
cmpq $0x0, (%r15)
jns 0x4a988
movq %r10, (%r15)
testq %r11, %r11
je 0x4a990
movq %r10, (%r11)
movq 0x28(%rdi), %rax
movq %rax, (%rbp)
cmpl $0x0, (%rdi)
jle 0x4aa00
xorl %r14d, %r14d
xorl %r12d, %r12d
movq %rcx, 0x18(%rsp)
movq %rdi, 0x10(%rsp)
movq %rbx, 0x20(%rsp)
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rdi
addq %r14, %rdi
leaq (%rbx,%r10), %rdx
movq %r11, (%rsp)
movq %rbp, %rsi
movq %r13, %r8
movq %r15, %r9
movq %r10, %rbx
callq 0x4a92a
movq 0x60(%rsp), %r11
movq 0x10(%rsp), %rdi
movq %rbx, %r10
movq 0x20(%rsp), %rbx
movq 0x18(%rsp), %rcx
addq %rax, %rbx
incq %r12
movslq (%rdi), %rax
addq $0x38, %r14
cmpq %rax, %r12
jl 0x4a9ad
movq %rbx, %rax
addq $0x28, %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_index.c
// Function: cram_container_num2offset
off_t cram_container_num2offset(cram_fd *fd, int64_t num) {
    int nc = 0, i;
    int64_t last_pos = -9;
    cram_index *e = NULL;

    for (i = 0; i < fd->index_sz; i++) {
        int j = i+1 == fd->index_sz ? 0 : i+1; // maps "*" to end
        if (!fd->index[j].nslice)
            continue;
        if ((e = cram_container_num2offset_(&fd->index[j], num,
                                            &last_pos, &nc)))
            break;
    }

    return e ? e->offset : -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl $0x0, 0xc(%rsp)
movq $-0x9, 0x10(%rsp)
movl 0x8870(%rdi), %ecx
movq $-0x1, %rax
testl %ecx, %ecx
jle 0x4aaac
movq %rsi, %r14
movq %rdi, %r15
xorl %ebp, %ebp
leaq 0x10(%rsp), %r12
leaq 0xc(%rsp), %r13
xorl %ebx, %ebx
incl %ebx
cmpl %ecx, %ebx
movl %ebx, %eax
cmovel %ebp, %eax
movq 0x8878(%r15), %rdi
imulq $0x38, %rax, %rax
cmpl $0x0, (%rdi,%rax)
je 0x4aa94
addq %rax, %rdi
movl %r14d, %esi
movq %r12, %rdx
movq %r13, %rcx
callq 0x4aabb
testq %rax, %rax
jne 0x4aaa8
movl 0x8870(%r15), %ecx
cmpl %ecx, %ebx
jl 0x4aa64
movq $-0x1, %rax
jmp 0x4aaac
movq 0x28(%rax), %rax
addq $0x18, %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_index.c
// Function: cram_container_num2offset_
static cram_index *cram_container_num2offset_(cram_index *e, int num,
                                              int64_t *last_pos, int *nc) {
    if (e->offset) {
        if (e->offset != *last_pos) {
            if (*nc == num)
                return e;
            (*nc)++;
        }
        // else a new multi-ref in same container
        *last_pos = e->offset;
    }

    int i;
    for (i = 0; i < e->nslice; i++) {
        cram_index *tmp = cram_container_num2offset_(&e->e[i], num,
                                                     last_pos, nc);
        if (tmp)
            return tmp;
    }


    return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, %r15
movl %esi, %ebp
movq %rdi, %rbx
movq 0x28(%rdi), %rax
testq %rax, %rax
je 0x4aaee
cmpq (%r15), %rax
je 0x4aaeb
movl (%r14), %ecx
cmpl %ebp, %ecx
je 0x4ab28
incl %ecx
movl %ecx, (%r14)
movq %rax, (%r15)
cmpl $0x0, (%rbx)
jle 0x4ab21
xorl %r12d, %r12d
xorl %r13d, %r13d
movq 0x8(%rbx), %rdi
addq %r12, %rdi
movl %ebp, %esi
movq %r15, %rdx
movq %r14, %rcx
callq 0x4aabb
testq %rax, %rax
jne 0x4ab25
incq %r13
movslq (%rbx), %rax
addq $0x38, %r12
cmpq %rax, %r13
jl 0x4aaf9
xorl %ebx, %ebx
jmp 0x4ab28
movq %rax, %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_index.c
// Function: cram_container_offset2num
int64_t cram_container_offset2num(cram_fd *fd, off_t pos) {
    int nc = 0, i;
    int64_t last_pos = -9;
    cram_index *e = NULL;

    for (i = 0; i < fd->index_sz; i++) {
        int j = i+1 == fd->index_sz ? 0 : i+1; // maps "*" to end
        if (!fd->index[j].nslice)
            continue;
        if ((e = cram_container_offset2num_(&fd->index[j], pos,
                                            &last_pos, &nc)))
            break;
    }

    return e ? nc : -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl $0x0, 0xc(%rsp)
movq $-0x9, 0x10(%rsp)
movl 0x8870(%rdi), %eax
testl %eax, %eax
setg %bpl
jle 0x4abbe
movq %rsi, %rbx
movq %rdi, %r14
xorl %r13d, %r13d
leaq 0xc(%rsp), %r12
xorl %r15d, %r15d
incl %r15d
cmpl %eax, %r15d
movl %r15d, %eax
cmovel %r13d, %eax
movq 0x8878(%r14), %rdi
imulq $0x38, %rax, %rax
cmpl $0x0, (%rdi,%rax)
je 0x4abae
addq %rax, %rdi
movq %rbx, %rsi
leaq 0x10(%rsp), %rdx
movq %r12, %rcx
callq 0x4abe1
testq %rax, %rax
jne 0x4abbe
movl 0x8870(%r14), %eax
cmpl %eax, %r15d
setl %bpl
jl 0x4ab78
movslq 0xc(%rsp), %rcx
testb $0x1, %bpl
movq $-0x1, %rax
cmovneq %rcx, %rax
addq $0x18, %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_index.c
// Function: cram_container_offset2num_
static cram_index *cram_container_offset2num_(cram_index *e, off_t pos,
                                              int64_t *last_pos, int *nc) {
    if (e->offset) {
        if (e->offset != *last_pos) {
            if (e->offset >= pos)
                return e;
            (*nc)++;
        }
        // else a new multi-ref in same container
        *last_pos = e->offset;
    }

    int i;
    for (i = 0; i < e->nslice; i++) {
        cram_index *tmp = cram_container_offset2num_(&e->e[i], pos,
                                                     last_pos, nc);
        if (tmp)
            return tmp;
    }


    return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
movq 0x28(%rdi), %rax
testq %rax, %rax
je 0x4ac11
cmpq (%r15), %rax
je 0x4ac0e
cmpq %r12, %rax
jge 0x4ac4b
incl (%r14)
movq %rax, (%r15)
cmpl $0x0, (%rbx)
jle 0x4ac44
xorl %r13d, %r13d
xorl %ebp, %ebp
movq 0x8(%rbx), %rdi
addq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x4abe1
testq %rax, %rax
jne 0x4ac48
incq %rbp
movslq (%rbx), %rax
addq $0x38, %r13
cmpq %rax, %rbp
jl 0x4ac1b
xorl %ebx, %ebx
jmp 0x4ac4b
movq %rax, %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_index.c
// Function: cram_index_extents
int cram_index_extents(cram_fd *fd, int refid, hts_pos_t start, hts_pos_t end,
                       off_t *first, off_t *last) {
    cram_index *ci;

    if (first) {
        if (!(ci = cram_index_query(fd, refid, start, NULL)))
            return -1;
        *first = ci->offset;
    }

    if (last) {
        if (!(ci = cram_index_query_last(fd, refid, end)))
            return -1;
        *last = ci->offset;
    }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %r9, %rbx
movq %rcx, %r14
movl %esi, %ebp
movq %rdi, %r12
testq %r8, %r8
je 0x4ac90
movq %r8, %r15
movq %r12, %rdi
movl %ebp, %esi
xorl %ecx, %ecx
callq 0x49df6
testq %rax, %rax
je 0x4acb3
movq 0x28(%rax), %rax
movq %rax, (%r15)
xorl %r15d, %r15d
testq %rbx, %rbx
je 0x4acb9
movq %r12, %rdi
movl %ebp, %esi
movq %r14, %rdx
callq 0x4a039
testq %rax, %rax
je 0x4acb3
movq 0x28(%rax), %rax
movq %rax, (%rbx)
jmp 0x4acb9
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
movl %r15d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_index.c
// Function: link_index_
static cram_index *link_index_(cram_index *e, cram_index *e_last) {
    int i;
    if (e_last)
        e_last->e_next = e;

    // We don't want to link in the top-level cram_index with
    // offset=0 and start/end = INT_MIN/INT_MAX.
    if (e->offset)
        e_last = e;

    for (i = 0; i < e->nslice; i++)
        e_last = link_index_(&e->e[i], e_last);

    return e_last;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rax
movq %rdi, %rbx
testq %rsi, %rsi
je 0x4acd9
movq %rbx, 0x30(%rax)
cmpq $0x0, 0x28(%rbx)
cmovneq %rbx, %rax
cmpl $0x0, (%rbx)
jle 0x4ad0b
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x8(%rbx), %rdi
addq %r14, %rdi
movq %rax, %rsi
callq 0x4acc5
incq %r15
movslq (%rbx), %rcx
addq $0x38, %r14
cmpq %rcx, %r15
jl 0x4aced
popq %rbx
popq %r14
popq %r15
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/../htslib/hfile.h
// Function: hwrite
static inline ssize_t HTS_RESULT_USED
hwrite(hFILE *fp, const void *buffer, size_t nbytes)
{
    HTSLIB_EXPORT
    extern ssize_t hwrite2(hFILE *, const void *, size_t, size_t);
    HTSLIB_EXPORT
    extern int hfile_set_blksize(hFILE *fp, size_t bufsiz);

    if (!fp->mobile) {
        size_t n = fp->limit - fp->begin;
        if (n < nbytes) {
            hfile_set_blksize(fp, fp->limit - fp->buffer + nbytes);
            fp->end = fp->limit;
        }
    }

    size_t n = fp->limit - fp->begin;
    if (nbytes >= n && fp->begin == fp->buffer) {
        // Go straight to hwrite2 if the buffer is empty and the request
        // won't fit.
        return hwrite2(fp, buffer, nbytes, 0);
    }

    if (n > nbytes) n = nbytes;
    memcpy(fp->begin, buffer, n);
    fp->begin += n;
    return (n==nbytes)? (ssize_t) n : hwrite2(fp, buffer, nbytes, n);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
testb $0x2, 0x30(%rdi)
movq 0x18(%rdi), %r12
jne 0x4b34f
movq %r12, %rax
subq 0x8(%r15), %rax
cmpq %rbx, %rax
jae 0x4b34f
addq %rbx, %r12
subq (%r15), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0xee24
movq 0x18(%r15), %r12
movq %r12, 0x10(%r15)
movq 0x8(%r15), %rdi
subq %rdi, %r12
cmpq %rbx, %r12
ja 0x4b360
cmpq (%r15), %rdi
je 0x4b38b
cmpq %rbx, %r12
movq %rbx, %r13
cmovbq %r12, %r13
movq %r14, %rsi
movq %r13, %rdx
callq 0x43c0
addq %r13, 0x8(%r15)
cmpq %rbx, %r12
jb 0x4b38e
movq %r13, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
xorl %r13d, %r13d
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
movq %r13, %rcx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xf300
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_io.c
// Function: itf8_put_blk
int itf8_put_blk(cram_block *blk, int32_t val) {
    char buf[5];
    int sz;

    sz = itf8_put(buf, val);
    BLOCK_APPEND(blk, buf, sz);
    return sz;

 block_err:
    return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %eax
movq %rdi, %rbx
cmpl $0x7f, %esi
ja 0x4bfa0
movb %al, 0x3(%rsp)
movl $0x1, %ebp
jmp 0x4c037
movl %eax, %ecx
cmpl $0x3fff, %eax           # imm = 0x3FFF
ja 0x4bfbe
shrl $0x8, %ecx
orb $-0x80, %cl
movb %cl, 0x3(%rsp)
movb %al, 0x4(%rsp)
movl $0x2, %ebp
jmp 0x4c037
cmpl $0x1fffff, %eax         # imm = 0x1FFFFF
ja 0x4bfde
shrl $0x10, %ecx
orb $-0x40, %cl
movb %cl, 0x3(%rsp)
movb %ah, 0x4(%rsp)
movb %al, 0x5(%rsp)
movl $0x3, %ebp
jmp 0x4c037
cmpl $0xfffffff, %eax        # imm = 0xFFFFFFF
ja 0x4c007
shrl $0x18, %ecx
orb $-0x20, %cl
movb %cl, 0x3(%rsp)
movl %eax, %ecx
shrl $0x10, %ecx
movb %cl, 0x4(%rsp)
movb %ah, 0x5(%rsp)
movb %al, 0x6(%rsp)
movl $0x4, %ebp
jmp 0x4c037
shrl $0x1c, %ecx
orb $-0x10, %cl
movb %cl, 0x3(%rsp)
movl %eax, %ecx
shrl $0x14, %ecx
movb %cl, 0x4(%rsp)
movl %eax, %ecx
shrl $0xc, %ecx
movb %cl, 0x5(%rsp)
movl %eax, %ecx
shrl $0x4, %ecx
movb %cl, 0x6(%rsp)
andb $0xf, %al
movb %al, 0x7(%rsp)
movl $0x5, %ebp
movl %ebp, %r14d
movq 0x28(%rbx), %rax
movq 0x30(%rbx), %rdi
leaq (%rdi,%r14), %r15
cmpq %r15, %rax
jbe 0x4c051
movq 0x20(%rbx), %rax
jmp 0x4c089
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 0x4c0aa
movq %r15, 0x28(%rbx)
movq %rax, 0x20(%rbx)
movq 0x30(%rbx), %rdi
addq %rax, %rdi
leaq 0x3(%rsp), %rsi
movq %r14, %rdx
callq 0x43c0
addq %r14, 0x30(%rbx)
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x4c09d
// File: /workspace/github_c_makefile_star2_O3/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), %rcx
leaq 0x4(%rcx), %r14
cmpq %r14, %rax
jbe 0x4c3f1
movq 0x20(%rbx), %rax
jmp 0x4c429
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 0x4c456
movq %r14, 0x28(%rbx)
movq %rax, 0x20(%rbx)
movq 0x30(%rbx), %rcx
movl %ebp, %edx
shrl $0x8, %edx
movl %ebp, %esi
shrl $0x10, %esi
movl %ebp, %edi
shrl $0x18, %edi
movb %bpl, (%rax,%rcx)
movb %dl, 0x1(%rax,%rcx)
movb %sil, 0x2(%rax,%rcx)
movb %dil, 0x3(%rax,%rcx)
addq $0x4, 0x30(%rbx)
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x4c451
// File: /workspace/github_c_makefile_star2_O3/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 0x4c6b0
xorl %ecx, %ecx
movq %rcx, (%rax)
movl %ebp, 0x8(%rax)
movl %ebx, 0xc(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rax)
movq %rcx, 0x30(%rax)
movl $0x7, 0x38(%rax)
movups %xmm0, 0x10(%rax)
movq %rcx, 0x40(%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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(%rdi), %r12
movq 0x10(%rdi), %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 0x4c917
testb $0x2, 0x30(%r15)
je 0x4c917
leaq 0xc(%rsp), %rsi
movl $0x4, %edx
movq %r15, %rdi
movq %r14, %rcx
callq 0xf129
movq %rax, %r14
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq $0x4, %r14
jne 0x4c92d
movl 0xc(%rsp), %eax
movl %eax, (%rbx)
movl $0x4, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq