LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/htslib/cram/cram_codecs.c
// Function: cram_external_decode_int
int cram_external_decode_int(cram_slice *slice, cram_codec *c,
			     cram_block *in, char *out, int *out_size) {
    int l;
    char *cp;
    cram_block *b;

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

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

    return l > 0 ? 0 : -1;
}

// Assembly:
pushq %r14
pushq %rbx
movl 0x30(%rsi), %edx
cmpq $0x400, %rdx            # imm = 0x400
setb %sil
movq 0x18(%rdi), %rax
testq %rax, %rax
setne %r9b
testb %r9b, %sil
je 0x48d9f
movq (%rax,%rdx,8), %rax
testq %rax, %rax
je 0x48dce
movq 0x20(%rax), %rsi
movslq 0x1c(%rax), %rdi
movslq 0x14(%rax), %r10
movq %r10, %rbx
subq %rdi, %rbx
cmpq $0x5, %rbx
jge 0x48ddb
movb $0x1, %r9b
xorl %edx, %edx
cmpl %r10d, %edi
jge 0x48df2
movzbl (%rsi,%rdi), %r11d
movl %r11d, %r10d
shrl $0x4, %r10d
leaq 0x9ad5(%rip), %r14      # 0x52860
movslq (%r14,%r10,4), %r14
movl $0x0, %r10d
cmpq %r14, %rbx
jge 0x48ddf
jmp 0x48ea1
movq (%rdi), %rax
movslq 0x20(%rax), %rsi
testq %rsi, %rsi
jle 0x48dce
movq 0x10(%rdi), %rdi
xorl %r9d, %r9d
movq (%rdi,%r9,8), %rax
testq %rax, %rax
je 0x48dc6
cmpl $0x4, 0x8(%rax)
jne 0x48dc6
cmpl %edx, 0xc(%rax)
je 0x48d56
incq %r9
cmpq %r9, %rsi
jne 0x48db2
cmpl $0x0, (%r8)
setne %r9b
jmp 0x48eae
movb (%rsi,%rdi), %r11b
movzbl %r11b, %edx
testb %dl, %dl
js 0x48dfa
movl $0x1, %r10d
jmp 0x48e9e
xorl %r10d, %r10d
jmp 0x48ea1
movzbl 0x1(%rsi,%rdi), %r9d
cmpb $-0x41, %r11b
ja 0x48e1a
andl $0x3f, %edx
shll $0x8, %edx
orl %r9d, %edx
movl $0x2, %r10d
jmp 0x48e9e
cmpb $-0x21, %r11b
ja 0x48e3c
shll $0x8, %r9d
movzbl 0x2(%rsi,%rdi), %esi
andl $0x1f, %edx
shll $0x10, %edx
orl %r9d, %edx
orl %esi, %edx
movl $0x3, %r10d
jmp 0x48e9e
cmpb $-0x11, %r11b
ja 0x48e6b
shll $0x10, %r9d
movzbl 0x2(%rsi,%rdi), %r10d
shll $0x8, %r10d
movzbl 0x3(%rsi,%rdi), %esi
andl $0xf, %edx
shll $0x18, %edx
orl %r9d, %edx
orl %r10d, %edx
orl %esi, %edx
movl $0x4, %r10d
jmp 0x48e9e
shll $0x1c, %edx
shll $0x14, %r9d
orl %edx, %r9d
movzbl 0x2(%rsi,%rdi), %edx
shll $0xc, %edx
orl %r9d, %edx
movzbl 0x3(%rsi,%rdi), %r9d
shll $0x4, %r9d
orl %edx, %r9d
movzbl 0x4(%rsi,%rdi), %edx
andl $0xf, %edx
orl %r9d, %edx
movl $0x5, %r10d
xorl %r9d, %r9d
movl %edx, (%rcx)
addl %r10d, 0x1c(%rax)
movl $0x1, (%r8)
movzbl %r9b, %eax
negl %eax
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/htslib/cram/cram_codecs.c
// Function: cram_external_decode_char
int cram_external_decode_char(cram_slice *slice, cram_codec *c,
			      cram_block *in, char *out,
			      int *out_size) {
    char *cp;
    cram_block *b;

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

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

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

// Assembly:
pushq %rbx
movl 0x30(%rsi), %eax
cmpq $0x400, %rax            # imm = 0x400
setb %sil
movq 0x18(%rdi), %rdx
testq %rdx, %rdx
setne %r9b
testb %r9b, %sil
je 0x48f1d
movq (%rdx,%rax,8), %rdi
testq %rdi, %rdi
je 0x48f4c
movq 0x20(%rdi), %rsi
movslq 0x1c(%rdi), %rax
movl (%r8), %edx
addl %eax, %edx
movl %edx, 0x1c(%rdi)
cmpl 0x14(%rdi), %edx
setg %dl
testq %rsi, %rsi
sete %dil
orb %dl, %dil
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jne 0x48f53
xorl %ebx, %ebx
testq %rcx, %rcx
je 0x48f53
addq %rax, %rsi
movslq (%r8), %rdx
movq %rcx, %rdi
callq 0x4420
jmp 0x48f53
movq (%rdi), %rdx
movslq 0x20(%rdx), %rdx
testq %rdx, %rdx
jle 0x48f4c
movq 0x10(%rdi), %rsi
xorl %r9d, %r9d
movq (%rsi,%r9,8), %rdi
testq %rdi, %rdi
je 0x48f44
cmpl $0x4, 0x8(%rdi)
jne 0x48f44
cmpl %eax, 0xc(%rdi)
je 0x48edf
incq %r9
cmpq %r9, %rdx
jne 0x48f30
xorl %ebx, %ebx
cmpl (%r8), %ebx
sbbl %ebx, %ebx
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/htslib/cram/cram_codecs.c
// Function: cram_external_decode_init
cram_codec *cram_external_decode_init(char *data, int size,
				      enum cram_external_type option,
				      int version) {
    cram_codec *c;
    char *cp = data;

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

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

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

    c->external.type = option;

    return c;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
movl $0x240, %edi            # imm = 0x240
callq 0x4700
testq %rax, %rax
je 0x49070
movl $0x1, (%rax)
leal -0x1(%rbx), %ecx
cmpl $0x1, %ecx
ja 0x48f96
leaq -0x268(%rip), %rcx      # 0x48d2c
jmp 0x48fae
leal -0x3(%rbx), %ecx
cmpl $0x1, %ecx
ja 0x48fa7
leaq -0xed(%rip), %rcx       # 0x48eb8
jmp 0x48fae
leaq 0xc9(%rip), %rcx        # 0x49077
movq %rcx, 0x18(%rax)
leaq -0x62(%rip), %rcx       # 0x48f57
movq %rcx, 0x10(%rax)
movzbl (%r14), %ecx
movl $0x1, %edx
testb %cl, %cl
jns 0x49058
movzbl 0x1(%r14), %edx
cmpb $-0x41, %cl
ja 0x48fe7
andl $0x3f, %ecx
shll $0x8, %ecx
orl %edx, %ecx
movl $0x2, %edx
jmp 0x49058
cmpb $-0x21, %cl
ja 0x49005
shll $0x8, %edx
movzbl 0x2(%r14), %esi
andl $0x1f, %ecx
shll $0x10, %ecx
orl %edx, %ecx
orl %esi, %ecx
movl $0x3, %edx
jmp 0x49058
cmpb $-0x11, %cl
ja 0x4902d
shll $0x10, %edx
movzbl 0x2(%r14), %esi
shll $0x8, %esi
movzbl 0x3(%r14), %edi
andl $0xf, %ecx
shll $0x18, %ecx
orl %edx, %ecx
orl %esi, %ecx
orl %edi, %ecx
movl $0x4, %edx
jmp 0x49058
shll $0x1c, %ecx
shll $0x14, %edx
orl %ecx, %edx
movzbl 0x2(%r14), %ecx
shll $0xc, %ecx
orl %edx, %ecx
movzbl 0x3(%r14), %edx
shll $0x4, %edx
orl %ecx, %edx
movzbl 0x4(%r14), %ecx
andl $0xf, %ecx
orl %edx, %ecx
movl $0x5, %edx
movl %ecx, 0x30(%rax)
movslq %ebp, %rcx
cmpq %rcx, %rdx
jne 0x49068
movl %ebx, 0x34(%rax)
jmp 0x49072
movq %rax, %rdi
callq 0x60ad
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/htslib/cram/cram_codecs.c
// Function: cram_external_decode_block
static int cram_external_decode_block(cram_slice *slice, cram_codec *c,
				      cram_block *in, char *out_,
				      int *out_size) {
    char *cp;
    cram_block *b = NULL;
    cram_block *out = (cram_block *)out_;

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

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

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

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movq %rcx, %r14
movl 0x30(%rsi), %eax
cmpq $0x400, %rax            # imm = 0x400
setb %dl
movq 0x18(%rdi), %rcx
testq %rcx, %rcx
setne %sil
testb %sil, %dl
je 0x49187
movq (%rcx,%rax,8), %rdx
testq %rdx, %rdx
je 0x491b9
movq 0x20(%rdx), %r15
movslq 0x1c(%rdx), %rcx
movl (%rbx), %eax
addl %ecx, %eax
movl %eax, 0x1c(%rdx)
cmpl 0x14(%rdx), %eax
setg %al
testq %r15, %r15
sete %dl
orb %al, %dl
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jne 0x491bf
addq %rcx, %r15
movq 0x20(%r14), %rax
movq 0x28(%r14), %rcx
movq 0x30(%r14), %rsi
movslq (%rbx), %rdx
leaq (%rsi,%rdx), %rdi
cmpq %rdi, %rcx
ja 0x4916e
movl $0x400, %r12d           # imm = 0x400
movq %rcx, %xmm0
punpckldq 0x7878(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x7880(%rip), %xmm0     # 0x50990
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
mulsd 0x893c(%rip), %xmm1     # 0x51a60
cvttsd2si %xmm1, %rdx
movq %rdx, %rdi
sarq $0x3f, %rdi
subsd 0x77d0(%rip), %xmm1     # 0x50908
cvttsd2si %xmm1, %rsi
andq %rdi, %rsi
orq %rdx, %rsi
testq %rcx, %rcx
cmoveq %r12, %rsi
movq %rsi, 0x28(%r14)
movq %rax, %rdi
callq 0x48d0
movq %rax, 0x20(%r14)
movq 0x28(%r14), %rcx
movq 0x30(%r14), %rsi
movslq (%rbx), %rdx
leaq (%rsi,%rdx), %rdi
cmpq %rdi, %rcx
jbe 0x490fb
addq %rsi, %rax
movq %rax, %rdi
movq %r15, %rsi
callq 0x4420
movslq (%rbx), %rax
addq %rax, 0x30(%r14)
xorl %eax, %eax
jmp 0x491bf
movq (%rdi), %rcx
movslq 0x20(%rcx), %rcx
testq %rcx, %rcx
jle 0x491b9
movq 0x10(%rdi), %rsi
xorl %edi, %edi
movq (%rsi,%rdi,8), %rdx
testq %rdx, %rdx
je 0x491b1
cmpl $0x4, 0x8(%rdx)
jne 0x491b1
cmpl %eax, 0xc(%rdx)
je 0x490b2
incq %rdi
cmpq %rdi, %rcx
jne 0x49199
xorl %eax, %eax
cmpl (%rbx), %eax
sbbl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/htslib/cram/cram_codecs.c
// Function: cram_external_encode_init
cram_codec *cram_external_encode_init(cram_stats *st,
				      enum cram_external_type option,
				      void *dat,
				      int version) {
    cram_codec *c;

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

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

    return c;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %r14d
movl $0x240, %edi            # imm = 0x240
callq 0x4700
testq %rax, %rax
je 0x4956d
movl $0x1, (%rax)
leaq -0x283(%rip), %rcx      # 0x492b1
movq %rcx, 0x10(%rax)
leal -0x1(%r14), %ecx
cmpl $0x2, %ecx
jae 0x4954a
leaq -0x37d(%rip), %rcx      # 0x491cb
jmp 0x4955b
addl $-0x3, %r14d
cmpl $0x2, %r14d
jae 0x49575
leaq -0x380(%rip), %rcx      # 0x491db
movq %rcx, 0x20(%rax)
leaq -0x2ab(%rip), %rcx      # 0x492bb
movq %rcx, 0x28(%rax)
movl %ebx, 0x30(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
callq 0x42e0
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/htslib/cram/cram_codecs.c
// Function: cram_beta_decode_int
int cram_beta_decode_int(cram_slice *slice, cram_codec *c, cram_block *in, char *out, int *out_size) {
    int32_t *out_i = (int32_t *)out;
    int i, n;

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

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

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rsi, %r15
movl 0x34(%rsi), %eax
testq %rax, %rax
je 0x495ef
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
testl %eax, %eax
js 0x49612
movq %rdx, %r12
movslq 0x14(%rdx), %rcx
subq 0x30(%rdx), %rcx
jbe 0x49612
cmpq $0x10000000, %rcx       # imm = 0x10000000
ja 0x495c5
movslq 0x38(%r12), %rdx
leaq (%rdx,%rcx,8), %rcx
addq $-0x7, %rcx
cmpq %rax, %rcx
jb 0x49612
movslq (%r8), %r13
testq %r13, %r13
jle 0x4960f
xorl %r14d, %r14d
xorl %ebp, %ebp
movl 0x34(%r15), %esi
movq %r12, %rdi
callq 0x49624
subl 0x30(%r15), %eax
movl %eax, (%rbx,%rbp,4)
incq %rbp
cmpq %rbp, %r13
jne 0x495d2
jmp 0x49612
movslq (%r8), %rax
testq %rax, %rax
jle 0x4960f
xorl %r14d, %r14d
xorl %ecx, %ecx
xorl %edx, %edx
subl 0x30(%r15), %edx
movl %edx, (%rbx,%rcx,4)
incq %rcx
cmpq %rcx, %rax
jne 0x495fc
jmp 0x49612
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/htslib/cram/cram_codecs.c
// Function: cram_beta_decode_char
int cram_beta_decode_char(cram_slice *slice, cram_codec *c, cram_block *in, char *out, int *out_size) {
    int i, n;


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

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

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r15
movq %rsi, %r14
movl 0x34(%rsi), %eax
testq %rax, %rax
je 0x49909
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %eax, %eax
js 0x49931
movq %rdx, %r12
movslq 0x14(%rdx), %rcx
subq 0x30(%rdx), %rcx
jbe 0x49931
cmpq $0x10000000, %rcx       # imm = 0x10000000
ja 0x498da
movslq 0x38(%r12), %rdx
leaq (%rdx,%rcx,8), %rcx
addq $-0x7, %rcx
cmpq %rax, %rcx
jb 0x49931
movl (%r8), %r13d
xorl %ebx, %ebx
testq %r15, %r15
je 0x49942
testl %r13d, %r13d
jle 0x49931
xorl %ebp, %ebp
movl 0x34(%r14), %esi
movq %r12, %rdi
callq 0x49624
subl 0x30(%r14), %eax
movb %al, (%r15,%rbp)
incq %rbp
cmpq %rbp, %r13
jne 0x498eb
jmp 0x49931
xorl %ebx, %ebx
testq %r15, %r15
je 0x49931
movslq (%r8), %rax
testq %rax, %rax
jle 0x49931
xorl %ebx, %ebx
xorl %ecx, %ecx
movb 0x30(%r14), %dl
xorl %esi, %esi
subb %dl, %sil
movb %sil, (%r15,%rcx)
incq %rcx
cmpq %rcx, %rax
jne 0x4991c
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testl %r13d, %r13d
jle 0x49931
movl 0x34(%r14), %esi
movq %r12, %rdi
callq 0x49624
decl %r13d
jne 0x49947
jmp 0x49931
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/htslib/cram/cram_codecs.c
// Function: cram_beta_encode_store
int cram_beta_encode_store(cram_codec *c, cram_block *b,
			   char *prefix, int version) {
    int len = 0;

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

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

    return len;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
testq %rdx, %rdx
je 0x49bf4
movq %rdx, %r12
movq %rdx, %rdi
callq 0x4230
movq %rax, %r15
movq 0x20(%rbx), %rax
movq 0x28(%rbx), %rcx
movq 0x30(%rbx), %rdx
leaq (%rdx,%r15), %rsi
cmpq %rsi, %rcx
ja 0x49bdd
movl $0x400, %r13d           # imm = 0x400
movq %rcx, %xmm0
punpckldq 0x6e06(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x6e0e(%rip), %xmm0     # 0x50990
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
mulsd 0x7eca(%rip), %xmm1     # 0x51a60
cvttsd2si %xmm1, %rdx
movq %rdx, %rdi
sarq $0x3f, %rdi
subsd 0x6d5e(%rip), %xmm1     # 0x50908
cvttsd2si %xmm1, %rsi
andq %rdi, %rsi
orq %rdx, %rsi
testq %rcx, %rcx
cmoveq %r13, %rsi
movq %rsi, 0x28(%rbx)
movq %rax, %rdi
callq 0x48d0
movq %rax, 0x20(%rbx)
movq 0x28(%rbx), %rcx
movq 0x30(%rbx), %rdx
leaq (%rdx,%r15), %rsi
cmpq %rsi, %rcx
jbe 0x49b6d
addq %rdx, %rax
movq %rax, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x4420
addq %r15, 0x30(%rbx)
jmp 0x49bf7
xorl %r15d, %r15d
movl (%r14), %esi
movq %rbx, %rdi
callq 0x3150c
movl %eax, %ebp
movl 0x30(%r14), %ecx
movl $0x1, %esi
movl $0x1, %eax
cmpl $0x80, %ecx
jb 0x49c42
movl $0x2, %eax
cmpl $0x4000, %ecx           # imm = 0x4000
jb 0x49c42
movl $0x3, %eax
cmpl $0x200000, %ecx         # imm = 0x200000
jb 0x49c42
cmpl $0x10000000, %ecx       # imm = 0x10000000
movl $0x5, %eax
sbbl $0x0, %eax
movl 0x34(%r14), %ecx
cmpl $0x80, %ecx
jb 0x49c76
movl $0x2, %esi
cmpl $0x4000, %ecx           # imm = 0x4000
jb 0x49c76
movl $0x3, %esi
cmpl $0x200000, %ecx         # imm = 0x200000
jb 0x49c76
cmpl $0x10000000, %ecx       # imm = 0x10000000
movl $0x5, %esi
sbbl $0x0, %esi
addl %eax, %esi
addl %r15d, %ebp
movq %rbx, %rdi
callq 0x3150c
movl %eax, %r15d
movl 0x30(%r14), %esi
movq %rbx, %rdi
callq 0x3150c
movl %eax, %r12d
addl %r15d, %r12d
addl %ebp, %r12d
movl 0x34(%r14), %esi
movq %rbx, %rdi
callq 0x3150c
addl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/htslib/cram/cram_codecs.c
// Function: cram_beta_encode_int
int cram_beta_encode_int(cram_slice *slice, cram_codec *c,
			 char *in, int in_size) {
    int *syms = (int *)in;
    int i, r = 0;

    for (i = 0; i < in_size; i++)
	r |= store_bits_MSB(c->out, syms[i] + c->e_beta.offset,
			    c->e_beta.nbits);

    return r;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
testl %ecx, %ecx
jle 0x49cf4
movq %rdx, %rbx
movq %rsi, %r14
movl %ecx, %r15d
xorl %r12d, %r12d
xorl %ebp, %ebp
movq 0x8(%r14), %rdi
movl 0x30(%r14), %esi
addl (%rbx,%r12,4), %esi
movl 0x34(%r14), %edx
callq 0x49d01
orl %eax, %ebp
incq %r12
cmpq %r12, %r15
jne 0x49cd3
jmp 0x49cf6
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/htslib/cram/cram_codecs.c
// Function: cram_beta_encode_char
int cram_beta_encode_char(cram_slice *slice, cram_codec *c,
			  char *in, int in_size) {
    unsigned char *syms = (unsigned char *)in;
    int i, r = 0;

    for (i = 0; i < in_size; i++)
	r |= store_bits_MSB(c->out, syms[i] + c->e_beta.offset,
			    c->e_beta.nbits);

    return r;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
testl %ecx, %ecx
jle 0x49e94
movq %rdx, %rbx
movq %rsi, %r14
movl %ecx, %r15d
xorl %r12d, %r12d
xorl %ebp, %ebp
movq 0x8(%r14), %rdi
movzbl (%rbx,%r12), %esi
addl 0x30(%r14), %esi
movl 0x34(%r14), %edx
callq 0x49d01
orl %eax, %ebp
incq %r12
cmpq %r12, %r15
jne 0x49e72
jmp 0x49e96
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/htslib/cram/cram_codecs.c
// Function: cram_beta_encode_init
cram_codec *cram_beta_encode_init(cram_stats *st,
				  enum cram_external_type option,
				  void *dat,
				  int version) {
    cram_codec *c;
    int min_val, max_val, len = 0;

    c = malloc(sizeof(*c));
    if (!c)
	return NULL;
    c->codec  = E_BETA;
    c->free   = cram_beta_encode_free;
    if (option == E_INT)
	c->encode = cram_beta_encode_int;
    else
	c->encode = cram_beta_encode_char;
    c->store  = cram_beta_encode_store;

    if (dat) {
	min_val = ((int *)dat)[0];
	max_val = ((int *)dat)[1];
    } else {
	min_val = INT_MAX;
	max_val = INT_MIN;
	int i;
	for (i = 0; i < MAX_STAT_VAL; i++) {
	    if (!st->freqs[i])
		continue;
	    if (min_val > i)
		min_val = i;
	    max_val = i;
	}
	if (st->h) {
	    khint_t k;

	    for (k = kh_begin(st->h); k != kh_end(st->h); k++) {
		if (!kh_exist(st->h, k))
		    continue;
	    
		i = kh_key(st->h, k);
		if (min_val > i)
		    min_val = i;
		if (max_val < i)
		    max_val = i;
	    }
	}
    }

    assert(max_val >= min_val);
    c->e_beta.offset = -min_val;
    max_val -= min_val;
    while (max_val) {
	len++;
	max_val >>= 1;
    }
    c->e_beta.nbits = len;

    return c;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %rbx
movl $0x240, %edi            # imm = 0x240
callq 0x4700
testq %rax, %rax
je 0x49f2c
movl $0x6, (%rax)
leaq -0x32(%rip), %rcx       # 0x49ea1
movq %rcx, 0x10(%rax)
cmpl $0x1, %ebp
leaq -0x228(%rip), %rcx      # 0x49cb9
leaq -0x90(%rip), %rdx       # 0x49e58
cmoveq %rcx, %rdx
movq %rdx, 0x20(%rax)
leaq -0x3cd(%rip), %rcx      # 0x49b2a
movq %rcx, 0x28(%rax)
testq %r14, %r14
je 0x49f31
movl (%r14), %esi
movl 0x4(%r14), %edx
cmpl %esi, %edx
jl 0x49fb4
movl %esi, %ecx
negl %ecx
movl %ecx, 0x30(%rax)
xorl %ecx, %ecx
subl %esi, %edx
je 0x49f29
movl %edx, %esi
incl %ecx
sarl %esi
cmpl $0x1, %edx
movl %esi, %edx
ja 0x49f1e
movl %ecx, 0x34(%rax)
popq %rbx
popq %r14
popq %rbp
retq
movl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
movl $0x80000000, %edx       # imm = 0x80000000
xorl %ecx, %ecx
movl %esi, %edi
cmpl %ecx, %esi
movl %ecx, %esi
cmovll %edi, %esi
cmpl $0x0, (%rbx,%rcx,4)
cmovel %edi, %esi
cmovnel %ecx, %edx
incq %rcx
cmpq $0x400, %rcx            # imm = 0x400
jne 0x49f3d
movq 0x1000(%rbx), %rdi
testq %rdi, %rdi
je 0x49f07
movl (%rdi), %r8d
testq %r8, %r8
je 0x49f07
movq 0x10(%rdi), %r9
xorl %r10d, %r10d
xorl %r11d, %r11d
movl %r11d, %ecx
shrl $0x4, %ecx
movl (%r9,%rcx,4), %ebx
movl %r10d, %ecx
andb $0x1e, %cl
shrl %cl, %ebx
testb $0x3, %bl
jne 0x49fa3
movq 0x18(%rdi), %rcx
movl (%rcx,%r11,4), %ecx
cmpl %ecx, %esi
cmovgel %ecx, %esi
cmpl %ecx, %edx
cmovlel %ecx, %edx
incq %r11
addl $0x2, %r10d
cmpq %r11, %r8
jne 0x49f7a
jmp 0x49f07
leaq 0xa895(%rip), %rdi      # 0x54850
leaq 0xa8a1(%rip), %rsi      # 0x54863
leaq 0xa8ad(%rip), %rcx      # 0x54876
movl $0x288, %edx            # imm = 0x288
callq 0x4350
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/htslib/cram/cram_codecs.c
// Function: cram_subexp_decode
int cram_subexp_decode(cram_slice *slice, cram_codec *c, cram_block *in, char *out, int *out_size) {
    int32_t *out_i = (int32_t *)out;
    int n, count;
    int k = c->subexp.k;

    for (count = 0, n = *out_size; count < n; count++) {
	int i = 0, tail;
	int val;

	/* Get number of 1s */
	//while (get_bit_MSB(in) == 1) i++;
	i = get_one_bits_MSB(in);
        if (i < 0 || cram_not_enough_bits(in, i > 0 ? i + k - 1 : k))
            return -1;
	/*
	 * Val is
	 * i > 0:  2^(k+i-1) + k+i-1 bits
	 * i = 0:  k bits
	 */
	if (i) {
	    tail = i + k-1;
	    val = 0;
	    while (tail) {
		//val = val<<1; val |= get_bit_MSB(in);
		GET_BIT_MSB(in, val);
		tail--;
	    }
	    val += 1 << (i + k-1);
	} else {
	    tail = k;
	    val = 0;
	    while (tail) {
		//val = val<<1; val |= get_bit_MSB(in);
		GET_BIT_MSB(in, val);
		tail--;
	    }
	}

	out_i[count] = val - c->subexp.offset;
    }

    return 0;
}

// Assembly:
movslq (%r8), %r9
testq %r9, %r9
jle 0x4a158
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %rdi
movl 0x34(%rsi), %r10d
movq 0x30(%rdx), %r11
xorl %ebx, %ebx
movslq 0x14(%rdx), %r15
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %r15, %r11
jae 0x4a14d
movq 0x20(%rdx), %r14
movl 0x38(%rdx), %ecx
movl $0x2, %ebp
movzbl (%r14,%r11), %r8d
shrl %cl, %r8d
subl $0x1, %ecx
movl %ecx, 0x38(%rdx)
jae 0x4a04a
movl $0x7, 0x38(%rdx)
incq %r11
movq %r11, 0x30(%rdx)
andl $0x1, %r8d
movl $0x7, %ecx
cmpq %r15, %r11
jne 0x4a04e
testl %r8d, %r8d
je 0x4a04e
jmp 0x4a14d
andl $0x1, %r8d
decl %ebp
testl %r8d, %r8d
jne 0x4a014
movl %r10d, %r8d
subl %ebp, %r8d
cmpl $0x1, %ebp
movl %r8d, %r12d
cmovel %r10d, %r12d
testl %r12d, %r12d
js 0x4a14d
je 0x4a079
cmpq %r11, %r15
jbe 0x4a14d
subq %r11, %r15
cmpq $0x10000000, %r15       # imm = 0x10000000
ja 0x4a09f
movslq %ecx, %r13
leaq -0x7(,%r15,8), %r15
addq %r13, %r15
movl %r12d, %r12d
cmpq %r12, %r15
jb 0x4a14d
cmpl $0x1, %ebp
jne 0x4a0e6
xorl %r15d, %r15d
testl %r10d, %r10d
je 0x4a137
movl %r10d, %eax
movzbl (%r14,%r11), %r8d
xorl %r12d, %r12d
btl %ecx, %r8d
setb %r12b
leal (%r12,%r15,2), %r15d
xorl %r8d, %r8d
testl %ecx, %ecx
leal -0x1(%rcx), %ecx
setle %r8b
addq %r8, %r11
movq %r11, 0x30(%rdx)
andl $0x7, %ecx
movl %ecx, 0x38(%rdx)
decl %eax
jne 0x4a0b3
jmp 0x4a137
xorl %eax, %eax
cmpl %ebp, %r10d
je 0x4a128
xorl %eax, %eax
movl %r10d, %r15d
movzbl (%r14,%r11), %r12d
xorl %r13d, %r13d
btl %ecx, %r12d
setb %r13b
leal (%r13,%rax,2), %eax
xorl %r12d, %r12d
testl %ecx, %ecx
leal -0x1(%rcx), %ecx
setle %r12b
addq %r12, %r11
movq %r11, 0x30(%rdx)
andl $0x7, %ecx
movl %ecx, 0x38(%rdx)
decl %r15d
cmpl %r15d, %ebp
jne 0x4a0f2
movl $0x1, %r15d
movl %r8d, %ecx
shll %cl, %r15d
addl %eax, %r15d
subl 0x30(%rsi), %r15d
movl %r15d, (%rdi,%rbx,4)
incq %rbx
cmpq %r9, %rbx
jne 0x49ff6
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/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->gamma.offset;
    }

    return 0;
}

// Assembly:
movslq (%r8), %r8
testq %r8, %r8
jle 0x4a46a
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 0x4a461
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 0x4a3db
movl $0x7, 0x38(%rdx)
incq %r9
movq %r9, 0x30(%rdx)
andl $0x1, %ebp
movl $0x7, %ecx
cmpq %r14, %r9
jne 0x4a3de
testl %ebp, %ebp
jne 0x4a3de
jmp 0x4a461
andl $0x1, %ebp
incq %r15
leal 0x1(%rbx), %r12d
testl %ebp, %ebp
je 0x4a3a5
testl %r15d, %r15d
je 0x4a3f3
cmpq %r9, %r14
jbe 0x4a461
subq %r9, %r14
cmpq $0x10000000, %r14       # imm = 0x10000000
ja 0x4a40f
movslq %ecx, %r12
leaq (%r12,%r14,8), %r14
addq $-0x7, %r14
cmpq %r15, %r14
jb 0x4a461
movl $0x1, %eax
testl %r15d, %r15d
je 0x4a44c
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 0x4a419
subl 0x30(%rsi), %eax
movl %eax, (%rdi,%r10,4)
incq %r10
cmpq %r8, %r10
jne 0x4a37f
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/htslib/cram/cram_codecs.c
// Function: cram_gamma_decode_init
cram_codec *cram_gamma_decode_init(char *data, int size,
				   enum cram_external_type option,
				   int version) {
    cram_codec *c;
    char *cp = data;

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

    c->codec  = E_GAMMA;
    c->decode = cram_gamma_decode;
    c->free   = cram_gamma_decode_free;
    
    cp += itf8_get(cp, &c->gamma.offset);

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

    return c;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
movl $0x240, %edi            # imm = 0x240
callq 0x4700
testq %rax, %rax
je 0x4a55d
movl $0x9, (%rax)
leaq -0x13f(%rip), %rcx      # 0x4a361
movq %rcx, 0x18(%rax)
leaq -0x3e(%rip), %rcx       # 0x4a46d
movq %rcx, 0x10(%rax)
movzbl (%r14), %ecx
movl $0x1, %edx
testb %cl, %cl
jns 0x4a54a
movzbl 0x1(%r14), %edx
cmpb $-0x41, %cl
ja 0x4a4d9
andl $0x3f, %ecx
shll $0x8, %ecx
orl %edx, %ecx
movl $0x2, %edx
jmp 0x4a54a
cmpb $-0x21, %cl
ja 0x4a4f7
shll $0x8, %edx
movzbl 0x2(%r14), %esi
andl $0x1f, %ecx
shll $0x10, %ecx
orl %edx, %ecx
orl %esi, %ecx
movl $0x3, %edx
jmp 0x4a54a
cmpb $-0x11, %cl
ja 0x4a51f
shll $0x10, %edx
movzbl 0x2(%r14), %esi
shll $0x8, %esi
movzbl 0x3(%r14), %edi
andl $0xf, %ecx
shll $0x18, %ecx
orl %edx, %ecx
orl %esi, %ecx
orl %edi, %ecx
movl $0x4, %edx
jmp 0x4a54a
shll $0x1c, %ecx
shll $0x14, %edx
orl %ecx, %edx
movzbl 0x2(%r14), %ecx
shll $0xc, %ecx
orl %edx, %ecx
movzbl 0x3(%r14), %edx
shll $0x4, %edx
orl %ecx, %edx
movzbl 0x4(%r14), %ecx
andl $0xf, %ecx
orl %edx, %ecx
movl $0x5, %edx
movl %ecx, 0x30(%rax)
movslq %ebx, %rcx
cmpq %rcx, %rdx
je 0x4a55f
movq %rax, %rdi
callq 0x6128
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/htslib/cram/cram_codecs.c
// Function: cram_huffman_decode_free
void cram_huffman_decode_free(cram_codec *c) {
    if (!c)
	return;

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

// Assembly:
testq %rdi, %rdi
je 0x4a587
pushq %rbx
movq %rdi, %rbx
movq 0x38(%rdi), %rdi
testq %rdi, %rdi
je 0x4a57e
callq 0x4610
movq %rbx, %rdi
popq %rbx
jmp 0x4610
retq
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/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->huffman.codes[0].symbol;
    }
    return 0;
}

// Assembly:
testq %rcx, %rcx
je 0x4a5b0
movslq (%r8), %rax
testq %rax, %rax
jle 0x4a5b0
xorl %edx, %edx
movq 0x38(%rsi), %rdi
movb (%rdi), %dil
movb %dil, (%rcx,%rdx)
incq %rdx
cmpq %rdx, %rax
jne 0x4a59d
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/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->huffman.ncodes;
    const cram_huffman_code * const codes = c->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) {
		out[i] = codes[idx].symbol;
		break;
	    }
	}
    }

    return 0;
}

// Assembly:
movslq (%r8), %rdi
testq %rdi, %rdi
jle 0x4a6e7
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl 0x30(%rsi), %r8d
movq 0x38(%rsi), %rsi
xorl %r9d, %r9d
movq %rcx, -0x10(%rsp)
movl 0xc(%rsi), %r15d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %r15d, %r15d
js 0x4a6dc
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 0x4a60e
cmpq %r11, %r10
jbe 0x4a6dc
movq %r10, %r12
subq %r11, %r12
cmpq $0x10000000, %r12       # imm = 0x10000000
ja 0x4a638
movslq 0x38(%rdx), %r13
leaq -0x7(,%r12,8), %r12
addq %r13, %r12
movl %r15d, %r13d
cmpq %r13, %r12
jb 0x4a6dc
testl %r15d, %r15d
je 0x4a679
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 0x4a645
movl %ebx, %r15d
subl 0x4(%r14), %r15d
cmpl %r8d, %r15d
jge 0x4a6dc
testl %r15d, %r15d
js 0x4a6dc
movl %r15d, %ecx
shlq $0x4, %rcx
leaq (%rsi,%rcx), %r14
movl 0x8(%rsi,%rcx), %r9d
xorl %ebx, %r9d
movl 0xc(%rsi,%rcx), %r12d
movl %r12d, %ecx
xorl %ebp, %ecx
orl %r9d, %ecx
je 0x4a6bd
movl %r12d, %r15d
subl %ebp, %r15d
movl %r12d, %ebp
jns 0x4a600
jmp 0x4a6dc
movb (%r14), %al
movq -0x10(%rsp), %rcx
movq -0x8(%rsp), %r9
movb %al, (%rcx,%r9)
incq %r9
xorl %eax, %eax
cmpq %rdi, %r9
jne 0x4a5d9
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/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->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 0x4a7e8
movq 0x38(%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 0x7705(%rip), %xmm1     # 0x51e20
movdqa 0x770d(%rip), %xmm2     # 0x51e30
xorl %esi, %esi
movdqa 0x7713(%rip), %xmm3     # 0x51e40
pxor %xmm3, %xmm0
pcmpeqd %xmm4, %xmm4
movdqa 0x7713(%rip), %xmm5     # 0x51e50
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 0x4a775
movl %eax, (%rcx,%rsi)
pxor %xmm4, %xmm6
pextrw $0x4, %xmm6, %edi
testb $0x1, %dil
je 0x4a788
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 0x4a7c4
movl %eax, 0x8(%rcx,%rsi)
pextrw $0x4, %xmm6, %edi
testb $0x1, %dil
je 0x4a7d3
movl %eax, 0xc(%rcx,%rsi)
paddq %xmm5, %xmm2
paddq %xmm5, %xmm1
addq $0x10, %rsi
cmpq %rsi, %rdx
jne 0x4a73d
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/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->huffman.ncodes;
    const cram_huffman_code * const codes = c->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 0x4a91f
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl 0x30(%rsi), %r8d
movq 0x38(%rsi), %rsi
xorl %r9d, %r9d
movq %rcx, -0x10(%rsp)
movl 0xc(%rsi), %r15d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %r15d, %r15d
js 0x4a914
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 0x4a846
cmpq %r11, %r10
jbe 0x4a914
movq %r10, %r12
subq %r11, %r12
cmpq $0x10000000, %r12       # imm = 0x10000000
ja 0x4a870
movslq 0x38(%rdx), %r13
leaq -0x7(,%r12,8), %r12
addq %r13, %r12
movl %r15d, %r13d
cmpq %r13, %r12
jb 0x4a914
testl %r15d, %r15d
je 0x4a8b1
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 0x4a87d
movl %ebx, %r15d
subl 0x4(%r14), %r15d
cmpl %r8d, %r15d
jge 0x4a914
testl %r15d, %r15d
js 0x4a914
movl %r15d, %ecx
shlq $0x4, %rcx
leaq (%rsi,%rcx), %r14
movl 0x8(%rsi,%rcx), %r9d
xorl %ebx, %r9d
movl 0xc(%rsi,%rcx), %r12d
movl %r12d, %ecx
xorl %ebp, %ecx
orl %r9d, %ecx
je 0x4a8f5
movl %r12d, %r15d
subl %ebp, %r15d
movl %r12d, %ebp
jns 0x4a838
jmp 0x4a914
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 0x4a811
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/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->e_huffman.val2code[sym+1];
	    assert(c->e_huffman.codes[i].symbol == sym);
	    code = c->e_huffman.codes[i].code;
	    len  = c->e_huffman.codes[i].len;
	} else {
	    /* Slow - use a lookup table for when sym < MAX_HUFF? */
	    for (i = 0; i < c->e_huffman.nvals; i++) {
		if (c->e_huffman.codes[i].symbol == sym)
		    break;
	    }
	    if (i == c->e_huffman.nvals)
		return -1;
    
	    code = c->e_huffman.codes[i].code;
	    len  = c->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 0x4af77
movl %ecx, %ebp
movq %rdx, %r14
movq %rsi, %r15
xorl %ebx, %ebx
movzbl (%r14), %eax
testb %al, %al
js 0x4af23
movslq 0x40(%r15,%rax,4), %rdx
movq 0x30(%r15), %rcx
shlq $0x4, %rdx
cmpl %eax, (%rcx,%rdx)
jne 0x4af86
addq %rdx, %rcx
jmp 0x4af54
movslq 0x38(%r15), %rcx
testq %rcx, %rcx
jle 0x4af44
movq 0x30(%r15), %rsi
xorl %edx, %edx
cmpl %eax, (%rsi)
je 0x4af46
incq %rdx
addq $0x10, %rsi
cmpq %rdx, %rcx
jne 0x4af32
jmp 0x4af70
xorl %edx, %edx
cmpl %ecx, %edx
je 0x4af70
movl %edx, %ecx
shlq $0x4, %rcx
addq 0x30(%r15), %rcx
decl %ebp
incq %r14
movl 0x8(%rcx), %esi
movl 0xc(%rcx), %edx
movq 0x8(%r15), %rdi
callq 0x49d01
orl %eax, %ebx
testl %ebp, %ebp
jne 0x4af04
jmp 0x4af79
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x4af79
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x999f(%rip), %rdi      # 0x5492c
leaq 0x98cf(%rip), %rsi      # 0x54863
leaq 0x99b5(%rip), %rcx      # 0x54950
movl $0x429, %edx            # imm = 0x429
callq 0x4350
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/htslib/cram/cram_codecs.c
// Function: cram_huffman_encode_free
void cram_huffman_encode_free(cram_codec *c) {
    if (!c)
	return;

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

// Assembly:
testq %rdi, %rdi
je 0x4b08b
pushq %rbx
movq %rdi, %rbx
movq 0x30(%rdi), %rdi
testq %rdi, %rdi
je 0x4b082
callq 0x4610
movq %rbx, %rdi
popq %rbx
jmp 0x4610
retq
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/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->byte_array_len.len_codec->decode(slice, c->byte_array_len.len_codec,
                                            in, (char *)&len, &one);
    //printf("ByteArray Len=%d\n", len);

    if (!r && c->byte_array_len.val_codec && len >= 0) {
	r = c->byte_array_len.val_codec->decode(slice,
						c->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 0x30(%rsi), %rsi
callq *0x18(%rsi)
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %ecx, %ecx
jne 0x4ba44
movq 0x38(%r13), %rsi
testq %rsi, %rsi
je 0x4ba44
cmpl $0x0, 0x8(%rsp)
js 0x4ba44
leaq 0x8(%rsp), %r13
movq %r12, %rdi
movq %r15, %rdx
movq %r14, %rcx
movq %r13, %r8
callq *0x18(%rsi)
movl (%r13), %ecx
movl %ecx, (%rbx)
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/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->byte_array_len.len_codec)
	c->byte_array_len.len_codec->free(c->byte_array_len.len_codec);

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

    free(c);
}

// Assembly:
testq %rdi, %rdi
je 0x4ba7c
pushq %rbx
movq %rdi, %rbx
movq 0x30(%rdi), %rdi
testq %rdi, %rdi
je 0x4ba67
callq *0x10(%rdi)
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0x4ba73
callq *0x10(%rdi)
movq %rbx, %rdi
popq %rbx
jmp 0x4610
retq
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/htslib/cram/cram_codecs.c
// Function: cram_decoder_init
cram_codec *cram_decoder_init(enum cram_encoding codec,
			      char *data, int size,
			      enum cram_external_type option,
			      int version) {
    if (codec >= E_NULL && codec < E_NUM_CODECS && decode_init[codec]) {
	return decode_init[codec](data, size, option, version);
    } else {
	fprintf(stderr, "Unimplemented codec of type %s\n", cram_encoding2str(codec));
	return NULL;
    }
}

// Assembly:
cmpl $0x9, %edi
ja 0x4beec
movl $0x105, %eax            # imm = 0x105
btq %rdi, %rax
jb 0x4beec
movl %edi, %eax
leaq 0x15da2(%rip), %r9      # 0x61c80
movq %rsi, %rdi
movl %edx, %esi
movl %ecx, %edx
movl %r8d, %ecx
jmpq *(%r9,%rax,8)
pushq %rax
callq 0x61eb
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/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->e_byte_array_len.len_codec)
	c->e_byte_array_len.len_codec->free(c->e_byte_array_len.len_codec);

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

    free(c);
}

// Assembly:
testq %rdi, %rdi
je 0x4bf6a
pushq %rbx
movq %rdi, %rbx
movq 0x48(%rdi), %rdi
testq %rdi, %rdi
je 0x4bf55
callq *0x10(%rdi)
movq 0x50(%rbx), %rdi
testq %rdi, %rdi
je 0x4bf61
callq *0x10(%rdi)
movq %rbx, %rdi
popq %rbx
jmp 0x4610
retq
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/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_external_type option,
					    void *dat,
					    int version) {
    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->e_byte_array_len.len_codec = cram_encoder_init(e->len_encoding,
						      NULL, E_INT, 
						      e->len_dat,
						      version);
    c->e_byte_array_len.val_codec = cram_encoder_init(e->val_encoding,
						      NULL, E_BYTE_ARRAY, 
						      e->val_dat,
						      version);

    return c;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %ecx, %ebp
movq %rdx, %r14
movl $0x240, %edi            # imm = 0x240
callq 0x4700
movq %rax, %rbx
testq %rax, %rax
je 0x4c2b0
movl $0x4, (%rbx)
leaq -0x321(%rip), %rax      # 0x4bf40
movq %rax, 0x10(%rbx)
leaq -0x376(%rip), %rax      # 0x4bef6
movq %rax, 0x20(%rbx)
leaq -0x30c(%rip), %rax      # 0x4bf6b
movq %rax, 0x28(%rbx)
movl (%r14), %edi
movq 0x8(%r14), %rcx
xorl %esi, %esi
movl $0x1, %edx
movl %ebp, %r8d
callq 0x4c2b8
movq %rax, 0x48(%rbx)
movl 0x4(%r14), %edi
movq 0x10(%r14), %rcx
xorl %esi, %esi
movl $0x4, %edx
movl %ebp, %r8d
callq 0x4c2b8
movq %rax, 0x50(%rbx)
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/htslib/cram/cram_codecs.c
// Function: cram_encoder_init
cram_codec *cram_encoder_init(enum cram_encoding codec,
			      cram_stats *st,
			      enum cram_external_type option,
			      void *dat,
			      int version) {
    if (st && !st->nvals)
	return NULL;

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

// Assembly:
pushq %rax
testq %rsi, %rsi
je 0x4c2c7
cmpl $0x0, 0x100c(%rsi)
je 0x4c2f9
movl $0x385, %eax            # imm = 0x385
btq %rdi, %rax
jb 0x4c2fd
movl %edi, %eax
leaq 0x159f5(%rip), %r9      # 0x61cd0
movq %rsi, %rdi
movl %edx, %esi
movq %rcx, %rdx
movl %r8d, %ecx
callq *(%r9,%rax,8)
testq %rax, %rax
je 0x4c2f9
movq $0x0, 0x8(%rax)
jmp 0x4c2fb
xorl %eax, %eax
popq %rcx
retq
callq 0x6220
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/htslib/cram/cram_codecs.c
// Function: cram_byte_array_stop_decode_init
cram_codec *cram_byte_array_stop_decode_init(char *data, int size,
					     enum cram_external_type option,
					     int version) {
    cram_codec *c;
    unsigned char *cp = (unsigned char *)data;

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

    c->codec  = E_BYTE_ARRAY_STOP;
    switch (option) {
    case E_BYTE_ARRAY_BLOCK:
        c->decode = cram_byte_array_stop_decode_block;
	break;
    case E_BYTE_ARRAY:
        c->decode = cram_byte_array_stop_decode_char;
	break;
    default:
        fprintf(stderr, "byte_array_stop codec only supports BYTE_ARRAYs.\n");
        free(c);
        return NULL;
    }
    c->free   = cram_byte_array_stop_decode_free;
    
    c->byte_array_stop.stop = *cp++;
    if (CRAM_MAJOR_VERS(version) == 1) {
	c->byte_array_stop.content_id = cp[0] + (cp[1]<<8) + (cp[2]<<16)
	    + (cp[3]<<24);
	cp += 4;
    } else {
	cp += itf8_get(cp, &c->byte_array_stop.content_id);
    }

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

    return c;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %ecx, %r15d
movl %edx, %r12d
movl %esi, %ebp
movq %rdi, %r14
movl $0x240, %edi            # imm = 0x240
callq 0x4700
testq %rax, %rax
je 0x4c6a2
movq %rax, %rbx
movl $0x5, (%rax)
cmpl $0x5, %r12d
je 0x4c5a3
cmpl $0x4, %r12d
jne 0x4c652
leaq 0x10f(%rip), %rax       # 0x4c6b0
jmp 0x4c5aa
leaq -0x2a8(%rip), %rax      # 0x4c302
movq %rax, 0x18(%rbx)
leaq -0x64(%rip), %rax       # 0x4c551
movq %rax, 0x10(%rbx)
movb (%r14), %al
movb %al, 0x30(%rbx)
andl $0xffffff00, %r15d      # imm = 0xFFFFFF00
cmpl $0x100, %r15d           # imm = 0x100
jne 0x4c5df
movl 0x1(%r14), %eax
movl %eax, 0x34(%rbx)
leaq 0x5(%r14), %rax
jmp 0x4c68a
leaq 0x1(%r14), %rax
movzbl (%rax), %ecx
movl $0x1, %edx
testb %cl, %cl
jns 0x4c684
movzbl 0x2(%r14), %edx
cmpb $-0x41, %cl
ja 0x4c60c
andl $0x3f, %ecx
shll $0x8, %ecx
orl %edx, %ecx
movl $0x2, %edx
jmp 0x4c684
cmpb $-0x21, %cl
ja 0x4c62a
shll $0x8, %edx
movzbl 0x3(%r14), %esi
andl $0x1f, %ecx
shll $0x10, %ecx
orl %edx, %ecx
orl %esi, %ecx
movl $0x3, %edx
jmp 0x4c684
cmpb $-0x11, %cl
ja 0x4c659
shll $0x10, %edx
movzbl 0x3(%r14), %esi
shll $0x8, %esi
movzbl 0x4(%r14), %edi
andl $0xf, %ecx
shll $0x18, %ecx
orl %edx, %ecx
orl %esi, %ecx
orl %edi, %ecx
movl $0x4, %edx
jmp 0x4c684
callq 0x6265
jmp 0x4c69a
shll $0x1c, %ecx
shll $0x14, %edx
orl %ecx, %edx
movzbl 0x3(%r14), %ecx
shll $0xc, %ecx
orl %edx, %ecx
movzbl 0x4(%r14), %edx
shll $0x4, %edx
orl %ecx, %edx
movzbl 0x5(%r14), %ecx
andl $0xf, %ecx
orl %edx, %ecx
movl $0x5, %edx
movl %ecx, 0x34(%rbx)
addq %rdx, %rax
subq %r14, %rax
movslq %ebp, %rcx
cmpq %rcx, %rax
je 0x4c6a4
callq 0x6249
movq %rbx, %rdi
callq 0x4610
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq