LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/sam.c
// Function: bam_aux_del
int bam_aux_del(bam1_t *b, uint8_t *s)
{
    uint8_t *p, *aux;
    int l_aux = bam_get_l_aux(b);
    aux = bam_get_aux(b);
    p = s - 2;
    s = skip_aux(s);
    memmove(p, s, l_aux - (s - aux));
    b->l_data -= s - p;
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movl 0x20(%rdi), %ebp
movq 0x8(%rdi), %rcx
movq %rcx, %rax
shrq $0x2e, %rax
andl $-0x4, %eax
shrl $0x18, %ecx
movslq 0x10(%rdi), %rdx
leal 0x1(%rdx), %edi
sarl %edi
leal (%rdx,%rcx), %r8d
addl %eax, %r8d
addl %edi, %r8d
subl %r8d, %ebp
addq 0x28(%rbx), %rax
movslq %edi, %r14
addq %rcx, %r14
addq %rdx, %r14
addq %rax, %r14
leaq -0x2(%rsi), %r15
movq %rsi, %rdi
callq 0x1a091
movq %rax, %r12
movslq %ebp, %rax
subq %r12, %r14
addq %rax, %r14
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x48c0
subl %r12d, %r15d
addl %r15d, 0x20(%rbx)
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/sam.c
// Function: bam_aux_update_str
int bam_aux_update_str(bam1_t *b, const char tag[2], int len, const char *data)
{
    uint8_t *s = bam_aux_get(b,tag);
    if (!s) return -1;
    char type = *s;
    if (type != 'Z') { fprintf(stderr,"bam_aux_update_str() called for type '%c' instead of 'Z'\n", type); abort(); }
    bam_aux_del(b,s);
    s -= 2;
    int l_aux = bam_get_l_aux(b);
    uint8_t *aux = bam_get_aux(b);

    b->l_data += 3 + len;
    if (b->m_data < b->l_data) {
        b->m_data = b->l_data;
        kroundup32(b->m_data);
        b->data = (uint8_t*)realloc(b->data, b->m_data);
    }
    memmove(s+3+len, s, l_aux - (s - aux));
    s[0] = tag[0];
    s[1] = tag[1];
    s[2] = type;
    memmove(s+3,data,len);
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %rbx
movl %edx, %r12d
movq %rsi, %r14
movq %rdi, %r13
callq 0x1a00b
testq %rax, %rax
je 0x1a360
movq %rax, %r15
movq %rbx, 0x10(%rsp)
movb (%rax), %al
movb %al, 0x7(%rsp)
cmpb $0x5a, %al
jne 0x1a374
movq %r13, %rdi
movq %r15, %rsi
callq 0x1a1a9
leaq -0x2(%r15), %r10
movl 0x20(%r13), %eax
movq 0x8(%r13), %rcx
movq %rcx, %rdx
shrq $0x2e, %rdx
andl $-0x4, %edx
shrl $0x18, %ecx
movslq 0x10(%r13), %rsi
leal 0x1(%rsi), %r8d
sarl %r8d
leal (%rsi,%rcx), %r9d
addl %edx, %r9d
addl %r8d, %r9d
movq 0x28(%r13), %rdi
addq %rdi, %rcx
addq %rdx, %rcx
movslq %r8d, %rbx
addq %rcx, %rbx
addq %rsi, %rbx
leal (%r12,%rax), %ecx
addl $0x3, %ecx
movl %eax, %ebp
subl %r9d, %ebp
movl %ecx, 0x20(%r13)
cmpl %ecx, 0x24(%r13)
jge 0x1a312
decl %ecx
movl %ecx, %eax
sarl %eax
orl %ecx, %eax
movl %eax, %ecx
sarl $0x2, %ecx
orl %eax, %ecx
movl %ecx, %eax
sarl $0x4, %eax
orl %ecx, %eax
movl %eax, %ecx
sarl $0x8, %ecx
orl %eax, %ecx
movl %ecx, %eax
sarl $0x10, %eax
orl %ecx, %eax
incl %eax
movl %eax, 0x24(%r13)
movslq %eax, %rsi
movq %r14, 0x8(%rsp)
movq %r12, %r14
movq %r10, %r12
callq 0x48d0
movq %r12, %r10
movq %r14, %r12
movq 0x8(%rsp), %r14
movq %rax, 0x28(%r13)
movslq %r12d, %r12
leaq (%r15,%r12), %rdi
incq %rdi
movq %r15, %r13
incq %r13
movslq %ebp, %rax
subq %r10, %rbx
addq %rax, %rbx
movq %r10, %rsi
movq %rbx, %rdx
callq 0x48c0
movb (%r14), %al
movb %al, -0x2(%r15)
movb 0x1(%r14), %al
movb %al, -0x1(%r15)
movb 0x7(%rsp), %al
movb %al, (%r15)
movq %r13, %rdi
movq 0x10(%rsp), %rsi
movq %r12, %rdx
callq 0x48c0
xorl %eax, %eax
jmp 0x1a365
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movzbl 0x7(%rsp), %edi
callq 0x50b7
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/sam.c
// Function: bam_aux2i
int32_t bam_aux2i(const uint8_t *s)
{
    int type;
    type = *s++;
    if (type == 'c') return (int32_t)*(int8_t*)s;
    else if (type == 'C') return (int32_t)*(uint8_t*)s;
    else if (type == 's') return (int32_t)*(int16_t*)s;
    else if (type == 'S') return (int32_t)*(uint16_t*)s;
    else if (type == 'i' || type == 'I') return *(int32_t*)s;
    else return 0;
}

// Assembly:
movb (%rdi), %cl
leal -0x43(%rcx), %eax
rolb $0x4, %al
cmpb $0x3, %al
ja 0x1a3b1
movzbl %al, %eax
leaq 0x38f00(%rip), %rcx     # 0x53294
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movzbl 0x1(%rdi), %eax
retq
movsbl 0x1(%rdi), %eax
retq
movswl 0x1(%rdi), %eax
retq
movzwl 0x1(%rdi), %eax
retq
andb $-0x21, %cl
xorl %eax, %eax
cmpb $0x49, %cl
jne 0x1a3be
movl 0x1(%rdi), %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/sam.c
// Function: bam_aux2f
double bam_aux2f(const uint8_t *s)
{
    int type;
    type = *s++;
    if (type == 'd') return *(double*)s;
    else if (type == 'f') return *(float*)s;
    else return 0.0;
}

// Assembly:
movzbl (%rdi), %eax
cmpl $0x66, %eax
je 0x1a3d5
xorps %xmm0, %xmm0
cmpl $0x64, %eax
jne 0x1a3da
movsd 0x1(%rdi), %xmm0
retq
cvtss2sd 0x1(%rdi), %xmm0
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/sam.c
// Function: sam_open_mode
int sam_open_mode(char *mode, const char *fn, const char *format)
{
    // TODO Parse "bam5" etc for compression level
    if (format == NULL) {
        // Try to pick a format based on the filename extension
        const char *ext = fn? strrchr(fn, '.') : NULL;
        if (ext == NULL || strchr(ext, '/')) return -1;
        return sam_open_mode(mode, fn, ext+1);
    }
    else if (strcmp(format, "bam") == 0) strcpy(mode, "b");
    else if (strcmp(format, "cram") == 0) strcpy(mode, "c");
    else if (strcmp(format, "sam") == 0) strcpy(mode, "");
    else return -1;

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testq %r14, %r14
jne 0x1a44e
testq %r15, %r15
je 0x1a42f
movq %r15, %rdi
movl $0x2e, %esi
callq 0x45a0
movq %rax, %r14
jmp 0x1a432
xorl %r14d, %r14d
testq %r14, %r14
je 0x1a49f
movq %r14, %rdi
movl $0x2f, %esi
callq 0x4200
testq %rax, %rax
jne 0x1a49f
incq %r14
jmp 0x1a413
leaq 0x389b4(%rip), %rsi     # 0x52e09
movq %r14, %rdi
callq 0x4750
testl %eax, %eax
je 0x1a491
leaq 0x389a5(%rip), %rsi     # 0x52e0d
movq %r14, %rdi
callq 0x4750
testl %eax, %eax
je 0x1a498
leaq 0x3898a(%rip), %rsi     # 0x52e05
movq %r14, %rdi
callq 0x4750
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0x1a49f
movb $0x0, (%rbx)
jmp 0x1a49d
movw $0x62, (%rbx)
jmp 0x1a49d
movw $0x63, (%rbx)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/sam.c
// Function: bam_plp_init
bam_plp_t bam_plp_init(bam_plp_auto_f func, void *data)
{
    bam_plp_t iter;
    iter = (bam_plp_t)calloc(1, sizeof(struct __bam_plp_t));
    iter->mp = mp_init();
    iter->head = iter->tail = mp_alloc(iter->mp);
    iter->max_tid = iter->max_pos = -1;
    iter->maxcnt = 8000;
    if (func) {
        iter->func = func;
        iter->data = data;
        iter->b = bam_init1();
    }
    return iter;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
movl $0x1, %edi
movl $0x68, %esi
callq 0x4360
movq %rax, %rbx
movl $0x1, %edi
movl $0x18, %esi
callq 0x4360
incl (%rax)
movq %rax, (%rbx)
movslq 0x4(%rax), %rcx
testq %rcx, %rcx
je 0x1abdc
movq 0x10(%rax), %rdx
leaq -0x1(%rcx), %rsi
movl %esi, 0x4(%rax)
movq -0x8(%rdx,%rcx,8), %rax
jmp 0x1abeb
movl $0x1, %edi
movl $0x58, %esi
callq 0x4360
movq %rax, 0x10(%rbx)
movq %rax, 0x8(%rbx)
movq $-0x1, 0x20(%rbx)
movl $0x1f40, 0x34(%rbx)     # imm = 0x1F40
testq %r15, %r15
je 0x1ac22
movq %r15, 0x50(%rbx)
movq %r14, 0x58(%rbx)
movl $0x1, %edi
movl $0x38, %esi
callq 0x4360
movq %rax, 0x48(%rbx)
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/sam.c
// Function: bam_plp_destroy
void bam_plp_destroy(bam_plp_t iter)
{
    lbnode_t *p, *pnext;
    if ( iter->overlaps ) kh_destroy(olap_hash, iter->overlaps);
    for (p = iter->head; p != NULL; p = pnext) {
        pnext = p->next;
        mp_free(iter->mp, p);
    }
    mp_destroy(iter->mp);
    if (iter->b) bam_destroy1(iter->b);
    free(iter->plp);
    free(iter);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0x60(%rdi), %r14
testq %r14, %r14
je 0x1ac7b
movq 0x18(%r14), %rdi
callq 0x4610
movq 0x10(%r14), %rdi
callq 0x4610
movq 0x20(%r14), %rdi
callq 0x4610
movq %r14, %rdi
callq 0x4610
movq 0x8(%rbx), %r14
testq %r14, %r14
je 0x1ace9
movl $0x100, %ebp            # imm = 0x100
movq 0x50(%r14), %r15
movq (%rbx), %r12
decl (%r12)
movq $0x0, 0x50(%r14)
movl 0x8(%r12), %eax
cmpl %eax, 0x4(%r12)
jne 0x1accb
leal (%rax,%rax), %ecx
testl %eax, %eax
cmovel %ebp, %ecx
movl %ecx, 0x8(%r12)
movq 0x10(%r12), %rdi
movslq %ecx, %rsi
shlq $0x3, %rsi
callq 0x48d0
movq %rax, 0x10(%r12)
movq 0x10(%r12), %rax
movslq 0x4(%r12), %rcx
leal 0x1(%rcx), %edx
movl %edx, 0x4(%r12)
movq %r14, (%rax,%rcx,8)
movq %r15, %r14
testq %r15, %r15
jne 0x1ac89
movq (%rbx), %r14
cmpl $0x0, 0x4(%r14)
jle 0x1ad20
xorl %r15d, %r15d
movq 0x10(%r14), %rax
movq (%rax,%r15,8), %rax
movq 0x28(%rax), %rdi
callq 0x4610
movq 0x10(%r14), %rax
movq (%rax,%r15,8), %rdi
callq 0x4610
incq %r15
movslq 0x4(%r14), %rax
cmpq %rax, %r15
jl 0x1acf6
movq 0x10(%r14), %rdi
callq 0x4610
movq %r14, %rdi
callq 0x4610
movq 0x48(%rbx), %r14
testq %r14, %r14
je 0x1ad4b
movq 0x28(%r14), %rdi
callq 0x4610
movq %r14, %rdi
callq 0x4610
movq 0x40(%rbx), %rdi
callq 0x4610
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x4610
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/sam.c
// Function: overlap_remove
static void overlap_remove(bam_plp_t iter, const bam1_t *b)
{
    if ( !iter->overlaps ) return;

    khiter_t kitr;
    if ( b )
    {
        kitr = kh_get(olap_hash, iter->overlaps, bam_get_qname(b));
        if ( kitr!=kh_end(iter->overlaps) )
            kh_del(olap_hash, iter->overlaps, kitr);
    }
    else
    {
        // remove all
        for (kitr = kh_begin(iter->overlaps); kitr<kh_end(iter->overlaps); kitr++)
            if ( kh_exist(iter->overlaps, kitr) ) kh_del(olap_hash, iter->overlaps, kitr);
    }
}

// Assembly:
movq 0x60(%rdi), %r10
testq %r10, %r10
je 0x1b507
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
testq %rsi, %rsi
je 0x1b3ed
movl (%r10), %eax
testl %eax, %eax
je 0x1b434
movq 0x28(%rsi), %r15
movq %rax, 0x10(%rsp)
leal -0x1(%rax), %esi
movsbl (%r15), %r12d
testl %r12d, %r12d
je 0x1b43c
movb 0x1(%r15), %al
testb %al, %al
je 0x1b43f
leaq 0x2(%r15), %rcx
movl %r12d, %edx
shll $0x5, %edx
subl %r12d, %edx
movsbl %al, %r12d
addl %edx, %r12d
movb (%rcx), %al
incq %rcx
testb %al, %al
jne 0x1b3d2
jmp 0x1b43f
cmpl $0x0, (%r10)
je 0x1b4f9
movq 0x10(%r10), %rax
xorl %edx, %edx
xorl %esi, %esi
movl %esi, %edi
shrl $0x4, %edi
movl (%rax,%rdi,4), %r8d
movl %edx, %ecx
andl $0x1e, %ecx
movl %r8d, %r9d
shrl %cl, %r9d
testb $0x3, %r9b
jne 0x1b425
btsl %ecx, %r8d
movl %r8d, (%rax,%rdi,4)
decl 0x4(%r10)
incl %esi
addl $0x2, %edx
cmpl (%r10), %esi
jb 0x1b3ff
jmp 0x1b4f9
xorl %r14d, %r14d
jmp 0x1b4c8
xorl %r12d, %r12d
andl %esi, %r12d
movq 0x10(%r10), %rdx
movl $0x1, %r13d
movl %r12d, %r14d
movq %r10, 0x20(%rsp)
movl %esi, 0xc(%rsp)
movq %rdx, 0x18(%rsp)
movl %r14d, %eax
shrl $0x4, %eax
movl (%rdx,%rax,4), %ebx
leal (%r14,%r14), %ebp
andl $0x1e, %ebp
movl %ebx, %eax
movl %ebp, %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0x1b4b8
testb $0x1, %al
jne 0x1b4a0
movq 0x18(%r10), %rax
movl %r14d, %ecx
movq (%rax,%rcx,8), %rdi
movq %r15, %rsi
callq 0x4750
movq 0x18(%rsp), %rdx
movl 0xc(%rsp), %esi
movq 0x20(%rsp), %r10
testl %eax, %eax
je 0x1b4b8
addl %r13d, %r14d
andl %esi, %r14d
incl %r13d
cmpl %r12d, %r14d
jne 0x1b45d
movq 0x10(%rsp), %rax
movl %eax, %r14d
jmp 0x1b4c8
movl %ebp, %ecx
shrl %cl, %ebx
testb $0x3, %bl
movq 0x10(%rsp), %rax
cmovnel %eax, %r14d
cmpl %eax, %r14d
je 0x1b4f9
movq 0x10(%r10), %rax
movl %r14d, %edx
shrl $0x4, %edx
movl (%rax,%rdx,4), %esi
addl %r14d, %r14d
andl $0x1e, %r14d
movl %esi, %edi
movl %r14d, %ecx
shrl %cl, %edi
testb $0x3, %dil
jne 0x1b4f9
btsl %r14d, %esi
movl %esi, (%rax,%rdx,4)
decl 0x4(%r10)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/sam.c
// Function: bam_plp_auto
const bam_pileup1_t *bam_plp_auto(bam_plp_t iter, int *_tid, int *_pos, int *_n_plp)
{
    const bam_pileup1_t *plp;
    if (iter->func == 0 || iter->error) { *_n_plp = -1; return 0; }
    if ((plp = bam_plp_next(iter, _tid, _pos, _n_plp)) != 0) return plp;
    else { // no pileup line can be obtained; read alignments
        *_n_plp = 0;
        if (iter->is_eof) return 0;
        int ret;
        while ( (ret=iter->func(iter->data, iter->b)) >= 0) {
            if (bam_plp_push(iter, iter->b) < 0) {
                *_n_plp = -1;
                return 0;
            }
            if ((plp = bam_plp_next(iter, _tid, _pos, _n_plp)) != 0) return plp;
            // otherwise no pileup line can be returned; read the next alignment.
        }
        if ( ret < -1 ) { iter->error = ret; *_n_plp = -1; return 0; }
        bam_plp_push(iter, 0);
        if ((plp = bam_plp_next(iter, _tid, _pos, _n_plp)) != 0) return plp;
        return 0;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
cmpq $0x0, 0x50(%rdi)
je 0x1bf97
movq %rdi, %r15
cmpl $0x0, 0x30(%rdi)
je 0x1bfab
movl $0xffffffff, (%rbx)     # imm = 0xFFFFFFFF
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rdx, %r14
movq %rsi, %r12
movq %r15, %rdi
movq %rbx, %rcx
callq 0x1ad64
testq %rax, %rax
jne 0x1bf9f
movl $0x0, (%rbx)
cmpl $0x0, 0x28(%r15)
jne 0x1bf9d
jmp 0x1bff6
movq 0x48(%r15), %rsi
movq %r15, %rdi
callq 0x1b508
testl %eax, %eax
js 0x1bf97
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x1ad64
testq %rax, %rax
jne 0x1bf9f
movq 0x48(%r15), %rsi
movq 0x58(%r15), %rdi
callq *0x50(%r15)
testl %eax, %eax
jns 0x1bfd0
cmpl $-0x1, %eax
je 0x1c011
movl %eax, 0x30(%r15)
jmp 0x1bf97
cmpl $0x0, 0x30(%r15)
jne 0x1c020
movl $0x1, 0x28(%r15)
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x1ad64
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/sam.c
// Function: bam_plp_reset
void bam_plp_reset(bam_plp_t iter)
{
    overlap_remove(iter, NULL);
    iter->max_tid = iter->max_pos = -1;
    iter->tid = iter->pos = 0;
    iter->is_eof = 0;
    while (iter->head != iter->tail) {
        lbnode_t *p = iter->head;
        iter->head = p->next;
        mp_free(iter->mp, p);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %esi, %esi
callq 0x1b386
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %rax, 0x24(%rbx)
movl $0xffffffff, 0x20(%rbx) # imm = 0xFFFFFFFF
movq $0x0, 0x18(%rbx)
movq 0x8(%rbx), %r14
cmpq 0x10(%rbx), %r14
je 0x1c0d1
movl $0x100, %ebp            # imm = 0x100
movq 0x50(%r14), %rax
movq %rax, 0x8(%rbx)
movq (%rbx), %r15
decl (%r15)
movq $0x0, 0x50(%r14)
movl 0x8(%r15), %eax
cmpl %eax, 0x4(%r15)
jne 0x1c0b4
leal (%rax,%rax), %ecx
testl %eax, %eax
cmovel %ebp, %ecx
movl %ecx, 0x8(%r15)
movq 0x10(%r15), %rdi
movslq %ecx, %rsi
shlq $0x3, %rsi
callq 0x48d0
movq %rax, 0x10(%r15)
movq 0x10(%r15), %rax
movslq 0x4(%r15), %rcx
leal 0x1(%rcx), %edx
movl %edx, 0x4(%r15)
movq %r14, (%rax,%rcx,8)
movq 0x8(%rbx), %r14
cmpq 0x10(%rbx), %r14
jne 0x1c074
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/sam.c
// Function: bam_mplp_init
bam_mplp_t bam_mplp_init(int n, bam_plp_auto_f func, void **data)
{
    int i;
    bam_mplp_t iter;
    iter = (bam_mplp_t)calloc(1, sizeof(struct __bam_mplp_t));
    iter->pos = (uint64_t*)calloc(n, sizeof(uint64_t));
    iter->n_plp = (int*)calloc(n, sizeof(int));
    iter->plp = (const bam_pileup1_t**)calloc(n, sizeof(bam_pileup1_t*));
    iter->iter = (bam_plp_t*)calloc(n, sizeof(bam_plp_t));
    iter->n = n;
    iter->min = (uint64_t)-1;
    for (i = 0; i < n; ++i) {
        iter->iter[i] = bam_plp_init(func, data[i]);
        iter->pos[i] = iter->min;
    }
    return iter;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, %ebp
movl $0x1, %edi
movl $0x30, %esi
callq 0x4360
movq %rax, %r15
movl %ebp, 0xc(%rsp)
movslq %ebp, %r13
movl $0x8, %esi
movq %r13, %rdi
callq 0x4360
movq %rax, %r12
movq %rax, 0x10(%r15)
movl $0x4, %esi
movq %r13, %rdi
callq 0x4360
movq %rax, 0x20(%r15)
movl $0x8, %esi
movq %r13, %rdi
callq 0x4360
movq %rax, 0x28(%r15)
movl $0x8, %esi
movq %r13, %rdi
callq 0x4360
movq %rax, 0x18(%r15)
movl %r13d, (%r15)
movq %r15, 0x10(%rsp)
movq $-0x1, 0x8(%r15)
testl %r13d, %r13d
jle 0x1c197
movq %rax, %rbp
movl 0xc(%rsp), %r13d
xorl %r15d, %r15d
movq (%rbx,%r15,8), %rsi
movq %r14, %rdi
callq 0x1ab90
movq %rax, (%rbp,%r15,8)
movq $-0x1, (%r12,%r15,8)
incq %r15
cmpq %r15, %r13
jne 0x1c176
movq 0x10(%rsp), %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/sam.c
// Function: bam_mplp_destroy
void bam_mplp_destroy(bam_mplp_t iter)
{
    int i;
    for (i = 0; i < iter->n; ++i) bam_plp_destroy(iter->iter[i]);
    free(iter->iter); free(iter->pos); free(iter->n_plp); free(iter->plp);
    free(iter);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x0, (%rdi)
jle 0x1c233
xorl %r14d, %r14d
movq 0x18(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x1ac44
incq %r14
movslq (%rbx), %rax
cmpq %rax, %r14
jl 0x1c21b
movq 0x18(%rbx), %rdi
callq 0x4610
movq 0x10(%rbx), %rdi
callq 0x4610
movq 0x20(%rbx), %rdi
callq 0x4610
movq 0x28(%rbx), %rdi
callq 0x4610
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x4610
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/sam.c
// Function: bam_mplp_auto
int bam_mplp_auto(bam_mplp_t iter, int *_tid, int *_pos, int *n_plp, const bam_pileup1_t **plp)
{
    int i, ret = 0;
    uint64_t new_min = (uint64_t)-1;
    for (i = 0; i < iter->n; ++i) {
        if (iter->pos[i] == iter->min) {
            int tid, pos;
            iter->plp[i] = bam_plp_auto(iter->iter[i], &tid, &pos, &iter->n_plp[i]);
            if ( iter->iter[i]->error ) return -1;
            iter->pos[i] = iter->plp[i] ? (uint64_t)tid<<32 | pos : 0;
        }
        if (iter->plp[i] && iter->pos[i] < new_min) new_min = iter->pos[i];
    }
    iter->min = new_min;
    if (new_min == (uint64_t)-1) return 0;
    *_tid = new_min>>32; *_pos = (uint32_t)new_min;
    for (i = 0; i < iter->n; ++i) {
        if (iter->pos[i] == iter->min) { // FIXME: valgrind reports "uninitialised value(s) at this line"
            n_plp[i] = iter->n_plp[i], plp[i] = iter->plp[i];
            ++ret;
        } else n_plp[i] = 0, plp[i] = 0;
    }
    return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq %rdi, %r15
cmpl $0x0, (%rdi)
jle 0x1c335
movq $-0x1, %r13
xorl %ebp, %ebp
xorl %r12d, %r12d
movq 0x10(%r15), %rax
movq (%rax,%rbp,2), %rax
cmpq 0x8(%r15), %rax
jne 0x1c306
movq 0x18(%r15), %rax
movq (%rax,%rbp,2), %rdi
movq 0x20(%r15), %rcx
addq %rbp, %rcx
leaq 0x4(%rsp), %rsi
movq %rsp, %rdx
callq 0x1bf7c
movq 0x28(%r15), %rcx
movq %rax, (%rcx,%rbp,2)
movq 0x18(%r15), %rax
movq (%rax,%rbp,2), %rax
cmpl $0x0, 0x30(%rax)
jne 0x1c3aa
movq 0x10(%r15), %rax
movq 0x28(%r15), %rcx
movq (%rcx,%rbp,2), %rcx
movl 0x4(%rsp), %edx
shlq $0x20, %rdx
movslq (%rsp), %rsi
orq %rdx, %rsi
testq %rcx, %rcx
cmoveq %rcx, %rsi
movq %rsi, (%rax,%rbp,2)
movq 0x28(%r15), %rax
cmpq $0x0, (%rax,%rbp,2)
je 0x1c320
movq 0x10(%r15), %rax
movq (%rax,%rbp,2), %rax
cmpq %r13, %rax
cmovbq %rax, %r13
incq %r12
movslq (%r15), %rax
addq $0x4, %rbp
cmpq %rax, %r12
jl 0x1c29c
jmp 0x1c33c
movq $-0x1, %r13
movq %r13, 0x8(%r15)
xorl %eax, %eax
cmpq $-0x1, %r13
je 0x1c3af
movq %r13, %rcx
shrq $0x20, %rcx
movq 0x8(%rsp), %rdx
movl %ecx, (%rdx)
movq 0x10(%rsp), %rcx
movl %r13d, (%rcx)
cmpl $0x0, (%r15)
jle 0x1c3af
xorl %ecx, %ecx
xorl %eax, %eax
movq 0x10(%r15), %rdx
cmpq %r13, (%rdx,%rcx,8)
jne 0x1c38d
movq 0x20(%r15), %rdx
movl (%rdx,%rcx,4), %edx
movl %edx, (%r14,%rcx,4)
movq 0x28(%r15), %rdx
movq (%rdx,%rcx,8), %rdx
movq %rdx, (%rbx,%rcx,8)
incl %eax
jmp 0x1c39d
movl $0x0, (%r14,%rcx,4)
movq $0x0, (%rbx,%rcx,8)
incq %rcx
movslq (%r15), %rdx
cmpq %rdx, %rcx
jl 0x1c368
jmp 0x1c3af
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/sam.c
// Function: bam_mplp_reset
void bam_mplp_reset(bam_mplp_t iter)
{
    int i;
    iter->min = (uint64_t)-1;
    for (i = 0; i < iter->n; ++i) {
        bam_plp_reset(iter->iter[i]);
        iter->pos[i] = (uint64_t)-1;
        iter->n_plp[i] = 0;
        iter->plp[i] = NULL;
    }
}

// Assembly:
movq $-0x1, 0x8(%rdi)
cmpl $0x0, (%rdi)
jle 0x1c418
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
movq 0x18(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x1c03c
movq 0x10(%rbx), %rax
movq $-0x1, (%rax,%r14,8)
movq 0x20(%rbx), %rax
movl $0x0, (%rax,%r14,4)
movq 0x28(%rbx), %rax
movq $0x0, (%rax,%r14,8)
incq %r14
movslq (%rbx), %rax
cmpq %rax, %r14
jl 0x1c3d5
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/./cram/cram_io.h
// Function: safe_itf8_get
static inline int safe_itf8_get(const char *cp, const char *endp,
                                int32_t *val_p) {
    const unsigned char *up = (unsigned char *)cp;

    if (endp - cp < 5 &&
        (cp >= endp || endp - cp < itf8_bytes[up[0]>>4])) {
        *val_p = 0;
        return 0;
    }

    if (up[0] < 0x80) {
        *val_p =   up[0];
        return 1;
    } else if (up[0] < 0xc0) {
        *val_p = ((up[0] <<8) |  up[1])                           & 0x3fff;
        return 2;
    } else if (up[0] < 0xe0) {
        *val_p = ((up[0]<<16) | (up[1]<< 8) |  up[2])             & 0x1fffff;
        return 3;
    } else if (up[0] < 0xf0) {
        *val_p = ((up[0]<<24) | (up[1]<<16) | (up[2]<<8) | up[3]) & 0x0fffffff;
        return 4;
    } else {
        *val_p = ((up[0] & 0x0f)<<28) | (up[1]<<20) | (up[2]<<12) | (up[3]<<4) | (up[4] & 0x0f);
        return 5;
    }
}

// Assembly:
movq %rsi, %r8
subq %rdi, %r8
cmpq $0x4, %r8
jg 0x1ca57
xorl %ecx, %ecx
cmpq %rsi, %rdi
jae 0x1ca7b
movzbl (%rdi), %eax
shrl $0x4, %eax
leaq 0x37cb7(%rip), %rsi     # 0x54700
movslq (%rsi,%rax,4), %rsi
movl $0x0, %eax
cmpq %rsi, %r8
jl 0x1ca7d
movzbl (%rdi), %ecx
movl $0x1, %eax
testb %cl, %cl
jns 0x1ca7d
movzbl 0x1(%rdi), %eax
cmpb $-0x41, %cl
ja 0x1ca80
andl $0x3f, %ecx
shll $0x8, %ecx
orl %eax, %ecx
movl $0x2, %eax
jmp 0x1ca7d
xorl %eax, %eax
movl %ecx, (%rdx)
retq
cmpb $-0x21, %cl
ja 0x1ca9d
shll $0x8, %eax
movzbl 0x2(%rdi), %esi
andl $0x1f, %ecx
shll $0x10, %ecx
orl %eax, %ecx
orl %esi, %ecx
movl $0x3, %eax
jmp 0x1ca7d
cmpb $-0x11, %cl
ja 0x1cac3
shll $0x10, %eax
movzbl 0x2(%rdi), %esi
shll $0x8, %esi
movzbl 0x3(%rdi), %edi
andl $0xf, %ecx
shll $0x18, %ecx
orl %eax, %ecx
orl %esi, %ecx
orl %edi, %ecx
movl $0x4, %eax
jmp 0x1ca7d
shll $0x1c, %ecx
shll $0x14, %eax
orl %ecx, %eax
movzbl 0x2(%rdi), %ecx
shll $0xc, %ecx
orl %eax, %ecx
movzbl 0x3(%rdi), %eax
shll $0x4, %eax
orl %ecx, %eax
movzbl 0x4(%rdi), %ecx
andl $0xf, %ecx
orl %eax, %ecx
movl $0x5, %eax
jmp 0x1ca7d
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/cram_decode.c
// Function: cram_decode_estimate_sizes
void cram_decode_estimate_sizes(cram_block_compression_hdr *hdr, cram_slice *s,
				int *qual_size, int *name_size,
				int *q_id) {
    int bnum1, bnum2;
    cram_codec *cd;

    *qual_size = 0;
    *name_size = 0;

    /* Qual */
    cd = hdr->codecs[DS_QS];
    bnum1 = cram_codec_to_id(cd, &bnum2);
    if (bnum1 < 0 && bnum2 >= 0) bnum1 = bnum2;
    if (cram_ds_unique(hdr, cd, bnum1)) {
	cram_block *b = cram_get_block_by_id(s, bnum1);
	if (b) *qual_size = b->uncomp_size;
	if (q_id && cd->codec == E_EXTERNAL)
	    *q_id = bnum1;
    }

    /* Name */
    cd = hdr->codecs[DS_RN];
    bnum1 = cram_codec_to_id(cd, &bnum2);
    if (bnum1 < 0 && bnum2 >= 0) bnum1 = bnum2;
    if (cram_ds_unique(hdr, cd, bnum1)) {
	cram_block *b = cram_get_block_by_id(s, bnum1);
	if (b) *name_size = b->uncomp_size;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %r12
movq %rdx, %rbp
movq %rsi, %r14
movq %rdi, %r15
xorl %eax, %eax
movl %eax, (%rdx)
movq %rcx, 0x10(%rsp)
movl %eax, (%rcx)
movq 0x2e0(%rdi), %r13
leaq 0xc(%rsp), %rbx
movq %r13, %rdi
movq %rbx, %rsi
callq 0x4ddc7
movl (%rbx), %ebx
testl %ebx, %ebx
cmovsl %eax, %ebx
testl %eax, %eax
cmovnsl %eax, %ebx
movq %r15, %rdi
movl %ebx, %esi
callq 0x1ef42
testl %eax, %eax
je 0x1ee97
movq 0x18(%r14), %rax
testq %rax, %rax
setne %cl
cmpl $0x400, %ebx            # imm = 0x400
setb %dl
testb %cl, %dl
je 0x1ee3c
movl %ebx, %ecx
movq (%rax,%rcx,8), %rax
jmp 0x1ee7c
movq (%r14), %rax
movslq 0x20(%rax), %rcx
testq %rcx, %rcx
jle 0x1ee7a
movq 0x10(%r14), %rdx
xorl %esi, %esi
movq (%rdx,%rsi,8), %rdi
testq %rdi, %rdi
je 0x1ee6a
cmpl $0x4, 0x8(%rdi)
jne 0x1ee6a
cmpl %ebx, 0xc(%rdi)
jne 0x1ee6a
xorl %r8d, %r8d
movq %rdi, %rax
jmp 0x1ee6d
movb $0x1, %r8b
testb %r8b, %r8b
je 0x1ee7c
incq %rsi
cmpq %rsi, %rcx
jne 0x1ee4e
xorl %eax, %eax
testq %rax, %rax
je 0x1ee87
movl 0x14(%rax), %eax
movl %eax, (%rbp)
testq %r12, %r12
je 0x1ee97
cmpl $0x1, (%r13)
jne 0x1ee97
movl %ebx, (%r12)
movq 0x2d8(%r15), %rdi
leaq 0xc(%rsp), %rbx
movq %rbx, %rsi
callq 0x4ddc7
movl (%rbx), %ebx
testl %ebx, %ebx
cmovsl %eax, %ebx
testl %eax, %eax
cmovnsl %eax, %ebx
movq %r15, %rdi
movl %ebx, %esi
callq 0x1ef42
testl %eax, %eax
je 0x1ef33
movq 0x18(%r14), %rax
testq %rax, %rax
setne %cl
cmpl $0x400, %ebx            # imm = 0x400
setb %dl
testb %cl, %dl
je 0x1eee4
movl %ebx, %ecx
movq (%rax,%rcx,8), %rax
jmp 0x1ef24
movq (%r14), %rax
movslq 0x20(%rax), %rcx
testq %rcx, %rcx
jle 0x1ef22
movq 0x10(%r14), %rdx
xorl %esi, %esi
movq (%rdx,%rsi,8), %rdi
testq %rdi, %rdi
je 0x1ef12
cmpl $0x4, 0x8(%rdi)
jne 0x1ef12
cmpl %ebx, 0xc(%rdi)
jne 0x1ef12
xorl %r8d, %r8d
movq %rdi, %rax
jmp 0x1ef15
movb $0x1, %r8b
testb %r8b, %r8b
je 0x1ef24
incq %rsi
cmpq %rsi, %rcx
jne 0x1eef6
xorl %eax, %eax
testq %rax, %rax
je 0x1ef33
movl 0x14(%rax), %eax
movq 0x10(%rsp), %rcx
movl %eax, (%rcx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/cram_decode.c
// Function: cram_ds_unique
static int cram_ds_unique(cram_block_compression_hdr *hdr, cram_codec *c,
			  int id) {
    int i, n_id = 0;
    enum cram_encoding e_type = 0;

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

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

	bnum1 = cram_codec_to_id(c, &bnum2);

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

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

    return n_id == 1 ? e_type : 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
xorl %r13d, %r13d
xorl %r15d, %r15d
xorl %ebp, %ebp
movq 0x280(%r14,%r13,8), %r12
testq %r12, %r12
je 0x1efa0
movq %r12, %rdi
leaq 0x4(%rsp), %rsi
callq 0x4ddc7
movl %r15d, %ecx
cmpl %ebx, %eax
jne 0x1ef83
leal 0x1(%r15), %ecx
movl (%r12), %ebp
cmpl %ebx, 0x4(%rsp)
jne 0x1ef8f
incl %ecx
movl (%r12), %ebp
addl $0x2, %r15d
xorl %eax, %eax
cmpl %r15d, %ecx
sete %al
subl %eax, %ecx
movl %ecx, %r15d
incq %r13
cmpq $0x2f, %r13
jne 0x1ef5a
xorl %eax, %eax
cmpl $0x1, %r15d
cmovel %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/./cram/cram_io.h
// Function: cram_get_block_by_id
static inline cram_block *cram_get_block_by_id(cram_slice *slice, int id) {
    if (slice->block_by_id && id >= 0 && id < 1024) {
        return slice->block_by_id[id];
    } else {
        int i;
        for (i = 0; i < slice->hdr->num_blocks; i++) {
	    cram_block *b = slice->block[i];
	    if (b && b->content_type == EXTERNAL && b->content_id == id)
	        return b;
	}
    }
    return NULL;
}

// Assembly:
movq 0x18(%rdi), %rax
testq %rax, %rax
setne %cl
cmpl $0x400, %esi            # imm = 0x400
setb %dl
testb %cl, %dl
je 0x1efdf
movl %esi, %ecx
movq (%rax,%rcx,8), %rax
retq
movq (%rdi), %rax
movslq 0x20(%rax), %rcx
testq %rcx, %rcx
jle 0x1f01f
movq 0x10(%rdi), %rdx
xorl %edi, %edi
movq (%rdx,%rdi,8), %r8
testq %r8, %r8
je 0x1f00f
cmpl $0x4, 0x8(%r8)
jne 0x1f00f
cmpl %esi, 0xc(%r8)
jne 0x1f00f
xorl %r9d, %r9d
movq %r8, %rax
jmp 0x1f012
movb $0x1, %r9b
testb %r9b, %r9b
je 0x1f021
incq %rdi
cmpq %rdi, %rcx
jne 0x1eff1
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/cram_decode.c
// Function: cram_decode_slice_mt
int cram_decode_slice_mt(cram_fd *fd, cram_container *c, cram_slice *s,
			 SAM_hdr *bfd) {
    cram_decode_job *j;
    int nonblock;

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

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

    j->fd = fd;
    j->c  = c;
    j->s  = s;
    j->h  = bfd;
    
    nonblock = t_pool_results_queue_sz(fd->rqueue) ? 1 : 0;

    if (-1 == t_pool_dispatch2(fd->pool, fd->rqueue, cram_decode_slice_thread,
			       j, nonblock)) {
	/* Would block */
	fd->job_pending = j;
    } else {
	fd->job_pending = NULL;
    }

    // flush too
    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbx
cmpq $0x0, 0x8860(%rdi)
je 0x243b0
movl $0x28, %edi
callq 0x4700
testq %rax, %rax
je 0x243ca
movq %rax, %r14
movq %rbx, (%rax)
movq %r13, 0x8(%rax)
movq %r12, 0x10(%rax)
movq %r15, 0x18(%rax)
movq 0x8868(%rbx), %rdi
callq 0x42105
xorl %r8d, %r8d
testl %eax, %eax
setne %r8b
movq 0x8860(%rbx), %rdi
movq 0x8868(%rbx), %rsi
leaq -0x8a(%rip), %rdx       # 0x2430c
movq %r14, %rcx
callq 0x42522
cmpl $-0x1, %eax
je 0x243d1
movq $0x0, 0x88f0(%rbx)
jmp 0x243d8
movq %rbx, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r15, %rcx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x1f905
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x243da
movq %r14, 0x88f0(%rbx)
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/cram_decode.c
// Function: add_md_char
static inline void add_md_char(cram_slice *s, int decode_md, char c, int32_t *md_dist) {
    if (decode_md) {
	BLOCK_APPEND_UINT(s->aux_blk, *md_dist);
	BLOCK_APPEND_CHAR(s->aux_blk, c);
	*md_dist = 0;
    }
}

// Assembly:
testl %esi, %esi
je 0x25110
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %rbx
movl %edx, %ebp
movq %rdi, %r14
movq 0x88(%rdi), %rcx
movq 0x28(%rcx), %rax
movq 0x30(%rcx), %r15
leaq 0xb(%r15), %rdx
cmpq %rdx, %rax
ja 0x25045
movl $0x400, %r12d           # imm = 0x400
movq %rax, %xmm0
punpckldq 0x2d956(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x2d95e(%rip), %xmm0    # 0x52940
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
mulsd 0x2ea12(%rip), %xmm1    # 0x53a08
cvttsd2si %xmm1, %rdx
movq %rdx, %rdi
subsd 0x2d902(%rip), %xmm1    # 0x52908
cvttsd2si %xmm1, %rsi
sarq $0x3f, %rdi
andq %rdi, %rsi
orq %rdx, %rsi
testq %rax, %rax
cmoveq %r12, %rsi
movq %rsi, 0x28(%rcx)
movq 0x20(%rcx), %rdi
callq 0x48d0
movq 0x88(%r14), %rcx
movq %rax, 0x20(%rcx)
movq 0x28(%rcx), %rax
movq 0x30(%rcx), %r15
leaq 0xb(%r15), %rdx
cmpq %rdx, %rax
jbe 0x24fcd
addq 0x20(%rcx), %r15
movl (%rbx), %esi
movq %r15, %rdi
callq 0x25111
subq %r15, %rax
movq 0x88(%r14), %rcx
movq 0x28(%rcx), %rdx
movq 0x30(%rcx), %rdi
leaq (%rax,%rdi), %rsi
movq %rsi, 0x30(%rcx)
addq %rdi, %rax
incq %rax
cmpq %rax, %rdx
ja 0x250f6
movl $0x400, %r15d           # imm = 0x400
movq %rdx, %xmm0
punpckldq 0x2d8a5(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x2d8ad(%rip), %xmm0    # 0x52940
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
mulsd 0x2e961(%rip), %xmm1    # 0x53a08
cvttsd2si %xmm1, %rax
movq %rax, %rdi
subsd 0x2d851(%rip), %xmm1    # 0x52908
cvttsd2si %xmm1, %rsi
sarq $0x3f, %rdi
andq %rdi, %rsi
orq %rax, %rsi
testq %rdx, %rdx
cmoveq %r15, %rsi
movq %rsi, 0x28(%rcx)
movq 0x20(%rcx), %rdi
callq 0x48d0
movq 0x88(%r14), %rcx
movq %rax, 0x20(%rcx)
movq 0x28(%rcx), %rdx
movq 0x30(%rcx), %rsi
leaq 0x1(%rsi), %rax
cmpq %rax, %rdx
jbe 0x2507e
movq 0x20(%rcx), %rdx
movq %rax, 0x30(%rcx)
movb %bpl, (%rdx,%rsi)
movl $0x0, (%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/cram_encode.c
// Function: cram_update_curr_slice
void cram_update_curr_slice(cram_container *c) {
    cram_slice *s = c->slice;
    if (c->multi_seq) {
	s->hdr->ref_seq_id    = -2;
	s->hdr->ref_seq_start = 0;
	s->hdr->ref_seq_span  = 0;
    } else {
	s->hdr->ref_seq_id    = c->curr_ref;
	s->hdr->ref_seq_start = c->first_base;
	s->hdr->ref_seq_span  = c->last_base - c->first_base + 1;
    }
    s->hdr->num_records   = c->curr_rec;

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

    c->curr_slice++;
}

// Assembly:
movq 0x80(%rdi), %rax
cmpl $0x0, 0x94(%rdi)
je 0x2e1c2
movq (%rax), %rcx
movl $0xfffffffe, %edx       # imm = 0xFFFFFFFE
movq %rdx, 0x4(%rcx)
xorl %edx, %edx
jmp 0x2e1de
movl 0x6c(%rdi), %edx
movq (%rax), %rcx
movl %edx, 0x4(%rcx)
movl 0xa0(%rdi), %esi
movl %esi, 0x8(%rcx)
movl 0xa4(%rdi), %edx
subl %esi, %edx
incl %edx
movl %edx, 0xc(%rcx)
movl 0x5c(%rdi), %edx
movq (%rax), %rcx
movl %edx, 0x10(%rcx)
movl 0x54(%rdi), %eax
testl %eax, %eax
jne 0x2e205
movl 0x4(%rcx), %ecx
cmpl %ecx, 0x4(%rdi)
je 0x2e1fc
movl %ecx, 0x4(%rdi)
movl 0xa0(%rdi), %ecx
movl %ecx, 0x8(%rdi)
incl %eax
movl %eax, 0x54(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/cram_encode.c
// Function: cram_add_base
static int cram_add_base(cram_fd *fd, cram_container *c,
			 cram_slice *s, cram_record *r,
			 int pos, char base, char qual) {
    cram_feature f;
    f.B.pos = pos+1;
    f.B.code = 'B';
    f.B.base = base;
    f.B.qual = qual;
    cram_stats_add(c->stats[DS_BA], base);
    cram_stats_add(c->stats[DS_QS], qual);
    BLOCK_APPEND_CHAR(s->qual_blk, qual);
    return cram_add_feature(c, s, r, &f);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %r9d, %ebp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
incl %ecx
movl %ecx, (%rsp)
movl $0x42, 0x4(%rsp)
movl %r8d, 0x8(%rsp)
movl %r9d, 0xc(%rsp)
movq 0x1b0(%rdi), %rdi
movl %r8d, %esi
callq 0x3a5bb
movq 0x120(%r15), %rdi
movl %ebp, %esi
callq 0x3a5bb
movq 0x70(%r14), %rcx
movq 0x28(%rcx), %rax
movq 0x30(%rcx), %rdx
leaq 0x1(%rdx), %rsi
cmpq %rsi, %rax
ja 0x2edc8
movl $0x400, %r12d           # imm = 0x400
movq %rax, %xmm0
punpckldq 0x23bd0(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x23bd8(%rip), %xmm0    # 0x52940
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
mulsd 0x24c8c(%rip), %xmm1    # 0x53a08
cvttsd2si %xmm1, %rdx
movq %rdx, %rdi
subsd 0x23b7c(%rip), %xmm1    # 0x52908
cvttsd2si %xmm1, %rsi
sarq $0x3f, %rdi
andq %rdi, %rsi
orq %rdx, %rsi
testq %rax, %rax
cmoveq %r12, %rsi
movq %rsi, 0x28(%rcx)
movq 0x20(%rcx), %rdi
callq 0x48d0
movq 0x70(%r14), %rcx
movq %rax, 0x20(%rcx)
movq 0x28(%rcx), %rax
movq 0x30(%rcx), %rdx
leaq 0x1(%rdx), %rsi
cmpq %rsi, %rax
jbe 0x2ed53
movq 0x20(%rcx), %rax
movq %rsi, 0x30(%rcx)
movb %bpl, (%rax,%rdx)
movq %rsp, %rcx
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x2f458
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/cram_encode.c
// Function: cram_add_quality
static int cram_add_quality(cram_fd *fd, cram_container *c,
			    cram_slice *s, cram_record *r,
			    int pos, char qual) {
    cram_feature f;
    f.Q.pos = pos+1;
    f.Q.code = 'Q';
    f.Q.qual = qual;
    cram_stats_add(c->stats[DS_QS], qual);
    BLOCK_APPEND_CHAR(s->qual_blk, qual);
    return cram_add_feature(c, s, r, &f);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %r8d, %ebp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
incl %ecx
movl %ecx, (%rsp)
movl $0x51, 0x4(%rsp)
movl %r8d, 0x8(%rsp)
movq 0x120(%rdi), %rdi
movl %r8d, %esi
callq 0x3a5bb
movq 0x70(%r14), %rcx
movq 0x28(%rcx), %rax
movq 0x30(%rcx), %rdx
leaq 0x1(%rdx), %rsi
cmpq %rsi, %rax
ja 0x2eebb
movl $0x400, %r12d           # imm = 0x400
movq %rax, %xmm0
punpckldq 0x23add(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x23ae5(%rip), %xmm0    # 0x52940
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
mulsd 0x24b99(%rip), %xmm1    # 0x53a08
cvttsd2si %xmm1, %rdx
movq %rdx, %rdi
subsd 0x23a89(%rip), %xmm1    # 0x52908
cvttsd2si %xmm1, %rsi
sarq $0x3f, %rdi
andq %rdi, %rsi
orq %rdx, %rsi
testq %rax, %rax
cmoveq %r12, %rsi
movq %rsi, 0x28(%rcx)
movq 0x20(%rcx), %rdi
callq 0x48d0
movq 0x70(%r14), %rcx
movq %rax, 0x20(%rcx)
movq 0x28(%rcx), %rax
movq 0x30(%rcx), %rdx
leaq 0x1(%rdx), %rsi
cmpq %rsi, %rax
jbe 0x2ee46
movq 0x20(%rcx), %rax
movq %rsi, 0x30(%rcx)
movb %bpl, (%rax,%rdx)
movq %rsp, %rcx
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x2f458
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/cram_encode.c
// Function: cram_add_feature
static int cram_add_feature(cram_container *c, cram_slice *s,
			    cram_record *r, cram_feature *f) {
    if (s->nfeatures >= s->afeatures) {
	s->afeatures = s->afeatures ? s->afeatures*2 : 1024;
	s->features = realloc(s->features, s->afeatures*sizeof(*s->features));
	if (!s->features)
	    return -1;
    }

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

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

    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %r15
movl 0x4c(%rsi), %eax
cmpl %eax, 0x48(%rsi)
jl 0x2f4a2
leal (%rax,%rax), %ecx
testl %eax, %eax
movl $0x400, %eax            # imm = 0x400
cmovnel %ecx, %eax
movl %eax, 0x4c(%r14)
movq 0x40(%r14), %rdi
movslq %eax, %rsi
shlq $0x4, %rsi
callq 0x48d0
movq %rax, 0x40(%r14)
testq %rax, %rax
je 0x2f522
movslq 0x68(%r12), %rcx
leaq 0x1(%rcx), %rax
movl %eax, 0x68(%r12)
testq %rcx, %rcx
je 0x2f4d4
movq 0x1a0(%r15), %rdi
movl (%rbx), %esi
movq 0x40(%r14), %rcx
movslq 0x64(%r12), %rdx
addq %rax, %rdx
shlq $0x4, %rdx
subl -0x20(%rcx,%rdx), %esi
jmp 0x2f4e6
movl 0x48(%r14), %eax
movl %eax, 0x64(%r12)
movq 0x1a0(%r15), %rdi
movl (%rbx), %esi
callq 0x3a5bb
movq 0x198(%r15), %rdi
movl 0x4(%rbx), %esi
callq 0x3a5bb
movq 0x40(%r14), %rax
movslq 0x48(%r14), %rcx
leal 0x1(%rcx), %edx
movl %edx, 0x48(%r14)
shlq $0x4, %rcx
movups (%rbx), %xmm0
movups %xmm0, (%rax,%rcx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x2f516
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/./htslib/kstring.h
// Function: kputsn
static inline int kputsn(const char *p, int l, kstring_t *s)
{
	if (ks_resize(s, s->l + l + 2) < 0)
		return EOF;
	memcpy(s->s + s->l, p, l);
	s->l += l;
	s->s[s->l] = 0;
	return l;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r15
movslq %esi, %r14
movq (%rdx), %rax
leaq (%rax,%r14), %rcx
addq $0x2, %rcx
cmpq %rcx, 0x8(%rdx)
jae 0x2ff21
addq %r14, %rax
incq %rax
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x10, %rcx
orq %rax, %rcx
movq %rcx, %r12
shrq $0x20, %r12
orq %rcx, %r12
incq %r12
movq 0x10(%rbx), %rdi
movq %r12, %rsi
callq 0x48d0
testq %rax, %rax
je 0x2ff42
movq %rax, 0x10(%rbx)
movq %r12, 0x8(%rbx)
movq 0x10(%rbx), %rdi
addq (%rbx), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x4420
addq (%rbx), %r14
movq %r14, (%rbx)
movq 0x10(%rbx), %rax
movb $0x0, (%rax,%r14)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/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 %rbx
movq (%rsi), %rcx
movq (%rdi), %r8
movl $0x1, %r9d
cmpq %r8, %rcx
setb %r10b
jae 0x2ffa9
movq 0x10(%rdi), %rax
movzbl (%rax,%rcx), %r11d
cmpl $0x20, %r11d
je 0x2ff79
cmpl $0x9, %r11d
jne 0x2ff8a
incq %rcx
cmpq %r8, %rcx
setb %r10b
jne 0x2ff68
movq %r8, %rcx
jmp 0x2ffa9
testb $0x1, %r10b
je 0x2ffa9
movq 0x10(%rdi), %rax
xorl %r9d, %r9d
cmpb $0x2d, (%rax,%rcx)
sete %r9b
addq %r9, %rcx
negl %r9d
orl $0x1, %r9d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %r8, %rcx
jae 0x2fffe
movq 0x10(%rdi), %rdi
movb (%rdi,%rcx), %r10b
addb $-0x30, %r10b
cmpb $0x9, %r10b
ja 0x2fffe
xorl %eax, %eax
xorl %r10d, %r10d
cmpq %r8, %rcx
jae 0x2fff4
movzbl (%rdi,%rcx), %r11d
leal -0x30(%r11), %ebx
cmpb $0x9, %bl
ja 0x2fff4
leal (%r10,%r10,4), %r10d
incq %rcx
leal (%r11,%r10,2), %r10d
addl $-0x30, %r10d
cmpq %rcx, %r8
jne 0x2ffcf
movq %r8, %rcx
imull %r9d, %r10d
movq %rcx, (%rsi)
movl %r10d, (%rdx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/cram_index.c
// Function: cram_index_free
void cram_index_free(cram_fd *fd) {
    int i;

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

    fd->index = NULL;
}

// Assembly:
cmpq $0x0, 0x8838(%rdi)
je 0x3005f
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpl $0x0, 0x8834(%rdi)
jle 0x30043
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x8838(%rbx), %rdi
addq %r14, %rdi
callq 0x30060
incq %r15
movslq 0x8834(%rbx), %rax
addq $0x30, %r14
cmpq %rax, %r15
jl 0x30021
movq 0x8838(%rbx), %rdi
callq 0x4610
movq $0x0, 0x8838(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/cram_index.c
// Function: cram_index_free_recurse
static void cram_index_free_recurse(cram_index *e) {
    if (e->e) {
	int i;
	for (i = 0; i < e->nslice; i++) {
	    cram_index_free_recurse(&e->e[i]);
	}
	free(e->e);
    }
}

// Assembly:
cmpq $0x0, 0x8(%rdi)
je 0x300a3
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpl $0x0, (%rdi)
jle 0x30095
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x8(%rbx), %rdi
addq %r14, %rdi
callq 0x30060
incq %r15
movslq (%rbx), %rax
addq $0x30, %r14
cmpq %rax, %r15
jl 0x3007a
movq 0x8(%rbx), %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x4610
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/cram_index.c
// Function: cram_index_query
cram_index *cram_index_query(cram_fd *fd, int refid, int pos, 
			     cram_index *from) {
    int i, j, k;
    cram_index *e;

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

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

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

    // This sequence is covered by the index, so binary search to find
    // the optimal starting block.
    i = 0, j = fd->index[refid+1].nslice-1;
    for (k = j/2; k != i; k = (j-i)/2 + i) {
	if (from->e[k].refid > refid) {
	    j = k;
	    continue;
	}

	if (from->e[k].refid < refid) {
	    i = k;
	    continue;
	}

	if (from->e[k].start >= pos) {
	    j = k;
	    continue;
	}

	if (from->e[k].start < pos) {
	    i = k;
	    continue;
	}
    }
    // i==j or i==j-1. Check if j is better.
    if (j >= 0 && from->e[j].start < pos && from->e[j].refid == refid)
	i = j;

    /* The above found *a* bin overlapping, but not necessarily the first */
    while (i > 0 && from->e[i-1].end >= pos)
	i--;

    /* We may be one bin before the optimum, so check */
    while (i+1 < from->nslice &&
	   (from->e[i].refid < refid ||
	    from->e[i].end < pos))
	i++;

    e = &from->e[i];

    return e;
}

// Assembly:
cmpl $-0x1, %esi
jl 0x301e6
leal 0x1(%rsi), %eax
cmpl 0x8834(%rdi), %eax
jge 0x301e6
movl %eax, %r9d
testq %rcx, %rcx
jne 0x300d3
leaq (%r9,%r9,2), %rcx
shlq $0x4, %rcx
addq 0x8838(%rdi), %rcx
movq 0x8(%rcx), %rax
xorl %r8d, %r8d
testq %rax, %rax
je 0x301e6
movq 0x8838(%rdi), %rdi
leaq (%r9,%r9,2), %r9
shlq $0x4, %r9
movl (%rdi,%r9), %r9d
leal -0x1(%r9), %edi
cmpl $0x3, %r9d
jb 0x30156
movl %edi, %r9d
shrl $0x1f, %r9d
addl %edi, %r9d
sarl %r9d
xorl %r8d, %r8d
movslq %r9d, %r10
leaq (%r10,%r10,2), %r11
shlq $0x4, %r11
leaq (%rax,%r11), %r10
cmpl %esi, 0x10(%rax,%r11)
jg 0x30134
jl 0x3012e
cmpl %edx, 0x14(%r10)
jge 0x30134
movl %r9d, %r8d
movl %edi, %r9d
movl %r9d, %edi
movl %r9d, %r10d
subl %r8d, %r10d
movl %r10d, %r9d
shrl $0x1f, %r9d
addl %r10d, %r9d
sarl %r9d
addl %r8d, %r9d
incl %r10d
cmpl $0x2, %r10d
ja 0x30110
testl %edi, %edi
js 0x30177
movl %edi, %r9d
leaq (%r9,%r9,2), %r9
shlq $0x4, %r9
cmpl %edx, 0x14(%rax,%r9)
jge 0x30177
addq %rax, %r9
cmpl %esi, 0x10(%r9)
cmovel %edi, %r8d
testl %r8d, %r8d
jle 0x301a1
leaq -0x18(%rax), %rdi
movl %r8d, %r9d
leaq (%r9,%r9,2), %r9
shlq $0x4, %r9
cmpl %edx, (%rdi,%r9)
jl 0x301a1
leal -0x1(%r8), %r9d
cmpl $0x1, %r8d
movl %r9d, %r8d
jg 0x30180
xorl %r8d, %r8d
movl (%rcx), %ecx
leal 0x1(%r8), %edi
cmpl %ecx, %edi
jge 0x301d7
movslq %r8d, %rdi
decl %ecx
leaq (%rdi,%rdi,2), %rdi
shlq $0x4, %rdi
addq %rax, %rdi
addq $0x18, %rdi
cmpl %esi, -0x8(%rdi)
jl 0x301c8
cmpl %edx, (%rdi)
jge 0x301d7
incl %r8d
addq $0x30, %rdi
cmpl %r8d, %ecx
jne 0x301bf
movl %ecx, %r8d
movslq %r8d, %rcx
leaq (%rcx,%rcx,2), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/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 %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl (%rsi), %eax
movl 0x4(%rsi), %edx
movl %eax, %esi
xorl %ecx, %ecx
callq 0x300a4
testq %rax, %rax
je 0x3025f
movq %rax, %r14
movq 0x28(%rax), %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x391a3
testl %eax, %eax
je 0x3023b
movq 0x28(%r14), %rsi
subq 0x8840(%rbx), %rsi
movq %rbx, %rdi
movl $0x1, %edx
callq 0x391a3
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %ecx, %ecx
jne 0x30264
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0x3025b
callq 0x35cde
movq $0x0, 0x38(%rbx)
movl $0x0, 0x88f8(%rbx)
xorl %eax, %eax
jmp 0x30264
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
addq $0x8, %rsp
popq %rbx
popq %r14
retq