LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/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
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, %ebp
pushq $0x1
popq %rdi
pushq $0x30
popq %rsi
callq 0x6470
movq %rax, %r15
movslq %ebp, %r12
pushq $0x8
popq %rbp
movq %r12, %rdi
movq %rbp, %rsi
callq 0x6470
movq %rax, %r13
movq %rax, 0x10(%r15)
pushq $0x4
popq %rsi
movq %r12, %rdi
callq 0x6470
movq %rax, 0x20(%r15)
movq %r12, %rdi
movq %rbp, %rsi
callq 0x6470
movq %rax, 0x28(%r15)
movq %r12, %rdi
movq %rbp, %rsi
callq 0x6470
movq %rax, %rbp
movq %rax, 0x18(%r15)
movl %r12d, (%r15)
movq %r15, (%rsp)
orq $-0x1, 0x8(%r15)
xorl %r15d, %r15d
testl %r12d, %r12d
cmovlel %r15d, %r12d
cmpq %r15, %r12
je 0x65d96
movq (%rbx,%r15,8), %rsi
movq %r14, %rdi
callq 0x64df9
movq %rax, (%rbp,%r15,8)
orq $-0x1, (%r13,%r15,8)
incq %r15
jmp 0x65d75
movq (%rsp), %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r8, %rbx
movq %rcx, %r14
movq %rdx, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq %rdi, %r15
pushq $-0x1
popq %r13
xorl %ebp, %ebp
xorl %r12d, %r12d
movslq (%r15), %rax
cmpq %rax, %r12
jge 0x65f07
movq 0x10(%r15), %rax
movq (%rax,%rbp,2), %rax
cmpq 0x8(%r15), %rax
jne 0x65ee5
movq 0x18(%r15), %rax
movq (%rax,%rbp,2), %rdi
movq 0x20(%r15), %rcx
addq %rbp, %rcx
leaq 0x4(%rsp), %rsi
movq %rsp, %rdx
callq 0x65bef
movq 0x28(%r15), %rcx
movq %rax, (%rcx,%rbp,2)
movq 0x18(%r15), %rax
movq (%rax,%rbp,2), %rax
cmpl $0x0, 0x38(%rax)
jne 0x65f61
movq 0x10(%r15), %rdx
movq 0x28(%r15), %rax
movq (%rax,%rbp,2), %rcx
movl 0x4(%rsp), %esi
shlq $0x20, %rsi
movslq (%rsp), %rax
orq %rsi, %rax
testq %rcx, %rcx
cmoveq %rcx, %rax
movq %rax, (%rdx,%rbp,2)
jmp 0x65eed
movq 0x28(%r15), %rcx
movq (%rcx,%rbp,2), %rcx
cmpq %r13, %rax
cmovaeq %r13, %rax
testq %rcx, %rcx
cmovneq %rax, %r13
incq %r12
addq $0x4, %rbp
jmp 0x65e6d
movq %r13, 0x8(%r15)
cmpq $-0x1, %r13
je 0x65f66
movq %r13, %rax
shrq $0x20, %rax
movq 0x8(%rsp), %rcx
movl %eax, (%rcx)
movq 0x10(%rsp), %rax
movl %r13d, (%rax)
xorl %ecx, %ecx
xorl %eax, %eax
movslq (%r15), %rdx
cmpq %rdx, %rcx
jge 0x65f68
movq 0x10(%r15), %rdx
cmpq %r13, (%rdx,%rcx,8)
jne 0x65f50
movq 0x20(%r15), %rdx
movq 0x28(%r15), %rsi
movl (%rdx,%rcx,4), %edx
movq (%rsi,%rcx,8), %rsi
incl %eax
jmp 0x65f54
xorl %edx, %edx
xorl %esi, %esi
movl %edx, (%r14,%rcx,4)
movq %rsi, (%rbx,%rcx,8)
incq %rcx
jmp 0x65f2b
pushq $-0x1
popq %rax
jmp 0x65f68
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/icebert[P]pblat/htslib/sam.c
// Function: cigar_iref2iseq_set
static inline int cigar_iref2iseq_set(uint32_t **cigar, uint32_t *cigar_max, int *icig, int *iseq, int *iref)
{
    int pos = *iref;
    if ( pos < 0 ) return -1;
    *icig = 0;
    *iseq = 0;
    *iref = 0;
    while ( *cigar<cigar_max )
    {
        int cig  = (**cigar) & BAM_CIGAR_MASK;
        int ncig = (**cigar) >> BAM_CIGAR_SHIFT;

        if ( cig==BAM_CSOFT_CLIP ) { (*cigar)++; *iseq += ncig; *icig = 0; continue; }
        if ( cig==BAM_CHARD_CLIP || cig==BAM_CPAD ) { (*cigar)++; *icig = 0; continue; }
        if ( cig==BAM_CMATCH || cig==BAM_CEQUAL || cig==BAM_CDIFF )
        {
            pos -= ncig;
            if ( pos < 0 ) { *icig = ncig + pos; *iseq += *icig; *iref += *icig; return BAM_CMATCH; }
            (*cigar)++; *iseq += ncig; *icig = 0; *iref += ncig;
            continue;
        }
        if ( cig==BAM_CINS ) { (*cigar)++; *iseq += ncig; *icig = 0; continue; }
        if ( cig==BAM_CDEL || cig==BAM_CREF_SKIP )
        {
            pos -= ncig;
            if ( pos<0 ) pos = 0;
            (*cigar)++; *icig = 0; *iref += ncig;
            continue;
        }
        fprintf(stderr,"todo: cigar %d\n", cig);
        assert(0);
    }
    *iseq = -1;
    return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl (%r8), %r10d
pushq $-0x1
popq %rax
testl %r10d, %r10d
js 0x663c3
andl $0x0, (%rdx)
andl $0x0, (%rcx)
andl $0x0, (%r8)
movq (%rdi), %r11
xorl %ebx, %ebx
cmpq %rsi, %r11
jae 0x663c0
movl (%r11), %r14d
movl %r14d, %r9d
andl $0xf, %r9d
movl %r14d, %ebp
shrl $0x4, %ebp
cmpl $0x4, %r9d
je 0x6636d
leal -0x5(%r9), %r15d
cmpl $0x1, %r15d
ja 0x6635b
addq $0x4, %r11
movq %r11, (%rdi)
andl $0x0, (%rdx)
jmp 0x66326
testb $0x7, %r14b
je 0x6637b
cmpl $0x7, %r9d
je 0x6637b
cmpl $0x1, %r9d
jne 0x66397
addq $0x4, %r11
movq %r11, (%rdi)
addl %ebp, (%rcx)
andl $0x0, (%rdx)
jmp 0x66326
movl %r10d, %r9d
subl %ebp, %r9d
js 0x663ce
addq $0x4, %r11
movq %r11, (%rdi)
addl %ebp, (%rcx)
andl $0x0, (%rdx)
addl (%r8), %ebp
movl %r9d, %r10d
jmp 0x663b8
andl $0xe, %r14d
cmpl $0x2, %r14d
jne 0x663dd
subl %ebp, %r10d
testl %r10d, %r10d
cmovlel %ebx, %r10d
addq $0x4, %r11
movq %r11, (%rdi)
andl $0x0, (%rdx)
addl (%r8), %ebp
movl %ebp, (%r8)
jmp 0x66326
orl $-0x1, (%rcx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl %r10d, (%rdx)
addl %r10d, (%rcx)
movl (%rdx), %eax
addl %eax, (%r8)
xorl %eax, %eax
jmp 0x663c3
movq 0x4cbf4(%rip), %rax     # 0xb2fd8
movq (%rax), %rdi
leaq 0x234ed(%rip), %rsi     # 0x898db
movl %r9d, %edx
xorl %eax, %eax
callq 0x6a90
leaq 0x1c4be(%rip), %rdi     # 0x828bd
leaq 0x23446(%rip), %rsi     # 0x8984c
leaq 0x234de(%rip), %rcx     # 0x898eb
movl $0x6a1, %edx            # imm = 0x6A1
callq 0x6460
// File: /workspace/github_c_makefile_star2_O2/icebert[P]pblat/htslib/sam.c
// Function: cigar_iref2iseq_next
static inline int cigar_iref2iseq_next(uint32_t **cigar, uint32_t *cigar_max, int *icig, int *iseq, int *iref)
{
    while ( *cigar < cigar_max )
    {
        int cig  = (**cigar) & BAM_CIGAR_MASK;
        int ncig = (**cigar) >> BAM_CIGAR_SHIFT;

        if ( cig==BAM_CMATCH || cig==BAM_CEQUAL || cig==BAM_CDIFF )
        {
            if ( *icig >= ncig - 1 ) { *icig = 0;  (*cigar)++; continue; }
            (*iseq)++; (*icig)++; (*iref)++;
            return BAM_CMATCH;
        }
        if ( cig==BAM_CDEL || cig==BAM_CREF_SKIP ) { (*cigar)++; (*iref) += ncig; *icig = 0; continue; }
        if ( cig==BAM_CINS ) { (*cigar)++; *iseq += ncig; *icig = 0; continue; }
        if ( cig==BAM_CSOFT_CLIP ) { (*cigar)++; *iseq += ncig; *icig = 0; continue; }
        if ( cig==BAM_CHARD_CLIP || cig==BAM_CPAD ) { (*cigar)++; *icig = 0; continue; }
        fprintf(stderr,"todo: cigar %d\n", cig);
        assert(0);
    }
    *iseq = -1;
    *iref = -1;
    return -1;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq (%rdi), %r9
cmpq %rsi, %r9
jae 0x664a8
movl (%r9), %r11d
movl %r11d, %eax
andl $0xf, %eax
movl %r11d, %r10d
shrl $0x4, %r10d
cmpl $0x7, %eax
setne %bl
testb $0x7, %r11b
setne %bpl
testb %bl, %bpl
jne 0x6645d
decl %r10d
cmpl %r10d, (%rdx)
jl 0x664b2
andl $0x0, (%rdx)
addq $0x4, %r9
movq %r9, (%rdi)
jmp 0x6641d
andl $0xe, %r11d
cmpl $0x2, %r11d
jne 0x66476
addq $0x4, %r9
movq %r9, (%rdi)
addl %r10d, (%r8)
andl $0x0, (%rdx)
jmp 0x6641d
cmpl $0x4, %eax
je 0x66480
cmpl $0x1, %eax
jne 0x6648f
addq $0x4, %r9
movq %r9, (%rdi)
addl %r10d, (%rcx)
andl $0x0, (%rdx)
jmp 0x6641d
leal -0x5(%rax), %r10d
cmpl $0x1, %r10d
ja 0x664c7
addq $0x4, %r9
movq %r9, (%rdi)
andl $0x0, (%rdx)
jmp 0x6641d
orl $-0x1, (%rcx)
pushq $-0x1
popq %rcx
movl %ecx, %eax
jmp 0x664bd
incl (%rcx)
incl (%rdx)
movl (%r8), %ecx
incl %ecx
xorl %eax, %eax
movl %ecx, (%r8)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq 0x4cb0a(%rip), %rcx     # 0xb2fd8
movq (%rcx), %rdi
leaq 0x23403(%rip), %rsi     # 0x898db
movl %eax, %edx
xorl %eax, %eax
callq 0x6a90
leaq 0x1c3d5(%rip), %rdi     # 0x828bd
leaq 0x2335d(%rip), %rsi     # 0x8984c
leaq 0x2343b(%rip), %rcx     # 0x89931
movl $0x6b8, %edx            # imm = 0x6B8
callq 0x6460
// File: /workspace/github_c_makefile_star2_O2/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 0x66784
xorl %ecx, %ecx
cmpq %rsi, %rdi
jae 0x66793
movzbl (%rdi), %esi
movl %esi, %eax
shrl $0x4, %eax
leaq 0x2135f(%rip), %r9      # 0x87ad0
movslq (%r9,%rax,4), %r9
movl $0x0, %eax
cmpq %r9, %r8
jge 0x66787
jmp 0x66812
movb (%rdi), %sil
movzbl %sil, %ecx
testb %cl, %cl
js 0x66797
pushq $0x1
jmp 0x66811
xorl %eax, %eax
jmp 0x66812
movzbl 0x1(%rdi), %eax
cmpb $-0x41, %sil
ja 0x667ad
andl $0x3f, %ecx
shll $0x8, %ecx
orl %eax, %ecx
pushq $0x2
jmp 0x66811
cmpb $-0x21, %sil
ja 0x667c8
shll $0x8, %eax
movzbl 0x2(%rdi), %esi
andl $0x1f, %ecx
shll $0x10, %ecx
orl %eax, %ecx
orl %esi, %ecx
pushq $0x3
jmp 0x66811
cmpb $-0x11, %sil
ja 0x667ec
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
pushq $0x4
jmp 0x66811
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
pushq $0x5
popq %rax
movl %ecx, (%rdx)
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x68161
movl %esi, %ecx
movq (%rax,%rcx,8), %rax
retq
movq (%rdi), %rax
movl 0x20(%rax), %ecx
xorl %eax, %eax
testl %ecx, %ecx
cmovlel %eax, %ecx
xorl %edx, %edx
cmpq %rdx, %rcx
je 0x68192
movq 0x10(%rdi), %rax
movq (%rax,%rdx,8), %rax
testq %rax, %rax
je 0x6818d
cmpl $0x4, 0x8(%rax)
jne 0x6818d
cmpl %esi, 0xc(%rax)
je 0x68160
incq %rdx
jmp 0x68170
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x6c0d0
pushq $0x28
popq %rdi
callq 0x69d0
testq %rax, %rax
je 0x6c0ea
movq %rax, %r14
movq %rbx, (%rax)
movq %r13, 0x8(%rax)
movq %r12, 0x10(%rax)
movq %r15, 0x18(%rax)
movq 0x8868(%rbx), %rdi
callq 0x5a777
xorl %r8d, %r8d
testl %eax, %eax
setne %r8b
movq 0x8860(%rbx), %rdi
movq 0x8868(%rbx), %rsi
leaq -0x88(%rip), %rdx       # 0x6c031
movq %r14, %rcx
callq 0x5ac13
cmpl $-0x1, %eax
je 0x6c0ef
andq $0x0, 0x88f0(%rbx)
jmp 0x6c0f6
movq %rbx, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r15, %rcx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x683af
pushq $-0x1
popq %rax
jmp 0x6c0f8
movq %r14, 0x88f0(%rbx)
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x547c1
movq 0x120(%r15), %rdi
movl %ebp, %esi
callq 0x547c1
movq 0x70(%r14), %rcx
movl $0x400, %r12d           # imm = 0x400
movq 0x28(%rcx), %rax
movq 0x30(%rcx), %rdx
leaq 0x1(%rdx), %rsi
cmpq %rsi, %rax
ja 0x74c23
movq %rax, %xmm0
punpckldq 0x6446(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x644e(%rip), %xmm0     # 0x7b020
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
mulsd 0xac02(%rip), %xmm1     # 0x7f7e8
cvttsd2si %xmm1, %rdx
movq %rdx, %rdi
subsd 0x124da(%rip), %xmm1    # 0x870d0
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 0x6c80
movq 0x70(%r14), %rcx
movq %rax, 0x20(%rcx)
jmp 0x74bac
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 0x75256
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x547c1
movq 0x70(%r14), %rcx
movl $0x400, %r12d           # imm = 0x400
movq 0x28(%rcx), %rax
movq 0x30(%rcx), %rdx
leaq 0x1(%rdx), %rsi
cmpq %rsi, %rax
ja 0x74d07
movq %rax, %xmm0
punpckldq 0x6362(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x636a(%rip), %xmm0     # 0x7b020
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
mulsd 0xab1e(%rip), %xmm1     # 0x7f7e8
cvttsd2si %xmm1, %rdx
movq %rdx, %rdi
subsd 0x123f6(%rip), %xmm1    # 0x870d0
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 0x6c80
movq 0x70(%r14), %rcx
movq %rax, 0x20(%rcx)
jmp 0x74c90
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 0x75256
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x752a0
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 0x75320
movslq 0x68(%r12), %rcx
leaq 0x1(%rcx), %rax
movl %eax, 0x68(%r12)
testq %rcx, %rcx
je 0x752d2
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 0x752e4
movl 0x48(%r14), %eax
movl %eax, 0x64(%r12)
movq 0x1a0(%r15), %rdi
movl (%rbx), %esi
callq 0x547c1
movq 0x198(%r15), %rdi
movl 0x4(%rbx), %esi
callq 0x547c1
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
pushq $-0x1
popq %rax
jmp 0x75314
// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
callq 0x61280
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)
movl 0x38(%rbx), %ebp
movl %ebp, (%r14)
movslq %ebp, %r15
pushq $0x8
popq %rsi
movq %r15, %rdi
callq 0x6470
movq %rax, 0x20(%r14)
pushq $0x4
popq %rsi
movq %r15, %rdi
callq 0x6470
movq %rax, 0x10(%r14)
xorl %r15d, %r15d
xorl %r12d, %r12d
movslq %ebp, %rax
cmpq %rax, %r12
jge 0x75896
movq 0x40(%rbx), %rax
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), %eax
movq 0x10(%r14), %rcx
movl %eax, (%rcx,%r15)
incq %r12
movl 0x38(%rbx), %ebp
addq $0x4, %r15
jmp 0x7585c
movq %r14, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
andq $0x0, 0x18(%rsp)
leaq 0x8(%rsp), %rcx
andq $0x0, (%rcx)
pushq $0x1
popq %rax
movl %eax, 0x14(%rsp)
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 0x75b8f
movq 0x8(%rsp), %rax
movl 0x4(%rax), %edi
movl 0x8(%rax), %esi
movl 0xc(%rax), %edx
callq 0x6190
cmpl $-0x1, %eax
je 0x75bbc
movl %eax, %ebx
pushq $0x1
popq %rsi
pushq $0x2
popq %rdx
leaq 0x14(%rsp), %rcx
pushq $0x4
popq %r8
movl %eax, %edi
callq 0x6d80
cmpl $-0x1, %eax
je 0x75b86
pushq $0x1
popq %rsi
pushq $0xd
popq %rdx
leaq 0x18(%rsp), %rcx
pushq $0x8
popq %r8
movl %ebx, %edi
callq 0x6d80
cmpl $-0x1, %eax
je 0x75b86
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rsi
movl 0x10(%rax), %edx
movl %ebx, %edi
callq 0x6580
testl %eax, %eax
jne 0x75bc5
movq 0x8(%rsp), %rdi
callq 0x69a0
jmp 0x75bde
leaq 0x14b7d(%rip), %rdi     # 0x8a70a
jmp 0x75bcc
movq 0x3d442(%rip), %rcx     # 0xb2fd8
movq (%rcx), %r15
movl %eax, %edi
callq 0x6a30
leaq 0x14b4a(%rip), %rsi     # 0x8a6f1
movq %r15, %rdi
movq %r14, %rdx
movq %rbx, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0x6a90
jmp 0x75bdb
leaq 0xdf0e(%rip), %rdi      # 0x83ad1
jmp 0x75bcc
leaq 0x14b49(%rip), %rdi     # 0x8a715
callq 0x6590
movq 0x8(%rsp), %rdi
callq 0x69a0
pushq $-0x1
popq %rbx
movl %ebx, %eax
addq $0x50, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x76790
testl %eax, %eax
jle 0x75d54
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 0x75d5f
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 0x75bea
// File: /workspace/github_c_makefile_star2_O2/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 0xa806(%rip), %rsi      # 0x805b9
pushq $0x6
popq %rdx
callq 0x6330
testl %eax, %eax
je 0x75dd4
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 0x75dbf
cmpl $0x2f, %eax
je 0x75dfc
incq %rbx
addq %rbp, %r13
jmp 0x75de8
pushq $0x1
popq %rdi
movl $0x88, %esi
callq 0x6470
movq %rax, %r14
movabsq $-0xfffffffe, %rax      # imm = 0xFFFFFFFF00000002
movq %rax, (%r14)
leaq 0xb0a4(%rip), %rdi      # 0x80ec4
callq 0x6dd0
movq %rax, 0x18(%r14)
addq %r13, %rbp
sarq $0x20, %rbp
movq %rbp, %rdi
pushq $0x1
popq %rsi
callq 0x6470
movq %rax, %rbp
movq %rax, 0x10(%r14)
pushq $0x63
popq %rsi
movq %r12, %rdi
callq 0x6270
testq %rax, %rax
je 0x75e5a
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
pushq $0x1
popq %r15
movq %r15, %rsi
callq 0x6470
movq %rax, 0x50(%r14)
leaq 0x14797(%rip), %rsi     # 0x8a626
movq %rax, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x6170
movq %rbx, %rdi
callq 0x62d0
leaq 0x8(%rax), %rdi
movq %r15, %rsi
callq 0x6470
movq %rax, 0x58(%r14)
leaq 0xb061(%rip), %rsi      # 0x80f1c
movq %rax, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x6170
jmp 0x75dc2
// File: /workspace/github_c_makefile_star2_O2/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 %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, %ebp
xorl %r15d, %r15d
pushq $0x1
popq %r12
testq %rbx, %rbx
je 0x76474
movl %ebp, %edi
movl %r12d, %esi
callq 0x76790
testl %eax, %eax
jle 0x76474
leaq (%r14,%r15), %rsi
movl %ebp, %edi
movq %rbx, %rdx
callq 0x6aa0
testq %rax, %rax
je 0x76474
addq %rax, %r15
subq %rax, %rbx
jmp 0x76446
movq %r15, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x76549
movq %rsi, %r14
movq %rdi, %rbx
leaq 0xa11f(%rip), %rsi      # 0x805b9
pushq $0x6
popq %rdx
callq 0x6330
testl %eax, %eax
je 0x764f2
leaq 0xa0fb(%rip), %rsi      # 0x805a8
pushq $0x7
popq %rdx
movq %rbx, %rdi
callq 0x6330
movq %rbx, %rdi
testl %eax, %eax
je 0x7651c
xorl %esi, %esi
xorl %eax, %eax
callq 0x64c0
cmpl $-0x1, %eax
je 0x76567
movl %eax, %ebp
pushq $0x1
popq %rdi
movl $0x88, %esi
callq 0x6470
movq %rax, %rbx
movl $0x1, (%rax)
movl %ebp, 0x4(%rax)
orl $-0x1, 0x20(%rax)
jmp 0x76531
movq %rbx, %rdi
movq %r14, %rsi
callq 0x75d9b
testq %rax, %rax
je 0x7653f
movq %rax, %rbx
movq %rax, %rdi
callq 0x75a60
cmpl $-0x1, %eax
je 0x76537
movq %rbx, %rdi
callq 0x75ecd
jmp 0x76531
callq 0x7609d
testq %rax, %rax
je 0x7653f
movq %rax, %rbx
movq %rax, %rdi
callq 0x76229
cmpl $-0x1, 0x4(%rbx)
jne 0x76541
movq %rbx, %rdi
callq 0x76575
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
movq 0x3ca88(%rip), %rax     # 0xb2fd8
movq (%rax), %rcx
leaq 0x14118(%rip), %rdi     # 0x8a672
pushq $0x28
popq %rsi
pushq $0x1
popq %rdx
callq 0x6e70
jmp 0x7653f
leaq 0xa1a8(%rip), %rdi      # 0x80716
callq 0x6590
jmp 0x7653f
// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x4(%rdi), %edi
cmpl $-0x1, %edi
je 0x7663b
movq %rdx, %r14
movq %rsi, %r15
movl (%rbx), %eax
cmpl $0x3, %eax
je 0x76640
cmpl $0x2, %eax
jne 0x76650
cmpl $0x0, 0x40(%rbx)
jne 0x76691
cmpl $0x0, 0x3c(%rbx)
jne 0x76631
movq %rbx, %rdi
callq 0x75d71
movq %rbx, %rdi
callq 0x75ecd
jmp 0x7664e
xorl %r13d, %r13d
jmp 0x766a6
cmpl $0x0, 0x40(%rbx)
jne 0x76691
movq %rbx, %rdi
callq 0x76229
movl (%rbx), %eax
cmpl $0x1, %eax
jne 0x7668e
xorl %r12d, %r12d
pushq $-0x1
popq %r13
testq %r14, %r14
je 0x7669f
leaq (%r15,%r12), %rbp
movl 0x4(%rbx), %edi
movq %rbp, %rsi
movq %r14, %rdx
callq 0x6aa0
testq %rax, %rax
jns 0x76684
callq 0x6060
cmpl $0x4, (%rax)
je 0x76665
jmp 0x766a6
je 0x7669f
addq %rax, %r12
subq %rax, %r14
jmp 0x7665c
movl 0x4(%rbx), %edi
movq %r15, %rsi
movq %r14, %rdx
callq 0x7642f
movq %rax, %r12
addq %r12, 0x8(%rbx)
movq %r12, %r13
movq %r13, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rsi, %rax
movq %rdi, %rbx
testl %edx, %edx
jne 0x766d0
cmpq %rax, 0x8(%rbx)
jne 0x766d0
xorl %eax, %eax
jmp 0x7678e
movl (%rbx), %ecx
cmpl $0x3, %ecx
je 0x766ff
cmpl $0x2, %ecx
je 0x7670f
cmpl $0x1, %ecx
jne 0x76731
movl 0x4(%rbx), %edi
movq %rax, %rsi
callq 0x6df0
cmpq $-0x1, %rax
je 0x7678b
movq %rax, 0x8(%rbx)
jmp 0x7678e
cmpl $0x1, %edx
je 0x76714
cmpl $0x2, %edx
je 0x76764
testl %edx, %edx
jne 0x7678b
jmp 0x76718
cmpl $0x1, %edx
jne 0x76722
addq 0x8(%rbx), %rax
movq %rax, 0x8(%rbx)
andl $0x0, 0x40(%rbx)
jmp 0x7678e
testl %edx, %edx
je 0x76718
cmpl $0x2, %edx
jne 0x7678b
addq 0x68(%rbx), %rax
jmp 0x76718
callq 0x6060
movl $0x16, (%rax)
movq 0x3c895(%rip), %rax     # 0xb2fd8
movq (%rax), %rbx
pushq $0x16
popq %rdi
callq 0x6230
leaq 0x13f8c(%rip), %rsi     # 0x8a6e1
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x6a90
jmp 0x7678b
movq 0x3c86d(%rip), %rax     # 0xb2fd8
movq (%rax), %rcx
leaq 0x13f26(%rip), %rdi     # 0x8a69b
pushq $0x45
popq %rsi
pushq $0x1
popq %rdx
callq 0x6e70
callq 0x6060
movl $0x1d, (%rax)
pushq $-0x1
popq %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
movq %r8, %rbx
movq %rcx, %r14
movl 0x30(%rsi), %esi
callq 0x7686f
testq %rax, %rax
je 0x7685e
movq %rax, %r15
movq 0x20(%rax), %rax
movslq 0x1c(%r15), %rdi
addq %rax, %rdi
movslq 0x14(%r15), %rsi
addq %rax, %rsi
movq %r14, %rdx
callq 0x768c1
addl %eax, 0x1c(%r15)
movl $0x1, (%rbx)
testl %eax, %eax
sete %al
jmp 0x76864
cmpl $0x0, (%rbx)
setne %al
movzbl %al, %eax
negl %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r14
pushq %rbx
pushq %rax
movq %r8, %r14
movq %rcx, %rbx
movl 0x30(%rsi), %esi
callq 0x7686f
movl (%r14), %ecx
testq %rax, %rax
je 0x769c3
movq 0x20(%rax), %rsi
movslq 0x1c(%rax), %rdx
addl %edx, %ecx
movl %ecx, 0x1c(%rax)
cmpl 0x14(%rax), %ecx
setg %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
je 0x769cb
pushq $-0x1
popq %rax
jmp 0x769db
xorl %eax, %eax
negl %ecx
sbbl %eax, %eax
jmp 0x769db
addq %rdx, %rsi
movslq (%r14), %rdx
movq %rbx, %rdi
callq 0x6570
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %r14d
movl %esi, %ebp
movq %rdi, %r15
movl $0x240, %edi            # imm = 0x240
callq 0x69d0
testq %rax, %rax
je 0x76b0a
movq %rax, %rbx
movl $0x1, (%rax)
leal -0x1(%r14), %eax
cmpl $0x1, %eax
ja 0x76a25
leaq -0x20b(%rip), %rax      # 0x76818
jmp 0x76a3e
leal -0x3(%r14), %eax
cmpl $0x1, %eax
ja 0x76a37
leaq -0xae(%rip), %rax       # 0x76987
jmp 0x76a3e
leaq 0xdc(%rip), %rax        # 0x76b1a
movq %rax, 0x18(%rbx)
leaq -0x66(%rip), %rax       # 0x769e3
movq %rax, 0x10(%rbx)
movzbl (%r15), %eax
testb %al, %al
js 0x76a59
pushq $0x1
jmp 0x76ad4
movzbl 0x1(%r15), %ecx
cmpb $-0x41, %al
ja 0x76a6e
andl $0x3f, %eax
shll $0x8, %eax
orl %ecx, %eax
pushq $0x2
jmp 0x76ad4
cmpb $-0x21, %al
ja 0x76a88
shll $0x8, %ecx
movzbl 0x2(%r15), %edx
andl $0x1f, %eax
shll $0x10, %eax
orl %ecx, %eax
orl %edx, %eax
pushq $0x3
jmp 0x76ad4
cmpb $-0x11, %al
ja 0x76aac
shll $0x10, %ecx
movzbl 0x2(%r15), %edx
shll $0x8, %edx
movzbl 0x3(%r15), %esi
andl $0xf, %eax
shll $0x18, %eax
orl %ecx, %eax
orl %edx, %eax
orl %esi, %eax
pushq $0x4
jmp 0x76ad4
shll $0x1c, %eax
shll $0x14, %ecx
orl %eax, %ecx
movzbl 0x2(%r15), %eax
shll $0xc, %eax
orl %ecx, %eax
movzbl 0x3(%r15), %ecx
shll $0x4, %ecx
orl %eax, %ecx
movzbl 0x4(%r15), %eax
andl $0xf, %eax
orl %ecx, %eax
pushq $0x5
popq %rcx
movl %eax, 0x30(%rbx)
movslq %ebp, %rax
cmpq %rax, %rcx
jne 0x76ae6
movl %r14d, 0x34(%rbx)
jmp 0x76b0c
movq 0x3c4eb(%rip), %rax     # 0xb2fd8
movq (%rax), %rcx
leaq 0x13ce5(%rip), %rdi     # 0x8a7dc
pushq $0x21
popq %rsi
pushq $0x1
popq %rdx
callq 0x6e70
movq %rbx, %rdi
callq 0x68a0
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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, %r14
movq %rcx, %rbx
movl 0x30(%rsi), %esi
callq 0x7686f
movl (%r14), %ecx
testq %rax, %rax
je 0x76b5d
movq 0x20(%rax), %r15
movslq 0x1c(%rax), %rdx
addl %edx, %ecx
movl %ecx, 0x1c(%rax)
cmpl 0x14(%rax), %ecx
setg %al
testq %r15, %r15
sete %cl
orb %al, %cl
je 0x76b68
pushq $-0x1
popq %rax
jmp 0x76bfc
xorl %eax, %eax
negl %ecx
sbbl %eax, %eax
jmp 0x76bfc
addq %rdx, %r15
movl $0x400, %r12d           # imm = 0x400
movq 0x28(%rbx), %rax
movq 0x30(%rbx), %rdi
movslq (%r14), %rdx
leaq (%rdi,%rdx), %rcx
cmpq %rcx, %rax
ja 0x76be7
movq %rax, %xmm0
punpckldq 0x447e(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x4486(%rip), %xmm0     # 0x7b020
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
mulsd 0x8c3a(%rip), %xmm1     # 0x7f7e8
cvttsd2si %xmm1, %rcx
movq %rcx, %rdx
subsd 0x10512(%rip), %xmm1    # 0x870d0
cvttsd2si %xmm1, %rsi
sarq $0x3f, %rdx
andq %rdx, %rsi
orq %rcx, %rsi
testq %rax, %rax
cmoveq %r12, %rsi
movq %rsi, 0x28(%rbx)
movq 0x20(%rbx), %rdi
callq 0x6c80
movq %rax, 0x20(%rbx)
jmp 0x76b71
addq 0x20(%rbx), %rdi
movq %r15, %rsi
callq 0x6570
movslq (%r14), %rax
addq %rax, 0x30(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x76f4c
movl $0x1, (%rax)
leaq -0x244(%rip), %rcx      # 0x76ccf
movq %rcx, 0x10(%rax)
leal -0x1(%r14), %ecx
cmpl $0x2, %ecx
jae 0x76f29
leaq -0x31f(%rip), %rcx      # 0x76c08
jmp 0x76f3a
addl $-0x3, %r14d
cmpl $0x2, %r14d
jae 0x76f54
leaq -0x322(%rip), %rcx      # 0x76c18
movq %rcx, 0x20(%rax)
leaq -0x271(%rip), %rcx      # 0x76cd4
movq %rcx, 0x28(%rax)
movl %ebx, 0x30(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
callq 0x63c0
// File: /workspace/github_c_makefile_star2_O2/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 %r8, %r15
movq %rcx, %rbx
movq %rsi, %r14
movl 0x34(%rsi), %esi
testl %esi, %esi
je 0x76f99
movq %rdx, %r12
movq %rdx, %rdi
callq 0x76fe6
testl %eax, %eax
je 0x76fba
pushq $-0x1
popq %r15
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl (%r15), %eax
xorl %r15d, %r15d
testl %eax, %eax
cmovlel %r15d, %eax
xorl %ecx, %ecx
cmpq %rcx, %rax
je 0x76f87
xorl %edx, %edx
subl 0x30(%r14), %edx
movl %edx, (%rbx,%rcx,4)
incq %rcx
jmp 0x76fa7
movl (%r15), %r13d
xorl %r15d, %r15d
testl %r13d, %r13d
cmovlel %r15d, %r13d
xorl %ebp, %ebp
cmpq %rbp, %r13
je 0x76f87
movl 0x34(%r14), %esi
movq %r12, %rdi
callq 0x77022
subl 0x30(%r14), %eax
movl %eax, (%rbx,%rbp,4)
incq %rbp
jmp 0x76fc9
// File: /workspace/github_c_makefile_star2_O2/icebert[P]pblat/htslib/cram/cram_codecs.c
// Function: cram_beta_decode_char
int cram_beta_decode_char(cram_slice *slice, cram_codec *c, cram_block *in, char *out, int *out_size) {
    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] = get_bits_MSB(in, c->beta.nbits) - c->beta.offset;
    } else {
	for (i = 0, n = *out_size; i < n; i++)
	    out[i] = -c->beta.offset;
    }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r15
movq %rcx, %rbx
movq %rsi, %r14
movl 0x34(%rsi), %esi
testl %esi, %esi
je 0x772c9
movq %rdx, %r12
movq %rdx, %rdi
callq 0x76fe6
testl %eax, %eax
je 0x772ee
pushq $-0x1
popq %r15
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl (%r15), %eax
xorl %r15d, %r15d
testl %eax, %eax
cmovlel %r15d, %eax
xorl %ecx, %ecx
cmpq %rcx, %rax
je 0x772b7
movb 0x30(%r14), %dl
xorl %esi, %esi
subb %dl, %sil
movb %sil, (%rbx,%rcx)
incq %rcx
jmp 0x772d7
movl (%r15), %r13d
xorl %r15d, %r15d
testl %r13d, %r13d
cmovlel %r15d, %r13d
xorl %ebp, %ebp
cmpq %rbp, %r13
je 0x772b7
movl 0x34(%r14), %esi
movq %r12, %rdi
callq 0x77022
subl 0x30(%r14), %eax
movb %al, (%rbx,%rbp)
incq %rbp
jmp 0x772fd
// File: /workspace/github_c_makefile_star2_O2/icebert[P]pblat/htslib/cram/cram_codecs.c
// Function: cram_beta_encode_store
int cram_beta_encode_store(cram_codec *c, cram_block *b,
			   char *prefix, int version) {
    int len = 0;

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

    len += itf8_put_blk(b, c->codec);
    len += itf8_put_blk(b, itf8_size(c->e_beta.offset)
			+ itf8_size(c->e_beta.nbits)); // codec length
    len += itf8_put_blk(b, c->e_beta.offset);
    len += itf8_put_blk(b, c->e_beta.nbits);

    return len;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
testq %rdx, %rdx
je 0x775ac
movq %rdx, %r12
movq %rdx, %rdi
callq 0x62d0
movq %rax, %r15
movl $0x400, %r13d           # imm = 0x400
movq 0x28(%rbx), %rax
movq 0x30(%rbx), %rdi
leaq (%rdi,%r15), %rcx
cmpq %rcx, %rax
ja 0x77597
movq %rax, %xmm0
punpckldq 0x3ace(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x3ad6(%rip), %xmm0     # 0x7b020
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
mulsd 0x828a(%rip), %xmm1     # 0x7f7e8
cvttsd2si %xmm1, %rcx
movq %rcx, %rdx
subsd 0xfb62(%rip), %xmm1     # 0x870d0
cvttsd2si %xmm1, %rsi
sarq $0x3f, %rdx
andq %rdx, %rsi
orq %rcx, %rsi
testq %rax, %rax
cmoveq %r13, %rsi
movq %rsi, 0x28(%rbx)
movq 0x20(%rbx), %rdi
callq 0x6c80
movq %rax, 0x20(%rbx)
jmp 0x77524
addq 0x20(%rbx), %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x6570
addq %r15, 0x30(%rbx)
jmp 0x775af
xorl %r15d, %r15d
movl (%r14), %esi
movq %rbx, %rdi
callq 0x4d6ec
movl %eax, %ebp
movl 0x30(%r14), %edx
pushq $0x1
popq %rsi
pushq $0x5
popq %rcx
movl %esi, %eax
cmpl $0x80, %edx
jb 0x775f4
cmpl $0x4000, %edx           # imm = 0x4000
jae 0x775dc
pushq $0x2
jmp 0x775e6
cmpl $0x200000, %edx         # imm = 0x200000
jae 0x775e9
pushq $0x3
popq %rax
jmp 0x775f4
cmpl $0x10000000, %edx       # imm = 0x10000000
movl %ecx, %eax
sbbl $0x0, %eax
movl 0x34(%r14), %edx
cmpl $0x80, %edx
jb 0x77624
cmpl $0x4000, %edx           # imm = 0x4000
jae 0x7760c
pushq $0x2
jmp 0x77616
cmpl $0x200000, %edx         # imm = 0x200000
jae 0x77619
pushq $0x3
popq %rsi
jmp 0x77624
cmpl $0x10000000, %edx       # imm = 0x10000000
sbbl $0x0, %ecx
movl %ecx, %esi
addl %eax, %esi
addl %r15d, %ebp
movq %rbx, %rdi
callq 0x4d6ec
movl %eax, %r15d
movl 0x30(%r14), %esi
movq %rbx, %rdi
callq 0x4d6ec
movl %eax, %r12d
addl %r15d, %r12d
addl %ebp, %r12d
movl 0x34(%r14), %esi
movq %rbx, %rdi
callq 0x4d6ec
addl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq