LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/htslib/tbx.c
// Function: get_tid
static inline int get_tid(tbx_t *tbx, const char *ss, int is_add)
{
    khint_t k;
    khash_t(s2i) *d;
    if (tbx->dict == 0) tbx->dict = kh_init(s2i);
    d = (khash_t(s2i)*)tbx->dict;
    if (is_add) {
        int absent;
        k = kh_put(s2i, d, ss, &absent);
        if (absent) {
            kh_key(d, k) = strdup(ss);
            kh_val(d, k) = kh_size(d) - 1;
        }
    } else k = kh_get(s2i, d, ss);
    return k == kh_end(d)? -1 : kh_val(d, k);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x20(%rax)
jne 0x78c3e
callq 0x6f430
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x20(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x78ca4
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x24(%rbp), %rdx
callq 0x6fb90
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0x78ca2
movq -0x10(%rbp), %rdi
callq 0x6dd0
movq %rax, %rdx
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x18(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movq -0x20(%rbp), %rax
movl 0x4(%rax), %eax
subl $0x1, %eax
movl %eax, %eax
movl %eax, %edx
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x18(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
jmp 0x78cb4
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x6f520
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl (%rcx), %eax
jne 0x78ccc
movq $-0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x78cdf
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x18(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/htslib/tbx.c
// Function: tbx_readrec
int tbx_readrec(BGZF *fp, void *tbxv, void *sv, int *tid, int *beg, int *end)
{
    tbx_t *tbx = (tbx_t *) tbxv;
    kstring_t *s = (kstring_t *) sv;
    int ret;
    if ((ret = bgzf_getline(fp, '\n', s)) >= 0) {
        tbx_intv_t intv;
        get_intv(tbx, s, &intv, 0);
        *tid = intv.tid; *beg = intv.beg; *end = intv.end;
    }
    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rdx
movl $0xa, %esi
callq 0x9db10
movl %eax, -0x44(%rbp)
cmpl $0x0, %eax
jl 0x791ae
movq -0x38(%rbp), %rdi
movq -0x40(%rbp), %rsi
leaq -0x70(%rbp), %rdx
xorl %ecx, %ecx
callq 0x791c0
movl -0x50(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x70(%rbp), %rax
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movq -0x68(%rbp), %rax
movl %eax, %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
movl -0x44(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/htslib/tbx.c
// Function: tbx_index_build2
int tbx_index_build2(const char *fn, const char *fnidx, int min_shift, const tbx_conf_t *conf)
{
    tbx_t *tbx;
    BGZF *fp;
    int ret;
    if ( bgzf_is_bgzf(fn)!=1 ) { fprintf(stderr,"Not a BGZF file: %s\n", fn); return -1; }
    if ((fp = bgzf_open(fn, "r")) == 0) return -1;
    if ( !fp->is_compressed ) { bgzf_close(fp); return -1; }
    tbx = tbx_index(fp, min_shift, conf);
    bgzf_close(fp);
    if ( !tbx ) return -1;
    ret = hts_idx_save_as(tbx->idx, fn, fnidx, min_shift > 0? HTS_FMT_CSI : HTS_FMT_TBI);
    tbx_destroy(tbx);
    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x10(%rbp), %rdi
callq 0x9d990
cmpl $0x1, %eax
je 0x798fd
movq 0x8b6f4(%rip), %rax     # 0x104fd0
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0x68dfb(%rip), %rsi     # 0xe26e5
movb $0x0, %al
callq 0x6a80
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x799ac
movq -0x10(%rbp), %rdi
leaq 0x6648e(%rip), %rsi     # 0xdfd96
callq 0x9afb0
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
jne 0x79923
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x799ac
movq -0x38(%rbp), %rax
movl (%rax), %eax
shrl $0x1d, %eax
andl $0x3, %eax
cmpl $0x0, %eax
jne 0x79946
movq -0x38(%rbp), %rdi
callq 0x9d380
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x799ac
movq -0x38(%rbp), %rdi
movl -0x1c(%rbp), %esi
movq -0x28(%rbp), %rdx
callq 0x795a0
movq %rax, -0x30(%rbp)
movq -0x38(%rbp), %rdi
callq 0x9d380
cmpq $0x0, -0x30(%rbp)
jne 0x79973
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x799ac
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movl -0x1c(%rbp), %r8d
movl $0x2, %ecx
xorl %eax, %eax
cmpl $0x0, %r8d
cmovgl %eax, %ecx
callq 0x756d0
movl %eax, -0x3c(%rbp)
movq -0x30(%rbp), %rdi
callq 0x79810
movl -0x3c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/htslib/tbx.c
// Function: tbx_index_load2
tbx_t *tbx_index_load2(const char *fn, const char *fnidx)
{
    tbx_t *tbx;
    uint8_t *meta;
    char *nm, *p;
    uint32_t x[7];
    int l_meta, l_nm;
    tbx = (tbx_t*)calloc(1, sizeof(tbx_t));
    tbx->idx = fnidx? hts_idx_load2(fn, fnidx) : hts_idx_load(fn, HTS_FMT_TBI);
    if ( !tbx->idx )
    {
        free(tbx);
        return NULL;
    }
    meta = hts_idx_get_meta(tbx->idx, &l_meta);
    if ( !meta )
    {
        free(tbx);
        return NULL;
    }
    memcpy(x, meta, 28);
    memcpy(&tbx->conf, x, 24);
    p = nm = (char*)meta + 28;
    l_nm = x[6];
    for (; p - nm < l_nm; p += strlen(p) + 1) get_tid(tbx, p, 1);
    return tbx;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x1, %edi
movl $0x28, %esi
callq 0x6460
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x79a2d
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x77700
movq %rax, -0x70(%rbp)
jmp 0x79a3f
movq -0x10(%rbp), %rdi
movl $0x2, %esi
callq 0x77670
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x20(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x79a6c
movq -0x20(%rbp), %rdi
callq 0x6880
movq $0x0, -0x8(%rbp)
jmp 0x79b35
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x64(%rbp), %rsi
callq 0x75ea0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x79a9e
movq -0x20(%rbp), %rdi
callq 0x6880
movq $0x0, -0x8(%rbp)
jmp 0x79b35
movq -0x28(%rbp), %rax
movq (%rax), %rcx
movq %rcx, -0x60(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0x58(%rbp)
movq 0x10(%rax), %rcx
movq %rcx, -0x50(%rbp)
movl 0x18(%rax), %eax
movl %eax, -0x48(%rbp)
movq -0x20(%rbp), %rax
movq -0x60(%rbp), %rcx
movq %rcx, (%rax)
movq -0x58(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x50(%rbp), %rcx
movq %rcx, 0x10(%rax)
movq -0x28(%rbp), %rax
addq $0x1c, %rax
movq %rax, -0x30(%rbp)
movq %rax, -0x38(%rbp)
movl -0x48(%rbp), %eax
movl %eax, -0x68(%rbp)
movq -0x38(%rbp), %rax
movq -0x30(%rbp), %rcx
subq %rcx, %rax
movslq -0x68(%rbp), %rcx
cmpq %rcx, %rax
jge 0x79b2d
movq -0x20(%rbp), %rdi
movq -0x38(%rbp), %rsi
movl $0x1, %edx
callq 0x78c10
movq -0x38(%rbp), %rdi
callq 0x62c0
addq $0x1, %rax
addq -0x38(%rbp), %rax
movq %rax, -0x38(%rbp)
jmp 0x79af0
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/htslib/./htslib/hfile.h
// Function: hread
static inline ssize_t HTS_RESULT_USED
hread(hFILE *fp, void *buffer, size_t nbytes)
{
    extern ssize_t hread2(hFILE *, void *, size_t, size_t);

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rcx
subq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x18(%rbp), %rax
jbe 0x7a64d
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x20(%rbp), %rdx
callq 0x6570
movq -0x20(%rbp), %rcx
movq -0x8(%rbp), %rax
addq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rax
cmpq -0x18(%rbp), %rax
jne 0x7a686
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
jmp 0x7a69f
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
callq 0xa1d60
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/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')
	val = val*10 + k->s[p++]-'0';
    
    *pos = p;
    *val_p = sign*val;

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl $0x1, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rcx
movq -0x10(%rbp), %rdx
xorl %eax, %eax
cmpq (%rdx), %rcx
movb %al, -0x31(%rbp)
jae 0x7a894
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x30(%rbp), %rcx
movsbl (%rax,%rcx), %ecx
movb $0x1, %al
cmpl $0x20, %ecx
movb %al, -0x32(%rbp)
je 0x7a88e
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x30(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x9, %eax
sete %al
movb %al, -0x32(%rbp)
movb -0x32(%rbp), %al
movb %al, -0x31(%rbp)
movb -0x31(%rbp), %al
testb $0x1, %al
jne 0x7a89d
jmp 0x7a8ab
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x7a849
movq -0x30(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x7a8e0
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x30(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x2d, %eax
jne 0x7a8e0
movl $0xffffffff, -0x24(%rbp) # imm = 0xFFFFFFFF
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x7a917
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x30(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x30, %eax
jl 0x7a917
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x30(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x39, %eax
jle 0x7a923
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x7a9bb
jmp 0x7a925
movq -0x30(%rbp), %rcx
movq -0x10(%rbp), %rdx
xorl %eax, %eax
cmpq (%rdx), %rcx
movb %al, -0x33(%rbp)
jae 0x7a96a
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x30(%rbp), %rcx
movsbl (%rax,%rcx), %ecx
xorl %eax, %eax
cmpl $0x30, %ecx
movb %al, -0x33(%rbp)
jl 0x7a96a
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x30(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x39, %eax
setle %al
movb %al, -0x33(%rbp)
movb -0x33(%rbp), %al
testb $0x1, %al
jne 0x7a973
jmp 0x7a99c
imull $0xa, -0x28(%rbp), %eax
movq -0x10(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq -0x30(%rbp), %rdx
movq %rdx, %rsi
addq $0x1, %rsi
movq %rsi, -0x30(%rbp)
movsbl (%rcx,%rdx), %ecx
addl %ecx, %eax
subl $0x30, %eax
movl %eax, -0x28(%rbp)
jmp 0x7a925
movq -0x30(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movl -0x24(%rbp), %ecx
imull -0x28(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/htslib/cram/cram_index.c
// Function: kget_int64
static int kget_int64(kstring_t *k, size_t *pos, int64_t *val_p) {
    int sign = 1;
    int64_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')
	val = val*10 + k->s[p++]-'0';
    
    *pos = p;
    *val_p = sign*val;

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl $0x1, -0x24(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rcx
movq -0x10(%rbp), %rdx
xorl %eax, %eax
cmpq (%rdx), %rcx
movb %al, -0x39(%rbp)
jae 0x7aa35
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x38(%rbp), %rcx
movsbl (%rax,%rcx), %ecx
movb $0x1, %al
cmpl $0x20, %ecx
movb %al, -0x3a(%rbp)
je 0x7aa2f
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x38(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x9, %eax
sete %al
movb %al, -0x3a(%rbp)
movb -0x3a(%rbp), %al
movb %al, -0x39(%rbp)
movb -0x39(%rbp), %al
testb $0x1, %al
jne 0x7aa3e
jmp 0x7aa4c
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x7a9ea
movq -0x38(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x7aa81
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x38(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x2d, %eax
jne 0x7aa81
movl $0xffffffff, -0x24(%rbp) # imm = 0xFFFFFFFF
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x7aab8
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x38(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x30, %eax
jl 0x7aab8
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x38(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x39, %eax
jle 0x7aac4
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x7ab64
jmp 0x7aac6
movq -0x38(%rbp), %rcx
movq -0x10(%rbp), %rdx
xorl %eax, %eax
cmpq (%rdx), %rcx
movb %al, -0x3b(%rbp)
jae 0x7ab0b
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x38(%rbp), %rcx
movsbl (%rax,%rcx), %ecx
xorl %eax, %eax
cmpl $0x30, %ecx
movb %al, -0x3b(%rbp)
jl 0x7ab0b
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x38(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x39, %eax
setle %al
movb %al, -0x3b(%rbp)
movb -0x3b(%rbp), %al
testb $0x1, %al
jne 0x7ab14
jmp 0x7ab42
imulq $0xa, -0x30(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq -0x38(%rbp), %rdx
movq %rdx, %rsi
addq $0x1, %rsi
movq %rsi, -0x38(%rbp)
movsbq (%rcx,%rdx), %rcx
addq %rcx, %rax
subq $0x30, %rax
movq %rax, -0x30(%rbp)
jmp 0x7aac6
movq -0x38(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movslq -0x24(%rbp), %rcx
imulq -0x30(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/htslib/cram/cram_index.c
// Function: cram_seek_to_refpos
int cram_seek_to_refpos(cram_fd *fd, cram_range *r) {
    cram_index *e;

    // 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))
	    if (0 != cram_seek(fd, e->offset - fd->first_container, SEEK_CUR))
		return -1;
    } else {
	// Absent from index, but this most likely means it simply has no data.
	return -2;
    }

    if (fd->ctr) {
	cram_free_container(fd->ctr);
	fd->ctr = NULL;
	fd->ooc = 0;
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movl (%rax), %esi
movq -0x18(%rbp), %rax
movl 0x4(%rax), %edx
xorl %eax, %eax
movl %eax, %ecx
callq 0x7ac50
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
je 0x7af55
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rsi
xorl %edx, %edx
callq 0x8aa60
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
je 0x7af53
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rsi
movq -0x10(%rbp), %rax
subq 0x8840(%rax), %rsi
movl $0x1, %edx
callq 0x8aa60
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
je 0x7af51
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x7af97
jmp 0x7af53
jmp 0x7af5e
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x7af97
movq -0x10(%rbp), %rax
cmpq $0x0, 0x38(%rax)
je 0x7af90
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rdi
callq 0x83b70
movq -0x10(%rbp), %rax
movq $0x0, 0x38(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x88f8(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/htslib/./htslib/hfile.h
// Function: hwrite
static inline ssize_t HTS_RESULT_USED
hwrite(hFILE *fp, const void *buffer, size_t nbytes)
{
    extern ssize_t hwrite2(hFILE *, const void *, size_t, size_t);

    size_t n = fp->limit - fp->begin;
    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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rcx
subq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x18(%rbp), %rax
jbe 0x7bced
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x6570
movq -0x20(%rbp), %rcx
movq -0x8(%rbp), %rax
addq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rax
cmpq -0x18(%rbp), %rax
jne 0x7bd26
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
jmp 0x7bd3f
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
callq 0xa20e0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/htslib/cram/cram_io.c
// Function: int32_encode
int int32_encode(cram_fd *fd, int32_t val) {
    val = le_int4(val);
    if (4 != hwrite(fd->fp, &val, 4))
	return -1;

    return 4;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq -0x14(%rbp), %rsi
movl $0x4, %edx
callq 0x7bcb0
movq %rax, %rcx
movl $0x4, %eax
cmpq %rcx, %rax
je 0x7dcb0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x7dcb7
movl $0x4, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/htslib/cram/cram_io.c
// Function: int32_get_blk
int int32_get_blk(cram_block *b, int32_t *val) {
    if (b->uncomp_size - BLOCK_SIZE(b) < 4)
	return -1;

    *val =
	 b->data[b->byte  ]        |
	(b->data[b->byte+1] <<  8) |
	(b->data[b->byte+2] << 16) |
	(b->data[b->byte+3] << 24);
    BLOCK_SIZE(b) += 4;
    return 4;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movslq 0x14(%rax), %rax
movq -0x10(%rbp), %rcx
subq 0x30(%rcx), %rax
cmpq $0x4, %rax
jae 0x7dceb
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x7dd6a
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x30(%rcx), %rcx
movzbl (%rax,%rcx), %ecx
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x10(%rbp), %rdx
movq 0x30(%rdx), %rdx
movzbl 0x1(%rax,%rdx), %eax
shll $0x8, %eax
orl %eax, %ecx
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x10(%rbp), %rdx
movq 0x30(%rdx), %rdx
movzbl 0x2(%rax,%rdx), %eax
shll $0x10, %eax
orl %eax, %ecx
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x10(%rbp), %rdx
movq 0x30(%rdx), %rdx
movzbl 0x3(%rax,%rdx), %eax
shll $0x18, %eax
orl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rcx
addq $0x4, %rcx
movq %rcx, 0x30(%rax)
movl $0x4, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/htslib/cram/cram_io.c
// Function: int32_put_blk
int int32_put_blk(cram_block *b, int32_t val) {
    unsigned char cp[4];
    cp[0] = ( val      & 0xff);
    cp[1] = ((val>>8)  & 0xff);
    cp[2] = ((val>>16) & 0xff);
    cp[3] = ((val>>24) & 0xff);

    BLOCK_APPEND(b, cp, 4);
    return b->data ? 0 : -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl -0xc(%rbp), %eax
andl $0xff, %eax
movb %al, -0x10(%rbp)
movl -0xc(%rbp), %eax
sarl $0x8, %eax
andl $0xff, %eax
movb %al, -0xf(%rbp)
movl -0xc(%rbp), %eax
sarl $0x10, %eax
andl $0xff, %eax
movb %al, -0xe(%rbp)
movl -0xc(%rbp), %eax
sarl $0x18, %eax
andl $0xff, %eax
movb %al, -0xd(%rbp)
jmp 0x7ddb6
jmp 0x7ddb8
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x30(%rcx), %rcx
addq $0x4, %rcx
cmpq %rcx, %rax
ja 0x7de85
movq -0x8(%rbp), %rax
cmpq $0x0, 0x28(%rax)
je 0x7de1e
movq -0x8(%rbp), %rax
movq 0x28(%rax), %xmm0
movaps 0x58230(%rip), %xmm1    # 0xd6020
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x58234(%rip), %xmm1    # 0xd6030
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd 0x5c85d(%rip), %xmm1    # 0xda670
mulsd %xmm1, %xmm0
movsd %xmm0, -0x18(%rbp)
jmp 0x7de2d
movsd 0x64d92(%rip), %xmm0    # 0xe2bb8
movsd %xmm0, -0x18(%rbp)
jmp 0x7de2d
movsd -0x18(%rbp), %xmm0
movsd 0x6421e(%rip), %xmm2    # 0xe2058
movaps %xmm0, %xmm1
subsd %xmm2, %xmm1
cvttsd2si %xmm1, %rax
cvttsd2si %xmm0, %rcx
movq %rcx, %rdx
sarq $0x3f, %rdx
andq %rdx, %rax
orq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rsi
callq 0x6c80
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x20(%rax)
jmp 0x7ddb8
jmp 0x7de87
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x30(%rcx), %rcx
movl -0x10(%rbp), %edx
movl %edx, (%rax,%rcx)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rcx
addq $0x4, %rcx
movq %rcx, 0x30(%rax)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
cmpq $0x0, %rdx
cmovnel %ecx, %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/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

    return b;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0xc(%rbp)
movl %esi, -0x10(%rbp)
movl $0x40, %edi
callq 0x69c0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x7e1cd
movq $0x0, -0x8(%rbp)
jmp 0x7e243
movq -0x18(%rbp), %rax
movl $0x0, 0x4(%rax)
movq -0x18(%rbp), %rax
movl $0x0, (%rax)
movl -0xc(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x8(%rax)
movl -0x10(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x10(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x14(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x20(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x28(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x30(%rax)
movq -0x18(%rbp), %rax
movl $0x7, 0x38(%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/htslib/cram/cram_io.c
// Function: cram_free_block
void cram_free_block(cram_block *b) {
    if (!b)
	return;
    if (b->data)
	free(b->data);
    free(b);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x7f765
jmp 0x7f786
movq -0x8(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x7f77d
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x6880
movq -0x8(%rbp), %rdi
callq 0x6880
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/htslib/cram/cram_io.c
// Function: cram_compress_by_method
static char *cram_compress_by_method(char *in, size_t in_size,
				     size_t *out_size,
				     enum cram_block_method method,
				     int level, int strat) {
    switch (method) {
    case GZIP:
	return zlib_mem_deflate(in, in_size, out_size, level, strat);

    case BZIP2: {
#ifdef HAVE_LIBBZ2
	unsigned int comp_size = in_size*1.01 + 600;
	char *comp = malloc(comp_size);
	if (!comp)
	    return NULL;

	if (BZ_OK != BZ2_bzBuffToBuffCompress(comp, &comp_size,
					      in, in_size,
					      level, 0, 30)) {
	    free(comp);
	    return NULL;
	}
	*out_size = comp_size;
	return comp;
#else
	return NULL;
#endif
    }

    case LZMA:
#ifdef HAVE_LIBLZMA
	return lzma_mem_deflate(in, in_size, out_size, level);
#else
	return NULL;
#endif

    case RANS0: {
	unsigned int out_size_i;
	unsigned char *cp;
	cp = rans_compress((unsigned char *)in, in_size, &out_size_i, 0);
	*out_size = out_size_i;
	return (char *)cp;
    }

    case RANS1: {
	unsigned int out_size_i;
	unsigned char *cp;
	
	cp = rans_compress((unsigned char *)in, in_size, &out_size_i, 1);
	*out_size = out_size_i;
	return (char *)cp;
    }

    case RAW:
	break;

    default:
	return NULL;
    }

    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movl %r8d, -0x28(%rbp)
movl %r9d, -0x2c(%rbp)
movl -0x24(%rbp), %eax
movq %rax, -0x50(%rbp)
subq $0xa, %rax
ja 0x809cc
movq -0x50(%rbp), %rax
leaq 0x61ff1(%rip), %rcx     # 0xe291c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movl -0x28(%rbp), %ecx
movl -0x2c(%rbp), %r8d
callq 0x8bbf0
movq %rax, -0x8(%rbp)
jmp 0x809de
movq $0x0, -0x8(%rbp)
jmp 0x809de
movq $0x0, -0x8(%rbp)
jmp 0x809de
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movl %eax, %esi
leaq -0x30(%rbp), %rdx
xorl %ecx, %ecx
callq 0x92ca0
movq %rax, -0x38(%rbp)
movl -0x30(%rbp), %eax
movl %eax, %ecx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x38(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x809de
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movl %eax, %esi
leaq -0x3c(%rbp), %rdx
movl $0x1, %ecx
callq 0x92ca0
movq %rax, -0x48(%rbp)
movl -0x3c(%rbp), %eax
movl %eax, %ecx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x48(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x809de
jmp 0x809d6
movq $0x0, -0x8(%rbp)
jmp 0x809de
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/htslib/cram/cram_io.c
// Function: cram_block_method2str
char *cram_block_method2str(enum cram_block_method m) {
    switch(m) {
    case RAW:	   return "RAW";
    case GZIP:	   return "GZIP";
    case BZIP2:	   return "BZIP2";
    case LZMA:     return "LZMA";
    case RANS0:    return "RANS0";
    case RANS1:    return "RANS1";
    case GZIP_RLE: return "GZIP_RLE";
    case ERROR:    break;
    }
    return "?";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0xc(%rbp)
movl -0xc(%rbp), %eax
incl %eax
movl %eax, %ecx
movq %rcx, -0x18(%rbp)
subl $0xc, %eax
ja 0x80a78
movq -0x18(%rbp), %rax
leaq 0x61f36(%rip), %rcx     # 0xe2948
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x62390(%rip), %rax     # 0xe2db2
movq %rax, -0x8(%rbp)
jmp 0x80a83
leaq 0x62387(%rip), %rax     # 0xe2db6
movq %rax, -0x8(%rbp)
jmp 0x80a83
leaq 0x619f3(%rip), %rax     # 0xe242f
movq %rax, -0x8(%rbp)
jmp 0x80a83
leaq 0x61a0b(%rip), %rax     # 0xe2454
movq %rax, -0x8(%rbp)
jmp 0x80a83
leaq 0x62365(%rip), %rax     # 0xe2dbb
movq %rax, -0x8(%rbp)
jmp 0x80a83
leaq 0x6235e(%rip), %rax     # 0xe2dc1
movq %rax, -0x8(%rbp)
jmp 0x80a83
leaq 0x62357(%rip), %rax     # 0xe2dc7
movq %rax, -0x8(%rbp)
jmp 0x80a83
jmp 0x80a78
leaq 0x59be9(%rip), %rax     # 0xda668
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/htslib/cram/cram_io.c
// Function: cram_new_metrics
cram_metrics *cram_new_metrics(void) {
    cram_metrics *m = calloc(1, sizeof(*m));
    if (!m)
	return NULL;
    m->trial = NTRIALS-1;
    m->next_trial = TRIAL_SPAN;
    m->method = RAW;
    m->strat = 0;
    m->revised_method = 0;

    return m;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x1, %edi
movl $0x78, %esi
callq 0x6460
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x80abc
movq $0x0, -0x8(%rbp)
jmp 0x80afa
movq -0x10(%rbp), %rax
movl $0x2, (%rax)
movq -0x10(%rbp), %rax
movl $0x32, 0x4(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x20(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x24(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x40(%rax)
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/htslib/cram/cram_io.c
// Function: paranoid_fclose
int paranoid_fclose(FILE *fp) {
    if (-1 == fflush(fp) && errno != EBADF) {
	fclose(fp);
	return -1;
    }

    errno = 0;
    if (-1 == fsync(fileno(fp))) {
	if (errno != EINVAL) { // eg pipe
	    fclose(fp);
	    return -1;
	}
    }
    return fclose(fp);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x6850
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl %ecx, %eax
jne 0x80bdc
callq 0x6060
cmpl $0x9, (%rax)
je 0x80bdc
movq -0x10(%rbp), %rdi
callq 0x66e0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x80c2c
callq 0x6060
movl $0x0, (%rax)
movq -0x10(%rbp), %rdi
callq 0x6740
movl %eax, %edi
callq 0x65c0
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl %ecx, %eax
jne 0x80c20
callq 0x6060
cmpl $0x16, (%rax)
je 0x80c1e
movq -0x10(%rbp), %rdi
callq 0x66e0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x80c2c
jmp 0x80c20
movq -0x10(%rbp), %rdi
callq 0x66e0
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/htslib/cram/cram_io.c
// Function: refs_free
void refs_free(refs_t *r) {
    RP("refs_free()\n");

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

    if (!r)
	return;

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

    if (r->h_meta) {
	khint_t k;

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

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

	kh_destroy(refs, r->h_meta);
    }
    
    if (r->ref_id)
	free(r->ref_id);

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

    pthread_mutex_destroy(&r->lock);

    free(r);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rcx
movl 0x30(%rcx), %eax
addl $-0x1, %eax
movl %eax, 0x30(%rcx)
cmpl $0x0, %eax
jle 0x80c63
jmp 0x80d64
cmpq $0x0, -0x8(%rbp)
jne 0x80c6f
jmp 0x80d64
movq -0x8(%rbp), %rax
cmpq $0x0, (%rax)
je 0x80c85
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0x97f90
movq -0x8(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x80d1e
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rcx
cmpl (%rcx), %eax
je 0x80d11
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rax), %rax
movl -0xc(%rbp), %ecx
shrl $0x4, %ecx
movl %ecx, %ecx
movl (%rax,%rcx,4), %eax
movl -0xc(%rbp), %ecx
andl $0xf, %ecx
shll %ecx
shrl %cl, %eax
andl $0x3, %eax
cmpl $0x0, %eax
je 0x80cd5
jmp 0x80d06
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x20(%rax), %rax
movl -0xc(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
jne 0x80cf4
jmp 0x80d06
movq -0x18(%rbp), %rdi
callq 0x80d70
movq -0x18(%rbp), %rdi
callq 0x6880
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x80c9b
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x80de0
movq -0x8(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x80d36
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x6880
movq -0x8(%rbp), %rax
cmpq $0x0, 0x28(%rax)
je 0x80d4e
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x9d380
movq -0x8(%rbp), %rdi
addq $0x38, %rdi
callq 0x6840
movq -0x8(%rbp), %rdi
callq 0x6880
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/htslib/cram/cram_io.c
// Function: ref_entry_free_seq
static void ref_entry_free_seq(ref_entry *e) {
    if (e->mf)
	mfclose(e->mf);
    if (e->seq && !e->mf)
	free(e->seq);

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x38(%rax)
je 0x80d94
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rdi
callq 0x8e3a0
movq -0x8(%rbp), %rax
cmpq $0x0, 0x30(%rax)
je 0x80db7
movq -0x8(%rbp), %rax
cmpq $0x0, 0x38(%rax)
jne 0x80db7
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x6880
movq -0x8(%rbp), %rax
movq $0x0, 0x30(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x38(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/htslib/cram/cram_io.c
// Function: refs2id
int refs2id(refs_t *r, SAM_hdr *h) {
    int i;

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

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

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

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x80e58
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x6880
movq -0x10(%rbp), %rax
cmpq $0x0, 0x60(%rax)
je 0x80e6f
movq -0x10(%rbp), %rax
movq $0x0, 0x60(%rax)
movq -0x18(%rbp), %rax
movslq 0x38(%rax), %rdi
movl $0x8, %esi
callq 0x6460
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x80ea3
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x80f67
movq -0x18(%rbp), %rax
movl 0x38(%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x18(%rax)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x38(%rcx), %eax
jge 0x80f60
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0x1c(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rsi
callq 0x80f70
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rcx
cmpl (%rcx), %eax
je 0x80f22
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x20(%rax), %rax
movl -0x20(%rbp), %ecx
movq (%rax,%rcx,8), %rdx
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x1c(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0x80f50
movq 0x840a7(%rip), %rax     # 0x104fd0
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0x1c(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rdx
leaq 0x61eb0(%rip), %rsi     # 0xe2df9
movb $0x0, %al
callq 0x6a80
jmp 0x80f52
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x80eb8
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/htslib/cram/cram_io.c
// Function: cram_set_header
int cram_set_header(cram_fd *fd, SAM_hdr *hdr) {
    if (fd->header)
	sam_hdr_free(fd->header);
    fd->header = hdr;
    return refs_from_header(fd->refs, fd, hdr);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x810e8
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x964f0
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rdx
callq 0x81110
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/htslib/cram/cram_io.c
// Function: cram_ref_incr_locked
static void cram_ref_incr_locked(refs_t *r, int id) {
    RP("%d INC REF %d, %d %p\n", gettid(), id, (int)(id>=0?r->ref_id[id]->count+1:-999), id>=0?r->ref_id[id]->seq:(char *)1);

    if (id < 0 || !r->ref_id[id]->seq)
	return;

    if (r->last_id == id)
	r->last_id = -1;

    ++r->ref_id[id]->count;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
jl 0x81708
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpq $0x0, 0x30(%rax)
jne 0x8170a
jmp 0x8173d
movq -0x8(%rbp), %rax
movl 0x68(%rax), %eax
cmpl -0xc(%rbp), %eax
jne 0x81721
movq -0x8(%rbp), %rax
movl $0xffffffff, 0x68(%rax) # imm = 0xFFFFFFFF
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x28(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x28(%rax)
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/htslib/cram/cram_io.c
// Function: cram_ref_decr_locked
static void cram_ref_decr_locked(refs_t *r, int id) {
    RP("%d DEC REF %d, %d %p\n", gettid(), id, (int)(id>=0?r->ref_id[id]->count-1:-999), id>=0?r->ref_id[id]->seq:(char *)1);

    if (id < 0 || !r->ref_id[id]->seq) {
	assert(r->ref_id[id]->count >= 0);
	return;
    }

    if (--r->ref_id[id]->count <= 0) {
	assert(r->ref_id[id]->count == 0);
	if (r->last_id >= 0) {
	    if (r->ref_id[r->last_id]->count <= 0 &&
		r->ref_id[r->last_id]->seq) {
		RP("%d FREE REF %d (%p)\n", gettid(),
		   r->last_id, r->ref_id[r->last_id]->seq);
		ref_entry_free_seq(r->ref_id[r->last_id]);
		r->ref_id[r->last_id]->length = 0;
	    }
	}
	r->last_id = id;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
jl 0x817ac
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpq $0x0, 0x30(%rax)
jne 0x817e9
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpq $0x0, 0x28(%rax)
jl 0x817c5
jmp 0x817e4
leaq 0x618ca(%rip), %rdi     # 0xe3096
leaq 0x614b3(%rip), %rsi     # 0xe2c86
movl $0x979, %edx            # imm = 0x979
leaq 0x618d1(%rip), %rcx     # 0xe30b0
callq 0x6450
jmp 0x818c8
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movq 0x28(%rcx), %rax
addq $-0x1, %rax
movq %rax, 0x28(%rcx)
cmpq $0x0, %rax
jg 0x818c8
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpq $0x0, 0x28(%rax)
jne 0x81828
jmp 0x81847
leaq 0x618aa(%rip), %rdi     # 0xe30d9
leaq 0x61450(%rip), %rsi     # 0xe2c86
movl $0x97e, %edx            # imm = 0x97E
leaq 0x6186e(%rip), %rcx     # 0xe30b0
callq 0x6450
movq -0x8(%rbp), %rax
cmpl $0x0, 0x68(%rax)
jl 0x818be
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rbp), %rcx
movslq 0x68(%rcx), %rcx
movq (%rax,%rcx,8), %rax
cmpq $0x0, 0x28(%rax)
jg 0x818bc
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rbp), %rcx
movslq 0x68(%rcx), %rcx
movq (%rax,%rcx,8), %rax
cmpq $0x0, 0x30(%rax)
je 0x818bc
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rbp), %rcx
movslq 0x68(%rcx), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x80d70
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rbp), %rcx
movslq 0x68(%rcx), %rcx
movq (%rax,%rcx,8), %rax
movq $0x0, 0x10(%rax)
jmp 0x818be
movl -0xc(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x68(%rax)
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/htslib/cram/cram_io.c
// Function: bgzf_open_ref
static BGZF *bgzf_open_ref(char *fn, char *mode, int is_md5) {
    BGZF *fp;

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

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

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

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

    return fp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1030, %rsp           # imm = 0x1030
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jne 0x81b4f
leaq -0x1030(%rbp), %rdi
movq -0x10(%rbp), %rcx
movl $0x1000, %esi           # imm = 0x1000
leaq 0x615e0(%rip), %rdx     # 0xe30f3
movb $0x0, %al
callq 0x6c20
leaq -0x1030(%rbp), %rdi
movl $0x4, %esi
callq 0x6cb0
cmpl $0x0, %eax
je 0x81b4d
movq -0x10(%rbp), %rdi
callq 0xa0250
cmpl $0x0, %eax
je 0x81b4b
movq $0x0, -0x8(%rbp)
jmp 0x81bda
jmp 0x81b4d
jmp 0x81b4f
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x9afb0
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
jne 0x81b79
movq -0x10(%rbp), %rdi
callq 0x6590
movq $0x0, -0x8(%rbp)
jmp 0x81bda
movq -0x28(%rbp), %rax
movl (%rax), %eax
shrl $0x1d, %eax
andl $0x3, %eax
cmpl $0x1, %eax
jne 0x81bd2
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq 0x61561(%rip), %rdx     # 0xe30fa
callq 0x9e170
cmpl $0x0, %eax
jge 0x81bd2
movq 0x83426(%rip), %rax     # 0x104fd0
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0x61547(%rip), %rsi     # 0xe30ff
movb $0x0, %al
callq 0x6a80
movq -0x28(%rbp), %rdi
callq 0x9d380
movq $0x0, -0x8(%rbp)
jmp 0x81bda
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x1030, %rsp           # imm = 0x1030
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/htslib/cram/cram_io.c
// Function: cram_load_reference
int cram_load_reference(cram_fd *fd, char *fn) {
    int ret = 0;

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

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

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

    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x82d6c
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rcx
xorl %eax, %eax
cmpl $0x0, 0x208(%rcx)
movb %al, -0x1d(%rbp)
je 0x82d06
movq -0x10(%rbp), %rax
cmpl $0x72, 0x8(%rax)
sete %al
movb %al, -0x1d(%rbp)
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdi
movb -0x1d(%rbp), %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %edx
callq 0x82e50
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x48(%rax)
je 0x82d45
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq 0x20(%rax), %rax
movq %rax, -0x38(%rbp)
jmp 0x82d4d
xorl %eax, %eax
movq %rax, -0x38(%rbp)
jmp 0x82d4d
movq -0x38(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x82d63
movl $0xffffffff, -0x1c(%rbp) # imm = 0xFFFFFFFF
movq -0x10(%rbp), %rdi
callq 0x83600
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x70(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x48(%rax)
je 0x82d98
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
cmpl $0x0, 0x18(%rax)
jne 0x82e06
cmpq $0x0, -0x18(%rbp)
jne 0x82e06
movq -0x10(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x82e06
movq -0x10(%rbp), %rax
cmpq $0x0, 0x48(%rax)
je 0x82dbb
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
callq 0x80c40
callq 0x837d0
movq -0x10(%rbp), %rcx
movq %rax, 0x48(%rcx)
cmpq $0x0, %rax
jne 0x82dd7
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x82e42
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x10(%rbp), %rsi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdx
callq 0x81110
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl %ecx, %eax
jne 0x82e04
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x82e42
jmp 0x82e06
movq -0x10(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x82e3c
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rsi
callq 0x80e30
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl %ecx, %eax
jne 0x82e3a
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x82e42
jmp 0x82e3c
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/htslib/cram/cram_io.c
// Function: cram_new_container
cram_container *cram_new_container(int nrec, int nslice) {
    cram_container *c = calloc(1, sizeof(*c));
    enum cram_DS_ID id;

    if (!c)
	return NULL;

    c->curr_ref = -2;

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

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

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

    c->pos_sorted = 1;
    c->max_apos   = 0;
    c->multi_seq  = 0;

    c->bams = NULL;

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

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

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

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

    return c;

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0xc(%rbp)
movl %esi, -0x10(%rbp)
movl $0x1, %edi
movl $0x250, %esi            # imm = 0x250
callq 0x6460
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x838d5
movq $0x0, -0x8(%rbp)
jmp 0x83a51
movq -0x18(%rbp), %rax
movl $0xfffffffe, 0x6c(%rax) # imm = 0xFFFFFFFE
movl -0xc(%rbp), %ecx
imull -0x10(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x60(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x64(%rax)
movl -0xc(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x58(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x18(%rax)
movl -0x10(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x50(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x54(%rax)
movq -0x18(%rbp), %rax
movl $0x1, 0x88(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x8c(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x94(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0xb8(%rax)
movslq -0x10(%rbp), %rdi
movl $0x8, %esi
callq 0x6460
movq -0x18(%rbp), %rcx
movq %rax, 0x78(%rcx)
cmpq $0x0, %rax
jne 0x8398a
jmp 0x83a21
movq -0x18(%rbp), %rax
movq $0x0, 0x80(%rax)
callq 0x83a60
movq -0x18(%rbp), %rcx
movq %rax, 0x40(%rcx)
cmpq $0x0, %rax
jne 0x839ae
jmp 0x83a21
movq -0x18(%rbp), %rax
movq $0x0, 0x48(%rax)
movl $0xb, -0x1c(%rbp)
cmpl $0x27, -0x1c(%rbp)
jae 0x839f0
callq 0x8c850
movq -0x18(%rbp), %rcx
movl -0x1c(%rbp), %edx
movq %rax, 0xc0(%rcx,%rdx,8)
cmpq $0x0, %rax
jne 0x839e3
jmp 0x83a21
jmp 0x839e5
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x839c1
callq 0x83b50
movq -0x18(%rbp), %rcx
movq %rax, 0x238(%rcx)
cmpq $0x0, %rax
jne 0x83a08
jmp 0x83a21
movq -0x18(%rbp), %rax
movq $0x0, 0x240(%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x83a51
cmpq $0x0, -0x18(%rbp)
je 0x83a49
movq -0x18(%rbp), %rax
cmpq $0x0, 0x78(%rax)
je 0x83a40
movq -0x18(%rbp), %rax
movq 0x78(%rax), %rdi
callq 0x6880
movq -0x18(%rbp), %rdi
callq 0x6880
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)