LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_codecs.c
// Function: cram_xdelta_decode_block
int cram_xdelta_decode_block(cram_slice *slice, cram_codec *c, cram_block *in,
                             char *out_, int *out_size) {
    cram_block *out = (cram_block *)out_;
    cram_block *b = c->u.e_xdelta.sub_codec->get_block(slice, c->u.e_xdelta.sub_codec);
    int i = 0;

    const int w = c->u.xdelta.word_size;
    uint32_t npad = (w - *out_size%w)%w;
    uint32_t out_sz = *out_size + npad;
    c->u.xdelta.last = 0;  // reset for each new array

    for (i = 0; i < out_sz; i += w) {
        uint16_t v;
        // Need better interface
        char *cp = (char *)b->data + b->byte;
        char *cp_end = (char *)b->data + b->uncomp_size;
        int err = 0;
        v = c->vv->varint_get32(&cp, cp_end, &err);
        if (err)
            return -1;
        b->byte = cp - (char *)b->data;

        switch(w) {
        case 2: {
            int16_t d = unzigzag16(v), z;
            c->u.xdelta.last = d + c->u.xdelta.last;
            z = le_int2(c->u.xdelta.last);
            BLOCK_APPEND(out, &z, 2-npad);
            npad = 0;
            break;
        }
        default:
            fprintf(stderr, "Unsupported word size by XDELTA\n");
            return -1;
        }
    }

    return 0;

 block_err:
    return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, %r12
movq %rcx, %rbx
movq %rsi, %r14
movq 0x78(%rsi), %rsi
callq *0x50(%rsi)
movq %rax, %r15
movzbl 0x68(%r14), %eax
movzwl %ax, %eax
movl (%r12), %ecx
movl %eax, %r12d
movl %ecx, %eax
cltd
idivl %r12d
movl %r12d, %eax
subl %edx, %eax
cwtd
idivw %r12w
movswl %dx, %eax
movq %r14, 0x18(%rsp)
movq $0x0, 0x60(%r14)
addl %eax, %ecx
movl %ecx, 0x14(%rsp)
je 0x8e796
movl $0x2, %r13d
subl %eax, %r13d
xorl %ebp, %ebp
movq 0x20(%r15), %rax
movq 0x30(%r15), %rcx
addq %rax, %rcx
movq %rcx, 0x20(%rsp)
movslq 0x14(%r15), %rsi
addq %rax, %rsi
movl $0x0, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rax
leaq 0x20(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq *0x18(%rax)
cmpl $0x0, 0x10(%rsp)
jne 0x8e79f
movq 0x20(%rsp), %rcx
subq 0x20(%r15), %rcx
movq %rcx, 0x30(%r15)
cmpb $0x2, %r12b
jne 0x8e79a
movl %r12d, %r14d
movzwl %ax, %ecx
shrl %ecx
andl $0x1, %eax
negl %eax
xorl %ecx, %eax
movswq %ax, %rax
movq 0x18(%rsp), %rcx
addq 0x60(%rcx), %rax
movq %rax, 0x60(%rcx)
movw %ax, 0xe(%rsp)
movq 0x30(%rbx), %r12
addq %r13, %r12
movq 0x28(%rbx), %rax
cmpq %r12, %rax
ja 0x8e762
leaq 0x320(%rax), %rcx
shrq $0x2, %rcx
addq %rcx, %rax
addq $0x320, %rax            # imm = 0x320
cmpq %r12, %rax
cmovaq %rax, %r12
movq 0x20(%rbx), %rdi
movq %r12, %rsi
callq 0x4840
testq %rax, %rax
je 0x8e79f
movq %r12, 0x28(%rbx)
movq %rax, 0x20(%rbx)
testq %r13, %r13
je 0x8e780
movq 0x20(%rbx), %rdi
addq 0x30(%rbx), %rdi
leaq 0xe(%rsp), %rsi
movq %r13, %rdx
callq 0x43c0
addq %r13, 0x30(%rbx)
movl %r14d, %r12d
addl %r14d, %ebp
movl $0x2, %r13d
cmpl 0x14(%rsp), %ebp
jb 0x8e6a2
xorl %eax, %eax
jmp 0x8e7a4
callq 0x4c4f
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x28, %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_codecs.c
// Function: cram_xdelta_decode_free
void cram_xdelta_decode_free(cram_codec *c) {
    if (!c) return;

    if (c->u.xdelta.sub_codec)
        c->u.xdelta.sub_codec->free(c->u.xdelta.sub_codec);

    free(c);
}

// Assembly:
testq %rdi, %rdi
je 0x8e7d1
pushq %rbx
movq %rdi, %rbx
movq 0x78(%rdi), %rdi
testq %rdi, %rdi
je 0x8e7c8
callq *0x20(%rdi)
movq %rbx, %rdi
popq %rbx
jmp 0x45c0
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_codecs.c
// Function: cram_xdelta_encode_char
int cram_xdelta_encode_char(cram_slice *slice, cram_codec *c,
                            char *in, int in_size) {
    char *dat = malloc(in_size*5);
    if (!dat)
        return -1;
    char *cp = dat, *cp_end = dat + in_size*5;

    c->u.e_xdelta.last = 0; // reset for each new array
    if (c->u.e_xdelta.word_size == 2) {
        int i, part;

        part = in_size%2;
        if (part) {
            uint16_t z = in[0];
            c->u.e_xdelta.last = le_int2(z);
            cp += c->vv->varint_put32(cp, cp_end, zigzag16(c->u.e_xdelta.last));
        }

        uint16_t *in16 = (uint16_t *)(in+part);
        for (i = 0; i < in_size/2; i++) {
            uint16_t d = le_int2(in16[i]) - c->u.e_xdelta.last;
            c->u.e_xdelta.last = le_int2(in16[i]);
            cp += c->vv->varint_put32(cp, cp_end, zigzag16(d));
        }
    }
    if (c->u.e_xdelta.sub_codec->encode(slice, c->u.e_xdelta.sub_codec,
                                      (char *)dat, cp-dat)) {
        free(dat);
        return -1;
    }

    free(dat);
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %r12d
movq %rdx, %r13
movq %rsi, %r15
movq %rdi, %rbx
leal (%r12,%r12,4), %eax
movslq %eax, %rbp
movq %rbp, %rdi
callq 0x4680
testq %rax, %rax
je 0x8ee0b
movq %rbx, 0x10(%rsp)
movq $0x0, 0x60(%r15)
cmpb $0x2, 0x68(%r15)
movq %rax, 0x8(%rsp)
movq %rax, %r14
jne 0x8eddf
movq 0x8(%rsp), %rbx
addq %rbx, %rbp
movl %r12d, %eax
shrl $0x1f, %eax
addl %r12d, %eax
andl $-0x2, %eax
movl %r12d, %ecx
movq %rbx, %r14
subl %eax, %ecx
je 0x8ed96
movsbq (%r13), %rax
movq %rax, 0x60(%r15)
movl %ecx, %r14d
movq 0x10(%r15), %rcx
leal (%rax,%rax), %edx
sarl $0xf, %eax
xorl %edx, %eax
movzwl %ax, %edx
movq %rbx, %rdi
movq %rbp, %rsi
callq *0x38(%rcx)
movl %r14d, %ecx
cltq
movq %rbx, %r14
addq %rax, %r14
cmpl $0x2, %r12d
jl 0x8eddf
movslq %ecx, %rax
addq %rax, %r13
shrl %r12d
xorl %ebx, %ebx
movswq (%r13,%rbx,2), %rax
movzwl 0x60(%r15), %ecx
movq %rax, 0x60(%r15)
subw %cx, %ax
cwtl
movq 0x10(%r15), %rcx
leal (%rax,%rax), %edx
sarl $0xf, %eax
xorl %edx, %eax
movzwl %ax, %edx
movq %r14, %rdi
movq %rbp, %rsi
callq *0x38(%rcx)
cltq
addq %rax, %r14
incq %rbx
cmpq %rbx, %r12
jne 0x8eda7
movq 0x78(%r15), %rsi
movq 0x8(%rsp), %rbx
subl %ebx, %r14d
movq 0x10(%rsp), %rdi
movq %rbx, %rdx
movl %r14d, %ecx
callq *0x30(%rsi)
movl %eax, %ebp
movq %rbx, %rdi
callq 0x45c0
xorl %eax, %eax
negl %ebp
sbbl %eax, %eax
jmp 0x8ee10
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_codecs.c
// Function: cram_xdelta_encode_free
void cram_xdelta_encode_free(cram_codec *c) {
    if (!c) return;

    if (c->u.e_xdelta.sub_codec)
        c->u.e_xdelta.sub_codec->free(c->u.e_xdelta.sub_codec);

    cram_free_block(c->out);

    free(c);
}

// Assembly:
testq %rdi, %rdi
je 0x8ee46
pushq %rbx
movq %rdi, %rbx
movq 0x78(%rdi), %rdi
testq %rdi, %rdi
je 0x8ee34
callq *0x20(%rdi)
movq 0x8(%rbx), %rdi
callq 0x4ceb6
movq %rbx, %rdi
popq %rbx
jmp 0x45c0
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_codecs.c
// Function: cram_xdelta_encode_init
cram_codec *cram_xdelta_encode_init(cram_stats *st,
                                    enum cram_encoding codec,
                                    enum cram_external_type option,
                                    void *dat,
                                    int version, varint_vec *vv) {
    cram_codec *c;

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

    c->codec  = E_XDELTA;
    c->free   = cram_xdelta_encode_free;
    if (option == E_LONG)
        c->encode = cram_xdelta_encode_long;
    else if (option == E_INT)
        c->encode = cram_xdelta_encode_int;
    else
        c->encode = cram_xdelta_encode_char;
    c->store  = cram_xdelta_encode_store;
    c->flush  = cram_xdelta_encode_flush;

    cram_xdelta_encoder *e = (cram_xdelta_encoder *)dat;
    c->u.e_xdelta.word_size = e->word_size;
    c->u.e_xdelta.last = 0;
    c->u.e_xdelta.sub_codec = cram_encoder_init(e->sub_encoding, NULL,
                                                E_BYTE_ARRAY,
                                                e->sub_codec_dat,
                                                version, vv);

    return c;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %r9, %rbx
movl %r8d, %ebp
movq %rcx, %r15
movl %edx, %r12d
movl $0x880, %edi            # imm = 0x880
callq 0x4680
movq %rax, %r14
testq %rax, %rax
je 0x8eeec
movl $0x35, (%r14)
leaq -0x5c(%rip), %rax       # 0x8ee1f
movq %rax, 0x20(%r14)
cmpl $0x1, %r12d
leaq -0x199(%rip), %rax      # 0x8ecf1
leaq -0x19a(%rip), %rcx      # 0x8ecf7
cmoveq %rax, %rcx
cmpl $0x2, %r12d
leaq -0x1b5(%rip), %rax      # 0x8eceb
cmovneq %rcx, %rax
movq %rax, 0x30(%r14)
leaq -0x392(%rip), %rax      # 0x8eb1d
movq %rax, 0x38(%r14)
leaq -0x53f(%rip), %rax      # 0x8e97b
movq %rax, 0x48(%r14)
movb 0x8(%r15), %al
movb %al, 0x68(%r14)
movq $0x0, 0x60(%r14)
movl 0xc(%r15), %edi
movq 0x10(%r15), %rcx
xorl %esi, %esi
movl $0x4, %edx
movl %ebp, %r8d
movq %rbx, %r9
callq 0x8e4cb
movq %rax, 0x78(%r14)
movq %r14, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_codecs.c
// Function: cram_xrle_decode_free
void cram_xrle_decode_free(cram_codec *c) {
    if (!c) return;

    if (c->u.xrle.len_codec)
        c->u.xrle.len_codec->free(c->u.xrle.len_codec);

    if (c->u.xrle.lit_codec)
        c->u.xrle.lit_codec->free(c->u.xrle.lit_codec);

    free(c);
}

// Assembly:
testq %rdi, %rdi
je 0x8f15c
pushq %rbx
movq %rdi, %rbx
movq 0x78(%rdi), %rdi
testq %rdi, %rdi
je 0x8f144
callq *0x20(%rdi)
movq 0x80(%rbx), %rdi
testq %rdi, %rdi
je 0x8f153
callq *0x20(%rdi)
movq %rbx, %rdi
popq %rbx
jmp 0x45c0
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_codecs.c
// Function: cram_xrle_encode_char
int cram_xrle_encode_char(cram_slice *slice, cram_codec *c,
                          char *in, int in_size) {
    if (c->u.e_xrle.to_flush) {
        if (!c->out && !(c->out = cram_new_block(0, 0)))
            return -1;
        BLOCK_APPEND(c->out, c->u.e_xrle.to_flush, c->u.e_xrle.to_flush_size);
        c->u.e_xrle.to_flush = NULL;
        c->u.e_xrle.to_flush_size = 0;
    }

    if (c->out && BLOCK_SIZE(c->out) > 0) {
        // Gathering data
        BLOCK_APPEND(c->out, in, in_size);
        return 0;
    }

    // else cache copy of the data we're about to send to flush instead.
    c->u.e_xrle.to_flush = in;
    c->u.e_xrle.to_flush_size = in_size;
    return 0;

 block_err:
    return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %ebp
movq %rdx, %r13
movq %rsi, %r14
movq 0x490(%rsi), %r12
testq %r12, %r12
je 0x8fc31
leaq 0x490(%r14), %rbx
movq 0x8(%r14), %r15
testq %r15, %r15
jne 0x8fbac
xorl %edi, %edi
xorl %esi, %esi
callq 0x4c675
movq %rax, 0x8(%r14)
testq %rax, %rax
je 0x8fcbc
movq %rax, %r15
movq (%rbx), %r12
movq %rbx, 0x8(%rsp)
movq %r13, 0x10(%rsp)
movq 0x498(%r14), %r13
movq 0x30(%r15), %rbx
addq %r13, %rbx
movq 0x28(%r15), %rax
cmpq %rbx, %rax
ja 0x8fc05
leaq 0x320(%rax), %rcx
shrq $0x2, %rcx
addq %rcx, %rax
addq $0x320, %rax            # imm = 0x320
cmpq %rbx, %rax
cmovaq %rax, %rbx
movq 0x20(%r15), %rdi
movq %rbx, %rsi
callq 0x4840
testq %rax, %rax
je 0x8fcbc
movq %rbx, 0x28(%r15)
movq %rax, 0x20(%r15)
testq %r13, %r13
je 0x8fc21
movq 0x20(%r15), %rdi
addq 0x30(%r15), %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x43c0
addq %r13, 0x30(%r15)
xorps %xmm0, %xmm0
movq 0x8(%rsp), %rax
movups %xmm0, (%rax)
movq 0x10(%rsp), %r13
movq 0x8(%r14), %rbx
testq %rbx, %rbx
je 0x8fca6
movq 0x30(%rbx), %r15
testq %r15, %r15
je 0x8fca6
movslq %ebp, %r14
addq %r14, %r15
movq 0x28(%rbx), %rax
cmpq %r15, %rax
ja 0x8fc86
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 0x8fcbc
movq %r15, 0x28(%rbx)
movq %rax, 0x20(%rbx)
xorl %r15d, %r15d
testl %ebp, %ebp
je 0x8fcc2
movq 0x20(%rbx), %rdi
addq 0x30(%rbx), %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x43c0
addq %r14, 0x30(%rbx)
jmp 0x8fcc2
movq %r13, 0x490(%r14)
movslq %ebp, %rax
movq %rax, 0x498(%r14)
xorl %r15d, %r15d
jmp 0x8fcc2
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
movl %r15d, %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_codecs.c
// Function: cram_xrle_encode_free
void cram_xrle_encode_free(cram_codec *c) {
    if (!c) return;

    if (c->u.e_xrle.len_codec)
        c->u.e_xrle.len_codec->free(c->u.e_xrle.len_codec);
    if (c->u.e_xrle.lit_codec)
        c->u.e_xrle.lit_codec->free(c->u.e_xrle.lit_codec);

    cram_free_block(c->out);

    free(c);
}

// Assembly:
testq %rdi, %rdi
je 0x8fd0a
pushq %rbx
movq %rdi, %rbx
movq 0x78(%rdi), %rdi
testq %rdi, %rdi
je 0x8fce9
callq *0x20(%rdi)
movq 0x80(%rbx), %rdi
testq %rdi, %rdi
je 0x8fcf8
callq *0x20(%rdi)
movq 0x8(%rbx), %rdi
callq 0x4ceb6
movq %rbx, %rdi
popq %rbx
jmp 0x45c0
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_codecs.c
// Function: cram_xrle_encode_init
cram_codec *cram_xrle_encode_init(cram_stats *st,
                                  enum cram_encoding codec,
                                  enum cram_external_type option,
                                  void *dat,
                                  int version, varint_vec *vv) {
    cram_codec *c;

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

    c->codec  = E_XRLE;
    c->free   = cram_xrle_encode_free;
    if (option == E_LONG)
        c->encode = cram_xrle_encode_long;
    else if (option == E_INT)
        c->encode = cram_xrle_encode_int;
    else
        c->encode = cram_xrle_encode_char;
    c->store  = cram_xrle_encode_store;
    c->flush  = cram_xrle_encode_flush;

    cram_xrle_encoder *e = (cram_xrle_encoder *)dat;

    c->u.e_xrle.len_codec = cram_encoder_init(e->len_encoding, NULL,
                                              E_BYTE, e->len_dat,
                                              version, vv);
    c->u.e_xrle.lit_codec = cram_encoder_init(e->lit_encoding, NULL,
                                              E_BYTE, e->lit_dat,
                                              version, vv);
    c->u.e_xrle.cur_lit = -1;
    c->u.e_xrle.cur_len = -1;
    c->u.e_xrle.to_flush = NULL;
    c->u.e_xrle.to_flush_size = 0;

    memcpy(c->u.e_xrle.rep_score, e->rep_score, 256*sizeof(*c->u.e_xrle.rep_score));

    return c;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %r9, %r15
movl %r8d, %ebp
movq %rcx, %rbx
movl %edx, %r12d
movl $0x880, %edi            # imm = 0x880
callq 0x4680
movq %rax, %r14
testq %rax, %rax
je 0x8fdf3
movl $0x34, (%r14)
cmpl $0x1, %r12d
leaq -0x1f3(%rip), %rax      # 0x8fb54
leaq -0x1f4(%rip), %rcx      # 0x8fb5a
cmoveq %rax, %rcx
leaq -0x85(%rip), %rax       # 0x8fcd4
cmpl $0x2, %r12d
leaq -0x216(%rip), %rdx      # 0x8fb4e
cmovneq %rcx, %rdx
movq %rax, 0x20(%r14)
movq %rdx, 0x30(%r14)
leaq -0x5fc(%rip), %rax      # 0x8f77b
movq %rax, 0x38(%r14)
leaq -0x9e8(%rip), %rax      # 0x8f39a
movq %rax, 0x48(%r14)
movl (%rbx), %edi
movq 0x8(%rbx), %rcx
xorl %esi, %esi
movl $0x3, %edx
movl %ebp, %r8d
movq %r15, %r9
callq 0x8e4cb
movq %rax, 0x78(%r14)
movl 0x4(%rbx), %edi
movq 0x10(%rbx), %rcx
xorl %esi, %esi
movl $0x3, %edx
movl %ebp, %r8d
movq %r15, %r9
callq 0x8e4cb
movq %rax, 0x80(%r14)
movq $-0x1, 0x88(%r14)
movq %r14, %rdi
addq $0x90, %rdi
addq $0x30, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x490(%r14)
movl $0x400, %edx            # imm = 0x400
movq %rbx, %rsi
callq 0x43c0
movq %r14, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_codecs.c
// Function: cram_subexp_describe
int cram_subexp_describe(cram_codec *c, kstring_t *ks) {
    return ksprintf(ks, "SUBEXP(offset=%d,k=%d)",
                    c->u.subexp.offset,
                    c->u.subexp.k)
        < 0 ? -1 : 0;
}

// Assembly:
pushq %rax
movq %rsi, %rax
movl 0x60(%rdi), %edx
movl 0x64(%rdi), %ecx
leaq 0x12b63(%rip), %rsi     # 0xa2b05
movq %rax, %rdi
xorl %eax, %eax
callq 0x9ab7
sarl $0x1f, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_codecs.c
// Function: cram_subexp_decode_init
cram_codec *cram_subexp_decode_init(cram_block_compression_hdr *hdr,
                                    char *data, int size,
                                    enum cram_encoding codec,
                                    enum cram_external_type option,
                                    int version, varint_vec *vv) {
    cram_codec *c;
    char *cp = data;

    if (option != E_INT) {
        hts_log_error("This codec only supports INT encodings");
        return NULL;
    }

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

    c->codec  = E_SUBEXP;
    c->decode = cram_subexp_decode;
    c->free   = cram_subexp_decode_free;
    c->describe = cram_subexp_describe;
    c->u.subexp.k = -1;

    c->u.subexp.offset = vv->varint_get32(&cp, data + size, NULL);
    c->u.subexp.k      = vv->varint_get32(&cp, data + size, NULL);

    if (cp - data != size || c->u.subexp.k < 0) {
        hts_log_error("Malformed subexp header stream");
        free(c);
        return NULL;
    }

    return c;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, (%rsp)
cmpl $0x1, %r8d
jne 0x90077
movl %edx, %ebp
movq %rsi, %r14
movl $0x880, %edi            # imm = 0x880
callq 0x4680
testq %rax, %rax
je 0x90073
movq %rax, %rbx
movq 0x40(%rsp), %r13
movl $0x7, (%rax)
leaq -0x1f8(%rip), %rax      # 0x8fdff
movq %rax, 0x28(%rbx)
leaq -0x7b(%rip), %rax       # 0x8ff87
movq %rax, 0x20(%rbx)
leaq -0x7c(%rip), %rax       # 0x8ff91
movq %rax, 0x58(%rbx)
movslq %ebp, %rbp
leaq (%r14,%rbp), %r15
movq %rsp, %r12
movq %r12, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq *0x18(%r13)
movl %eax, 0x60(%rbx)
movq %r12, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq *0x18(%r13)
movl %eax, 0x64(%rbx)
movq (%r12), %rcx
subq %r14, %rcx
cmpq %rbp, %rcx
setne %cl
testl %eax, %eax
sets %al
orb %cl, %al
cmpb $0x1, %al
jne 0x90093
leaq 0x12ac4(%rip), %rsi     # 0xa2b1c
leaq 0x12afc(%rip), %rdx     # 0xa2b5b
movl $0x1, %edi
xorl %eax, %eax
callq 0x13de5
movq %rbx, %rdi
callq 0x45c0
xorl %ebx, %ebx
jmp 0x90093
leaq 0x12a9e(%rip), %rsi     # 0xa2b1c
leaq 0x12aaf(%rip), %rdx     # 0xa2b34
xorl %ebx, %ebx
movl $0x1, %edi
xorl %eax, %eax
callq 0x13de5
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/cram_codecs.c
// Function: cram_gamma_decode
int cram_gamma_decode(cram_slice *slice, cram_codec *c, cram_block *in, char *out, int *out_size) {
    int32_t *out_i = (int32_t *)out;
    int i, n;

    for (i = 0, n = *out_size; i < n; i++) {
        int nz = 0;
        int val;
        //while (get_bit_MSB(in) == 0) nz++;
        nz = get_zero_bits_MSB(in);
        if (cram_not_enough_bits(in, nz))
            return -1;
        val = 1;
        while (nz > 0) {
            //val <<= 1; val |= get_bit_MSB(in);
            GET_BIT_MSB(in, val);
            nz--;
        }

        out_i[i] = val - c->u.gamma.offset;
    }

    return 0;
}

// Assembly:
movslq (%r8), %r8
testq %r8, %r8
jle 0x901ae
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %rdi
movq 0x30(%rdx), %r9
xorl %r10d, %r10d
movslq 0x14(%rdx), %r14
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %r14, %r9
jae 0x901a5
movq 0x20(%rdx), %r11
movl 0x38(%rdx), %ecx
movq $-0x1, %r15
movl $0x1, %r12d
movzbl (%r11,%r9), %ebp
shrl %cl, %ebp
movl %r12d, %ebx
subl $0x1, %ecx
movl %ecx, 0x38(%rdx)
jae 0x9011f
movl $0x7, 0x38(%rdx)
incq %r9
movq %r9, 0x30(%rdx)
andl $0x1, %ebp
movl $0x7, %ecx
cmpq %r14, %r9
jne 0x90122
testl %ebp, %ebp
jne 0x90122
jmp 0x901a5
andl $0x1, %ebp
incq %r15
leal 0x1(%rbx), %r12d
testl %ebp, %ebp
je 0x900e9
testl %r15d, %r15d
je 0x90137
cmpq %r9, %r14
jbe 0x901a5
subq %r9, %r14
cmpq $0x10000000, %r14       # imm = 0x10000000
ja 0x90153
movslq %ecx, %r12
leaq (%r12,%r14,8), %r14
addq $-0x7, %r14
cmpq %r15, %r14
jb 0x901a5
movl $0x1, %eax
testl %r15d, %r15d
je 0x90190
movzbl (%r11,%r9), %ebp
xorl %r14d, %r14d
btl %ecx, %ebp
setb %r14b
leal (%r14,%rax,2), %eax
xorl %r14d, %r14d
testl %ecx, %ecx
leal -0x1(%rcx), %ecx
setle %r14b
addq %r14, %r9
movq %r9, 0x30(%rdx)
andl $0x7, %ecx
movl %ecx, 0x38(%rdx)
decl %ebx
cmpl $0x1, %ebx
jg 0x9015d
subl 0x60(%rsi), %eax
movl %eax, (%rdi,%r10,4)
incq %r10
cmpq %r8, %r10
jne 0x900c3
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_codecs.c
// Function: cram_gamma_decode_init
cram_codec *cram_gamma_decode_init(cram_block_compression_hdr *hdr,
                                   char *data, int size,
                                   enum cram_encoding codec,
                                   enum cram_external_type option,
                                   int version, varint_vec *vv) {
    cram_codec *c = NULL;
    char *cp = data;

    if (option != E_INT) {
        hts_log_error("This codec only supports INT encodings");
        return NULL;
    }

    if (size < 1)
        goto malformed;

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

    c->codec  = E_GAMMA;
    c->decode = cram_gamma_decode;
    c->free   = cram_gamma_decode_free;
    c->describe = cram_gamma_describe;

    c->u.gamma.offset = vv->varint_get32(&cp, data+size, NULL);

    if (cp - data != size)
        goto malformed;

    return c;

 malformed:
    hts_log_error("Malformed gamma header stream");
    free(c);
    return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, 0x8(%rsp)
cmpl $0x1, %r8d
jne 0x90262
movl %edx, %ebp
testl %edx, %edx
jle 0x90280
movq %rsi, %r14
movl $0x880, %edi            # imm = 0x880
callq 0x4680
testq %rax, %rax
je 0x902a4
movq %rax, %rbx
movq 0x40(%rsp), %rax
movl $0x9, (%rbx)
leaq -0x17f(%rip), %rcx      # 0x900a5
movq %rcx, 0x28(%rbx)
leaq -0x7e(%rip), %rcx       # 0x901b1
movq %rcx, 0x20(%rbx)
leaq -0x7f(%rip), %rcx       # 0x901bb
movq %rcx, 0x58(%rbx)
movl %ebp, %r12d
leaq (%r14,%r12), %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
xorl %edx, %edx
callq *0x18(%rax)
movl %eax, 0x60(%rbx)
movq (%r15), %rax
subq %r14, %rax
cmpq %r12, %rax
jne 0x90282
jmp 0x902a6
leaq 0x12922(%rip), %rsi     # 0xa2b8b
leaq 0x128c4(%rip), %rdx     # 0xa2b34
xorl %ebx, %ebx
movl $0x1, %edi
xorl %eax, %eax
callq 0x13de5
jmp 0x902a6
xorl %ebx, %ebx
leaq 0x12902(%rip), %rsi     # 0xa2b8b
leaq 0x12912(%rip), %rdx     # 0xa2ba2
movl $0x1, %edi
xorl %eax, %eax
callq 0x13de5
movq %rbx, %rdi
callq 0x45c0
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_codecs.c
// Function: cram_huffman_decode_free
void cram_huffman_decode_free(cram_codec *c) {
    if (!c)
        return;

    if (c->u.huffman.codes)
        free(c->u.huffman.codes);
    free(c);
}

// Assembly:
testq %rdi, %rdi
je 0x902d6
pushq %rbx
movq %rdi, %rbx
movq 0x68(%rdi), %rdi
testq %rdi, %rdi
je 0x902cd
callq 0x45c0
movq %rbx, %rdi
popq %rbx
jmp 0x45c0
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_codecs.c
// Function: cram_huffman_decode_char0
int cram_huffman_decode_char0(cram_slice *slice, cram_codec *c,
                              cram_block *in, char *out, int *out_size) {
    int i, n;

    if (!out)
        return 0;

    /* Special case of 0 length codes */
    for (i = 0, n = *out_size; i < n; i++) {
        out[i] = c->u.huffman.codes[0].symbol;
    }
    return 0;
}

// Assembly:
testq %rcx, %rcx
je 0x902ff
movslq (%r8), %rax
testq %rax, %rax
jle 0x902ff
xorl %edx, %edx
movq 0x68(%rsi), %rdi
movb (%rdi), %dil
movb %dil, (%rcx,%rdx)
incq %rdx
cmpq %rdx, %rax
jne 0x902ec
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_codecs.c
// Function: cram_huffman_decode_char
int cram_huffman_decode_char(cram_slice *slice, cram_codec *c,
                             cram_block *in, char *out, int *out_size) {
    int i, n, ncodes = c->u.huffman.ncodes;
    const cram_huffman_code * const codes = c->u.huffman.codes;

    for (i = 0, n = *out_size; i < n; i++) {
        int idx = 0;
        int val = 0, len = 0, last_len = 0;

        for (;;) {
            int dlen = codes[idx].len - last_len;
            if (cram_not_enough_bits(in, dlen))
                return -1;

            //val <<= dlen;
            //val  |= get_bits_MSB(in, dlen);
            //last_len = (len += dlen);

            last_len = (len += dlen);
            for (; dlen; dlen--) GET_BIT_MSB(in, val);

            idx = val - codes[idx].p;
            if (idx >= ncodes || idx < 0)
                return -1;

            if (codes[idx].code == val && codes[idx].len == len) {
                if (out) out[i] = codes[idx].symbol;
                break;
            }
        }
    }

    return 0;
}

// Assembly:
movslq (%r8), %rdi
testq %rdi, %rdi
jle 0x90439
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl 0x60(%rsi), %r8d
movq 0x68(%rsi), %rsi
xorl %r9d, %r9d
movq %rcx, -0x10(%rsp)
movl 0x10(%rsi), %r15d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %r15d, %r15d
js 0x9042e
movq %r9, -0x8(%rsp)
movslq 0x14(%rdx), %r10
movq 0x30(%rdx), %r11
xorl %ebx, %ebx
movl %r15d, %ebp
movq %rsi, %r14
testl %r15d, %r15d
je 0x9035d
cmpq %r11, %r10
jbe 0x9042e
movq %r10, %r12
subq %r11, %r12
cmpq $0x10000000, %r12       # imm = 0x10000000
ja 0x90387
movslq 0x38(%rdx), %r13
leaq -0x7(,%r12,8), %r12
addq %r13, %r12
movl %r15d, %r13d
cmpq %r13, %r12
jb 0x9042e
testl %r15d, %r15d
je 0x903c8
movq 0x20(%rdx), %r12
movl 0x38(%rdx), %r13d
movzbl (%r12,%r11), %r9d
xorl %ecx, %ecx
btl %r13d, %r9d
setb %cl
leal (%rcx,%rbx,2), %ebx
xorl %ecx, %ecx
testl %r13d, %r13d
leal -0x1(%r13), %r9d
setle %cl
addq %rcx, %r11
movq %r11, 0x30(%rdx)
andl $0x7, %r9d
movl %r9d, 0x38(%rdx)
movl %r9d, %r13d
decl %r15d
jne 0x90394
movl %ebx, %r15d
subl 0x8(%r14), %r15d
cmpl %r8d, %r15d
jge 0x9042e
testl %r15d, %r15d
js 0x9042e
movl %r15d, %ecx
leaq (%rcx,%rcx,2), %rcx
leaq (%rsi,%rcx,8), %r14
movl 0xc(%r14), %ecx
xorl %ebx, %ecx
movl 0x10(%r14), %r12d
movl %r12d, %r9d
xorl %ebp, %r9d
orl %ecx, %r9d
je 0x9040a
movl %r12d, %r15d
subl %ebp, %r15d
movl %r12d, %ebp
jns 0x9034f
jmp 0x9042e
movq -0x10(%rsp), %rcx
testq %rcx, %rcx
movq -0x8(%rsp), %r9
je 0x90420
movb (%r14), %al
movb %al, (%rcx,%r9)
incq %r9
xorl %eax, %eax
cmpq %rdi, %r9
jne 0x90328
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_codecs.c
// Function: cram_huffman_decode_int0
int cram_huffman_decode_int0(cram_slice *slice, cram_codec *c,
                             cram_block *in, char *out, int *out_size) {
    int32_t *out_i = (int32_t *)out;
    int i, n;
    const cram_huffman_code * const codes = c->u.huffman.codes;

    /* Special case of 0 length codes */
    for (i = 0, n = *out_size; i < n; i++) {
        out_i[i] = codes[0].symbol;
    }
    return 0;
}

// Assembly:
movslq (%r8), %rdi
testq %rdi, %rdi
jle 0x9053a
movq 0x68(%rsi), %rax
movl (%rax), %eax
leal 0x3(%rdi), %edx
decq %rdi
movq %rdi, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
shrl $0x2, %edx
shlq $0x4, %rdx
movdqa 0x4403(%rip), %xmm1     # 0x94870
movdqa 0x440b(%rip), %xmm2     # 0x94880
xorl %esi, %esi
movdqa 0x4411(%rip), %xmm3     # 0x94890
pxor %xmm3, %xmm0
pcmpeqd %xmm4, %xmm4
movdqa 0x4411(%rip), %xmm5     # 0x948a0
movdqa %xmm2, %xmm6
pxor %xmm3, %xmm6
movdqa %xmm6, %xmm7
pcmpgtd %xmm0, %xmm7
pcmpeqd %xmm0, %xmm6
pshufd $0xf5, %xmm6, %xmm8     # xmm8 = xmm6[1,1,3,3]
pand %xmm7, %xmm8
pshufd $0xf5, %xmm7, %xmm6     # xmm6 = xmm7[1,1,3,3]
por %xmm8, %xmm6
movd %xmm6, %edi
notl %edi
testb $0x1, %dil
je 0x904c7
movl %eax, (%rcx,%rsi)
pxor %xmm4, %xmm6
pextrw $0x4, %xmm6, %edi
testb $0x1, %dil
je 0x904da
movl %eax, 0x4(%rcx,%rsi)
movdqa %xmm1, %xmm6
pxor %xmm3, %xmm6
movdqa %xmm6, %xmm7
pcmpgtd %xmm0, %xmm7
pcmpeqd %xmm0, %xmm6
pshufd $0xf5, %xmm6, %xmm8     # xmm8 = xmm6[1,1,3,3]
pand %xmm7, %xmm8
pshufd $0xf5, %xmm7, %xmm6     # xmm6 = xmm7[1,1,3,3]
por %xmm8, %xmm6
pxor %xmm4, %xmm6
pextrw $0x0, %xmm6, %edi
testb $0x1, %dil
je 0x90516
movl %eax, 0x8(%rcx,%rsi)
pextrw $0x4, %xmm6, %edi
testb $0x1, %dil
je 0x90525
movl %eax, 0xc(%rcx,%rsi)
paddq %xmm5, %xmm2
paddq %xmm5, %xmm1
addq $0x10, %rsi
cmpq %rsi, %rdx
jne 0x9048f
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_codecs.c
// Function: cram_huffman_decode_int
int cram_huffman_decode_int(cram_slice *slice, cram_codec *c,
                            cram_block *in, char *out, int *out_size) {
    int32_t *out_i = (int32_t *)out;
    int i, n, ncodes = c->u.huffman.ncodes;
    const cram_huffman_code * const codes = c->u.huffman.codes;

    for (i = 0, n = *out_size; i < n; i++) {
        int idx = 0;
        int val = 0, len = 0, last_len = 0;

        // Now one bit at a time for remaining checks
        for (;;) {
            int dlen = codes[idx].len - last_len;
            if (cram_not_enough_bits(in, dlen))
                return -1;

            //val <<= dlen;
            //val  |= get_bits_MSB(in, dlen);
            //last_len = (len += dlen);

            last_len = (len += dlen);
            for (; dlen; dlen--) GET_BIT_MSB(in, val);

            idx = val - codes[idx].p;
            if (idx >= ncodes || idx < 0)
                return -1;

            if (codes[idx].code == val && codes[idx].len == len) {
                out_i[i] = codes[idx].symbol;
                break;
            }
        }
    }

    return 0;
}

// Assembly:
movslq (%r8), %rdi
testq %rdi, %rdi
jle 0x9066f
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl 0x60(%rsi), %r8d
movq 0x68(%rsi), %rsi
xorl %r9d, %r9d
movq %rcx, -0x10(%rsp)
movl 0x10(%rsi), %r15d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %r15d, %r15d
js 0x90664
movq %r9, -0x8(%rsp)
movslq 0x14(%rdx), %r10
movq 0x30(%rdx), %r11
xorl %ebx, %ebx
movl %r15d, %ebp
movq %rsi, %r14
testl %r15d, %r15d
je 0x90598
cmpq %r11, %r10
jbe 0x90664
movq %r10, %r12
subq %r11, %r12
cmpq $0x10000000, %r12       # imm = 0x10000000
ja 0x905c2
movslq 0x38(%rdx), %r13
leaq -0x7(,%r12,8), %r12
addq %r13, %r12
movl %r15d, %r13d
cmpq %r13, %r12
jb 0x90664
testl %r15d, %r15d
je 0x90603
movq 0x20(%rdx), %r12
movl 0x38(%rdx), %r13d
movzbl (%r12,%r11), %r9d
xorl %ecx, %ecx
btl %r13d, %r9d
setb %cl
leal (%rcx,%rbx,2), %ebx
xorl %ecx, %ecx
testl %r13d, %r13d
leal -0x1(%r13), %r9d
setle %cl
addq %rcx, %r11
movq %r11, 0x30(%rdx)
andl $0x7, %r9d
movl %r9d, 0x38(%rdx)
movl %r9d, %r13d
decl %r15d
jne 0x905cf
movl %ebx, %r15d
subl 0x8(%r14), %r15d
cmpl %r8d, %r15d
jge 0x90664
testl %r15d, %r15d
js 0x90664
movl %r15d, %ecx
leaq (%rcx,%rcx,2), %rcx
leaq (%rsi,%rcx,8), %r14
movl 0xc(%r14), %ecx
xorl %ebx, %ecx
movl 0x10(%r14), %r12d
movl %r12d, %r9d
xorl %ebp, %r9d
orl %ecx, %r9d
je 0x90645
movl %r12d, %r15d
subl %ebp, %r15d
movl %r12d, %ebp
jns 0x9058a
jmp 0x90664
movl (%r14), %eax
movq -0x10(%rsp), %rcx
movq -0x8(%rsp), %r9
movl %eax, (%rcx,%r9,4)
incq %r9
xorl %eax, %eax
cmpq %rdi, %r9
jne 0x90563
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_codecs.c
// Function: cram_huffman_decode_long0
int cram_huffman_decode_long0(cram_slice *slice, cram_codec *c,
                              cram_block *in, char *out, int *out_size) {
    int64_t *out_i = (int64_t *)out;
    int i, n;
    const cram_huffman_code * const codes = c->u.huffman.codes;

    /* Special case of 0 length codes */
    for (i = 0, n = *out_size; i < n; i++) {
        out_i[i] = codes[0].symbol;
    }
    return 0;
}

// Assembly:
movslq (%r8), %rdi
testq %rdi, %rdi
jle 0x90714
movq 0x68(%rsi), %rax
movq (%rax), %rax
leal 0x1(%rdi), %edx
decq %rdi
movq %rdi, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
shrl %edx
shlq $0x4, %rdx
movdqa 0x41dd(%rip), %xmm1     # 0x94880
xorl %esi, %esi
movdqa 0x41e3(%rip), %xmm2     # 0x94890
pxor %xmm2, %xmm0
pcmpeqd %xmm3, %xmm3
movdqa 0x6843(%rip), %xmm4     # 0x96f00
movdqa %xmm1, %xmm5
pxor %xmm2, %xmm5
movdqa %xmm5, %xmm6
pcmpgtd %xmm0, %xmm6
pcmpeqd %xmm0, %xmm5
pshufd $0xf5, %xmm5, %xmm7     # xmm7 = xmm5[1,1,3,3]
pand %xmm6, %xmm7
pshufd $0xf5, %xmm6, %xmm5     # xmm5 = xmm6[1,1,3,3]
por %xmm7, %xmm5
movd %xmm5, %edi
notl %edi
testb $0x1, %dil
je 0x906f3
movq %rax, (%rcx,%rsi)
pxor %xmm3, %xmm5
pextrw $0x4, %xmm5, %edi
testb $0x1, %dil
je 0x90707
movq %rax, 0x8(%rcx,%rsi)
paddq %xmm4, %xmm1
addq $0x10, %rsi
cmpq %rsi, %rdx
jne 0x906bd
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_codecs.c
// Function: cram_huffman_describe
int cram_huffman_describe(cram_codec *c, kstring_t *ks) {
    int r = 0, n;
    r |= ksprintf(ks, "HUFFMAN(codes={") < 0;
    for (n = 0; n < c->u.huffman.ncodes; n++) {
        r |= ksprintf(ks, "%s%"PRId64, n?",":"",
                      c->u.huffman.codes[n].symbol);
    }
    r |= ksprintf(ks, "},lengths={") < 0;
    for (n = 0; n < c->u.huffman.ncodes; n++) {
        r |= ksprintf(ks, "%s%d", n?",":"",
                      c->u.huffman.codes[n].len);
    }
    r |= ksprintf(ks, "})") < 0;
    return r;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rax
movq %rdi, %r14
leaq 0x12358(%rip), %rsi     # 0xa2bc0
movq %rax, (%rsp)
movq %rax, %rdi
xorl %eax, %eax
callq 0x9ab7
movl %eax, %ebp
shrl $0x1f, %ebp
cmpl $0x0, 0x60(%r14)
leaq 0x54e6(%rip), %r15      # 0x95d6d
leaq 0x763d(%rip), %rbx      # 0x97ecb
jle 0x908cc
xorl %r12d, %r12d
xorl %r13d, %r13d
testq %r13, %r13
movq %rbx, %rdx
cmoveq %r15, %rdx
movq 0x68(%r14), %rax
movq (%rax,%r12), %rcx
movq (%rsp), %rdi
leaq 0x1231d(%rip), %rsi     # 0xa2bd0
xorl %eax, %eax
callq 0x9ab7
orl %eax, %ebp
incq %r13
movslq 0x60(%r14), %rax
addq $0x18, %r12
cmpq %rax, %r13
jl 0x90896
movq %r15, %r12
leaq 0x12300(%rip), %rsi     # 0xa2bd6
movq (%rsp), %rdi
xorl %eax, %eax
callq 0x9ab7
movl %eax, %r15d
shrl $0x1f, %r15d
orl %ebp, %r15d
cmpl $0x0, 0x60(%r14)
jle 0x9092e
xorl %ebp, %ebp
xorl %r13d, %r13d
testq %rbp, %rbp
movq %rbx, %rdx
cmoveq %r12, %rdx
movq 0x68(%r14), %rax
movl 0x10(%rax,%rbp), %ecx
movq (%rsp), %rdi
leaq 0x122ce(%rip), %rsi     # 0xa2be2
xorl %eax, %eax
callq 0x9ab7
orl %eax, %r15d
incq %r13
movslq 0x60(%r14), %rax
addq $0x18, %rbp
cmpq %rax, %r13
jl 0x908f7
leaq 0x122b2(%rip), %rsi     # 0xa2be7
movq (%rsp), %rdi
xorl %eax, %eax
callq 0x9ab7
shrl $0x1f, %eax
orl %r15d, %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_codecs.c
// Function: cram_huffman_encode_char
int cram_huffman_encode_char(cram_slice *slice, cram_codec *c,
                             char *in, int in_size) {
    int i, code, len, r = 0;
    unsigned char *syms = (unsigned char *)in;

    while (in_size--) {
        int sym = *syms++;
        if (sym >= -1 && sym < MAX_HUFF) {
            i = c->u.e_huffman.val2code[sym+1];
            assert(c->u.e_huffman.codes[i].symbol == sym);
            code = c->u.e_huffman.codes[i].code;
            len  = c->u.e_huffman.codes[i].len;
        } else {
            /* Slow - use a lookup table for when sym < MAX_HUFF? */
            for (i = 0; i < c->u.e_huffman.nvals; i++) {
                if (c->u.e_huffman.codes[i].symbol == sym)
                    break;
            }
            if (i == c->u.e_huffman.nvals)
                return -1;

            code = c->u.e_huffman.codes[i].code;
            len  = c->u.e_huffman.codes[i].len;
        }

        r |= store_bits_MSB(c->out, code, len);
    }

    return r;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testl %ecx, %ecx
je 0x90e69
movl %ecx, %ebp
movq %rdx, %r14
movq %rsi, %r15
xorl %ebx, %ebx
movzbl (%r14), %eax
testb %al, %al
js 0x90e0f
movslq 0x70(%r15,%rax,4), %rdx
movq 0x60(%r15), %rcx
leaq (%rdx,%rdx,2), %rdx
cmpq %rax, (%rcx,%rdx,8)
jne 0x90e78
leaq (%rcx,%rdx,8), %rax
jmp 0x90e45
movslq 0x68(%r15), %rcx
testq %rcx, %rcx
jle 0x90e31
movq 0x60(%r15), %rsi
xorl %edx, %edx
cmpq %rax, (%rsi)
je 0x90e33
incq %rdx
addq $0x18, %rsi
cmpq %rdx, %rcx
jne 0x90e1e
jmp 0x90e62
xorl %edx, %edx
cmpl %ecx, %edx
je 0x90e62
movl %edx, %eax
leaq (%rax,%rax,2), %rax
shlq $0x3, %rax
addq 0x60(%r15), %rax
decl %ebp
incq %r14
movl 0x10(%rax), %edx
movslq 0xc(%rax), %rsi
movq 0x8(%r15), %rdi
callq 0x8d5ad
orl %eax, %ebx
testl %ebp, %ebp
jne 0x90dee
jmp 0x90e6b
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x90e6b
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x11e35(%rip), %rdi     # 0xa2cb4
leaq 0x11e54(%rip), %rsi     # 0xa2cda
leaq 0x11e60(%rip), %rcx     # 0xa2ced
movl $0xba9, %edx            # imm = 0xBA9
callq 0x42f0
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_codecs.c
// Function: cram_huffman_encode_long
int cram_huffman_encode_long(cram_slice *slice, cram_codec *c,
                             char *in, int in_size) {
    int i, code, len, r = 0;
    int64_t *syms = (int64_t *)in;

    while (in_size--) {
        int sym = *syms++;

        if (sym >= -1 && sym < MAX_HUFF) {
            i = c->u.e_huffman.val2code[sym+1];
            assert(c->u.e_huffman.codes[i].symbol == sym);
            code = c->u.e_huffman.codes[i].code;
            len  = c->u.e_huffman.codes[i].len;
        } else {
            /* Slow - use a lookup table for when sym < MAX_HUFFMAN_SYM? */
            for (i = 0; i < c->u.e_huffman.nvals; i++) {
                if (c->u.e_huffman.codes[i].symbol == sym)
                    break;
            }
            if (i == c->u.e_huffman.nvals)
                return -1;

            code = c->u.e_huffman.codes[i].code;
            len  = c->u.e_huffman.codes[i].len;
        }

        r |= store_bits_MSB(c->out, code, len);
    }

    return r;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testl %ecx, %ecx
je 0x9100f
movl %ecx, %ebp
movq %rdx, %r14
movq %rsi, %r15
xorl %ebx, %ebx
movq (%r14), %rcx
leal 0x1(%rcx), %eax
cmpl $0x81, %eax
jae 0x90fad
leal 0x1(%rcx), %eax
movslq 0x6c(%r15,%rax,4), %rdx
movq 0x60(%r15), %rax
leaq (%rdx,%rdx,2), %rdx
movslq %ecx, %rcx
cmpq %rcx, (%rax,%rdx,8)
jne 0x9101e
leaq (%rax,%rdx,8), %rax
jmp 0x90fe6
movslq 0x68(%r15), %rax
testq %rax, %rax
jle 0x90fd2
movq 0x60(%r15), %rdx
movslq %ecx, %rsi
xorl %ecx, %ecx
cmpq %rsi, (%rdx)
je 0x90fd4
incq %rcx
addq $0x18, %rdx
cmpq %rcx, %rax
jne 0x90fbf
jmp 0x91008
xorl %ecx, %ecx
cmpl %eax, %ecx
je 0x91008
movl %ecx, %eax
leaq (%rax,%rax,2), %rax
shlq $0x3, %rax
addq 0x60(%r15), %rax
decl %ebp
addq $0x8, %r14
movl 0x10(%rax), %edx
movslq 0xc(%rax), %rsi
movq 0x8(%r15), %rdi
callq 0x8d5ad
orl %eax, %ebx
testl %ebp, %ebp
jne 0x90f81
jmp 0x91011
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x91011
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x11c8f(%rip), %rdi     # 0xa2cb4
leaq 0x11cae(%rip), %rsi     # 0xa2cda
leaq 0x11d45(%rip), %rcx     # 0xa2d78
movl $0xbf3, %edx            # imm = 0xBF3
callq 0x42f0
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_codecs.c
// Function: cram_huffman_encode_free
void cram_huffman_encode_free(cram_codec *c) {
    if (!c)
        return;

    if (c->u.e_huffman.codes)
        free(c->u.e_huffman.codes);
    free(c);
}

// Assembly:
testq %rdi, %rdi
je 0x9105d
pushq %rbx
movq %rdi, %rbx
movq 0x60(%rdi), %rdi
testq %rdi, %rdi
je 0x91054
callq 0x45c0
movq %rbx, %rdi
popq %rbx
jmp 0x45c0
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_codecs.c
// Function: cram_byte_array_len_decode
int cram_byte_array_len_decode(cram_slice *slice, cram_codec *c,
                               cram_block *in, char *out,
                               int *out_size) {
    /* Fetch length */
    int32_t len = 0, one = 1;
    int r;

    r = c->u.byte_array_len.len_codec->decode(slice, c->u.byte_array_len.len_codec,
                                              in, (char *)&len, &one);
    //printf("ByteArray Len=%d\n", len);

    if (!r && c->u.byte_array_len.val_codec && len >= 0) {
        r = c->u.byte_array_len.val_codec->decode(slice,
                                                  c->u.byte_array_len.val_codec,
                                                  in, out, &len);
    } else {
        return -1;
    }

    *out_size = len;

    return r;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r13
movq %rdi, %r12
leaq 0x8(%rsp), %rcx
movl $0x0, (%rcx)
leaq 0xc(%rsp), %r8
movl $0x1, (%r8)
movq 0x60(%rsi), %rsi
callq *0x28(%rsi)
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %ecx, %ecx
jne 0x9192b
movq 0x68(%r13), %rsi
testq %rsi, %rsi
je 0x9192b
cmpl $0x0, 0x8(%rsp)
js 0x9192b
leaq 0x8(%rsp), %r13
movq %r12, %rdi
movq %r15, %rdx
movq %r14, %rcx
movq %r13, %r8
callq *0x28(%rsi)
movl (%r13), %ecx
movl %ecx, (%rbx)
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_codecs.c
// Function: cram_byte_array_len_decode_free
void cram_byte_array_len_decode_free(cram_codec *c) {
    if (!c) return;

    if (c->u.byte_array_len.len_codec)
        c->u.byte_array_len.len_codec->free(c->u.byte_array_len.len_codec);

    if (c->u.byte_array_len.val_codec)
        c->u.byte_array_len.val_codec->free(c->u.byte_array_len.val_codec);

    free(c);
}

// Assembly:
testq %rdi, %rdi
je 0x91963
pushq %rbx
movq %rdi, %rbx
movq 0x60(%rdi), %rdi
testq %rdi, %rdi
je 0x9194e
callq *0x20(%rdi)
movq 0x68(%rbx), %rdi
testq %rdi, %rdi
je 0x9195a
callq *0x20(%rdi)
movq %rbx, %rdi
popq %rbx
jmp 0x45c0
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_codecs.c
// Function: cram_byte_array_len_describe
int cram_byte_array_len_describe(cram_codec *c, kstring_t *ks) {
    int r = 0;
    r |= ksprintf(ks, "BYTE_ARRAY_LEN(len_codec={") < 0;
    cram_byte_array_len_decoder *l = &c->u.byte_array_len;
    r |=  l->len_codec->describe
        ? l->len_codec->describe(l->len_codec, ks)
        : (ksprintf(ks, "?")<0);
    r |= ksprintf(ks, "},val_codec={") < 0;
    r |=  l->val_codec->describe
        ? l->val_codec->describe(l->val_codec, ks)
        : (ksprintf(ks, "?")<0);
    r |= ksprintf(ks, "}") < 0;

    return r;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r12
leaq 0x11505(%rip), %rsi     # 0xa2e7e
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9ab7
movl %eax, %ebp
movq 0x60(%r12), %rdi
movq 0x58(%rdi), %rax
testq %rax, %rax
je 0x9199d
movq %rbx, %rsi
callq *%rax
movl %eax, %r14d
jmp 0x919b5
leaq 0x665b(%rip), %rsi      # 0x97fff
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9ab7
movl %eax, %r14d
shrl $0x1f, %r14d
leaq 0x114dd(%rip), %rsi     # 0xa2e99
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9ab7
movl %eax, %r15d
movq 0x68(%r12), %rdi
movq 0x58(%rdi), %rax
testq %rax, %rax
je 0x919e1
movq %rbx, %rsi
callq *%rax
movl %eax, %r12d
jmp 0x919f9
leaq 0x6617(%rip), %rsi      # 0x97fff
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9ab7
movl %eax, %r12d
shrl $0x1f, %r12d
orl %ebp, %r15d
shrl $0x1f, %r15d
orl %r14d, %r15d
leaq 0x73f1(%rip), %rsi      # 0x98dfb
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9ab7
shrl $0x1f, %eax
orl %r12d, %eax
orl %r15d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_codecs.c
// Function: cram_byte_array_len_encode_free
void cram_byte_array_len_encode_free(cram_codec *c) {
    if (!c)
        return;

    if (c->u.e_byte_array_len.len_codec)
        c->u.e_byte_array_len.len_codec->free(c->u.e_byte_array_len.len_codec);

    if (c->u.e_byte_array_len.val_codec)
        c->u.e_byte_array_len.val_codec->free(c->u.e_byte_array_len.val_codec);

    free(c);
}

// Assembly:
testq %rdi, %rdi
je 0x91c67
pushq %rbx
movq %rdi, %rbx
movq 0x78(%rdi), %rdi
testq %rdi, %rdi
je 0x91c4f
callq *0x20(%rdi)
movq 0x80(%rbx), %rdi
testq %rdi, %rdi
je 0x91c5e
callq *0x20(%rdi)
movq %rbx, %rdi
popq %rbx
jmp 0x45c0
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_codecs.c
// Function: cram_byte_array_len_encode_init
cram_codec *cram_byte_array_len_encode_init(cram_stats *st,
                                            enum cram_encoding codec,
                                            enum cram_external_type option,
                                            void *dat,
                                            int version, varint_vec *vv) {
    cram_codec *c;
    cram_byte_array_len_encoder *e = (cram_byte_array_len_encoder *)dat;

    c = malloc(sizeof(*c));
    if (!c)
        return NULL;
    c->codec = E_BYTE_ARRAY_LEN;
    c->free = cram_byte_array_len_encode_free;
    c->encode = cram_byte_array_len_encode;
    c->store = cram_byte_array_len_encode_store;
    c->flush = NULL;

    c->u.e_byte_array_len.len_codec = cram_encoder_init(e->len_encoding,
                                                        st, E_INT,
                                                        e->len_dat,
                                                        version, vv);
    c->u.e_byte_array_len.val_codec = cram_encoder_init(e->val_encoding,
                                                        NULL, E_BYTE_ARRAY,
                                                        e->val_dat,
                                                        version, vv);

    if (!c->u.e_byte_array_len.len_codec ||
        !c->u.e_byte_array_len.val_codec) {
        cram_byte_array_len_encode_free(c);
        return NULL;
    }

    return c;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %r9, %r14
movl %r8d, %ebp
movq %rcx, %r15
movq %rdi, %r12
movl $0x880, %edi            # imm = 0x880
callq 0x4680
testq %rax, %rax
je 0x91faa
movq %rax, %rbx
movl $0x4, (%rax)
leaq -0x2f2(%rip), %rax      # 0x91c3a
movq %rax, 0x20(%rbx)
leaq -0x34a(%rip), %rax      # 0x91bed
movq %rax, 0x30(%rbx)
leaq -0x2da(%rip), %rax      # 0x91c68
movq %rax, 0x38(%rbx)
movq $0x0, 0x48(%rbx)
movl (%r15), %edi
movq 0x8(%r15), %rcx
movq %r12, %rsi
movl $0x1, %edx
movl %ebp, %r8d
movq %r14, %r9
callq 0x8e4cb
movq %rax, %r12
movq %rax, 0x78(%rbx)
movl 0x4(%r15), %edi
movq 0x10(%r15), %rcx
xorl %esi, %esi
movl $0x4, %edx
movl %ebp, %r8d
movq %r14, %r9
callq 0x8e4cb
movq %rax, 0x80(%rbx)
testq %r12, %r12
sete %cl
testq %rax, %rax
sete %al
orb %cl, %al
cmpb $0x1, %al
jne 0x91fac
movq %rbx, %rdi
callq 0x91c3a
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_codecs.c
// Function: cram_byte_array_stop_describe
int cram_byte_array_stop_describe(cram_codec *c, kstring_t *ks) {
    return ksprintf(ks, "BYTE_ARRAY_STOP(stop=%d,id=%d)",
                    c->u.byte_array_stop.stop,
                    c->u.byte_array_stop.content_id)
        < 0 ? -1 : 0;
}

// Assembly:
pushq %rax
movq %rsi, %rax
movzbl 0x60(%rdi), %edx
movl 0x64(%rdi), %ecx
leaq 0x10cb3(%rip), %rsi     # 0xa2eee
movq %rax, %rdi
xorl %eax, %eax
callq 0x9ab7
sarl $0x1f, %eax
popq %rcx
retq