LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/zhou-lab[P]tbmate/htslib/regidx.c
// Function: regidx_build_index
int _regidx_build_index(regidx_t *idx)
{
    int iseq;
    for (iseq=0; iseq<idx->nseq; iseq++)
    {
        reglist_t *list = &idx->seq[iseq];
        int j,k, imax = 0;   // max index bin
        for (j=0; j<list->nregs; j++)
        {
            int ibeg = list->regs[j].start >> LIDX_SHIFT;
            int iend = list->regs[j].end >> LIDX_SHIFT;
            if ( imax < iend + 1 )
            {
                int old_imax = imax; 
                imax = iend + 1;
                kroundup32(imax);
                list->idx = (int*) realloc(list->idx, imax*sizeof(int));
                for (k=old_imax; k<imax; k++) list->idx[k] = -1;
            }
            if ( ibeg==iend )
            {
                if ( list->idx[ibeg]<0 ) list->idx[ibeg] = j;
            }
            else
            {
                for (k=ibeg; k<=iend; k++)
                    if ( list->idx[k]<0 ) list->idx[k] = j;
            }
            list->nidx = iend + 1;
        }
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
xorl %ecx, %ecx
movq %rdi, 0x8(%rsp)
movslq (%rdi), %rax
cmpq %rax, %rcx
jge 0xea57
movq %rcx, 0x10(%rsp)
imulq $0x28, %rcx, %r15
addq 0x8(%rdi), %r15
xorl %r12d, %r12d
xorl %ebp, %ebp
movslq 0xc(%r15), %rax
cmpq %rax, %r12
jge 0xea45
movq 0x18(%r15), %rax
movl (%rax,%r12,8), %ebx
movl 0x4(%rax,%r12,8), %eax
movl %eax, %r13d
shrl $0xd, %r13d
cmpl %r13d, %ebp
jg 0xea05
shrl $0xe, %eax
orl %r13d, %eax
movl %eax, %ecx
shrl $0x2, %ecx
orl %eax, %ecx
movl %ecx, %eax
shrl $0x4, %eax
orl %ecx, %eax
movl %eax, %ecx
shrl $0x8, %ecx
orl %eax, %ecx
movl %ecx, %r14d
shrl $0x10, %r14d
orl %ecx, %r14d
leal 0x1(%r14), %eax
movl %eax, 0x4(%rsp)
movq (%r15), %rdi
leaq 0x4(,%r14,4), %rsi
callq 0x37c0
movq %rax, (%r15)
movl %ebp, %ecx
cmpq %r14, %rcx
ja 0xea01
orl $-0x1, (%rax,%rcx,4)
incq %rcx
jmp 0xe9f3
movl 0x4(%rsp), %ebp
movl %ebx, %eax
shrl $0xd, %eax
cmpl %r13d, %eax
jne 0xea2b
movq (%r15), %rcx
cmpl $0x0, (%rcx,%rax,4)
jns 0xea1c
movl %r12d, (%rcx,%rax,4)
incl %r13d
movl %r13d, 0x8(%r15)
incq %r12
jmp 0xe98b
shrl $0xd, %ebx
cmpq %r13, %rbx
ja 0xea1c
movq (%r15), %rax
cmpl $0x0, (%rax,%rbx,4)
jns 0xea40
movl %r12d, (%rax,%rbx,4)
incq %rbx
jmp 0xea2e
movq 0x10(%rsp), %rcx
incq %rcx
movq 0x8(%rsp), %rdi
jmp 0xe96d
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/zhou-lab[P]tbmate/htslib/regidx.c
// Function: regidx_parse_tab
int regidx_parse_tab(const char *line, char **chr_beg, char **chr_end, reg_t *reg, void *payload, void *usr)
{
    char *ss = (char*) line;
    while ( *ss && isspace(*ss) ) ss++;
    if ( !*ss ) return -1;      // skip blank lines
    if ( *ss=='#' ) return -1;  // skip comments
    
    char *se = ss;
    while ( *se && !isspace(*se) ) se++;
    if ( !*se ) { fprintf(stderr,"Could not parse bed line: %s\n", line); return -2; }

    *chr_beg = ss;
    *chr_end = se-1;

    ss = se+1;
    reg->start = hts_parse_decimal(ss, &se, 0) - 1;
    if ( ss==se ) { fprintf(stderr,"Could not parse bed line: %s\n", line); return -2; }

    if ( !se[0] || !se[1] )
        reg->end = reg->start;
    else
    {
        ss = se+1;
        reg->end = hts_parse_decimal(ss, &se, 0);
        if ( ss==se ) reg->end = reg->start;
        else reg->end--;
    }
    
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r13
movq %rdx, 0x10(%rsp)
movq %rsi, %r12
movq %rdi, %rbx
pushq $-0x1
popq %rbp
movq %rdi, %r14
movsbq (%r14), %r15
testq %r15, %r15
je 0xf23c
callq 0x3410
movq (%rax), %rax
testb $0x20, 0x1(%rax,%r15,2)
je 0xf195
incq %r14
jmp 0xf173
cmpb $0x23, %r15b
je 0xf23c
movq %r13, (%rsp)
leaq 0x1(%r14), %r13
testb %r15b, %r15b
je 0xf254
movsbq %r15b, %rcx
testb $0x20, 0x1(%rax,%rcx,2)
jne 0xf1c4
movb (%r13), %r15b
incq %r13
jmp 0xf1a7
leaq -0x1(%r13), %rax
leaq 0x8(%rsp), %rbp
movq %rax, (%rbp)
movq %r14, (%r12)
leaq -0x2(%r13), %rax
movq 0x10(%rsp), %rcx
movq %rax, (%rcx)
movq %r13, %rdi
movq %rbp, %rsi
xorl %edx, %edx
callq 0xd5cf
decl %eax
movq (%rsp), %rcx
movl %eax, (%rcx)
movq (%rbp), %r15
cmpq %r15, %r13
je 0xf25c
cmpb $0x0, (%r15)
je 0xf233
cmpb $0x0, 0x1(%r15)
je 0xf233
incq %r15
leaq 0x8(%rsp), %r14
xorl %ebp, %ebp
movq %r15, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0xd5cf
cmpq (%r14), %r15
movq (%rsp), %rcx
je 0xf24d
decl %eax
movl %eax, 0x4(%rcx)
jmp 0xf23c
movq (%rsp), %rcx
movl %eax, 0x4(%rcx)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl (%rcx), %eax
movl %eax, 0x4(%rcx)
jmp 0xf23c
decq %r13
movq %r13, 0x8(%rsp)
movq 0x43d85(%rip), %rax     # 0x52fe8
movq (%rax), %rdi
leaq 0x315ec(%rip), %rsi     # 0x40859
movq %rbx, %rdx
xorl %eax, %eax
callq 0x37f0
pushq $-0x2
popq %rbp
jmp 0xf23c
// File: /workspace/github_c_makefile_star2_O2/zhou-lab[P]tbmate/htslib/regidx.c
// Function: regidx_destroy
void regidx_destroy(regidx_t *idx)
{
    int i, j;
    for (i=0; i<idx->nseq; i++)
    {
        reglist_t *list = &idx->seq[i];
        if ( idx->free )
        {
            for (j=0; j<list->nregs; j++)
                idx->free(list->payload + idx->payload_size*j);
        }
        free(list->payload);
        free(list->regs);
        free(list->idx);
    }
    free(idx->seq_names);
    free(idx->seq);
    free(idx->str.s);
    free(idx->payload);
    khash_str2int_destroy_free(idx->seq2regs);
    free(idx);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
xorl %r14d, %r14d
movslq (%rbx), %rax
cmpq %rax, %r14
jge 0xf3ef
imulq $0x28, %r14, %r15
addq 0x8(%rbx), %r15
cmpq $0x0, 0x20(%rbx)
je 0xf3d0
xorl %ebp, %ebp
cmpl 0xc(%r15), %ebp
jge 0xf3d0
movslq 0x5c(%rbx), %rax
movslq %ebp, %rdi
imulq %rax, %rdi
addq 0x20(%r15), %rdi
callq *0x20(%rbx)
incl %ebp
jmp 0xf3b4
movq 0x20(%r15), %rdi
callq 0x3370
movq 0x18(%r15), %rdi
callq 0x3370
movq (%r15), %rdi
callq 0x3370
incq %r14
jmp 0xf39b
movq 0x18(%rbx), %rdi
callq 0x3370
movq 0x8(%rbx), %rdi
callq 0x3370
movq 0x48(%rbx), %rdi
callq 0x3370
movq 0x60(%rbx), %rdi
callq 0x3370
movq 0x10(%rbx), %r14
testq %r14, %r14
je 0xf47d
xorl %r15d, %r15d
xorl %r12d, %r12d
movl (%r14), %eax
cmpq %rax, %r12
jae 0xf45a
movq 0x10(%r14), %rax
movq %r12, %rcx
shrq $0x4, %rcx
movl (%rax,%rcx,4), %eax
movl %r15d, %ecx
andb $0x1e, %cl
shrl %cl, %eax
testb $0x3, %al
jne 0xf451
movq 0x18(%r14), %rax
movq (%rax,%r12,8), %rdi
callq 0x3370
incq %r12
addl $0x2, %r15d
jmp 0xf422
movq 0x18(%r14), %rdi
callq 0x3370
movq 0x10(%r14), %rdi
callq 0x3370
movq 0x20(%r14), %rdi
callq 0x3370
movq %r14, %rdi
callq 0x3370
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x3370
// File: /workspace/github_c_makefile_star2_O2/zhou-lab[P]tbmate/htslib/regidx.c
// Function: regidx_overlap
int regidx_overlap(regidx_t *idx, const char *chr, uint32_t from, uint32_t to, regitr_t *itr)
{
    if ( itr ) itr->i = itr->n = 0;

    int iseq;
    if ( khash_str2int_get(idx->seq2regs, chr, &iseq)!=0 ) return 0; // no such sequence

    reglist_t *list = &idx->seq[iseq];
    if ( !list->nregs ) return 0;

    int i, ibeg = from>>LIDX_SHIFT; 
    int ireg = ibeg < list->nidx ? list->idx[ibeg] : list->idx[ list->nidx - 1 ];
    if ( ireg < 0 )
    {
        // linear search; if slow, replace with binary search
        if ( ibeg > list->nidx ) ibeg = list->nidx;
        for (i=ibeg - 1; i>=0; i--)
            if ( list->idx[i] >=0 ) break;
        ireg = i>=0 ? list->idx[i] : 0;
    }
    for (i=ireg; i<list->nregs; i++)
    {
        if ( list->regs[i].start > to ) return 0;   // no match
        if ( list->regs[i].end >= from && list->regs[i].start <= to ) break; // found
    }

    if ( i>=list->nregs ) return 0;   // no match

    if ( !itr ) return 1;

    itr->i = 0;
    itr->n = list->nregs - i;
    itr->reg = &idx->seq[iseq].regs[i];
    if ( idx->payload_size )
        itr->payload = idx->seq[iseq].payload + i*idx->payload_size;
    else
        itr->payload = NULL;

    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %r8, %rbx
movl %ecx, %ebp
movl %edx, %r15d
movq %rdi, %r14
testq %r8, %r8
je 0xf4ad
andq $0x0, (%rbx)
movq 0x10(%r14), %rdi
leaq 0xc(%rsp), %rdx
callq 0xe839
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
je 0xf4d0
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%r14), %rcx
movslq 0xc(%rsp), %rdx
imulq $0x28, %rdx, %rdx
movl 0xc(%rcx,%rdx), %esi
testl %esi, %esi
je 0xf4c3
leaq (%rcx,%rdx), %rdi
movl %r15d, %r8d
shrl $0xd, %r8d
movslq 0x8(%rdi), %r11
cmpl %r11d, %r8d
movq (%rdi), %r9
leaq (%r9,%r8,4), %r10
leaq -0x4(%r9,%r11,4), %r12
cmovlq %r10, %r12
movl (%r12), %r10d
testl %r10d, %r10d
jns 0xf52e
cmpl %r11d, %r8d
cmovgel %r11d, %r8d
testl %r8d, %r8d
jle 0xf52b
movl -0x4(%r9,%r8,4), %r10d
decq %r8
testl %r10d, %r10d
js 0xf517
jmp 0xf52e
xorl %r10d, %r10d
movl %r10d, %r8d
movl %esi, %r10d
subl %r8d, %r10d
jle 0xf4c3
movq 0x18(%rdi), %r9
cmpl %ebp, (%r9,%r8,8)
ja 0xf4c3
cmpl %r15d, 0x4(%r9,%r8,8)
jae 0xf54f
incq %r8
jmp 0xf531
pushq $0x1
popq %rax
testq %rbx, %rbx
je 0xf4c3
andl $0x0, (%rbx)
movl %r10d, 0x4(%rbx)
movl %r8d, %esi
leaq (%r9,%rsi,8), %rsi
movq %rsi, 0x8(%rbx)
movl 0x5c(%r14), %esi
testl %esi, %esi
je 0xf583
imull %r8d, %esi
movslq %esi, %rsi
addq 0x20(%rcx,%rdx), %rsi
jmp 0xf585
xorl %esi, %esi
movq %rsi, 0x10(%rbx)
jmp 0xf4c3
// File: /workspace/github_c_makefile_star2_O2/zhou-lab[P]tbmate/htslib/bgzf.c
// Function: inflate_gzip_block
static int inflate_gzip_block(BGZF *fp, int cached)
{
    int ret = Z_OK;
    do
    {
        if ( !cached && fp->gz_stream->avail_out!=0 )
        {
            fp->gz_stream->avail_in = hread(fp->fp, fp->compressed_block, BGZF_BLOCK_SIZE);
            if ( fp->gz_stream->avail_in<=0 ) return fp->gz_stream->avail_in;
            if ( fp->gz_stream->avail_in==0 ) break;
            fp->gz_stream->next_in = fp->compressed_block;
        }
        else cached = 0;
        do
        {
            fp->gz_stream->next_out = (Bytef*)fp->uncompressed_block + fp->block_offset;
            fp->gz_stream->avail_out = BGZF_MAX_BLOCK_SIZE - fp->block_offset;
            fp->gz_stream->msg = NULL;
            ret = inflate(fp->gz_stream, Z_NO_FLUSH);
            if ( ret==Z_BUF_ERROR ) continue;   // non-critical error
            if ( ret<0 ) {
                if (hts_verbose >= 1) {
                    fprintf(stderr, "[E::%s] inflate failed: %s\n",
                            __func__,
                            bgzf_zerr(ret, ret == Z_DATA_ERROR ? fp->gz_stream : NULL));
                }
                fp->errcode |= BGZF_ERR_ZLIB;
                return -1;
            }
            unsigned int have = BGZF_MAX_BLOCK_SIZE - fp->gz_stream->avail_out;
            if ( have ) return have;
        }
        while ( fp->gz_stream->avail_out == 0 );
    }
    while (ret != Z_STREAM_END);
    return BGZF_MAX_BLOCK_SIZE - fp->gz_stream->avail_out;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x58(%rdi), %rdi
testl %esi, %esi
jne 0x20e13
cmpl $0x0, 0x20(%rdi)
sete %dl
testb $0x1, %dl
jne 0x20e13
movq 0x28(%rbx), %rsi
movq 0x38(%rbx), %rdi
movl $0xff00, %edx           # imm = 0xFF00
callq 0x20d72
movq 0x58(%rbx), %rdi
movl %eax, 0x8(%rdi)
testl %eax, %eax
je 0x20e80
movq 0x28(%rbx), %rax
movq %rax, (%rdi)
movslq 0xc(%rbx), %rax
movl $0x10000, %ecx          # imm = 0x10000
subl %eax, %ecx
addq 0x20(%rbx), %rax
movq %rax, 0x18(%rdi)
movl %ecx, 0x20(%rdi)
andq $0x0, 0x30(%rdi)
xorl %esi, %esi
callq 0x3310
cmpl $-0x5, %eax
jne 0x20e4e
movq 0x58(%rbx), %rdi
movl 0x20(%rdi), %edx
testl %edx, %edx
je 0x20e13
movl $0x10000, %ecx          # imm = 0x10000
subl %edx, %ecx
jmp 0x20e63
testl %eax, %eax
js 0x20e6c
movq 0x58(%rbx), %rdi
movl 0x20(%rdi), %edx
xorl %ecx, %ecx
cmpl $0x10000, %edx          # imm = 0x10000
jne 0x20e84
xorl %edx, %edx
cmpl $0x1, %eax
jne 0x20dea
jmp 0x20e8b
leaq 0x3261d(%rip), %rcx     # 0x53490
cmpl $0x0, (%rcx)
jg 0x20e95
orb $0x1, (%rbx)
pushq $-0x1
popq %rcx
jmp 0x20e8b
xorl %ecx, %ecx
jmp 0x20e8b
movl $0x10000, %ecx          # imm = 0x10000
subl %edx, %ecx
movl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x3214c(%rip), %rcx     # 0x52fe8
movq (%rcx), %r14
cmpl $-0x3, %eax
jne 0x20eaa
movq 0x58(%rbx), %rsi
jmp 0x20eac
xorl %esi, %esi
movl %eax, %edi
callq 0x20481
leaq 0x2124c(%rip), %rsi     # 0x42106
leaq 0x21261(%rip), %rdx     # 0x42122
movq %r14, %rdi
movq %rax, %rcx
xorl %eax, %eax
callq 0x37f0
jmp 0x20e78
// File: /workspace/github_c_makefile_star2_O2/zhou-lab[P]tbmate/htslib/bgzf.c
// Function: bgzf_read
ssize_t bgzf_read(BGZF *fp, void *data, size_t length)
{
    ssize_t bytes_read = 0;
    uint8_t *output = (uint8_t*)data;
    if (length <= 0) return 0;
    assert(fp->is_write == 0);
    while (bytes_read < length) {
        int copy_length, available = fp->block_length - fp->block_offset;
        uint8_t *buffer;
        if (available <= 0) {
            int ret = bgzf_read_block(fp);
            if (ret != 0) {
                if (hts_verbose >= 2) {
                    fprintf(stderr, "[E::%s] bgzf_read_block error %d after %zd of %zu bytes\n", __func__, ret, bytes_read, length);
                }
                fp->errcode |= BGZF_ERR_ZLIB;
                return -1;
            }
            available = fp->block_length - fp->block_offset;
            if (available <= 0) break;
        }
        copy_length = length - bytes_read < available? length - bytes_read : available;
        buffer = (uint8_t*)fp->uncompressed_block;
        memcpy(output, buffer + fp->block_offset, copy_length);
        fp->block_offset += copy_length;
        output += copy_length;
        bytes_read += copy_length;
    }
    if (fp->block_offset == fp->block_length) {
        fp->block_address = htell(fp->fp);
        fp->block_offset = fp->block_length = 0;
    }
    fp->uncompressed_address += bytes_read;
    return bytes_read;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdx, %rdx
je 0x20fdf
movq %rdi, %rbx
testb $0x3, 0x2(%rdi)
jne 0x2105c
movq %rdx, %rbp
movq %rsi, %r12
movl 0xc(%rbx), %eax
xorl %r14d, %r14d
movq %rbp, %r15
movl 0x8(%rbx), %ecx
subq %r14, %r15
jbe 0x20fec
subl %eax, %ecx
jg 0x20fa7
movq %rbx, %rdi
callq 0x20506
testl %eax, %eax
jne 0x2100e
movl 0x8(%rbx), %ecx
movl 0xc(%rbx), %eax
subl %eax, %ecx
jle 0x20fda
movl %ecx, %r13d
cmpq %r13, %r15
cmovbq %r15, %r13
movslq %eax, %rsi
addq 0x20(%rbx), %rsi
movq %r12, %rdi
movq %r13, %rdx
callq 0x3860
movl 0xc(%rbx), %eax
addl %r13d, %eax
movl %eax, 0xc(%rbx)
addq %r13, %r12
addq %r13, %r14
xorl %ecx, %ecx
testl %ecx, %ecx
je 0x20f82
jmp 0x20fe4
pushq $0x3
popq %rcx
jmp 0x20fd4
xorl %r14d, %r14d
jmp 0x21021
cmpl $0x3, %ecx
jne 0x2101d
movl 0x8(%rbx), %ecx
cmpl %ecx, %eax
jne 0x21008
movq 0x38(%rbx), %rax
movq 0x28(%rax), %rcx
addq 0x8(%rax), %rcx
subq (%rax), %rcx
movq %rcx, 0x10(%rbx)
andq $0x0, 0x8(%rbx)
addq %r14, 0x18(%rbx)
jmp 0x21021
leaq 0x3247b(%rip), %rcx     # 0x53490
cmpl $0x2, (%rcx)
jge 0x21033
orb $0x1, (%rbx)
pushq $-0x1
popq %r14
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x31fae(%rip), %rcx     # 0x52fe8
movq (%rcx), %rdi
leaq 0x20d86(%rip), %rsi     # 0x41dca
leaq 0x20db8(%rip), %rdx     # 0x41e03
movl %eax, %ecx
movq %r14, %r8
movq %rbp, %r9
xorl %eax, %eax
callq 0x37f0
jmp 0x2101a
leaq 0x20d2b(%rip), %rdi     # 0x41d8e
leaq 0x20beb(%rip), %rsi     # 0x41c55
leaq 0x20d2f(%rip), %rcx     # 0x41da0
movl $0x2b2, %edx            # imm = 0x2B2
callq 0x3180
// File: /workspace/github_c_makefile_star2_O2/zhou-lab[P]tbmate/htslib/bgzf.c
// Function: bgzf_flush
int bgzf_flush(BGZF *fp)
{
    if (!fp->is_write) return 0;
#ifdef BGZF_MT
    if (fp->mt) {
        if (fp->block_offset) mt_queue(fp); // guaranteed that assertion does not fail
        return mt_flush_queue(fp);
    }
#endif
    while (fp->block_offset > 0) {
        int block_length;
        if ( fp->idx_build_otf )
        {
            bgzf_index_add_block(fp);
            fp->idx->ublock_addr += fp->block_offset;
        }
        block_length = deflate_block(fp, fp->block_offset);
        if (block_length < 0) {
            if (hts_verbose >= 3) fprintf(stderr, "[E::%s] deflate_block error %d\n", __func__, block_length);
            return -1;
        }
        if (hwrite(fp->fp, fp->compressed_block, block_length) != block_length) {
            if (hts_verbose >= 1) fprintf(stderr, "[E::%s] hwrite error (wrong size)\n", __func__);
            fp->errcode |= BGZF_ERR_IO; // possibly truncated file
            return -1;
        }
        fp->block_address += block_length;
    }
    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
xorl %ebx, %ebx
testb $0x3, 0x2(%rdi)
je 0x212e1
movq %rdi, %r14
cmpq $0x0, 0x40(%rdi)
je 0x21292
cmpl $0x0, 0xc(%r14)
je 0x21242
movq %r14, %rdi
callq 0x2130a
movq %r14, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x21371
cmpl $0x0, 0x50(%r14)
je 0x2126a
movq %r14, %rdi
callq 0x20ed0
movslq 0xc(%r14), %rsi
movq 0x48(%r14), %rax
addq %rsi, 0x10(%rax)
movq %r14, %rdi
callq 0x2144e
testl %eax, %eax
js 0x2129c
movq 0x28(%r14), %rsi
movq 0x38(%r14), %rdi
movl %eax, %r15d
movq %r15, %rdx
callq 0x21541
cmpq %r15, %rax
jne 0x212ce
addq %r15, 0x10(%r14)
movl 0xc(%r14), %esi
testl %esi, %esi
jg 0x2124f
jmp 0x212e1
leaq 0x321ed(%rip), %rcx     # 0x53490
pushq $-0x1
popq %rbx
cmpl $0x3, (%rcx)
jl 0x212e1
movq 0x31d36(%rip), %rcx     # 0x52fe8
movq (%rcx), %rdi
leaq 0x20b51(%rip), %rsi     # 0x41e0d
leaq 0x20b6a(%rip), %rdx     # 0x41e2d
movl %eax, %ecx
xorl %eax, %eax
callq 0x37f0
jmp 0x212e1
leaq 0x321bb(%rip), %rax     # 0x53490
cmpl $0x0, (%rax)
jg 0x212e9
orb $0x4, (%r14)
pushq $-0x1
popq %rbx
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
movq 0x31cf8(%rip), %rax     # 0x52fe8
movq (%rax), %rdi
leaq 0x20b3e(%rip), %rsi     # 0x41e38
leaq 0x20b2c(%rip), %rdx     # 0x41e2d
xorl %eax, %eax
callq 0x37f0
jmp 0x212da
// File: /workspace/github_c_makefile_star2_O2/zhou-lab[P]tbmate/htslib/bgzf.c
// Function: deflate_block
static int deflate_block(BGZF *fp, int block_length)
{
    size_t comp_size = BGZF_MAX_BLOCK_SIZE;
    int ret;
    if ( !fp->is_gzip )
        ret = bgzf_compress(fp->compressed_block, &comp_size, fp->uncompressed_block, block_length, fp->compress_level);
    else
        ret = bgzf_gzip_compress(fp, fp->compressed_block, &comp_size, fp->uncompressed_block, block_length, fp->compress_level);

    if ( ret != 0 )
    {
        if (hts_verbose >= 3) {
            fprintf(stderr, "[E::%s] compression error %d\n", __func__, ret);
        }
        fp->errcode |= BGZF_ERR_ZLIB;
        return -1;
    }
    fp->block_offset = 0;
    return comp_size;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq $0x10000, (%rsp)        # imm = 0x10000
movl (%rdi), %r8d
movq 0x28(%rdi), %rdi
movq 0x20(%rbx), %rdx
testl %r8d, %r8d
js 0x214b4
movslq %esi, %rcx
shll $0x3, %r8d
sarl $0x17, %r8d
movq %rsp, %rsi
callq 0x202de
testl %eax, %eax
je 0x214f8
leaq 0x32005(%rip), %rax     # 0x53490
cmpl $0x3, (%rax)
jl 0x214f0
movq 0x31b51(%rip), %rax     # 0x52fe8
movq (%rax), %rdi
leaq 0x20d51(%rip), %rsi     # 0x421f2
leaq 0x20d68(%rip), %rdx     # 0x42210
pushq $-0x1
popq %rcx
xorl %eax, %eax
callq 0x37f0
jmp 0x214f0
movq 0x58(%rbx), %r14
xorl %eax, %eax
testl %esi, %esi
sete %al
shll $0x2, %eax
movq %rdx, (%r14)
movl %esi, 0x8(%r14)
movq %rdi, 0x18(%r14)
movl $0x10000, 0x20(%r14)    # imm = 0x10000
movq %r14, %rdi
movl %eax, %esi
callq 0x31f0
cmpl $-0x2, %eax
jne 0x214fe
leaq 0x31fa5(%rip), %rax     # 0x53490
cmpl $0x0, (%rax)
jg 0x21516
orb $0x1, (%rbx)
pushq $-0x1
popq %rax
jmp 0x2150e
movq (%rsp), %rax
jmp 0x2150a
movl 0x20(%r14), %ecx
movl $0x10000, %eax          # imm = 0x10000
subq %rcx, %rax
andl $0x0, 0xc(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x31acb(%rip), %rax     # 0x52fe8
movq (%rax), %rdi
leaq 0x207dc(%rip), %rsi     # 0x41d03
leaq 0x20cf0(%rip), %rdx     # 0x4221e
leaq 0x20b00(%rip), %rcx     # 0x42035
xorl %eax, %eax
callq 0x37f0
jmp 0x21484
// File: /workspace/github_c_makefile_star2_O2/zhou-lab[P]tbmate/htslib/bgzf.c
// Function: worker_aux
static int worker_aux(worker_t *w)
{
    int i, stop = 0;
    // wait for condition: to process or all done
    pthread_mutex_lock(&w->mt->lock);
    while (!w->toproc && !w->mt->done)
        pthread_cond_wait(&w->mt->cv, &w->mt->lock);
    if (w->mt->done) stop = 1;
    w->toproc = 0;
    pthread_mutex_unlock(&w->mt->lock);
    if (stop) return 1; // to quit the thread
    w->errcode = 0;
    for (i = w->i; i < w->mt->curr; i += w->mt->n_threads) {
        size_t clen = BGZF_MAX_BLOCK_SIZE;
        int ret = bgzf_compress(w->buf, &clen, w->mt->blk[i], w->mt->len[i], w->compress_level);
        if (ret != 0) {
            if (hts_verbose >= 2) fprintf(stderr, "[E::%s] bgzf_compress error %d\n", __func__, ret);
            w->errcode |= BGZF_ERR_ZLIB; // Report error
            // We're not going to do any more, so set remaining lengths to 0
            for (; i < w->mt->curr; i += w->mt->n_threads) w->mt->len[i] = 0;
            break; // Give up
        } else {
            memcpy(w->mt->blk[i], w->buf, clen);
            w->mt->len[i] = clen;
        }
    }
    __sync_fetch_and_add(&w->mt->proc_cnt, 1);
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq (%rdi), %rdi
addq $0x38, %rdi
callq 0x37b0
cmpl $0x0, 0x18(%rbx)
movq (%rbx), %rdi
movl 0xc(%rdi), %ebp
jne 0x226ac
leaq 0x38(%rdi), %rsi
testl %ebp, %ebp
jne 0x22730
addq $0x60, %rdi
callq 0x3680
jmp 0x22689
andl $0x0, 0x18(%rbx)
addq $0x38, %rdi
callq 0x3850
testl %ebp, %ebp
jne 0x2273c
andl $0x0, 0x14(%rbx)
movl 0x10(%rbx), %ebp
movq (%rbx), %rax
leaq 0x8(%rsp), %r14
cmpl 0x8(%rax), %ebp
jge 0x22773
movq $0x10000, 0x8(%rsp)     # imm = 0x10000
movq 0x8(%rbx), %rdi
movslq %ebp, %r12
movq 0x18(%rax), %rcx
movq 0x20(%rax), %rax
movq (%rcx,%r12,8), %rdx
movslq (%rax,%r12,4), %rcx
movl 0x1c(%rbx), %r8d
movq %r14, %rsi
callq 0x202de
testl %eax, %eax
jne 0x2274c
movq (%rbx), %rax
movq 0x8(%rbx), %rsi
movq 0x18(%rax), %rax
movq (%rax,%r12,8), %rdi
movq 0x8(%rsp), %r15
movq %r15, %rdx
callq 0x3860
movq (%rbx), %rax
movq 0x20(%rax), %rcx
movl %r15d, (%rcx,%r12,4)
addl (%rax), %ebp
jmp 0x226cc
andl $0x0, 0x18(%rbx)
movq %rsi, %rdi
callq 0x3850
pushq $0x1
popq %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x30d3d(%rip), %rax     # 0x53490
cmpl $0x2, (%rax)
jge 0x2277b
orb $0x1, 0x14(%rbx)
movq (%rbx), %rax
cmpl 0x8(%rax), %ebp
jge 0x22773
movq 0x20(%rax), %rcx
movslq %ebp, %rdx
andl $0x0, (%rcx,%rdx,4)
addl (%rax), %ebp
jmp 0x2275f
lock
incl 0x10(%rax)
xorl %eax, %eax
jmp 0x2273f
movq 0x30866(%rip), %rax     # 0x52fe8
movq (%rax), %rdi
leaq 0x1fa0f(%rip), %rsi     # 0x4219b
leaq 0x1fa28(%rip), %rdx     # 0x421bb
pushq $-0x1
popq %rcx
xorl %eax, %eax
callq 0x37f0
jmp 0x22758
nop
// File: /workspace/github_c_makefile_star2_O2/zhou-lab[P]tbmate/htslib/hfile.c
// Function: hfile_exit
static void hfile_exit()
{
    pthread_mutex_lock(&plugins_lock);

    kh_destroy(scheme_string, schemes);

    while (plugins != NULL) {
        struct hFILE_plugin_list *p = plugins;
        if (p->plugin.destroy) p->plugin.destroy();
#ifdef ENABLE_PLUGINS
        if (p->plugin.obj) close_plugin(p->plugin.obj);
#endif
        plugins = p->next;
        free(p);
    }

    pthread_mutex_unlock(&plugins_lock);
    pthread_mutex_destroy(&plugins_lock);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0x2e677(%rip), %rdi     # 0x53578
callq 0x37b0
movq 0x2e663(%rip), %rbx     # 0x53570
testq %rbx, %rbx
je 0x24f35
movq 0x18(%rbx), %rdi
callq 0x3370
movq 0x10(%rbx), %rdi
callq 0x3370
movq 0x20(%rbx), %rdi
callq 0x3370
movq %rbx, %rdi
callq 0x3370
movq 0x2e664(%rip), %rbx     # 0x535a0
testq %rbx, %rbx
je 0x24f64
movq 0x18(%rbx), %rax
testq %rax, %rax
je 0x24f4c
callq *%rax
movq 0x20(%rbx), %r14
movq %r14, 0x2e649(%rip)     # 0x535a0
movq %rbx, %rdi
callq 0x3370
movq %r14, %rbx
jmp 0x24f3c
leaq 0x2e60d(%rip), %rbx     # 0x53578
movq %rbx, %rdi
callq 0x3850
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3800
nop
// File: /workspace/github_c_makefile_star2_O2/zhou-lab[P]tbmate/htslib/hfile_net.c
// Function: hfile_plugin_init_net
int hfile_plugin_init_net(struct hFILE_plugin *self)
{
    static const struct hFILE_scheme_handler handler =
        { hopen_net, hfile_always_remote, "knetfile", 0 };

    self->name = "knetfile";
    hfile_add_scheme_handler("http", &handler);
    hfile_add_scheme_handler("ftp",  &handler);
    return 0;
}

// Assembly:
pushq %rbx
leaq 0x1d74c(%rip), %rax     # 0x4274c
movq %rax, 0x10(%rdi)
leaq 0x1d7d3(%rip), %rdi     # 0x427de
leaq 0x2dcb6(%rip), %rbx     # 0x52cc8
movq %rbx, %rsi
callq 0x2440a
leaq 0x1d7c2(%rip), %rdi     # 0x427e3
movq %rbx, %rsi
callq 0x2440a
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/zhou-lab[P]tbmate/htslib/sam.c
// Function: bam_plp_destroy
void bam_plp_destroy(bam_plp_t iter)
{
    lbnode_t *p, *pnext;
    if ( iter->overlaps ) kh_destroy(olap_hash, iter->overlaps);
    for (p = iter->head; p != NULL; p = pnext) {
        pnext = p->next;
        mp_free(iter->mp, p);
    }
    mp_destroy(iter->mp);
    if (iter->b) bam_destroy1(iter->b);
    free(iter->plp);
    free(iter);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x60(%rdi), %r14
testq %r14, %r14
je 0x297d0
movq 0x18(%r14), %rdi
callq 0x3370
movq 0x10(%r14), %rdi
callq 0x3370
movq 0x20(%r14), %rdi
callq 0x3370
movq %r14, %rdi
callq 0x3370
movq 0x8(%rbx), %rsi
testq %rsi, %rsi
je 0x297ea
movq 0x50(%rsi), %r14
movq (%rbx), %rdi
callq 0x2984d
movq %r14, %rsi
jmp 0x297d4
movq (%rbx), %r14
xorl %r15d, %r15d
movslq 0x4(%r14), %rax
movq 0x10(%r14), %rdi
cmpq %rax, %r15
jge 0x2981c
movq (%rdi,%r15,8), %rax
movq 0x28(%rax), %rdi
callq 0x3370
movq 0x10(%r14), %rax
movq (%rax,%r15,8), %rdi
callq 0x3370
incq %r15
jmp 0x297f0
callq 0x3370
movq %r14, %rdi
callq 0x3370
movq 0x48(%rbx), %rdi
testq %rdi, %rdi
je 0x29837
callq 0x261cc
movq 0x40(%rbx), %rdi
callq 0x3370
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x3370
// File: /workspace/github_c_makefile_star2_O2/zhou-lab[P]tbmate/htslib/knetfile.c
// Function: knet_read
ssize_t knet_read(knetFile *fp, void *buf, size_t len)
{
	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 0x3af67
movq %rdx, %r14
movq %rsi, %r15
movl (%rbx), %eax
cmpl $0x3, %eax
je 0x3af6c
cmpl $0x2, %eax
jne 0x3af7c
cmpl $0x0, 0x40(%rbx)
jne 0x3afbd
cmpl $0x0, 0x3c(%rbx)
jne 0x3af5d
movq %rbx, %rdi
callq 0x3a69d
movq %rbx, %rdi
callq 0x3a7f9
jmp 0x3af7a
xorl %r13d, %r13d
jmp 0x3afd2
cmpl $0x0, 0x40(%rbx)
jne 0x3afbd
movq %rbx, %rdi
callq 0x3ab55
movl (%rbx), %eax
cmpl $0x1, %eax
jne 0x3afba
xorl %r12d, %r12d
pushq $-0x1
popq %r13
testq %r14, %r14
je 0x3afcb
leaq (%r15,%r12), %rbp
movl 0x4(%rbx), %edi
movq %rbp, %rsi
movq %r14, %rdx
callq 0x3220
testq %rax, %rax
jns 0x3afb0
callq 0x35e0
cmpl $0x4, (%rax)
je 0x3af91
jmp 0x3afd2
je 0x3afcb
addq %rax, %r12
subq %rax, %r14
jmp 0x3af88
movl 0x4(%rbx), %edi
movq %r15, %rsi
movq %r14, %rdx
callq 0x3ad5b
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/zhou-lab[P]tbmate/htslib/knetfile.c
// Function: knet_seek
off_t knet_seek(knetFile *fp, off_t off, int whence)
{
	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 0x3affc
cmpq %rax, 0x8(%rbx)
jne 0x3affc
xorl %eax, %eax
jmp 0x3b0ba
movl (%rbx), %ecx
cmpl $0x3, %ecx
je 0x3b02b
cmpl $0x2, %ecx
je 0x3b03b
cmpl $0x1, %ecx
jne 0x3b05d
movl 0x4(%rbx), %edi
movq %rax, %rsi
callq 0x3540
cmpq $-0x1, %rax
je 0x3b0b7
movq %rax, 0x8(%rbx)
jmp 0x3b0ba
cmpl $0x1, %edx
je 0x3b040
cmpl $0x2, %edx
je 0x3b090
testl %edx, %edx
jne 0x3b0b7
jmp 0x3b044
cmpl $0x1, %edx
jne 0x3b04e
addq 0x8(%rbx), %rax
movq %rax, 0x8(%rbx)
andl $0x0, 0x40(%rbx)
jmp 0x3b0ba
testl %edx, %edx
je 0x3b044
cmpl $0x2, %edx
jne 0x3b0b7
addq 0x68(%rbx), %rax
jmp 0x3b044
callq 0x35e0
movl $0x16, (%rax)
movq 0x17f79(%rip), %rax     # 0x52fe8
movq (%rax), %rbx
pushq $0x16
popq %rdi
callq 0x34e0
leaq 0x8d94(%rip), %rsi      # 0x43e15
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x37f0
jmp 0x3b0b7
movq 0x17f51(%rip), %rax     # 0x52fe8
movq (%rax), %rcx
leaq 0x8d2e(%rip), %rdi      # 0x43dcf
pushq $0x45
popq %rsi
pushq $0x1
popq %rdx
callq 0x3780
callq 0x35e0
movl $0x1d, (%rax)
pushq $-0x1
popq %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/zhou-lab[P]tbmate/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;

	if (out)
	    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++)
		get_bits_MSB(in, c->beta.nbits);
    } else {
	if (out)
	    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, %r12
movq %rcx, %r14
movq %rsi, %rbx
movl 0x34(%rsi), %esi
testl %esi, %esi
je 0x3bbe9
movq %rdx, %r15
movq %rdx, %rdi
callq 0x3b916
testl %eax, %eax
je 0x3bc13
pushq $-0x1
popq %r12
jmp 0x3bc5a
testq %r14, %r14
je 0x3bc57
movl (%r12), %eax
xorl %r12d, %r12d
testl %eax, %eax
cmovlel %r12d, %eax
xorl %ecx, %ecx
cmpq %rcx, %rax
je 0x3bc5a
movb 0x30(%rbx), %dl
xorl %esi, %esi
subb %dl, %sil
movb %sil, (%r14,%rcx)
incq %rcx
jmp 0x3bbfd
movl (%r12), %eax
xorl %ebp, %ebp
testl %eax, %eax
cmovgl %eax, %ebp
testq %r14, %r14
je 0x3bc52
movl %ebp, %r13d
xorl %r12d, %r12d
xorl %ebp, %ebp
cmpq %rbp, %r13
je 0x3bc5a
movl 0x34(%rbx), %esi
movq %r15, %rdi
callq 0x3b952
subl 0x30(%rbx), %eax
movb %al, (%r14,%rbp)
incq %rbp
jmp 0x3bc2b
movl 0x34(%rbx), %esi
movq %r15, %rdi
callq 0x3b952
subl $0x1, %ebp
jae 0x3bc47
xorl %r12d, %r12d
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/zhou-lab[P]tbmate/htslib/cram/cram_codecs.c
// Function: cram_decoder_init
cram_codec *cram_decoder_init(enum cram_encoding codec,
			      char *data, int size,
			      enum cram_external_type option,
			      int version) {
    if (codec >= E_NULL && codec < E_NUM_CODECS && decode_init[codec]) {
	return decode_init[codec](data, size, option, version);
    } else {
	fprintf(stderr, "Unimplemented codec of type %s\n", cram_encoding2str(codec));
	return NULL;
    }
}

// Assembly:
cmpl $0x9, %edi
ja 0x3d9c4
movl $0x105, %eax            # imm = 0x105
btq %rdi, %rax
jb 0x3d9c4
movl %edi, %eax
leaq 0x1533a(%rip), %r9      # 0x52cf0
movq %rsi, %rdi
movl %edx, %esi
movl %ecx, %edx
movl %r8d, %ecx
jmpq *(%r9,%rax,8)
pushq %rbx
movq 0x1561c(%rip), %rax     # 0x52fe8
movq (%rax), %rbx
callq 0x3e66d
leaq 0x6899(%rip), %rsi      # 0x44274
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x37f0
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/zhou-lab[P]tbmate/htslib/cram/cram_codecs.c
// Function: cram_encoder_init
cram_codec *cram_encoder_init(enum cram_encoding codec,
			      cram_stats *st,
			      enum cram_external_type option,
			      void *dat,
			      int version) {
    if (st && !st->nvals)
	return NULL;

    if (encode_init[codec]) {
	cram_codec *r;
	if ((r = encode_init[codec](st, option, dat, version)))
	    r->out = NULL;
	return r;
    } else {
	fprintf(stderr, "Unimplemented codec of type %s\n", cram_encoding2str(codec));
	abort();
    }
}

// Assembly:
pushq %rbx
testq %rsi, %rsi
je 0x3dd61
cmpl $0x0, 0x100c(%rsi)
je 0x3dd90
movl $0x385, %eax            # imm = 0x385
btq %rdi, %rax
jb 0x3dd94
movl %edi, %eax
leaq 0x14fcb(%rip), %r9      # 0x52d40
movq %rsi, %rdi
movl %edx, %esi
movq %rcx, %rdx
movl %r8d, %ecx
callq *(%r9,%rax,8)
testq %rax, %rax
je 0x3dd90
andq $0x0, 0x8(%rax)
jmp 0x3dd92
xorl %eax, %eax
popq %rbx
retq
movq 0x1524d(%rip), %rax     # 0x52fe8
movq (%rax), %rbx
callq 0x3e66d
leaq 0x64ca(%rip), %rsi      # 0x44274
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x37f0
callq 0x3100
// File: /workspace/github_c_makefile_star2_O2/zhou-lab[P]tbmate/htslib/cram/cram_codecs.c
// Function: cram_byte_array_stop_decode_char
static int cram_byte_array_stop_decode_char(cram_slice *slice, cram_codec *c,
					    cram_block *in, char *out,
					    int *out_size) {
    cram_block *b = NULL;
    char *cp, ch;

    b = cram_get_block_by_id(slice, c->byte_array_stop.content_id);
    if (!b)
        return *out_size?-1:0;

    if (b->idx >= b->uncomp_size)
	return -1;

    cp = (char *)b->data + b->idx;
    if (out) {
	while ((ch = *cp) != (char)c->byte_array_stop.stop) {
	    if (cp - (char *)b->data >= b->uncomp_size)
		return -1;
	    *out++ = ch;
	    cp++;
	}
    } else {
	// Consume input, but produce no output
	while ((ch = *cp) != (char)c->byte_array_stop.stop) {
	    if (cp - (char *)b->data >= b->uncomp_size)
		return -1;
	    cp++;
	}
    }

    *out_size = cp - (char *)(b->data + b->idx);
    b->idx = cp - (char *)b->data + 1;

    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %r8, %rbx
movq %rcx, %r15
movq %rsi, %r14
movl 0x34(%rsi), %esi
callq 0x3b19b
testq %rax, %rax
je 0x3e194
movslq 0x1c(%rax), %rdi
movslq 0x14(%rax), %r8
pushq $-0x1
popq %rcx
cmpl %r8d, %edi
jge 0x3e1d0
movq 0x20(%rax), %rsi
testq %r15, %r15
je 0x3e19c
leaq (%rsi,%rdi), %rdx
addq %rdi, %rsi
movq %rsi, %rdi
movb (%rdx), %r8b
movq 0x20(%rax), %rsi
cmpb 0x30(%r14), %r8b
je 0x3e1b3
movq %rdi, %r9
subq %rsi, %r9
movslq 0x14(%rax), %rsi
cmpq %rsi, %r9
jge 0x3e1d0
movb %r8b, (%r15)
incq %r15
incq %rdx
incq %rdi
jmp 0x3e16a
xorl %ecx, %ecx
cmpl (%rbx), %ecx
sbbl %ecx, %ecx
jmp 0x3e1d0
movb 0x30(%r14), %r9b
movq %rdi, %rdx
cmpb %r9b, (%rsi,%rdx)
je 0x3e1b9
cmpq %r8, %rdx
jge 0x3e1d0
incq %rdx
jmp 0x3e1a3
movslq 0x1c(%rax), %rdi
jmp 0x3e1bc
addq %rsi, %rdx
movq %rsi, %rcx
addl %edi, %esi
movl %edx, %edi
subl %esi, %edi
movl %edi, (%rbx)
subl %ecx, %edx
incl %edx
movl %edx, 0x1c(%rax)
xorl %ecx, %ecx
movl %ecx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/baskerville[P]bspwm/src/bspwm.c
// Function: sig_handler
void sig_handler(int sig)
{
	if (sig == SIGCHLD) {
		signal(sig, sig_handler);
		while (waitpid(-1, 0, WNOHANG) > 0)
			;
	} else if (sig == SIGINT || sig == SIGHUP || sig == SIGTERM) {
		running = false;
	}
}

// Assembly:
leal -0x1(%rdi), %eax
cmpl $0x2, %eax
jb 0x5959
cmpl $0xf, %edi
je 0x5959
cmpl $0x11, %edi
jne 0x5960
pushq %rbp
pushq %rbx
pushq %rax
leaq -0x1c(%rip), %rsi       # 0x5919
pushq $0x11
popq %rdi
callq 0x4070
pushq $-0x1
popq %rbx
pushq $0x1
popq %rbp
movl %ebx, %edi
xorl %esi, %esi
movl %ebp, %edx
callq 0x4750
testl %eax, %eax
jg 0x5943
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movb $0x0, 0x22d70(%rip)     # 0x286d0
retq
// File: /workspace/github_c_makefile_star2_O2/baskerville[P]bspwm/src/bspwm.c
// Function: cleanup
void cleanup(void)
{
	mon = NULL;

	while (mon_head != NULL) {
		remove_monitor(mon_head);
	}
	while (rule_head != NULL) {
		remove_rule(rule_head);
	}
	while (subscribe_head != NULL) {
		remove_subscriber(subscribe_head);
	}
	while (pending_rule_head != NULL) {
		remove_pending_rule(pending_rule_head);
	}

	empty_history();
}

// Assembly:
pushq %rax
andq $0x0, 0x22da6(%rip)     # 0x28710
movq 0x22d97(%rip), %rdi     # 0x28708
testq %rdi, %rdi
je 0x5982
callq 0x7194
jmp 0x596a
callq 0x1b69a
movq 0x22daf(%rip), %rdi     # 0x28738
testq %rdi, %rdi
jne 0x597d
jmp 0x5995
callq 0x1cd54
movq 0x22dbc(%rip), %rdi     # 0x28758
testq %rdi, %rdi
jne 0x5990
jmp 0x59a8
callq 0x1b8a1
movq 0x22d29(%rip), %rdi     # 0x286d8
testq %rdi, %rdi
jne 0x59a3
popq %rax
jmp 0xcc84
// File: /workspace/github_c_makefile_star2_O2/baskerville[P]bspwm/src/bspwm.c
// Function: init
void init(void)
{
	clients_count = 0;
	mon = mon_head = mon_tail = pri_mon = NULL;
	history_head = history_tail = history_needle = NULL;
	rule_head = rule_tail = NULL;
	stack_head = stack_tail = NULL;
	subscribe_head = subscribe_tail = NULL;
	pending_rule_head = pending_rule_tail = NULL;
	auto_raise = sticky_still = hide_sticky = record_history = true;
	randr_base = 0;
	exit_status = 0;
	restart = false;
}

// Assembly:
andl $0x0, 0x22d1c(%rip)     # 0x286f4
andq $0x0, 0x22d18(%rip)     # 0x286f8
andq $0x0, 0x22d18(%rip)     # 0x28700
andq $0x0, 0x22d18(%rip)     # 0x28708
andq $0x0, 0x22d18(%rip)     # 0x28710
andq $0x0, 0x22d18(%rip)     # 0x28718
andq $0x0, 0x22d18(%rip)     # 0x28720
andq $0x0, 0x22d18(%rip)     # 0x28728
andq $0x0, 0x22d18(%rip)     # 0x28730
andq $0x0, 0x22d18(%rip)     # 0x28738
andq $0x0, 0x22d18(%rip)     # 0x28740
andq $0x0, 0x22d18(%rip)     # 0x28748
andq $0x0, 0x22d18(%rip)     # 0x28750
andq $0x0, 0x22d18(%rip)     # 0x28758
andq $0x0, 0x22d18(%rip)     # 0x28760
andq $0x0, 0x22c88(%rip)     # 0x286d8
movb $0x1, %al
movb %al, 0x22d10(%rip)      # 0x28768
movb %al, 0x22d0b(%rip)      # 0x28769
movb %al, 0x22d06(%rip)      # 0x2876a
movb %al, 0x22d01(%rip)      # 0x2876b
leaq 0x2339f(%rip), %rax     # 0x28e10
xorl %ecx, %ecx
movb %cl, (%rax)
andl $0x0, 0x22c74(%rip)     # 0x286f0
movb %cl, 0x22c5e(%rip)      # 0x286e0
retq
// File: /workspace/github_c_makefile_star2_O2/baskerville[P]bspwm/src/bspwm.c
// Function: register_events
void register_events(void)
{
	uint32_t values[] = {ROOT_EVENT_MASK};
	xcb_generic_error_t *e = xcb_request_check(dpy, xcb_change_window_attributes_checked(dpy, root, XCB_CW_EVENT_MASK, values));
	if (e != NULL) {
		free(e);
		xcb_ewmh_connection_wipe(ewmh);
		free(ewmh);
		xcb_disconnect(dpy);
		err("Another window manager is already running.\n");
	}
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
leaq 0xc(%rsp), %rcx
movl $0x3a0004, (%rcx)       # imm = 0x3A0004
movq 0x22c2e(%rip), %rbx     # 0x286c8
movl 0x22cd8(%rip), %esi     # 0x28778
movq %rbx, %rdi
movl $0x800, %edx            # imm = 0x800
callq 0x4640
movq %rbx, %rdi
movl %eax, %esi
callq 0x4900
testq %rax, %rax
je 0x5af5
movq %rax, %rdi
callq 0x4460
leaq 0x23365(%rip), %rbx     # 0x28e30
movq (%rbx), %rdi
callq 0x59ba
movq (%rbx), %rdi
callq 0x4460
movq 0x22be6(%rip), %rdi     # 0x286c8
callq 0x4980
leaq 0x186da(%rip), %rdi     # 0x1e1c8
xorl %eax, %eax
callq 0x5be8
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/baskerville[P]bspwm/src/geometry.c
// Function: boundary_distance
uint32_t boundary_distance(xcb_rectangle_t r1, xcb_rectangle_t r2, direction_t dir)
{
	xcb_point_t r1_max = {r1.x + r1.width - 1, r1.y + r1.height - 1};
	xcb_point_t r2_max = {r2.x + r2.width - 1, r2.y + r2.height - 1};
	switch (dir) {
		case DIR_NORTH:
			return r2_max.y > r1.y ? r2_max.y - r1.y : r1.y - r2_max.y;
			break;
		case DIR_WEST:
			return r2_max.x > r1.x ? r2_max.x - r1.x : r1.x - r2_max.x;
			break;
		case DIR_SOUTH:
			return r2.y < r1_max.y ? r1_max.y - r2.y : r2.y - r1_max.y;
			break;
		case DIR_EAST:
			return r2.x < r1_max.x ? r1_max.x - r2.x : r2.x - r1_max.x;
			break;
		default:
			return UINT32_MAX;
	}
}

// Assembly:
cmpl $0x3, %edx
ja 0x612c
movl %edi, %eax
sarl $0x10, %eax
movl %esi, %ecx
sarl $0x10, %ecx
movl %edx, %edx
leaq 0x182d3(%rip), %r8      # 0x1e3a8
movslq (%r8,%rdx,4), %rdx
addq %r8, %rdx
jmpq *%rdx
shrq $0x30, %rsi
addl %esi, %ecx
decl %ecx
movswl %cx, %ecx
subl %eax, %ecx
jmp 0x6124
shrq $0x30, %rdi
addl %edi, %eax
decl %eax
cwtl
subl %eax, %ecx
movl %ecx, %eax
negl %eax
cmovsl %ecx, %eax
retq
movswl %si, %ecx
movq %rdi, %rax
shrq $0x20, %rax
addl %edi, %eax
decl %eax
cwtl
jmp 0x6122
movswl %di, %eax
movq %rsi, %rcx
shrq $0x20, %rcx
addl %esi, %ecx
decl %ecx
movswl %cx, %ecx
subl %eax, %ecx
movl %ecx, %eax
negl %eax
cmovsl %ecx, %eax
retq
pushq $-0x1
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/baskerville[P]bspwm/src/geometry.c
// Function: rect_cmp
int rect_cmp(xcb_rectangle_t r1, xcb_rectangle_t r2)
{
	if (r1.y >= (r2.y + r2.height)) {
		return 1;
	} else if (r2.y >= (r1.y + r1.height)) {
		return -1;
	} else {
		if (r1.x >= (r2.x + r2.width)) {
			return 1;
		} else if (r2.x >= (r1.x + r1.width)) {
			return -1;
		} else {
			return area(r2) - area(r1);
		}
	}
}

// Assembly:
movq %rsi, %rcx
shrq $0x30, %rcx
movl %edi, %r9d
sarl $0x10, %r9d
movl %esi, %r10d
sarl $0x10, %r10d
leal (%r10,%rcx), %edx
pushq $0x1
popq %rax
cmpl %r9d, %edx
jle 0x62cb
movq %rdi, %rdx
shrq $0x30, %rdx
addl %edx, %r9d
pushq $-0x1
popq %r8
cmpl %r10d, %r9d
jle 0x62cc
movq %rsi, %r11
shrq $0x20, %r11
movswl %di, %r9d
movswl %si, %r10d
movzwl %r11w, %esi
leal (%rsi,%r10), %r11d
cmpl %r9d, %r11d
jle 0x62cb
shrq $0x20, %rdi
movzwl %di, %edi
addl %edi, %r9d
movl %r8d, %eax
cmpl %r10d, %r9d
jle 0x62cb
imull %ecx, %esi
imull %edx, %edi
subl %edi, %esi
movl %esi, %eax
retq
movl %r8d, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/baskerville[P]bspwm/src/settings.c
// Function: run_config
void run_config(int run_level)
{
	if (fork() == 0) {
		if (dpy != NULL) {
			close(xcb_get_file_descriptor(dpy));
		}
		setsid();
		char arg1[2];
		snprintf(arg1, 2, "%i", run_level);
		execl(config_path, config_path, arg1, (char *) NULL);
		err("Couldn't execute the configuration file.\n");
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
callq 0x49b0
testl %eax, %eax
jne 0x6832
leaq 0x21eee(%rip), %rax     # 0x286c8
movq (%rax), %rdi
testq %rdi, %rdi
je 0x67ee
callq 0x4380
movl %eax, %edi
callq 0x4150
callq 0x4120
leaq 0x19925(%rip), %rdx     # 0x2011f
leaq 0x6(%rsp), %r14
pushq $0x2
popq %rsi
movq %r14, %rdi
movl %ebx, %ecx
xorl %eax, %eax
callq 0x4110
leaq 0x21dab(%rip), %rdi     # 0x285c0
movq %rdi, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x4230
leaq 0x17bcd(%rip), %rdi     # 0x1e3f8
xorl %eax, %eax
callq 0x5be8
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/baskerville[P]bspwm/src/monitor.c
// Function: make_monitor
monitor_t *make_monitor(const char *name, xcb_rectangle_t *rect, uint32_t id)
{
	monitor_t *m = calloc(1, sizeof(monitor_t));
	if (id == XCB_NONE) {
		m->id = xcb_generate_id(dpy);
	}
	m->randr_id = XCB_NONE;
	snprintf(m->name, sizeof(m->name), "%s", name == NULL ? DEFAULT_MON_NAME : name);
	m->padding = padding;
	m->border_width = border_width;
	m->window_gap = window_gap;
	m->root = XCB_NONE;
	m->prev = m->next = NULL;
	m->desk = m->desk_head = m->desk_tail = NULL;
	m->wired = true;
	m->sticky_count = 0;
	if (rect != NULL) {
		update_root(m, rect);
	} else {
		m->rectangle = (xcb_rectangle_t) {0, 0, screen_width, screen_height};
	}
	return m;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r15
pushq $0x1
popq %rdi
movl $0x80, %esi
callq 0x48b0
movq %rax, %rbx
testl %ebp, %ebp
jne 0x69b9
leaq 0x21d1a(%rip), %rax     # 0x286c8
movq (%rax), %rdi
callq 0x4920
movl %eax, 0x20(%rbx)
testq %r15, %r15
leaq 0x17a7d(%rip), %rcx     # 0x1e440
cmovneq %r15, %rcx
leaq 0x17679(%rip), %rdx     # 0x1e047
pushq $0x20
popq %rsi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x4110
leaq 0x223be(%rip), %rax     # 0x28da0
movups (%rax), %xmm0
movups %xmm0, 0x30(%rbx)
leaq 0x223d4(%rip), %rax     # 0x28dc4
movl (%rax), %eax
movl %eax, 0x48(%rbx)
leaq 0x223c4(%rip), %rax     # 0x28dc0
movl (%rax), %eax
movl %eax, 0x44(%rbx)
andl $0x0, 0x28(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x68(%rbx)
movups %xmm0, 0x58(%rbx)
andq $0x0, 0x78(%rbx)
movb $0x1, 0x2c(%rbx)
andl $0x0, 0x40(%rbx)
testq %r14, %r14
je 0x6a2f
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6a5d
jmp 0x6a4f
leaq 0x21d46(%rip), %rax     # 0x2877c
movzwl (%rax), %eax
andl $0x0, 0x4c(%rbx)
leaq 0x21d3c(%rip), %rcx     # 0x28780
movzwl (%rcx), %ecx
movw %ax, 0x50(%rbx)
movw %cx, 0x52(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/baskerville[P]bspwm/src/monitor.c
// Function: reorder_monitor
void reorder_monitor(monitor_t *m)
{
	if (m == NULL) {
		return;
	}
	monitor_t *prev = m->prev;
	while (prev != NULL && rect_cmp(m->rectangle, prev->rectangle) < 0) {
		swap_monitors(m, prev);
		prev = m->prev;
	}
	monitor_t *next = m->next;
	while (next != NULL && rect_cmp(m->rectangle, next->rectangle) > 0) {
		swap_monitors(m, next);
		next = m->next;
	}
}

// Assembly:
testq %rdi, %rdi
je 0x6e0b
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x70(%rbx), %r14
testq %r14, %r14
je 0x6dfb
movq 0x4c(%rbx), %rdi
movq 0x4c(%r14), %rsi
callq 0x625f
testl %eax, %eax
jns 0x6dfb
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6e0c
jmp 0x6db8
movq 0x4c(%rbx), %rdi
movq 0x4c(%r14), %rsi
callq 0x625f
testl %eax, %eax
jle 0x6e04
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6e0c
movq 0x78(%rbx), %r14
testq %r14, %r14
jne 0x6ddf
addq $0x8, %rsp
popq %rbx
popq %r14
retq