LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/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
movl %ecx, %ebx
movq %rdx, %r14
movq %rsi, %r15
xorl %r12d, %r12d
testl %ecx, %ecx
cmovlel %r12d, %ebx
xorl %ebp, %ebp
cmpq %r12, %rbx
je 0x776a3
movq 0x8(%r15), %rdi
movl 0x30(%r15), %esi
addl (%r14,%r12,4), %esi
movl 0x34(%r15), %edx
callq 0x776ae
orl %eax, %ebp
incq %r12
jmp 0x77682
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
movl %ecx, %ebx
movq %rdx, %r14
movq %rsi, %r15
xorl %r12d, %r12d
testl %ecx, %ecx
cmovlel %r12d, %ebx
xorl %ebp, %ebp
cmpq %r12, %rbx
je 0x7783e
movq 0x8(%r15), %rdi
movzbl (%r14,%r12), %esi
addl 0x30(%r15), %esi
movl 0x34(%r15), %edx
callq 0x776ae
orl %eax, %ebp
incq %r12
jmp 0x7781c
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x778c6
movl $0x6, (%rax)
leaq -0x2d(%rip), %rcx       # 0x77849
movq %rcx, 0x10(%rax)
cmpl $0x1, %ebp
leaq -0x21d(%rip), %rcx      # 0x77667
leaq -0x8a(%rip), %rdx       # 0x77801
cmoveq %rcx, %rdx
movq %rdx, 0x20(%rax)
leaq -0x3a4(%rip), %rcx      # 0x774f6
movq %rcx, 0x28(%rax)
testq %r14, %r14
je 0x778cb
movl (%r14), %esi
movl 0x4(%r14), %edx
subl %esi, %edx
jl 0x77949
negl %esi
movl %esi, 0x30(%rax)
xorl %ecx, %ecx
testl %edx, %edx
je 0x778c3
incl %ecx
sarl %edx
jmp 0x778b9
movl %ecx, 0x34(%rax)
popq %rbx
popq %r14
popq %rbp
retq
movl $0x80000000, %edx       # imm = 0x80000000
movl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
xorl %ecx, %ecx
cmpq $0x400, %rcx            # imm = 0x400
je 0x778f6
cmpl %ecx, %esi
movl %ecx, %edi
cmovll %esi, %edi
cmpl $0x0, (%rbx,%rcx,4)
cmovnel %edi, %esi
cmovnel %ecx, %edx
incq %rcx
jmp 0x778d7
movq 0x1000(%rbx), %rdi
testq %rdi, %rdi
je 0x778aa
movl (%rdi), %r8d
xorl %r9d, %r9d
xorl %r10d, %r10d
cmpq %r10, %r8
je 0x778aa
movq 0x10(%rdi), %rcx
movl %r10d, %r11d
shrl $0x4, %r11d
movl (%rcx,%r11,4), %r11d
movl %r9d, %ecx
andb $0x1e, %cl
shrl %cl, %r11d
testb $0x3, %r11b
jne 0x77940
movq 0x18(%rdi), %rcx
movl (%rcx,%r10,4), %ecx
cmpl %ecx, %esi
cmovgel %ecx, %esi
cmpl %ecx, %edx
cmovlel %ecx, %edx
incq %r10
addl $0x2, %r9d
jmp 0x7790b
leaq 0x12ecc(%rip), %rdi     # 0x8a81c
leaq 0x12ed8(%rip), %rsi     # 0x8a82f
leaq 0x12ee4(%rip), %rcx     # 0x8a842
movl $0x293, %edx            # imm = 0x293
callq 0x6460
// File: /workspace/github_c_makefile_star2_O2/icebert[P]pblat/htslib/cram/cram_codecs.c
// Function: cram_subexp_decode_init
cram_codec *cram_subexp_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_SUBEXP;
    c->decode = cram_subexp_decode;
    c->free   = cram_subexp_decode_free;
    c->subexp.k = -1;

    cp += safe_itf8_get(cp, data + size, &c->subexp.offset);
    cp += safe_itf8_get(cp, data + size, &c->subexp.k);

    if (cp - data != size || c->subexp.k < 0) {
	fprintf(stderr, "Malformed subexp header stream\n");
	free(c);
	return NULL;
    }

    return c;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %r14
movl $0x240, %edi            # imm = 0x240
callq 0x69d0
testq %rax, %rax
je 0x77bbb
movq %rax, %rbx
movl $0x7, (%rax)
leaq -0x1dc(%rip), %rax      # 0x77968
movq %rax, 0x18(%rbx)
leaq -0x43(%rip), %rax       # 0x77b0c
movq %rax, 0x10(%rbx)
leaq 0x30(%rbx), %rdx
orl $-0x1, 0x34(%rbx)
movq %rbx, %r15
addq $0x34, %r15
movslq %ebp, %r13
leaq (%r14,%r13), %r12
movq %r14, %rdi
movq %r12, %rsi
callq 0x768c1
movl %eax, %ebp
addq %rbp, %r14
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x768c1
movl %eax, %eax
addq %rbp, %rax
cmpq %r13, %rax
jne 0x77b97
cmpl $0x0, (%r15)
jns 0x77bbd
movq 0x3b43a(%rip), %rax     # 0xb2fd8
movq (%rax), %rcx
leaq 0x12cf0(%rip), %rdi     # 0x8a898
pushq $0x1f
popq %rsi
pushq $0x1
popq %rdx
callq 0x6e70
movq %rbx, %rdi
callq 0x68a0
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %r14
movl $0x240, %edi            # imm = 0x240
callq 0x69d0
testq %rax, %rax
je 0x77dce
movq %rax, %rbx
movl $0x9, (%rax)
leaq -0x139(%rip), %rax      # 0x77bcf
movq %rax, 0x18(%rbx)
leaq -0x3c(%rip), %rax       # 0x77cd7
movq %rax, 0x10(%rbx)
movzbl (%r14), %eax
testb %al, %al
js 0x77d23
pushq $0x1
jmp 0x77d9e
movzbl 0x1(%r14), %ecx
cmpb $-0x41, %al
ja 0x77d38
andl $0x3f, %eax
shll $0x8, %eax
orl %ecx, %eax
pushq $0x2
jmp 0x77d9e
cmpb $-0x21, %al
ja 0x77d52
shll $0x8, %ecx
movzbl 0x2(%r14), %edx
andl $0x1f, %eax
shll $0x10, %eax
orl %ecx, %eax
orl %edx, %eax
pushq $0x3
jmp 0x77d9e
cmpb $-0x11, %al
ja 0x77d76
shll $0x10, %ecx
movzbl 0x2(%r14), %edx
shll $0x8, %edx
movzbl 0x3(%r14), %esi
andl $0xf, %eax
shll $0x18, %eax
orl %ecx, %eax
orl %edx, %eax
orl %esi, %eax
pushq $0x4
jmp 0x77d9e
shll $0x1c, %eax
shll $0x14, %ecx
orl %eax, %ecx
movzbl 0x2(%r14), %eax
shll $0xc, %eax
orl %ecx, %eax
movzbl 0x3(%r14), %ecx
shll $0x4, %ecx
orl %eax, %ecx
movzbl 0x4(%r14), %eax
andl $0xf, %eax
orl %ecx, %eax
pushq $0x5
popq %rcx
movl %eax, 0x30(%rbx)
movslq %ebp, %rax
cmpq %rax, %rcx
je 0x77dd0
movq 0x3b227(%rip), %rax     # 0xb2fd8
movq (%rax), %rcx
leaq 0x12afd(%rip), %rdi     # 0x8a8b8
pushq $0x1e
popq %rsi
pushq $0x1
popq %rdx
callq 0x6e70
movq %rbx, %rdi
callq 0x68a0
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x77df3
pushq %rbx
movq %rdi, %rbx
movq 0x38(%rdi), %rdi
callq 0x68a0
movq %rbx, %rdi
popq %rbx
jmp 0x68a0
retq
// File: /workspace/github_c_makefile_star2_O2/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:
movl (%r8), %eax
xorl %edx, %edx
testl %eax, %eax
cmovlel %edx, %eax
cmpq %rdx, %rax
je 0x77e17
movq 0x38(%rsi), %rdi
movb (%rdi), %dil
movb %dil, (%rcx,%rdx)
incq %rdx
jmp 0x77e02
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/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
subq $0x28, %rsp
movq %rcx, 0x18(%rsp)
movq %rdx, %r15
movl 0x30(%rsi), %eax
movl %eax, 0xc(%rsp)
movq 0x38(%rsi), %r12
movl (%r8), %ecx
xorl %eax, %eax
testl %ecx, %ecx
cmovlel %eax, %ecx
xorl %eax, %eax
movq %rcx, 0x10(%rsp)
cmpq %rcx, %rax
je 0x77f28
movq %rax, 0x20(%rsp)
xorl %eax, %eax
xorl %r14d, %r14d
xorl %ebx, %ebx
movl %eax, %ebp
shlq $0x4, %rbp
movl 0xc(%r12,%rbp), %r13d
movl %r13d, %esi
subl %ebx, %esi
movq %r15, %rdi
callq 0x76fe6
testl %eax, %eax
jne 0x77f16
addq %r12, %rbp
cmpl %ebx, %r13d
je 0x77ec3
movq 0x20(%r15), %rax
movq 0x30(%r15), %rcx
movzbl (%rax,%rcx), %eax
movl 0x38(%r15), %edx
xorl %esi, %esi
btl %edx, %eax
setb %sil
leal (%rsi,%r14,2), %r14d
leal -0x1(%rdx), %eax
xorl %esi, %esi
testl %edx, %edx
setle %sil
addq %rcx, %rsi
movq %rsi, 0x30(%r15)
andl $0x7, %eax
movl %eax, 0x38(%r15)
incl %ebx
jmp 0x77e84
movl %r14d, %eax
subl 0x4(%rbp), %eax
cmpl 0xc(%rsp), %eax
jge 0x77f16
testl %eax, %eax
js 0x77f16
movl %eax, %ecx
shlq $0x4, %rcx
movl %r13d, %ebx
cmpl %r14d, 0x8(%r12,%rcx)
jne 0x77e61
addq %r12, %rcx
movl %r13d, %ebx
cmpl %r13d, 0xc(%rcx)
jne 0x77e61
movb (%rcx), %al
movq 0x18(%rsp), %rcx
movq 0x20(%rsp), %rdx
movb %al, (%rcx,%rdx)
movq %rdx, %rax
incq %rax
movq 0x10(%rsp), %rcx
jmp 0x77e4c
pushq $-0x1
popq %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
jmp 0x77f19
// File: /workspace/github_c_makefile_star2_O2/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 %r12
pushq %rbx
movl %ecx, %ebp
movq %rdx, %r14
movq %rsi, %r15
xorl %ebx, %ebx
pushq $-0x1
popq %r12
subl $0x1, %ebp
jb 0x783a0
movzbl (%r14), %eax
testb %al, %al
js 0x7834d
movslq 0x40(%r15,%rax,4), %rdx
movq 0x30(%r15), %rcx
shlq $0x4, %rdx
cmpl %eax, (%rcx,%rdx)
jne 0x783ab
addq %rdx, %rcx
jmp 0x78387
movl 0x38(%r15), %ecx
testl %ecx, %ecx
movl $0x0, %edx
cmovgl %ecx, %edx
xorl %edi, %edi
xorl %esi, %esi
cmpq %rsi, %rdx
je 0x78379
movq 0x30(%r15), %r8
cmpl %eax, (%r8,%rdi)
je 0x78377
incq %rsi
addq $0x10, %rdi
jmp 0x7835f
movl %esi, %edx
cmpl %ecx, %edx
je 0x7839d
movl %edx, %ecx
shlq $0x4, %rcx
addq 0x30(%r15), %rcx
incq %r14
movl 0x8(%rcx), %esi
movl 0xc(%rcx), %edx
movq 0x8(%r15), %rdi
callq 0x776ae
orl %eax, %ebx
jmp 0x78329
movl %r12d, %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x12546(%rip), %rdi     # 0x8a8f8
leaq 0x12476(%rip), %rsi     # 0x8a82f
leaq 0x1255c(%rip), %rcx     # 0x8a91c
movl $0x431, %edx            # imm = 0x431
callq 0x6460
// File: /workspace/github_c_makefile_star2_O2/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 0x784a8
pushq %rbx
movq %rdi, %rbx
movq 0x30(%rdi), %rdi
callq 0x68a0
movq %rbx, %rdi
popq %rbx
jmp 0x68a0
retq
// File: /workspace/github_c_makefile_star2_O2/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
leaq 0x8(%rsp), %rcx
andl $0x0, (%rcx)
movq %rdi, %r12
leaq 0xc(%rsp), %r8
movl $0x1, (%r8)
movq 0x30(%rsi), %rsi
callq *0x18(%rsi)
movl %eax, %ecx
pushq $-0x1
popq %rax
testl %ecx, %ecx
jne 0x78e93
movq 0x38(%r13), %rsi
testq %rsi, %rsi
je 0x78e93
cmpl $0x0, 0x8(%rsp)
js 0x78e93
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_O2/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 0x78ecb
pushq %rbx
movq %rdi, %rbx
movq 0x30(%rdi), %rdi
testq %rdi, %rdi
je 0x78eb6
callq *0x10(%rdi)
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0x78ec2
callq *0x10(%rdi)
movq %rbx, %rdi
popq %rbx
jmp 0x68a0
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x7906d
movl $0x105, %eax            # imm = 0x105
btq %rdi, %rax
jb 0x7906d
movl %edi, %eax
leaq 0x39c41(%rip), %r9      # 0xb2ca0
movq %rsi, %rdi
movl %edx, %esi
movl %ecx, %edx
movl %r8d, %ecx
jmpq *(%r9,%rax,8)
pushq %rbx
movq 0x39f63(%rip), %rax     # 0xb2fd8
movq (%rax), %rbx
callq 0x79d01
leaq 0x11a77(%rip), %rsi     # 0x8aafb
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x6a90
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x79107
pushq %rbx
movq %rdi, %rbx
movq 0x48(%rdi), %rdi
testq %rdi, %rdi
je 0x790f2
callq *0x10(%rdi)
movq 0x50(%rbx), %rdi
testq %rdi, %rdi
je 0x790fe
callq *0x10(%rdi)
movq %rbx, %rdi
popq %rbx
jmp 0x68a0
retq
// File: /workspace/github_c_makefile_star2_O2/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
movq %rax, %rbx
testq %rax, %rax
je 0x793f3
movl $0x4, (%rbx)
leaq -0x2cb(%rip), %rax      # 0x790dd
movq %rax, 0x10(%rbx)
leaq -0x31e(%rip), %rax      # 0x79095
movq %rax, 0x20(%rbx)
leaq -0x2b6(%rip), %rax      # 0x79108
movq %rax, 0x28(%rbx)
movl (%r14), %edi
movq 0x8(%r14), %rcx
pushq $0x1
popq %rdx
xorl %esi, %esi
movl %ebp, %r8d
callq 0x793fb
movq %rax, 0x48(%rbx)
movl 0x4(%r14), %edi
movq 0x10(%r14), %rcx
pushq $0x4
popq %rdx
xorl %esi, %esi
movl %ebp, %r8d
callq 0x793fb
movq %rax, 0x50(%rbx)
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbx
testq %rsi, %rsi
je 0x7940a
cmpl $0x0, 0x100c(%rsi)
je 0x79439
movl $0x385, %eax            # imm = 0x385
btq %rdi, %rax
jb 0x7943d
movl %edi, %eax
leaq 0x398d2(%rip), %r9      # 0xb2cf0
movq %rsi, %rdi
movl %edx, %esi
movq %rcx, %rdx
movl %r8d, %ecx
callq *(%r9,%rax,8)
testq %rax, %rax
je 0x79439
andq $0x0, 0x8(%rax)
jmp 0x7943b
xorl %eax, %eax
popq %rbx
retq
movq 0x39b94(%rip), %rax     # 0xb2fd8
movq (%rax), %rbx
callq 0x79d01
leaq 0x116a8(%rip), %rsi     # 0x8aafb
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x6a90
callq 0x63c0
// File: /workspace/github_c_makefile_star2_O2/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 0x797c7
movq %rax, %rbx
movl $0x5, (%rax)
cmpl $0x5, %r12d
je 0x796b0
cmpl $0x4, %r12d
jne 0x79754
leaq 0x127(%rip), %rax       # 0x797d5
jmp 0x796b7
leaq -0x252(%rip), %rax      # 0x79465
movq %rax, 0x18(%rbx)
leaq -0x5f(%rip), %rax       # 0x79663
movq %rax, 0x10(%rbx)
movb (%r14), %al
movb %al, 0x30(%rbx)
andl $0xffffff00, %r15d      # imm = 0xFFFFFF00
cmpl $0x100, %r15d           # imm = 0x100
jne 0x796ec
movl 0x1(%r14), %eax
movl %eax, 0x34(%rbx)
leaq 0x5(%r14), %rax
jmp 0x79798
leaq 0x1(%r14), %rax
movzbl (%rax), %ecx
testb %cl, %cl
js 0x796fe
pushq $0x1
jmp 0x79791
movzbl 0x2(%r14), %edx
cmpb $-0x41, %cl
ja 0x79714
andl $0x3f, %ecx
shll $0x8, %ecx
orl %edx, %ecx
pushq $0x2
jmp 0x79791
cmpb $-0x21, %cl
ja 0x7972f
shll $0x8, %edx
movzbl 0x3(%r14), %esi
andl $0x1f, %ecx
shll $0x10, %ecx
orl %edx, %ecx
orl %esi, %ecx
pushq $0x3
jmp 0x79791
cmpb $-0x11, %cl
ja 0x79769
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
pushq $0x4
jmp 0x79791
movq 0x3987d(%rip), %rax     # 0xb2fd8
movq (%rax), %rcx
leaq 0x112ef(%rip), %rdi     # 0x8aa54
pushq $0x31
jmp 0x797b6
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
pushq $0x5
popq %rdx
movl %ecx, 0x34(%rbx)
addq %rdx, %rax
subq %r14, %rax
movslq %ebp, %rcx
cmpq %rcx, %rax
je 0x797c9
movq 0x3982e(%rip), %rax     # 0xb2fd8
movq (%rax), %rcx
leaq 0x112d2(%rip), %rdi     # 0x8aa86
pushq $0x28
popq %rsi
pushq $0x1
popq %rdx
callq 0x6e70
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_O2/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 %r15
pushq %r14
pushq %rbx
movq %r8, %rbx
movq %rcx, %r14
movq %rsi, %r15
movl 0x34(%rsi), %esi
callq 0x7686f
testq %rax, %rax
je 0x7982d
movslq 0x1c(%rax), %rdx
pushq $-0x1
popq %rcx
cmpl 0x14(%rax), %edx
jge 0x79849
addq 0x20(%rax), %rdx
movq %rdx, %rsi
movb (%rsi), %r8b
movq 0x20(%rax), %rdi
cmpb 0x30(%r15), %r8b
je 0x79835
movq %rdx, %r9
subq %rdi, %r9
movslq 0x14(%rax), %rdi
cmpq %rdi, %r9
jge 0x79849
movb %r8b, (%r14)
incq %r14
incq %rsi
incq %rdx
jmp 0x79803
xorl %ecx, %ecx
cmpl (%rbx), %ecx
sbbl %ecx, %ecx
jmp 0x79849
movl 0x1c(%rax), %ecx
addl %edi, %ecx
movl %edx, %esi
subl %ecx, %esi
movl %esi, (%rbx)
subl %edi, %edx
incl %edx
movl %edx, 0x1c(%rax)
xorl %ecx, %ecx
movl %ecx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x79ce4
movl $0x5, (%rax)
leaq -0x327(%rip), %rcx      # 0x79998
movq %rcx, 0x10(%rax)
leaq -0x479(%rip), %rcx      # 0x79851
movq %rcx, 0x20(%rax)
leaq -0x338(%rip), %rcx      # 0x7999d
movq %rcx, 0x28(%rax)
movb (%rbx), %cl
movb %cl, 0x30(%rax)
movl 0x4(%rbx), %ecx
movl %ecx, 0x34(%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq $-0x2
popq %r14
pushq $-0x1
popq %rbp
cmpq $0x9, %rdx
ja 0x79d9d
movq %rdi, %r15
leaq 0x10a5d(%rip), %rax     # 0x8a79c
movslq (%rax,%rdx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
testq %rbx, %rbx
je 0x79d50
movl %r14d, (%rbx)
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
pushq $-0x2
popq %rbp
movl %ebp, %r14d
jmp 0x79d48
movl 0x34(%r15), %ebp
jmp 0x79d48
xorl %ebp, %ebp
cmpl $0x1, 0x30(%r15)
sete %bpl
notl %ebp
jmp 0x79d48
movl 0x30(%r15), %ebp
jmp 0x79d48
movq 0x30(%r15), %rdi
xorl %esi, %esi
callq 0x79d1c
movl %eax, %ebp
movq 0x38(%r15), %rdi
xorl %esi, %esi
callq 0x79d1c
movl %eax, %r14d
jmp 0x79d48
movq 0x39234(%rip), %rax     # 0xb2fd8
movq (%rax), %rdi
leaq 0x10d6d(%rip), %rsi     # 0x8ab1b
xorl %eax, %eax
callq 0x6a90
jmp 0x79d48
// File: /workspace/github_c_makefile_star2_O2/SequentMicrosystems[P]wdt-rpi/src/comm.c
// Function: i2cSetup
int i2cSetup(int addr)
{
	int file;
	char filename[40];

	sprintf(filename, "/dev/i2c-1");

	if ( (file = open(filename, O_RDWR)) < 0)
	{
		printf("Failed to open the bus.");
		return FAIL;
	}
	if (ioctl(file, I2C_SLAVE, addr) < 0)
	{
		printf("Failed to acquire bus access and/or talk to slave.\n");
		return FAIL;
	}

	return file;
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x28, %rsp
movl %edi, %ebp
movabsq $0x6332692f7665642f, %rax # imm = 0x6332692F7665642F
movq %rsp, %rdi
movq %rax, (%rdi)
movl $0x312d63, 0x7(%rdi)    # imm = 0x312D63
pushq $0x2
popq %rsi
xorl %eax, %eax
callq 0x10a0
testl %eax, %eax
js 0x25b9
movl %eax, %ebx
movl $0x703, %esi            # imm = 0x703
movl %eax, %edi
movl %ebp, %edx
xorl %eax, %eax
callq 0x1070
testl %eax, %eax
jns 0x25ca
leaq 0x21d1(%rip), %rdi      # 0x4783
callq 0x1040
jmp 0x25c7
leaq 0x21ab(%rip), %rdi      # 0x476b
xorl %eax, %eax
callq 0x1060
pushq $-0x1
popq %rbx
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/SequentMicrosystems[P]wdt-rpi/src/comm.c
// Function: doBoardInit
int doBoardInit(int hwAdd, u8 *bType)
{
	int dev, bV = -1;

	dev = i2cSetup(hwAdd);
	if (dev == FAIL)
	{
		return dev;
	}
	bV = readReg8(dev, I2C_WDT_RELOAD_ADD);
	if (bV == FAIL)
	{
		return bV;
	}
	*bType = bV;
	return dev;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
callq 0x2568
pushq $-0x1
popq %rbp
cmpl $-0x1, %eax
je 0x25fd
movl %eax, %r14d
movl %eax, %edi
xorl %esi, %esi
callq 0x2604
cmpl $-0x1, %eax
je 0x25fd
movb %al, (%rbx)
movl %r14d, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/SequentMicrosystems[P]wdt-rpi/src/comm.c
// Function: readReg8
int readReg8(int dev, int add)
{

	int ret;
	char buf[10];

	buf[0] = 0xff & add;

	if (write(dev, buf, 1) != 1)
	{
		printf("Fail to select mem add\n");
		return -1;
	}

	if (read(dev, buf, 1) != 1)
	{
		printf("Fail to read reg\n");
		return -1;
	}
	ret = 0xff & buf[0];
	return ret;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movl %edi, %ebx
leaq 0x6(%rsp), %rax
movb %sil, (%rax)
pushq $0x1
popq %rdx
movq %rax, %rsi
callq 0x1050
cmpq $0x1, %rax
jne 0x2640
leaq 0x6(%rsp), %rsi
pushq $0x1
popq %rdx
movl %ebx, %edi
callq 0x1080
cmpq $0x1, %rax
jne 0x2649
movzbl 0x6(%rsp), %eax
jmp 0x2658
leaq 0x21a3(%rip), %rdi      # 0x47ea
jmp 0x2650
leaq 0x2189(%rip), %rdi      # 0x47d9
callq 0x1040
pushq $-0x1
popq %rax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/SequentMicrosystems[P]wdt-rpi/src/comm.c
// Function: readReg16
int readReg16(int dev, int add)
{
	int ret = 0;
	char buf[10];

	buf[0] = 0xff & add;

	if (write(dev, buf, 1) != 1)
	{
		printf("Fail to select mem add\n");
		return -1;
	}

	if (read(dev, buf, 2) != 2)
	{
		printf("Fail to read reg\n");
		return -1;
	}
	memcpy(&ret, buf, 2);

	return ret;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movl %edi, %ebx
leaq 0x6(%rsp), %rax
movb %sil, (%rax)
pushq $0x1
popq %rdx
movq %rax, %rsi
callq 0x1050
cmpq $0x1, %rax
jne 0x269a
leaq 0x6(%rsp), %rsi
pushq $0x2
popq %rdx
movl %ebx, %edi
callq 0x1080
cmpq $0x2, %rax
jne 0x26a3
movzwl 0x6(%rsp), %eax
jmp 0x26b2
leaq 0x2149(%rip), %rdi      # 0x47ea
jmp 0x26aa
leaq 0x212f(%rip), %rdi      # 0x47d9
callq 0x1040
pushq $-0x1
popq %rax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/SequentMicrosystems[P]wdt-rpi/src/comm.c
// Function: readReg32
int readReg32(int dev, int add)
{
	uint32_t ret = 0;
	char buf[10];

	buf[0] = 0xff & add;

	if (write(dev, buf, 1) != 1)
	{
		printf("Fail to select mem add\n");
		return -1;
	}

	if (read(dev, buf, 4) != 4)
	{
		printf("Fail to read reg\n");
		return -1;
	}
	memcpy(&ret, buf, 4);

	return ret;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movl %edi, %ebx
leaq 0x4(%rsp), %rax
movb %sil, (%rax)
pushq $0x1
popq %rdx
movq %rax, %rsi
callq 0x1050
cmpq $0x1, %rax
jne 0x26f3
leaq 0x4(%rsp), %rsi
pushq $0x4
popq %rdx
movl %ebx, %edi
callq 0x1080
cmpq $0x4, %rax
jne 0x26fc
movl 0x4(%rsp), %eax
jmp 0x270b
leaq 0x20f0(%rip), %rdi      # 0x47ea
jmp 0x2703
leaq 0x20d6(%rip), %rdi      # 0x47d9
callq 0x1040
pushq $-0x1
popq %rax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/SequentMicrosystems[P]wdt-rpi/src/comm.c
// Function: writeReg8
int writeReg8(int dev, int add, int val)
{
	char buf[10];

	buf[0] = 0xff & add;
	buf[1] = 0xff & val;

	if (write(dev, buf, 2) < 0)
	{
		printf("Fail to w8\n");
		return -1;
	}
	return OK;

}

// Assembly:
subq $0x18, %rsp
leaq 0xe(%rsp), %rax
movb %sil, (%rax)
movb %dl, 0x1(%rax)
pushq $0x2
popq %rdx
movq %rax, %rsi
callq 0x1050
movq %rax, %rcx
xorl %eax, %eax
testq %rcx, %rcx
jns 0x2744
leaq 0x207a(%rip), %rdi      # 0x47b6
callq 0x1040
pushq $-0x1
popq %rax
addq $0x18, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/SequentMicrosystems[P]wdt-rpi/src/comm.c
// Function: writeReg16
int writeReg16(int dev, int add, int val)
{
	char buf[10];

	buf[0] = 0xff & add;
	memcpy(&buf[1], &val, 2);

	if (write(dev, buf, 3) < 0)
	{
		printf("Fail to w16\n");
		return FAIL;
	}
	return OK;
}

// Assembly:
subq $0x18, %rsp
leaq 0xe(%rsp), %rax
movb %sil, (%rax)
movw %dx, 0x1(%rax)
pushq $0x3
popq %rdx
movq %rax, %rsi
callq 0x1050
movq %rax, %rcx
xorl %eax, %eax
testq %rcx, %rcx
jns 0x277d
leaq 0x204c(%rip), %rdi      # 0x47c1
callq 0x1040
pushq $-0x1
popq %rax
addq $0x18, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/SequentMicrosystems[P]wdt-rpi/src/comm.c
// Function: writeReg32
int writeReg32(int dev, int add, int val)
{
	char buf[10];

	buf[0] = 0xff & add;
	memcpy(&buf[1], &val, 4);

	if (write(dev, buf, 5) < 0)
	{
		printf("Fail to w16\n");
		return FAIL;
	}
	return OK;
}

// Assembly:
subq $0x18, %rsp
leaq 0xe(%rsp), %rax
movb %sil, (%rax)
movl %edx, 0x1(%rax)
pushq $0x5
popq %rdx
movq %rax, %rsi
callq 0x1050
movq %rax, %rcx
xorl %eax, %eax
testq %rcx, %rcx
jns 0x27b5
leaq 0x2014(%rip), %rdi      # 0x47c1
callq 0x1040
pushq $-0x1
popq %rax
addq $0x18, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/SequentMicrosystems[P]wdt-rpi/src/comm.c
// Function: readReg24
int readReg24(int dev, int add)
{
	int ret = 0;
	char buf[10];

	buf[0] = 0xff & add;

	if (write(dev, buf, 1) != 1)
	{
		printf("Fail to select mem add\n");
		return FAIL;
	}

	if (read(dev, buf, 3) != 2)
	{
		printf("Fail to read reg\n");
		return FAIL;
	}
	memcpy(&ret, buf, 3);

#ifdef DEBUG_I	
	printbits(ret);
	printf("\n");
	printf("%#08x\n", ret);
#endif
	return ret;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movl %edi, %ebx
leaq 0x4(%rsp), %rax
movb %sil, (%rax)
pushq $0x1
popq %rdx
movq %rax, %rsi
callq 0x1050
cmpq $0x1, %rax
jne 0x2800
leaq 0x4(%rsp), %rsi
pushq $0x3
popq %rdx
movl %ebx, %edi
callq 0x1080
cmpq $0x2, %rax
jne 0x2809
movzbl 0x6(%rsp), %ecx
shll $0x10, %ecx
movzwl 0x4(%rsp), %eax
orl %ecx, %eax
jmp 0x2818
leaq 0x1fe3(%rip), %rdi      # 0x47ea
jmp 0x2810
leaq 0x1fc9(%rip), %rdi      # 0x47d9
callq 0x1040
pushq $-0x1
popq %rax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/SequentMicrosystems[P]wdt-rpi/src/comm.c
// Function: writeReg24
int writeReg24(int dev, int add, int val)
{
	char buf[10];

	buf[0] = 0xff & add;
	memcpy(&buf[1], &val, 3);

	if (write(dev, buf, 4) < 0)
	{
		printf("Fail to w24\n");
		return FAIL;
	}
	return OK;

}

// Assembly:
subq $0x18, %rsp
leaq 0xe(%rsp), %rax
movb %sil, (%rax)
movw %dx, 0x1(%rax)
shrl $0x10, %edx
movb %dl, 0x3(%rax)
pushq $0x4
popq %rdx
movq %rax, %rsi
callq 0x1050
movq %rax, %rcx
xorl %eax, %eax
testq %rcx, %rcx
jns 0x2858
leaq 0x1f7d(%rip), %rdi      # 0x47cd
callq 0x1040
pushq $-0x1
popq %rax
addq $0x18, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/SequentMicrosystems[P]wdt-rpi/src/comm.c
// Function: readBuff
int readBuff(int dev, int add, uint8_t *data, int len)
{
	char buf[2];

	if (NULL == data || len > I2C_MAX_BUFFER_SIZE)
	{
		return FAIL;
	}

	buf[0] = 0xff & add;

	if (write(dev, buf, 1) != 1)
	{
		printf("Fail to select mem add\n");
		return FAIL;
	}

	if (read(dev, data, len) < 1)
	{
		printf("Fail to read reg\n");
		return FAIL;
	}
	return OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %ebp
testq %rdx, %rdx
sete %al
cmpl $0x21, %ecx
setge %cl
orb %al, %cl
pushq $-0x1
popq %r15
jne 0x28c6
movq %rdx, %rbx
movl %edi, %r14d
leaq 0x6(%rsp), %rax
movb %sil, (%rax)
pushq $0x1
popq %rdx
movq %rax, %rsi
callq 0x1050
cmpq $0x1, %rax
jne 0x28ba
movslq %ebp, %rdx
movl %r14d, %edi
movq %rbx, %rsi
callq 0x1080
movq %rax, %rcx
xorl %eax, %eax
testq %rcx, %rcx
jg 0x28c9
leaq 0x1f21(%rip), %rdi      # 0x47d9
jmp 0x28c1
leaq 0x1f29(%rip), %rdi      # 0x47ea
callq 0x1040
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/SequentMicrosystems[P]wdt-rpi/src/comm.c
// Function: writeBuff
int writeBuff(int dev, int add, uint8_t *data, int len)
{
	char buf[I2C_MAX_BUFFER_SIZE];

	if (NULL == data || len > I2C_MAX_BUFFER_SIZE -1)
	{
		return FAIL;
	}

	buf[0] = 0xff & add;
	memcpy( buf + 1, data, len);

	if (write(dev, buf, len + 1) < 1)
	{
		printf("Fail to select mem add\n");
		return FAIL;
	}
	return OK;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movl %ecx, %ebp
testq %rdx, %rdx
sete %al
cmpl $0x20, %ecx
setge %cl
orb %al, %cl
pushq $-0x1
popq %r14
jne 0x2930
movl %edi, %ebx
leaq 0x1(%rsp), %rdi
movb %sil, -0x1(%rdi)
movslq %ebp, %rax
movq %rdx, %rsi
movq %rax, %rdx
callq 0x1090
incl %ebp
movslq %ebp, %rdx
movq %rsp, %rsi
movl %ebx, %edi
callq 0x1050
movq %rax, %rcx
xorl %eax, %eax
testq %rcx, %rcx
jg 0x2933
leaq 0x1ebf(%rip), %rdi      # 0x47ea
callq 0x1040
movl %r14d, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/fm4dd[P]learn-ssl/certsignature.c
// Function: X509_signature_dump
int X509_signature_dump(BIO *bp, const ASN1_STRING *sig, int indent) {
  const unsigned char *s;
  int i, n;

  n=sig->length;
  s=sig->data;
  for (i=0; i<n; i++) {
    if ((i%18) == 0) {
      if (BIO_write(bp,"\n",1) <= 0) return 0;
      if (BIO_indent(bp, indent, indent) <= 0) return 0;
    }
    if (BIO_printf(bp,"%02x%s",s[i],
      ((i+1) == n)?"":":") <= 0) return 0;
  }

  if (BIO_write(bp,"\n",1) != 1) return 0;

  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, 0xc(%rsp)
movq %rdi, %rbx
movl (%rsi), %r15d
xorl %r13d, %r13d
testl %r15d, %r15d
movl $0x0, %r12d
cmovgl %r15d, %r12d
movq 0x8(%rsi), %rax
movq %rax, 0x10(%rsp)
decq %r15
movl %r13d, %eax
xorl %edx, %edx
pushq $0x12
popq %rcx
divl %ecx
cmpq %r13, %r12
je 0x142b
imull $-0x12, %eax, %eax
addl %r13d, %eax
jne 0x13eb
movq %rbx, %rdi
leaq 0xcd9(%rip), %rsi       # 0x20a3
pushq $0x1
popq %rdx
callq 0x1090
xorl %r14d, %r14d
testl %eax, %eax
jle 0x1447
movq %rbx, %rdi
movl 0xc(%rsp), %edx
movl %edx, %esi
callq 0x10f0
testl %eax, %eax
jle 0x1447
movq 0x10(%rsp), %rax
movzbl (%rax,%r13), %edx
leaq 0x1(%r13), %rbp
cmpq %r13, %r15
leaq 0xcb0(%rip), %rcx       # 0x20b3
leaq 0xc9a(%rip), %rax       # 0x20a4
cmoveq %rax, %rcx
xorl %r14d, %r14d
movq %rbx, %rdi
leaq 0xcbd(%rip), %rsi       # 0x20d8
xorl %eax, %eax
callq 0x1100
movq %rbp, %r13
testl %eax, %eax
jg 0x13a9
jmp 0x1447
leaq 0xc71(%rip), %rsi       # 0x20a3
pushq $0x1
popq %rdx
movq %rbx, %rdi
callq 0x1090
xorl %r14d, %r14d
cmpl $0x1, %eax
sete %r14b
movl %r14d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/craigbarnes[P]lua-gumbo/lib/string_buffer.c
// Function: gumbo_string_buffer_append_codepoint
HOT void gumbo_string_buffer_append_codepoint (
  int c,
  GumboStringBuffer* output
) {
  // num_bytes is actually the number of continuation bytes, 1 less than the
  // total number of bytes. This is done to keep the loop below simple and
  // should probably change if we unroll it.
  int num_bytes;
  int prefix;
  if (c <= 0x7f) {
    num_bytes = 0;
    prefix = 0;
  } else if (c <= 0x7ff) {
    num_bytes = 1;
    prefix = 0xc0;
  } else if (c <= 0xffff) {
    num_bytes = 2;
    prefix = 0xe0;
  } else {
    num_bytes = 3;
    prefix = 0xf0;
  }
  maybe_resize_string_buffer(num_bytes + 1, output);
  output->data[output->length++] = prefix | (c >> (num_bytes * 6));
  for (int i = num_bytes - 1; i >= 0; --i) {
    output->data[output->length++] = 0x80 | (0x3f & (c >> (i * 6)));
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %ebp
xorl %r14d, %r14d
movl $0x0, %r15d
cmpl $0x80, %edi
jl 0x42ee
cmpl $0x800, %ebp            # imm = 0x800
jae 0x42d1
movl $0xc0, %r15d
pushq $0x1
popq %r14
jmp 0x42ee
xorl %r15d, %r15d
cmpl $0x10000, %ebp          # imm = 0x10000
setae %r15b
pushq $0x3
popq %r14
sbbl $0x0, %r14d
orl $0xe, %r15d
shll $0x4, %r15d
leal 0x1(%r14), %edi
movq %rbx, %rsi
callq 0x7118
imull $0x6, %r14d, %ecx
movl %ebp, %eax
sarl %cl, %eax
orl %r15d, %eax
addl $-0x6, %ecx
movq (%rbx), %rdx
movq 0x8(%rbx), %rsi
leaq 0x1(%rsi), %rdi
movq %rdi, 0x8(%rbx)
movb %al, (%rdx,%rsi)
testl %r14d, %r14d
jle 0x432c
movl %ebp, %eax
sarl %cl, %eax
decl %r14d
andb $0x3f, %al
orb $-0x80, %al
jmp 0x4305
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/craigbarnes[P]lua-gumbo/lib/utf8.c
// Function: utf8iterator_next
static void update_position(Utf8Iterator* iter) {
  iter->_pos.offset += iter->_width;
  switch (iter->_current) {
  case '\n':
    ++iter->_pos.line;
    iter->_pos.column = 1;
    break;
  case '\t': {
    int tab_stop = iter->_parser->_options->tab_stop;
    iter->_pos.column = ((iter->_pos.column / tab_stop) + 1) * tab_stop;
    break;
  }
  case -1:
    break;
  default:
    ++iter->_pos.column;
    break;
  }
}

// Assembly:
movq 0x20(%rdi), %rcx
addq %rcx, 0x38(%rdi)
movl 0x18(%rdi), %eax
cmpl $-0x1, %eax
je 0x4383
cmpl $0x9, %eax
je 0x435f
cmpl $0xa, %eax
jne 0x437f
incq 0x28(%rdi)
movq $0x1, 0x30(%rdi)
jmp 0x4383
movq 0x30(%rdi), %rax
movq 0x58(%rdi), %rdx
movq (%rdx), %rdx
movslq (%rdx), %rsi
xorl %edx, %edx
divq %rsi
incq %rax
imulq %rsi, %rax
movq %rax, 0x30(%rdi)
jmp 0x4383
incq 0x30(%rdi)
addq %rcx, (%rdi)
jmp 0x74b7
// File: /workspace/github_c_makefile_star2_O2/craigbarnes[P]lua-gumbo/lib/parser.c
// Function: handle_text
static HOT bool handle_text(GumboParser* parser, GumboToken* token) {
  if (
    token->type == GUMBO_TOKEN_CHARACTER
    || token->type == GUMBO_TOKEN_WHITESPACE
  ) {
    insert_text_token(parser, token);
  } else {
    // We provide only bare-bones script handling that doesn't involve any of
    // the parser-pause/already-started/script-nesting flags or re-entrant
    // invocations of the tokenizer. Because the intended usage of this library
    // is mostly for templating, refactoring, and static-analysis libraries, we
    // provide the script body as a text-node child of the <script> element.
    // This behavior doesn't support document.write of partial HTML elements,
    // but should be adequate for almost all other scripting support.
    if (token->type == GUMBO_TOKEN_EOF) {
      parser_add_parse_error(parser, token);
      parser->_parser_state->_reprocess_current_token = true;
    }
    pop_current_node(parser);
    set_insertion_mode(parser, parser->_parser_state->_original_insertion_mode);
  }
  return true;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl (%rsi), %eax
leal -0x4(%rax), %ecx
cmpl $0x2, %ecx
jae 0x5f20
movq %rbx, %rdi
callq 0xa59b
jmp 0x5f46
cmpl $0x8, %eax
jne 0x5f35
movq %rbx, %rdi
callq 0x797d
movq 0x18(%rbx), %rax
movb $0x1, 0x50(%rax)
movq %rbx, %rdi
callq 0xa620
movq 0x18(%rbx), %rax
movl 0x4(%rax), %ecx
movl %ecx, (%rax)
movb $0x1, %al
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/craigbarnes[P]lua-gumbo/gumbo/parse.c
// Function: push_document
static int push_document(lua_State *L)
{
    const GumboDocument *document = lua_touserdata(L, 1);
    lua_createtable(L, 0, 4);
    if (document->has_doctype) {
        set_integer(L, "quirksModeEnum", document->doc_type_quirks_mode);
        set_children(L, &document->children, 2);
        lua_getfield(L, -1, "childNodes");
        lua_createtable(L, 0, 3); // doctype
        set_string(L, "name", document->name);
        set_string(L, "publicId", document->public_identifier);
        set_string(L, "systemId", document->system_identifier);
        setmetatable(L, DocumentType);
        lua_rawseti(L, -2, 1); // childNodes[1] = doctype
        lua_pop(L, 1);
    } else {
        set_children(L, &document->children, 1);
    }
    setmetatable(L, Document);
    return 1;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
pushq $0x1
popq %rsi
callq 0x4060
movq %rax, %r14
pushq $0x4
popq %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x40a0
cmpb $0x1, 0x10(%r14)
jne 0x640d
leaq 0xfd3d(%rip), %rsi      # 0x16066
movq %rbx, %rdi
callq 0x4260
movl 0x30(%r14), %esi
movq %rbx, %rdi
callq 0x4130
pushq $-0x3
popq %rbp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x40c0
pushq $0x2
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x642e
leaq 0xfd16(%rip), %rdx      # 0x16075
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq 0x4270
pushq $0x3
popq %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x40a0
leaq 0x100e7(%rip), %rsi     # 0x16465
movq %rbx, %rdi
callq 0x4260
movq 0x18(%r14), %rsi
movq %rbx, %rdi
callq 0x4260
movq %rbx, %rdi
movl %ebp, %esi
callq 0x40c0
leaq 0xfcdd(%rip), %rsi      # 0x16080
movq %rbx, %rdi
callq 0x4260
movq 0x20(%r14), %rsi
movq %rbx, %rdi
callq 0x4260
movq %rbx, %rdi
movl %ebp, %esi
callq 0x40c0
leaq 0xfcc1(%rip), %rsi      # 0x16089
movq %rbx, %rdi
callq 0x4260
movq 0x28(%r14), %rsi
movq %rbx, %rdi
callq 0x4260
movq %rbx, %rdi
movl %ebp, %esi
callq 0x40c0
pushq $0x6
popq %rsi
movq %rbx, %rdi
callq 0x6741
pushq $-0x2
popq %rbp
pushq $0x1
popq %rdx
movq %rbx, %rdi
movl %ebp, %esi
callq 0x4180
movq %rbx, %rdi
movl %ebp, %esi
callq 0x4040
jmp 0x641b
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x642e
pushq $0x5
popq %rsi
movq %rbx, %rdi
callq 0x6741
pushq $0x1
popq %rax
popq %rbx
popq %r14
popq %rbp
retq