LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/htslib/sam.c
// Function: bam_plp_destroy
void bam_plp_destroy(bam_plp_t iter)
{
    if ( iter->overlaps ) kh_destroy(olap_hash, iter->overlaps);
    mp_free(iter->mp, iter->dummy);
    mp_free(iter->mp, iter->head);
    if (iter->mp->cnt != 0)
        fprintf(stderr, "[bam_plp_destroy] memory leak: %d. Continue anyway.\n", iter->mp->cnt);
    mp_destroy(iter->mp);
    if (iter->b) bam_destroy1(iter->b);
    free(iter->plp);
    free(iter);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x68(%rdi), %r14
testq %r14, %r14
je 0x72f7c
movq 0x18(%r14), %rdi
callq 0x68a0
movq 0x10(%r14), %rdi
callq 0x68a0
movq 0x20(%r14), %rdi
callq 0x68a0
movq %r14, %rdi
callq 0x68a0
movq (%rbx), %r15
movq 0x18(%rbx), %r14
decl (%r15)
movq $0x0, 0x50(%r14)
movl 0x4(%r15), %ecx
cmpl 0x8(%r15), %ecx
jne 0x72fc3
leal (%rcx,%rcx), %eax
testl %ecx, %ecx
movl $0x100, %ecx            # imm = 0x100
cmovnel %eax, %ecx
movl %ecx, 0x8(%r15)
movq 0x10(%r15), %rdi
movslq %ecx, %rsi
shlq $0x3, %rsi
callq 0x6c80
movq %rax, 0x10(%r15)
movl 0x4(%r15), %ecx
jmp 0x72fc7
movq 0x10(%r15), %rax
leal 0x1(%rcx), %edx
movl %edx, 0x4(%r15)
movslq %ecx, %rcx
movq %r14, (%rax,%rcx,8)
movq (%rbx), %r15
movq 0x8(%rbx), %r14
decl (%r15)
movq $0x0, 0x50(%r14)
movl 0x4(%r15), %ecx
cmpl 0x8(%r15), %ecx
jne 0x7301c
leal (%rcx,%rcx), %eax
testl %ecx, %ecx
movl $0x100, %ecx            # imm = 0x100
cmovnel %eax, %ecx
movl %ecx, 0x8(%r15)
movq 0x10(%r15), %rdi
movslq %ecx, %rsi
shlq $0x3, %rsi
callq 0x6c80
movq %rax, 0x10(%r15)
movl 0x4(%r15), %ecx
jmp 0x73020
movq 0x10(%r15), %rax
leal 0x1(%rcx), %edx
movl %edx, 0x4(%r15)
movslq %ecx, %rcx
movq %r14, (%rax,%rcx,8)
movq (%rbx), %r14
movl (%r14), %edx
testl %edx, %edx
jne 0x730ad
cmpl $0x0, 0x4(%r14)
jle 0x7306c
xorl %r15d, %r15d
movq 0x10(%r14), %rax
movq (%rax,%r15,8), %rax
movq 0x28(%rax), %rdi
callq 0x68a0
movq 0x10(%r14), %rax
movq (%rax,%r15,8), %rdi
callq 0x68a0
incq %r15
movslq 0x4(%r14), %rax
cmpq %rax, %r15
jl 0x73042
movq 0x10(%r14), %rdi
callq 0x68a0
movq %r14, %rdi
callq 0x68a0
movq 0x50(%rbx), %r14
testq %r14, %r14
je 0x73097
movq 0x28(%r14), %rdi
callq 0x68a0
movq %r14, %rdi
callq 0x68a0
movq 0x48(%rbx), %rdi
callq 0x68a0
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x68a0
movq 0x4bf24(%rip), %rax     # 0xbefd8
movq (%rax), %rdi
leaq 0x27969(%rip), %rsi     # 0x9aa27
xorl %eax, %eax
callq 0x6a90
movq (%rbx), %r14
jmp 0x73038
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/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, 0x58(%rdi)
je 0x742b6
movq %rdi, %r15
cmpl $0x0, 0x38(%rdi)
je 0x742ca
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 0x730cd
testq %rax, %rax
jne 0x742be
movl $0x0, (%rbx)
cmpl $0x0, 0x30(%r15)
jne 0x742bc
jmp 0x74315
movq 0x50(%r15), %rsi
movq %r15, %rdi
callq 0x738aa
testl %eax, %eax
js 0x742b6
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x730cd
testq %rax, %rax
jne 0x742be
movq 0x50(%r15), %rsi
movq 0x60(%r15), %rdi
callq *0x58(%r15)
testl %eax, %eax
jns 0x742ef
cmpl $-0x1, %eax
je 0x74330
movl %eax, 0x38(%r15)
jmp 0x742b6
cmpl $0x0, 0x38(%r15)
jne 0x7433f
movl $0x1, 0x30(%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 0x730cd
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/htslib/sam.c
// Function: bam_plp_reset
void bam_plp_reset(bam_plp_t iter)
{
    lbnode_t *p, *q;
    iter->max_tid = iter->max_pos = -1;
    iter->tid = iter->pos = 0;
    iter->is_eof = 0;
    for (p = iter->head; p->next;) {
        overlap_remove(iter, NULL);
        q = p->next;
        mp_free(iter->mp, p);
        p = q;
    }
    iter->head = iter->tail;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movaps 0x26243(%rip), %xmm0    # 0x9a5b0
movups %xmm0, 0x20(%rdi)
movl $0x0, 0x30(%rdi)
movq 0x8(%rdi), %r14
cmpq $0x0, 0x50(%r14)
je 0x743fa
movl $0x100, %ebp            # imm = 0x100
movq 0x68(%rbx), %rdi
xorl %esi, %esi
callq 0x7372c
movq 0x50(%r14), %r15
movq (%rbx), %r12
decl (%r12)
movq $0x0, 0x50(%r14)
movl 0x4(%r12), %ecx
cmpl 0x8(%r12), %ecx
jne 0x743dc
leal (%rcx,%rcx), %eax
testl %ecx, %ecx
cmovel %ebp, %eax
movl %eax, 0x8(%r12)
movq 0x10(%r12), %rdi
movslq %eax, %rsi
shlq $0x3, %rsi
callq 0x6c80
movq %rax, 0x10(%r12)
movl 0x4(%r12), %ecx
jmp 0x743e1
movq 0x10(%r12), %rax
leal 0x1(%rcx), %edx
movl %edx, 0x4(%r12)
movslq %ecx, %rcx
movq %r14, (%rax,%rcx,8)
cmpq $0x0, 0x50(%r15)
movq %r15, %r14
jne 0x74388
movq 0x10(%rbx), %rax
movq %rax, 0x8(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/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 0x6470
movq %rax, %r15
movl %ebp, 0xc(%rsp)
movslq %ebp, %r13
movl $0x8, %esi
movq %r13, %rdi
callq 0x6470
movq %rax, %r12
movq %rax, 0x10(%r15)
movl $0x4, %esi
movq %r13, %rdi
callq 0x6470
movq %rax, 0x20(%r15)
movl $0x8, %esi
movq %r13, %rdi
callq 0x6470
movq %rax, 0x28(%r15)
movl $0x8, %esi
movq %r13, %rdi
callq 0x6470
movq %rax, 0x18(%r15)
movl %r13d, (%r15)
movq %r15, 0x10(%rsp)
movq $-0x1, 0x8(%r15)
testl %r13d, %r13d
jle 0x744c6
movq %rax, %rbp
movl 0xc(%rsp), %r13d
xorl %r15d, %r15d
movq (%rbx,%r15,8), %rsi
movq %r14, %rdi
callq 0x72e8a
movq %rax, (%rbp,%r15,8)
movq $-0x1, (%r12,%r15,8)
incq %r15
cmpq %r15, %r13
jne 0x744a5
movq 0x10(%rsp), %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/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 %rdi, %r15
cmpl $0x0, (%rdi)
jle 0x746c4
movq %r8, %rbx
movq %rcx, %r14
movq %rsi, 0x8(%rsp)
movq %rdx, 0x10(%rsp)
movq 0x10(%r15), %rax
movq $-0x1, %r13
xorl %ebp, %ebp
xorl %r12d, %r12d
movq (%rax,%rbp,2), %rcx
cmpq 0x8(%r15), %rcx
jne 0x74637
movq 0x18(%r15), %rax
movq (%rax,%rbp,2), %rdi
movq 0x20(%r15), %rcx
addq %rbp, %rcx
leaq 0x4(%rsp), %rsi
movq %rsp, %rdx
callq 0x7429b
movq 0x28(%r15), %rcx
movq %rax, (%rcx,%rbp,2)
movq 0x18(%r15), %rax
movq (%rax,%rbp,2), %rax
cmpl $0x0, 0x38(%rax)
jne 0x746d0
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)
jmp 0x7463f
movq 0x28(%r15), %rcx
movq (%rcx,%rbp,2), %rcx
testq %rcx, %rcx
je 0x7464f
movq (%rax,%rbp,2), %rcx
cmpq %r13, %rcx
cmovbq %rcx, %r13
incq %r12
movslq (%r15), %rcx
addq $0x4, %rbp
cmpq %rcx, %r12
jl 0x745cf
movq %r13, 0x8(%r15)
xorl %eax, %eax
cmpq $-0x1, %r13
je 0x746d5
movq %r13, %rcx
shrq $0x20, %rcx
movq 0x8(%rsp), %rdx
movl %ecx, (%rdx)
movq 0x10(%rsp), %rcx
movl %r13d, (%rcx)
cmpl $0x0, (%r15)
jle 0x746d5
xorl %ecx, %ecx
xorl %eax, %eax
movq 0x10(%r15), %rdx
cmpq %r13, (%rdx,%rcx,8)
jne 0x746ab
movq 0x20(%r15), %rdx
movq 0x28(%r15), %rsi
movl (%rdx,%rcx,4), %edx
movq (%rsi,%rcx,8), %rsi
incl %eax
jmp 0x746af
xorl %edx, %edx
xorl %esi, %esi
movl %edx, (%r14,%rcx,4)
movq %rsi, (%rbx,%rcx,8)
incq %rcx
movslq (%r15), %rdx
cmpq %rdx, %rcx
jl 0x7468e
jmp 0x746d5
movq $-0x1, 0x8(%r15)
xorl %eax, %eax
jmp 0x746d5
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/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 $0x5, %r8
jge 0x74cf4
xorl %ecx, %ecx
cmpq %rsi, %rdi
jae 0x74d1d
movzbl (%rdi), %esi
movl %esi, %eax
shrl $0x4, %eax
leaq 0x23ebc(%rip), %r9      # 0x98ba0
movslq (%r9,%rax,4), %r9
movl $0x0, %eax
cmpq %r9, %r8
jge 0x74cf7
jmp 0x74d1f
movb (%rdi), %sil
movzbl %sil, %ecx
movl $0x1, %eax
testb %cl, %cl
jns 0x74d1f
movzbl 0x1(%rdi), %eax
cmpb $-0x41, %sil
ja 0x74d22
andl $0x3f, %ecx
shll $0x8, %ecx
orl %eax, %ecx
movl $0x2, %eax
jmp 0x74d1f
xorl %eax, %eax
movl %ecx, (%rdx)
retq
cmpb $-0x21, %sil
ja 0x74d40
shll $0x8, %eax
movzbl 0x2(%rdi), %esi
andl $0x1f, %ecx
shll $0x10, %ecx
orl %eax, %ecx
orl %esi, %ecx
movl $0x3, %eax
jmp 0x74d1f
cmpb $-0x11, %sil
ja 0x74d67
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 0x74d1f
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 0x74d1f
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/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 0x771eb
movl %esi, %ecx
movq (%rax,%rcx,8), %rax
retq
movq (%rdi), %rax
movslq 0x20(%rax), %rcx
testq %rcx, %rcx
jle 0x77219
movq 0x10(%rdi), %rdx
xorl %edi, %edi
movq (%rdx,%rdi,8), %rax
testq %rax, %rax
je 0x77211
cmpl $0x4, 0x8(%rax)
jne 0x77211
cmpl %esi, 0xc(%rax)
je 0x7721b
incq %rdi
cmpq %rdi, %rcx
jne 0x771fd
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/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 0x7bee8
movl $0x28, %edi
callq 0x69d0
testq %rax, %rax
je 0x7bf02
movq %rax, %r14
movq %rbx, (%rax)
movq %r13, 0x8(%rax)
movq %r12, 0x10(%rax)
movq %r15, 0x18(%rax)
movq 0x8868(%rbx), %rdi
callq 0x65385
xorl %r8d, %r8d
testl %eax, %eax
setne %r8b
movq 0x8860(%rbx), %rdi
movq 0x8868(%rbx), %rsi
leaq -0x8a(%rip), %rdx       # 0x7be44
movq %r14, %rcx
callq 0x6588a
cmpl $-0x1, %eax
je 0x7bf09
movq $0x0, 0x88f0(%rbx)
jmp 0x7bf10
movq %rbx, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r15, %rcx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x77b17
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x7bf12
movq %r14, 0x88f0(%rbx)
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/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 0x5db73
movq 0x120(%r15), %rdi
movl %ebp, %esi
callq 0x5db73
movq 0x70(%r14), %rdx
movq 0x20(%rdx), %rax
movq 0x28(%rdx), %rcx
movq 0x30(%rdx), %rsi
leaq 0x1(%rsi), %r8
cmpq %r8, %rcx
ja 0x85b4e
addq $0x28, %rdx
movl $0x400, %r12d           # imm = 0x400
movq %rdx, %rdi
movq %rcx, %xmm0
punpckldq 0x652c(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x6534(%rip), %xmm0     # 0x8c020
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
mulsd 0xade8(%rip), %xmm1     # 0x908e8
cvttsd2si %xmm1, %rdx
movq %rdx, %r8
sarq $0x3f, %r8
subsd 0x126bc(%rip), %xmm1    # 0x981d0
cvttsd2si %xmm1, %rsi
andq %r8, %rsi
orq %rdx, %rsi
testq %rcx, %rcx
cmoveq %r12, %rsi
movq %rsi, (%rdi)
movq %rax, %rdi
callq 0x6c80
movq 0x70(%r14), %rdx
movq %rax, 0x20(%rdx)
leaq 0x28(%rdx), %rdi
movq 0x28(%rdx), %rcx
movq 0x30(%rdx), %rsi
leaq 0x1(%rsi), %r8
cmpq %r8, %rcx
jbe 0x85ad7
movq %r8, 0x30(%rdx)
movb %bpl, (%rax,%rsi)
movq %rsp, %rcx
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x861ed
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/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 0x5db73
movq 0x70(%r14), %rdx
movq 0x20(%rdx), %rax
movq 0x28(%rdx), %rcx
movq 0x30(%rdx), %rsi
leaq 0x1(%rsi), %r8
cmpq %r8, %rcx
ja 0x85c4e
addq $0x28, %rdx
movl $0x400, %r12d           # imm = 0x400
movq %rdx, %rdi
movq %rcx, %xmm0
punpckldq 0x642c(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x6434(%rip), %xmm0     # 0x8c020
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
mulsd 0xace8(%rip), %xmm1     # 0x908e8
cvttsd2si %xmm1, %rdx
movq %rdx, %r8
sarq $0x3f, %r8
subsd 0x125bc(%rip), %xmm1    # 0x981d0
cvttsd2si %xmm1, %rsi
andq %r8, %rsi
orq %rdx, %rsi
testq %rcx, %rcx
cmoveq %r12, %rsi
movq %rsi, (%rdi)
movq %rax, %rdi
callq 0x6c80
movq 0x70(%r14), %rdx
movq %rax, 0x20(%rdx)
leaq 0x28(%rdx), %rdi
movq 0x28(%rdx), %rcx
movq 0x30(%rdx), %rsi
leaq 0x1(%rsi), %r8
cmpq %r8, %rcx
jbe 0x85bd7
movq %r8, 0x30(%rdx)
movb %bpl, (%rax,%rsi)
movq %rsp, %rcx
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x861ed
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/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 0x86237
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 0x6c80
movq %rax, 0x40(%r14)
testq %rax, %rax
je 0x862b7
movslq 0x68(%r12), %rcx
leaq 0x1(%rcx), %rax
movl %eax, 0x68(%r12)
testq %rcx, %rcx
je 0x86269
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 0x8627b
movl 0x48(%r14), %eax
movl %eax, 0x64(%r12)
movq 0x1a0(%r15), %rdi
movl (%rbx), %esi
callq 0x5db73
movq 0x198(%r15), %rdi
movl 0x4(%rbx), %esi
callq 0x5db73
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 0x862ab
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/htslib/cram/cram_samtools.c
// Function: cram_header_to_bam
bam_hdr_t *cram_header_to_bam(SAM_hdr *h) {
    int i;
    bam_hdr_t *header = bam_hdr_init();

    header->l_text = ks_len(&h->text);
    header->text = malloc(header->l_text+1);
    memcpy(header->text, ks_str(&h->text), header->l_text);
    header->text[header->l_text] = 0;

    header->n_targets = h->nref;
    header->target_name = (char **)calloc(header->n_targets,
					  sizeof(char *));
    header->target_len = (uint32_t *)calloc(header->n_targets, 4);

    for (i = 0; i < h->nref; i++) {
	header->target_name[i] = strdup(h->ref[i].name);
	header->target_len[i] = h->ref[i].len;
    }

    return header;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x6cc54
movq %rax, %r14
movq (%rbx), %r12
movl %r12d, 0x8(%rax)
leal 0x1(%r12), %edi
callq 0x69d0
movq %rax, %r15
movq %rax, 0x28(%r14)
movq 0x10(%rbx), %rsi
movl %r12d, %r12d
movq %rax, %rdi
movq %r12, %rdx
callq 0x6570
movb $0x0, (%r15,%r12)
movslq 0x38(%rbx), %r15
movl %r15d, (%r14)
movl $0x8, %esi
movq %r15, %rdi
callq 0x6470
movq %rax, 0x20(%r14)
movl $0x4, %esi
movq %r15, %rdi
callq 0x6470
movq %rax, 0x10(%r14)
testq %r15, %r15
jle 0x86864
movq 0x40(%rbx), %rax
xorl %r15d, %r15d
xorl %r12d, %r12d
movq (%rax,%r15,8), %rdi
callq 0x6dd0
movq 0x20(%r14), %rcx
movq %rax, (%rcx,%r15,2)
movq 0x40(%rbx), %rax
movl 0x8(%rax,%r15,8), %ecx
movq 0x10(%r14), %rdx
movl %ecx, (%rdx,%r15)
incq %r12
movslq 0x38(%rbx), %rcx
addq $0x4, %r15
cmpq %rcx, %r12
jl 0x86832
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/htslib/knetfile.c
// Function: socket_connect
static int socket_connect(const char *host, const char *port)
{
#define __err_connect(func) do { perror(func); freeaddrinfo(res); return -1; } while (0)

	int ai_err, on = 1, fd;
	struct linger lng = { 0, 0 };
	struct addrinfo hints, *res = 0;
	memset(&hints, 0, sizeof(struct addrinfo));
	hints.ai_family = AF_UNSPEC;
	hints.ai_socktype = SOCK_STREAM;
	/* In Unix/Mac, getaddrinfo() is the most convenient way to get
	 * server information. */
	if ((ai_err = getaddrinfo(host, port, &hints, &res)) != 0) { fprintf(stderr, "can't resolve %s:%s: %s\n", host, port, gai_strerror(ai_err)); return -1; }
	if ((fd = socket(res->ai_family, res->ai_socktype, res->ai_protocol)) == -1) __err_connect("socket");
	/* The following two setsockopt() are used by ftplib
	 * (http://nbpfaus.net/~pfau/ftplib/). I am not sure if they
	 * necessary. */
	if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)) == -1) __err_connect("setsockopt");
	if (setsockopt(fd, SOL_SOCKET, SO_LINGER, &lng, sizeof(lng)) == -1) __err_connect("setsockopt");
	if (connect(fd, res->ai_addr, res->ai_addrlen) != 0) __err_connect("connect");
	freeaddrinfo(res);
	return fd;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x50, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movl $0x1, %eax
movl %eax, 0x14(%rsp)
xorl %edx, %edx
movq %rdx, 0x18(%rsp)
leaq 0x8(%rsp), %rcx
movq %rdx, (%rcx)
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rdx
movaps %xmm0, (%rdx)
movaps %xmm0, 0x10(%rdx)
movaps %xmm0, 0x20(%rdx)
movl %eax, 0x8(%rdx)
callq 0x6960
testl %eax, %eax
jne 0x86b5d
movq 0x8(%rsp), %rax
movl 0x4(%rax), %edi
movl 0x8(%rax), %esi
movl 0xc(%rax), %edx
callq 0x6190
cmpl $-0x1, %eax
je 0x86b8a
movl %eax, %ebx
leaq 0x14(%rsp), %rcx
movl %eax, %edi
movl $0x1, %esi
movl $0x2, %edx
movl $0x4, %r8d
callq 0x6d80
cmpl $-0x1, %eax
je 0x86b96
leaq 0x18(%rsp), %rcx
movl %ebx, %edi
movl $0x1, %esi
movl $0xd, %edx
movl $0x8, %r8d
callq 0x6d80
cmpl $-0x1, %eax
je 0x86ba2
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rsi
movl 0x10(%rax), %edx
movl %ebx, %edi
callq 0x6580
testl %eax, %eax
jne 0x86bae
movq 0x8(%rsp), %rdi
callq 0x69a0
jmp 0x86bbd
movq 0x38474(%rip), %rcx     # 0xbefd8
movq (%rcx), %r15
movl %eax, %edi
callq 0x6a30
leaq 0x14ecc(%rip), %rsi     # 0x9ba41
movq %r15, %rdi
movq %r14, %rdx
movq %rbx, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0x6a90
jmp 0x86bb8
leaq 0x8(%rsp), %rdi
callq 0x83be
jmp 0x86bb8
leaq 0x8(%rsp), %rdi
callq 0x83a4
jmp 0x86bb8
leaq 0x8(%rsp), %rdi
callq 0x838a
jmp 0x86bb8
leaq 0x8(%rsp), %rdi
callq 0x8370
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x50, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/htslib/knetfile.c
// Function: kftp_send_cmd
static int kftp_send_cmd(knetFile *ftp, const char *cmd, int is_get)
{
	if (socket_wait(ftp->ctrl_fd, 0) <= 0) return -1; // socket is not ready for writing
    int len = strlen(cmd);
	if ( netwrite(ftp->ctrl_fd, cmd, len) != len ) return -1;
	return is_get? kftp_get_response(ftp) : 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movl 0x20(%rdi), %edi
xorl %esi, %esi
callq 0x87752
testl %eax, %eax
jle 0x86d3d
movq %r14, %rdi
callq 0x62d0
movl 0x20(%rbx), %edi
movslq %eax, %r15
movq %r14, %rsi
movq %r15, %rdx
callq 0x6260
cmpq %r15, %rax
setne %al
testl %ebp, %ebp
sete %cl
orb %al, %cl
je 0x86d48
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x86bc9
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/htslib/knetfile.c
// Function: kftp_parse_url
knetFile *kftp_parse_url(const char *fn, const char *mode)
{
	knetFile *fp;
	char *p;
	int l;
	if (strstr(fn, "ftp://") != fn) return 0;
	for (p = (char*)fn + 6; *p && *p != '/'; ++p);
	if (*p != '/') return 0;
	l = p - fn - 6;
	fp = (knetFile*)calloc(1, sizeof(knetFile));
	fp->type = KNF_TYPE_FTP;
	fp->fd = -1;
	/* the Linux/Mac version of socket_connect() also recognizes a port
	 * like "ftp", but the Windows version does not. */
	fp->port = strdup("21");
	fp->host = (char*)calloc(l + 1, 1);
	if (strchr(mode, 'c')) fp->no_reconnect = 1;
	strncpy(fp->host, fn + 6, l);
	fp->retr = (char*)calloc(strlen(p) + 8, 1);
	sprintf(fp->retr, "RETR %s\r\n", p);
    fp->size_cmd = (char*)calloc(strlen(p) + 8, 1);
    sprintf(fp->size_cmd, "SIZE %s\r\n", p);
	fp->seek_offset = 0;
	return fp;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r12
movq %rdi, %r15
leaq 0xa917(%rip), %rsi      # 0x916b9
movl $0x6, %edx
callq 0x6330
testl %eax, %eax
je 0x86dc5
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movabsq $0x100000000, %rbp      # imm = 0x100000000
addq $0x6, %r15
xorl %r13d, %r13d
movq %r15, %rbx
movzbl (%rbx), %eax
testl %eax, %eax
je 0x86db0
cmpl $0x2f, %eax
je 0x86ded
incq %rbx
addq %rbp, %r13
jmp 0x86dd9
movl $0x1, %edi
movl $0x88, %esi
callq 0x6470
movq %rax, %r14
movabsq $-0xfffffffe, %rax      # imm = 0xFFFFFFFF00000002
movq %rax, (%r14)
leaq 0xb1b1(%rip), %rdi      # 0x91fc4
callq 0x6dd0
movq %rax, 0x18(%r14)
addq %r13, %rbp
sarq $0x20, %rbp
movl $0x1, %esi
movq %rbp, %rdi
callq 0x6470
movq %rax, %rbp
movq %rax, 0x10(%r14)
movq %r12, %rdi
movl $0x63, %esi
callq 0x6270
testq %rax, %rax
je 0x86e51
movl $0x1, 0x3c(%r14)
sarq $0x20, %r13
movq %rbp, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x6380
movq %rbx, %rdi
callq 0x62d0
leaq 0x8(%rax), %rdi
movl $0x1, %esi
callq 0x6470
movq %rax, 0x50(%r14)
leaq 0x14af2(%rip), %rsi     # 0x9b976
movq %rax, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x6170
movq %rbx, %rdi
callq 0x62d0
leaq 0x8(%rax), %rdi
movl $0x1, %esi
callq 0x6470
movq %rax, 0x58(%r14)
leaq 0xb16a(%rip), %rsi      # 0x9201c
movq %rax, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x6170
jmp 0x86db3
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/htslib/knetfile.c
// Function: my_netread
static off_t my_netread(int fd, void *buf, off_t len)
{
	off_t rest = len, curr, l = 0;
	/* recv() and read() may not read the required length of data with
	 * one call. They have to be called repeatedly. */
	while (rest) {
		if (socket_wait(fd, 1) <= 0) break; // socket is not ready for reading
		curr = netread(fd, (void*)((char*)buf + l), rest);
		/* According to the glibc manual, section 13.2, a zero returned
		 * value indicates end-of-file (EOF), which should mean that
		 * read() will not return zero if EOF has not been met but data
		 * are not immediately available. */
		if (curr == 0) break;
		l += curr; rest -= curr;
	}
	return l;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdx, %rdx
je 0x87487
movq %rdx, %r14
movq %rsi, %r15
movl %edi, %ebp
xorl %ebx, %ebx
movl %ebp, %edi
movl $0x1, %esi
callq 0x87752
testl %eax, %eax
jle 0x87489
leaq (%r15,%rbx), %rsi
movl %ebp, %edi
movq %r14, %rdx
callq 0x6aa0
testq %rax, %rax
je 0x87489
addq %rax, %rbx
subq %rax, %r14
jne 0x8745a
jmp 0x87489
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/htslib/knetfile.c
// Function: knet_open
knetFile *knet_open(const char *fn, const char *mode)
{
#ifdef KNETFILE_HOOKS
    if (alt_open)
        return alt_open(fn, mode);
#endif
	knetFile *fp = 0;
	if (mode[0] != 'r') {
		fprintf(stderr, "[kftp_open] only mode \"r\" is supported.\n");
		return 0;
	}
	if (strstr(fn, "ftp://") == fn) {
		fp = kftp_parse_url(fn, mode);
		if (fp == 0) return 0;
		if (kftp_connect(fp) == -1) {
			knet_close(fp);
			return 0;
		}
		kftp_connect_file(fp);
	} else if (strstr(fn, "http://") == fn) {
		fp = khttp_parse_url(fn, mode);
		if (fp == 0) return 0;
		khttp_connect_file(fp);
	} else { // local file
#ifdef _WIN32
		/* In windows, O_BINARY is necessary. In Linux/Mac, O_BINARY may
		 * be undefined on some systems, although it is defined on my
		 * Mac and the Linux I have tested on. */
		int fd = open(fn, O_RDONLY | O_BINARY);
#else		
		int fd = open(fn, O_RDONLY);
#endif
		if (fd == -1) {
			perror("open");
			return 0;
		}
		fp = (knetFile*)calloc(1, sizeof(knetFile));
		fp->type = KNF_TYPE_LOCAL;
		fp->fd = fd;
		fp->ctrl_fd = -1;
	}
	if (fp && fp->fd == -1) {
		knet_close(fp);
		return 0;
	}
	return fp;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
cmpb $0x72, (%rsi)
jne 0x87569
movq %rsi, %r14
movq %rdi, %rbx
leaq 0xa208(%rip), %rsi      # 0x916b9
movl $0x6, %edx
callq 0x6330
testl %eax, %eax
je 0x87512
leaq 0xa1e2(%rip), %rsi      # 0x916a8
movl $0x7, %edx
movq %rbx, %rdi
callq 0x6330
movq %rbx, %rdi
testl %eax, %eax
je 0x8753c
xorl %esi, %esi
xorl %eax, %eax
callq 0x64c0
cmpl $-0x1, %eax
je 0x87570
movl %eax, %ebp
movl $0x1, %edi
movl $0x88, %esi
callq 0x6470
movq %rax, %rbx
movl $0x1, (%rax)
movl %ebp, 0x4(%rax)
movl $0xffffffff, 0x20(%rax) # imm = 0xFFFFFFFF
jmp 0x87551
movq %rbx, %rdi
movq %r14, %rsi
callq 0x86d8a
testq %rax, %rax
je 0x8755f
movq %rax, %rbx
movq %rax, %rdi
callq 0x86a28
cmpl $-0x1, %eax
je 0x87557
movq %rbx, %rdi
callq 0x86ec4
jmp 0x87551
callq 0x8707d
testq %rax, %rax
je 0x8755f
movq %rax, %rbx
movq %rax, %rdi
callq 0x87214
cmpl $-0x1, 0x4(%rbx)
jne 0x87561
movq %rbx, %rdi
callq 0x8757e
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
callq 0x8428
jmp 0x8755f
leaq 0xa29f(%rip), %rdi      # 0x91816
callq 0x6590
jmp 0x8755f
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/htslib/knetfile.c
// Function: knet_read
ssize_t knet_read(knetFile *fp, void *buf, size_t len)
{
#ifdef KNETFILE_HOOKS
       if (alt_read)  
               return alt_read(fp, buf, len);
#endif  

	off_t l = 0;
	if (fp->fd == -1) return 0;
	if (fp->type == KNF_TYPE_FTP) {
		if (fp->is_ready == 0) {
			if (!fp->no_reconnect) kftp_reconnect(fp);
			kftp_connect_file(fp);
		}
	} else if (fp->type == KNF_TYPE_HTTP) {
		if (fp->is_ready == 0)
			khttp_connect_file(fp);
	}
	if (fp->type == KNF_TYPE_LOCAL) { // on Windows, the following block is necessary; not on UNIX
		size_t rest = len;
		ssize_t curr;
		while (rest) {
			do {
				curr = read(fp->fd, (void*)((char*)buf + l), rest);
			} while (curr < 0 && EINTR == errno);
			if (curr < 0) return -1;
			if (curr == 0) break;
			l += curr; rest -= curr;
		}
	} else l = my_netread(fp->fd, buf, len);
	fp->offset += l;
	return l;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movl 0x4(%rdi), %edi
cmpl $-0x1, %edi
je 0x87644
movq %rdx, %r14
movq %rsi, %r15
movl (%rbx), %eax
cmpl $0x3, %eax
je 0x87649
cmpl $0x2, %eax
jne 0x87659
cmpl $0x0, 0x40(%rbx)
jne 0x87698
cmpl $0x0, 0x3c(%rbx)
jne 0x8763a
movq %rbx, %rdi
callq 0x86d5a
movq %rbx, %rdi
callq 0x86ec4
jmp 0x87657
xorl %r12d, %r12d
jmp 0x876aa
cmpl $0x0, 0x40(%rbx)
jne 0x87698
movq %rbx, %rdi
callq 0x87214
movl (%rbx), %eax
cmpl $0x1, %eax
jne 0x87695
xorl %r12d, %r12d
testq %r14, %r14
je 0x876a6
leaq (%r15,%r12), %r13
movl 0x4(%rbx), %edi
movq %r13, %rsi
movq %r14, %rdx
callq 0x6aa0
testq %rax, %rax
jns 0x87689
callq 0x6060
cmpl $0x4, (%rax)
je 0x8766a
jmp 0x876b7
je 0x876a6
addq %rax, %r12
subq %rax, %r14
jne 0x87666
jmp 0x876a6
movl 0x4(%rbx), %edi
movq %r15, %rsi
movq %r14, %rdx
callq 0x87444
movq %rax, %r12
addq %r12, 0x8(%rbx)
movq %r12, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq $-0x1, %r12
jmp 0x876aa
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/htslib/knetfile.c
// Function: knet_seek
off_t knet_seek(knetFile *fp, off_t off, int whence)
{
#ifdef KNETFILE_HOOKS
       if (alt_seek)
               return alt_seek(fp, off, whence);
#endif

	if (whence == SEEK_SET && off == fp->offset) return 0;
	if (fp->type == KNF_TYPE_LOCAL) {
		/* Be aware that lseek() returns the offset after seeking, while fseek() returns zero on success. */
		off_t offset = lseek(fp->fd, off, whence);
		if (offset == -1) return -1;
		fp->offset = offset;
		return fp->offset;
	} else if (fp->type == KNF_TYPE_FTP) {
		if (whence == SEEK_CUR) fp->offset += off;
		else if (whence == SEEK_SET) fp->offset = off;
		else if (whence == SEEK_END) fp->offset = fp->file_size + off;
		else return -1;
		fp->is_ready = 0;
		return fp->offset;
	} else if (fp->type == KNF_TYPE_HTTP) {
		if (whence == SEEK_END) { // FIXME: can we allow SEEK_END in future?
			fprintf(stderr, "[knet_seek] SEEK_END is not supported for HTTP. Offset is unchanged.\n");
			errno = ESPIPE;
			return -1;
		}
		if (whence == SEEK_CUR) fp->offset += off;
		else if (whence == SEEK_SET) fp->offset = off;
		else return -1;
		fp->is_ready = 0;
		return fp->offset;
	}
	errno = EINVAL;
	fprintf(stderr,"[knet_seek] %s\n", strerror(errno));
	return -1;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
testl %edx, %edx
jne 0x876d2
cmpq %rsi, 0x8(%rbx)
jne 0x876d2
xorl %eax, %eax
jmp 0x87750
movl (%rbx), %eax
cmpl $0x3, %eax
je 0x876f7
cmpl $0x2, %eax
je 0x8770e
cmpl $0x1, %eax
jne 0x8773d
movl 0x4(%rbx), %edi
callq 0x6df0
cmpq $-0x1, %rax
je 0x87749
movq %rax, 0x8(%rbx)
jmp 0x87750
cmpl $0x1, %edx
je 0x87713
cmpl $0x2, %edx
je 0x87744
movq $-0x1, %rax
testl %edx, %edx
jne 0x87750
jmp 0x87717
cmpl $0x1, %edx
jne 0x87727
addq 0x8(%rbx), %rsi
movq %rsi, 0x8(%rbx)
movl $0x0, 0x40(%rbx)
movq %rsi, %rax
jmp 0x87750
testl %edx, %edx
je 0x87717
movq $-0x1, %rax
cmpl $0x2, %edx
jne 0x87750
addq 0x68(%rbx), %rsi
jmp 0x87717
callq 0x8471
jmp 0x87749
callq 0x8444
movq $-0x1, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/htslib/cram/cram_codecs.c
// Function: cram_external_decode_int
int cram_external_decode_int(cram_slice *slice, cram_codec *c,
			     cram_block *in, char *out, int *out_size) {
    int l;
    char *cp;
    cram_block *b;

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

    cp = (char *)b->data + b->idx;
    // E_INT and E_LONG are guaranteed single item queries
    l = safe_itf8_get(cp, (char *)b->data + b->uncomp_size, (int32_t *)out);
    b->idx += l;
    *out_size = 1;

    return l > 0 ? 0 : -1;
}

// Assembly:
pushq %r14
pushq %rbx
movl 0x30(%rsi), %edx
cmpq $0x400, %rdx            # imm = 0x400
setb %sil
movq 0x18(%rdi), %rax
testq %rax, %rax
setne %r9b
testb %r9b, %sil
je 0x8786b
movq (%rax,%rdx,8), %rax
testq %rax, %rax
je 0x8789a
movq 0x20(%rax), %rsi
movslq 0x1c(%rax), %rdi
movslq 0x14(%rax), %r10
movq %r10, %rbx
subq %rdi, %rbx
cmpq $0x5, %rbx
jge 0x878a7
movb $0x1, %r9b
xorl %edx, %edx
cmpl %r10d, %edi
jge 0x878be
movzbl (%rsi,%rdi), %r11d
movl %r11d, %r10d
shrl $0x4, %r10d
leaq 0x11349(%rip), %r14     # 0x98ba0
movslq (%r14,%r10,4), %r14
movl $0x0, %r10d
cmpq %r14, %rbx
jge 0x878ab
jmp 0x8796d
movq (%rdi), %rax
movslq 0x20(%rax), %rsi
testq %rsi, %rsi
jle 0x8789a
movq 0x10(%rdi), %rdi
xorl %r9d, %r9d
movq (%rdi,%r9,8), %rax
testq %rax, %rax
je 0x87892
cmpl $0x4, 0x8(%rax)
jne 0x87892
cmpl %edx, 0xc(%rax)
je 0x87822
incq %r9
cmpq %r9, %rsi
jne 0x8787e
cmpl $0x0, (%r8)
setne %r9b
jmp 0x8797a
movb (%rsi,%rdi), %r11b
movzbl %r11b, %edx
testb %dl, %dl
js 0x878c6
movl $0x1, %r10d
jmp 0x8796a
xorl %r10d, %r10d
jmp 0x8796d
movzbl 0x1(%rsi,%rdi), %r9d
cmpb $-0x41, %r11b
ja 0x878e6
andl $0x3f, %edx
shll $0x8, %edx
orl %r9d, %edx
movl $0x2, %r10d
jmp 0x8796a
cmpb $-0x21, %r11b
ja 0x87908
shll $0x8, %r9d
movzbl 0x2(%rsi,%rdi), %esi
andl $0x1f, %edx
shll $0x10, %edx
orl %r9d, %edx
orl %esi, %edx
movl $0x3, %r10d
jmp 0x8796a
cmpb $-0x11, %r11b
ja 0x87937
shll $0x10, %r9d
movzbl 0x2(%rsi,%rdi), %r10d
shll $0x8, %r10d
movzbl 0x3(%rsi,%rdi), %esi
andl $0xf, %edx
shll $0x18, %edx
orl %r9d, %edx
orl %r10d, %edx
orl %esi, %edx
movl $0x4, %r10d
jmp 0x8796a
shll $0x1c, %edx
shll $0x14, %r9d
orl %edx, %r9d
movzbl 0x2(%rsi,%rdi), %edx
shll $0xc, %edx
orl %r9d, %edx
movzbl 0x3(%rsi,%rdi), %r9d
shll $0x4, %r9d
orl %edx, %r9d
movzbl 0x4(%rsi,%rdi), %edx
andl $0xf, %edx
orl %r9d, %edx
movl $0x5, %r10d
xorl %r9d, %r9d
movl %edx, (%rcx)
addl %r10d, 0x1c(%rax)
movl $0x1, (%r8)
movzbl %r9b, %eax
negl %eax
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/htslib/cram/cram_codecs.c
// Function: cram_external_decode_char
int cram_external_decode_char(cram_slice *slice, cram_codec *c,
			      cram_block *in, char *out,
			      int *out_size) {
    char *cp;
    cram_block *b;

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

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

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

// Assembly:
pushq %rax
movl 0x30(%rsi), %eax
cmpq $0x400, %rax            # imm = 0x400
setb %sil
movq 0x18(%rdi), %rdx
testq %rdx, %rdx
setne %r9b
testb %r9b, %sil
je 0x879e4
movq (%rdx,%rax,8), %rdi
testq %rdi, %rdi
je 0x87a13
movq 0x20(%rdi), %rsi
movslq 0x1c(%rdi), %rdx
movl (%r8), %eax
addl %edx, %eax
movl %eax, 0x1c(%rdi)
cmpl 0x14(%rdi), %eax
setg %al
testq %rsi, %rsi
sete %dil
orb %al, %dil
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jne 0x87a1a
addq %rdx, %rsi
movslq (%r8), %rdx
movq %rcx, %rdi
callq 0x6570
xorl %eax, %eax
jmp 0x87a1a
movq (%rdi), %rdx
movslq 0x20(%rdx), %rdx
testq %rdx, %rdx
jle 0x87a13
movq 0x10(%rdi), %rsi
xorl %r9d, %r9d
movq (%rsi,%r9,8), %rdi
testq %rdi, %rdi
je 0x87a0b
cmpl $0x4, 0x8(%rdi)
jne 0x87a0b
cmpl %eax, 0xc(%rdi)
je 0x879ab
incq %r9
cmpq %r9, %rdx
jne 0x879f7
xorl %eax, %eax
cmpl (%r8), %eax
sbbl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/htslib/cram/cram_codecs.c
// Function: cram_external_decode_init
cram_codec *cram_external_decode_init(char *data, int size,
				      enum cram_external_type option,
				      int version) {
    cram_codec *c;
    char *cp = data;

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

    c->codec  = E_EXTERNAL;
    if (option == E_INT || option == E_LONG)
	c->decode = cram_external_decode_int;
    else if (option == E_BYTE_ARRAY || option == E_BYTE)
	c->decode = cram_external_decode_char;
    else
	c->decode = cram_external_decode_block;
    c->free   = cram_external_decode_free;
    
    cp += itf8_get(cp, &c->external.content_id);

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

    c->external.type = option;

    return c;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
movl $0x240, %edi            # imm = 0x240
callq 0x69d0
testq %rax, %rax
je 0x87b35
movl $0x1, (%rax)
leal -0x1(%rbx), %ecx
cmpl $0x1, %ecx
ja 0x87a5b
leaq -0x261(%rip), %rcx      # 0x877f8
jmp 0x87a73
leal -0x3(%rbx), %ecx
cmpl $0x1, %ecx
ja 0x87a6c
leaq -0xe6(%rip), %rcx       # 0x87984
jmp 0x87a73
leaq 0xc9(%rip), %rcx        # 0x87b3c
movq %rcx, 0x18(%rax)
leaq -0x62(%rip), %rcx       # 0x87a1c
movq %rcx, 0x10(%rax)
movzbl (%r14), %ecx
movl $0x1, %edx
testb %cl, %cl
jns 0x87b1d
movzbl 0x1(%r14), %edx
cmpb $-0x41, %cl
ja 0x87aac
andl $0x3f, %ecx
shll $0x8, %ecx
orl %edx, %ecx
movl $0x2, %edx
jmp 0x87b1d
cmpb $-0x21, %cl
ja 0x87aca
shll $0x8, %edx
movzbl 0x2(%r14), %esi
andl $0x1f, %ecx
shll $0x10, %ecx
orl %edx, %ecx
orl %esi, %ecx
movl $0x3, %edx
jmp 0x87b1d
cmpb $-0x11, %cl
ja 0x87af2
shll $0x10, %edx
movzbl 0x2(%r14), %esi
shll $0x8, %esi
movzbl 0x3(%r14), %edi
andl $0xf, %ecx
shll $0x18, %ecx
orl %edx, %ecx
orl %esi, %ecx
orl %edi, %ecx
movl $0x4, %edx
jmp 0x87b1d
shll $0x1c, %ecx
shll $0x14, %edx
orl %ecx, %edx
movzbl 0x2(%r14), %ecx
shll $0xc, %ecx
orl %edx, %ecx
movzbl 0x3(%r14), %edx
shll $0x4, %edx
orl %ecx, %edx
movzbl 0x4(%r14), %ecx
andl $0xf, %ecx
orl %edx, %ecx
movl $0x5, %edx
movl %ecx, 0x30(%rax)
movslq %ebp, %rcx
cmpq %rcx, %rdx
jne 0x87b2d
movl %ebx, 0x34(%rax)
jmp 0x87b37
movq %rax, %rdi
callq 0x84a4
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/htslib/cram/cram_codecs.c
// Function: cram_external_decode_block
static int cram_external_decode_block(cram_slice *slice, cram_codec *c,
				      cram_block *in, char *out_,
				      int *out_size) {
    char *cp;
    cram_block *b = NULL;
    cram_block *out = (cram_block *)out_;

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

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

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

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movq %rcx, %r14
movl 0x30(%rsi), %eax
cmpq $0x400, %rax            # imm = 0x400
setb %dl
movq 0x18(%rdi), %rcx
testq %rcx, %rcx
setne %sil
testb %sil, %dl
je 0x87c4c
movq (%rcx,%rax,8), %rdx
testq %rdx, %rdx
je 0x87c7e
movq 0x20(%rdx), %r15
movslq 0x1c(%rdx), %rcx
movl (%rbx), %eax
addl %ecx, %eax
movl %eax, 0x1c(%rdx)
cmpl 0x14(%rdx), %eax
setg %al
testq %r15, %r15
sete %dl
orb %al, %dl
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jne 0x87c84
addq %rcx, %r15
movq 0x20(%r14), %rax
movq 0x28(%r14), %rcx
movq 0x30(%r14), %rsi
movslq (%rbx), %rdx
leaq (%rsi,%rdx), %rdi
cmpq %rdi, %rcx
ja 0x87c33
movl $0x400, %r12d           # imm = 0x400
movq %rcx, %xmm0
punpckldq 0x4443(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x444b(%rip), %xmm0     # 0x8c020
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
mulsd 0x8cff(%rip), %xmm1     # 0x908e8
cvttsd2si %xmm1, %rdx
movq %rdx, %rdi
sarq $0x3f, %rdi
subsd 0x105d3(%rip), %xmm1    # 0x981d0
cvttsd2si %xmm1, %rsi
andq %rdi, %rsi
orq %rdx, %rsi
testq %rcx, %rcx
cmoveq %r12, %rsi
movq %rsi, 0x28(%r14)
movq %rax, %rdi
callq 0x6c80
movq %rax, 0x20(%r14)
movq 0x28(%r14), %rcx
movq 0x30(%r14), %rsi
movslq (%rbx), %rdx
leaq (%rsi,%rdx), %rdi
cmpq %rdi, %rcx
jbe 0x87bc0
addq %rsi, %rax
movq %rax, %rdi
movq %r15, %rsi
callq 0x6570
movslq (%rbx), %rax
addq %rax, 0x30(%r14)
xorl %eax, %eax
jmp 0x87c84
movq (%rdi), %rcx
movslq 0x20(%rcx), %rcx
testq %rcx, %rcx
jle 0x87c7e
movq 0x10(%rdi), %rsi
xorl %edi, %edi
movq (%rsi,%rdi,8), %rdx
testq %rdx, %rdx
je 0x87c76
cmpl $0x4, 0x8(%rdx)
jne 0x87c76
cmpl %eax, 0xc(%rdx)
je 0x87b77
incq %rdi
cmpq %rdi, %rcx
jne 0x87c5e
xorl %eax, %eax
cmpl (%rbx), %eax
sbbl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/htslib/cram/cram_codecs.c
// Function: cram_external_encode_init
cram_codec *cram_external_encode_init(cram_stats *st,
				      enum cram_external_type option,
				      void *dat,
				      int version) {
    cram_codec *c;

    c = malloc(sizeof(*c));
    if (!c)
	return NULL;
    c->codec = E_EXTERNAL;
    c->free = cram_external_encode_free;
    if (option == E_INT || option == E_LONG)
	c->encode = cram_external_encode_int;
    else if (option == E_BYTE_ARRAY || option == E_BYTE)
	c->encode = cram_external_encode_char;
    else
	abort();
    c->store = cram_external_encode_store;

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

    return c;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %r14d
movl $0x240, %edi            # imm = 0x240
callq 0x69d0
testq %rax, %rax
je 0x88032
movl $0x1, (%rax)
leaq -0x283(%rip), %rcx      # 0x87d76
movq %rcx, 0x10(%rax)
leal -0x1(%r14), %ecx
cmpl $0x2, %ecx
jae 0x8800f
leaq -0x37d(%rip), %rcx      # 0x87c90
jmp 0x88020
addl $-0x3, %r14d
cmpl $0x2, %r14d
jae 0x8803a
leaq -0x380(%rip), %rcx      # 0x87ca0
movq %rcx, 0x20(%rax)
leaq -0x2ab(%rip), %rcx      # 0x87d80
movq %rcx, 0x28(%rax)
movl %ebx, 0x30(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
callq 0x63c0
// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/htslib/cram/cram_codecs.c
// Function: cram_beta_decode_int
int cram_beta_decode_int(cram_slice *slice, cram_codec *c, cram_block *in, char *out, int *out_size) {
    int32_t *out_i = (int32_t *)out;
    int i, n;

    if (c->beta.nbits) {
        if (cram_not_enough_bits(in, c->beta.nbits))
            return -1;

	for (i = 0, n = *out_size; i < n; i++)
	    out_i[i] = get_bits_MSB(in, c->beta.nbits) - c->beta.offset;
    } else {
	for (i = 0, n = *out_size; i < n; i++)
	    out_i[i] = -c->beta.offset;
    }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rsi, %r15
movl 0x34(%rsi), %eax
testq %rax, %rax
je 0x880b4
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
testl %eax, %eax
js 0x880d7
movq %rdx, %r12
movslq 0x14(%rdx), %rcx
subq 0x30(%rdx), %rcx
jbe 0x880d7
cmpq $0x10000000, %rcx       # imm = 0x10000000
ja 0x8808a
movslq 0x38(%r12), %rdx
leaq (%rdx,%rcx,8), %rcx
addq $-0x7, %rcx
cmpq %rax, %rcx
jb 0x880d7
movslq (%r8), %r13
testq %r13, %r13
jle 0x880d4
xorl %r14d, %r14d
xorl %ebp, %ebp
movl 0x34(%r15), %esi
movq %r12, %rdi
callq 0x880e9
subl 0x30(%r15), %eax
movl %eax, (%rbx,%rbp,4)
incq %rbp
cmpq %rbp, %r13
jne 0x88097
jmp 0x880d7
movslq (%r8), %rax
testq %rax, %rax
jle 0x880d4
xorl %r14d, %r14d
xorl %ecx, %ecx
xorl %edx, %edx
subl 0x30(%r15), %edx
movl %edx, (%rbx,%rcx,4)
incq %rcx
cmpq %rcx, %rax
jne 0x880c1
jmp 0x880d7
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq