LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/htslib/cram/cram_codecs.c
// Function: cram_beta_encode_store
int cram_beta_encode_store(cram_codec *c, cram_block *b,
			   char *prefix, int version) {
    int len = 0;

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

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

    return len;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
testq %rdx, %rdx
je 0x88b43
movq %rdx, %r12
movq %rdx, %rdi
callq 0x62d0
movq %rax, %r15
movq 0x28(%rbx), %rax
movq 0x30(%rbx), %rdi
leaq (%rdi,%r15), %rcx
cmpq %rcx, %rax
ja 0x88b2e
movl $0x400, %r13d           # imm = 0x400
movq %rax, %xmm0
punpckldq 0x3546(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x354e(%rip), %xmm0     # 0x8c020
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
mulsd 0x7d12(%rip), %xmm1     # 0x907f8
cvttsd2si %xmm1, %rcx
movq %rcx, %rdx
subsd 0xf622(%rip), %xmm1     # 0x98118
cvttsd2si %xmm1, %rsi
sarq $0x3f, %rdx
andq %rdx, %rsi
orq %rcx, %rsi
testq %rax, %rax
cmoveq %r13, %rsi
movq %rsi, 0x28(%rbx)
movq 0x20(%rbx), %rdi
callq 0x6c80
movq %rax, 0x20(%rbx)
movq 0x28(%rbx), %rax
movq 0x30(%rbx), %rdi
leaq (%rdi,%r15), %rcx
cmpq %rcx, %rax
jbe 0x88abd
addq 0x20(%rbx), %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x6570
addq %r15, 0x30(%rbx)
jmp 0x88b46
xorl %r15d, %r15d
movl (%r14), %esi
movq %rbx, %rdi
callq 0x5597a
movl %eax, %ebp
movl 0x30(%r14), %ecx
movl $0x1, %esi
movl $0x1, %eax
cmpl $0x80, %ecx
jb 0x88b91
movl $0x2, %eax
cmpl $0x4000, %ecx           # imm = 0x4000
jb 0x88b91
movl $0x3, %eax
cmpl $0x200000, %ecx         # imm = 0x200000
jb 0x88b91
cmpl $0x10000000, %ecx       # imm = 0x10000000
movl $0x5, %eax
sbbl $0x0, %eax
movl 0x34(%r14), %ecx
cmpl $0x80, %ecx
jb 0x88bc5
movl $0x2, %esi
cmpl $0x4000, %ecx           # imm = 0x4000
jb 0x88bc5
movl $0x3, %esi
cmpl $0x200000, %ecx         # imm = 0x200000
jb 0x88bc5
cmpl $0x10000000, %ecx       # imm = 0x10000000
movl $0x5, %esi
sbbl $0x0, %esi
addl %eax, %esi
addl %r15d, %ebp
movq %rbx, %rdi
callq 0x5597a
movl %eax, %r15d
movl 0x30(%r14), %esi
movq %rbx, %rdi
callq 0x5597a
movl %eax, %r12d
addl %r15d, %r12d
addl %ebp, %r12d
movl 0x34(%r14), %esi
movq %rbx, %rdi
callq 0x5597a
addl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/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 0x88c43
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 0x88c50
orl %eax, %ebp
incq %r12
cmpq %r12, %r15
jne 0x88c22
jmp 0x88c45
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/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 0x88dde
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 0x88c50
orl %eax, %ebp
incq %r12
cmpq %r12, %r15
jne 0x88dbc
jmp 0x88de0
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/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 0x69d0
testq %rax, %rax
je 0x88e78
movl $0x6, (%rax)
leaq -0x32(%rip), %rcx       # 0x88deb
movq %rcx, 0x10(%rax)
cmpl $0x1, %ebp
leaq -0x223(%rip), %rcx      # 0x88c08
leaq -0x90(%rip), %rdx       # 0x88da2
cmoveq %rcx, %rdx
movq %rdx, 0x20(%rax)
leaq -0x3c3(%rip), %rcx      # 0x88a7e
movq %rcx, 0x28(%rax)
testq %r14, %r14
je 0x88e7f
movl (%r14), %esi
movl 0x4(%r14), %edx
cmpl %esi, %edx
jl 0x88f02
movl %esi, %ecx
negl %ecx
movl %ecx, 0x30(%rax)
xorl %ecx, %ecx
subl %esi, %edx
je 0x88e73
movl %edx, %esi
incl %ecx
sarl %esi
cmpl $0x1, %edx
movl %esi, %edx
ja 0x88e68
movl %ecx, 0x34(%rax)
jmp 0x88e7a
xorl %eax, %eax
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 0x88e8b
movq 0x1000(%rbx), %rdi
testq %rdi, %rdi
je 0x88e51
movl (%rdi), %r8d
testq %r8, %r8
je 0x88e51
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 0x88ef1
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 0x88ec8
jmp 0x88e51
leaq 0x12963(%rip), %rdi     # 0x9b86c
leaq 0x1296f(%rip), %rsi     # 0x9b87f
leaq 0x1297b(%rip), %rcx     # 0x9b892
movl $0x293, %edx            # imm = 0x293
callq 0x6460
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/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 0x69d0
testq %rax, %rax
je 0x894f9
movl $0x9, (%rax)
leaq -0x16e(%rip), %rcx      # 0x892ce
movq %rcx, 0x18(%rax)
leaq -0x3e(%rip), %rcx       # 0x89409
movq %rcx, 0x10(%rax)
movzbl (%r14), %ecx
movl $0x1, %edx
testb %cl, %cl
jns 0x894e6
movzbl 0x1(%r14), %edx
cmpb $-0x41, %cl
ja 0x89475
andl $0x3f, %ecx
shll $0x8, %ecx
orl %edx, %ecx
movl $0x2, %edx
jmp 0x894e6
cmpb $-0x21, %cl
ja 0x89493
shll $0x8, %edx
movzbl 0x2(%r14), %esi
andl $0x1f, %ecx
shll $0x10, %ecx
orl %edx, %ecx
orl %esi, %ecx
movl $0x3, %edx
jmp 0x894e6
cmpb $-0x11, %cl
ja 0x894bb
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 0x894e6
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 0x894fb
movq %rax, %rdi
callq 0x85fb
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/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 0x89523
pushq %rbx
movq %rdi, %rbx
movq 0x38(%rdi), %rdi
testq %rdi, %rdi
je 0x8951a
callq 0x68a0
movq %rbx, %rdi
popq %rbx
jmp 0x68a0
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/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;

    /* 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:
movslq (%r8), %rax
testq %rax, %rax
jle 0x89547
xorl %edx, %edx
movq 0x38(%rsi), %rdi
movb (%rdi), %dil
movb %dil, (%rcx,%rdx)
incq %rdx
cmpq %rdx, %rax
jne 0x89534
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, -0x10(%rsp)
movslq (%r8), %rax
movq %rax, -0x8(%rsp)
testq %rax, %rax
jle 0x89696
movl 0x30(%rsi), %edi
movq 0x38(%rsi), %rsi
xorl %r8d, %r8d
xorl %ebp, %ebp
xorl %r9d, %r9d
xorl %eax, %eax
xorl %ebx, %ebx
movslq %ebp, %r15
shlq $0x4, %r15
movl 0xc(%rsi,%r15), %r14d
movl %r14d, %r11d
subl %ebx, %r11d
movl $0x1, %r10d
js 0x8962f
movslq 0x14(%rdx), %r12
subq 0x30(%rdx), %r12
setbe %r13b
testl %r11d, %r11d
setne %cl
testb %r13b, %cl
jne 0x8962f
cmpq $0x10000000, %r12       # imm = 0x10000000
ja 0x895cf
movslq 0x38(%rdx), %rcx
leaq (%rcx,%r12,8), %rcx
addq $-0x7, %rcx
movl %r11d, %r12d
cmpq %r12, %rcx
jb 0x8962f
testl %r11d, %r11d
je 0x89610
movq 0x20(%rdx), %r12
movq 0x30(%rdx), %r13
movl 0x38(%rdx), %ebp
subl %r14d, %ebx
movzbl (%r12,%r13), %ecx
xorl %r14d, %r14d
btl %ebp, %ecx
setb %r14b
leal (%r14,%r9,2), %r9d
xorl %ecx, %ecx
testl %ebp, %ebp
leal -0x1(%rbp), %ebp
setle %cl
addq %rcx, %r13
movq %r13, 0x30(%rdx)
andl $0x7, %ebp
movl %ebp, 0x38(%rdx)
incl %ebx
jne 0x895e2
addq %rsi, %r15
addl %eax, %r11d
movl %r9d, %ebp
subl 0x4(%r15), %ebp
sets %al
cmpl %edi, %ebp
setge %cl
orb %al, %cl
je 0x8963d
movl %r11d, %eax
movl %r11d, %ebx
xorl %r15d, %r15d
testl %r10d, %r10d
je 0x8957d
jmp 0x8967d
movl %ebp, %eax
shlq $0x4, %rax
movb $0x1, %r15b
cmpl %r9d, 0x8(%rsi,%rax)
jne 0x89672
addq %rsi, %rax
cmpl %r11d, 0xc(%rax)
jne 0x89672
movb (%rax), %al
movq -0x10(%rsp), %rcx
movb %al, (%rcx,%r8)
movl $0x5, %r10d
xorl %r15d, %r15d
movl %r11d, %eax
movl %r11d, %ebx
jmp 0x89632
movl %r11d, %eax
movl %r11d, %ebx
xorl %r10d, %r10d
jmp 0x89632
cmpl $0x5, %r10d
je 0x89688
testb %r15b, %r15b
je 0x8969a
incq %r8
cmpq -0x8(%rsp), %r8
jne 0x89574
xorl %eax, %eax
jmp 0x8969f
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/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
movl %ecx, %ebp
movq %rdx, %r14
movq %rsi, %r15
xorl %ebx, %ebx
subl $0x1, %ebp
jb 0x89eb4
movzbl (%r14), %ecx
testb %cl, %cl
js 0x89e5f
movslq 0x40(%r15,%rcx,4), %rdx
movq 0x30(%r15), %rax
shlq $0x4, %rdx
cmpl %ecx, (%rax,%rdx)
jne 0x89ec1
addq %rdx, %rax
jmp 0x89e95
movl 0x38(%r15), %eax
testl %eax, %eax
jle 0x89e81
movq 0x30(%r15), %rsi
xorl %edx, %edx
cmpl %ecx, (%rsi)
je 0x89e83
incq %rdx
addq $0x10, %rsi
cmpq %rdx, %rax
jne 0x89e6d
movl %eax, %edx
jmp 0x89e83
xorl %edx, %edx
cmpl %eax, %edx
jne 0x89e8b
xorl %eax, %eax
jmp 0x89ea8
movl %edx, %eax
shlq $0x4, %rax
addq 0x30(%r15), %rax
movl 0x8(%rax), %esi
movl 0xc(%rax), %edx
movq 0x8(%r15), %rdi
callq 0x88c50
orl %eax, %ebx
movb $0x1, %al
incq %r14
testb %al, %al
jne 0x89e3b
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x11a80(%rip), %rdi     # 0x9b948
leaq 0x119b0(%rip), %rsi     # 0x9b87f
leaq 0x11a96(%rip), %rcx     # 0x9b96c
movl $0x431, %edx            # imm = 0x431
callq 0x6460
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/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 0x89fc1
pushq %rbx
movq %rdi, %rbx
movq 0x30(%rdi), %rdi
testq %rdi, %rdi
je 0x89fb8
callq 0x68a0
movq %rbx, %rdi
popq %rbx
jmp 0x68a0
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/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 0x8a9c4
movq 0x38(%r13), %rsi
testq %rsi, %rsi
je 0x8a9c4
cmpl $0x0, 0x8(%rsp)
js 0x8a9c4
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_c_makefile_star2_O1/icebert[P]pblat/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 0x8a9fc
pushq %rbx
movq %rdi, %rbx
movq 0x30(%rdi), %rdi
testq %rdi, %rdi
je 0x8a9e7
callq *0x10(%rdi)
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0x8a9f3
callq *0x10(%rdi)
movq %rbx, %rdi
popq %rbx
jmp 0x68a0
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/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", codec2str(codec));
	return NULL;
    }
}

// Assembly:
cmpl $0x9, %edi
ja 0x8ae5b
movl $0x105, %eax            # imm = 0x105
btq %rdi, %rax
jb 0x8ae5b
movl %edi, %eax
leaq 0x33e53(%rip), %r9      # 0xbeca0
movq %rsi, %rdi
movl %edx, %esi
movl %ecx, %edx
movl %r8d, %ecx
jmpq *(%r9,%rax,8)
pushq %rax
callq 0x86bb
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/htslib/cram/cram_codecs.c
// Function: cram_byte_array_len_encode
int cram_byte_array_len_encode(cram_slice *slice, cram_codec *c,
			       char *in, int in_size) {
    int32_t i32 = in_size;
    int r = 0;

    r |= c->e_byte_array_len.len_codec->encode(slice,
					       c->e_byte_array_len.len_codec,
					       (char *)&i32, 1);
    r |= c->e_byte_array_len.val_codec->encode(slice,
					       c->e_byte_array_len.val_codec,
					       in, in_size);
    return r;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %ecx, %ebx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
leaq 0xc(%rsp), %rdx
movl %ecx, (%rdx)
movq 0x48(%rsi), %rsi
movl $0x1, %ecx
callq *0x20(%rsi)
movl %eax, %ebp
movq 0x50(%r15), %rsi
movq %r12, %rdi
movq %r14, %rdx
movl %ebx, %ecx
callq *0x20(%rsi)
orl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/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 0x8aed9
pushq %rbx
movq %rdi, %rbx
movq 0x48(%rdi), %rdi
testq %rdi, %rdi
je 0x8aec4
callq *0x10(%rdi)
movq 0x50(%rbx), %rdi
testq %rdi, %rdi
je 0x8aed0
callq *0x10(%rdi)
movq %rbx, %rdi
popq %rbx
jmp 0x68a0
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/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 0x69d0
testq %rax, %rax
je 0x8b20f
movq %rax, %rbx
movl $0x4, (%rax)
leaq -0x30f(%rip), %rax      # 0x8aeaf
movq %rax, 0x10(%rbx)
leaq -0x364(%rip), %rax      # 0x8ae65
movq %rax, 0x20(%rbx)
leaq -0x2fa(%rip), %rax      # 0x8aeda
movq %rax, 0x28(%rbx)
movl (%r14), %edi
movq 0x8(%r14), %rcx
xorl %esi, %esi
movl $0x1, %edx
movl %ebp, %r8d
callq 0x8b219
movq %rax, 0x48(%rbx)
movl 0x4(%r14), %edi
movq 0x10(%r14), %rcx
xorl %esi, %esi
movl $0x4, %edx
movl %ebp, %r8d
callq 0x8b219
movq %rax, 0x50(%rbx)
jmp 0x8b211
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/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", codec2str(codec));
	abort();
    }
}

// Assembly:
pushq %rax
testq %rsi, %rsi
je 0x8b228
cmpl $0x0, 0x100c(%rsi)
je 0x8b25a
movl $0x385, %eax            # imm = 0x385
btq %rdi, %rax
jb 0x8b25e
movl %edi, %eax
leaq 0x33ab4(%rip), %r9      # 0xbecf0
movq %rsi, %rdi
movl %edx, %esi
movq %rcx, %rdx
movl %r8d, %ecx
callq *(%r9,%rax,8)
testq %rax, %rax
je 0x8b25c
movq $0x0, 0x8(%rax)
jmp 0x8b25c
xorl %eax, %eax
popq %rcx
retq
callq 0x86f0
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/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 0x69d0
testq %rax, %rax
je 0x8b632
movq %rax, %rbx
movl $0x5, (%rax)
cmpl $0x5, %r12d
je 0x8b517
cmpl $0x4, %r12d
jne 0x8b5e2
leaq 0x12b(%rip), %rax       # 0x8b640
jmp 0x8b51e
leaq -0x2bb(%rip), %rax      # 0x8b263
movq %rax, 0x18(%rbx)
leaq -0x64(%rip), %rax       # 0x8b4c5
movq %rax, 0x10(%rbx)
movb (%r14), %al
movb %al, 0x30(%rbx)
andl $0xffffff00, %r15d      # imm = 0xFFFFFF00
movzbl 0x1(%r14), %ecx
cmpl $0x100, %r15d           # imm = 0x100
jne 0x8b572
movzbl 0x2(%r14), %eax
shll $0x8, %eax
movzbl 0x3(%r14), %edx
shll $0x10, %edx
orl %eax, %edx
movzbl 0x4(%r14), %eax
shll $0x18, %eax
orl %edx, %eax
orl %ecx, %eax
movl %eax, 0x34(%rbx)
leaq 0x5(%r14), %rax
jmp 0x8b61a
leaq 0x1(%r14), %rax
movl $0x1, %edx
testb %cl, %cl
jns 0x8b614
movzbl 0x2(%r14), %edx
cmpb $-0x41, %cl
ja 0x8b59c
andl $0x3f, %ecx
shll $0x8, %ecx
orl %edx, %ecx
movl $0x2, %edx
jmp 0x8b614
cmpb $-0x21, %cl
ja 0x8b5ba
shll $0x8, %edx
movzbl 0x3(%r14), %esi
andl $0x1f, %ecx
shll $0x10, %ecx
orl %edx, %ecx
orl %esi, %ecx
movl $0x3, %edx
jmp 0x8b614
cmpb $-0x11, %cl
ja 0x8b5e9
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 0x8b614
callq 0x8735
jmp 0x8b62a
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
addq %rdx, %rax
movl %ecx, 0x34(%rbx)
subq %r14, %rax
movslq %ebp, %rcx
cmpq %rcx, %rax
je 0x8b634
callq 0x8719
movq %rbx, %rdi
callq 0x68a0
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/htslib/cram/cram_codecs.c
// Function: cram_byte_array_stop_decode_char
static int cram_byte_array_stop_decode_char(cram_slice *slice, cram_codec *c,
					    cram_block *in, char *out,
					    int *out_size) {
    cram_block *b = NULL;
    char *cp, ch;

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

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

    cp = (char *)b->data + b->idx;
    while ((ch = *cp) != (char)c->byte_array_stop.stop) {
	if (cp - (char *)b->data >= b->uncomp_size)
	    return -1;
	*out++ = ch;
	cp++;
    }

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

    return 0;
}

// Assembly:
pushq %rbx
movl 0x34(%rsi), %eax
cmpq $0x400, %rax            # imm = 0x400
setb %r9b
movq 0x18(%rdi), %rdx
testq %rdx, %rdx
setne %r10b
testb %r10b, %r9b
je 0x8b664
movq (%rdx,%rax,8), %rdx
jmp 0x8b6a4
movq (%rdi), %rdx
movslq 0x20(%rdx), %r9
testq %r9, %r9
jle 0x8b6a2
movq 0x10(%rdi), %rdi
xorl %r10d, %r10d
movq (%rdi,%r10,8), %r11
testq %r11, %r11
je 0x8b694
cmpl $0x4, 0x8(%r11)
jne 0x8b694
cmpl %eax, 0xc(%r11)
jne 0x8b694
xorl %ebx, %ebx
movq %r11, %rdx
jmp 0x8b696
movb $0x1, %bl
testb %bl, %bl
je 0x8b6a4
incq %r10
cmpq %r10, %r9
jne 0x8b677
xorl %edx, %edx
testq %rdx, %rdx
je 0x8b70d
movslq 0x1c(%rdx), %r11
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl 0x14(%rdx), %r11d
jge 0x8b714
movq 0x20(%rdx), %r9
leaq (%r9,%r11), %rdi
movb (%r9,%r11), %r10b
cmpb 0x30(%rsi), %r10b
je 0x8b6f3
addq %r11, %r9
movq %r9, %r11
subq 0x20(%rdx), %r11
movslq 0x14(%rdx), %rbx
cmpq %rbx, %r11
jge 0x8b714
movb %r10b, (%rcx)
incq %rcx
movb 0x1(%rdi), %r10b
incq %rdi
incq %r9
cmpb 0x30(%rsi), %r10b
jne 0x8b6cd
movl 0x20(%rdx), %eax
movl 0x1c(%rdx), %ecx
addl %eax, %ecx
movl %edi, %esi
subl %ecx, %esi
movl %esi, (%r8)
subl %eax, %edi
incl %edi
movl %edi, 0x1c(%rdx)
xorl %eax, %eax
jmp 0x8b714
xorl %eax, %eax
cmpl (%r8), %eax
sbbl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/htslib/cram/cram_codecs.c
// Function: cram_byte_array_stop_encode_init
cram_codec *cram_byte_array_stop_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_BYTE_ARRAY_STOP;
    c->free = cram_byte_array_stop_encode_free;
    c->encode = cram_byte_array_stop_encode;
    c->store = cram_byte_array_stop_encode_store;

    c->e_byte_array_stop.stop = ((int *)dat)[0];
    c->e_byte_array_stop.content_id = ((int *)dat)[1];

    return c;
}

// Assembly:
pushq %rbx
movq %rdx, %rbx
movl $0x240, %edi            # imm = 0x240
callq 0x69d0
testq %rax, %rax
je 0x8bc03
movl $0x5, (%rax)
leaq -0x360(%rip), %rcx      # 0x8b87c
movq %rcx, 0x10(%rax)
leaq -0x4d1(%rip), %rcx      # 0x8b716
movq %rcx, 0x20(%rax)
leaq -0x36c(%rip), %rcx      # 0x8b886
movq %rcx, 0x28(%rax)
movb (%rbx), %cl
movb %cl, 0x30(%rax)
movl 0x4(%rbx), %ecx
movl %ecx, 0x34(%rax)
jmp 0x8bc05
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/htslib/cram/cram_codecs.c
// Function: cram_codec_to_id
int cram_codec_to_id(cram_codec *c, int *id2) {
    int bnum1, bnum2 = -2;

    switch (c->codec) {
    case E_HUFFMAN:
	bnum1 = c->huffman.ncodes == 1 ? -2 : -1;
	break;
    case E_GOLOMB:
    case E_BETA:
    case E_SUBEXP:
    case E_GOLOMB_RICE:
    case E_GAMMA:
	bnum1 = -1;
	break;
    case E_EXTERNAL:
	bnum1 = c->external.content_id;
	break;
    case E_BYTE_ARRAY_LEN:
	bnum1 = cram_codec_to_id(c->byte_array_len.len_codec, NULL);
	bnum2 = cram_codec_to_id(c->byte_array_len.val_codec, NULL);
	break;
    case E_BYTE_ARRAY_STOP:
	bnum1 = c->byte_array_stop.content_id;
	break;
    case E_NULL:
	bnum1 = -2;
	break;
    default:
	fprintf(stderr, "Unknown codec type %d\n", c->codec);
	bnum1 = -1;
    }

    if (id2)
	*id2 = bnum2;
    return bnum1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl (%rdi), %edx
movl $0xfffffffe, %r14d      # imm = 0xFFFFFFFE
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpq $0x9, %rdx
ja 0x8bcc1
movq %rdi, %r15
leaq 0xfb88(%rip), %rax      # 0x9b7ec
movslq (%rax,%rdx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
testq %rbx, %rbx
je 0x8bc75
movl %r14d, (%rbx)
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0xfffffffe, %ebp       # imm = 0xFFFFFFFE
jmp 0x8bc6d
movl 0x34(%r15), %ebp
jmp 0x8bc6d
xorl %ebp, %ebp
cmpl $0x1, 0x30(%r15)
sete %bpl
notl %ebp
jmp 0x8bc6d
movl 0x30(%r15), %ebp
jmp 0x8bc6d
movq 0x30(%r15), %rdi
xorl %esi, %esi
callq 0x8bc3d
movl %eax, %ebp
movq 0x38(%r15), %rdi
xorl %esi, %esi
callq 0x8bc3d
movl %eax, %r14d
jmp 0x8bc6d
movq 0x33310(%rip), %rax     # 0xbefd8
movq (%rax), %rdi
leaq 0xfe99(%rip), %rsi      # 0x9bb6b
xorl %eax, %eax
callq 0x6a90
jmp 0x8bc6d
// File: /workspace/github_c_makefile_star2_O1/albertito[P]libfiu/preload/posix/codegen.c
// Function: fiu_init_final
static void constructor_attr(250) _fiu_init_final(void)
{
	struct timeval tv;

	rec_inc();

	fiu_init(0);

	/* since we use random() in the wrappers, we need to seed it */
	gettimeofday(&tv, NULL);
	srandom(tv.tv_usec);

	rec_dec();
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
leaq 0x15ce6(%rip), %rdi     # 0x18ff0
callq 0x3120
movq %rax, %rbx
incl (%rax)
xorl %edi, %edi
callq 0x3080
leaq 0x8(%rsp), %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x30e0
movl 0x8(%r14), %edi
callq 0x3060
decl (%rbx)
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/albertito[P]libfiu/preload/posix/modules/posix.custom.c
// Function: set_ferror
void set_ferror(void * stream)
{
	char key[STREAM_KEY_SIZE];
	stream_to_key(stream, key);

	pthread_once(&ferror_hash_table_is_initialized,
			_fiu_init_ferror_hash_table);

	pthread_mutex_lock(&ferror_hash_table_mutex);

	// Use a dummy the value; we don't care about it, we only need to be able to
	// distinguish it from NULL.
	hash_set(ferror_hash_table, key, (void *) 0xDEAD);

	pthread_mutex_unlock(&ferror_hash_table_mutex);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rcx
leaq 0x2daf(%rip), %rdx      # 0x1223c
movq %rsp, %rbx
movl $0x11, %esi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x30d0
leaq 0x9c7a(%rip), %rdi      # 0x19120
leaq 0x38(%rip), %rsi        # 0xf4e5
callq 0x31f0
leaq 0x9c6f(%rip), %r14      # 0x19128
movq %r14, %rdi
callq 0x3200
movq 0x9c88(%rip), %rdi      # 0x19150
movl $0xdead, %edx           # imm = 0xDEAD
movq %rbx, %rsi
callq 0x3140
movq %r14, %rdi
callq 0x3160
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/albertito[P]libfiu/preload/posix/modules/posix.custom.c
// Function: fiu_init_ferror_hash_table
static void _fiu_init_ferror_hash_table(void)
{
	rec_inc();
	pthread_mutex_lock(&ferror_hash_table_mutex);

	// Create the hash table. No need for a value destructor, as our values
	// are not pointers but static values.
	ferror_hash_table = hash_create(NULL);

	pthread_mutex_unlock(&ferror_hash_table_mutex);
	rec_dec();
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0x9aff(%rip), %rdi      # 0x18ff0
callq 0x3120
movq %rax, %rbx
incl (%rax)
leaq 0x9c23(%rip), %r14      # 0x19128
movq %r14, %rdi
callq 0x3200
xorl %edi, %edi
callq 0x30a0
movq %rax, 0x9c35(%rip)      # 0x19150
movq %r14, %rdi
callq 0x3160
decl (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/albertito[P]libfiu/preload/posix/modules/posix.custom.c
// Function: clear_ferror
static void clear_ferror(void * stream)
{
	char key[STREAM_KEY_SIZE];
	stream_to_key(stream, key);

	pthread_once(&ferror_hash_table_is_initialized,
			_fiu_init_ferror_hash_table);

	pthread_mutex_lock(&ferror_hash_table_mutex);

	hash_del(ferror_hash_table, key);

	pthread_mutex_unlock(&ferror_hash_table_mutex);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rcx
leaq 0x2a55(%rip), %rdx      # 0x1223c
movq %rsp, %rbx
movl $0x11, %esi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x30d0
leaq 0x9920(%rip), %rdi      # 0x19120
leaq -0x322(%rip), %rsi      # 0xf4e5
callq 0x31f0
leaq 0x9915(%rip), %r14      # 0x19128
movq %r14, %rdi
callq 0x3200
movq 0x992e(%rip), %rdi      # 0x19150
movq %rbx, %rsi
callq 0x3180
movq %r14, %rdi
callq 0x3160
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/albertito[P]libfiu/preload/posix/../../libfiu/hash.c
// Function: hash_create
struct hash *hash_create(void (*destructor)(void *))
{
	struct hash *h = malloc(sizeof(struct hash));
	if (h == NULL)
		return NULL;

	h->entries = malloc(sizeof(struct entry) * MIN_SIZE);
	if (h->entries == NULL) {
		free(h);
		return NULL;
	}

	memset(h->entries, 0, sizeof(struct entry) * MIN_SIZE);

	h->table_size = MIN_SIZE;
	h->nentries = 0;
	h->nremoved = 0;

	if (destructor == NULL)
		destructor = dumb_destructor;

	h->destructor = destructor;

	return h;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movl $0x28, %edi
callq 0x3210
testq %rax, %rax
je 0x105ed
movq %rax, %rbx
movl $0xf0, %edi
callq 0x3210
movq %rax, (%rbx)
testq %rax, %rax
je 0x105e5
movl $0xf0, %edx
movq %rax, %rdi
xorl %esi, %esi
callq 0x30f0
testq %r14, %r14
leaq 0x2e(%rip), %rax        # 0x105fa
cmovneq %r14, %rax
movq $0xa, 0x8(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
movq %rax, 0x20(%rbx)
jmp 0x105ef
movq %rbx, %rdi
callq 0x3030
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/albertito[P]libfiu/preload/posix/../../libfiu/hash.c
// Function: hash_free
void hash_free(struct hash *h)
{
	size_t i;
	struct entry *entry;

	for (i = 0; i < h->table_size; i++) {
		entry = h->entries + i;
		if (entry->in_use == IN_USE) {
			h->destructor(entry->value);
			free(entry->key);
		}
	}

	free(h->entries);
	free(h);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0x0, 0x8(%rdi)
je 0x1063f
movl $0x10, %r14d
xorl %r15d, %r15d
movq (%rbx), %r12
cmpl $0x1, (%r12,%r14)
jne 0x10632
movq -0x8(%r12,%r14), %rdi
callq *0x20(%rbx)
movq -0x10(%r12,%r14), %rdi
callq 0x3030
incq %r15
addq $0x18, %r14
cmpq 0x8(%rbx), %r15
jb 0x10616
movq (%rbx), %rdi
callq 0x3030
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x3030
// File: /workspace/github_c_makefile_star2_O1/albertito[P]libfiu/preload/posix/../../libfiu/hash.c
// Function: hash_get
void *hash_get(struct hash *h, const char *key)
{
	size_t pos;
	struct entry *entry;

	pos = murmurhash2(key, strlen(key)) % h->table_size;

	for (int i = 0; i < h->table_size; i++) {
		entry = h->entries + pos;
		if (entry->in_use == NEVER) {
			/* We got to a entry never used, no match. */
			return NULL;
		} else if (entry->in_use == IN_USE &&
		           strcmp(key, entry->key) == 0) {
			/* The key matches. */
			return entry->value;
		}

		/* The key doesn't match this entry, continue with linear
		 * probing. */
		pos = (pos + 1) % h->table_size;
	}

	/* We went through the entire table and did not find the key.
	 * Note this is a pathological case that we don't expect would happen
	 * under normal operation, since we resize the table so there are
	 * always some never-used spaces. */
	return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x30b0
movq %rbx, %rdi
movq %rax, %rsi
callq 0x106f2
movl %eax, %r15d
movq (%r14), %r12
movq 0x8(%r14), %r13
cmpq $0x1, %r13
movq %r13, %rbp
adcq $0x0, %rbp
movq $0x0, (%rsp)
movq %r15, %rax
xorl %edx, %edx
divq %r13
movq %rdx, %r15
leaq (%rdx,%rdx,2), %rax
movl 0x10(%r12,%rax,8), %ecx
cmpl $0x1, %ecx
je 0x106ba
testl %ecx, %ecx
jne 0x106cd
jmp 0x106df
leaq (%r12,%rax,8), %r14
movq (%r14), %rsi
movq %rbx, %rdi
callq 0x3130
testl %eax, %eax
je 0x106d7
incq %r15
decq %rbp
jne 0x1069b
jmp 0x106df
movq 0x8(%r14), %rax
movq %rax, (%rsp)
movq (%rsp), %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/albertito[P]libfiu/preload/posix/../../libfiu/hash.c
// Function: hash_set
static bool _hash_set(struct hash *h, char *key, void *value)
{
	size_t pos;
	struct entry *entry;

	pos = murmurhash2(key, strlen(key)) % h->table_size;

	for (int i = 0; i < h->table_size; i++) {
		entry = h->entries + pos;
		if (entry->in_use == NEVER) {
			/* Use only fresh entries, reusing removed ones
			 * introduces significant complications when combined
			 * with the linear probing. */
			entry->in_use = IN_USE;
			entry->key = key;
			entry->value = value;
			h->nentries++;
			return true;
		} else if (entry->in_use == IN_USE &&
		           strcmp(key, entry->key) == 0) {
			/* The key matches, override the value. */
			h->destructor(entry->value);
			entry->value = value;
			return true;
		}

		/* The key doesn't match this entry, continue with linear
		 * probing. */
		pos = (pos + 1) % h->table_size;
	}

	/* We went through the entire table and did not find the key.
	 * Note this is a pathological case that we don't expect would happen
	 * under normal operation, since we resize the table so there are
	 * always some never-used spaces. */
	return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, 0x10(%rsp)
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x30b0
movq %r14, 0x18(%rsp)
movq %r14, %rdi
movq %rax, %rsi
callq 0x106f2
movl %eax, %r12d
movq (%rbx), %r14
movq %rbx, 0x8(%rsp)
movq 0x8(%rbx), %rbx
xorl %esi, %esi
cmpq $0x1, %rbx
sbbq %rbx, %rsi
movb $0x1, %bpl
movl $0x1, %r15d
movq %rsi, 0x20(%rsp)
movq %r12, %rax
xorl %edx, %edx
divq %rbx
movq %rdx, %r12
leaq (%rdx,%rdx,2), %rax
leaq (%r14,%rax,8), %r13
movl 0x10(%r13), %eax
cmpl $0x1, %eax
je 0x10817
testl %eax, %eax
jne 0x1082e
jmp 0x1084a
movq (%r13), %rsi
movq 0x18(%rsp), %rdi
callq 0x3130
movq 0x20(%rsp), %rsi
testl %eax, %eax
je 0x1086f
incq %r12
cmpq %r15, %rbx
seta %bpl
leaq (%rsi,%r15), %rax
incq %rax
incq %r15
cmpq $0x1, %rax
jne 0x107f5
jmp 0x10884
movl $0x1, 0x10(%r13)
movq 0x18(%rsp), %rax
movq %rax, (%r13)
movq 0x10(%rsp), %rax
movq %rax, 0x8(%r13)
movq 0x8(%rsp), %rax
incq 0x10(%rax)
jmp 0x10884
movq 0x8(%r13), %rdi
movq 0x8(%rsp), %rax
callq *0x20(%rax)
movq 0x10(%rsp), %rax
movq %rax, 0x8(%r13)
andb $0x1, %bpl
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/albertito[P]libfiu/preload/posix/../../libfiu/hash.c
// Function: auto_resize_table
static bool auto_resize_table(hash_t *h)
{
	/* Slots in the table is taken by valid and removed entries.
	 * Since we don't reuse removed slots, we need to also take them into
	 * consideration and shrink if we are accumulating too many.
	 *
	 * This function always resizes to <number of entries> * 2, which
	 * preserves the "at least 30% usable" property both when growing and
	 * shrinking, and makes calculations simpler.
	 */

	/* Maintain at least 30% usable entries. */
	float usable_ratio =
	    (float)(h->table_size - h->nentries - h->nremoved) / h->table_size;
	if (usable_ratio < 0.3) {
		return resize_table(h, h->nentries * 2);
	}

	/* If we have less than 30% used (by valid entries), compact. */
	float entries_ratio = (float)h->nentries / h->table_size;
	if (h->table_size > MIN_SIZE && entries_ratio < 0.3) {
		return resize_table(h, h->nentries * 2);
	}

	return true;
}

// Assembly:
movq 0x8(%rdi), %rax
movq 0x10(%rdi), %rsi
movq 0x18(%rdi), %rdx
addq %rsi, %rdx
movq %rax, %rcx
subq %rdx, %rcx
js 0x108b7
cvtsi2ss %rcx, %xmm1
jmp 0x108cc
movq %rcx, %rdx
shrq %rdx
andl $0x1, %ecx
orq %rdx, %rcx
cvtsi2ss %rcx, %xmm1
addss %xmm1, %xmm1
testq %rax, %rax
js 0x108d8
cvtsi2ss %rax, %xmm0
jmp 0x108ef
movq %rax, %rcx
shrq %rcx
movl %eax, %edx
andl $0x1, %edx
orq %rcx, %rdx
cvtsi2ss %rdx, %xmm0
addss %xmm0, %xmm0
divss %xmm0, %xmm1
cvtss2sd %xmm1, %xmm2
movsd 0x1a09(%rip), %xmm1     # 0x12308
ucomisd %xmm2, %xmm1
jbe 0x1090d
addq %rsi, %rsi
jmp 0x10b83
cmpq $0xb, %rax
jb 0x1094d
testq %rsi, %rsi
js 0x10922
xorps %xmm2, %xmm2
cvtsi2ss %rsi, %xmm2
jmp 0x1093c
movq %rsi, %rax
shrq %rax
movl %esi, %ecx
andl $0x1, %ecx
orq %rax, %rcx
xorps %xmm2, %xmm2
cvtsi2ss %rcx, %xmm2
addss %xmm2, %xmm2
divss %xmm0, %xmm2
xorps %xmm0, %xmm0
cvtss2sd %xmm2, %xmm0
ucomisd %xmm0, %xmm1
ja 0x10905
movb $0x1, %al
retq
// File: /workspace/github_c_makefile_star2_O1/albertito[P]libfiu/preload/posix/../../libfiu/hash.c
// Function: hash_del
bool hash_del(struct hash *h, const char *key)
{
	size_t pos;
	struct entry *entry;
	bool found = false;

	pos = murmurhash2(key, strlen(key)) % h->table_size;

	for (int i = 0; i < h->table_size; i++) {
		entry = h->entries + pos;
		if (entry->in_use == NEVER) {
			/* We got to a never used key, not found. */
			return false;
		} else if (entry->in_use == IN_USE &&
		           strcmp(key, entry->key) == 0) {
			/* The key matches, remove it. */
			found = true;
			break;
		}

		/* The key doesn't match this entry, continue with linear
		 * probing. */
		pos = (pos + 1) % h->table_size;
	}

	if (!found) {
		return false;
	}

	/* Remove the entry */
	free(entry->key);
	h->destructor(entry->value);
	entry->key = NULL;
	entry->value = NULL;
	entry->in_use = REMOVED;
	h->nentries--;
	h->nremoved++;

	if (!auto_resize_table(h))
		return false;

	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x30b0
movq %r14, 0x10(%rsp)
movq %r14, %rdi
movq %rax, %rsi
callq 0x106f2
movl %eax, %r15d
movq (%rbx), %r13
movq %rbx, 0x8(%rsp)
movq 0x8(%rbx), %r14
cmpq $0x1, %r14
movq %r14, %rbx
adcq $0x0, %rbx
movq %r15, %rax
xorl %edx, %edx
divq %r14
movq %rdx, %r15
leaq (%rdx,%rdx,2), %rax
leaq (,%rax,8), %r12
addq %r13, %r12
movl 0x10(%r12), %eax
movb $0x1, %bpl
cmpl $0x1, %eax
je 0x109c3
testl %eax, %eax
jne 0x109d5
jmp 0x109df
movq (%r12), %rsi
movq 0x10(%rsp), %rdi
callq 0x3130
testl %eax, %eax
je 0x109e3
incq %r15
decq %rbx
jne 0x10996
jmp 0x109e5
movb $0x1, %al
jmp 0x109e7
xorl %ebp, %ebp
xorl %eax, %eax
orb %al, %bpl
je 0x109fd
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%r12), %rdi
callq 0x3030
movq 0x8(%r12), %rdi
movq 0x8(%rsp), %rbx
callq *0x20(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%r12)
movl $0x2, 0x10(%r12)
decq 0x10(%rbx)
incq 0x18(%rbx)
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10899
// File: /workspace/github_c_makefile_star2_O1/albertito[P]libfiu/preload/posix/../../libfiu/hash.c
// Function: cache_create
struct cache *cache_create()
{
	struct cache *c;

	c = malloc(sizeof(struct cache));
	if (c == NULL)
		return NULL;

	c->hash = hash_create(NULL);
	if (c->hash == NULL) {
		free(c);
		return NULL;
	}

	pthread_rwlock_init(&c->lock, NULL);

	return c;
}

// Assembly:
pushq %rbx
movl $0x48, %edi
callq 0x3210
testq %rax, %rax
je 0x10a7c
movq %rax, %rbx
xorl %edi, %edi
callq 0x30a0
movq %rax, (%rbx)
testq %rax, %rax
je 0x10a74
movq %rbx, %rdi
addq $0x10, %rdi
xorl %esi, %esi
callq 0x3190
jmp 0x10a7e
movq %rbx, %rdi
callq 0x3030
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/albertito[P]libfiu/preload/posix/../../libfiu/hash.c
// Function: cache_invalidate
bool cache_invalidate(struct cache *c)
{
	pthread_rwlock_wrlock(&c->lock);
	_cache_invalidate(c);
	pthread_rwlock_unlock(&c->lock);

	return true;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x10(%rdi), %r14
movq %r14, %rdi
callq 0x3070
movq %rbx, %rdi
callq 0x10ace
movq %r14, %rdi
callq 0x31a0
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/albertito[P]libfiu/preload/posix/../../libfiu/hash.c
// Function: cache_invalidate
static void _cache_invalidate(struct cache *c)
{
	size_t i;
	struct entry *entry;

	for (i = 0; i < c->hash->table_size; i++) {
		entry = c->hash->entries + i;
		if (entry->in_use == IN_USE) {
			free(entry->key);
			entry->key = NULL;
			entry->value = NULL;
			entry->in_use = NEVER;
		}
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq (%rdi), %rax
cmpq $0x0, 0x8(%rax)
je 0x10b21
movq %rdi, %rbx
xorl %r14d, %r14d
xorl %r15d, %r15d
movq (%rax), %r12
cmpl $0x1, 0x10(%r12,%r14)
jne 0x10b11
addq %r14, %r12
movq (%r12), %rdi
callq 0x3030
xorps %xmm0, %xmm0
movups %xmm0, (%r12)
movl $0x0, 0x10(%r12)
incq %r15
movq (%rbx), %rax
addq $0x18, %r14
cmpq 0x8(%rax), %r15
jb 0x10ae9
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/albertito[P]libfiu/preload/posix/../../libfiu/hash.c
// Function: resize_table
static bool resize_table(struct hash *h, size_t new_size)
{
	size_t i;
	struct entry *old_entries, *e;
	size_t old_size;

	/* Do not resize below minimum size; however, continue anyway to clear
	 * up removed entries. */
	if (new_size < MIN_SIZE) {
		new_size = MIN_SIZE;
	}

	old_entries = h->entries;
	old_size = h->table_size;

	h->entries = malloc(sizeof(struct entry) * new_size);
	if (h->entries == NULL)
		return false;

	memset(h->entries, 0, sizeof(struct entry) * new_size);
	h->table_size = new_size;
	h->nentries = 0;
	h->nremoved = 0;

	/* Insert the old entries into the new table. We use the internal
	 * version _hash_set() to avoid copying the keys again. */
	for (i = 0; i < old_size; i++) {
		e = old_entries + i;
		if (e->in_use == IN_USE)
			_hash_set(h, e->key, e->value);
	}

	free(old_entries);

	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0xb, %rsi
movl $0xa, %ebp
cmovaeq %rsi, %rbp
movq (%rdi), %r14
movq 0x8(%rdi), %r13
leaq (,%rbp,8), %rax
leaq (%rax,%rax,2), %r12
movq %r12, %rdi
callq 0x3210
movq %rax, %r15
movq %rax, (%rbx)
testq %rax, %rax
je 0x10c0f
movq %r15, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x30f0
movq %rbp, 0x8(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
testq %r13, %r13
je 0x10c07
leaq 0x10(%r14), %r12
cmpl $0x1, (%r12)
jne 0x10bfe
movq -0x10(%r12), %rsi
movq -0x8(%r12), %rdx
movq %rbx, %rdi
callq 0x1079e
addq $0x18, %r12
decq %r13
jne 0x10be5
movq %r14, %rdi
callq 0x3030
testq %r15, %r15
setne %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq