LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/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, %r15
movq %rsi, %r12
movq %rdi, %rbx
movq %rdx, %rsi
callq 0xf8601
movq %rax, (%r12)
xorl %r13d, %r13d
testq %r15, %r15
cmovleq %r13, %r15
movq (%r12), %rax
cmpq %r13, %r15
je 0xf61a7
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 0xf82ee
incq %r13
jmp 0xf616a
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
pushq $0x3
popq %rcx
movq %rbx, %rdi
xorl %r8d, %r8d
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xf8362
// File: /workspace/github_c_makefile_star2_O2/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 0xf61ea
retq
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %ecx, %ebp
movq %rdi, %rbx
cmpl $0x30, %ecx
jae 0xf621f
movl %esi, %r14d
movl 0x8(%rbx), %eax
addl $-0x2, %eax
cmpl %esi, %eax
jb 0xf621f
movl %r14d, %r12d
cmpb $0x0, 0x18(%rbx,%r12,4)
jne 0xf621f
incl %r14d
cmpb $0x0, 0x18(%rbx,%r14,4)
je 0xf622c
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 0xf6276
movzwl 0x1a(%rbx,%r14,4), %esi
leaq 0x1(,%r15,2), %rdx
movq %rbx, %rdi
movl %ebp, %ecx
callq 0xf6276
xorl %eax, %eax
movb %al, 0x18(%rbx,%r12,4)
movb %al, 0x18(%rbx,%r14,4)
jmp 0xf6223
// File: /workspace/github_c_makefile_star2_O2/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 0xf6293
movl %ecx, %ebx
movq %rdi, %r15
cmpl $0x30, %ecx
jb 0xf629c
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 0xf62bc
movq %r15, %rdi
movq %r14, %rdx
movl %ebx, %ecx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xf61e3
movq (%r15), %r12
cmpl $0x3, (%r12)
jl 0xf62f3
leaq 0x9e8(%r15), %rdi
pushq $0x48
popq %rsi
movq %r14, %rdx
movl %ebx, %ecx
callq 0xdfc03
leaq 0x1b0af(%rip), %rsi     # 0x111390
movq %r12, %rdi
movq %rax, %rdx
movl %ebp, %ecx
xorl %eax, %eax
callq 0xdea83
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 0xf7e56
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/src/fmtutil-lzh.c
// Function: mash_read_run_of_1_bits
static UI mash_read_run_of_1_bits(struct lzh_ctx *cctx, UI max1bits)
{
	UI count_of_1s = 0;

	while(1) {
		u8 b;

		if(count_of_1s>=max1bits) break;
		b = mash_getbit(cctx);
		if(b==0) break;
		count_of_1s++;
	}

	return count_of_1s;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r15
movl %esi, %r12d
negl %r12d
pushq $-0x1
popq %r14
leal (%r12,%r14), %eax
cmpl $-0x1, %eax
je 0xf6344
movq %r15, %rdi
callq 0xf637e
incl %r14d
testb %al, %al
jne 0xf632a
jmp 0xf6347
movl %ebx, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/src/fmtutil-lzh.c
// Function: mash_getbits
static UI mash_getbits(struct lzh_ctx *cctx, UI nbits)
{
	UI i;
	UI n = 0;

	for(i=0; i<nbits; i++) {
		n <<= 1;
		n |= (UI)mash_getbit(cctx);
	}

	return n;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
xorl %ebp, %ebp
subl $0x1, %ebx
jb 0xf6377
addl %ebp, %ebp
movq %r14, %rdi
callq 0xf637e
movzbl %al, %eax
orl %eax, %ebp
jmp 0xf6361
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xf6387
xorl %eax, %eax
retq
pushq %rbx
movq %rdi, %rsi
leaq 0x58(%rdi), %rbx
cmpl $0x0, 0x5c(%rdi)
jne 0xf63c3
movq 0x40(%rsi), %rax
cmpq 0x48(%rsi), %rax
jge 0xf63bc
movq 0x8(%rsi), %rax
addq $0x40, %rsi
movq (%rax), %rdi
callq 0xe3f2a
movzbl %al, %esi
movq %rbx, %rdi
callq 0xe69c4
jmp 0xf63c3
movl $0x1, 0x30(%rsi)
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0xe69f9
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r14
pushq %rbx
movq %rdi, %r14
pushq $0x3
popq %rsi
callq 0xf6356
movl %eax, %ebp
movl %eax, %eax
leaq 0x48270(%rip), %rcx     # 0x13e65a
movzbl (%rax,%rcx), %ebx
movq %r14, %rdi
movl %ebx, %esi
callq 0xf6356
testl %ebp, %ebp
je 0xf6414
cmpl $0x1, %ebp
jne 0xf6406
addl $0x20, %eax
jmp 0xf6414
pushq $0x1
popq %rdx
movl %ebx, %ecx
shll %cl, %edx
addl %edx, %eax
addl $0xfffffea0, %eax       # imm = 0xFFFFFEA0
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/src/fmtutil-lzh.c
// Function: read_run_of_1_bits
static UI read_run_of_1_bits(struct lzh_ctx *cctx, UI max1bits)
{
	UI count_of_1s = 0;

	while(1) {
		u8 b;

		if(count_of_1s>=max1bits) break;
		b = (u8)lzh_getbits(cctx, 1);
		if(b==0) break;
		count_of_1s++;
	}

	return count_of_1s;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
addq $0x38, %rbx
xorl %ecx, %ecx
pushq $0x1
popq %rbp
movl %ecx, %r14d
cmpl $0x5, %ecx
je 0xf6443
movq %rbx, %rdi
movl %ebp, %esi
callq 0xe6a4a
leal 0x1(%r14), %ecx
testb %al, %al
jne 0xf6429
movl %r14d, %eax
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/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 0xdecaf
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        # 0xf64e9
movq %rcx, 0x40(%r14)
leaq 0xc5(%rip), %rcx        # 0xf6568
movq %rcx, 0x48(%r14)
leaq 0x116(%rip), %rcx       # 0xf65c4
movq %rcx, 0x30(%r14)
leaq 0xc07(%rip), %rcx       # 0xf70c0
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_O2/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 0xf6560
movq %rdi, %r14
cmpb $0x0, 0x31(%rbx)
je 0xf6512
movq 0x70(%rbx), %rax
cmpq 0x38(%rbx), %rax
jne 0xf6512
leaq 0x481f6(%rip), %rsi     # 0x13e706
jmp 0xf6519
leaq 0x48210(%rip), %rsi     # 0x13e729
movq %rbx, %rdi
callq 0xf74ef
movq 0x68(%rbx), %rax
movq 0x8(%r14), %rsi
movq %rax, 0x8(%rsi)
movb $0x1, 0x4(%rsi)
cmpl $0x0, 0x60(%rbx)
je 0xf6560
movq (%r14), %rdi
addq $0xf8, %rbx
leaq 0x481b8(%rip), %rdx     # 0x13e700
leaq 0x117b0(%rip), %rcx     # 0x107cff
movq %rbx, %r8
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xee823
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xf65be
movq %rdi, %rbx
movq (%rdi), %r15
movq 0xd0(%r14), %rsi
movq %r15, %rdi
callq 0xded32
movq 0xd8(%r14), %rsi
testq %rsi, %rsi
je 0xf659f
movq %r15, %rdi
callq 0xded32
movq 0xf0(%r14), %rsi
movq %r15, %rdi
callq 0xded32
movq %r15, %rdi
movq %r14, %rsi
callq 0xded32
andq $0x0, 0x28(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xf70f4
cmpl $0x1, %esi
je 0xf77f7
cmpl $0x3, %esi
jne 0xf70f4
leaq 0xb8(%rdi), %rax
movl 0xbc(%rdi), %ecx
shrl $0x3, %ecx
subq %rcx, 0x68(%rdi)
movq %rax, %rdi
jmp 0xe6a40
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xf756a
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 0xf75c8
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 0xfc8d8
movq (%rbx), %rdi
movq 0x68(%rbx), %rdx
movq 0x70(%rbx), %rcx
leaq 0x4718b(%rip), %rsi     # 0x13e749
movq %r14, %r8
xorl %eax, %eax
callq 0xde896
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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
leaq 0x48959(%rip), %rsi     # 0x13ff3f
callq 0xf74ef
cmpl $0x0, 0x60(%r14)
je 0xf75f7
popq %rbx
popq %r14
popq %rbp
retq
movl %ebp, 0x60(%r14)
testq %rbx, %rbx
je 0xf7605
cmpb $0x0, (%rbx)
jne 0xf760c
leaq 0x47185(%rip), %rbx     # 0x13e791
addq $0xf8, %r14
pushq $0x50
popq %rdx
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0xde492
// File: /workspace/github_c_makefile_star2_O2/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 0xf7682
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)
leaq 0x488b6(%rip), %rsi     # 0x13ff3f
callq 0xf74ef
cmpl $0x0, 0x60(%r14)
jne 0xf76d3
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
pushq $0x50
popq %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq 0xfc8d8
addq $0xd0, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/src/fmtutil-lzw.c
// Function: set_std_static_codes
static void set_std_static_codes(delzwctx *dc)
{
	DELZW_CODE i;

	for(i=0; i<256; i++) {
		dc->ct[i].codetype = DELZW_CODETYPE_STATIC;
		dc->ct[i].value = (u8)i;
	}
}

// Assembly:
movq 0xd0(%rdi), %rax
addq $0x3, %rax
xorl %ecx, %ecx
cmpq $0x100, %rcx            # imm = 0x100
je 0xf7704
movb $0x1, (%rax)
movb %cl, -0x1(%rax)
incq %rcx
addq $0x6, %rax
jmp 0xf76ec
retq
// File: /workspace/github_c_makefile_star2_O2/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
imulq $0x6, %rbx, %rax
cmpb $0x2, 0x3(%rsi,%rax)
je 0xf7797
movq 0xd8(%rdi), %r8
movl %ebx, %r9d
movzwl (%r8,%r9,2), %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
je 0xf775a
incl %r10d
movl %eax, %ebx
cmpl %ecx, %r10d
jbe 0xf773f
jmp 0xf7784
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
imulq $0x6, %rbx, %rax
cmpb $0x2, 0x3(%rsi,%rax)
je 0xf7792
incl %r10d
cmpl %ecx, %r10d
jbe 0xf775d
xorl %ebx, %ebx
pushq $0x1
popq %rsi
xorl %edx, %edx
callq 0xf75d3
jmp 0xf7797
movw %bx, (%r8,%r9,2)
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xf77b6
cmpl $0x1, %eax
jne 0xf77cd
movq %rbx, %rdi
callq 0xf787d
jmp 0xf77cd
movl 0xbc(%rbx), %esi
andl $0x7, %esi
je 0xf77cd
leaq 0xb8(%rbx), %rdi
callq 0xe69f9
movl 0x90(%rbx), %ecx
cmpl 0x48(%rbx), %ecx
jae 0xf77f5
incl %ecx
movl %ecx, 0x90(%rbx)
leaq 0x47154(%rip), %rdx     # 0x13e93b
pushq $0x2
popq %rsi
movq %rbx, %rdi
xorl %eax, %eax
popq %rbx
jmp 0xf7516
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x4716a(%rip), %rdx     # 0x13e96e
pushq $0x2
popq %rsi
xorl %eax, %eax
callq 0xf7516
cmpl $0x1, 0x14(%rbx)
jne 0xf781c
movq %rbx, %rdi
callq 0xf787d
movl 0xac(%rbx), %ebp
cmpl 0xa4(%rbx), %ebp
ja 0xf7838
movq %rbx, %rdi
movl %ebp, %esi
callq 0xf7911
incl %ebp
jmp 0xf7822
movl 0x44(%rbx), %ecx
movl 0xac(%rbx), %eax
movl %ecx, 0x90(%rbx)
movl %eax, 0xa8(%rbx)
xorl %eax, %eax
movb %al, 0x94(%rbx)
andq $0x0, 0x98(%rbx)
movb %al, 0xa0(%rbx)
leaq 0x1b6a4(%rip), %rdx     # 0x112f0e
pushq $0x2
popq %rsi
movq %rbx, %rdi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xf7516
// File: /workspace/github_c_makefile_star2_O2/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 0xf7b47
movl 0xcc(%rbx), %eax
cmpl 0xc8(%rbx), %eax
jae 0xf7c22
movzbl %bpl, %edx
movq %rbx, %rdi
movl %r14d, %esi
callq 0xf7705
cmpl $0x0, 0x60(%rbx)
jne 0xf7c22
movzwl 0x98(%rbx), %ecx
movq 0xd0(%rbx), %rdx
movl %eax, %esi
imulq $0x6, %rsi, %rsi
movw %cx, (%rdx,%rsi)
movb %bpl, 0x2(%rdx,%rsi)
movb $0x3, 0x3(%rdx,%rsi)
incl 0xcc(%rbx)
movl %eax, 0x9c(%rbx)
jmp 0xf7c22
movl 0xa8(%rbx), %eax
cmpl $0x3, 0x14(%rbx)
jne 0xf7b95
movl 0xc8(%rbx), %r15d
imulq $0x6, %rax, %rcx
addq $0x3, %rcx
cmpq %r15, %rax
jae 0xf7b7d
movq 0xd0(%rbx), %rdx
cmpb $0x2, (%rdx,%rcx)
je 0xf7b95
incq %rax
addq $0x6, %rcx
jmp 0xf7b62
decl %r15d
leaq 0x46e7d(%rip), %rdx     # 0x13ea04
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0xf75d3
movl %r15d, %eax
cmpl $0x0, 0x60(%rbx)
jne 0xf7c22
cmpl 0xc8(%rbx), %eax
jae 0xf7c22
cmpl 0xac(%rbx), %eax
jae 0xf7bc6
pushq $0x1
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xf75d3
movq 0xd0(%rbx), %rcx
movl %eax, %edx
imulq $0x6, %rdx, %rdx
movw %r14w, (%rcx,%rdx)
movb %bpl, 0x2(%rcx,%rdx)
movb $0x3, 0x3(%rcx,%rdx)
incl 0xcc(%rbx)
movl %eax, 0x9c(%rbx)
leal 0x1(%rax), %edx
movl %edx, 0xa8(%rbx)
cmpl 0xa4(%rbx), %eax
jbe 0xf7c05
movl %eax, 0xa4(%rbx)
cmpb $0x0, 0x40(%rbx)
je 0xf7c22
cmpb $0x0, 0x59(%rbx)
movl 0x90(%rbx), %ecx
je 0xf7c2d
pushq $-0x1
popq %rax
shll %cl, %eax
notl %eax
cmpl %eax, %edx
jae 0xf7c33
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
shrl %cl, %edx
testl %edx, %edx
je 0xf7c22
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xf779b
// File: /workspace/github_c_makefile_star2_O2/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 0xf7c6e
movzwl %bx, %edx
leaq 0x46e58(%rip), %rsi     # 0x13eabf
xorl %eax, %eax
callq 0xf7d0f
movzwl 0xc(%r14), %eax
movw %bx, 0x200e(%r14,%rax,2)
addl %r15d, %r15d
movw %ax, 0xe(%r14,%r15)
andw $0x0, 0x200e(%r14,%r15)
movw %bx, 0xc(%r14)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xf7ca3
retq
movl %edx, %eax
movzwl %ax, %ecx
movzwl 0x200e(%rsi,%rcx,2), %r9d
movzwl 0xe(%rsi,%rcx,2), %r8d
cmpw %cx, 0xc(%rsi)
jne 0xf7cc7
xorl %edx, %edx
testq %r9, %r9
setne %dl
jmp 0xf7cd4
xorl %edx, %edx
cmpw %ax, 0xe(%rsi,%r9,2)
setne %dl
addl %edx, %edx
cmpw %ax, 0xa(%rsi)
jne 0xf7ce4
testq %r8, %r8
je 0xf7cef
orl $0x4, %edx
jmp 0xf7cf8
cmpw %ax, 0x200e(%rsi,%r8,2)
jne 0xf7cf5
testl %edx, %edx
jne 0xf7cf8
jmp 0xf7ca2
orl $0x8, %edx
movl %r8d, %eax
movzwl 0x200e(%rsi,%rax,2), %r9d
leaq 0x46d75(%rip), %rsi     # 0x13ea80
xorl %eax, %eax
jmp 0xf7d0f
// File: /workspace/github_c_makefile_star2_O2/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 0xf7d68
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 0xf7dc6
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 0xfc8d8
movq (%rbx), %rdi
leaq 0xff43(%rip), %rsi      # 0x107cff
movq %r14, %rdx
xorl %eax, %eax
callq 0xde896
addq $0xd8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xf7c9a
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 0xf7e10
movw %di, 0xc(%rbx)
jmp 0xf7e1a
movzwl %dx, %r8d
movw %di, 0xe(%rbx,%r8,2)
cmpw %bp, 0xa(%rbx)
leaq (%rcx,%rsi,2), %rcx
cmoveq %r14, %rcx
movw %dx, (%rcx)
andw $0x0, 0x200e(%rbx,%rax,2)
andw $0x0, 0xe(%rbx,%rax,2)
popq %rbx
popq %r14
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/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:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %eax
movl 0xc(%rsi), %edx
pushq $0x1
popq %rbp
cmpl %eax, %edx
jae 0xf7ff0
movq %rsi, %rbx
movl %eax, %esi
movq (%rbx), %rcx
xorl %eax, %eax
cmpq %rsi, %rcx
jl 0xf7ff2
leaq (%rdx,%rdx), %rax
cmpq %rcx, %rax
cmovbq %rax, %rcx
cmpq %rsi, %rcx
cmovbeq %rsi, %rcx
cmpq $0x11, %rcx
pushq $0x10
popq %r14
cmovaeq %rcx, %r14
movq 0x10(%rbx), %rsi
pushq $0xc
popq %rcx
movq %r14, %r8
callq 0xdf6b6
movq %rax, 0x10(%rbx)
movl %r14d, 0xc(%rbx)
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/src/fmtutil-huffman.c
// Function: huffman_setchildstatus
static void huffman_setchildstatus(struct fmtutil_huffman_codebook *bk, NODE_REF_TYPE n,
	u8 child_idx, u8 newstatus)
{
	if(n>=bk->nodes_alloc) return;
	if(child_idx>1) return;

	if(bk->nodes[n].child_status[child_idx]==newstatus) return;
	if(bk->nodes[n].child_status[child_idx]==CHILDSTATUS_VALUE) {
		bk->num_codes--;
	}
	if(newstatus==CHILDSTATUS_VALUE) {
		bk->num_codes++;
	}
	bk->nodes[n].child_status[child_idx] = newstatus;
}

// Assembly:
cmpl %esi, 0xc(%rdi)
jbe 0xf8028
movl %esi, %eax
imulq $0xc, %rax, %rax
addq 0x10(%rdi), %rax
movzbl %dl, %edx
movb (%rdx,%rax), %sil
cmpb %cl, %sil
je 0xf8028
cmpb $0x2, %sil
jne 0xf801c
decq 0x20(%rdi)
cmpb $0x2, %cl
jne 0xf8025
incq 0x20(%rdi)
movb %cl, (%rax,%rdx)
retq
// File: /workspace/github_c_makefile_star2_O2/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 %edx, %edx
cmpb $0x0, 0x18(%rsi)
movl $0x0, %ebp
movl $0x0, %eax
jne 0xf80a9
movq %rdi, %r15
andl $0x0, 0x4(%rsp)
cmpb $0x0, 0x18(%rdi)
je 0xf80c2
movl 0x1c(%r15), %ebp
pushq $0x1
popq %rax
movl %ebp, (%r14)
testq %rbx, %rbx
je 0xf80b3
movl %edx, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rsi, %r12
xorl %ebp, %ebp
xorl %r13d, %r13d
movq %r12, %rdi
pushq $0x1
popq %rsi
callq 0xe6a4a
cmpb $0x0, 0x18(%r12)
jne 0xf8116
cmpl $0x2f, %r13d
ja 0xf8116
incl %r13d
movzbl %al, %edx
movq %r15, %rdi
leaq 0x4(%rsp), %rsi
movq %r14, %rcx
callq 0xf8029
cmpl $0x2, %eax
je 0xf80ca
movl %eax, %ecx
movl $0x0, %eax
cmpl $0x1, %ecx
movl $0x0, %edx
jne 0xf80a9
movl %r13d, %edx
movl %ecx, %eax
jmp 0xf80ac
xorl %eax, %eax
xorl %edx, %edx
jmp 0xf80a9
// File: /workspace/github_c_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq $0x1
popq %r12
testl %ecx, %ecx
je 0xf8356
movl %ecx, %ebx
xorl %eax, %eax
cmpl $0x30, %ecx
ja 0xf8359
movq %rsi, %r14
movq 0x8(%rsi), %r15
cmpq $0x101d0, %r15          # imm = 0x101D0
jg 0xf8359
movl %edx, %ebp
movq (%r14), %rdx
cmpq %rdx, %r15
jge 0xf8327
movq 0x10(%r14), %rax
jmp 0xf8345
subq $-0x80, %r15
movq 0x10(%r14), %rsi
pushq $0x8
popq %rcx
movq %r15, %r8
callq 0xdf6b6
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 %r12d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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, %r13
movq %rsi, %r12
movq %rdi, %r14
pushq $0x18
popq %r15
movq %r15, %rsi
callq 0xdecaf
movq %rax, %rbx
pushq $0x4
popq %rsi
movq %r14, %rdi
callq 0xdecaf
movq %rax, (%rbx)
pushq $0x30
popq %rsi
movq %r14, %rdi
callq 0xdecaf
movl $0x101d0, %ecx          # imm = 0x101D0
cmpq %rcx, %r13
movl $0x101d0, %esi          # imm = 0x101D0
cmovbq %r13, %rsi
movq %rax, %rbp
testq %r13, %r13
cmovleq %rcx, %rsi
cmpq $0x2, %r12
pushq $0x1
popq %rdx
cmovgeq %r12, %rdx
movq %rsi, (%rax)
cmpq %rcx, %rdx
cmovgeq %rcx, %rdx
movq %r14, %rdi
movq %rax, %rsi
callq 0xf7f9c
andl $0x0, 0x8(%rbp)
andq $0x0, 0x20(%rbp)
andl $0x0, 0x28(%rbp)
movq %rbp, 0x8(%rbx)
movq %r14, %rdi
movq %r15, %rsi
callq 0xdecaf
movq %rax, 0x10(%rbx)
movq (%rbx), %rax
andl $0x0, (%rax)
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/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 0xf871c
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq 0x8(%rsi), %r15
testq %r15, %r15
je 0xf86e0
movq 0x10(%r15), %rsi
movq %r14, %rdi
callq 0xded32
movq %r14, %rdi
movq %r15, %rsi
callq 0xded32
andq $0x0, 0x8(%rbx)
movq 0x10(%rbx), %rax
movq 0x10(%rax), %rsi
movq %r14, %rdi
callq 0xded32
movq 0x10(%rbx), %rsi
movq %r14, %rdi
callq 0xded32
movq (%rbx), %rsi
movq %r14, %rdi
callq 0xded32
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0xded32
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/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 0xf87fd
pushq %rbp
pushq %rbx
pushq %rax
movl %ecx, %ebp
movq %rsi, %rbx
testb $0x1, %bpl
jne 0xf8774
testb $0x2, %bpl
jne 0xf8794
testb $0x4, %bpl
je 0xf876d
leaq 0x465eb(%rip), %rsi     # 0x13ed38
pushq $0xb
popq %rdx
pushq $0x3f
popq %rcx
movq %rbx, %rdi
xorl %r8d, %r8d
callq 0xe0fff
movl %eax, %ecx
movl $0xfb, %eax
testl %ecx, %ecx
jne 0xf87f7
xorl %eax, %eax
jmp 0xf87f7
leaq 0x46405(%rip), %rsi     # 0x13eb80
pushq $0xb
popq %rdx
pushq $0x3f
popq %rcx
movq %rbx, %rdi
xorl %r8d, %r8d
callq 0xe0fff
testl %eax, %eax
je 0xf87b4
pushq $0x64
jmp 0xf87f6
leaq 0x46590(%rip), %rsi     # 0x13ed2b
pushq $0xc
popq %rdx
pushq $0x3f
popq %rcx
movq %rbx, %rdi
xorl %r8d, %r8d
callq 0xe0fff
testl %eax, %eax
je 0xf87d4
pushq $0x5a
jmp 0xf87f6
leaq 0x4654b(%rip), %rsi     # 0x13ed06
pushq $0xb
popq %rdx
pushq $0x3f
popq %rcx
movq %rbx, %rdi
xorl %r8d, %r8d
callq 0xe0fff
testl %eax, %eax
je 0xf87fe
pushq $0x70
jmp 0xf87f6
leaq 0x32f0d(%rip), %rsi     # 0x12b6e8
pushq $0xb
popq %rdx
pushq $0x3f
popq %rcx
movq %rbx, %rdi
xorl %r8d, %r8d
callq 0xe0fff
testl %eax, %eax
je 0xf8740
pushq $0x5b
popq %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x4650d(%rip), %rsi     # 0x13ed12
pushq $0xb
popq %rdx
pushq $0x3f
popq %rcx
movq %rbx, %rdi
xorl %r8d, %r8d
callq 0xe0fff
movl %eax, %ecx
movl $0x96, %eax
testl %ecx, %ecx
jne 0xf87f7
leaq 0x464f6(%rip), %rsi     # 0x13ed1e
pushq $0xc
popq %rdx
pushq $0x3f
popq %rcx
movq %rbx, %rdi
xorl %r8d, %r8d
callq 0xe0fff
movl %eax, %ecx
movl $0xfa, %eax
testl %ecx, %ecx
jne 0xf87f7
jmp 0xf873a
// File: /workspace/github_c_makefile_star2_O2/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 0xf904b
retq
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movb $0x1, 0x64(%rsi)
movq %rsi, %rdi
callq 0xf9427
pushq $0x10
popq %rsi
movq %r14, %rdi
callq 0xe0ae9
movq %rax, %r14
leaq 0x70(%rbx), %rsi
pushq $0x20
popq %r15
movq %rax, %rdi
movq %r15, %rdx
callq 0xe0ecf
movq %r14, %rdi
callq 0xe0e95
movl %eax, %r12d
movq %r14, %rdi
callq 0xe0e44
leaq 0x90(%rbx), %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0xe0ecf
movq %r14, %rdi
callq 0xe0e95
shlq $0x20, %r12
movl %eax, %eax
orq %r12, %rax
movq %rax, 0x68(%rbx)
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xe0e8d
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x8
popq %r12
leaq 0x988c5(%rip), %r13     # 0x191c90
cmpq $0xb8, %r12
je 0xf93f8
movl -0x4(%r12,%r13), %eax
cmpq %rax, 0x50(%r14)
jl 0xf93f2
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq *(%r12,%r13)
cmpb $0x0, 0x1(%rbx)
jne 0xf93f8
addq $0x10, %r12
jmp 0xf93cb
cmpb $0x0, 0x50(%rbx)
je 0xf9408
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
addq $0x50, %rbx
leaq 0xc069(%rip), %rsi      # 0x10547c
pushq $0x28
popq %rdx
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xde492
// File: /workspace/github_c_makefile_star2_O2/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 0xf942e
retq
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movb $0x1, 0x65(%rdi)
leaq 0x70(%rdi), %rsi
movq (%rdi), %rdi
movq 0x40(%rbx), %rdx
pushq $0x40
popq %r14
movq %r14, %rcx
callq 0xe3cb7
leaq 0xb0(%rbx), %rsi
movq (%rbx), %rdi
movq 0x48(%rbx), %rdx
movq %r14, %rcx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xe3cb7
// File: /workspace/github_c_makefile_star2_O2/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 0xf94f5
movq %rdi, %r15
cmpq $0x80, 0x18(%rdi)
jne 0xf94f5
cmpq $0x20, 0x38(%r15)
jne 0xf94f5
movq %rsi, %r14
movq (%r15), %rdi
movq 0x40(%r15), %rsi
addq $0xf, %rsi
callq 0xe3fa3
movq %rax, %r12
movq (%r15), %rdi
movq 0x40(%r15), %rsi
addq $0x11, %rsi
callq 0xe3fa3
movq %rax, %r13
movq %r15, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0xf9505
testl %eax, %eax
je 0xf94f5
movq 0x48(%r15), %rsi
pushq $0x68
popq %rdx
leaq 0x8(%rsp), %rcx
movq %r15, %rdi
callq 0xf955f
testl %eax, %eax
je 0xf94f5
movq %r13, 0x30(%r14)
movq %r12, 0x38(%r14)
pushq $0x1
popq %rbx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xe404f
movq %rax, %rcx
xorl %eax, %eax
cmpl $0x60e1f8b, %ecx        # imm = 0x60E1F8B
jne 0xf9557
movq (%r14), %rdi
addq $0xe9, %rbx
leaq 0x456c3(%rip), %rdx     # 0x13ec06
pushq $0x5
popq %rcx
movq %rbx, %rsi
callq 0xe4d48
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_O2/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
movq (%rdi), %rdi
xorl %ebx, %ebx
cmpq 0x18(%rdi), %rax
jle 0xf9589
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
pushq $0x8
popq %rcx
movq %r12, %rsi
movq %r15, %rdx
callq 0xe3cb7
cmpb $0x2d, 0x2(%r12)
jne 0xf957a
cmpb $0x2d, 0xe(%rsp)
jne 0xf957a
cmpb $0x6c, 0xb(%rsp)
jne 0xf957a
cmpb %bpl, 0xc(%rsp)
jne 0xf957a
movq %r15, (%r14)
pushq $0x1
popq %rbx
jmp 0xf957a
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/src/fmtutil-exe.c
// Function: detect_exesfx_zip
static void detect_exesfx_zip(deark *c,
	struct fmtutil_exe_info *ei, struct fmtutil_specialexe_detection_data *edd)
{
	int ret;
	i64 foundpos = 0;

	if(!edd->zip_eocd_looked_for) {
		if(c->infile==ei->f && c->detection_data && c->detection_data->zip_eocd_looked_for) {
			edd->zip_eocd_looked_for = 1;
			edd->zip_eocd_found = c->detection_data->zip_eocd_found;
			edd->zip_eocd_pos = c->detection_data->zip_eocd_pos;
		}
		else {
			edd->zip_eocd_found = (u8)fmtutil_find_zip_eocd(c, c->infile, 0, &edd->zip_eocd_pos);
			edd->zip_eocd_looked_for = 1;
		}
	}

	if(!edd->zip_eocd_found) goto done;

	// Look for a ZIP file in the overlay (approximately)
	if(ei->overlay_len < 10) goto done; // Overlay too small

	ret = dbuf_search(ei->f, (const u8*)"PK\x03\x04", 4, ei->end_of_dos_code-10, 20,
		&foundpos);
	if(!ret) goto done;
	edd->detected_fmt = DE_SPECIALEXEFMT_ZIPSFX;

done:
	if(edd->detected_fmt==DE_SPECIALEXEFMT_ZIPSFX) {
		de_strlcpy(edd->detected_fmt_name, "ZIP", sizeof(edd->detected_fmt_name));
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
andq $0x0, (%rsp)
movq %rsi, %r14
cmpb $0x0, 0x4(%rdx)
je 0xf95e3
movb 0x5(%rbx), %al
jmp 0xf95fe
movq 0x18(%rdi), %rsi
cmpq (%r14), %rsi
je 0xf9656
leaq 0x28(%rbx), %rcx
xorl %edx, %edx
callq 0xed59e
movb %al, 0x5(%rbx)
movb $0x1, 0x4(%rbx)
testb %al, %al
je 0xf9632
cmpq $0xa, 0x50(%r14)
jl 0xf9632
movq (%r14), %rdi
movq 0x48(%r14), %rcx
addq $-0xa, %rcx
leaq 0x4567b(%rip), %rsi     # 0x13ec96
pushq $0x4
popq %rdx
pushq $0x14
popq %r8
movq %rsp, %r9
callq 0xe62f1
testl %eax, %eax
je 0xf9632
movb $0x65, 0x1(%rbx)
cmpb $0x65, 0x1(%rbx)
jne 0xf964e
addq $0x50, %rbx
leaq 0x1fa4c(%rip), %rsi     # 0x11908f
pushq $0x28
popq %rdx
movq %rbx, %rdi
callq 0xde492
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x28(%rdi), %rcx
testq %rcx, %rcx
je 0xf95ec
cmpb $0x0, 0x6(%rcx)
je 0xf95ec
movb $0x1, 0x4(%rbx)
movb 0x7(%rcx), %al
movb %al, 0x5(%rbx)
movq 0x8(%rcx), %rcx
movq %rcx, 0x28(%rbx)
jmp 0xf95fe