LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/header.c
// Function: sam_hdr_remove_tag_id
int sam_hdr_remove_tag_id(sam_hdr_t *bh,
        const char *type,
        const char *ID_key,
        const char *ID_value,
        const char *key) {
    sam_hrecs_t *hrecs;
    if (!bh || !type || !key)
        return -1;

    if (!(hrecs = bh->hrecs)) {
        if (sam_hdr_fill_hrecs(bh) != 0)
            return -1;
        hrecs = bh->hrecs;
    }

    sam_hrec_type_t *ty = sam_hrecs_find_type_id(hrecs, type, ID_key, ID_value);
    if (!ty)
        return -1;

    int ret = sam_hrecs_remove_key(hrecs, ty, key);
    if (!ret && hrecs->dirty)
        redact_header_text(bh);

    return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r12
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %dl
orb %al, %dl
testq %r8, %r8
sete %al
pushq $-0x1
popq %rbp
orb %dl, %al
jne 0x6cde5
movq %r8, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq 0x38(%rdi), %r13
testq %r13, %r13
je 0x6cdd5
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x6a8fd
testq %rax, %rax
je 0x6cde5
movq %r13, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x6ce00
movl %eax, %ebp
testl %eax, %eax
jne 0x6cde5
xorl %ebp, %ebp
cmpl $0x0, 0x90(%r13)
je 0x6cde5
movq %rbx, %rdi
callq 0x6a1b4
jmp 0x6cde5
movq %rcx, (%rsp)
movq %rbx, %rdi
callq 0x6933d
testl %eax, %eax
je 0x6cdf6
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x38(%rbx), %r13
movq (%rsp), %rcx
jmp 0x6cd98
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/header.c
// Function: sam_hrecs_remove_key
int sam_hrecs_remove_key(sam_hrecs_t *hrecs,
                         sam_hrec_type_t *type,
                         const char *key) {
    sam_hrec_tag_t *tag, *prev;
    if (!hrecs)
        return -1;
    tag = sam_hrecs_find_key(type, key, &prev);
    if (!tag)
        return 0; // Not there anyway

    if (type->type == TYPEKEY("SQ") && tag->str[0] == 'A' && tag->str[1] == 'N') {
        assert(tag->len >= 3);
        sam_hrec_tag_t *sn_tag = sam_hrecs_find_key(type, "SN", NULL);
        if (sn_tag) {
            assert(sn_tag->len >= 3);
            khint_t k = kh_get(m_s2i, hrecs->ref_hash, sn_tag->str + 3);
            if (k != kh_end(hrecs->ref_hash))
                sam_hrecs_remove_ref_altnames(hrecs, kh_val(hrecs->ref_hash, k), tag->str + 3);
        }
    }

    if (!prev) { //first tag
        type->tag = tag->next;
    } else {
        prev->next = tag->next;
    }
    pool_free(hrecs->tag_pool, tag);
    hrecs->dirty = 1; //mark text as dirty and force a rebuild

    return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
testq %rdi, %rdi
je 0x6cee5
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8(%rsp), %rax
movq %rsi, %rdi
movq %rdx, %rsi
movq %rax, %rdx
callq 0x6b93e
testq %rax, %rax
je 0x6ceea
movq %rax, %r15
cmpl $0x5351, 0x28(%r14)     # imm = 0x5351
jne 0x6ceb5
movq 0x8(%r15), %r12
cmpb $0x41, (%r12)
jne 0x6ceb5
cmpb $0x4e, 0x1(%r12)
jne 0x6ceb5
cmpl $0x2, 0x10(%r15)
jle 0x6cefa
leaq 0xe50b(%rip), %rsi      # 0x7b375
movq %r14, %rdi
xorl %edx, %edx
callq 0x6b93e
testq %rax, %rax
je 0x6ceb5
cmpl $0x2, 0x10(%rax)
jle 0x6cf19
movq 0x38(%rbx), %r13
movq 0x8(%rax), %rsi
addq $0x3, %rsi
movq %r13, %rdi
callq 0x6b87d
cmpl (%r13), %eax
je 0x6ceb5
movq 0x20(%r13), %rcx
movl %eax, %eax
movl (%rcx,%rax,4), %esi
addq $0x3, %r12
movq %rbx, %rdi
movq %r12, %rdx
callq 0x6d616
movq 0x8(%rsp), %rax
addq $0x20, %r14
testq %rax, %rax
movq (%r15), %rcx
cmovneq %rax, %r14
movq %rcx, (%r14)
movq 0x20(%rbx), %rdi
movq %r15, %rsi
callq 0x4924e
movl $0x1, 0x90(%rbx)
pushq $0x1
jmp 0x6cee7
pushq $-0x1
popq %rax
jmp 0x6ceec
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x17064(%rip), %rdi     # 0x83f65
leaq 0x16853(%rip), %rsi     # 0x8375b
leaq 0x16aa8(%rip), %rcx     # 0x839b7
movl $0xa78, %edx            # imm = 0xA78
callq 0x42f0
leaq 0x16ae0(%rip), %rdi     # 0x83a00
leaq 0x16834(%rip), %rsi     # 0x8375b
leaq 0x16a89(%rip), %rcx     # 0x839b7
movl $0xa7b, %edx            # imm = 0xA7B
callq 0x42f0
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/header.c
// Function: sam_hdr_name2tid
int sam_hdr_name2tid(sam_hdr_t *bh, const char *ref) {
    sam_hrecs_t *hrecs;
    khint_t k;

    if (!bh)
        return -1;

    if (!(hrecs = bh->hrecs)) {
        if (sam_hdr_fill_hrecs(bh) != 0)
            return -2;
        hrecs = bh->hrecs;
    }

    if (!hrecs->ref_hash)
        return -1;

    k = kh_get(m_s2i, hrecs->ref_hash, ref);
    return k == kh_end(hrecs->ref_hash) ? -1 : kh_val(hrecs->ref_hash, k);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
pushq $-0x1
popq %rbx
testq %rdi, %rdi
je 0x6cf87
movq %rsi, %r14
movq %rdi, %r15
movq 0x38(%rdi), %rax
testq %rax, %rax
je 0x6cf78
movq 0x38(%rax), %r15
testq %r15, %r15
je 0x6cf87
movq %r15, %rdi
movq %r14, %rsi
callq 0x6b87d
cmpl (%r15), %eax
je 0x6cf87
movq 0x20(%r15), %rcx
movl %eax, %eax
movl (%rcx,%rax,4), %ebx
jmp 0x6cf87
movq %r15, %rdi
callq 0x6933d
testl %eax, %eax
je 0x6cf8f
pushq $-0x2
popq %rbx
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
movq 0x38(%r15), %rax
jmp 0x6cf54
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/header.c
// Function: sam_hdr_tid2name
const char *sam_hdr_tid2name(const sam_hdr_t *h, int tid) {
    sam_hrecs_t *hrecs;

    if (!h || tid < 0)
        return NULL;

    if ((hrecs = h->hrecs) != NULL && tid < hrecs->nref) {
        return hrecs->ref[tid].name;
    } else {
        if (tid < h->n_targets)
            return h->target_name[tid];
    }

    return NULL;
}

// Assembly:
testq %rdi, %rdi
sete %al
testl %esi, %esi
sets %cl
orb %al, %cl
jne 0x6cfd0
movq 0x38(%rdi), %rcx
testq %rcx, %rcx
je 0x6cfbe
cmpl %esi, 0x28(%rcx)
jle 0x6cfbe
movl %esi, %eax
imulq $0x18, %rax, %rax
addq 0x30(%rcx), %rax
jmp 0x6cfcc
cmpl %esi, (%rdi)
jle 0x6cfd0
movl %esi, %eax
shlq $0x3, %rax
addq 0x20(%rdi), %rax
movq (%rax), %rax
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/header.c
// Function: sam_hdr_tid2len
hts_pos_t sam_hdr_tid2len(const sam_hdr_t *h, int tid) {
    sam_hrecs_t *hrecs;

    if (!h || tid < 0)
        return 0;

    if ((hrecs = h->hrecs) != NULL && tid < hrecs->nref) {
        return hrecs->ref[tid].len;
    } else {
        if (tid < h->n_targets) {
            if (h->target_len[tid] < UINT32_MAX || !h->sdict) {
                return h->target_len[tid];
            } else {
                khash_t(s2i) *long_refs = (khash_t(s2i) *) h->sdict;
                khint_t k = kh_get(s2i, long_refs, h->target_name[tid]);
                if (k < kh_end(long_refs)) {
                    return kh_val(long_refs, k);
                } else {
                    return UINT32_MAX;
                }
            }
        }
    }

    return 0;
}

// Assembly:
testq %rdi, %rdi
sete %al
testl %esi, %esi
sets %cl
orb %al, %cl
je 0x6cfe5
xorl %eax, %eax
retq
pushq %rbx
movq 0x38(%rdi), %rax
testq %rax, %rax
je 0x6d005
cmpl %esi, 0x28(%rax)
jle 0x6d005
movq 0x30(%rax), %rax
movl %esi, %ecx
imulq $0x18, %rcx, %rcx
movq 0x8(%rax,%rcx), %rax
jmp 0x6d04e
cmpl %esi, (%rdi)
jle 0x6d04c
movq 0x10(%rdi), %rax
movl %esi, %ecx
movl (%rax,%rcx,4), %eax
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
cmpq %rdx, %rax
jne 0x6d04e
movq 0x30(%rdi), %rbx
testq %rbx, %rbx
je 0x6d04e
movq 0x20(%rdi), %rax
movq (%rax,%rcx,8), %rsi
movq %rbx, %rdi
callq 0xefef
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl (%rbx), %ecx
jae 0x6d04e
movq 0x20(%rbx), %rax
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
jmp 0x6d04e
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/header.c
// Function: sam_hdr_pg_id
const char *sam_hdr_pg_id(sam_hdr_t *bh, const char *name) {
    sam_hrecs_t *hrecs;
    size_t name_len;
    const size_t name_extra = 17;
    if (!bh || !name)
        return NULL;

    if (!(hrecs = bh->hrecs)) {
        if (sam_hdr_fill_hrecs(bh) != 0)
            return NULL;
        hrecs = bh->hrecs;
    }

    khint_t k = kh_get(m_s2i, hrecs->pg_hash, name);
    if (k == kh_end(hrecs->pg_hash))
        return name;

    name_len = strlen(name);
    if (name_len > 1000) name_len = 1000;
    if (hrecs->ID_buf_sz < name_len + name_extra) {
        char *new_ID_buf = realloc(hrecs->ID_buf, name_len + name_extra);
        if (new_ID_buf == NULL)
            return NULL;
        hrecs->ID_buf = new_ID_buf;
        hrecs->ID_buf_sz = name_len + name_extra;
    }

    do {
        snprintf(hrecs->ID_buf, hrecs->ID_buf_sz, "%.1000s.%d", name, hrecs->ID_cnt++);
        k = kh_get(m_s2i, hrecs->pg_hash, hrecs->ID_buf);
    } while (k != kh_end(hrecs->pg_hash));

    return hrecs->ID_buf;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0x6d143
movq %rsi, %rbx
movq %rdi, %r14
movq 0x38(%rdi), %r13
testq %r13, %r13
je 0x6d137
movq 0x70(%r13), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6b87d
cmpl (%r14), %eax
jne 0x6d09c
movq %rbx, %r14
jmp 0x6d146
movq %rbx, %rdi
callq 0x41d0
movl $0x3e8, %r15d           # imm = 0x3E8
cmpq %r15, %rax
cmovbq %rax, %r15
movl 0x88(%r13), %eax
addq $0x11, %r15
movq 0x80(%r13), %r14
cmpq %rax, %r15
jbe 0x6d0e9
movq %r14, %rdi
movq %r15, %rsi
callq 0x4840
testq %rax, %rax
je 0x6d143
movq %rax, %r14
movq %rax, 0x80(%r13)
movl %r15d, 0x88(%r13)
leaq 0x167e5(%rip), %r15     # 0x838d5
movl 0x88(%r13), %esi
movl 0x8c(%r13), %r8d
leal 0x1(%r8), %eax
movl %eax, 0x8c(%r13)
movq %r14, %rdi
movq %r15, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x4800
movq 0x70(%r13), %r12
movq 0x80(%r13), %r14
movq %r12, %rdi
movq %r14, %rsi
callq 0x6b87d
cmpl (%r12), %eax
jne 0x6d0f0
jmp 0x6d146
movq %r14, %rdi
callq 0x6933d
testl %eax, %eax
je 0x6d153
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0x38(%r14), %r13
jmp 0x6d080
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/header.c
// Function: sam_hrecs_remove_ref_altnames
static void sam_hrecs_remove_ref_altnames(sam_hrecs_t *hrecs, int expected, const char *list) {
    const char *token, *sn;
    ks_tokaux_t aux;
    kstring_t str = KS_INITIALIZE;

    if (expected < 0 || expected >= hrecs->nref)
        return;
    sn = hrecs->ref[expected].name;

    for (token = kstrtok(list, ",", &aux); token; token = kstrtok(NULL, NULL, &aux)) {
        kputsn(token, aux.p - token, ks_clear(&str));
        khint_t k = kh_get(m_s2i, hrecs->ref_hash, str.s);
        if (k != kh_end(hrecs->ref_hash)
            && kh_val(hrecs->ref_hash, k) == expected
            && strcmp(sn, str.s) != 0)
            kh_del(m_s2i, hrecs->ref_hash, k);
    }

    free(str.s);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rsp)
testl %esi, %esi
js 0x6d6ed
movl %esi, %ebx
movq %rdi, %r14
cmpl %esi, 0x28(%rdi)
jle 0x6d6ed
movq 0x30(%r14), %rax
movl %ebx, %ecx
imulq $0x18, %rcx, %rcx
movq (%rax,%rcx), %rax
movq %rax, 0x8(%rsp)
leaq 0xc7ca(%rip), %rsi      # 0x79e26
leaq 0x28(%rsp), %rax
movq %rdx, %rdi
movq %rax, %rdx
callq 0x8cfc
xorl %ebp, %ebp
leaq 0x10(%rsp), %r13
testq %rax, %rax
je 0x6d6e5
movq 0x50(%rsp), %rsi
subq %rax, %rsi
andq $0x0, 0x10(%rsp)
movq %rax, %rdi
movq %r13, %rdx
callq 0x6cc3e
movq 0x38(%r14), %r15
movq 0x20(%rsp), %rbp
movq %r15, %rdi
movq %rbp, %rsi
callq 0x6b87d
cmpl (%r15), %eax
je 0x6d6d5
movl %eax, %r12d
movq 0x20(%r15), %rax
movl %r12d, %ecx
cmpl %ebx, (%rax,%rcx,4)
jne 0x6d6d5
movq 0x8(%rsp), %rdi
movq %rbp, %rsi
callq 0x46c0
testl %eax, %eax
je 0x6d6d5
movq %r15, %rdi
movl %r12d, %esi
callq 0x6b983
xorl %edi, %edi
xorl %esi, %esi
leaq 0x28(%rsp), %rdx
callq 0x8cfc
jmp 0x6d673
movq %rbp, %rdi
callq 0x45c0
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/header.c
// Function: sam_hrecs_find_rg
sam_hrec_rg_t *sam_hrecs_find_rg(sam_hrecs_t *hrecs, const char *rg) {
    khint_t k = kh_get(m_s2i, hrecs->rg_hash, rg);
    return k == kh_end(hrecs->rg_hash)
        ? NULL
        : &hrecs->rg[kh_val(hrecs->rg_hash, k)];
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x50(%rdi), %r14
movq %r14, %rdi
callq 0x6b87d
cmpl (%r14), %eax
jne 0x6d718
xorl %eax, %eax
jmp 0x6d72a
movq 0x20(%r14), %rcx
movl %eax, %eax
movslq (%rcx,%rax,4), %rax
imulq $0x18, %rax, %rax
addq 0x48(%rbx), %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/header.c
// Function: sam_hrecs_sort_order
enum sam_sort_order sam_hrecs_sort_order(sam_hrecs_t *hrecs) {
    khint_t k;
    enum sam_sort_order so;

    so = ORDER_UNKNOWN;
    k = kh_get(sam_hrecs_t, hrecs->h, TYPEKEY("HD"));
    if (k != kh_end(hrecs->h)) {
        sam_hrec_type_t *ty = kh_val(hrecs->h, k);
        sam_hrec_tag_t *tag;
        for (tag = ty->tag; tag; tag = tag->next) {
            if (tag->str[0] == 'S' && tag->str[1] == 'O') {
                if (strcmp(tag->str+3, "unsorted") == 0)
                    so = ORDER_UNSORTED;
                else if (strcmp(tag->str+3, "queryname") == 0)
                    so = ORDER_NAME;
                else if (strcmp(tag->str+3, "coordinate") == 0)
                    so = ORDER_COORD;
                else if (strcmp(tag->str+3, "unknown") != 0)
                    hts_log_error("Unknown sort order field: %s", tag->str+3);
            }
        }
    }

    return so;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq (%rdi), %rbx
movq %rbx, %rdi
movl $0x4844, %esi           # imm = 0x4844
callq 0x6c54d
cmpl (%rbx), %eax
jne 0x6d765
pushq $-0x1
popq %rbx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x20(%rbx), %rcx
movl %eax, %eax
movq (%rcx,%rax,8), %r13
addq $0x20, %r13
pushq $-0x1
popq %rbx
leaq 0x16294(%rip), %r14     # 0x83a11
leaq 0x16296(%rip), %r15     # 0x83a1a
leaq 0x16299(%rip), %r12     # 0x83a24
movq (%r13), %r13
testq %r13, %r13
je 0x6d754
movq 0x8(%r13), %rbp
cmpb $0x53, (%rbp)
jne 0x6d78b
cmpb $0x4f, 0x1(%rbp)
jne 0x6d78b
addq $0x3, %rbp
movq %rbp, %rdi
movq %r14, %rsi
callq 0x46c0
testl %eax, %eax
je 0x6d805
movq %rbp, %rdi
movq %r15, %rsi
callq 0x46c0
testl %eax, %eax
je 0x6d809
movq %rbp, %rdi
movq %r12, %rsi
callq 0x46c0
testl %eax, %eax
je 0x6d811
movq %rbp, %rdi
leaq 0x9a15(%rip), %rsi      # 0x771f4
callq 0x46c0
testl %eax, %eax
je 0x6d78b
pushq $0x1
popq %rdi
leaq 0x1623d(%rip), %rsi     # 0x83a2f
leaq 0x1624b(%rip), %rdx     # 0x83a44
movq %rbp, %rcx
xorl %eax, %eax
callq 0x110c6
jmp 0x6d78b
xorl %ebx, %ebx
jmp 0x6d78b
pushq $0x1
popq %rbx
jmp 0x6d78b
pushq $0x2
popq %rbx
jmp 0x6d78b
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/header.c
// Function: sam_hrecs_group_order
enum sam_group_order sam_hrecs_group_order(sam_hrecs_t *hrecs) {
    khint_t k;
    enum sam_group_order go;

    go = ORDER_NONE;
    k = kh_get(sam_hrecs_t, hrecs->h, TYPEKEY("HD"));
    if (k != kh_end(hrecs->h)) {
        sam_hrec_type_t *ty = kh_val(hrecs->h, k);
        sam_hrec_tag_t *tag;
        for (tag = ty->tag; tag; tag = tag->next) {
            if (tag->str[0] == 'G' && tag->str[1] == 'O') {
                if (strcmp(tag->str+3, "query") == 0)
                    go = ORDER_QUERY;
                else if (strcmp(tag->str+3, "reference") == 0)
                    go = ORDER_REFERENCE;
            }
        }
    }

    return go;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq (%rdi), %rbx
movq %rbx, %rdi
movl $0x4844, %esi           # imm = 0x4844
callq 0x6c54d
cmpl (%rbx), %eax
jne 0x6d84c
pushq $-0x1
popq %rbp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x20(%rbx), %rcx
movl %eax, %eax
movq (%rcx,%rax,8), %r12
addq $0x20, %r12
pushq $-0x1
popq %rcx
leaq 0xc801(%rip), %rbx      # 0x7a065
leaq 0xfcbc(%rip), %r14      # 0x7d527
pushq $0x1
popq %r13
movl %ecx, %ebp
movq (%r12), %r12
testq %r12, %r12
je 0x6d83b
movq 0x8(%r12), %r15
cmpb $0x47, (%r15)
jne 0x6d871
cmpb $0x4f, 0x1(%r15)
jne 0x6d871
addq $0x3, %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x46c0
xorl %ecx, %ecx
testl %eax, %eax
je 0x6d86f
movq %r15, %rdi
movq %r14, %rsi
callq 0x46c0
testl %eax, %eax
cmovel %r13d, %ebp
movl %ebp, %ecx
jmp 0x6d86f
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/header.c
// Function: sam_hrecs_add
static int sam_hrecs_add(sam_hrecs_t *hrecs, const char *type, ...) {
    va_list args;
    int res;
    va_start(args, type);
    res = sam_hrecs_vadd(hrecs, type, args, NULL);
    va_end(args);
    return res;
}

// Assembly:
subq $0xd8, %rsp
leaq 0x20(%rsp), %rsi
movq %rdx, 0x10(%rsi)
movq %rcx, 0x18(%rsi)
movq %r8, 0x20(%rsi)
movq %r9, 0x28(%rsi)
testb %al, %al
je 0x6dd8b
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsp, %rdx
movq %rsi, 0x10(%rdx)
leaq 0xe0(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rdx)
leaq 0xd5c0(%rip), %rsi      # 0x7b372
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x6a316
addq $0xd8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/header.c
// Function: sam_hrecs_free_tags
static void sam_hrecs_free_tags(sam_hrecs_t *hrecs, sam_hrec_tag_t *tag) {
    if (!hrecs || !tag)
        return;
    if (tag->next)
        sam_hrecs_free_tags(hrecs, tag->next);

    pool_free(hrecs->tag_pool, tag);
}

// Assembly:
testq %rsi, %rsi
je 0x6de85
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq (%rsi), %rsi
testq %rsi, %rsi
je 0x6de72
movq %r14, %rdi
callq 0x6de53
movq 0x20(%r14), %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x4924e
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/header.c
// Function: sam_hrecs_update
static int sam_hrecs_update(sam_hrecs_t *hrecs, sam_hrec_type_t *type, ...) {
    va_list args;
    int res;
    va_start(args, type);
    res = sam_hrecs_vupdate(hrecs, type, args);
    va_end(args);
    return res;
}

// Assembly:
subq $0xd8, %rsp
leaq 0x20(%rsp), %r10
movq %rdx, 0x10(%r10)
movq %rcx, 0x18(%r10)
movq %r8, 0x20(%r10)
movq %r9, 0x28(%r10)
testb %al, %al
je 0x6e179
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsp, %rdx
movq %r10, 0x10(%rdx)
leaq 0xe0(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rdx)
callq 0x6b72b
addq $0xd8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/header.c
// Function: sam_hrecs_add_ref_altnames
static int sam_hrecs_add_ref_altnames(sam_hrecs_t *hrecs, int nref, const char *list) {
    const char *token;
    ks_tokaux_t aux;

    if (!list)
        return 0;

    for (token = kstrtok(list, ",", &aux); token; token = kstrtok(NULL, NULL, &aux)) {
        if (aux.p == token)
            continue;

        char *name = string_ndup(hrecs->str_pool, token, aux.p - token);
        if (!name)
            return -1;
        int r;
        khint_t k = kh_put(m_s2i, hrecs->ref_hash, name, &r);
        if (r < 0) return -1;

        if (r > 0)
            kh_val(hrecs->ref_hash, k) = nref;
        else if (kh_val(hrecs->ref_hash, k) != nref)
            hts_log_warning("Duplicate entry AN:\"%s\" in sam header", name);
    }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
testq %rdx, %rdx
je 0x6e259
movl %esi, %ebx
movq %rdi, %r14
leaq 0xbc5d(%rip), %rsi      # 0x79e26
leaq 0x8(%rsp), %r15
movq %rdx, %rdi
movq %r15, %rdx
callq 0x8cfc
pushq $-0x1
popq %rbp
leaq 0x4(%rsp), %r12
testq %rax, %rax
je 0x6e259
movq 0x30(%rsp), %rdx
subq %rax, %rdx
je 0x6e24b
movq 0x10(%r14), %rdi
movq %rax, %rsi
callq 0x493ba
testq %rax, %rax
je 0x6e25b
movq %rax, %r13
movq 0x38(%r14), %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0x6b9b4
cmpl $0x0, 0x4(%rsp)
js 0x6e25b
movq 0x38(%r14), %rcx
movq 0x20(%rcx), %rcx
movl %eax, %eax
je 0x6e22b
movl %ebx, (%rcx,%rax,4)
jmp 0x6e24b
cmpl %ebx, (%rcx,%rax,4)
je 0x6e24b
pushq $0x3
popq %rdi
leaq 0x15d9e(%rip), %rsi     # 0x83fd8
leaq 0x15db2(%rip), %rdx     # 0x83ff3
movq %r13, %rcx
xorl %eax, %eax
callq 0x110c6
xorl %edi, %edi
xorl %esi, %esi
movq %r15, %rdx
callq 0x8cfc
jmp 0x6e1e1
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/md5.c
// Function: hts_md5_update
void hts_md5_update(hts_md5_context *ctx, const void *data, unsigned long size)
{
	hts_md5_u32plus saved_lo;
	unsigned long used, available;

	saved_lo = ctx->lo;
	if ((ctx->lo = (saved_lo + size) & 0x1fffffff) < saved_lo)
		ctx->hi++;
	ctx->hi += size >> 29;

	used = saved_lo & 0x3f;

	if (used) {
		available = 64 - used;

		if (size < available) {
			memcpy(&ctx->buffer[used], data, size);
			return;
		}

		memcpy(&ctx->buffer[used], data, available);
		data = (const unsigned char *)data + available;
		size -= available;
		body(ctx, ctx->buffer, 64);
	}

	if (size >= 64) {
		data = body(ctx, data, size & ~(unsigned long)0x3f);
		size &= 0x3f;
	}

	memcpy(ctx->buffer, data, size);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movl (%rdi), %eax
leal (%rdx,%rax), %ecx
andl $0x1fffffff, %ecx       # imm = 0x1FFFFFFF
movl %ecx, (%rdi)
movq %rdx, %rdi
shrq $0x1d, %rdi
cmpl %eax, %ecx
adcl %edi, 0x4(%rbx)
movq %rsi, %r14
andq $0x3f, %rax
je 0x6e307
pushq $0x40
popq %r12
subq %rax, %r12
movq %rdx, %r15
leaq (%rbx,%rax), %rdi
addq $0x18, %rdi
subq %r12, %r15
jae 0x6e30c
movq %r14, %rsi
jmp 0x6e358
movq %rdx, %r15
jmp 0x6e32c
leaq 0x18(%rbx), %r13
movq %r14, %rsi
movq %r12, %rdx
callq 0x43c0
addq %r12, %r14
pushq $0x40
popq %rdx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x6e366
cmpq $0x40, %r15
jb 0x6e34b
movq %r15, %rdx
andq $-0x40, %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6e366
movq %rax, %r14
andl $0x3f, %r15d
addq $0x18, %rbx
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x43c0
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/md5.c
// Function: hts_md5_final
void hts_md5_final(unsigned char *result, hts_md5_context *ctx)
{
	unsigned long used, available;

	used = ctx->lo & 0x3f;

	ctx->buffer[used++] = 0x80;

	available = 64 - used;

	if (available < 8) {
		memset(&ctx->buffer[used], 0, available);
		body(ctx, ctx->buffer, 64);
		used = 0;
		available = 64;
	}

	memset(&ctx->buffer[used], 0, available - 8);

	ctx->lo <<= 3;
	ctx->buffer[56] = ctx->lo;
	ctx->buffer[57] = ctx->lo >> 8;
	ctx->buffer[58] = ctx->lo >> 16;
	ctx->buffer[59] = ctx->lo >> 24;
	ctx->buffer[60] = ctx->hi;
	ctx->buffer[61] = ctx->hi >> 8;
	ctx->buffer[62] = ctx->hi >> 16;
	ctx->buffer[63] = ctx->hi >> 24;

	body(ctx, ctx->buffer, 64);

	result[0] = ctx->a;
	result[1] = ctx->a >> 8;
	result[2] = ctx->a >> 16;
	result[3] = ctx->a >> 24;
	result[4] = ctx->b;
	result[5] = ctx->b >> 8;
	result[6] = ctx->b >> 16;
	result[7] = ctx->b >> 24;
	result[8] = ctx->c;
	result[9] = ctx->c >> 8;
	result[10] = ctx->c >> 16;
	result[11] = ctx->c >> 24;
	result[12] = ctx->d;
	result[13] = ctx->d >> 8;
	result[14] = ctx->d >> 16;
	result[15] = ctx->d >> 24;

	memset(ctx, 0, sizeof(*ctx));
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl (%rsi), %edx
andl $0x3f, %edx
leaq 0x18(%rsi), %r15
leaq 0x1(%rdx), %rdi
movb $-0x80, 0x18(%rsi,%rdx)
xorq $0x3f, %rdx
cmpq $0x7, %rdx
ja 0x6ec0b
pushq $0x40
popq %r12
addq %r15, %rdi
xorl %esi, %esi
callq 0x4260
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x6e366
xorl %edi, %edi
movq %r12, %rdx
addq %r15, %rdi
addq $-0x8, %rdx
xorl %esi, %esi
callq 0x4260
movl (%rbx), %eax
movl 0x4(%rbx), %ecx
leal (,%rax,8), %edx
movl %edx, (%rbx)
movb %dl, 0x50(%rbx)
movl %eax, %edx
shrl $0x5, %edx
movb %dl, 0x51(%rbx)
movl %eax, %edx
shrl $0xd, %edx
movb %dl, 0x52(%rbx)
shrl $0x15, %eax
movb %al, 0x53(%rbx)
movl %ecx, 0x54(%rbx)
pushq $0x40
popq %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6e366
movb 0x8(%rbx), %al
movb %al, (%r14)
movb 0x9(%rbx), %al
movb %al, 0x1(%r14)
movb 0xa(%rbx), %al
movb %al, 0x2(%r14)
movb 0xb(%rbx), %al
movb %al, 0x3(%r14)
movb 0xc(%rbx), %al
movb %al, 0x4(%r14)
movb 0xd(%rbx), %al
movb %al, 0x5(%r14)
movb 0xe(%rbx), %al
movb %al, 0x6(%r14)
movb 0xf(%rbx), %al
movb %al, 0x7(%r14)
movb 0x10(%rbx), %al
movb %al, 0x8(%r14)
movb 0x11(%rbx), %al
movb %al, 0x9(%r14)
movb 0x12(%rbx), %al
movb %al, 0xa(%r14)
movb 0x13(%rbx), %al
movb %al, 0xb(%r14)
movb 0x14(%rbx), %al
movb %al, 0xc(%r14)
movb 0x15(%rbx), %al
movb %al, 0xd(%r14)
movb 0x16(%rbx), %al
movb %al, 0xe(%r14)
movb 0x17(%rbx), %al
movb %al, 0xf(%r14)
movl $0x98, %edx
movq %rbx, %rdi
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x4260
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/md5.c
// Function: hts_md5_init
hts_md5_context *hts_md5_init(void)
{
    hts_md5_context *ctx = malloc(sizeof(*ctx));
    if (!ctx)
        return NULL;

    hts_md5_reset(ctx);
    return ctx;
}

// Assembly:
pushq %rax
movl $0x98, %edi
callq 0x4680
testq %rax, %rax
je 0x6ed02
movabsq $0x1032547698badcfe, %rcx # imm = 0x1032547698BADCFE
movq %rcx, 0x10(%rax)
movaps 0x153f1(%rip), %xmm0    # 0x840f0
movups %xmm0, (%rax)
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/md5.c
// Function: hts_md5_hex
void hts_md5_hex(char *hex, const unsigned char *digest)
{
    int i;
    for (i = 0; i < 16; i++) {
        hex[i*2+0] = "0123456789abcdef"[(digest[i]>>4)&0xf];
        hex[i*2+1] = "0123456789abcdef"[digest[i]&0xf];
    }
    hex[32] = 0;
}

// Assembly:
xorl %eax, %eax
leaq 0xc772(%rip), %rcx      # 0x7b484
cmpq $0x10, %rax
je 0x6ed38
movzbl (%rsi,%rax), %edx
shrl $0x4, %edx
movb (%rdx,%rcx), %dl
movb %dl, (%rdi,%rax,2)
movzbl (%rsi,%rax), %edx
andl $0xf, %edx
movb (%rdx,%rcx), %dl
movb %dl, 0x1(%rdi,%rax,2)
incq %rax
jmp 0x6ed12
movb $0x0, 0x20(%rdi)
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/cram_codecs.c
// Function: cram_external_decode_int
int cram_external_decode_int(cram_slice *slice, cram_codec *c,
                             cram_block *in, char *out, int *out_size) {
    char *cp;
    cram_block *b;

    /* Find the external block */
    b = cram_get_block_by_id(slice, c->u.external.content_id);
    if (!b)
        return *out_size?-1:0;

    cp = (char *)b->data + b->idx;
    // E_INT and E_LONG are guaranteed single item queries
    int err = 0;
    *(int32_t *)out = c->vv->varint_get32(&cp, (char *)b->data + b->uncomp_size, &err);
    b->idx = cp - (char *)b->data;
    *out_size = 1;

    return err ? -1 : 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %rbx
movq %rcx, %r14
movq %rsi, %r12
movl 0x60(%rsi), %esi
callq 0x6edca
testq %rax, %rax
je 0x6edb3
movq %rax, %r15
movq 0x20(%rax), %rax
movslq 0x1c(%r15), %rcx
addq %rax, %rcx
leaq 0x10(%rsp), %r13
leaq 0xc(%rsp), %rbp
andl $0x0, (%rbp)
movq %rcx, (%r13)
movq 0x10(%r12), %rcx
movslq 0x14(%r15), %rsi
addq %rax, %rsi
movq %r13, %rdi
movq %rbp, %rdx
callq *0x18(%rcx)
movl %eax, (%r14)
movl (%r13), %eax
subl 0x20(%r15), %eax
movl %eax, 0x1c(%r15)
movl $0x1, (%rbx)
movl (%rbp), %ecx
jmp 0x6edb5
movl (%rbx), %ecx
xorl %eax, %eax
negl %ecx
sbbl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/cram_codecs.c
// Function: cram_external_decode_char
int cram_external_decode_char(cram_slice *slice, cram_codec *c,
                              cram_block *in, char *out,
                              int *out_size) {
    char *cp;
    cram_block *b;

    /* Find the external block */
    b = cram_get_block_by_id(slice, c->u.external.content_id);
    if (!b)
        return *out_size?-1:0;

    cp = cram_extract_block(b, *out_size);
    if (!cp)
        return -1;

    if (out)
        memcpy(out, cp, *out_size);
    return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %r8, %r14
movq %rcx, %rbx
movl 0x60(%rsi), %esi
callq 0x6edca
movl (%r14), %edx
testq %rax, %rax
je 0x6ef09
movq 0x20(%rax), %rsi
movslq 0x1c(%rax), %rcx
addl %ecx, %edx
movl %edx, 0x1c(%rax)
cmpl 0x14(%rax), %edx
setg %al
testq %rsi, %rsi
sete %dl
orb %al, %dl
je 0x6ef11
pushq $-0x1
popq %rbp
jmp 0x6ef26
xorl %ebp, %ebp
negl %edx
sbbl %ebp, %ebp
jmp 0x6ef26
xorl %ebp, %ebp
testq %rbx, %rbx
je 0x6ef26
addq %rcx, %rsi
movslq (%r14), %rdx
movq %rbx, %rdi
callq 0x43c0
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/cram_codecs.c
// Function: cram_external_decode_size
int cram_external_decode_size(cram_slice *slice, cram_codec *c) {
    cram_block *b;

    /* Find the external block */
    b = cram_get_block_by_id(slice, c->u.external.content_id);
    if (!b)
        return -1;

    return b->uncomp_size;
}

// Assembly:
pushq %rax
movl 0x60(%rsi), %esi
callq 0x6edca
testq %rax, %rax
je 0x6ef45
movl 0x14(%rax), %eax
jmp 0x6ef48
pushq $-0x1
popq %rax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/cram_codecs.c
// Function: cram_external_decode_block
static int cram_external_decode_block(cram_slice *slice, cram_codec *c,
                                      cram_block *in, char *out_,
                                      int *out_size) {
    char *cp;
    cram_block *out = (cram_block *)out_;
    cram_block *b = NULL;

    /* Find the external block */
    b = cram_get_block_by_id(slice, c->u.external.content_id);
    if (!b)
        return *out_size?-1:0;

    cp = cram_extract_block(b, *out_size);
    if (!cp)
        return -1;

    BLOCK_APPEND(out, cp, *out_size);
    return 0;

 block_err:
    return -1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %r8, %r14
movq %rcx, %rbx
movl 0x60(%rsi), %esi
callq 0x6edca
movl (%r14), %ecx
testq %rax, %rax
je 0x6f0dd
movq 0x20(%rax), %rsi
movslq 0x1c(%rax), %rdx
addl %edx, %ecx
movl %ecx, 0x1c(%rax)
cmpl 0x14(%rax), %ecx
setg %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
je 0x6f0eb
pushq $-0x1
popq %rax
jmp 0x6f0e3
xorl %eax, %eax
negl %ecx
sbbl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
addq %rdx, %rsi
movslq (%r14), %rdx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x6f15a
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/cram_codecs.c
// Function: cram_external_encode_store
int cram_external_encode_store(cram_codec *c, cram_block *b, char *prefix,
                               int version) {
    char tmp[99], *tp = tmp, *tpend = tmp+99;
    int len = 0, r = 0, n;

    if (prefix) {
        size_t l = strlen(prefix);
        BLOCK_APPEND(b, prefix, l);
        len += l;
    }

    tp += c->vv->varint_put32(tp, tpend, c->u.e_external.content_id);
    len += (n = c->vv->varint_put32_blk(b, c->codec)); r |= n;
    len += (n = c->vv->varint_put32_blk(b, tp-tmp));   r |= n;
    BLOCK_APPEND(b, tmp, tp-tmp);
    len += tp-tmp;

    if (r > 0)
        return len;

 block_err:
    return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %r15
movq %rdi, %r12
pushq $-0x1
popq %rbx
testq %rdx, %rdx
je 0x6f1ef
movq %rdx, %r13
movq %rdx, %rdi
callq 0x41d0
movq %rax, %r14
movq %r15, %rdi
movq %r13, %rsi
movq %rax, %rdx
callq 0x6f15a
xorl %ecx, %ecx
testl %eax, %eax
cmovsl %ecx, %r14d
jns 0x6f1f2
jmp 0x6f25b
xorl %r14d, %r14d
leaq 0x63(%rsp), %rsi
movq 0x10(%r12), %rax
movl 0x60(%r12), %edx
movq %rsp, %rdi
callq *0x38(%rax)
movl %eax, %ebp
movslq %eax, %rbx
movq 0x10(%r12), %rax
movl (%r12), %esi
movq %r15, %rdi
callq *0x58(%rax)
movl %eax, %r13d
movq 0x10(%r12), %rax
movq %r15, %rdi
movl %ebx, %esi
callq *0x58(%rax)
movl %eax, %r12d
movq %r15, %rdi
movq %rsp, %rsi
movq %rbx, %rdx
callq 0x6f15a
testl %eax, %eax
js 0x6f258
movl %r12d, %eax
orl %r13d, %eax
pushq $-0x1
popq %rbx
jle 0x6f25b
addl %r14d, %ebp
addl %r13d, %ebp
addl %r12d, %ebp
movl %ebp, %ebx
jmp 0x6f25b
pushq $-0x1
popq %rbx
movl %ebx, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/cram_codecs.c
// Function: cram_external_encode_init
cram_codec *cram_external_encode_init(cram_stats *st,
                                      enum cram_encoding codec,
                                      enum cram_external_type option,
                                      void *dat,
                                      int version, varint_vec *vv) {
    cram_codec *c;

    c = malloc(sizeof(*c));
    if (!c)
        return NULL;
    c->codec = E_EXTERNAL;
    c->free = cram_external_encode_free;
    if (CRAM_MAJOR_VERS(version) >= 4) {
        // Version 4 does not permit integer data to be encoded as a
        // series of bytes.  This is used purely for bytes, either
        // singular or declared as arrays
        switch (codec) {
        case E_EXTERNAL:
            if (option != E_BYTE && option != E_BYTE_ARRAY)
                return NULL;
            c->encode = cram_external_encode_char;
            break;
        default:
            return NULL;
        }
    } else {
        // CRAM 3 and earlier encodes integers as EXTERNAL.  We need
        // use the option field to indicate the input data format so
        // we know which serialisation format to use.
        if (option == E_INT)
            c->encode = cram_external_encode_int;
        else if (option == E_LONG)
            c->encode = cram_external_encode_long;
        else if (option == E_BYTE_ARRAY || option == E_BYTE)
            c->encode = cram_external_encode_char;
        else
            abort();
    }
    c->store = cram_external_encode_store;
    c->flush = NULL;

    c->u.e_external.content_id = (size_t)dat;

    return c;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %r8d, %r15d
movq %rcx, %rbx
movl %edx, %ebp
movl %esi, %r14d
movl $0x880, %edi            # imm = 0x880
callq 0x4680
testq %rax, %rax
je 0x6f2bb
movl $0x1, (%rax)
leaq -0xf4(%rip), %rcx       # 0x6f1a6
movq %rcx, 0x20(%rax)
cmpl $0x400, %r15d           # imm = 0x400
jl 0x6f2bf
cmpl $0x1, %r14d
setne %cl
addl $-0x5, %ebp
cmpl $-0x2, %ebp
setb %dl
orb %cl, %dl
je 0x6f2e3
xorl %eax, %eax
jmp 0x6f301
cmpl $0x1, %ebp
je 0x6f2d2
cmpl $0x2, %ebp
jne 0x6f2db
leaq -0x1ad(%rip), %rcx      # 0x6f123
jmp 0x6f2ea
leaq -0x1dc(%rip), %rcx      # 0x6f0fd
jmp 0x6f2ea
addl $-0x3, %ebp
cmpl $0x2, %ebp
jae 0x6f30c
leaq -0x19f(%rip), %rcx      # 0x6f14b
movq %rcx, 0x30(%rax)
leaq -0x14a(%rip), %rcx      # 0x6f1ab
movq %rcx, 0x38(%rax)
andq $0x0, 0x48(%rax)
movl %ebx, 0x60(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x4270
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/cram_codecs.c
// Function: cram_varint_decode_int
int cram_varint_decode_int(cram_slice *slice, cram_codec *c,
                           cram_block *in, char *out, int *out_size) {
    char *cp;
    cram_block *b;

    /* Find the data block */
    b = cram_get_block_by_id(slice, c->u.varint.content_id);
    if (!b)
        return *out_size?-1:0;

    cp = (char *)b->data + b->idx;
    // E_INT and E_LONG are guaranteed single item queries
    int err = 0;
    *(int32_t *)out = c->vv->varint_get32(&cp,
                                          (char *)b->data + b->uncomp_size,
                                          &err) + c->u.varint.offset;
    b->idx = cp - (char *)b->data;
    *out_size = 1;

    return err ? -1 : 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %rbx
movq %rcx, %r14
movq %rsi, %r15
movl 0x60(%rsi), %esi
callq 0x6edca
testq %rax, %rax
je 0x6f38b
movq %rax, %r12
movq 0x20(%rax), %rax
movslq 0x1c(%r12), %rcx
addq %rax, %rcx
leaq 0x10(%rsp), %r13
leaq 0xc(%rsp), %rbp
andl $0x0, (%rbp)
movq %rcx, (%r13)
movq 0x10(%r15), %rcx
movslq 0x14(%r12), %rsi
addq %rax, %rsi
movq %r13, %rdi
movq %rbp, %rdx
callq *0x18(%rcx)
addl 0x68(%r15), %eax
movl %eax, (%r14)
movl (%r13), %eax
subl 0x20(%r12), %eax
movl %eax, 0x1c(%r12)
movl $0x1, (%rbx)
movl (%rbp), %ecx
jmp 0x6f38d
movl (%rbx), %ecx
xorl %eax, %eax
negl %ecx
sbbl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/cram_codecs.c
// Function: cram_varint_decode_slong
int cram_varint_decode_slong(cram_slice *slice, cram_codec *c,
                             cram_block *in, char *out, int *out_size) {
    char *cp;
    cram_block *b;

    /* Find the data block */
    b = cram_get_block_by_id(slice, c->u.varint.content_id);
    if (!b)
        return *out_size?-1:0;

    cp = (char *)b->data + b->idx;
    // E_INT and E_LONG are guaranteed single item queries
    int err = 0;
    *(int64_t *)out = c->vv->varint_get64s(&cp,
                                           (char *)b->data + b->uncomp_size,
                                           &err) + c->u.varint.offset;
    b->idx = cp - (char *)b->data;
    *out_size = 1;

    return err ? -1 : 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %rbx
movq %rcx, %r14
movq %rsi, %r15
movl 0x60(%rsi), %esi
callq 0x6edca
testq %rax, %rax
je 0x6f53e
movq %rax, %r12
movq 0x20(%rax), %rax
movslq 0x1c(%r12), %rcx
addq %rax, %rcx
leaq 0x10(%rsp), %r13
leaq 0xc(%rsp), %rbp
andl $0x0, (%rbp)
movq %rcx, (%r13)
movq 0x10(%r15), %rcx
movslq 0x14(%r12), %rsi
addq %rax, %rsi
movq %r13, %rdi
movq %rbp, %rdx
callq *0x30(%rcx)
addq 0x68(%r15), %rax
movq %rax, (%r14)
movl (%r13), %eax
subl 0x20(%r12), %eax
movl %eax, 0x1c(%r12)
movl $0x1, (%rbx)
movl (%rbp), %ecx
jmp 0x6f540
movl (%rbx), %ecx
xorl %eax, %eax
negl %ecx
sbbl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/cram_codecs.c
// Function: cram_varint_decode_size
int cram_varint_decode_size(cram_slice *slice, cram_codec *c) {
    cram_block *b;

    /* Find the data block */
    b = cram_get_block_by_id(slice, c->u.varint.content_id);
    if (!b)
        return -1;

    return b->uncomp_size;
}

// Assembly:
pushq %rax
movl 0x60(%rsi), %esi
callq 0x6edca
testq %rax, %rax
je 0x6f56d
movl 0x14(%rax), %eax
jmp 0x6f570
pushq $-0x1
popq %rax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/cram_codecs.c
// Function: cram_varint_describe
int cram_varint_describe(cram_codec *c, kstring_t *ks) {
    return ksprintf(ks, "VARINT(id=%d,offset=%"PRId64",type=%d)",
                    c->u.varint.content_id,
                    c->u.varint.offset,
                    c->u.varint.type)
        < 0 ? -1 : 0;
}

// Assembly:
pushq %rax
movq %rsi, %rax
movl 0x60(%rdi), %edx
movq 0x68(%rdi), %rcx
movl 0x70(%rdi), %r8d
leaq 0x14ca7(%rip), %rsi     # 0x84237
movq %rax, %rdi
xorl %eax, %eax
callq 0x8c78
sarl $0x1f, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/cram_codecs.c
// Function: cram_varint_decode_init
cram_codec *cram_varint_decode_init(cram_block_compression_hdr *hdr,
                                    char *data, int size,
                                    enum cram_encoding codec,
                                    enum cram_external_type option,
                                    int version, varint_vec *vv) {
    cram_codec *c;
    char *cp = data, *cp_end = data+size;

    if (!(c = malloc(sizeof(*c))))
        return NULL;

    c->codec  = codec;

    // Function pointer choice is theoretically by codec type.
    // Given we have some vars as int32 and some as int64 we
    // use option too for sizing, although on disk format
    // does not change.
    switch(codec) {
    case E_VARINT_UNSIGNED:
        c->decode = (option == E_INT)
            ? cram_varint_decode_int
            : cram_varint_decode_long;
        break;
    case E_VARINT_SIGNED:
        c->decode = (option == E_INT)
            ? cram_varint_decode_sint
            : cram_varint_decode_slong;
        break;
    default:
        return NULL;
    }

    c->free   = cram_varint_decode_free;
    c->size   = cram_varint_decode_size;
    c->get_block = cram_varint_get_block;
    c->describe = cram_varint_describe;

    c->u.varint.content_id = vv->varint_get32 (&cp, cp_end, NULL);
    c->u.varint.offset     = vv->varint_get64s(&cp, cp_end, NULL);

    if (cp - data != size) {
        fprintf(stderr, "Malformed varint header stream\n");
        free(c);
        return NULL;
    }

    c->u.varint.type = option;

    return c;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %ebp
movl %ecx, %r12d
movl %edx, %r15d
movq %rsi, %r14
movq %rsi, (%rsp)
movl $0x880, %edi            # imm = 0x880
callq 0x4680
testq %rax, %rax
je 0x6f6a1
movq %rax, %rbx
movl %r12d, (%rax)
cmpl $0x2a, %r12d
je 0x6f5f6
cmpl $0x29, %r12d
jne 0x6f6a1
cmpl $0x1, %ebp
leaq -0x2dc(%rip), %rcx      # 0x6f311
leaq -0x1c1(%rip), %rax      # 0x6f433
jmp 0x6f607
cmpl $0x1, %ebp
leaq -0x25e(%rip), %rcx      # 0x6f3a2
leaq -0x143(%rip), %rax      # 0x6f4c4
cmoveq %rcx, %rax
movslq %r15d, %r13
leaq (%r14,%r13), %r15
movq %rax, 0x28(%rbx)
leaq -0xc8(%rip), %rax       # 0x6f555
movq %rax, 0x20(%rbx)
leaq -0xce(%rip), %rax       # 0x6f55a
movq %rax, 0x40(%rbx)
leaq -0xc1(%rip), %rax       # 0x6f572
movq %rax, 0x50(%rbx)
leaq -0xc4(%rip), %rax       # 0x6f57a
movq %rax, 0x58(%rbx)
movq %rsp, %r12
movq %r12, %rdi
movq %r15, %rsi
xorl %edx, %edx
movq 0x40(%rsp), %rax
callq *0x18(%rax)
movl %eax, 0x60(%rbx)
movq %r12, %rdi
movq %r15, %rsi
xorl %edx, %edx
movq 0x40(%rsp), %rax
callq *0x30(%rax)
movq %rax, 0x68(%rbx)
movq (%r12), %rax
subq %r14, %rax
cmpq %r13, %rax
jne 0x6f67d
movl %ebp, 0x70(%rbx)
jmp 0x6f6a3
movq 0x2e954(%rip), %rax     # 0x9dfd8
movq (%rax), %rcx
leaq 0x14bca(%rip), %rdi     # 0x84258
pushq $0x1f
popq %rsi
pushq $0x1
popq %rdx
callq 0x49b0
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
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/cram_codecs.c
// Function: cram_varint_encode_store
int cram_varint_encode_store(cram_codec *c, cram_block *b, char *prefix,
                             int version) {
    char tmp[99], *tp = tmp;
    int len = 0;

    if (prefix) {
        size_t l = strlen(prefix);
        BLOCK_APPEND(b, prefix, l);
        len += l;
    }

    tp += c->vv->varint_put32 (tp, NULL, c->u.e_varint.content_id);
    tp += c->vv->varint_put64s(tp, NULL, c->u.e_varint.offset);
    len += c->vv->varint_put32_blk(b, c->codec);
    len += c->vv->varint_put32_blk(b, tp-tmp);
    BLOCK_APPEND(b, tmp, tp-tmp);
    len += tp-tmp;

    return len;

 block_err:
    return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %r14
movq %rdi, %r12
pushq $-0x1
popq %r13
testq %rdx, %rdx
je 0x6f765
movq %rdx, %rbx
movq %rdx, %rdi
callq 0x41d0
movq %rax, %r15
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x6f15a
xorl %ecx, %ecx
testl %eax, %eax
cmovsl %ecx, %r15d
jns 0x6f768
jmp 0x6f7d8
xorl %r15d, %r15d
movq 0x10(%r12), %rax
movl 0x60(%r12), %edx
movq %rsp, %rdi
xorl %esi, %esi
callq *0x38(%rax)
movslq %eax, %r13
leaq (%rsp,%r13), %rdi
movq 0x10(%r12), %rax
movq 0x68(%r12), %rdx
xorl %esi, %esi
callq *0x50(%rax)
movslq %eax, %rbp
movq 0x10(%r12), %rax
movl (%r12), %esi
movq %r14, %rdi
callq *0x58(%rax)
movl %eax, %ebx
movq 0x10(%r12), %rax
addq %r13, %rbp
pushq $-0x1
popq %r13
movq %r14, %rdi
movl %ebp, %esi
callq *0x58(%rax)
movl %eax, %r12d
movq %r14, %rdi
movq %rsp, %rsi
movq %rbp, %rdx
callq 0x6f15a
testl %eax, %eax
js 0x6f7d8
addl %r15d, %ebx
addl %ebp, %ebx
addl %r12d, %ebx
movl %ebx, %r13d
movl %r13d, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/cram_codecs.c
// Function: cram_varint_encode_init
cram_codec *cram_varint_encode_init(cram_stats *st,
                                    enum cram_encoding codec,
                                    enum cram_external_type option,
                                    void *dat,
                                    int version, varint_vec *vv) {
    cram_codec *c;

    if (!(c = malloc(sizeof(*c))))
        return NULL;

    c->u.e_varint.offset = 0;
    if (st) {
        // Marginal difference so far! Not worth the hassle?
        if (st->min_val < 0 && st->min_val >= -127
            && st->max_val / -st->min_val > 100) {
            c->u.e_varint.offset = -st->min_val;
            codec = E_VARINT_UNSIGNED;
        } else if (st->min_val > 0) {
            c->u.e_varint.offset = -st->min_val;
        }
    }

    c->codec = codec;
    c->free = cram_varint_encode_free;

    // Function pointer choice is theoretically by codec type.
    // Given we have some vars as int32 and some as int64 we
    // use option too for sizing, although on disk format
    // does not change.
    switch (codec) {
    case E_VARINT_UNSIGNED:
        c->encode = (option == E_INT)
            ? cram_varint_encode_int
            : cram_varint_encode_long;
        break;
    case E_VARINT_SIGNED:
        c->encode = (option == E_INT)
            ? cram_varint_encode_sint
            : cram_varint_encode_slong;
        break;
    default:
        return NULL;
    }
    c->store = cram_varint_encode_store;
    c->flush = NULL;

    c->u.e_varint.content_id = (size_t)dat;

    return c;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rcx, %rbx
movl %edx, %ebp
movl %esi, %r14d
movq %rdi, %r15
movl $0x880, %edi            # imm = 0x880
callq 0x4680
testq %rax, %rax
je 0x6f88a
movq %rax, %rcx
andq $0x0, 0x68(%rax)
testq %r15, %r15
je 0x6f85d
movq 0x1010(%r15), %rsi
cmpq $-0x7f, %rsi
jb 0x6f851
movq 0x1018(%r15), %rax
negq %rsi
cqto
idivq %rsi
cmpq $0x65, %rax
jl 0x6f85d
movq %rsi, 0x68(%rcx)
movl $0x29, (%rcx)
leaq -0x130(%rip), %rax      # 0x6f71b
movq %rax, 0x20(%rcx)
jmp 0x6f877
testq %rsi, %rsi
jle 0x6f85d
negq %rsi
movq %rsi, 0x68(%rcx)
movl %r14d, (%rcx)
leaq -0x14c(%rip), %rax      # 0x6f71b
movq %rax, 0x20(%rcx)
cmpl $0x2a, %r14d
je 0x6f88e
cmpl $0x29, %r14d
jne 0x6f88a
cmpl $0x1, %ebp
leaq -0x1cc(%rip), %rdx      # 0x6f6b5
leaq -0x1a3(%rip), %rax      # 0x6f6e5
jmp 0x6f89f
xorl %ecx, %ecx
jmp 0x6f8ba
cmpl $0x1, %ebp
leaq -0x1cb(%rip), %rdx      # 0x6f6cd
leaq -0x19f(%rip), %rax      # 0x6f700
cmoveq %rdx, %rax
movq %rax, 0x30(%rcx)
leaq -0x18e(%rip), %rax      # 0x6f720
movq %rax, 0x38(%rcx)
andq $0x0, 0x48(%rcx)
movl %ebx, 0x60(%rcx)
movq %rcx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/cram_codecs.c
// Function: cram_const_decode_byte
int cram_const_decode_byte(cram_slice *slice, cram_codec *c,
                           cram_block *in, char *out, int *out_size) {
    int i, n;

    for (i = 0, n = *out_size; i < n; i++)
        out[i] = c->u.xconst.val;

    return 0;
}

// Assembly:
movl (%r8), %eax
xorl %edx, %edx
testl %eax, %eax
cmovlel %edx, %eax
cmpq %rdx, %rax
je 0x6f8e4
movb 0x60(%rsi), %dil
movb %dil, (%rcx,%rdx)
incq %rdx
jmp 0x6f8d2
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/cram_codecs.c
// Function: cram_const_decode_int
int cram_const_decode_int(cram_slice *slice, cram_codec *c,
                          cram_block *in, char *out, int *out_size) {
    int32_t *out_i = (int32_t *)out;
    int i, n;

    for (i = 0, n = *out_size; i < n; i++)
        out_i[i] = c->u.xconst.val;

    return 0;
}

// Assembly:
movl (%r8), %eax
xorl %edx, %edx
testl %eax, %eax
cmovlel %edx, %eax
cmpq %rdx, %rax
je 0x6f901
movl 0x60(%rsi), %edi
movl %edi, (%rcx,%rdx,4)
incq %rdx
jmp 0x6f8f1
xorl %eax, %eax
retq