LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_io.c
// Function: uint7_put_blk_64
static int uint7_put_blk_64(cram_block *blk, int64_t v) {
    uint8_t buf[10];
    int sz = var_put_u64(buf, buf+10, v);
    BLOCK_APPEND(blk, buf, sz);
    return sz;

 block_err:
    return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rdx
movq %rdi, %rbx
leaq 0x18(%rsp), %rsi
leaq 0xe(%rsp), %rdi
callq 0x55d55
movl %eax, %ebp
movslq %eax, %r14
movq 0x30(%rbx), %r15
addq %r14, %r15
movq 0x28(%rbx), %rax
cmpq %r15, %rax
ja 0x55507
leaq 0x320(%rax), %rcx
shrq $0x2, %rcx
addq %rcx, %rax
addq $0x320, %rax            # imm = 0x320
cmpq %r15, %rax
cmovaq %rax, %r15
movq 0x20(%rbx), %rdi
movq %r15, %rsi
callq 0x4840
testq %rax, %rax
je 0x5552b
movq %r15, 0x28(%rbx)
movq %rax, 0x20(%rbx)
testl %ebp, %ebp
je 0x55526
movq 0x20(%rbx), %rdi
addq 0x30(%rbx), %rdi
leaq 0xe(%rsp), %rsi
movq %r14, %rdx
callq 0x43c0
addq %r14, 0x30(%rbx)
jmp 0x55531
xorl %r14d, %r14d
jmp 0x55531
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
movl %r14d, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_io.c
// Function: sint7_put_blk_64
static int sint7_put_blk_64(cram_block *blk, int64_t v) {
    uint8_t buf[10];
    int sz = var_put_s64(buf, buf+10, v);
    BLOCK_APPEND(blk, buf, sz);
    return sz;

 block_err:
    return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x18(%rsp), %rax
leaq (%rsi,%rsi), %rdx
sarq $0x3f, %rsi
xorq %rsi, %rdx
leaq 0xe(%rsp), %rdi
movq %rax, %rsi
callq 0x55d55
movl %eax, %ebp
movslq %eax, %r14
movq 0x30(%rbx), %r15
addq %r14, %r15
movq 0x28(%rbx), %rax
cmpq %r15, %rax
ja 0x555b2
leaq 0x320(%rax), %rcx
shrq $0x2, %rcx
addq %rcx, %rax
addq $0x320, %rax            # imm = 0x320
cmpq %r15, %rax
cmovaq %rax, %r15
movq 0x20(%rbx), %rdi
movq %r15, %rsi
callq 0x4840
testq %rax, %rax
je 0x555d6
movq %r15, 0x28(%rbx)
movq %rax, 0x20(%rbx)
testl %ebp, %ebp
je 0x555d1
movq 0x20(%rbx), %rdi
addq 0x30(%rbx), %rdi
leaq 0xe(%rsp), %rsi
movq %r14, %rdx
callq 0x43c0
addq %r14, 0x30(%rbx)
jmp 0x555dc
xorl %r14d, %r14d
jmp 0x555dc
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
movl %r14d, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_io.c
// Function: uint7_decode_crc32
static int uint7_decode_crc32(cram_fd *fd, int32_t *val_p, uint32_t *crc) {
    uint8_t b[5], i = 0;
    int c;
    uint32_t v = 0;

#ifdef VARINT2
    b[0] = hgetc(fd->fp);
    if (b[0] < 177) {
    } else if (b[0] < 241) {
        b[1] = hgetc(fd->fp);
    } else if (b[0] < 249) {
        b[1] = hgetc(fd->fp);
        b[2] = hgetc(fd->fp);
    } else {
        int n = b[0]+2, z = 1;
        while (n-- >= 249)
            b[z++] = hgetc(fd->fp);
    }
    i = var_get_u32(b, NULL, &v);
#else
//    // Little endian
//    int s = 0;
//    do {
//        b[i++] = c = hgetc(fd->fp);
//        if (c < 0)
//            return -1;
//        v |= (c & 0x7f) << s;
//      s += 7;
//    } while (i < 5 && (c & 0x80));

    // Big endian, see also htscodecs/varint.h
    do {
        b[i++] = c = hgetc(fd->fp);
        if (c < 0)
            return -1;
        v = (v<<7) | (c & 0x7f);
    } while (i < 5 && (c & 0x80));
#endif
    *crc = crc32(*crc, b, i);

    *val_p = v;
    return i;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
xorl %r13d, %r13d
xorl %ebp, %ebp
movq (%r15), %rdi
movq 0x8(%rdi), %rax
cmpq %rax, 0x10(%rdi)
jbe 0x55637
leaq 0x1(%rax), %rcx
movq %rcx, 0x8(%rdi)
movzbl (%rax), %eax
movb %al, 0x3(%rsp,%r13)
jmp 0x55645
callq 0xee9b
movb %al, 0x3(%rsp,%r13)
testl %eax, %eax
js 0x5567c
leaq 0x1(%r13), %r12
movl %ebp, %ecx
shll $0x7, %ecx
movl %eax, %ebp
andl $0x7f, %ebp
orl %ecx, %ebp
cmpq $0x3, %r13
ja 0x55665
movq %r12, %r13
andl $0x80, %eax
jne 0x55618
movl (%r14), %edi
leaq 0x3(%rsp), %rsi
movl %r12d, %edx
callq 0x4320
movl %eax, (%r14)
movl %ebp, (%rbx)
jmp 0x55682
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
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_O3/samtools[P]htslib/cram/cram_io.c
// Function: uint7_decode_crc64
static int uint7_decode_crc64(cram_fd *fd, int64_t *val_p, uint32_t *crc) {
    uint8_t b[10], i = 0;
    int c;
    uint64_t v = 0;

#ifdef VARINT2
    b[0] = hgetc(fd->fp);
    if (b[0] < 177) {
    } else if (b[0] < 241) {
        b[1] = hgetc(fd->fp);
    } else if (b[0] < 249) {
        b[1] = hgetc(fd->fp);
        b[2] = hgetc(fd->fp);
    } else {
        int n = b[0]+2, z = 1;
        while (n-- >= 249)
            b[z++] = hgetc(fd->fp);
    }
    i = var_get_u64(b, NULL, &v);
#else
//    // Little endian
//    int s = 0;
//    do {
//        b[i++] = c = hgetc(fd->fp);
//        if (c < 0)
//            return -1;
//        v |= (c & 0x7f) << s;
//      s += 7;
//    } while (i < 10 && (c & 0x80));

    // Big endian, see also htscodecs/varint.h
    do {
        b[i++] = c = hgetc(fd->fp);
        if (c < 0)
            return -1;
        v = (v<<7) | (c & 0x7f);
    } while (i < 5 && (c & 0x80));
#endif
    *crc = crc32(*crc, b, i);

    *val_p = v;
    return i;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
xorl %ebp, %ebp
xorl %r13d, %r13d
movq (%r15), %rdi
movq 0x8(%rdi), %rax
cmpq %rax, 0x10(%rdi)
jbe 0x5577f
leaq 0x1(%rax), %rcx
movq %rcx, 0x8(%rdi)
movzbl (%rax), %eax
movb %al, 0xe(%rsp,%rbp)
jmp 0x5578c
callq 0xee9b
movb %al, 0xe(%rsp,%rbp)
testl %eax, %eax
js 0x557c9
leaq 0x1(%rbp), %r12
movq %r13, %rcx
shlq $0x7, %rcx
movl %eax, %r13d
andl $0x7f, %r13d
orq %rcx, %r13
cmpq $0x3, %rbp
ja 0x557b1
movq %r12, %rbp
andl $0x80, %eax
jne 0x55761
movl (%r14), %edi
leaq 0xe(%rsp), %rsi
movl %r12d, %edx
callq 0x4320
movl %eax, (%r14)
movq %r13, (%rbx)
jmp 0x557cf
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
movl %r12d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_io.c
// Function: safe_itf8_get
static int64_t safe_itf8_get(char **cp, const char *endp, int *err) {
    const unsigned char *up = (unsigned char *)*cp;

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

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

// Assembly:
movq (%rdi), %rcx
testq %rsi, %rsi
je 0x5581e
movq %rsi, %rax
subq %rcx, %rax
cmpq $0x4, %rax
jg 0x5581e
cmpq %rsi, %rcx
jae 0x55810
movzbl (%rcx), %esi
shrl $0x4, %esi
leaq 0x44cc9(%rip), %r8      # 0x9a4d0
movslq (%r8,%rsi,4), %rsi
cmpq %rsi, %rax
jge 0x5581e
testq %rdx, %rdx
je 0x5581b
movl $0x1, (%rdx)
xorl %eax, %eax
retq
movb (%rcx), %al
testb %al, %al
js 0x5582f
leaq 0x1(%rcx), %rax
movq %rax, (%rdi)
movzbl (%rcx), %eax
retq
cmpb $-0x41, %al
ja 0x55849
leaq 0x2(%rcx), %rax
movq %rax, (%rdi)
movzbl (%rcx), %eax
movzbl 0x1(%rcx), %ecx
andl $0x3f, %eax
shll $0x8, %eax
jmp 0x55896
cmpb $-0x21, %al
ja 0x5586c
leaq 0x3(%rcx), %rax
movq %rax, (%rdi)
movzbl (%rcx), %eax
movzbl 0x1(%rcx), %edx
shll $0x8, %edx
movzbl 0x2(%rcx), %ecx
andl $0x1f, %eax
shll $0x10, %eax
orl %edx, %eax
jmp 0x55896
cmpb $-0x11, %al
ja 0x5589a
leaq 0x4(%rcx), %rax
movq %rax, (%rdi)
movzbl (%rcx), %eax
movzbl 0x1(%rcx), %edx
shll $0x10, %edx
movzbl 0x2(%rcx), %esi
shll $0x8, %esi
movzbl 0x3(%rcx), %ecx
andl $0xf, %eax
shll $0x18, %eax
orl %edx, %eax
orl %esi, %eax
orq %rcx, %rax
retq
leaq 0x5(%rcx), %rax
movq %rax, (%rdi)
movzbl (%rcx), %eax
shll $0x1c, %eax
movzbl 0x1(%rcx), %edx
shll $0x14, %edx
cltq
orq %rdx, %rax
movzbl 0x2(%rcx), %edx
shll $0xc, %edx
orq %rax, %rdx
movzbl 0x3(%rcx), %esi
shll $0x4, %esi
orq %rdx, %rsi
movzbl 0x4(%rcx), %eax
andl $0xf, %eax
orq %rsi, %rax
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_io.c
// Function: safe_itf8_put
static inline int itf8_put(char *cp, int32_t val) {
    unsigned char *up = (unsigned char *)cp;
    if        (!(val & ~0x00000007f)) { // 1 byte
        *up = val;
        return 1;
    } else if (!(val & ~0x00003fff)) { // 2 byte
        *up++ = (val >> 8 ) | 0x80;
        *up   = val & 0xff;
        return 2;
    } else if (!(val & ~0x01fffff)) { // 3 byte
        *up++ = (val >> 16) | 0xc0;
        *up++ = (val >> 8 ) & 0xff;
        *up   = val & 0xff;
        return 3;
    } else if (!(val & ~0x0fffffff)) { // 4 byte
        *up++ = (val >> 24) | 0xe0;
        *up++ = (val >> 16) & 0xff;
        *up++ = (val >> 8 ) & 0xff;
        *up   = val & 0xff;
        return 4;
    } else {                           // 5 byte
        *up++ = 0xf0 | ((val>>28) & 0xff);
        *up++ = (val >> 20) & 0xff;
        *up++ = (val >> 12) & 0xff;
        *up++ = (val >> 4 ) & 0xff;
        *up = val & 0x0f;
        return 5;
    }
}

// Assembly:
cmpl $0x7f, %edx
ja 0x55ad1
movb %dl, (%rdi)
movl $0x1, %eax
retq
movl %edx, %eax
cmpl $0x3fff, %edx           # imm = 0x3FFF
ja 0x55aeb
shrl $0x8, %eax
orb $-0x80, %al
movb %al, (%rdi)
movb %dl, 0x1(%rdi)
movl $0x2, %eax
retq
cmpl $0x1fffff, %edx         # imm = 0x1FFFFF
ja 0x55b06
shrl $0x10, %eax
orb $-0x40, %al
movb %al, (%rdi)
movb %dh, 0x1(%rdi)
movb %dl, 0x2(%rdi)
movl $0x3, %eax
retq
cmpl $0xfffffff, %edx        # imm = 0xFFFFFFF
ja 0x55b29
shrl $0x18, %eax
orb $-0x20, %al
movb %al, (%rdi)
movl %edx, %eax
shrl $0x10, %eax
movb %al, 0x1(%rdi)
movb %dh, 0x2(%rdi)
movb %dl, 0x3(%rdi)
movl $0x4, %eax
retq
shrl $0x1c, %eax
orb $-0x10, %al
movb %al, (%rdi)
movl %edx, %eax
shrl $0x14, %eax
movb %al, 0x1(%rdi)
movl %edx, %eax
shrl $0xc, %eax
movb %al, 0x2(%rdi)
movl %edx, %eax
shrl $0x4, %eax
movb %al, 0x3(%rdi)
andb $0xf, %dl
movb %dl, 0x4(%rdi)
movl $0x5, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_stats.c
// Function: cram_stats_add
int cram_stats_add(cram_stats *st, int64_t val) {
    st->nsamp++;

    //assert(val >= 0);

    if (val < MAX_STAT_VAL && val >= 0) {
        st->freqs[val]++;
    } else {
        khint_t k;
        int r;

        if (!st->h) {
            st->h = kh_init(m_i2i);
            if (!st->h)
                return -1;
        }

        k = kh_put(m_i2i, st->h, val, &r);
        if (r == 0)
            kh_val(st->h, k)++;
        else if (r != -1)
            kh_val(st->h, k) = 1;
        else
            return -1;
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
incl 0x1008(%rdi)
cmpq $0x3ff, %rsi            # imm = 0x3FF
ja 0x5605c
incl (%rbx,%r15,4)
jmp 0x56203
movq 0x1000(%rbx), %r14
testq %r14, %r14
jne 0x56086
movl $0x1, %edi
movl $0x28, %esi
callq 0x4300
movq %rax, %r14
movq %rax, 0x1000(%rbx)
testq %rax, %rax
je 0x560e8
movl 0x8(%r14), %eax
cmpl 0xc(%r14), %eax
jb 0x560af
movl (%r14), %esi
movl 0x4(%r14), %eax
addl %eax, %eax
cmpl %eax, %esi
jbe 0x560a1
decl %esi
jmp 0x560a3
incl %esi
movq %r14, %rdi
callq 0x56662
testl %eax, %eax
js 0x560e8
movl (%r14), %esi
leal -0x1(%rsi), %r8d
movq %r15, %rdi
shrq $0x21, %rdi
movl %r15d, %eax
shll $0xb, %eax
xorl %eax, %edi
xorl %r15d, %edi
andl %r8d, %edi
movq 0x10(%r14), %rax
movl %edi, %ecx
shrl $0x4, %ecx
movl (%rax,%rcx,4), %edx
leal (%rdi,%rdi), %ecx
shrl %cl, %edx
testb $0x2, %dl
je 0x560f2
movl %edi, %edx
jmp 0x5616d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x56205
movl $0x1, %r10d
movl %edi, %r9d
movl %esi, %edx
movl %r9d, %ecx
shrl $0x4, %ecx
movl (%rax,%rcx,4), %r11d
leal (%r9,%r9), %ecx
andl $0x1e, %ecx
movl %r11d, %ebp
shrl %cl, %ebp
testb $0x2, %bpl
jne 0x5614d
testb $0x1, %bpl
jne 0x5612c
movq 0x18(%r14), %r12
movl %r9d, %r13d
cmpq %r15, (%r12,%r13,8)
je 0x5614d
btl %ecx, %r11d
cmovbl %r9d, %edx
addl %r10d, %r9d
andl %r8d, %r9d
incl %r10d
cmpl %edi, %r9d
jne 0x560fd
movb $0x1, %cl
movl %esi, %r8d
cmpl %esi, %edx
je 0x5615d
jmp 0x5616d
shrl %cl, %r11d
testb $0x2, %r11b
sete %cl
movl %edx, %r8d
movl %r9d, %edi
cmpl %esi, %r8d
cmovel %edi, %r8d
testb %cl, %cl
cmovnel %edi, %r8d
movl %r8d, %edx
movl %edx, %esi
shrl $0x4, %esi
movl (%rax,%rsi,4), %edi
leal (%rdx,%rdx), %ecx
andl $0x1e, %ecx
movl %edi, %r8d
shrl %cl, %r8d
testb $0x2, %r8b
jne 0x5619f
testb $0x1, %r8b
jne 0x561d1
movq 0x1000(%rbx), %rax
movq 0x20(%rax), %rax
movl %edx, %ecx
incl (%rax,%rcx,4)
jmp 0x56203
movq 0x18(%r14), %r8
movl %edx, %edx
movl $0x3, %r9d
shll %cl, %r9d
movq %r15, (%r8,%rdx,8)
notl %r9d
andl %r9d, %edi
movl %edi, (%rax,%rsi,4)
movq 0x4(%r14), %xmm0
pcmpeqd %xmm1, %xmm1
psubd %xmm1, %xmm0
movq %xmm0, 0x4(%r14)
jmp 0x561f1
movq 0x18(%r14), %r8
movl $0x3, %r9d
shll %cl, %r9d
movl %edx, %edx
movq %r15, (%r8,%rdx,8)
notl %r9d
andl %r9d, %edi
movl %edi, (%rax,%rsi,4)
incl 0x4(%r14)
movq 0x1000(%rbx), %rax
movq 0x20(%rax), %rax
movl $0x1, (%rax,%rdx,4)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_stats.c
// Function: cram_stats_del
void cram_stats_del(cram_stats *st, int64_t val) {
    st->nsamp--;

    //assert(val >= 0);

    if (val < MAX_STAT_VAL && val >= 0) {
        st->freqs[val]--;
        assert(st->freqs[val] >= 0);
    } else if (st->h) {
        khint_t k = kh_get(m_i2i, st->h, val);

        if (k != kh_end(st->h)) {
            if (--kh_val(st->h, k) == 0)
                kh_del(m_i2i, st->h, k);
        } else {
            hts_log_warning("Failed to remove val %"PRId64" from cram_stats", val);
            st->nsamp++;
        }
    } else {
        hts_log_warning("Failed to remove val %"PRId64" from cram_stats", val);
        st->nsamp++;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rax
movq %rdi, %rbx
decl 0x1008(%rdi)
cmpq $0x3ff, %rsi            # imm = 0x3FF
ja 0x56260
movl (%rbx,%rax,4), %ecx
leal -0x1(%rcx), %edx
movl %edx, (%rbx,%rax,4)
testl %ecx, %ecx
jg 0x5630a
leaq 0x45611(%rip), %rdi     # 0x9b859
leaq 0x4561e(%rip), %rsi     # 0x9b86d
leaq 0x45629(%rip), %rcx     # 0x9b87f
movl $0x57, %edx
callq 0x42f0
movq 0x1000(%rbx), %rsi
testq %rsi, %rsi
je 0x562e7
movl (%rsi), %edi
testl %edi, %edi
je 0x562e1
leal -0x1(%rdi), %r8d
movq %rax, %r9
shrq $0x21, %r9
movl %eax, %ecx
shll $0xb, %ecx
xorl %ecx, %r9d
xorl %eax, %r9d
andl %r8d, %r9d
movq 0x10(%rsi), %r10
movl $0x1, %r11d
movl %r9d, %edx
movl %edx, %ecx
shrl $0x4, %ecx
movl (%r10,%rcx,4), %ebp
leal (%rdx,%rdx), %ecx
andl $0x1e, %ecx
movl %ebp, %r14d
shrl %cl, %r14d
testb $0x2, %r14b
jne 0x562d6
testb $0x1, %r14b
jne 0x562c6
movq 0x18(%rsi), %r14
movl %edx, %r15d
cmpq %rax, (%r14,%r15,8)
je 0x562d6
addl %r11d, %edx
andl %r8d, %edx
incl %r11d
cmpl %r9d, %edx
jne 0x56298
jmp 0x562e7
shrl %cl, %ebp
testb $0x3, %bpl
cmovnel %edi, %edx
jmp 0x562e3
xorl %edx, %edx
cmpl %edi, %edx
jne 0x56315
leaq 0x455bc(%rip), %rsi     # 0x9b8aa
leaq 0x455c4(%rip), %rdx     # 0x9b8b9
movl $0x3, %edi
movq %rax, %rcx
xorl %eax, %eax
callq 0x13de5
incl 0x1008(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x20(%rsi), %rax
movl %edx, %ecx
decl (%rax,%rcx,4)
jne 0x5630a
cmpl %edx, (%rsi)
je 0x5630a
movq 0x10(%rsi), %rax
movl %edx, %edi
shrl $0x4, %edi
movl (%rax,%rdi,4), %r8d
addl %edx, %edx
andl $0x1e, %edx
movl %r8d, %r9d
movl %edx, %ecx
shrl %cl, %r9d
testb $0x3, %r9b
jne 0x5630a
btsl %edx, %r8d
movl %r8d, (%rax,%rdi,4)
decl 0x4(%rsi)
jmp 0x5630a
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/mFILE.c
// Function: mstdin
mFILE *mstdin(void) {
    if (m_channel[0])
        return m_channel[0];

    m_channel[0] = mfcreate(NULL, 0);
    if (NULL == m_channel[0]) return NULL;
    m_channel[0]->fp = stdin;
    return m_channel[0];
}

// Assembly:
movq 0x607cd(%rip), %rax     # 0xb70d0
testq %rax, %rax
je 0x56909
retq
pushq %rax
movl $0x38, %edi
callq 0x4680
testq %rax, %rax
je 0x56950
movabsq $0x300000000, %rcx      # imm = 0x300000000
movq %rcx, 0x18(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movups %xmm0, 0x20(%rax)
movq $0x0, 0x30(%rax)
movq %rax, 0x6078f(%rip)     # 0xb70d0
movq 0x5f688(%rip), %rcx     # 0xb5fd0
movq (%rcx), %rcx
movq %rcx, (%rax)
jmp 0x5695d
movq $0x0, 0x60775(%rip) # 0xb70d0
xorl %eax, %eax
addq $0x8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/mFILE.c
// Function: mfcreate
mFILE *mfcreate(char *data, int size) {
    mFILE *mf = (mFILE *)malloc(sizeof(*mf));
    if (NULL == mf) return NULL;
    mf->fp = NULL;
    mf->data = data;
    mf->alloced = size;
    mf->size = size;
    mf->eof = 0;
    mf->offset = 0;
    mf->flush_pos = 0;
    mf->mode = MF_READ | MF_WRITE;
    return mf;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
movl $0x38, %edi
callq 0x4680
testq %rax, %rax
je 0x569a5
movq $0x0, (%rax)
movq %r14, 0x8(%rax)
movslq %ebx, %rcx
movq %rcx, 0x10(%rax)
movq %rcx, 0x20(%rax)
movabsq $0x300000000, %rcx      # imm = 0x300000000
movq %rcx, 0x18(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/mFILE.c
// Function: mstdout
mFILE *mstdout(void) {
    if (m_channel[1])
        return m_channel[1];

    m_channel[1] = mfcreate(NULL, 0);
    if (NULL == m_channel[1]) return NULL;
    m_channel[1]->fp = stdout;
    m_channel[1]->mode = MF_WRITE;
    return m_channel[1];
}

// Assembly:
movq 0x6072c(%rip), %rax     # 0xb70e0
testq %rax, %rax
je 0x569ba
retq
pushq %rax
movl $0x38, %edi
callq 0x4680
testq %rax, %rax
je 0x56a01
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movl $0x0, 0x18(%rax)
movups %xmm0, 0x20(%rax)
movq $0x0, 0x30(%rax)
movq %rax, 0x606f5(%rip)     # 0xb70e0
movq 0x5f5be(%rip), %rcx     # 0xb5fb0
movq (%rcx), %rcx
movq %rcx, (%rax)
movl $0x2, 0x1c(%rax)
jmp 0x56a0e
movq $0x0, 0x606d4(%rip) # 0xb70e0
xorl %eax, %eax
addq $0x8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/mFILE.c
// Function: mstderr
mFILE *mstderr(void) {
    if (m_channel[2])
        return m_channel[2];

    m_channel[2] = mfcreate(NULL, 0);
    if (NULL == m_channel[2]) return NULL;
    m_channel[2]->fp = stderr;
    m_channel[2]->mode = MF_WRITE;
    return m_channel[2];
}

// Assembly:
movq 0x606d6(%rip), %rax     # 0xb70f0
testq %rax, %rax
je 0x56a20
retq
pushq %rax
movl $0x38, %edi
callq 0x4680
testq %rax, %rax
je 0x56a67
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movl $0x0, 0x18(%rax)
movups %xmm0, 0x20(%rax)
movq $0x0, 0x30(%rax)
movq %rax, 0x6069f(%rip)     # 0xb70f0
movq 0x5f580(%rip), %rcx     # 0xb5fd8
movq (%rcx), %rcx
movq %rcx, (%rax)
movl $0x2, 0x1c(%rax)
jmp 0x56a74
movq $0x0, 0x6067e(%rip) # 0xb70f0
xorl %eax, %eax
addq $0x8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/mFILE.c
// Function: mfrecreate
void mfrecreate(mFILE *mf, char *data, int size) {
    if (mf->data)
        free(mf->data);
    mf->data = data;
    mf->size = size;
    mf->alloced = size;
    mf->eof = 0;
    mf->offset = 0;
    mf->flush_pos = 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x56a93
callq 0x45c0
movq %r14, 0x8(%rbx)
movslq %ebp, %rax
movq %rax, 0x20(%rbx)
movq %rax, 0x10(%rbx)
movl $0x0, 0x18(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/mFILE.c
// Function: mfload
static char *mfload(FILE *fp, const char *fn, size_t *size, int binary) {
    struct stat sb;
    char *data = NULL;
    size_t allocated = 0, used = 0;
    int bufsize = 8192;

#ifdef _WIN32
    if (binary)
        _setmode(_fileno(fp), _O_BINARY);
    else
        _setmode(_fileno(fp), _O_TEXT);
#endif

    if (fn && -1 != stat(fn, &sb)) {
        data = malloc(allocated = sb.st_size);
        if (!data)
            return NULL;
        bufsize = sb.st_size;
    } else {
        fn = NULL;
    }

    do {
        size_t len;
        if (used + bufsize > allocated) {
            allocated += bufsize;
            char *datan = realloc(data, allocated);
            if (datan) {
                data = datan;
            } else {
                free(data);
                return NULL;
            }
        }
        len = fread(data + used, 1, allocated - used, fp);
        if (len > 0)
            used += len;
    } while (!feof(fp) && (fn == NULL || used < sb.st_size));

    *size = used;

    return data;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rdx, %r12
movq %rdi, %r14
movb $0x1, %al
movl %eax, 0x4(%rsp)
movl $0x2000, %ebx           # imm = 0x2000
testq %rsi, %rsi
je 0x56d54
leaq 0x18(%rsp), %r15
movq %rsi, %rdi
movq %r15, %rsi
callq 0x4420
movq 0x30(%r15), %r15
cmpl $-0x1, %eax
je 0x56d5e
movq %r15, %rdi
callq 0x4680
testq %rax, %rax
je 0x56dde
movq %rax, %r13
movq %r12, 0x8(%rsp)
movslq %r15d, %rbx
movl $0x0, 0x4(%rsp)
movq %r15, 0x10(%rsp)
movq %r15, %r12
jmp 0x56d6e
movq %r12, 0x8(%rsp)
xorl %r13d, %r13d
jmp 0x56d6b
movq %r15, 0x10(%rsp)
movq %r12, 0x8(%rsp)
xorl %r13d, %r13d
xorl %r12d, %r12d
xorl %r15d, %r15d
leaq (%r15,%rbx), %rax
cmpq %r12, %rax
jbe 0x56d92
addq %rbx, %r12
movq %r13, %rdi
movq %r12, %rsi
callq 0x4840
movq %rax, %rbp
testq %rax, %rax
jne 0x56d95
jmp 0x56dd6
movq %r13, %rbp
leaq (%r15,%rbp), %rdi
movq %r12, %rdx
subq %r15, %rdx
movl $0x1, %esi
movq %r14, %rcx
callq 0x4790
addq %rax, %r15
movq %r14, %rdi
callq 0x47d0
cmpq 0x10(%rsp), %r15
setb %cl
testl %eax, %eax
jne 0x56dcc
orb 0x4(%rsp), %cl
movq %rbp, %r13
jne 0x56d71
movq 0x8(%rsp), %rax
movq %r15, (%rax)
jmp 0x56de0
movq %r13, %rdi
callq 0x45c0
xorl %ebp, %ebp
movq %rbp, %rax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/mFILE.c
// Function: mfflush
int mfflush(mFILE *mf) {
    if (!mf->fp)
        return 0;

    /* FIXME: only do this when opened in write mode */
    if (mf == m_channel[1] || mf == m_channel[2]) {
        if (mf->flush_pos < mf->size) {
            size_t bytes = mf->size - mf->flush_pos;
            if (fwrite(mf->data + mf->flush_pos, 1, bytes, mf->fp) < bytes)
                return -1;
            if (0 != fflush(mf->fp))
                return -1;
        }

        /* Stdout & stderr are non-seekable streams so throw away the data */
        mf->offset = mf->size = mf->flush_pos = 0;
    }

    /* only flush when opened in write mode */
    if (mf->mode & MF_WRITE) {
        if (mf->flush_pos < mf->size) {
            size_t bytes = mf->size - mf->flush_pos;
            if (!(mf->mode & MF_MODEX)) {
                fseek(mf->fp, mf->flush_pos, SEEK_SET);
            }
            if (fwrite(mf->data + mf->flush_pos, 1, bytes, mf->fp) < bytes)
                return -1;
            if (0 != fflush(mf->fp))
                return -1;
        }
        if (ftell(mf->fp) != -1 &&
            ftruncate(fileno(mf->fp), ftell(mf->fp)) == -1)
            return -1;
        mf->flush_pos = mf->size;
    }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq (%rdi), %rcx
testq %rcx, %rcx
je 0x56f61
movq %rdi, %rbx
cmpq %rdi, 0x60271(%rip)     # 0xb70e0
je 0x56e7a
cmpq %rbx, 0x60278(%rip)     # 0xb70f0
jne 0x56ec8
movq 0x20(%rbx), %r14
movq 0x30(%rbx), %rdi
subq %rdi, %r14
jbe 0x56eb6
addq 0x8(%rbx), %rdi
movl $0x1, %esi
movq %r14, %rdx
callq 0x49b0
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpq %r14, %rax
jb 0x56f63
movq (%rbx), %rdi
callq 0x45a0
testl %eax, %eax
jne 0x56f63
leaq 0x20(%rbx), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
movl 0x1c(%rbx), %edx
testb $0x2, %dl
je 0x56f61
movq 0x30(%rbx), %rax
movq (%rbx), %rcx
movq 0x20(%rbx), %r14
subq %rax, %r14
jbe 0x56f2a
testb $0x20, %dl
jne 0x56efd
movq %rcx, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x4540
movq (%rbx), %rcx
movq 0x30(%rbx), %rax
addq 0x8(%rbx), %rax
movl $0x1, %esi
movq %rax, %rdi
movq %r14, %rdx
callq 0x49b0
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpq %r14, %rax
jb 0x56f63
movq (%rbx), %rdi
callq 0x45a0
testl %eax, %eax
jne 0x56f63
movq (%rbx), %rcx
movq %rcx, %rdi
callq 0x4030
cmpq $-0x1, %rax
je 0x56f59
movq (%rbx), %rdi
callq 0x44f0
movl %eax, %ebp
movq (%rbx), %rdi
callq 0x4030
movl %ebp, %edi
movq %rax, %rsi
callq 0x46b0
cmpl $-0x1, %eax
je 0x56f6a
movq 0x20(%rbx), %rax
movq %rax, 0x30(%rbx)
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x56f63
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/mFILE.c
// Function: mfdestroy
int mfdestroy(mFILE *mf) {
    if (!mf)
        return -1;

    if (mf->data)
        free(mf->data);
    free(mf);

    return 0;
}

// Assembly:
testq %rdi, %rdi
je 0x56f94
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x56f88
callq 0x45c0
movq %rbx, %rdi
callq 0x45c0
xorl %eax, %eax
popq %rbx
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/mFILE.c
// Function: mfdetach
int mfdetach(mFILE *mf) {
    if (!mf)
        return -1;

    mfflush(mf);
    if (mf->mode & MF_MMAP)
        return -1;

    if (mf->fp) {
        fclose(mf->fp);
        mf->fp = NULL;
    }

    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %rdi, %rdi
je 0x56fcd
movq %rdi, %r14
callq 0x56e55
testb $0x40, 0x1c(%r14)
jne 0x56fcd
movq (%r14), %rdi
xorl %ebx, %ebx
testq %rdi, %rdi
je 0x56fcd
callq 0x44b0
movq $0x0, (%r14)
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/mFILE.c
// Function: mfsteal
void *mfsteal(mFILE *mf, size_t *size_out) {
    void *data;

    if (!mf) return NULL;

    data = mf->data;

    if (NULL != size_out) *size_out = mf->size;

    if (mfdetach(mf) != 0)
        return NULL;

    mf->data = NULL;
    mfdestroy(mf);

    return data;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x56fff
movq %rdi, %r14
movq 0x8(%rdi), %rbx
testq %rsi, %rsi
je 0x56ff3
movq 0x20(%r14), %rax
movq %rax, (%rsi)
movq %r14, %rdi
callq 0x56f9a
testl %eax, %eax
je 0x57003
xorl %ebx, %ebx
jmp 0x57013
movq $0x0, 0x8(%r14)
movq %r14, %rdi
callq 0x56f71
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/mFILE.c
// Function: mfseek
int mfseek(mFILE *mf, long offset, int whence) {
    switch (whence) {
    case SEEK_SET:
        mf->offset = offset;
        break;
    case SEEK_CUR:
        mf->offset += offset;
        break;
    case SEEK_END:
        mf->offset = mf->size + offset;
        break;
    default:
        errno = EINVAL;
        return -1;
    }

    mf->eof = 0;
    return 0;
}

// Assembly:
cmpl $0x2, %edx
je 0x57048
cmpl $0x1, %edx
je 0x57042
testl %edx, %edx
je 0x5704c
pushq %rax
callq 0x4050
movl $0x16, (%rax)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
retq
addq %rsi, 0x28(%rdi)
jmp 0x57050
addq 0x20(%rdi), %rsi
movq %rsi, 0x28(%rdi)
movl $0x0, 0x18(%rdi)
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/mFILE.c
// Function: mfread
size_t mfread(void *ptr, size_t size, size_t nmemb, mFILE *mf) {
    size_t len;
    char *cptr = (char *)ptr;

    if (mf == m_channel[0]) init_mstdin();

    if (mf->size <= mf->offset)
        return 0;

    len = size * nmemb <= mf->size - mf->offset
        ? size * nmemb
        : mf->size - mf->offset;
    if (!size)
        return 0;

    memcpy(cptr, &mf->data[mf->offset], len);
    mf->offset += len;

    if (len != size * nmemb) {
        mf->eof = 1;
    }

    return len / size;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r12
cmpq %rcx, 0x60022(%rip)     # 0xb70d0
jne 0x570b5
callq 0x57110
movq 0x20(%r14), %rbp
movq 0x28(%r14), %rsi
subq %rsi, %rbp
jbe 0x570ff
imulq %rbx, %r15
cmpq %rbp, %r15
movq %rbp, %r13
cmovbq %r15, %r13
testq %rbx, %rbx
je 0x570ff
addq 0x8(%r14), %rsi
movq %r12, %rdi
movq %r13, %rdx
callq 0x43c0
addq %r13, 0x28(%r14)
cmpq %rbp, %r15
jbe 0x570f5
movl $0x1, 0x18(%r14)
movq %r13, %rax
xorl %edx, %edx
divq %rbx
jmp 0x57101
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/mFILE.c
// Function: init_mstdin
static void init_mstdin(void) {
    static int done_stdin = 0;
    if (done_stdin)
        return;

    m_channel[0]->data = mfload(stdin, NULL, &m_channel[0]->size, 1);
    m_channel[0]->mode = MF_READ;
    done_stdin = 1;
}

// Assembly:
cmpb $0x0, 0x5ffe1(%rip)     # 0xb70f8
jne 0x57153
pushq %rax
movq 0x5eeaf(%rip), %rax     # 0xb5fd0
movq (%rax), %rdi
movq 0x5ffa5(%rip), %rdx     # 0xb70d0
addq $0x20, %rdx
xorl %esi, %esi
callq 0x56ce6
movq 0x5ff93(%rip), %rcx     # 0xb70d0
movq %rax, 0x8(%rcx)
movl $0x1, 0x1c(%rcx)
movb $0x1, 0x5ffa9(%rip)     # 0xb70f8
addq $0x8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/mFILE.c
// Function: mfwrite
size_t mfwrite(void *ptr, size_t size, size_t nmemb, mFILE *mf) {
    if (!(mf->mode & MF_WRITE))
        return 0;

    /* Append mode => forced all writes to end of file */
    if (mf->mode & MF_APPEND)
        mf->offset = mf->size;

    /* Make sure we have enough room */
    while (size * nmemb + mf->offset > mf->alloced) {
        size_t new_alloced = mf->alloced ? mf->alloced * 2 : 1024;
        void * new_data = realloc(mf->data, new_alloced);
        if (NULL == new_data) return 0;
        mf->alloced = new_alloced;
        mf->data    = new_data;
    }

    /* Record where we need to reflush from */
    if (mf->offset < mf->flush_pos)
        mf->flush_pos = mf->offset;

    /* Copy the data over */
    memcpy(&mf->data[mf->offset], ptr, size * nmemb);
    mf->offset += size * nmemb;
    if (mf->size < mf->offset)
        mf->size = mf->offset;

    return nmemb;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl 0x1c(%rcx), %eax
testb $0x2, %al
jne 0x5716d
xorl %ebx, %ebx
jmp 0x57201
movq %rcx, %r14
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r12
testb $0x4, %al
jne 0x57183
movq 0x28(%r14), %rdi
jmp 0x5718b
movq 0x20(%r14), %rdi
movq %rdi, 0x28(%r14)
imulq %rbx, %r15
leaq (%rdi,%r15), %rax
movq 0x10(%r14), %r13
cmpq %r13, %rax
jbe 0x571d6
movq 0x8(%r14), %rax
movl $0x400, %ebp            # imm = 0x400
testq %r13, %r13
leaq (%r13,%r13), %r13
cmoveq %rbp, %r13
movq %rax, %rdi
movq %r13, %rsi
callq 0x4840
testq %rax, %rax
je 0x57166
movq %r13, 0x10(%r14)
movq %rax, 0x8(%r14)
movq 0x28(%r14), %rdi
leaq (%rdi,%r15), %rcx
cmpq %r13, %rcx
ja 0x571a5
cmpq 0x30(%r14), %rdi
jae 0x571e0
movq %rdi, 0x30(%r14)
addq 0x8(%r14), %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x43c0
addq 0x28(%r14), %r15
movq %r15, 0x28(%r14)
cmpq %r15, 0x20(%r14)
jae 0x57201
movq %r15, 0x20(%r14)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/mFILE.c
// Function: mfgetc
int mfgetc(mFILE *mf) {
    if (mf == m_channel[0]) init_mstdin();
    if (mf->offset < mf->size) {
        return (unsigned char)mf->data[mf->offset++];
    }

    mf->eof = 1;
    return -1;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpq %rdi, 0x5feb2(%rip)     # 0xb70d0
jne 0x57225
callq 0x57110
movq 0x28(%rbx), %rax
cmpq 0x20(%rbx), %rax
jae 0x57241
movq 0x8(%rbx), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, 0x28(%rbx)
movzbl (%rcx,%rax), %eax
jmp 0x5724d
movl $0x1, 0x18(%rbx)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/mFILE.c
// Function: mfgets
char *mfgets(char *s, int size, mFILE *mf) {
    int i;

    if (mf == m_channel[0]) init_mstdin();
    *s = 0;
    for (i = 0; i < size-1;) {
        if (mf->offset < mf->size) {
            s[i] = mf->data[mf->offset++];
            if (s[i++] == '\n')
                break;
        } else {
            mf->eof = 1;
            break;
        }
    }

    s[i] = 0;
    return i ? s : NULL;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %rbx
cmpq %rdx, 0x5fe45(%rip)     # 0xb70d0
jne 0x57292
callq 0x57110
movb $0x0, (%rbx)
cmpl $0x2, %ebp
movl $0x1, %eax
cmovgel %ebp, %eax
decl %eax
xorl %ecx, %ecx
cmpq %rcx, %rax
je 0x572d9
movq 0x28(%r14), %rdx
cmpq 0x20(%r14), %rdx
jae 0x572cf
movq 0x8(%r14), %rsi
leaq 0x1(%rdx), %rdi
movq %rdi, 0x28(%r14)
movb (%rsi,%rdx), %dl
movb %dl, (%rbx,%rcx)
incq %rcx
cmpb $0xa, %dl
jne 0x572a4
jmp 0x572d7
movl $0x1, 0x18(%r14)
movl %ecx, %eax
movslq %eax, %rcx
movb $0x0, (%rbx,%rcx)
xorl %eax, %eax
testl %ecx, %ecx
cmovneq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/mFILE.c
// Function: mfascii
void mfascii(mFILE *mf) {
    size_t p1, p2;

    for (p1 = p2 = 1; p1 < mf->size; p1++, p2++) {
        if (mf->data[p1] == '\n' && mf->data[p1-1] == '\r') {
            p2--; /* delete the \r */
        }
        mf->data[p2] = mf->data[p1];
    }
    mf->size = p2;

    mf->offset = mf->flush_pos = 0;
}

// Assembly:
movl $0x1, %eax
cmpq $0x2, 0x20(%rdi)
jb 0x5732b
movl $0x1, %ecx
movq 0x8(%rdi), %rdx
movb (%rdx,%rcx), %sil
cmpb $0xa, %sil
jne 0x5731b
xorl %r8d, %r8d
cmpb $0xd, -0x1(%rdx,%rcx)
sete %r8b
subq %r8, %rax
movb %sil, (%rdx,%rax)
incq %rcx
incq %rax
cmpq 0x20(%rdi), %rcx
jb 0x572fe
movq %rax, 0x20(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rdi)
retq
nop
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/open_trace_file.c
// Function: find_file_url
mFILE *find_file_url(const char *file, char *url) {
    char *path = NULL, buf[8192];
    mFILE *mf = NULL;
    ssize_t len;
    hFILE *hf = NULL;

    /* Expand %s for the trace name.  Only one digit is allowed between
       The % and s to avoid ambiguity with percent-encoded URLs */

    path = expand_path(file, url, 1);
    if (!path)
        return NULL;

    if (!(hf = hopen(path, "r"))) {
        if (errno != ENOENT)
            hts_log_warning("Failed to open reference \"%s\": %s", path, strerror(errno));
        goto fail;
    }

    if (NULL == (mf = mfcreate(NULL, 0)))
        goto fail;
    while ((len = hread(hf, buf, sizeof(buf))) > 0) {
        if (mfwrite(buf, len, 1, mf) <= 0) {
            hclose_abruptly(hf);
            goto fail;
        }
    }
    if (hclose(hf) < 0 || len < 0) {
        hts_log_warning("Failed to read reference \"%s\": %s", path, strerror(errno));
        goto fail;
    }

    free(path);
    mrewind(mf);
    return mf;

 fail:
    mfdestroy(mf);
    free(path);
    return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2018, %rsp           # imm = 0x2018
movl $0x1, %edx
callq 0x5776e
testq %rax, %rax
je 0x57756
movq %rax, %rbx
leaq 0x40fcc(%rip), %rsi     # 0x985cb
movq %rax, %rdi
xorl %eax, %eax
callq 0xfe44
testq %rax, %rax
je 0x576c2
movq %rax, %r15
xorl %r14d, %r14d
xorl %edi, %edi
xorl %esi, %esi
callq 0x56962
testq %rax, %rax
je 0x57746
movq %rbx, 0x8(%rsp)
movq %rax, %r14
leaq 0x10(%rsp), %r12
movq 0x8(%r15), %rbx
movq 0x10(%r15), %r13
subq %rbx, %r13
movl $0x2000, %eax           # imm = 0x2000
cmpq %rax, %r13
movl $0x2000, %ebp           # imm = 0x2000
cmovbq %r13, %rbp
movq %r12, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
callq 0x43c0
addq %rbp, %rbx
movq %rbx, 0x8(%r15)
movl $0x2000, %esi           # imm = 0x2000
cmpq $0x1fff, %r13           # imm = 0x1FFF
ja 0x5769b
testb $0x2, 0x30(%r15)
je 0x57693
movl $0x2000, %edx           # imm = 0x2000
movq %r15, %rdi
movq %r12, %rsi
movq %rbp, %rcx
callq 0xf129
movq %rax, %r13
testq %r13, %r13
jle 0x576f0
movq %r13, %rsi
movl $0x1, %edx
movq %r12, %rdi
movq %r14, %rcx
callq 0x57154
testq %rax, %rax
jne 0x57637
movq %r15, %rdi
callq 0xf53f
movq 0x8(%rsp), %rbx
jmp 0x57746
callq 0x4050
movl (%rax), %edi
cmpl $0x2, %edi
jne 0x576d3
xorl %r14d, %r14d
jmp 0x57746
callq 0x4150
leaq 0x442b8(%rip), %rsi     # 0x9b997
leaq 0x442bf(%rip), %rdx     # 0x9b9a5
xorl %r14d, %r14d
movl $0x3, %edi
jmp 0x57739
movq %r15, %rdi
callq 0xf4df
testq %r13, %r13
jne 0x57715
testl %eax, %eax
js 0x57715
movq 0x8(%rsp), %rdi
callq 0x45c0
movq %r14, %rdi
callq 0x5705f
jmp 0x57759
callq 0x4050
movl (%rax), %edi
callq 0x4150
leaq 0x4426f(%rip), %rsi     # 0x9b997
leaq 0x44298(%rip), %rdx     # 0x9b9c7
movl $0x3, %edi
movq 0x8(%rsp), %rbx
movq %rbx, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0x13de5
movq %r14, %rdi
callq 0x56f71
movq %rbx, %rdi
callq 0x45c0
xorl %r14d, %r14d
movq %r14, %rax
addq $0x2018, %rsp           # imm = 0x2018
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/open_trace_file.c
// Function: find_file_dir
static mFILE *find_file_dir(const char *file, char *dirname) {
    char *path;
    mFILE *mf = NULL;

    path = expand_path(file, dirname, INT_MAX);
    if (!path)
        return NULL;

    if (is_file(path))
        mf = mfopen(path, "rbm");

    free(path);
    return mf;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x98, %rsp
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
callq 0x5776e
testq %rax, %rax
je 0x57ba2
movq %rax, %rbx
leaq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0x4420
xorl %r14d, %r14d
testl %eax, %eax
jne 0x57b98
movl $0xf000, %eax           # imm = 0xF000
andl 0x20(%rsp), %eax
cmpl $0x8000, %eax           # imm = 0x8000
jne 0x57b98
leaq 0x43e75(%rip), %rsi     # 0x9ba02
movq %rbx, %rdi
callq 0x56df5
movq %rax, %r14
movq %rbx, %rdi
callq 0x45c0
jmp 0x57ba5
xorl %r14d, %r14d
movq %r14, %rax
addq $0x98, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/open_trace_file.c
// Function: find_path
char *find_path(const char *file, const char *path) {
    char *newsearch;
    char *ele;
    char *outpath = NULL;

    /* Use path first */
    if (!path)
        path = getenv("RAWDATA");
    if (NULL == (newsearch = tokenise_search_path(path)))
        return NULL;

    for (ele = newsearch; *ele; ele += strlen(ele)+1) {
        char *ele2 = (*ele == '|') ? ele+1 : ele;

        if (!strncmp(ele2, "URL=", 4) ||
            !strncmp(ele2, "http:", 5) ||
            !strncmp(ele2, "https:", 6) ||
            !strncmp(ele2, "ftp:", 4)) {
            continue;
        } else {
            outpath = expand_path(file, ele2, INT_MAX);
            if (is_file(outpath)) {
                free(newsearch);
                return outpath;
            } else {
                free(outpath);
            }
        }
    }

    free(newsearch);

    return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdi, (%rsp)
testq %rsi, %rsi
jne 0x57bdc
leaq 0x43e15(%rip), %rdi     # 0x9b9e9
callq 0x4600
movq %rax, %rsi
movq %rsi, %rdi
callq 0x57338
testq %rax, %rax
je 0x57cd4
movq %rax, %rbp
movb (%rax), %al
testb %al, %al
je 0x57cc8
leaq 0x43df0(%rip), %r15     # 0x9b9f1
leaq 0x43d75(%rip), %r12     # 0x9b97d
leaq 0x43d78(%rip), %r13     # 0x9b987
movq %rbp, %r14
xorl %ebx, %ebx
cmpb $0x7c, %al
sete %bl
addq %r14, %rbx
movl $0x4, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4210
testl %eax, %eax
je 0x57caf
movl $0x5, %edx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x4210
testl %eax, %eax
je 0x57caf
movl $0x6, %edx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x4210
testl %eax, %eax
je 0x57caf
movl $0x4, %edx
movq %rbx, %rdi
leaq 0x43d2b(%rip), %rsi     # 0x9b992
callq 0x4210
testl %eax, %eax
je 0x57caf
movq (%rsp), %rdi
movq %rbx, %rsi
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
callq 0x5776e
movq %rax, %rbx
movq %rax, %rdi
leaq 0x8(%rsp), %rsi
callq 0x4420
testl %eax, %eax
jne 0x57ca7
movl 0x20(%rsp), %eax
movl $0xf000, %ecx           # imm = 0xF000
andl %ecx, %eax
cmpl $0x8000, %eax           # imm = 0x8000
je 0x57cca
movq %rbx, %rdi
callq 0x45c0
movq %r14, %rdi
callq 0x41d0
addq %rax, %r14
incq %r14
movb (%r14), %al
testb %al, %al
jne 0x57c12
xorl %ebx, %ebx
movq %rbp, %rdi
callq 0x45c0
jmp 0x57cd6
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/pooled_alloc.c
// Function: pool_create
pool_alloc_t *pool_create(size_t dsize) {
    pool_alloc_t *p;

    if (NULL == (p = (pool_alloc_t *)malloc(sizeof(*p))))
        return NULL;

    /* Minimum size is a pointer, for free list */
    dsize = (dsize + sizeof(void *) - 1) & ~(sizeof(void *)-1);
    if (dsize < sizeof(void *))
        dsize = sizeof(void *);
    p->dsize = dsize;
    p->psize = MIN(PSIZE, next_power_2(p->dsize*1024));

    p->npools = 0;
    p->pools = NULL;
    p->free  = NULL;

    return p;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0x28, %edi
callq 0x4680
testq %rax, %rax
je 0x57d63
addq $0x7, %rbx
movq %rbx, %rcx
andq $-0x8, %rcx
cmpq $0x8, %rbx
movl $0x8, %edx
cmovaeq %rcx, %rdx
movq %rdx, (%rax)
shll $0xa, %edx
decl %edx
movl %edx, %ecx
shrl %ecx
orl %edx, %ecx
movl %ecx, %edx
shrl $0x2, %edx
orl %ecx, %edx
movl %edx, %ecx
shrl $0x4, %ecx
orl %edx, %ecx
movl %ecx, %edx
shrl $0x8, %edx
orl %ecx, %edx
movl %edx, %ecx
shrl $0x10, %ecx
orl %edx, %ecx
incl %ecx
movl $0x100000, %edx         # imm = 0x100000
cmpl %edx, %ecx
cmovgel %edx, %ecx
movslq %ecx, %rcx
movq %rcx, 0x8(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movq $0x0, 0x20(%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/pooled_alloc.c
// Function: pool_destroy
void pool_destroy(pool_alloc_t *p) {
    size_t i;

    for (i = 0; i < p->npools; i++) {
        free(p->pools[i].pool);
    }
    free(p->pools);
    free(p);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpq $0x0, 0x10(%rdi)
je 0x57d94
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x18(%rbx), %rax
movq (%rax,%r14), %rdi
callq 0x45c0
incq %r15
addq $0x10, %r14
cmpq 0x10(%rbx), %r15
jb 0x57d7a
movq 0x18(%rbx), %rdi
callq 0x45c0
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x45c0
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/pooled_alloc.c
// Function: pool_alloc
void *pool_alloc(pool_alloc_t *p) {
    pool_t *pool;
    void *ret;

    /* Look on free list */
    if (NULL != p->free) {
        ret = p->free;
        p->free = *((void **)p->free);
        return ret;
    }

    /* Look for space in the last pool */
    if (p->npools) {
        pool = &p->pools[p->npools - 1];
        if (pool->used + p->dsize < p->psize) {
            ret = ((char *) pool->pool) + pool->used;
            pool->used += p->dsize;
            return ret;
        }
    }

    /* Need a new pool */
    pool = new_pool(p);
    if (NULL == pool) return NULL;

    pool->used = p->dsize;
    return pool->pool;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x20(%rdi), %r14
testq %r14, %r14
je 0x57dda
movq (%r14), %rax
movq %rax, 0x20(%rbx)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%rbx), %rsi
testq %rsi, %rsi
je 0x57e10
movq 0x18(%rbx), %rdi
movq %rsi, %rax
shlq $0x4, %rax
movq -0x8(%rdi,%rax), %r14
movq (%rbx), %r13
movq 0x8(%rbx), %r12
leaq (%r14,%r13), %rcx
cmpq %r12, %rcx
jae 0x57e1b
addq %rax, %rdi
addq -0x10(%rdi), %r14
movq %rcx, -0x8(%rdi)
jmp 0x57dc8
movq (%rbx), %r13
movq 0x8(%rbx), %r12
movq 0x18(%rbx), %rdi
shlq $0x4, %rsi
addq $0x10, %rsi
callq 0x4840
testq %rax, %rax
je 0x57e7c
movq %rax, %r15
xorl %r14d, %r14d
movq %r12, %rax
xorl %edx, %edx
divq %r13
movq %r15, 0x18(%rbx)
movq (%rbx), %r12
movq 0x10(%rbx), %r13
movq %r13, %rbp
shlq $0x4, %rbp
imulq %r12, %rax
movq %rax, %rdi
callq 0x4680
movq %rax, (%r15,%rbp)
testq %rax, %rax
je 0x57dc8
addq %rbp, %r15
incq %r13
movq %r13, 0x10(%rbx)
movq %r12, 0x8(%r15)
movq %rax, %r14
jmp 0x57dc8
xorl %r14d, %r14d
jmp 0x57dc8
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/string_alloc.c
// Function: string_pool_create
string_alloc_t *string_pool_create(size_t max_length) {
    string_alloc_t *a_str;

    if (NULL == (a_str = (string_alloc_t *)malloc(sizeof(*a_str)))) {
        return NULL;
    }

    if (max_length < MIN_STR_SIZE) max_length = MIN_STR_SIZE;

    a_str->nstrings    = 0;
    a_str->max_strings = 0;
    a_str->max_length  = max_length;
    a_str->strings     = NULL;

    return a_str;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0x20, %edi
callq 0x4680
testq %rax, %rax
je 0x57ec5
cmpq $0x401, %rbx            # imm = 0x401
movl $0x400, %ecx            # imm = 0x400
cmovaeq %rbx, %rcx
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movq %rcx, (%rax)
movq $0x0, 0x18(%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/string_alloc.c
// Function: string_pool_destroy
void string_pool_destroy(string_alloc_t *a_str) {
    size_t i;

    for (i = 0; i < a_str->nstrings; i++) {
        free(a_str->strings[i].str);
    }

    free(a_str->strings);
    free(a_str);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpq $0x0, 0x8(%rdi)
je 0x57ef6
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x18(%rbx), %rax
movq (%rax,%r14), %rdi
callq 0x45c0
incq %r15
addq $0x10, %r14
cmpq 0x8(%rbx), %r15
jb 0x57edc
movq 0x18(%rbx), %rdi
callq 0x45c0
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x45c0
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/string_alloc.c
// Function: string_alloc
char *string_alloc(string_alloc_t *a_str, size_t length) {
    string_t *str;
    char *ret;

    if (length <= 0) return NULL;

    // add to last string pool if we have space
    if (a_str->nstrings) {
        str = &a_str->strings[a_str->nstrings - 1];

        if (str->used + length < a_str->max_length) {
            ret = str->str + str->used;
            str->used += length;
            return ret;
        }
    }

    // increase the max length if needs be
    if (length > a_str->max_length) a_str->max_length = length;

    // need a new string pool
    str = new_string_pool(a_str);

    if (NULL == str) return NULL;

    str->used = length;
    return str->str;
}

// Assembly:
testq %rsi, %rsi
je 0x57f9d
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rdi
movq 0x8(%r14), %r12
testq %r12, %r12
je 0x57f56
movq 0x18(%r14), %rcx
movq %r12, %rsi
shlq $0x4, %rsi
movq -0x8(%rcx,%rsi), %rax
leaq (%rax,%rbx), %rdx
cmpq %rdi, %rdx
jae 0x57f56
addq %rsi, %rcx
addq -0x10(%rcx), %rax
movq %rdx, -0x8(%rcx)
jmp 0x57fcb
cmpq %rbx, %rdi
jae 0x57f61
movq %rbx, (%r14)
movq %rbx, %rdi
cmpq 0x10(%r14), %r12
jne 0x57fa0
movq %r12, %r13
shrq $0x2, %r13
orq %r12, %r13
incq %r13
movq 0x18(%r14), %rdi
movq %r13, %rsi
shlq $0x4, %rsi
callq 0x4840
testq %rax, %rax
je 0x57fc9
movq %rax, %r15
movq %rax, 0x18(%r14)
movq %r13, 0x10(%r14)
movq (%r14), %rdi
movq 0x8(%r14), %r12
jmp 0x57fa4
xorl %eax, %eax
retq
movq 0x18(%r14), %r15
movq %r12, %r13
shlq $0x4, %r13
callq 0x4680
movq %rax, (%r15,%r13)
testq %rax, %rax
je 0x57fc9
addq %r13, %r15
incq %r12
movq %r12, 0x8(%r14)
movq %rbx, 0x8(%r15)
jmp 0x57fcb
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/string_alloc.c
// Function: string_ndup
char *string_ndup(string_alloc_t *a_str, const char *instr, size_t len) {
    char *str = string_alloc(a_str, len + 1);

    if (NULL == str) return NULL;

    memcpy(str, instr, len);
    str[len] = 0;

    return str;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
leaq 0x1(%rdx), %rsi
callq 0x57f0c
movq %rax, %r15
testq %rax, %rax
je 0x5804a
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x43c0
movb $0x0, (%r15,%rbx)
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
nop