LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/fmtutil-exe.c
// Function: detect_exesfx_pak_nogate
static void detect_exesfx_pak_nogate(deark *c,
	struct fmtutil_exe_info *ei, struct fmtutil_specialexe_detection_data *edd)
{
	int found = 0;
	int canextract = 0;
	u8 v16flag = 0;

	read_exe_testbytes(ei);
	if(ei->ovl64b[0]!=0x1a && ei->ovl64b[0]!=0xfe) goto done;

	if(!de_memcmp(ei->ep64b, (const u8*)"\x55\x8b\xec\x83\xec\x50", 6)) {
		// PAK 1.51-2.51
		found = 1;

		// There's a problem with PAK v1.6. If there are any file or archive
		// comments, the payload will not be in proper PAK format.
		// We can convert it, but it needs special detection and handling.
		if(ei->entry_point==2656) {
			v16flag = 1;
		}
		else {
			canextract = 1;
		}
	}
	if(!found && !de_memcmp(ei->ep64b, (const u8*)"\xfb\xba\x53\x03\x2e\x89\x16\x65", 8)) {
		// GSARC 1.0 and PAK 1.0
		found = 1;
		canextract = 1;
	}

	if(!found) goto done;
	if(ei->ovl64b[0] != 0x1a) canextract = 0;

	edd->payload_pos = ei->end_of_dos_code;
	edd->payload_len = ei->f->len - edd->payload_pos;
	if(edd->payload_len<2) goto done;

	if(v16flag) {
		edd->detected_fmt = DE_SPECIALEXEFMT_PAK16SFX;
	}
	else {
		edd->detected_fmt = DE_SPECIALEXEFMT_SFX;
		edd->payload_valid = canextract;
		edd->payload_file_ext = "pak";
	}

done:
	if(edd->detected_fmt==DE_SPECIALEXEFMT_SFX ||
		edd->detected_fmt==DE_SPECIALEXEFMT_PAK16SFX)
	{
		de_strlcpy(edd->detected_fmt_name, "PAK", sizeof(edd->detected_fmt_name));
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rsi, %rdi
callq 0x106061
movzbl 0xb0(%r14), %eax
cmpl $0xfe, %eax
je 0x106863
cmpl $0x1a, %eax
jne 0x1068ff
movl $0x83ec8b55, %ecx       # imm = 0x83EC8B55
xorl 0x70(%r14), %ecx
movzwl 0x74(%r14), %edx
xorl $0x50ec, %edx           # imm = 0x50EC
xorl %esi, %esi
orl %ecx, %edx
setne %sil
je 0x106887
xorl %ecx, %ecx
movb $0x1, %dl
jmp 0x106896
xorl %ecx, %ecx
cmpq $0xa60, 0x40(%r14)      # imm = 0xA60
setne %cl
movl %ecx, %edx
testl %esi, %esi
je 0x1068b6
movabsq $0x6516892e0353bafb, %rsi # imm = 0x6516892E0353BAFB
cmpq %rsi, 0x70(%r14)
setne %sil
movl $0x1, %edi
cmovel %edi, %ecx
jmp 0x1068b8
xorl %esi, %esi
testb %sil, %sil
jne 0x1068ff
movq 0x48(%r14), %rsi
movq %rsi, 0x10(%rbx)
movq (%r14), %rdi
movq 0x18(%rdi), %rdi
subq %rsi, %rdi
movq %rdi, 0x18(%rbx)
cmpq $0x2, %rdi
jl 0x1068ff
testb %dl, %dl
je 0x1068fb
xorl %edx, %edx
cmpb $0x1a, %al
movzbl %cl, %eax
cmovnel %edx, %eax
movb $0x64, 0x1(%rbx)
movb %al, 0x3(%rbx)
leaq 0xdcd1(%rip), %rax      # 0x1145c6
movq %rax, 0x40(%rbx)
jmp 0x1068ff
movb $0x67, 0x1(%rbx)
movzbl 0x1(%rbx), %eax
cmpl $0x67, %eax
je 0x10690d
cmpl $0x64, %eax
jne 0x10692c
addq $0x50, %rbx
leaq 0x4529c(%rip), %rsi     # 0x14bbb4
movl $0x28, %edx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xe8ded
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/fmtutil-exe.c
// Function: detect_exesfx_rar
static void detect_exesfx_rar(deark *c,
	struct fmtutil_exe_info *ei, struct fmtutil_specialexe_detection_data *edd)
{
	// TODO: Lots more work to do here. Maybe better to delete the RSFX test.
	if(ei->overlay_len < 8) goto done;

	read_exe_testbytes(ei);

	if(de_memcmp(ei->ovl64b, "Rar!\x1a\x07", 6) &&
		de_memcmp(ei->ovl64b, "RE\x7e\x5e", 4))
	{
		goto done;
	}

	if(dbuf_memcmp(ei->f, 28, (const u8*)"RSFX", 4)) {
		goto done;
	}

	edd->payload_pos = ei->end_of_dos_code;
	edd->payload_len = ei->overlay_len;
	edd->payload_valid = 1;
	edd->detected_fmt = DE_SPECIALEXEFMT_SFX;
	edd->payload_file_ext = "rar";

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

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
cmpq $0x8, 0x50(%rsi)
jl 0x1069b8
movq %rsi, %r14
movq %rsi, %rdi
callq 0x106061
movl $0x21726152, %eax       # imm = 0x21726152
xorl 0xb0(%r14), %eax
movzwl 0xb4(%r14), %ecx
xorl $0x71a, %ecx            # imm = 0x71A
orl %eax, %ecx
je 0x106978
cmpl $0x5e7e4552, 0xb0(%r14) # imm = 0x5E7E4552
jne 0x1069b8
movq (%r14), %rdi
leaq 0x4523d(%rip), %rdx     # 0x14bbbf
movl $0x1c, %esi
movl $0x4, %ecx
callq 0xf025e
testl %eax, %eax
jne 0x1069b8
movq 0x48(%r14), %rax
movq %rax, 0x10(%rbx)
movq 0x50(%r14), %rax
movq %rax, 0x18(%rbx)
movb $0x1, 0x3(%rbx)
movb $0x64, 0x1(%rbx)
leaq 0x3e364(%rip), %rax     # 0x144d18
movq %rax, 0x40(%rbx)
cmpb $0x64, 0x1(%rbx)
jne 0x1069dd
addq $0x50, %rbx
leaq 0x451fb(%rip), %rsi     # 0x14bbc4
movl $0x28, %edx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xe8ded
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/fmtutil-exe.c
// Function: detect_exesfx_zoo
static void detect_exesfx_zoo(deark *c,
	struct fmtutil_exe_info *ei, struct fmtutil_specialexe_detection_data *edd)
{
	if(ei->overlay_len < 24) goto done;
	read_exe_testbytes(ei);
	if((UI)de_getu32le_direct(&ei->ovl64b[20]) != 0xfdc4a7dcU) goto done;

	calc_entrypoint_crc(c, ei);
	switch((UI)(ei->entrypoint_crcs>>32)) {
	case 0x6d384fa1U: // SEZ 2.00
	case 0xec5138deU: // SEZ 2.30
		// TODO: More Zoo SFX variants
		break;
	default:
		goto done;
	}

	edd->payload_pos = ei->end_of_dos_code;
	edd->payload_len = ei->overlay_len;
	edd->payload_valid = 1;
	edd->detected_fmt = DE_SPECIALEXEFMT_SFX;
	edd->payload_file_ext = "zoo";

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

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
cmpq $0x18, 0x50(%rsi)
jl 0x106a55
movq %rsi, %r14
movq %rdi, %r15
movq %rsi, %rdi
callq 0x106061
leaq 0xc4(%r14), %rdi
callq 0xef37b
cmpl $0xfdc4a7dc, %eax       # imm = 0xFDC4A7DC
jne 0x106a55
movq %r15, %rdi
movq %r14, %rsi
callq 0x105c44
movl 0x6c(%r14), %eax
cmpl $0x6d384fa1, %eax       # imm = 0x6D384FA1
je 0x106a32
cmpl $0xec5138de, %eax       # imm = 0xEC5138DE
jne 0x106a55
movq 0x48(%r14), %rax
movq %rax, 0x10(%rbx)
movq 0x50(%r14), %rax
movq %rax, 0x18(%rbx)
movb $0x1, 0x3(%rbx)
movb $0x64, 0x1(%rbx)
leaq 0x3dbb7(%rip), %rax     # 0x144608
movq %rax, 0x40(%rbx)
cmpb $0x64, 0x1(%rbx)
jne 0x106a78
addq $0x50, %rbx
leaq 0x45162(%rip), %rsi     # 0x14bbc8
movl $0x28, %edx
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0xe8ded
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/fmtutil-exe.c
// Function: detect_exesfx_arj
static void detect_exesfx_arj(deark *c,
	struct fmtutil_exe_info *ei, struct fmtutil_specialexe_detection_data *edd)
{
	int ret;
	i64 foundpos = 0;

	if(ei->overlay_len < ARJ_MIN_FILE_SIZE) goto done;

	// Aribrarily allow up to 16 extra bytes before the ARJ data starts.
	// Maybe 2 is sufficient. Dunno.
	ret = fmtutil_scan_for_arj_data(ei->f, ei->end_of_dos_code, 16, 0, &foundpos);

	if(ret) {
		edd->detected_fmt = DE_SPECIALEXEFMT_ARJSFX;
		edd->payload_pos = foundpos;
		edd->payload_len = ei->f->len - foundpos;
		edd->payload_valid = 1;
		goto done;
	}

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

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq $0x0, (%rsp)
cmpq $0x54, 0x50(%rsi)
jl 0x106acf
movq %rsi, %r14
movq (%rsi), %rdi
movq 0x48(%rsi), %rsi
movq %rsp, %r8
movl $0x10, %edx
xorl %ecx, %ecx
callq 0xf9fc8
testl %eax, %eax
je 0x106acf
movb $0x66, 0x1(%rbx)
movq (%rsp), %rax
movq %rax, 0x10(%rbx)
movq (%r14), %rcx
movq 0x18(%rcx), %rcx
subq %rax, %rcx
movq %rcx, 0x18(%rbx)
movb $0x1, 0x3(%rbx)
cmpb $0x66, 0x1(%rbx)
jne 0x106aed
addq $0x50, %rbx
leaq 0x11333(%rip), %rsi     # 0x117e13
movl $0x28, %edx
movq %rbx, %rdi
callq 0xe8ded
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/fmtutil-exe.c
// Function: detect_exesfx_fbex
static void detect_exesfx_fbex(deark *c,
	struct fmtutil_exe_info *ei, struct fmtutil_specialexe_detection_data *edd)
{
	i64 pos;
	i64 n;

	read_exe_testbytes(ei);
	if(de_memcmp(ei->ovl64b, "FBIN", 4)) goto done;
	n = de_getu32le_direct(&ei->ovl64b[4]);

	pos = ei->end_of_dos_code + 8 + n;
	if(pos+40 > ei->f->len) goto done;
	if(dbuf_memcmp(ei->f, pos, "FBEX", 4)) goto done;
	pos += 4;
	edd->payload_len = dbuf_getu32le_p(ei->f, &pos);
	edd->payload_pos = pos;
	if(edd->payload_len<32) goto done;
	if(edd->payload_pos+edd->payload_len > ei->f->len) goto done;
	// If there's other stuff after this item, fail completely instead
	// of partially.
	if(edd->payload_pos+edd->payload_len+32 < ei->f->len) goto done;
	if(dbuf_memcmp(ei->f, edd->payload_pos, "MZ", 2)) goto done;

	edd->payload_valid = 1;
	edd->detected_fmt = DE_SPECIALEXEFMT_SFX;
	edd->payload_file_ext = "exe";

done:
	if(edd->detected_fmt==DE_SPECIALEXEFMT_SFX) {
		de_strlcpy(edd->detected_fmt_name, "FBEX overlay",
			sizeof(edd->detected_fmt_name));
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rsi, %rdi
callq 0x106061
cmpl $0x4e494246, 0xb0(%r14) # imm = 0x4E494246
jne 0x106bd2
leaq 0xb4(%r14), %rdi
callq 0xef37b
movq 0x48(%r14), %rcx
leaq (%rax,%rcx), %rsi
addq $0x8, %rsi
movq %rsi, 0x8(%rsp)
addq %rcx, %rax
addq $0x30, %rax
movq (%r14), %rdi
cmpq 0x18(%rdi), %rax
jg 0x106bd2
leaq 0x4507c(%rip), %rdx     # 0x14bbd1
movl $0x4, %ecx
callq 0xf025e
testl %eax, %eax
jne 0x106bd2
leaq 0x8(%rsp), %r15
addq $0x4, (%r15)
movq (%r14), %rdi
movq %r15, %rsi
callq 0xef3a0
movq %rax, 0x18(%rbx)
movq (%r15), %rsi
movq %rsi, 0x10(%rbx)
cmpq $0x20, %rax
jl 0x106bd2
leaq (%rsi,%rax), %rcx
movq (%r14), %rdi
movq 0x18(%rdi), %rdx
cmpq %rdx, %rcx
setg %cl
addq %rsi, %rax
addq $0x20, %rax
cmpq %rdx, %rax
setl %al
orb %cl, %al
jne 0x106bd2
leaq 0x45025(%rip), %rdx     # 0x14bbd6
movl $0x2, %ecx
callq 0xf025e
testl %eax, %eax
jne 0x106bd2
movb $0x1, 0x3(%rbx)
movb $0x64, 0x1(%rbx)
leaq 0x1cb87(%rip), %rax     # 0x123755
movq %rax, 0x40(%rbx)
cmpb $0x64, 0x1(%rbx)
jne 0x106bf0
addq $0x50, %rbx
leaq 0x44ff6(%rip), %rsi     # 0x14bbd9
movl $0x28, %edx
movq %rbx, %rdi
callq 0xe8ded
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/fmtutil-lzah.c
// Function: fmtutil_get_lzhuf_d_code_and_len
void fmtutil_get_lzhuf_d_code_and_len(UI n, UI *pd_code, UI *pd_len)
{
	if(n<32 || n>=256) { *pd_code = 0; *pd_len = 3; }
	else if(n<80) { *pd_code = (n-16)>>4; *pd_len = 4; }
	else if(n<144) { *pd_code = (n-48)>>3; *pd_len = 5; }
	else if(n<192) { *pd_code = (n-96)>>2; *pd_len = 6; }
	else if(n<240) { *pd_code = (n-144)>>1; *pd_len = 7; }
	else { *pd_code = n-192; *pd_len = 8; };
}

// Assembly:
leal -0x100(%rdi), %eax
cmpl $0xffffff20, %eax       # imm = 0xFFFFFF20
jae 0x106c12
movl $0x3, %eax
xorl %edi, %edi
jmp 0x106c70
cmpl $0x4f, %edi
ja 0x106c24
addl $-0x10, %edi
shrl $0x4, %edi
movl $0x4, %eax
jmp 0x106c70
cmpl $0x8f, %edi
ja 0x106c39
addl $-0x30, %edi
shrl $0x3, %edi
movl $0x5, %eax
jmp 0x106c70
cmpl $0xbf, %edi
ja 0x106c4e
addl $-0x60, %edi
shrl $0x2, %edi
movl $0x6, %eax
jmp 0x106c70
cmpl $0xef, %edi
ja 0x106c65
addl $0xffffff70, %edi       # imm = 0xFFFFFF70
shrl %edi
movl $0x7, %eax
jmp 0x106c70
addl $0xffffff40, %edi       # imm = 0xFFFFFF40
movl $0x8, %eax
movl %edi, (%rsi)
movl %eax, (%rdx)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/fmtutil-lzah.c
// Function: my_lh1_codec_addbuf
static void my_lh1_codec_addbuf(struct de_dfilter_ctx *dfctx,
	const u8 *buf, i64 buf_len)
{
	struct lzahuf_ctx *cctx = (struct lzahuf_ctx*)dfctx->codec_private;

	if(dfctx->finished_flag || cctx->errflag) {
		goto done;
	}

	lzhuf_Decode_continue(cctx, buf, buf_len, 0);

done:
	if(cctx->errflag) {
		dfctx->finished_flag = 1;
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x28(%rdi), %r14
cmpb $0x0, 0x20(%rdi)
jne 0x107018
cmpl $0x0, 0x54(%r14)
jne 0x107018
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x107142
cmpl $0x0, 0x54(%r14)
je 0x107023
movb $0x1, 0x20(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/fmtutil-lzah.c
// Function: my_lh1_codec_finish
static void my_lh1_codec_finish(struct de_dfilter_ctx *dfctx)
{
	struct lzahuf_ctx *cctx = (struct lzahuf_ctx*)dfctx->codec_private;

	lzhuf_Decode_continue(cctx, NULL, 0, 1);

	cctx->total_nbytes_processed -= (i64)(cctx->bbll.nbits_in_bitbuf/8);
	de_bitbuf_lowlevel_empty(&cctx->bbll);
	dfctx->dres->bytes_consumed = cctx->total_nbytes_processed;
	dfctx->dres->bytes_consumed_valid = 1;

	if(cctx->errflag) {
		de_dfilter_set_generic_error(cctx->c, dfctx->dres, cctx->modname);
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0x28(%rdi), %rbx
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
movl $0x1, %ecx
callq 0x107142
leaq 0x70(%rbx), %rdi
movl 0x74(%rbx), %eax
shrl $0x3, %eax
subq %rax, 0x58(%rbx)
callq 0xf2261
movq 0x58(%rbx), %rax
movq 0x8(%r14), %rsi
movq %rax, 0x8(%rsi)
movb $0x1, 0x4(%rsi)
cmpl $0x0, 0x54(%rbx)
je 0x107083
movq (%rbx), %rdi
movq 0x8(%rbx), %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xfa815
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/fmtutil-lzah.c
// Function: my_lh1_codec_command
static void my_lh1_codec_command(struct de_dfilter_ctx *dfctx, int cmd, UI flags)
{
	struct lzahuf_ctx *cctx = (struct lzahuf_ctx*)dfctx->codec_private;

	if(cmd==DE_DFILTER_COMMAND_FINISH_BLOCK) {
		lzhuf_Decode_continue(cctx, NULL, 0, 1);
		cctx->total_nbytes_processed -= (i64)(cctx->bbll.nbits_in_bitbuf/8);
		de_bitbuf_lowlevel_empty(&cctx->bbll);
		if(cctx->lh1p.is_dms_deep) {
			de_lz77buffer_set_curpos(cctx->ringbuf, cctx->ringbuf->curpos + 60);
		}
	}
	else if(cmd==DE_DFILTER_COMMAND_RESET_COUNTERS) {
		cctx->nbytes_written = 0;
		cctx->total_nbytes_processed = 0;
		cctx->errflag = 0;
		dfctx->finished_flag = 0;
	}
}

// Assembly:
pushq %rbx
movq 0x28(%rdi), %rbx
cmpl $0x4, %esi
je 0x1070d4
cmpl $0x3, %esi
jne 0x1070e6
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
movl $0x1, %ecx
callq 0x107142
leaq 0x70(%rbx), %rdi
movl 0x74(%rbx), %eax
shrl $0x3, %eax
subq %rax, 0x58(%rbx)
callq 0xf2261
cmpb $0x0, 0x14(%rbx)
je 0x1070e6
movq 0x68(%rbx), %rdi
movl 0x10(%rdi), %esi
addl $0x3c, %esi
popq %rbx
jmp 0xfb86a
xorps %xmm0, %xmm0
movups %xmm0, 0x54(%rbx)
movl $0x0, 0x64(%rbx)
movb $0x0, 0x20(%rdi)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/fmtutil-lzah.c
// Function: my_lh1_codec_destroy
static void my_lh1_codec_destroy(struct de_dfilter_ctx *dfctx)
{
	struct lzahuf_ctx *cctx = (struct lzahuf_ctx*)dfctx->codec_private;

	if(cctx) {
		de_lz77buffer_destroy(cctx->c, cctx->ringbuf);
		cctx->ringbuf = NULL;
		de_free(dfctx->c, cctx);
	}
	dfctx->codec_private = NULL;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x28(%rdi), %r14
testq %r14, %r14
je 0x107117
movq (%r14), %rdi
movq 0x68(%r14), %rsi
callq 0xfb408
movq $0x0, 0x68(%r14)
movq (%rbx), %rdi
movq %r14, %rsi
callq 0xe9752
movq $0x0, 0x28(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/../foreign/lzhuf.h
// Function: lzah_lz77buf_writebytecb
static void lzah_lz77buf_writebytecb(struct de_lz77buffer *rb, u8 n)
{
	struct lzahuf_ctx *cctx = (struct lzahuf_ctx*)rb->userdata;

	if(lzah_have_enough_output(cctx)) {
		return;
	}
	dbuf_writebyte(cctx->dcmpro->f, n);
	cctx->nbytes_written++;
}

// Assembly:
pushq %rbx
movq (%rdi), %rbx
movq 0x20(%rbx), %rax
cmpb $0x0, 0x8(%rax)
je 0x107a52
movq 0x60(%rbx), %rcx
cmpq 0x10(%rax), %rcx
jge 0x107a64
movq (%rax), %rdi
movzbl %sil, %esi
callq 0xf11be
incq 0x60(%rbx)
jmp 0x107a6c
movq 0x18(%rbx), %rax
movb $0x1, 0x20(%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/../foreign/lzhuf.h
// Function: lzhuf_decodesubtree_node
static void lzhuf_decodesubtree_node(struct lzahuf_ctx *cctx, UI p1, u64 val, UI val_nbits,
	char *b2buf, size_t b2buf_len)
{
	if(cctx->son[p1] < cctx->lzhuf_T) { // [pointer node]
		lzhuf_decodesubtree_nodepair(cctx, cctx->son[p1], val, val_nbits, b2buf, b2buf_len);
	}
	else { // [leaf node]
		de_dbg(cctx->c, "code: \"%s\" = %d [%u]",
			de_print_base2_fixed(b2buf, b2buf_len, val, val_nbits),
			(int)cctx->son[p1], (UI)(cctx->son[p1]-cctx->lzhuf_T));
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r14
movl %ecx, %ebp
movq %rdx, %r15
movl %esi, %r12d
movq %rdi, %rbx
movl %r12d, %r13d
movzwl 0xcd6(%rbx,%r13,2), %r12d
cmpl %r12d, 0x3c(%rbx)
jbe 0x107abc
leaq (%r15,%r15), %rdx
incl %ebp
movq %rbx, %rdi
movl %r12d, %esi
movl %ebp, %ecx
movq %r14, %r8
callq 0x107a6e
incl %r12d
leaq 0x1(,%r15,2), %r15
jmp 0x107a87
movq (%rbx), %r12
movl $0x48, %esi
movq %r14, %rdi
movq %r15, %rdx
movl %ebp, %ecx
callq 0xea85a
movzwl 0xcd6(%rbx,%r13,2), %ecx
movl %ecx, %r8d
subl 0x3c(%rbx), %r8d
leaq 0x441cf(%rip), %rsi     # 0x14bcb7
movq %r12, %rdi
movq %rax, %rdx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe9226
nop
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/fmtutil-iff.c
// Function: fmtutil_read_iff_format
void fmtutil_read_iff_format(struct de_iffctx *ictx, i64 pos, i64 len)
{
	deark *c = ictx->c;
	struct iff_parser_data *pctx = NULL;

	if(!ictx->f || !ictx->handle_chunk_fn) return; // Internal error

	ictx->level = 0;
	fourcc_clear(&ictx->main_fmt4cc);
	fourcc_clear(&ictx->main_contentstype4cc);
	fourcc_clear(&ictx->curr_container_fmt4cc);
	fourcc_clear(&ictx->curr_container_contentstype4cc);
	if(ictx->alignment==0) {
		ictx->alignment = 2;
	}
	if(ictx->sizeof_len==0) {
		ictx->sizeof_len = 4;
	}

	if(ictx->input_encoding==DE_ENCODING_UNKNOWN) {
		ictx->input_encoding = DE_ENCODING_ASCII;
	}

	pctx = de_malloc(c, sizeof(struct iff_parser_data));
	ictx->private_data = (void*)pctx;
	do_iff_chunk_sequence(c, ictx, NULL, pos, len, 0);
	ictx->private_data = NULL;
	de_free(c, pctx);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
cmpq $0x0, 0x18(%rdi)
je 0x107bd4
movq %rdi, %rbx
cmpq $0x0, 0x20(%rdi)
je 0x107bd4
movq %rdx, %r14
movq %rsi, %r15
movq (%rbx), %r12
leaq 0x64(%rbx), %rdi
movl $0xc4, %edx
xorl %esi, %esi
callq 0x18140
cmpq $0x0, 0x48(%rbx)
jne 0x107b72
movq $0x2, 0x48(%rbx)
cmpq $0x0, 0x50(%rbx)
jne 0x107b81
movq $0x4, 0x50(%rbx)
cmpl $0x0, 0x60(%rbx)
jne 0x107b8e
movl $0x1, 0x60(%rbx)
movl $0x50, %esi
movq %r12, %rdi
callq 0xe969b
movq %rax, %r13
movq %rax, 0x8(%rbx)
movq %r12, %rdi
movq %rbx, %rsi
xorl %edx, %edx
movq %r15, %rcx
movq %r14, %r8
xorl %r9d, %r9d
callq 0x107bde
movq $0x0, 0x8(%rbx)
movq %r12, %rdi
movq %r13, %rsi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xe9752
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/fmtutil-iff.c
// Function: do_iff_text_chunk
static void do_iff_text_chunk(deark *c, struct de_iffctx *ictx, i64 dpos, i64 dlen,
	const char *name)
{
	de_ucstring *s = NULL;

	if(dlen<1) return;
	s = ucstring_create(c);
	dbuf_read_to_ucstring_n(ictx->f,
		dpos, dlen, DE_DBG_MAX_STRLEN,
		s, DE_CONVFLAG_STOP_AT_NUL, ictx->input_encoding);
	de_dbg(c, "%s: \"%s\"", name, ucstring_getpsz(s));
	ucstring_destroy(s);
}

// Assembly:
testq %rcx, %rcx
jle 0x10840f
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movq %rcx, %r12
movq %rdx, %r13
movq %rsi, %rbp
movq %rdi, %r14
callq 0xf6870
movq %rax, %r15
movq 0x18(%rbp), %rdi
movl 0x60(%rbp), %eax
movl %eax, (%rsp)
movl $0x1f4, %ecx            # imm = 0x1F4
movq %r13, %rsi
movq %r12, %rdx
movq %r15, %r8
movl $0x1, %r9d
callq 0xf0203
movq %r15, %rdi
callq 0xf74bd
leaq 0x23a59(%rip), %rsi     # 0x12be42
movq %r14, %rdi
movq %rbx, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0xe9226
movq %r15, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xf6bb0
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/fmtutil-iff.c
// Function: do_iff_anno
static void do_iff_anno(deark *c, struct de_iffctx *ictx, i64 pos, i64 len)
{
	i64 foundpos;

	if(len<1) return;

	// Some ANNO chunks seem to be padded with one or more NUL bytes. Probably
	// best not to save them.
	if(dbuf_search_byte(ictx->f, 0x00, pos, len, &foundpos)) {
		len = foundpos - pos;
	}
	if(len<1) return;
	if(c->extract_level>=2) {
		dbuf_create_file_from_slice(ictx->f, pos, len, "anno.txt", NULL, DE_CREATEFLAG_IS_AUX);
	}
	else {
		de_ucstring *s = NULL;
		s = ucstring_create(c);
		dbuf_read_to_ucstring_n(ictx->f, pos, len, DE_DBG_MAX_STRLEN, s, 0, ictx->input_encoding);
		de_dbg(c, "annotation: \"%s\"", ucstring_getpsz(s));
		ucstring_destroy(s);
	}
}

// Assembly:
testq %rcx, %rcx
jle 0x1084e0
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rcx, %r13
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %rbx
movq 0x18(%rsi), %rdi
leaq 0x8(%rsp), %r15
xorl %esi, %esi
movq %r15, %r8
callq 0xf0057
movq (%r15), %r15
subq %r14, %r15
testl %eax, %eax
cmoveq %r13, %r15
testq %r15, %r15
jle 0x1084d3
cmpl $0x2, 0x90(%rbx)
jl 0x108481
movq 0x18(%r12), %rdi
leaq 0x43993(%rip), %rcx     # 0x14bdfe
movq %r14, %rsi
movq %r15, %rdx
xorl %r8d, %r8d
movl $0x1, %r9d
callq 0xf0321
jmp 0x1084d3
movq %rbx, %rdi
callq 0xf6870
movq %rax, %r13
movq 0x18(%r12), %rdi
movl 0x60(%r12), %eax
movl %eax, (%rsp)
movl $0x1f4, %ecx            # imm = 0x1F4
movq %r14, %rsi
movq %r15, %rdx
movq %r13, %r8
xorl %r9d, %r9d
callq 0xf0203
movq %r13, %rdi
callq 0xf74bd
leaq 0x201ae(%rip), %rsi     # 0x12866c
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq %r13, %rdi
callq 0xf6bb0
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-user.c
// Function: de_print_module_list
void de_print_module_list(deark *c)
{
	int i, k;
	struct sort_data_struct *sort_data = NULL;

	de_register_modules(c);

	// An index to the modules. Will be sorted by name.
	sort_data = de_mallocarray(c, c->num_modules, sizeof(struct sort_data_struct));

	for(k=0; k<c->num_modules; k++) {
		sort_data[k].c = c;
		sort_data[k].module_index = k;
	}

	qsort((void*)sort_data, (size_t)c->num_modules, sizeof(struct sort_data_struct),
		module_compare_fn);

	for(k=0; k<c->num_modules; k++) {
		const char *desc;
		i = sort_data[k].module_index;
		if(!c->module_info[i].id) continue;
		if(c->extract_level<2) {
			if(c->module_info[i].flags & (DE_MODFLAG_HIDDEN |
				DE_MODFLAG_NONWORKING | DE_MODFLAG_WARNPARSEONLY))
			{
				continue;
			}
		}
		desc = c->module_info[i].desc ? c->module_info[i].desc : "-";
		de_printf(c, DE_MSGTYPE_MESSAGE, "%-14s %s\n", c->module_info[i].id, desc);
	}

	de_free(c, sort_data);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x1a0(%rdi), %rax
testq %rax, %rax
je 0x108505
movq %rbx, %rdi
callq *%rax
jmp 0x108516
leaq 0x43942(%rip), %rsi     # 0x14be4e
movq %rbx, %rdi
xorl %eax, %eax
callq 0xea0a6
movslq 0x1a8(%rbx), %rsi
movl $0x10, %edx
movq %rbx, %rdi
callq 0xea259
movq %rax, %r14
movslq 0x1a8(%rbx), %rsi
testq %rsi, %rsi
jle 0x108551
leaq 0x8(%r14), %rax
xorl %ecx, %ecx
movq %rbx, -0x8(%rax)
movl %ecx, (%rax)
incq %rcx
addq $0x10, %rax
cmpq %rcx, %rsi
jne 0x10853f
leaq 0xbb(%rip), %rcx        # 0x108613
movl $0x10, %edx
movq %r14, %rdi
callq 0x18070
cmpl $0x0, 0x1a8(%rbx)
jle 0x1085de
movq %r14, %r12
addq $0x8, %r12
leaq 0x23deb(%rip), %r13     # 0x12c367
leaq 0x438c1(%rip), %r15     # 0x14be44
xorl %ebp, %ebp
movslq (%r12), %rcx
movq 0x1b0(%rbx), %rax
leaq (%rcx,%rcx,8), %rdx
movq (%rax,%rdx,8), %rcx
testq %rcx, %rcx
je 0x1085cb
cmpl $0x1, 0x90(%rbx)
jg 0x1085b0
leaq (%rax,%rdx,8), %rsi
testb $0x23, 0x30(%rsi)
jne 0x1085cb
movq 0x8(%rax,%rdx,8), %r8
testq %r8, %r8
cmoveq %r13, %r8
movq %rbx, %rdi
xorl %esi, %esi
movq %r15, %rdx
xorl %eax, %eax
callq 0xe917a
incq %rbp
movslq 0x1a8(%rbx), %rax
addq $0x10, %r12
cmpq %rax, %rbp
jl 0x108585
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe9752
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-user.c
// Function: detect_module_for_file
static struct deark_module_info *detect_module_for_file(deark *c, int *errflag)
{
	int i;
	int result;
	int orig_errcount;
	struct deark_module_info *best_module = NULL;

	*errflag = 0;
	if(!c->detection_data) {
		c->detection_data = de_malloc(c, sizeof(struct de_detection_data_struct));
	}

	// This value is made available to modules' identification functions, so
	// that they can potentially skip expensive tests that cannot possibly return
	// a high enough confidence.
	c->detection_data->best_confidence_so_far = 0;

	orig_errcount = c->error_count;
	for(i=0; i<c->num_modules; i++) {
		if(c->module_info[i].identify_fn==NULL) continue;

		// If autodetect is disabled for this module, and its autodetect routine
		// doesn't do anything that may be needed by other modules, don't bother
		// to run this module's autodetection.
		if((c->module_info[i].flags & DE_MODFLAG_DISABLEDETECT) &&
			!(c->module_info[i].flags & DE_MODFLAG_SHAREDDETECTION))
		{
			continue;
		}

		result = c->module_info[i].identify_fn(c);

		if(c->error_count > orig_errcount) {
			// Detection routines don't normally produce errors. If one does,
			// it's probably an internal error, or other serious problem.
			*errflag = 1;
			return NULL;
		}

		if(c->module_info[i].flags & DE_MODFLAG_DISABLEDETECT) {
			// Ignore results of autodetection.
			continue;
		}

		if(result <= c->detection_data->best_confidence_so_far) continue;

		// This is the best result so far.
		c->detection_data->best_confidence_so_far = result;
		best_module = &c->module_info[i];
		if(c->detection_data->best_confidence_so_far>=100) break;
	}

	return best_module;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl $0x0, (%rsi)
cmpq $0x0, 0x28(%rdi)
jne 0x108e74
movl $0x20, %esi
movq %r14, %rdi
callq 0xe969b
movq %rax, 0x28(%r14)
movq 0x28(%r14), %rax
movl $0x0, (%rax)
cmpl $0x0, 0x1a8(%r14)
jle 0x108f12
movq %rbx, (%rsp)
movl 0x48(%r14), %ebp
xorl %r12d, %r12d
movl $0x110, %r13d           # imm = 0x110
xorl %ebx, %ebx
xorl %r15d, %r15d
movq 0x1b0(%r14), %rax
cmpq $0x0, 0x20(%rax,%r12)
je 0x108ef3
movl 0x30(%rax,%r12), %ecx
andl %r13d, %ecx
cmpl $0x100, %ecx            # imm = 0x100
je 0x108ef3
movq %r14, %rdi
callq *0x20(%rax,%r12)
cmpl %ebp, 0x48(%r14)
jg 0x108f08
movq 0x1b0(%r14), %rcx
testb $0x1, 0x31(%rcx,%r12)
jne 0x108ef3
movq 0x28(%r14), %rdx
cmpl (%rdx), %eax
jle 0x108ef3
movl %eax, (%rdx)
cmpl $0x63, %eax
jg 0x108f27
addq %r12, %rcx
movq %rcx, %r15
incq %rbx
movslq 0x1a8(%r14), %rax
addq $0x48, %r12
cmpq %rax, %rbx
jl 0x108ea2
jmp 0x108f15
movq (%rsp), %rax
movl $0x1, (%rax)
xorl %r15d, %r15d
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
addq %r12, %rcx
movq %rcx, %r15
jmp 0x108f15
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-user.c
// Function: do_modhelp_internal
static void do_modhelp_internal(deark *c, struct deark_module_info *module_to_use)
{
	int k;
	u8 printed_something = 0;
	u8 suppress_nohelpmsg = 0;

	if(!module_to_use) goto done;
	de_msg(c, "Module: %s", module_to_use->id);

	for(k=0; k<DE_MAX_MODULE_ALIASES; k++) {
		if(module_to_use->id_alias[k]) {
			de_msg(c, "Alias: %s", module_to_use->id_alias[k]);
		}
		else {
			break;
		}
	}

	if(module_to_use->desc) {
		de_msg(c, "Description: %s", module_to_use->desc);
	}
	if(module_to_use->desc2) {
		de_msg(c, "Other notes: %s", module_to_use->desc2);
		printed_something = 1;
	}

	if(module_to_use->flags&DE_MODFLAG_MULTIPART) {
		de_msg(c, "This module supports multiple input files; "
			"use the \"-mp\" option.");
		printed_something = 1;
	}

	if(module_to_use->flags&DE_MODFLAG_INTERNALONLY) {
		de_msg(c, "This module is intended for internal use only.");
		suppress_nohelpmsg = 1;
	}

	if(!module_to_use->help_fn) {
		if(!suppress_nohelpmsg) {
			de_msg(c, "No%s help available for module \"%s\".",
				(printed_something?" other":""), module_to_use->id);
		}
		goto done;
	}

	de_msg(c, "Help for module \"%s\":", module_to_use->id);
	module_to_use->help_fn(c);

done:
	;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %rdx
leaq 0x43038(%rip), %rsi     # 0x14bf7f
xorl %eax, %eax
callq 0xe9fc3
movq %r14, %rcx
movl $0x7, %r15d
leaq 0x4328f(%rip), %r14     # 0x14c1ed
movq %rcx, %r12
movq (%rcx,%r15,8), %rdx
testq %rdx, %rdx
je 0x108f83
movq %rbx, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0xe9fc3
movq %r12, %rcx
incq %r15
cmpq $0x8, %r15
je 0x108f61
movq 0x8(%rcx), %rdx
testq %rdx, %rdx
je 0x108fa0
leaq 0x43264(%rip), %rsi     # 0x14c1f7
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9fc3
movq %r12, %rcx
movq 0x10(%rcx), %rdx
testq %rdx, %rdx
je 0x108fc4
leaq 0x43257(%rip), %rsi     # 0x14c207
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9fc3
movq %r12, %rcx
movl $0x1, %ebp
jmp 0x108fc6
xorl %ebp, %ebp
testb $0x40, 0x30(%rcx)
je 0x108fe5
leaq 0x43244(%rip), %rsi     # 0x14c217
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9fc3
movq %r12, %rcx
movl $0x1, %ebp
movl 0x30(%rcx), %r14d
testb %r14b, %r14b
jns 0x109002
leaq 0x43263(%rip), %rsi     # 0x14c258
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9fc3
movq %r12, %rcx
cmpq $0x0, 0x28(%rcx)
je 0x109031
movq (%rcx), %rdx
movq %rcx, %r14
leaq 0x4329d(%rip), %rsi     # 0x14c2b3
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9fc3
movq %rbx, %rdi
movq %r14, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmpq *0x28(%rax)
testb %r14b, %r14b
js 0x109066
testl %ebp, %ebp
leaq 0x3bb91(%rip), %rax     # 0x144bd0
leaq 0x43266(%rip), %rdx     # 0x14c2ac
cmoveq %rax, %rdx
movq (%rcx), %rcx
leaq 0x43233(%rip), %rsi     # 0x14c287
movq %rbx, %rdi
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xe9fc3
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-user.c
// Function: de_create_internal
deark *de_create_internal(void)
{
	deark *c;
	c = de_malloc(NULL,sizeof(deark));
	c->show_infomessages = 1;
	c->show_warnings = 1;
	c->write_bom = 1;
	c->write_density = 1;
	c->filenames_from_file = 1;
	c->append_riscos_type = 0xff;
	c->preserve_file_times = 1;
	c->preserve_file_times_archives = 1;
	c->preserve_file_times_internal = 1;
	c->max_output_files = DE_MAX_OUTPUT_FILES_HARD_LIMIT;
	c->max_image_dimension = DE_DEFAULT_MAX_IMAGE_DIMENSION;
	c->max_output_file_size = DE_DEFAULT_MAX_FILE_SIZE;
	c->max_total_output_size = DE_DEFAULT_MAX_TOTAL_OUTPUT_SIZE;
	c->current_time.is_valid = 0;
	c->can_decode_fltpt = -1; // = unknown
	c->host_is_le = -1; // = unknown
	c->input_encoding = DE_ENCODING_UNKNOWN;
	return c;
}

// Assembly:
pushq %rax
movl $0x2f0, %esi            # imm = 0x2F0
xorl %edi, %edi
callq 0xe969b
movabsq $0x100000001, %rcx      # imm = 0x100000001
movq %rcx, 0xc0(%rax)
movw $0x101, %cx             # imm = 0x101
movw %cx, 0xcc(%rax)
movb $0x1, %dl
movb %dl, 0xd0(%rax)
movb $-0x1, 0xd4(%rax)
movw %cx, 0xdc(%rax)
movb %dl, 0xde(%rax)
movl $0x3d090, 0x9c(%rax)    # imm = 0x3D090
movq $0x2710, 0xa8(%rax) # imm = 0x2710
movabsq $0x280000000, %rcx      # imm = 0x280000000
movq %rcx, 0xb0(%rax)
movabsq $0x3c0000000, %rcx      # imm = 0x3C0000000
movq %rcx, 0xb8(%rax)
movb $0x0, 0x190(%rax)
movq $-0x1, 0xf0(%rax)
movl $0x0, 0xfc(%rax)
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-user.c
// Function: de_destroy
void de_destroy(deark *c)
{
	int i;

	if(!c) return;
	if(c->zip_data) { de_zip_close_file(c); }
	if(c->tar_data) { de_tar_close_file(c); }
	if(c->extrlist_dbuf) { dbuf_close(c->extrlist_dbuf); }
	for(i=0; i<c->num_ext_options; i++) {
		de_free(c, c->ext_option[i].name);
		de_free(c, c->ext_option[i].val);
	}
	if(c->base_output_filename) { de_free(c, c->base_output_filename); }
	if(c->special_1st_filename) { de_free(c, c->special_1st_filename); }
	if(c->output_archive_filename) { de_free(c, c->output_archive_filename); }
	if(c->extrlist_filename) { de_free(c, c->extrlist_filename); }
	if(c->detection_data) { de_free(c, c->detection_data); }
	if(c->mp_data) {
		for(i=0; i<c->mp_data->count; i++) {
			dbuf_close(c->mp_data->item[i].f);
			// (The .fn field is owned by the caller (deark-cmd.c)).
		}
		de_free(c, c->mp_data->item);
		de_free(c, c->mp_data);
	}
	for(i=0; i<DE_NUM_PERSISTENT_MEM_ITEMS; i++) {
		if(c->persistent_item[i]) {
			de_free(c, c->persistent_item[i]);
		}
	}
	de_free(c, c->module_info);
	de_free(NULL,c);
}

// Assembly:
testq %rdi, %rdi
je 0x10927c
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpq $0x0, 0x138(%rdi)
je 0x10912c
movq %rbx, %rdi
callq 0xedf69
cmpq $0x0, 0x140(%rbx)
je 0x10913e
movq %rbx, %rdi
callq 0xee2b6
movq 0x148(%rbx), %rdi
testq %rdi, %rdi
je 0x10914f
callq 0xf0b13
cmpl $0x0, 0x1b8(%rbx)
jle 0x10918c
leaq 0x1c8(%rbx), %r14
xorl %r15d, %r15d
movq -0x8(%r14), %rsi
movq %rbx, %rdi
callq 0xe9752
movq (%r14), %rsi
movq %rbx, %rdi
callq 0xe9752
incq %r15
movslq 0x1b8(%rbx), %rax
addq $0x10, %r14
cmpq %rax, %r15
jl 0x109162
movq 0x150(%rbx), %rsi
testq %rsi, %rsi
je 0x1091a0
movq %rbx, %rdi
callq 0xe9752
movq 0x158(%rbx), %rsi
testq %rsi, %rsi
je 0x1091b4
movq %rbx, %rdi
callq 0xe9752
movq 0x160(%rbx), %rsi
testq %rsi, %rsi
je 0x1091c8
movq %rbx, %rdi
callq 0xe9752
movq 0x168(%rbx), %rsi
testq %rsi, %rsi
je 0x1091dc
movq %rbx, %rdi
callq 0xe9752
movq 0x28(%rbx), %rsi
testq %rsi, %rsi
je 0x1091ed
movq %rbx, %rdi
callq 0xe9752
cmpq $0x0, 0x30(%rbx)
je 0x10923e
movq 0x30(%rbx), %rax
cmpl $0x0, (%rax)
jle 0x109226
movl $0x8, %r14d
xorl %r15d, %r15d
movq 0x8(%rax), %rax
movq (%rax,%r14), %rdi
callq 0xf0b13
incq %r15
movq 0x30(%rbx), %rax
movslq (%rax), %rcx
addq $0x10, %r14
cmpq %rcx, %r15
jl 0x109206
movq 0x8(%rax), %rsi
movq %rbx, %rdi
callq 0xe9752
movq 0x30(%rbx), %rsi
movq %rbx, %rdi
callq 0xe9752
movl $0x58, %r14d
movq (%rbx,%r14,8), %rsi
testq %rsi, %rsi
je 0x109255
movq %rbx, %rdi
callq 0xe9752
incq %r14
cmpq $0x5e, %r14
jne 0x109244
movq 0x1b0(%rbx), %rsi
movq %rbx, %rdi
callq 0xe9752
xorl %edi, %edi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0xe9752
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-user.c
// Function: de_set_output_filename_pattern
void de_set_output_filename_pattern(deark *c, const char *dirname, const char *fn,
	unsigned int flags)
{
	if(c->base_output_filename) de_free(c, c->base_output_filename);
	c->base_output_filename = NULL;
	if(!fn && !dirname) return;
	if(!fn) fn = "output";
	if(c->output_style==DE_OUTPUTSTYLE_ARCHIVE) {
		flags |= 0x4;
	}
	c->base_output_filename = make_output_filename(c, dirname, fn, NULL, flags);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %ebp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movq 0x150(%rdi), %rsi
testq %rsi, %rsi
je 0x1092c5
movq %rbx, %rdi
callq 0xe9752
movq $0x0, 0x150(%rbx)
movq %r14, %rax
orq %r15, %rax
je 0x109309
testq %r15, %r15
leaq 0x42320(%rip), %rdx     # 0x14b602
cmovneq %r15, %rdx
movl %ebp, %r8d
orl $0x4, %r8d
cmpl $0x1, 0x7c(%rbx)
cmovnel %ebp, %r8d
movq %rbx, %rdi
movq %r14, %rsi
xorl %ecx, %ecx
callq 0x109314
movq %rax, 0x150(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-user.c
// Function: de_set_output_special_1st_filename
void de_set_output_special_1st_filename(deark *c, const char *dirname, const char *fn)
{
	if(c->special_1st_filename) {
		de_free(c, c->special_1st_filename);
		c->special_1st_filename = NULL;
	}
	if(fn) {
		UI flags = 0;

		if(c->output_style==DE_OUTPUTSTYLE_ARCHIVE) {
			flags |= 0x4;
		}

		c->special_1st_filename = make_output_filename(c, dirname, fn, NULL, flags);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq 0x158(%rdi), %rsi
testq %rsi, %rsi
je 0x1094ad
movq %rbx, %rdi
callq 0xe9752
movq $0x0, 0x158(%rbx)
testq %r14, %r14
je 0x1094d8
xorl %r8d, %r8d
cmpl $0x1, 0x7c(%rbx)
sete %r8b
shll $0x2, %r8d
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x109314
movq %rax, 0x158(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-user.c
// Function: de_set_output_archive_filename
void de_set_output_archive_filename(deark *c, const char *dname, const char *fn,
	unsigned int flags)
{
	const char *suffix = NULL;
	if(c->output_archive_filename) de_free(c, c->output_archive_filename);

	if(flags&0x10) {
		c->archive_to_stdout = 1;
		return;
	}

	if((flags & 0x20) && c->output_style==DE_OUTPUTSTYLE_ARCHIVE) {
		if(c->archive_fmt==DE_ARCHIVEFMT_ZIP) {
			suffix = ".zip";
		}
		else if(c->archive_fmt==DE_ARCHIVEFMT_TAR) {
			suffix = ".tar";
		}
		else {
			suffix = ".err";
		}
	}

	c->output_archive_filename = make_output_filename(c, dname, fn, suffix, flags);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %ebp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq 0x160(%rdi), %rsi
testq %rsi, %rsi
je 0x109504
movq %rbx, %rdi
callq 0xe9752
testb $0x10, %bpl
jne 0x109541
testb $0x20, %bpl
je 0x10954a
cmpl $0x1, 0x7c(%rbx)
jne 0x10954a
movl 0x80(%rbx), %eax
cmpl $0x2, %eax
leaq 0x3f642(%rip), %rcx     # 0x148b68
leaq 0x42c63(%rip), %rdx     # 0x14c190
cmoveq %rcx, %rdx
cmpl $0x1, %eax
leaq 0x3f493(%rip), %rcx     # 0x1489ce
cmovneq %rdx, %rcx
jmp 0x10954c
movb $0x1, 0x88(%rbx)
jmp 0x109564
xorl %ecx, %ecx
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
movl %ebp, %r8d
callq 0x109314
movq %rax, 0x160(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-user.c
// Function: de_set_extrlist_filename
void de_set_extrlist_filename(deark *c, const char *fn)
{
	if(c->extrlist_filename) de_free(c, c->extrlist_filename);
	c->extrlist_filename = NULL;
	if(fn) {
		c->extrlist_filename = de_strdup(c, fn);
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x168(%rdi), %rsi
testq %rsi, %rsi
je 0x10958d
movq %rbx, %rdi
callq 0xe9752
movq $0x0, 0x168(%rbx)
testq %r14, %r14
je 0x1095af
movq %rbx, %rdi
movq %r14, %rsi
callq 0xea3c7
movq %rax, 0x168(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-user.c
// Function: de_set_input_filename
void de_set_input_filename(deark *c, const char *fn, UI flags)
{
	if(c->input_filename && (flags&0x1)) {
		de_add_input_filename_mp(c, fn);
	}
	else {
		c->input_filename = fn;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
testb $0x1, %dl
je 0x1096a8
cmpq $0x0, 0x50(%rbx)
je 0x1096a8
cmpq $0x0, 0x30(%rbx)
jne 0x109681
movl $0x10, %esi
movq %rbx, %rdi
callq 0xe969b
movq %rax, 0x30(%rbx)
movq 0x30(%rbx), %rax
movslq (%rax), %r15
cmpq $0x7ff, %r15            # imm = 0x7FF
jl 0x1096ae
leaq 0x42c31(%rip), %rsi     # 0x14c2c9
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9df7
movb $0x1, 0x4c(%rbx)
jmp 0x1096f1
movq %r14, 0x50(%rbx)
jmp 0x1096f1
leal 0x1(%r15), %ebp
cmpl 0x4(%rax), %r15d
jl 0x1096df
leaq 0x10(%r15), %r12
movq 0x8(%rax), %rsi
movl $0x10, %ecx
movq %rbx, %rdi
movq %r15, %rdx
movq %r12, %r8
callq 0xea2ba
movq 0x30(%rbx), %rcx
movq %rax, 0x8(%rcx)
movl %r12d, 0x4(%rcx)
movq 0x30(%rbx), %rax
movq 0x8(%rax), %rcx
shlq $0x4, %r15
movq %r14, (%rcx,%r15)
movl %ebp, (%rax)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-user.c
// Function: de_set_max_output_file_size
void de_set_max_output_file_size(deark *c, i64 n)
{
	if(n<0) n=0;
	c->max_output_file_size = n;
	if(c->max_total_output_size < n) {
		c->max_total_output_size = n;
	}
}

// Assembly:
xorl %eax, %eax
testq %rsi, %rsi
cmovgq %rsi, %rax
movq %rax, 0xb0(%rdi)
cmpq %rax, 0xb8(%rdi)
jge 0x10979a
movq %rax, 0xb8(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-user.c
// Function: de_set_ext_option
void de_set_ext_option(deark *c, const char *name, const char *val)
{
	int n;

	n = c->num_ext_options;
	if(n>=DE_MAX_EXT_OPTIONS) return;
	if(!name || !val) return;

	c->ext_option[n].name = de_strdup(c, name);
	c->ext_option[n].val = de_strdup(c, val);
	c->num_ext_options++;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movslq 0x1b8(%rdi), %r15
cmpq $0xf, %r15
jg 0x109847
movq %rdx, %r14
testq %rsi, %rsi
sete %al
testq %rdx, %rdx
sete %cl
orb %al, %cl
jne 0x109847
movq %rdi, %rbx
callq 0xea3c7
shlq $0x4, %r15
movq %rax, 0x1c0(%rbx,%r15)
movq %rbx, %rdi
movq %r14, %rsi
callq 0xea3c7
movq %rax, 0x1c8(%rbx,%r15)
incl 0x1b8(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-unix.c
// Function: de_fopen_for_read
FILE* de_fopen_for_read(deark *c, const char *fn, i64 *len,
	char *errmsg, size_t errmsg_len, unsigned int *returned_flags)
{
	int ret;
	FILE *f;

	f = de_fopen(c, fn, "rb", errmsg, errmsg_len);
	if(!f) {
		return NULL;
	}

	ret = de_examine_file_by_fd(c, fileno(f), len, errmsg, errmsg_len,
		returned_flags);
	if(!ret) {
		de_fclose(f);
		return NULL;
	}

	return f;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %r9, %r13
movq %r8, %r14
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %rdi
leaq 0x181ed(%rip), %rsi     # 0x121aae
movq %rcx, %rdx
movq %r8, %rcx
callq 0x109983
testq %rax, %rax
je 0x10992e
movq %rax, %rbx
movq %r12, (%rsp)
movq %rax, %rdi
callq 0x181f0
movl %eax, %ebp
movl $0x0, (%r13)
leaq 0x8(%rsp), %r12
movl $0x90, %edx
movq %r12, %rdi
xorl %esi, %esi
callq 0x18140
movl %ebp, %edi
movq %r12, %rsi
callq 0x182b0
testl %eax, %eax
je 0x109945
callq 0x18040
movl (%rax), %edi
callq 0x182c0
movq %r15, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0xe8ded
movq %rbx, %rdi
callq 0x180d0
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0xf000, %eax           # imm = 0xF000
andl 0x20(%rsp), %eax
movl %eax, %ecx
negw %cx
jo 0x109969
cmpl $0x1000, %eax           # imm = 0x1000
movq (%rsp), %rcx
jne 0x109977
orb $0x1, (%r13)
xorl %eax, %eax
jmp 0x109972
movq 0x38(%rsp), %rax
movq (%rsp), %rcx
movq %rax, (%rcx)
jmp 0x109930
leaq 0x19579(%rip), %rsi     # 0x122ef7
movq %r15, %rdi
jmp 0x10991e
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-unix.c
// Function: de_fopen
static FILE* de_fopen(deark *c, const char *fn, const char *mode,
	char *errmsg, size_t errmsg_len)
{
	FILE *f;
	int errcode;

	f = fopen(fn, mode);
	if(!f) {
		errcode = errno;
		de_strlcpy(errmsg, strerror(errcode), errmsg_len);
	}
	return f;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r14
callq 0x181d0
movq %rax, %r15
testq %rax, %rax
jne 0x1099b5
callq 0x18040
movl (%rax), %edi
callq 0x182c0
movq %r14, %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0xe8ded
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-unix.c
// Function: de_fopen_for_write
FILE* de_fopen_for_write(deark *c, const char *fn,
	char *errmsg, size_t errmsg_len, int overwrite_mode,
	unsigned int flags)
{
	const char *mode;

	// A simple check to make it harder to accidentally overwrite the input
	// file. (But it can easily be defeated.)
	// TODO?: Make this more robust.
	if(c->input_filename && !de_strcmp(fn, c->input_filename)) {
		de_err(c, "Refusing to write to %s: Same as input filename", fn);
		de_fatalerror(c);
		de_strlcpy(errmsg, "", errmsg_len);
		return NULL;
	}

	if(overwrite_mode!=DE_OVERWRITEMODE_STANDARD) {
		// Check if the file already exists.
		struct stat stbuf;
		int s_ret;

		de_zeromem(&stbuf, sizeof(struct stat));
#if DE_USE_LSTAT
		s_ret = lstat(fn, &stbuf);
#else
		s_ret = stat(fn, &stbuf);
#endif

		 // s_ret==0 = "success"
		if(s_ret==0 && overwrite_mode==DE_OVERWRITEMODE_NEVER) {
			de_strlcpy(errmsg, "Output file already exists", errmsg_len);
			return NULL;
		}

		if(s_ret==0 && overwrite_mode==DE_OVERWRITEMODE_DEFAULT) {
			if(S_ISLNK(stbuf.st_mode)) {
				de_strlcpy(errmsg, "Output file is a symlink", errmsg_len);
				return NULL;
			}
		}
	}

	mode = (flags&0x1) ? "ab" : "wb";
	return de_fopen(c, fn, mode, errmsg, errmsg_len);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movl %r9d, %ebp
movl %r8d, %r12d
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq 0x50(%rdi), %rsi
testq %rsi, %rsi
je 0x1099fb
movq %rdi, %r13
movq %r15, %rdi
callq 0x181a0
testl %eax, %eax
je 0x109a37
cmpl $0x2, %r12d
je 0x109a97
leaq 0x8(%rsp), %r13
movl $0x90, %edx
movq %r13, %rdi
xorl %esi, %esi
callq 0x18140
movq %r15, %rdi
movq %r13, %rsi
callq 0x180c0
movl %r12d, %ecx
xorl $0x1, %ecx
orl %eax, %ecx
jne 0x109a79
leaq 0x428e3(%rip), %rsi     # 0x14c318
jmp 0x109a5a
leaq 0x428aa(%rip), %rsi     # 0x14c2e8
movq %r13, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0xe9df7
movq %r13, %rdi
callq 0xea084
leaq 0x3b176(%rip), %rsi     # 0x144bd0
movq %r14, %rdi
movq %rbx, %rdx
callq 0xe8ded
xorl %eax, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
orl %r12d, %eax
jne 0x109a97
movl $0xf000, %eax           # imm = 0xF000
andl 0x20(%rsp), %eax
cmpl $0xa000, %eax           # imm = 0xA000
jne 0x109a97
leaq 0x4289e(%rip), %rsi     # 0x14c333
jmp 0x109a5a
testb $0x1, %bpl
leaq 0x428aa(%rip), %rax     # 0x14c34c
leaq 0x35110(%rip), %rsi     # 0x13ebb9
cmoveq %rax, %rsi
movq %r15, %rdi
movq %r14, %rdx
movq %rbx, %rcx
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x109983
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-unix.c
// Function: de_update_file_attribs
void de_update_file_attribs(dbuf *f, u8 preserve_file_times)
{
	struct upd_attr_ctx uactx;

	de_zeromem(&uactx, sizeof(struct upd_attr_ctx));

	update_file_perms(&uactx, f);
	if(preserve_file_times) {
		update_file_time(&uactx, f);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xc0, %rsp
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x28(%rsp), %rdi
movl $0x98, %edx
xorl %esi, %esi
callq 0x18140
cmpl $0x2, (%rbx)
jne 0x109b8c
movq 0xd0(%rbx), %rax
testq %rax, %rax
je 0x109b8c
movq 0x68(%rbx), %rdi
testq %rdi, %rdi
je 0x109b8c
testb $0x3, 0x14(%rax)
je 0x109b8c
leaq 0x30(%rsp), %r14
movq %r14, %rsi
callq 0x180f0
movl %eax, -0x4(%r14)
movl $0x1, -0x8(%r14)
testl %eax, %eax
jne 0x109b8c
movl 0x48(%rsp), %edx
movl %edx, %eax
andl $-0x4a, %eax
movq 0xd0(%rbx), %rcx
movl 0x14(%rcx), %ecx
shll $0x1e, %ecx
sarl $0x1f, %ecx
movl %edx, %r14d
shrl $0x2, %r14d
andl %ecx, %r14d
andl $0x49, %r14d
orl %eax, %r14d
cmpl %edx, %r14d
je 0x109b8c
movq 0x8(%rbx), %rdi
leaq 0x427d9(%rip), %rsi     # 0x14c34f
movl %r14d, %ecx
xorl %eax, %eax
callq 0xe93cf
movq 0x68(%rbx), %rdi
movl %r14d, %esi
callq 0x18260
testb %bpl, %bpl
je 0x109c6f
cmpl $0x2, (%rbx)
jne 0x109c6f
movq 0xd0(%rbx), %r12
testq %r12, %r12
je 0x109c6f
cmpb $0x0, 0x18(%r12)
je 0x109c6f
movq 0x68(%rbx), %rdi
testq %rdi, %rdi
je 0x109c6f
leaq 0x18(%r12), %r14
cmpl $0x0, 0x28(%rsp)
jne 0x109bec
leaq 0x30(%rsp), %r15
movq %r15, %rsi
callq 0x180f0
movl %eax, -0x4(%r15)
movl $0x1, -0x8(%r15)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, (%rsp)
movq %r14, %rdi
callq 0xeb296
movq %rax, 0x10(%rsp)
cmpb $0x1f, 0x1a(%r12)
jb 0x109c35
movq %r14, %rdi
callq 0xeadb6
movabsq $0x6666666666666667, %rcx # imm = 0x6666666666666667
imulq %rcx
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x2, %rdx
addq %rax, %rdx
movq %rdx, 0x18(%rsp)
cmpl $0x0, 0x28(%rsp)
je 0x109c57
cmpl $0x0, 0x2c(%rsp)
jne 0x109c57
movq 0x78(%rsp), %rax
movq %rax, (%rsp)
movq $0x0, 0x8(%rsp)
jmp 0x109c63
leaq 0x10(%rsp), %rax
movaps (%rax), %xmm0
movaps %xmm0, -0x10(%rax)
movq 0x68(%rbx), %rdi
movq %rsp, %rsi
callq 0x18180
addq $0xc0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq