LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-lzh.c
// Function: mash_lz77buf_writebytecb
static void mash_lz77buf_writebytecb(struct de_lz77buffer *rb, u8 n)
{
	struct lzh_ctx *cctx = (struct lzh_ctx*)rb->userdata;

	if(lzh_have_enough_output(cctx)) {
		// This ought to be an error, but in practice there's often an extra
		// decompressed byte that we have to ignore.
		return;
	}
	dbuf_writebyte(cctx->dcmpro->f, n);
	cctx->nbytes_written++;
}

// Assembly:
pushq %rbx
movq (%rdi), %rbx
movq 0x10(%rbx), %rax
cmpb $0x0, 0x8(%rax)
je 0x10191e
movq 0x28(%rbx), %rcx
cmpq 0x10(%rax), %rcx
jge 0x10192e
movq (%rax), %rdi
movzbl %sil, %esi
callq 0xf0bd6
incq 0x28(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-lzh.c
// Function: read_next_code_using_tree
static UI read_next_code_using_tree(struct lzh_ctx *cctx, struct lzh_tree_wrapper *tree)
{
	fmtutil_huffman_valtype val = 0;
	UI bitcount = 0;
	int ret;

	if(!tree->ht) {
		return 0;
	}

	ret = fmtutil_huffman_read_next_value(tree->ht->bk, &cctx->bitrd, &val, &bitcount);
	if(cctx->bitrd.eof_flag) {
		de_dfilter_set_errorf(cctx->c, cctx->dres, cctx->modname,
			"Unexpected end of compressed data");
		lzh_set_err_flag(cctx);
		val = 0;
		goto done;
	}
	else if(!ret) {
		de_dfilter_set_errorf(cctx->c, cctx->dres, cctx->modname,
			"Huffman decoding error");
		lzh_set_err_flag(cctx);
		val = 0;
		goto done;
	}

done:
	return (UI)val;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
xorl %ebp, %ebp
movl %ebp, (%rsp)
movl %ebp, 0x4(%rsp)
testq %rsi, %rsi
je 0x101ea5
movq %rdi, %rbx
movq 0x8(%rsi), %rdi
leaq 0x38(%rbx), %rsi
movq %rsp, %rdx
leaq 0x4(%rsp), %rcx
callq 0x1046f3
cmpb $0x0, 0x50(%rbx)
je 0x101e9e
movq (%rbx), %rdi
movq 0x18(%rbx), %rsi
movq 0x20(%rbx), %rdx
leaq 0x1c3b2(%rip), %rcx     # 0x11e23a
xorl %ebp, %ebp
xorl %eax, %eax
callq 0xfa21a
movb $0x1, 0x50(%rbx)
movl $0x1, 0x30(%rbx)
jmp 0x101ea5
testl %eax, %eax
je 0x101eae
movl (%rsp), %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq (%rbx), %rdi
movq 0x18(%rbx), %rsi
movq 0x20(%rbx), %rdx
leaq 0x1c39c(%rip), %rcx     # 0x11e25c
jmp 0x101e88
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-lzh.c
// Function: lzh_destroy_trees
static void lzh_destroy_trees(struct lzh_ctx *cctx)
{
	if(cctx->meta_tree.ht) {
		fmtutil_huffman_destroy_decoder(cctx->c, cctx->meta_tree.ht);
		cctx->meta_tree.ht = NULL;
	}
	if(cctx->literals_tree.ht) {
		fmtutil_huffman_destroy_decoder(cctx->c, cctx->literals_tree.ht);
		cctx->literals_tree.ht = NULL;
	}
	if(cctx->offsets_tree.ht) {
		fmtutil_huffman_destroy_decoder(cctx->c, cctx->offsets_tree.ht);
		cctx->offsets_tree.ht = NULL;
	}
	if(cctx->matchlengths_tree.ht) {
		fmtutil_huffman_destroy_decoder(cctx->c, cctx->matchlengths_tree.ht);
		cctx->matchlengths_tree.ht = NULL;
	}
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x90(%rdi), %rsi
testq %rsi, %rsi
je 0x101ee5
movq (%rbx), %rdi
callq 0x104dc7
movq $0x0, 0x90(%rbx)
movq 0x98(%rbx), %rsi
testq %rsi, %rsi
je 0x101f04
movq (%rbx), %rdi
callq 0x104dc7
movq $0x0, 0x98(%rbx)
movq 0xa0(%rbx), %rsi
testq %rsi, %rsi
je 0x101f23
movq (%rbx), %rdi
callq 0x104dc7
movq $0x0, 0xa0(%rbx)
movq 0xa8(%rbx), %rsi
testq %rsi, %rsi
je 0x101f42
movq (%rbx), %rdi
callq 0x104dc7
movq $0x0, 0xa8(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-lzh.c
// Function: lh5x_read_a_code_length
static UI lh5x_read_a_code_length(struct lzh_ctx *cctx)
{
	UI n;

	n = (UI)lzh_getbits(cctx, 3);
	if(n==7) {
		while(1) {
			UI b;

			b = (UI)lzh_getbits(cctx, 1);
			if(cctx->bitrd.eof_flag) break;
			if(b==0) break;
			n++;
			// TODO: What is the length limit?
			if(n>FMTUTIL_HUFFMAN_MAX_CODE_LENGTH) {
				lzh_set_err_flag(cctx);
				return FMTUTIL_HUFFMAN_MAX_CODE_LENGTH;
			}
		}
	}
	return n;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x38(%rdi), %r15
movq %r15, %rdi
movl $0x3, %esi
callq 0xf1bed
movq %rax, %r14
cmpl $0x7, %r14d
jne 0x101fa0
movl $0x7, %r14d
movq %r15, %rdi
movl $0x1, %esi
callq 0xf1bed
cmpb $0x0, 0x50(%rbx)
jne 0x101fa0
movl %eax, %eax
testq %rax, %rax
je 0x101fa0
incl %r14d
cmpl $0x31, %r14d
jne 0x101f6c
movb $0x1, 0x50(%rbx)
movl $0x1, 0x30(%rbx)
movl $0x30, %r14d
movl %r14d, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-lzh.c
// Function: make_dclimplode_tree
static void make_dclimplode_tree(deark *c, struct lzh_ctx *cctx, struct lzh_tree_wrapper *tree,
	i64 num_codes, const u8 *codelengths)
{
	i64 i;

	tree->ht = fmtutil_huffman_create_decoder(c, num_codes, num_codes);

	for(i=0; i<num_codes; i++) {
		fmtutil_huffman_record_a_code_length(c, tree->ht->builder, (fmtutil_huffman_valtype)i,
			dclimplode_getcodelenfromarray(codelengths, (UI)i));
	}

	fmtutil_huffman_make_canonical_code(c, tree->ht->bk, tree->ht->builder,
		FMTUTIL_MCTFLAG_LEFT_ALIGN_BRANCHES | FMTUTIL_MCTFLAG_LAST_CODE_FIRST, NULL);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %r14
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %rbx
movq %rdx, %rsi
callq 0x104d0e
movq %rax, (%r15)
testq %r12, %r12
jle 0x1021da
xorl %r13d, %r13d
movq (%r15), %rax
movq 0x10(%rax), %rsi
movl %r13d, %eax
shrl %eax
movb (%r14,%rax), %al
movl %eax, %ecx
shrb $0x4, %cl
andb $0xf, %al
testb $0x1, %r13b
movzbl %cl, %ecx
movzbl %al, %eax
cmovel %ecx, %eax
movzbl %al, %ecx
movq %rbx, %rdi
movl %r13d, %edx
callq 0x1049cc
incq %r13
cmpq %r13, %r12
jne 0x10219d
movq (%r15), %rax
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
movq %rbx, %rdi
movl $0x3, %ecx
xorl %r8d, %r8d
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x104a46
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-lzh.c
// Function: distilled_interpret_node_pair
static void distilled_interpret_node_pair(struct distilled_nodetable_decoder *ntd,
	UI nodenum, u64 currcode, UI currcode_nbits)
{
	if(ntd->err_flag) return;
	if(currcode_nbits >= FMTUTIL_HUFFMAN_MAX_CODE_LENGTH) {
		ntd->err_flag = 1;
		return;
	}
	if(nodenum > ntd->nodecount-2) {
		ntd->err_flag = 1;
		return;
	}

	if(ntd->node[nodenum].in_use || ntd->node[nodenum+1].in_use) {
		ntd->err_flag = 1;
		return;
	}

	ntd->node[nodenum].in_use = 1;
	ntd->node[nodenum+1].in_use = 1;
	distilled_interpret_dval(ntd, ntd->node[nodenum].dval, currcode<<1, currcode_nbits+1);
	distilled_interpret_dval(ntd, ntd->node[nodenum+1].dval, (currcode<<1) | 1, currcode_nbits+1);
	ntd->node[nodenum].in_use = 0;
	ntd->node[nodenum+1].in_use = 0;
}

// Assembly:
cmpb $0x0, 0xc(%rdi)
je 0x102202
retq
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %ecx, %ebp
movq %rdi, %rbx
cmpl $0x30, %ecx
jae 0x102237
movl %esi, %r14d
movl 0x8(%rbx), %eax
addl $-0x2, %eax
cmpl %esi, %eax
jb 0x102237
movl %r14d, %r12d
cmpb $0x0, 0x18(%rbx,%r12,4)
jne 0x102237
incl %r14d
cmpb $0x0, 0x18(%rbx,%r14,4)
je 0x102244
movb $0x1, 0xc(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rdx, %r15
movb $0x1, %al
movb %al, 0x18(%rbx,%r12,4)
movb %al, 0x18(%rbx,%r14,4)
movzwl 0x1a(%rbx,%r12,4), %esi
addq %rdx, %rdx
incl %ebp
movq %rbx, %rdi
movl %ebp, %ecx
callq 0x10228e
movzwl 0x1a(%rbx,%r14,4), %esi
leaq 0x1(,%r15,2), %rdx
movq %rbx, %rdi
movl %ebp, %ecx
callq 0x10228e
xorl %eax, %eax
movb %al, 0x18(%rbx,%r12,4)
movb %al, 0x18(%rbx,%r14,4)
jmp 0x10223b
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-lzh.c
// Function: distilled_interpret_dval
static void distilled_interpret_dval(struct distilled_nodetable_decoder *ntd,
	UI dval, u64 currcode, UI currcode_nbits)
{
	if(ntd->err_flag) return;
	if(currcode_nbits>=FMTUTIL_HUFFMAN_MAX_CODE_LENGTH) {
		ntd->err_flag = 1;
		return;
	}

	if(dval < ntd->nodecount) {
		distilled_interpret_node_pair(ntd, dval, currcode, currcode_nbits);
	}
	else { // a leaf node
		fmtutil_huffman_valtype adj_value;

		adj_value = (fmtutil_huffman_valtype)(dval - ntd->nodecount);
		if(ntd->c->debug_level>=3) {
			de_dbg3(ntd->c, "code: \"%s\" = %d",
				de_print_base2_fixed(ntd->b2buf, sizeof(ntd->b2buf), currcode, currcode_nbits),
				(int)adj_value);
		}
		fmtutil_huffman_add_code(ntd->c, ntd->ht->bk, currcode, currcode_nbits, adj_value);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
cmpb $0x0, 0xc(%rdi)
jne 0x1022ab
movl %ecx, %ebx
movq %rdi, %r15
cmpl $0x30, %ecx
jb 0x1022b4
movb $0x1, 0xc(%r15)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rdx, %r14
movl %esi, %ebp
subl 0x8(%r15), %ebp
jae 0x1022d4
movq %r15, %rdi
movq %r14, %rdx
movl %ebx, %ecx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x1021fb
movq (%r15), %r12
cmpl $0x3, (%r12)
jl 0x10230d
leaq 0x9e8(%r15), %rdi
movl $0x48, %esi
movq %r14, %rdx
movl %ebx, %ecx
callq 0xe9d03
leaq 0x1c169(%rip), %rsi     # 0x11e464
movq %r12, %rdi
movq %rax, %rdx
movl %ebp, %ecx
xorl %eax, %eax
callq 0xe889f
movq (%r15), %r12
movq 0x10(%r15), %rax
movq 0x8(%rax), %rsi
movq %r12, %rdi
movq %r14, %rdx
movl %ebx, %ecx
movl %ebp, %r8d
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x1044c1
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-lzh.c
// Function: mash_getbit
static u8 mash_getbit(struct lzh_ctx *cctx)
{
	u8 v;

	if(cctx->err_flag) return 0;

	if(cctx->bitrd.bbll.nbits_in_bitbuf==0) {
		mash_fill_bitbuf(cctx);
	}

	v = (u8)de_bitbuf_lowlevel_get_bits(&cctx->bitrd.bbll, 1);

	return v;
}

// Assembly:
cmpl $0x0, 0x30(%rdi)
je 0x102336
xorl %eax, %eax
retq
pushq %rbx
movq %rdi, %rsi
leaq 0x58(%rdi), %rbx
cmpl $0x0, 0x5c(%rdi)
jne 0x102372
movq 0x40(%rsi), %rax
cmpq 0x48(%rsi), %rax
jge 0x10236b
movq 0x8(%rsi), %rax
addq $0x40, %rsi
movq (%rax), %rdi
callq 0xeeb4b
movzbl %al, %esi
movq %rbx, %rdi
callq 0xf1b5e
jmp 0x102372
movl $0x1, 0x30(%rsi)
movq %rbx, %rdi
movl $0x1, %esi
callq 0xf1b93
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-lzh.c
// Function: mash_read_offset
static UI mash_read_offset(struct lzh_ctx *cctx)
{
	UI ocode;
	UI offset;
	static const u8 numextrabits[8] = {5, 7, 9, 10, 11, 12, 13, 14};

	ocode = mash_getbits(cctx, 3);
	offset = mash_getbits(cctx, numextrabits[ocode]);
	if(ocode==1) {
		offset += 32;
	}
	else if(ocode>=2) {
		offset += (1<<numextrabits[ocode]) - 352;
	}
	return offset;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
xorl %r14d, %r14d
movl $0x3, %ebp
movl %r14d, %r15d
addl %r15d, %r15d
movq %rbx, %rdi
callq 0x10232d
movzbl %al, %r14d
orq %r15, %r14
decl %ebp
jne 0x102394
leaq 0x49776(%rip), %rax     # 0x14bb2a
movzbl (%r14,%rax), %ebp
xorl %eax, %eax
movl %ebp, %r15d
movl %eax, %r12d
addl %eax, %r12d
movq %rbx, %rdi
callq 0x10232d
movzbl %al, %eax
orl %r12d, %eax
decl %r15d
jne 0x1023be
testl %r14d, %r14d
je 0x1023f7
cmpl $0x1, %r14d
jne 0x1023e7
addl $0x20, %eax
jmp 0x1023f7
movl $0x1, %edx
movl %ebp, %ecx
shll %cl, %edx
addl %edx, %eax
addl $0xfffffea0, %eax       # imm = 0xFFFFFEA0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-lzw.c
// Function: dfilter_lzw_codec
void dfilter_lzw_codec(struct de_dfilter_ctx *dfctx, void *codec_private_params)
{
	delzwctx *dc = NULL;
	struct de_lzw_params *delzwp = (struct de_lzw_params*)codec_private_params;

	dc = de_malloc(dfctx->c, sizeof(delzwctx));
	dc->c = dfctx->c;
	dc->dfctx = dfctx;
	dc->debug_level = dc->c->debug_level;

	dfctx->codec_private = (void*)dc;
	dfctx->codec_finish_fn = my_lzw_codec_finish;
	dfctx->codec_destroy_fn = my_lzw_codec_destroy;
	dfctx->codec_addbuf_fn = my_lzw_codec_addbuf;
	dfctx->codec_command_fn = my_lzw_codec_command;

	dc->output_len_known = dfctx->dcmpro->len_known;
	dc->output_expected_len = dfctx->dcmpro->expected_len;

	dc->delzwp_copy = *delzwp; // struct copy
	dc->fmt = delzwp->fmt;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rdi
movl $0x148, %esi            # imm = 0x148
callq 0xe8b2b
movq (%r14), %rcx
movq %rcx, (%rax)
movq %r14, 0x8(%rax)
movl (%rcx), %ecx
movl %ecx, 0x10(%rax)
movq %rax, 0x28(%r14)
leaq 0x51(%rip), %rcx        # 0x10249d
movq %rcx, 0x40(%r14)
leaq 0xea(%rip), %rcx        # 0x102541
movq %rcx, 0x48(%r14)
leaq 0x13e(%rip), %rcx       # 0x1025a0
movq %rcx, 0x30(%r14)
leaq 0x1271(%rip), %rcx      # 0x1036de
movq %rcx, 0x38(%r14)
movq 0x10(%r14), %rcx
movb 0x8(%rcx), %dl
movb %dl, 0x31(%rax)
movq 0x10(%rcx), %rcx
movq %rcx, 0x38(%rax)
movl 0x10(%rbx), %ecx
movl %ecx, 0x28(%rax)
movups (%rbx), %xmm0
movups %xmm0, 0x18(%rax)
movl (%rbx), %ecx
movl %ecx, 0x14(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-lzw.c
// Function: my_lzw_codec_finish
static void my_lzw_codec_finish(struct de_dfilter_ctx *dfctx)
{
	const char *modname = "delzw";
	delzwctx *dc = (delzwctx*)dfctx->codec_private;

	if(!dc) return;
	delzw_finish(dc);

	dfctx->dres->bytes_consumed = dc->total_nbytes_processed;
	dfctx->dres->bytes_consumed_valid = 1;

	if(dc->errcode) {
		de_dfilter_set_errorf(dfctx->c, dfctx->dres, modname, "%s", dc->errmsg);
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x28(%rdi), %rbx
testq %rbx, %rbx
je 0x102539
movq %rdi, %r14
cmpb $0x0, 0x31(%rbx)
je 0x1024d0
movq 0x70(%rbx), %rax
cmpq 0x38(%rbx), %rax
jne 0x1024d0
cmpl $0x3, 0x64(%rbx)
je 0x1024fa
leaq 0x49734(%rip), %rcx     # 0x14bc02
jmp 0x1024dd
cmpl $0x3, 0x64(%rbx)
je 0x1024fa
leaq 0x49748(%rip), %rcx     # 0x14bc25
leaq 0x4974e(%rip), %rdx     # 0x14bc32
movq %rbx, %rdi
movl $0x2, %esi
xorl %eax, %eax
callq 0x103b39
movl $0x3, 0x64(%rbx)
movq 0x68(%rbx), %rax
movq 0x8(%r14), %rsi
movq %rax, 0x8(%rsi)
movb $0x1, 0x4(%rsi)
cmpl $0x0, 0x60(%rbx)
je 0x102539
movq (%r14), %rdi
addq $0xf8, %rbx
leaq 0x496db(%rip), %rdx     # 0x14bbfc
leaq 0x12837(%rip), %rcx     # 0x114d5f
movq %rbx, %r8
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xfa21a
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-lzw.c
// Function: my_lzw_codec_destroy
static void my_lzw_codec_destroy(struct de_dfilter_ctx *dfctx)
{
	deark *c = dfctx->c;
	delzwctx *dc = (delzwctx*)dfctx->codec_private;

	if(!dc) return;

	de_free(c, dc->ct);
	if(dc->ct2) de_free(c, dc->ct2);
	de_free(c, dc->valbuf);

	de_free(c, dc);
	dfctx->codec_private = NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq 0x28(%rdi), %r14
testq %r14, %r14
je 0x10259a
movq %rdi, %rbx
movq (%rdi), %r15
movq 0xd0(%r14), %rsi
movq %r15, %rdi
callq 0xe8be2
movq 0xd8(%r14), %rsi
testq %rsi, %rsi
je 0x102578
movq %r15, %rdi
callq 0xe8be2
movq 0xf0(%r14), %rsi
movq %r15, %rdi
callq 0xe8be2
movq %r15, %rdi
movq %r14, %rsi
callq 0xe8be2
movq $0x0, 0x28(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-lzw.c
// Function: my_lzw_codec_command
static void my_lzw_codec_command(struct de_dfilter_ctx *dfctx, int cmd, UI flags)
{
	delzwctx *dc = (delzwctx*)dfctx->codec_private;

	if(dc->fmt==DE_LZWFMT_SHRINKIT2) {
		if(cmd==DE_DFILTER_COMMAND_FINISH_BLOCK) {
			dc->total_nbytes_processed -= (i64)(dc->bbll.nbits_in_bitbuf/8);
			de_bitbuf_lowlevel_empty(&dc->bbll);
		}
		else if(cmd==DE_DFILTER_COMMAND_SOFTRESET) {
			delzw_clear(dc);
		}
	}
}

// Assembly:
movq 0x28(%rdi), %rdi
cmpl $0xa, 0x14(%rdi)
jne 0x103712
cmpl $0x1, %esi
je 0x103e3c
cmpl $0x3, %esi
jne 0x103712
leaq 0xb8(%rdi), %rax
movl 0xbc(%rdi), %ecx
shrl $0x3, %ecx
subq %rcx, 0x68(%rdi)
movq %rax, %rdi
jmp 0xf1bdd
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-lzw.c
// Function: delzw_debugmsg
static void delzw_debugmsg(delzwctx *dc, int level, const char *fmt, ...)
{
	va_list ap;
	char msg[200];

	if(level>dc->debug_level) return;

	va_start(ap, fmt);
	de_vsnprintf(msg, sizeof(msg), fmt, ap);
	va_end(ap);

	de_dbg(dc->c, "[delzw:i%"I64_FMT"/o%"I64_FMT"] %s",
		(i64)dc->total_nbytes_processed, (i64)dc->uncmpr_nbytes_written, msg);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x198, %rsp            # imm = 0x198
movq %rcx, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
testb %al, %al
je 0x103b8d
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
cmpl %esi, 0x10(%rdi)
jl 0x103beb
movq %rdi, %rbx
leaq 0x20(%rsp), %rax
movq %rsp, %rcx
movq %rax, 0x10(%rcx)
leaq 0x1b0(%rsp), %rax
movq %rax, 0x8(%rcx)
movabsq $0x3000000018, %rax     # imm = 0x3000000018
movq %rax, (%rcx)
leaq 0xd0(%rsp), %r14
movl $0xc8, %esi
movq %r14, %rdi
callq 0x109360
movq (%rbx), %rdi
movq 0x68(%rbx), %rdx
movq 0x70(%rbx), %rcx
leaq 0x48064(%rip), %rsi     # 0x14bc45
movq %r14, %r8
xorl %eax, %eax
callq 0xe8617
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-lzw.c
// Function: delzw_set_error
static void delzw_set_error(delzwctx *dc, int errcode, const char *msg)
{
	delzw_stop(dc, "error");
	if(dc->errcode) return;
	dc->errcode = errcode;
	if(!msg || !msg[0]) {
		msg = "LZW decompression error";
	}
	de_strlcpy(dc->errmsg, msg, sizeof(dc->errmsg));
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
cmpl $0x3, 0x64(%rdi)
je 0x103c2d
leaq 0x48023(%rip), %rdx     # 0x14bc32
leaq 0x49839(%rip), %rcx     # 0x14d44f
movq %r14, %rdi
movl $0x2, %esi
xorl %eax, %eax
callq 0x103b39
movl $0x3, 0x64(%r14)
cmpl $0x0, 0x60(%r14)
je 0x103c39
popq %rbx
popq %r14
popq %rbp
retq
movl %ebp, 0x60(%r14)
testq %rbx, %rbx
je 0x103c47
cmpb $0x0, (%rbx)
jne 0x103c4e
leaq 0x4803f(%rip), %rbx     # 0x14bc8d
addq $0xf8, %r14
movl $0x50, %edx
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0xe8219
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-lzw.c
// Function: delzw_set_errorf
static void delzw_set_errorf(delzwctx *dc, int errcode, const char *fmt, ...)
{
	va_list ap;

	delzw_stop(dc, "error");
	if(dc->errcode) return;
	dc->errcode = errcode;
	va_start(ap, fmt);
	de_vsnprintf(dc->errmsg, sizeof(dc->errmsg), fmt, ap);
	va_end(ap);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0xd0, %rsp
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
movq %rcx, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
testb %al, %al
je 0x103cc6
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
cmpl $0x3, 0x64(%rdi)
je 0x103cf1
leaq 0x47f5f(%rip), %rdx     # 0x14bc32
leaq 0x49775(%rip), %rcx     # 0x14d44f
movq %r14, %rdi
movl $0x2, %esi
xorl %eax, %eax
callq 0x103b39
movl $0x3, 0x64(%r14)
cmpl $0x0, 0x60(%r14)
jne 0x103d38
movl %ebp, 0x60(%r14)
leaq 0x20(%rsp), %rax
movq %rsp, %rcx
movq %rax, 0x10(%rcx)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rcx)
movabsq $0x3000000018, %rax     # imm = 0x3000000018
movq %rax, (%rcx)
addq $0xf8, %r14
movl $0x50, %esi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x109360
addq $0xd0, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-lzw.c
// Function: delzw_get_hashed_code
static DELZW_CODE delzw_get_hashed_code(delzwctx *dc, DELZW_CODE code,
	u8 value)
{
	DELZW_CODE h;
	DELZW_CODE saved_h;
	u32 count;

	h = ((code+(DELZW_CODE)value) | 0x0800) & 0xffff;
	h = ((h*h) >> 6) % dc->ct_capacity;

	if(dc->ct[h].codetype==DELZW_CODETYPE_DYN_UNUSED) {
		return h;
	}

	// Collision - First, walk to the end of the duplicates list
	count = 0;
	while(dc->ct2[h].next != DELZW_NEXTPTR_NONE) {
		h = dc->ct2[h].next;

		count++;
		if(count > dc->ct_capacity) {
			delzw_set_error(dc, DELZW_ERRCODE_GENERIC_ERROR, NULL);
			return 0;
		}
	}

	saved_h = h;

	// Then search for an open slot
	count = 0;
	while(1) {
		if(count==0)
			h += 101;
		else
			h += 1;
		h %= dc->ct_capacity;

		if(dc->ct[h].codetype==DELZW_CODETYPE_DYN_UNUSED)
			break;

		count++;
		if(count > dc->ct_capacity) {
			delzw_set_error(dc, DELZW_ERRCODE_GENERIC_ERROR, NULL);
			return 0;
		}
	}

	dc->ct2[saved_h].next = h;
	return h;
}

// Assembly:
pushq %rbx
addl %edx, %esi
orl $0x800, %esi            # imm = 0x800
movzwl %si, %eax
imull %eax, %eax
shrl $0x6, %eax
movl 0xc8(%rdi), %ecx
xorl %r10d, %r10d
xorl %edx, %edx
divl %ecx
movl %edx, %ebx
movq 0xd0(%rdi), %rsi
leaq (%rbx,%rbx,2), %rax
movl %eax, %eax
cmpb $0x2, 0x3(%rsi,%rax,2)
je 0x103dda
movq 0xd8(%rdi), %r8
movl %ebx, %r9d
movzwl (%r8,%r9,2), %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
je 0x103d9b
incl %r10d
movl %eax, %ebx
cmpl %ecx, %r10d
jbe 0x103d80
jmp 0x103dc5
xorl %r10d, %r10d
leal 0x1(%rbx), %eax
addl $0x65, %ebx
testl %r10d, %r10d
cmovnel %eax, %ebx
movl %ebx, %eax
xorl %edx, %edx
divl %ecx
movl %edx, %ebx
leaq (%rbx,%rbx,2), %rax
cmpb $0x2, 0x3(%rsi,%rax,2)
je 0x103dd5
incl %r10d
cmpl %ecx, %r10d
jbe 0x103d9e
xorl %ebx, %ebx
movl $0x1, %esi
xorl %edx, %edx
callq 0x103bf6
jmp 0x103dda
movw %bx, (%r8,%r9,2)
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-lzw.c
// Function: delzw_increase_codesize
static void delzw_increase_codesize(delzwctx *dc)
{
	if(dc->fmt==DE_LZWFMT_UNIXCOMPRESS) {
		delzw_unixcompress_end_bitgroup(dc);
	}
	else if(dc->fmt==DE_LZWFMT_ASC2COM) {
		bbll_skip_to_byte_boundary(&dc->bbll);
	}

	if(dc->curr_codesize<dc->max_codesize) {
		dc->curr_codesize++;
		delzw_debugmsg(dc, 2, "increased code size to %u", dc->curr_codesize);
	}
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl 0x14(%rdi), %eax
cmpl $0xc, %eax
je 0x103df9
cmpl $0x1, %eax
jne 0x103e10
movq %rbx, %rdi
callq 0x103ed8
jmp 0x103e10
movl 0xbc(%rbx), %esi
andl $0x7, %esi
je 0x103e10
leaq 0xb8(%rbx), %rdi
callq 0xf1b93
movl 0x90(%rbx), %ecx
cmpl 0x48(%rbx), %ecx
jae 0x103e3a
incl %ecx
movl %ecx, 0x90(%rbx)
leaq 0x4800d(%rip), %rdx     # 0x14be37
movq %rbx, %rdi
movl $0x2, %esi
xorl %eax, %eax
popq %rbx
jmp 0x103b39
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-lzw.c
// Function: delzw_clear
static void delzw_clear(delzwctx *dc)
{
	DELZW_CODE i;

	delzw_debugmsg(dc, 2, "clear code");

	if(dc->fmt==DE_LZWFMT_UNIXCOMPRESS) {
		delzw_unixcompress_end_bitgroup(dc);
	}

	for(i=dc->first_dynamic_code; i<=dc->highest_code_ever_used; i++) {
		delzw_clear_one_dynamic_code(dc, i);
	}

	dc->curr_codesize = dc->min_codesize;
	dc->free_code_search_start = dc->first_dynamic_code;
	dc->have_oldcode = 0;
	dc->oldcode = 0;
	dc->last_code_added = 0;
	dc->last_value = 0;

	delzw_debugmsg(dc, 2, "code size: %u", dc->curr_codesize);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x48023(%rip), %rdx     # 0x14be6a
movl $0x2, %esi
xorl %eax, %eax
callq 0x103b39
cmpl $0x1, 0x14(%rbx)
jne 0x103e61
movq %rbx, %rdi
callq 0x103ed8
movl 0xa4(%rbx), %ecx
movl 0xac(%rbx), %eax
cmpl %ecx, %eax
ja 0x103e99
movl %eax, %edx
cmpl %edx, %eax
ja 0x103e93
cmpl %edx, 0xc8(%rbx)
jbe 0x103e93
movq 0xd0(%rbx), %rsi
movl %edx, %edi
leaq (%rdi,%rdi,2), %rdi
movl $0x2000000, (%rsi,%rdi,2) # imm = 0x2000000
incl %edx
cmpl %ecx, %edx
jbe 0x103e73
movl 0x44(%rbx), %ecx
movl %ecx, 0x90(%rbx)
movl %eax, 0xa8(%rbx)
xorl %eax, %eax
movb %al, 0x94(%rbx)
movb %al, 0xa0(%rbx)
movq $0x0, 0x98(%rbx)
leaq 0x1c0f2(%rip), %rdx     # 0x11ffba
movq %rbx, %rdi
movl $0x2, %esi
xorl %eax, %eax
popq %rbx
jmp 0x103b39
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-lzw.c
// Function: delzw_add_to_dict
static void delzw_add_to_dict(delzwctx *dc, DELZW_CODE parent, u8 value)
{
	DELZW_CODE newpos;

	if(dc->is_hashed) {
		delzw_hashed_add_code_to_dict(dc, parent, value);
		return;
	}

	if(dc->fmt==DE_LZWFMT_ZIPSHRINK) {
		delzw_find_first_free_entry(dc, &newpos);
	}
	else {
		newpos = dc->free_code_search_start;
	}
	if(dc->errcode) return;
	if(newpos >= dc->ct_capacity) {
		return;
	}

	if(newpos < dc->first_dynamic_code) {
		delzw_set_error(dc, DELZW_ERRCODE_GENERIC_ERROR, NULL);
		return;
	}

	dc->ct[newpos].parent = (DELZW_CODE_MINRANGE)parent;
	dc->ct[newpos].value = value;
	dc->ct[newpos].codetype = DELZW_CODETYPE_DYN_USED;
	dc->ct_code_count++;
	dc->last_code_added = newpos;
	dc->free_code_search_start = newpos+1;
	if(newpos > dc->highest_code_ever_used) {
		dc->highest_code_ever_used = newpos;
	}

	if(dc->auto_inc_codesize) {
		if(dc->early_codesize_inc) {
			if(dc->free_code_search_start>=DELZW_NBITS_TO_MAXCODE(dc->curr_codesize)) {
				delzw_increase_codesize(dc);
			}
		}
		else {
			if(dc->free_code_search_start>DELZW_NBITS_TO_MAXCODE(dc->curr_codesize)) {
				delzw_increase_codesize(dc);
			}
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movl %esi, %r14d
movq %rdi, %rbx
cmpb $0x0, 0x5b(%rdi)
je 0x1041a5
movl 0xcc(%rbx), %eax
cmpl 0xc8(%rbx), %eax
jae 0x10428b
movzbl %bpl, %edx
movq %rbx, %rdi
movl %r14d, %esi
callq 0x103d44
cmpl $0x0, 0x60(%rbx)
jne 0x10428b
movzwl 0x98(%rbx), %ecx
movq 0xd0(%rbx), %rdx
movl %eax, %esi
leaq (%rsi,%rsi,2), %rsi
movw %cx, (%rdx,%rsi,2)
movb %bpl, 0x2(%rdx,%rsi,2)
movb $0x3, 0x3(%rdx,%rsi,2)
incl 0xcc(%rbx)
movl %eax, 0x9c(%rbx)
jmp 0x10428b
movl 0xa8(%rbx), %eax
cmpl $0x3, 0x14(%rbx)
jne 0x1041fa
movl 0xc8(%rbx), %r15d
cmpl %r15d, %eax
jae 0x1041e0
movq 0xd0(%rbx), %rcx
leaq (%rax,%rax,2), %rdx
leaq (%rcx,%rdx,2), %rcx
addq $0x3, %rcx
cmpb $0x2, (%rcx)
je 0x1041fa
incl %eax
addq $0x6, %rcx
cmpl %eax, %r15d
jne 0x1041d0
decl %r15d
leaq 0x47d16(%rip), %rdx     # 0x14bf00
movq %rbx, %rdi
movl $0x2, %esi
callq 0x103bf6
movl %r15d, %eax
cmpl $0x0, 0x60(%rbx)
jne 0x10428b
cmpl 0xc8(%rbx), %eax
jae 0x10428b
cmpl 0xac(%rbx), %eax
jae 0x10422d
movq %rbx, %rdi
movl $0x1, %esi
xorl %edx, %edx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x103bf6
movq 0xd0(%rbx), %rcx
movl %eax, %edx
leaq (%rdx,%rdx,2), %rdx
movw %r14w, (%rcx,%rdx,2)
movb %bpl, 0x2(%rcx,%rdx,2)
movb $0x3, 0x3(%rcx,%rdx,2)
incl 0xcc(%rbx)
movl %eax, 0x9c(%rbx)
leal 0x1(%rax), %edx
movl %edx, 0xa8(%rbx)
cmpl 0xa4(%rbx), %eax
jbe 0x10426c
movl %eax, 0xa4(%rbx)
cmpb $0x0, 0x40(%rbx)
je 0x10428b
cmpb $0x0, 0x59(%rbx)
movl 0x90(%rbx), %ecx
je 0x104296
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
shll %cl, %eax
notl %eax
cmpl %eax, %edx
jae 0x10429c
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
shrl %cl, %edx
testl %edx, %edx
je 0x10428b
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x103dde
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/../foreign/dskdcmps.h
// Function: dd_AddMRU
static void dd_AddMRU (struct dd_Ctl *Ctl, struct dd_codet * ct, u16 tcode)
{
	if (ct->usecount[tcode] != 0) {
		dd_tmsg(Ctl, "Usecount not zero in AddMRU, code: %4x", tcode);
	}
	ct->newer[ct->newest] = tcode;
	ct->older[tcode] = ct->newest;
	ct->newer[tcode] = 0;
	ct->newest = tcode;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %edx, %ebx
movq %rsi, %r14
movl %edx, %r15d
cmpl $0x0, 0x6010(%rsi,%r15,4)
je 0x1042d7
movzwl %bx, %edx
leaq 0x47ceb(%rip), %rsi     # 0x14bfbb
xorl %eax, %eax
callq 0x104379
movzwl 0xc(%r14), %eax
movw %bx, 0x200e(%r14,%rax,2)
addl %r15d, %r15d
movw %ax, 0xe(%r14,%r15)
movw $0x0, 0x200e(%r14,%r15)
movw %bx, 0xc(%r14)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/../foreign/dskdcmps.h
// Function: dd_ValidateLinkChains
static void dd_ValidateLinkChains (struct dd_Ctl *Ctl, struct dd_codet * ct, u16 tcode)
{
	u16 tnewer, tolder;
	UI errcode = 0;

	if(Ctl->c->debug_level<3) return;
	tnewer = ct->newer[tcode];
	tolder = ct->older[tcode];
	if (tcode == ct->newest) {
		if (tnewer != 0) {
			errcode += 1;
		}
	}
	else {
		if (ct->older[tnewer] != tcode) {
			errcode += 2;
		}
	}
	if (tcode == ct->oldest) {
		if (tolder != 0) {
			errcode += 4;
		}
	}
	else {
		if (ct->newer[tolder] != tcode) {
			errcode += 8;
		}
	}

	if(errcode) {
		dd_tmsg(Ctl, "Link validation error (%u). tcode: %4x, older: %4x, newer: %4x",
			errcode, tcode, tolder, ct->newer[tolder]);
	}
}

// Assembly:
movq (%rdi), %rcx
cmpl $0x3, (%rcx)
jge 0x10430d
retq
movl %edx, %eax
movzwl %ax, %ecx
movzwl 0x200e(%rsi,%rcx,2), %r9d
movzwl 0xe(%rsi,%rcx,2), %r8d
cmpw %cx, 0xc(%rsi)
jne 0x104331
xorl %edx, %edx
testq %r9, %r9
setne %dl
jmp 0x10433e
xorl %edx, %edx
cmpw %ax, 0xe(%rsi,%r9,2)
setne %dl
addl %edx, %edx
cmpw %ax, 0xa(%rsi)
jne 0x10434e
testq %r8, %r8
je 0x104359
orl $0x4, %edx
jmp 0x104362
cmpw %ax, 0x200e(%rsi,%r8,2)
jne 0x10435f
testl %edx, %edx
jne 0x104362
jmp 0x10430c
orl $0x8, %edx
movl %r8d, %eax
movzwl 0x200e(%rsi,%rax,2), %r9d
leaq 0x47c07(%rip), %rsi     # 0x14bf7c
xorl %eax, %eax
jmp 0x104379
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/../foreign/dskdcmps.h
// Function: dd_tmsg
static void dd_tmsg(struct dd_Ctl *Ctl, const char *fmt, ...)
{
	va_list ap;

	if (Ctl->c->debug_level<3) return;

	va_start(ap, fmt);
	de_vsnprintf(Ctl->msg, sizeof(Ctl->msg), fmt, ap);
	va_end(ap);

	de_dbg(Ctl->c, "%s", Ctl->msg);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xd8, %rsp
movq %rdx, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
testb %al, %al
je 0x1043d2
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq (%rdi), %rax
cmpl $0x3, (%rax)
jl 0x104430
movq %rsi, %r10
movq %rdi, %rbx
leaq 0x20(%rsp), %rax
movq %rsp, %rcx
movq %rax, 0x10(%rcx)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rcx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rcx)
leaq 0x1050(%rdi), %r14
movl $0x1000, %esi           # imm = 0x1000
movq %r14, %rdi
movq %r10, %rdx
callq 0x109360
movq (%rbx), %rdi
leaq 0x10939(%rip), %rsi     # 0x114d5f
movq %r14, %rdx
xorl %eax, %eax
callq 0xe8617
addq $0xd8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/../foreign/dskdcmps.h
// Function: dd_UnlinkCode
static void dd_UnlinkCode (struct dd_Ctl *Ctl, struct dd_codet * ct, u16 tcode)
{
	u16 tnewer, tolder;

	dd_ValidateLinkChains(Ctl, ct, ct->oldest);
	tnewer = ct->newer[tcode];
	tolder = ct->older[tcode];
	if (tcode == ct->newest)
		ct->newest = tolder;
	else
		ct->older[tnewer] = tolder;
	if (tcode == ct->oldest)
		ct->oldest = tnewer;
	else
		ct->newer[tolder] = tnewer;
	ct->older[tcode] = ct->newer[tcode] = 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movq %rsi, %rbx
leaq 0xa(%rsi), %r14
movzwl 0xa(%rsi), %edx
callq 0x104304
leaq 0x200e(%rbx), %rcx
movl %ebp, %eax
movl %ebp, %esi
addl %esi, %esi
movzwl 0x200e(%rbx,%rsi), %edx
movzwl 0xe(%rbx,%rsi), %edi
movzwl %di, %esi
cmpw %bp, 0xc(%rbx)
jne 0x10447a
movw %di, 0xc(%rbx)
jmp 0x104484
movzwl %dx, %r8d
movw %di, 0xe(%rbx,%r8,2)
cmpw %bp, 0xa(%rbx)
leaq (%rcx,%rsi,2), %rcx
cmoveq %r14, %rcx
movw %dx, (%rcx)
xorl %ecx, %ecx
movw %cx, 0x200e(%rbx,%rax,2)
movw %cx, 0xe(%rbx,%rax,2)
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-huffman.c
// Function: huffman_ensure_alloc
static int huffman_ensure_alloc(deark *c, struct fmtutil_huffman_codebook *bk, NODE_REF_TYPE n)
{
	i64 new_nodes_alloc;

	if(n <= bk->nodes_alloc) return 1;
	if((i64)n > bk->max_nodes) return 0;

	new_nodes_alloc = (i64)bk->nodes_alloc * 2;
	if(new_nodes_alloc > bk->max_nodes) new_nodes_alloc = bk->max_nodes;
	if(new_nodes_alloc < (i64)n) new_nodes_alloc = (i64)n;
	if(new_nodes_alloc < 16) new_nodes_alloc = 16;

	bk->nodes = de_reallocarray(c, bk->nodes, bk->nodes_alloc, sizeof(struct huffman_node),
		new_nodes_alloc);
	bk->nodes_alloc = (NODE_REF_TYPE)new_nodes_alloc;
	return 1;
}

// Assembly:
movl %edx, %ecx
movl 0xc(%rsi), %edx
movl $0x1, %eax
cmpl %ecx, %edx
jae 0x1046a1
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %ecx, %esi
movq (%rbx), %rcx
xorl %eax, %eax
cmpq %rsi, %rcx
jl 0x10469a
leaq (%rdx,%rdx), %rax
cmpq %rcx, %rax
cmovbq %rax, %rcx
cmpq %rsi, %rcx
cmovbeq %rsi, %rcx
cmpq $0x11, %rcx
movl $0x10, %r14d
cmovaeq %rcx, %r14
movq 0x10(%rbx), %rsi
movl $0xc, %ecx
movq %r14, %r8
callq 0xe9758
movq %rax, 0x10(%rbx)
movl %r14d, 0xc(%rbx)
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-huffman.c
// Function: fmtutil_huffman_read_next_value
int fmtutil_huffman_read_next_value(struct fmtutil_huffman_codebook *bk,
	struct de_bitreader *bitrd, fmtutil_huffman_valtype *pval, UI *pnbits)
{
	int bitcount = 0;
	int retval = 0;
	struct fmtutil_huffman_cursor tmpcursor;

	if(bitrd->eof_flag) goto done;
	tmpcursor.curr_noderef = 0;

	if(bk->has_null_code) {
		*pval = bk->value_of_null_code;
		retval = 1;
		goto done;
	}

	while(1) {
		int ret;
		u8 b;

		b = (u8)de_bitreader_getbits(bitrd, 1);
		if(bitrd->eof_flag) goto done;
		bitcount++;
		if(bitcount>FMTUTIL_HUFFMAN_MAX_CODE_LENGTH) goto done; // Should be impossible

		ret = fmtutil_huffman_decode_bit(bk, &tmpcursor, b, pval);
		if(ret==1) { // finished the code
			retval = 1;
			goto done;
		}
		else if(ret!=2) { // decoding error
			goto done;
		}
	}
done:
	if(!retval) {
		*pval = 0;
	}
	if(pnbits) {
		*pnbits = retval ? bitcount : 0;
	}
	return retval;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
xorl %ebp, %ebp
cmpb $0x0, 0x18(%rsi)
je 0x104715
xorl %edx, %edx
xorl %ecx, %ecx
jmp 0x1047b4
movq %rdi, %r15
cmpb $0x0, 0x18(%rdi)
je 0x104731
addq $0x1c, %r15
xorl %edx, %edx
movl (%r15), %ebp
movl $0x1, %ecx
jmp 0x1047b4
movq %rsi, %r12
movq %rsi, %rdi
movl $0x1, %esi
callq 0xf1bed
cmpb $0x0, 0x18(%r12)
movl $0x0, %edx
movl $0x0, %ecx
jne 0x1047b4
movq %r14, (%rsp)
xorl %ebp, %ebp
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
xorl %r14d, %r14d
cmpl $-0x31, %r13d
je 0x1047ac
cmpl 0xc(%r15), %r14d
jae 0x1047ac
cmpl 0x8(%r15), %r14d
jae 0x1047ac
andl $0x1, %eax
movl %r14d, %ecx
leaq (%rcx,%rcx,2), %rsi
shlq $0x2, %rsi
addq 0x10(%r15), %rsi
movzbl (%rax,%rsi), %edi
cmpl $0x1, %edi
jne 0x1047cf
movl 0x4(%rsi,%rax,4), %r14d
movq %r12, %rdi
movl $0x1, %esi
callq 0xf1bed
decl %r13d
cmpb $0x0, 0x18(%r12)
je 0x104762
xorl %edx, %edx
xorl %ecx, %ecx
movq (%rsp), %r14
movl %ebp, (%r14)
testq %rbx, %rbx
je 0x1047be
movl %edx, (%rbx)
movl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x0, %edx
movl $0x0, %ecx
cmpl $0x2, %edi
movq (%rsp), %r14
jne 0x1047b4
leaq (%rsi,%rax,4), %r15
addq $0x4, %r15
negl %r13d
movl %r13d, %edx
jmp 0x104724
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-huffman.c
// Function: fmtutil_huffman_record_a_code_length
int fmtutil_huffman_record_a_code_length(deark *c, struct fmtutil_huffman_code_builder *builder,
	fmtutil_huffman_valtype val, UI len)
{
	if(len==0) return 1;
	if(len > FMTUTIL_HUFFMAN_MAX_CODE_LENGTH) return 0;
	if(builder->lengths_arr_numused > MAX_MAX_NODES) return 0;

	if(builder->lengths_arr_numused >= builder->lengths_arr_numalloc) {
		i64 new_numalloc;

		new_numalloc = builder->lengths_arr_numused + 128;
		builder->lengths_arr = de_reallocarray(c, builder->lengths_arr, builder->lengths_arr_numalloc,
			sizeof(struct huffman_lengths_arr_item), new_numalloc);
		builder->lengths_arr_numalloc = new_numalloc;
	}
	builder->lengths_arr[builder->lengths_arr_numused].val = val;
	builder->lengths_arr[builder->lengths_arr_numused++].len = len;
	return 1;
}

// Assembly:
movl $0x1, %eax
testl %ecx, %ecx
je 0x104a45
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %ebx
xorl %eax, %eax
cmpl $0x30, %ecx
ja 0x104a3b
movq %rsi, %r14
movq 0x8(%rsi), %r15
cmpq $0x101d0, %r15          # imm = 0x101D0
jg 0x104a3b
movl %edx, %ebp
movq (%r14), %rdx
cmpq %rdx, %r15
jge 0x104a05
movq 0x10(%r14), %rax
jmp 0x104a25
subq $-0x80, %r15
movq 0x10(%r14), %rsi
movl $0x8, %ecx
movq %r15, %r8
callq 0xe9758
movq %rax, 0x10(%r14)
movq %r15, (%r14)
movq 0x8(%r14), %r15
movl %ebp, (%rax,%r15,8)
leaq 0x1(%r15), %rcx
movq %rcx, 0x8(%r14)
movl %ebx, 0x4(%rax,%r15,8)
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-huffman.c
// Function: fmtutil_huffman_create_decoder
struct fmtutil_huffman_decoder *fmtutil_huffman_create_decoder(deark *c, i64 initial_codes, i64 max_codes)
{
	struct fmtutil_huffman_decoder *ht = NULL;

	ht = de_malloc(c, sizeof(struct fmtutil_huffman_decoder));
	ht->cursor = de_malloc(c, sizeof(struct fmtutil_huffman_cursor));
	ht->bk = huffman_create_codebook(c, initial_codes, max_codes);
	ht->builder = de_malloc(c, sizeof(struct fmtutil_huffman_code_builder));
	fmtutil_huffman_reset_cursor(ht->cursor);
	return ht;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %rbx
movl $0x18, %esi
callq 0xe8b2b
movq %rax, %r14
movl $0x4, %esi
movq %rbx, %rdi
callq 0xe8b2b
movq %rax, (%r14)
movl $0x30, %esi
movq %rbx, %rdi
callq 0xe8b2b
movl $0x101d0, %ecx          # imm = 0x101D0
cmpq %rcx, %r12
movl $0x101d0, %esi          # imm = 0x101D0
cmovbq %r12, %rsi
movq %rax, %r13
testq %r12, %r12
cmovleq %rcx, %rsi
cmpq $0x2, %r15
movl $0x1, %edx
cmovgeq %r15, %rdx
movq %rsi, (%rax)
cmpq %rcx, %rdx
cmovgeq %rcx, %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x10463b
xorl %ebp, %ebp
movl %ebp, 0x8(%r13)
movq $0x0, 0x20(%r13)
movl %ebp, 0x28(%r13)
movq %r13, 0x8(%r14)
movl $0x18, %esi
movq %rbx, %rdi
callq 0xe8b2b
movq %rax, 0x10(%r14)
movq (%r14), %rax
movl %ebp, (%rax)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-huffman.c
// Function: fmtutil_huffman_destroy_decoder
void fmtutil_huffman_destroy_decoder(deark *c, struct fmtutil_huffman_decoder *ht)
{
	if(!ht) return;
	huffman_destroy_codebook(c, ht->bk);
	ht->bk = NULL;
	de_free(c, ht->builder->lengths_arr);
	de_free(c, ht->builder);
	de_free(c, ht->cursor);
	de_free(c, ht);
}

// Assembly:
testq %rsi, %rsi
je 0x104e36
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq 0x8(%rsi), %r15
testq %r15, %r15
je 0x104df7
movq 0x10(%r15), %rsi
movq %r14, %rdi
callq 0xe8be2
movq %r14, %rdi
movq %r15, %rsi
callq 0xe8be2
movq $0x0, 0x8(%rbx)
movq 0x10(%rbx), %rax
movq 0x10(%rax), %rsi
movq %r14, %rdi
callq 0xe8be2
movq 0x10(%rbx), %rsi
movq %r14, %rdi
callq 0xe8be2
movq (%rbx), %rsi
movq %r14, %rdi
callq 0xe8be2
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0xe8be2
retq
nop
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-exe.c
// Function: fmtutil_detect_pklite_by_exe_ep
UI fmtutil_detect_pklite_by_exe_ep(deark *c, const u8 *mem, i64 mem_len, UI flags)
{
	if(mem_len<64) return 0;

	if(flags & 0x01) {
		if(de_memmatch(mem, (const u8*)"\xb8??\xba??\x8c\xdb\x03\xd8\x3b", 11, '?', 0)) {
			return 100; // v1.00-1.05, etc.
		}
		if(de_memmatch(mem, (const u8*)"\xb8??\xba??\x05\x00\x00\x3b\x06", 11, '?', 0)) {
			return 112; // v1.12-1.15, etc.
		}
		if(de_memmatch(mem, (const u8*)"\x50\xb8??\xba??\x05\x00\x00\x3b", 11, '?', 0)) {
			return 150; // v2.01, etc.
		}
		if(de_memmatch(mem, (const u8*)"\x9c\xba?\x00\x2d?\x00\x81\xe1?\x00\x81", 12, '?', 0)) {
			return 250; // Patched by UN^2PACK v2.0?
		}
	}

	if(flags & 0x02) {
		if(de_memmatch(mem, (const u8*)"\x2e\x8c\x1e??\x8b\x1e\x02\x00\x8c\xda\x81", 12, '?', 0)) {
			return 90; // Normal beta
		}
		if(de_memmatch(mem, (const u8*)"\x2e\x8c\x1e??\xfc\x8c\xc8\x2e\x2b\x06", 11, '?', 0)) {
			return 91; // beta/loadhigh
		}
	}

	if(flags & 0x04) {
		if(de_memmatch(mem, (const u8*)"\xb8??\xba??\x05\x00\x00\x3b\x2d", 11, '?', 0)) {
			return 251; // Megalite
		}
	}

	return 0;
}

// Assembly:
xorl %eax, %eax
cmpq $0x40, %rdx
jl 0x104f95
pushq %rbp
pushq %rbx
pushq %rax
movl %ecx, %ebp
movq %rsi, %rbx
testb $0x1, %bpl
jne 0x104e94
testb $0x2, %bpl
jne 0x104f3d
testb $0x4, %bpl
je 0x104e8d
leaq 0x473cf(%rip), %rsi     # 0x14c238
movl $0xb, %edx
movq %rbx, %rdi
movl $0x3f, %ecx
xorl %r8d, %r8d
callq 0xeba3e
movl %eax, %ecx
movl $0xfb, %eax
testl %ecx, %ecx
jne 0x104f8f
xorl %eax, %eax
jmp 0x104f8f
leaq 0x471e5(%rip), %rsi     # 0x14c080
movl $0xb, %edx
movq %rbx, %rdi
movl $0x3f, %ecx
xorl %r8d, %r8d
callq 0xeba3e
movl %eax, %ecx
movl $0x64, %eax
testl %ecx, %ecx
jne 0x104f8f
leaq 0x47340(%rip), %rsi     # 0x14c206
movl $0xb, %edx
movq %rbx, %rdi
movl $0x3f, %ecx
xorl %r8d, %r8d
callq 0xeba3e
movl %eax, %ecx
movl $0x70, %eax
testl %ecx, %ecx
jne 0x104f8f
leaq 0x47321(%rip), %rsi     # 0x14c212
movl $0xb, %edx
movq %rbx, %rdi
movl $0x3f, %ecx
xorl %r8d, %r8d
callq 0xeba3e
movl %eax, %ecx
movl $0x96, %eax
testl %ecx, %ecx
jne 0x104f8f
leaq 0x47306(%rip), %rsi     # 0x14c21e
movl $0xc, %edx
movq %rbx, %rdi
movl $0x3f, %ecx
xorl %r8d, %r8d
callq 0xeba3e
movl %eax, %ecx
movl $0xfa, %eax
testl %ecx, %ecx
jne 0x104f8f
jmp 0x104e52
leaq 0x472e7(%rip), %rsi     # 0x14c22b
movl $0xc, %edx
movq %rbx, %rdi
movl $0x3f, %ecx
xorl %r8d, %r8d
callq 0xeba3e
movl %eax, %ecx
movl $0x5a, %eax
testl %ecx, %ecx
jne 0x104f8f
leaq 0x33a7d(%rip), %rsi     # 0x1389e8
movl $0xb, %edx
movq %rbx, %rdi
movl $0x3f, %ecx
xorl %r8d, %r8d
callq 0xeba3e
movl %eax, %ecx
movl $0x5b, %eax
testl %ecx, %ecx
je 0x104e5c
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-exe.c
// Function: calc_entrypoint_crc
static void calc_entrypoint_crc(deark *c, struct fmtutil_exe_info *ei)
{
	struct de_crcobj *crco = NULL;
	u32 crc1, crc2;

	if(ei->have_epcrcs) return;
	ei->have_epcrcs = 1;

	read_exe_testbytes(ei);

	// Sniff some bytes, starting at the code entry point.
	crco = de_crcobj_create(c, DE_CRCOBJ_CRC32_IEEE);
	de_crcobj_addbuf(crco, &ei->ep64b[0], 32);
	crc1 = de_crcobj_getval(crco);
	de_crcobj_reset(crco);
	de_crcobj_addbuf(crco, &ei->ep64b[32], 32);
	crc2 = de_crcobj_getval(crco);
	ei->entrypoint_crcs = ((u64)crc1 << 32) | crc2;
#ifdef DE_EXECOMP_DEVMODE
	de_dbg(c, "execomp crc: %016"U64_FMTx, ei->entrypoint_crcs);
#endif

	de_crcobj_destroy(crco);
}

// Assembly:
cmpb $0x0, 0x64(%rsi)
je 0x1057e3
retq
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movb $0x1, 0x64(%rsi)
movq %rsi, %rdi
callq 0x105bf5
movq %r14, %rdi
movl $0x10, %esi
callq 0xeb499
movq %rax, %r14
leaq 0x70(%rbx), %rsi
movl $0x20, %edx
movq %rax, %rdi
callq 0xeb8ad
movq %r14, %rdi
callq 0xeb865
movl %eax, %r15d
movq %r14, %rdi
callq 0xeb7fe
leaq 0x90(%rbx), %rsi
movl $0x20, %edx
movq %r14, %rdi
callq 0xeb8ad
movq %r14, %rdi
callq 0xeb865
shlq $0x20, %r15
movl %eax, %eax
orq %r15, %rax
movq %rax, 0x68(%rbx)
movq %r14, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0xeb858
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-exe.c
// Function: fmtutil_detect_exesfx
void fmtutil_detect_exesfx(deark *c, struct fmtutil_exe_info *ei,
	struct fmtutil_specialexe_detection_data *edd)
{
	size_t i;

	for(i=0; i<DE_ARRAYCOUNT(exesfx_detector_arr); i++) {
		if(ei->overlay_len < (i64)exesfx_detector_arr[i].min_overlay_len) continue;
		exesfx_detector_arr[i].fn(c, ei, edd);
		if(edd->detected_fmt) goto done;
	}

done:
	if(!edd->detected_fmt_name[0]) {
		de_strlcpy(edd->detected_fmt_name, "unknown", sizeof(edd->detected_fmt_name));
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x8910c(%rip), %r12     # 0x18ec98
xorl %r13d, %r13d
movl -0x4(%r12), %eax
cmpq %rax, 0x50(%r14)
jge 0x105ba2
cmpq $0x9, %r13
jbe 0x105bbb
jmp 0x105bc4
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq *(%r12)
cmpb $0x0, 0x1(%rbx)
jne 0x105bc4
cmpq $0xa, %r13
jae 0x105bc4
incq %r13
addq $0x10, %r12
jmp 0x105b8f
cmpb $0x0, 0x50(%rbx)
je 0x105bd4
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
addq $0x50, %rbx
leaq 0xc8bd(%rip), %rsi      # 0x11249c
movl $0x28, %edx
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xe8219
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-exe.c
// Function: read_exe_testbytes
static void read_exe_testbytes(struct fmtutil_exe_info *ei)
{
	if(ei->have_testbytes) return;
	ei->have_testbytes = 1;
	dbuf_read(ei->f, ei->ep64b, ei->entry_point, sizeof(ei->ep64b));
	dbuf_read(ei->f, ei->ovl64b, ei->end_of_dos_code, sizeof(ei->ovl64b));
}

// Assembly:
cmpb $0x0, 0x65(%rdi)
je 0x105bfc
retq
pushq %rbx
movq %rdi, %rbx
movb $0x1, 0x65(%rdi)
leaq 0x70(%rdi), %rsi
movq (%rdi), %rdi
movq 0x40(%rbx), %rdx
movl $0x40, %ecx
callq 0xee8d4
leaq 0xb0(%rbx), %rsi
movq (%rbx), %rdi
movq 0x48(%rbx), %rdx
movl $0x40, %ecx
popq %rbx
jmp 0xee8d4
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-exe.c
// Function: detect_lhark_sfx
static int detect_lhark_sfx(deark *c, struct fmtutil_exe_info *ei,
	struct fmtutil_specialexe_detection_data *edd)
{
	int found;
	i64 foundpos = 0;
	i64 cs, ip;

	if(ei->num_relocs != 0) return 0;
	if(ei->regSP != 128) return 0;
	if(ei->start_of_dos_code != 32) return 0;

	// LHARK SFX uses a modified LZEXE 0.91 decompressor.
	// Try to find the original entry point, and record it in regCS_2/regIP_2.
	ip = dbuf_getu16le(ei->f, ei->entry_point+0x0f);
	cs = dbuf_getu16le(ei->f, ei->entry_point+0x11);
	if(!is_lzexe091_entry_point(ei, cs, ip)) {
		return 0;
	}

	found = is_lhalike_data_at(ei, ei->end_of_dos_code, 'h', &foundpos);
	if(!found) return 0;

	edd->regCS_2 = cs;
	edd->regIP_2 = ip;

	return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
xorl %ebx, %ebx
cmpq $0x0, 0x8(%rdi)
jne 0x105cbe
movq %rdi, %r15
cmpq $0x80, 0x18(%rdi)
jne 0x105cbe
cmpq $0x20, 0x38(%r15)
jne 0x105cbe
movq %rsi, %r14
movq (%r15), %rdi
movq 0x40(%r15), %rsi
addq $0xf, %rsi
callq 0xeebc8
movq %rax, %r12
movq (%r15), %rdi
movq 0x40(%r15), %rsi
addq $0x11, %rsi
callq 0xeebc8
movq %rax, %r13
movq %r15, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0x105cce
testl %eax, %eax
je 0x105cbe
movq (%r15), %rdi
movq 0x48(%r15), %rsi
leaq 0x8(%rsp), %rcx
movl $0x68, %edx
callq 0x105d2a
testl %eax, %eax
je 0x105cbe
movq %r13, 0x30(%r14)
movq %r12, 0x38(%r14)
movl $0x1, %ebx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-exe.c
// Function: is_lzexe091_entry_point
static int is_lzexe091_entry_point(struct fmtutil_exe_info *ei, i64 cs, i64 ip)
{
	i64 n;
	i64 ep;

	ep = ei->start_of_dos_code + cs*16 + ip;

	n = (UI)dbuf_getu32be(ei->f, ep);
	if(n!=0x060e1f8bU) return 0;

	// If this is the right place, the *FAB* signature should be at offset 233.
	if(dbuf_memcmp(ei->f, ep+233, (const void*)"*FAB*", 5)) {
		return 0;
	}
	return 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
shlq $0x4, %rbx
addq %rdx, %rbx
addq 0x38(%rdi), %rbx
movq (%rdi), %rdi
movq %rbx, %rsi
callq 0xeed0d
movq %rax, %rcx
xorl %eax, %eax
cmpl $0x60e1f8b, %ecx        # imm = 0x60E1F8B
jne 0x105d22
movq (%r14), %rdi
addq $0xe9, %rbx
leaq 0x463fa(%rip), %rdx     # 0x14c106
movl $0x5, %ecx
movq %rbx, %rsi
callq 0xefc85
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
sete %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/fmtutil-exe.c
// Function: is_lhalike_data_at
static int is_lhalike_data_at(struct fmtutil_exe_info *ei, i64 pos, u8 h_or_z, i64 *pfoundpos)
{
	u8 b2[8];

	if(pos+21 > ei->f->len) return 0;
	dbuf_read(ei->f, b2, pos, sizeof(b2));
	if(b2[2]!='-' || b2[6]!='-') return 0;
	if(b2[3]=='l' && b2[4]==h_or_z) {
		*pfoundpos = pos;
		return 1;
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
leaq 0x15(%rsi), %rax
xorl %ebx, %ebx
cmpq 0x18(%rdi), %rax
jle 0x105d51
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rcx, %r14
movl %edx, %ebp
movq %rsi, %r15
leaq 0x8(%rsp), %r12
movl $0x8, %ecx
movq %r12, %rsi
movq %r15, %rdx
callq 0xee8d4
cmpb $0x2d, 0x2(%r12)
jne 0x105d42
cmpb $0x2d, 0xe(%rsp)
jne 0x105d42
cmpb $0x6c, 0xb(%rsp)
jne 0x105d42
cmpb %bpl, 0xc(%rsp)
jne 0x105d42
movq %r15, (%r14)
movl $0x1, %ebx
jmp 0x105d42