LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/emf.c
// Function: emf_handler_53
static int emf_handler_53(deark *c, lctx *d, struct decoder_params *dp)
{
	i64 pos = dp->recpos;

	pos += 8; // type, size
	pos += 16; // bounds
	pos += 12; // iGraphicsMode, exScale, eyScale
	do_emf_aEmrText(c, d, dp->recpos, pos, dp->recpos+dp->recsize_bytes - pos);
	return 1;
}

// Assembly:
pushq %rax
movq 0x8(%rdx), %rax
movq 0x10(%rdx), %rcx
leaq 0x24(%rax), %rdx
addq $-0x24, %rcx
movl (%rsi), %r9d
movl $0x1, %r8d
movq %rax, %rsi
callq 0x4315e
movl $0x1, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/emf.c
// Function: emf_handler_54
static int emf_handler_54(deark *c, lctx *d, struct decoder_params *dp)
{
	i64 pos = dp->recpos;

	pos += 8; // type, size
	pos += 16; // bounds
	pos += 12; // iGraphicsMode, exScale, eyScale
	do_emf_wEmrText(c, d, dp->recpos, pos, dp->recpos+dp->recsize_bytes - pos);
	return 1;
}

// Assembly:
pushq %rax
movq 0x8(%rdx), %rsi
movq 0x10(%rdx), %rcx
leaq 0x24(%rsi), %rdx
addq $-0x24, %rcx
movl $0x2, %r8d
movl $0x3, %r9d
callq 0x4315e
movl $0x1, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/emf.c
// Function: do_dbg_colorref
static void do_dbg_colorref(deark *c, lctx *d, u32 colorref)
{
	u32 clr;
	char csamp[16];

	clr = colorref_to_color(colorref);
	de_get_colorsample_code(c, clr, csamp, sizeof(csamp));
	de_dbg(c, "colorref: 0x%08x%s", (UI)colorref, csamp);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %esi, %ebx
movq %rdi, %r14
movl %esi, %eax
andl $0xff00, %eax           # imm = 0xFF00
movl %esi, %ecx
shrl $0x10, %ecx
movzbl %cl, %ecx
shll $0x10, %esi
orl %eax, %esi
orl %ecx, %esi
orl $0xff000000, %esi       # imm = 0xFF000000
movq %rsp, %r15
movl $0x10, %ecx
movq %r15, %rdx
callq 0xe903b
leaq 0xd8a17(%rip), %rsi     # 0x11b85b
movq %r14, %rdi
movl %ebx, %edx
movq %r15, %rcx
xorl %eax, %eax
callq 0xe8617
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/emf.c
// Function: read_object_index_p
static void read_object_index_p(deark *c, lctx *d, i64 *ppos)
{
	UI n;
	n = (UI)de_getu32le_p(ppos);
	if(n & 0x80000000U) {
		// A stock object
		de_dbg(c, "object index: 0x%08x (%s)", n, get_stock_obj_name(n));
	}
	else {
		de_dbg(c, "object index: %u", n);
	}
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
callq 0xeed83
testl %eax, %eax
js 0x42e82
leaq 0xfe348(%rip), %rsi     # 0x1411bd
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
popq %rbx
jmp 0xe8617
movl %eax, %ecx
andl $0x7ffffffc, %ecx       # imm = 0x7FFFFFFC
cmpl $0x13, %ecx
ja 0x42ea4
movl %eax, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
leaq 0x13e2c2(%rip), %rdx    # 0x181160
movq (%rdx,%rcx,8), %rdx
jmp 0x42ea6
xorl %edx, %edx
testq %rdx, %rdx
leaq 0xe92a1(%rip), %rcx     # 0x12c151
cmovneq %rdx, %rcx
leaq 0xd89b3(%rip), %rsi     # 0x11b86e
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
popq %rbx
jmp 0xe8617
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/emf.c
// Function: do_LogFont
static void do_LogFont(deark *c, lctx *d, struct decoder_params *dp, i64 pos1, i64 len)
{
	de_ucstring *facename = NULL;
	i64 pos = pos1;
	i64 n, n2;
	u8 b;

	if(len<92) goto done;

	n = de_geti32le_p(&pos);
	n2 = de_geti32le_p(&pos);
	de_dbg(c, "height,width: %d,%d", (int)n, (int)n2);
	pos += 15;
	b = de_getbyte_p(&pos);
	de_dbg(c, "charset: 0x%02x (%s)", (UI)b,
		fmtutil_get_windows_charset_name(b));

	pos += 4;
	facename = ucstring_create(c);
	dbuf_read_to_ucstring(c->infile, pos, 32*2, facename, 0, DE_ENCODING_UTF16LE);
	ucstring_truncate_at_NUL(facename);
	de_dbg(c, "facename: \"%s\"", ucstring_getpsz_d(facename));

done:
	ucstring_destroy(facename);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, (%rsp)
cmpq $0x5c, %rdx
jge 0x43094
xorl %r15d, %r15d
jmp 0x4314b
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
movq %rsp, %r14
movq %r14, %rsi
callq 0xeee2f
movq %rax, %r15
movq 0x18(%rbx), %rdi
movq %r14, %rsi
callq 0xeee2f
leaq 0xd8e12(%rip), %rsi     # 0x11bece
movq %rbx, %rdi
movl %r15d, %edx
movl %eax, %ecx
xorl %eax, %eax
callq 0xe8617
addq $0xf, (%r14)
movq 0x18(%rbx), %rdi
movq %r14, %rsi
callq 0xeeb4b
movzbl %al, %ebp
movl %ebp, %edi
callq 0xf8e88
leaq 0xd8df6(%rip), %rsi     # 0x11bee2
movq %rbx, %rdi
movl %ebp, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0xe8617
addq $0x4, (%r14)
movq %rbx, %rdi
callq 0xf6410
movq %rax, %r15
movq 0x18(%rbx), %rdi
movq (%r14), %rsi
movl $0x40, %edx
movq %rax, %rcx
xorl %r8d, %r8d
movl $0x3, %r9d
callq 0xefbd7
movq %r15, %rdi
callq 0xf6461
movq %r15, %rdi
callq 0xf70f6
leaq 0xd8db9(%rip), %rsi     # 0x11bef7
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
movq %r15, %rdi
callq 0xf6753
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/emf.c
// Function: do_emf_xEmrText
static void do_emf_xEmrText(deark *c, lctx *d, i64 recpos, i64 pos1, i64 len,
	i64 bytesperchar, de_encoding encoding)
{
	i64 pos = pos1;
	i64 nchars;
	i64 offstring;
	de_ucstring *s = NULL;

	pos += 8; // Reference
	nchars = de_getu32le(pos);
	pos += 4;
	offstring = de_getu32le(pos);
	if(recpos+offstring+nchars*bytesperchar > pos1+len) goto done;
	s = ucstring_create(c);
	dbuf_read_to_ucstring_n(c->infile, recpos+offstring, nchars*bytesperchar,
		DE_DBG_MAX_STRLEN*bytesperchar, s, 0, encoding);
	ucstring_strip_trailing_NUL(s);
	de_dbg(c, "text: \"%s\"", ucstring_getpsz(s));

done:
	ucstring_destroy(s);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r9d, 0xc(%rsp)
movq %r8, 0x10(%rsp)
movq %rcx, %r14
movq %rdx, %rbp
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x8(%rdx), %rsi
movq 0x18(%rdi), %rdi
callq 0xeed61
movq %rax, %r12
leaq 0xc(%rbp), %rsi
movq 0x18(%rbx), %rdi
callq 0xeed61
movq %rax, %r13
addq %r15, %r13
movq 0x10(%rsp), %r15
imulq %r15, %r12
leaq (%r12,%r13), %rax
addq %rbp, %r14
cmpq %r14, %rax
jle 0x431bf
xorl %r14d, %r14d
jmp 0x43211
movq %rbx, %rdi
callq 0xf6410
movq %rax, %r14
movq 0x18(%rbx), %rdi
imulq $0x1f4, %r15, %rcx      # imm = 0x1F4
movl 0xc(%rsp), %eax
movl %eax, (%rsp)
movq %r13, %rsi
movq %r12, %rdx
movq %r14, %r8
xorl %r9d, %r9d
callq 0xefc2a
movq %r14, %rdi
callq 0xf6483
movq %r14, %rdi
callq 0xf705c
leaq 0xf7ea0(%rip), %rsi     # 0x13b0a4
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
movq %r14, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xf6753
nop
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/epocimage.c
// Function: de_module_epocimage
void de_module_epocimage(deark *c, struct deark_module_info *mi)
{
	mi->id = "epocimage";
	mi->desc = "EPOC/Symbian MBM, Sketch, AIF";
	mi->run_fn = de_run_epocimage;
	mi->identify_fn = de_identify_epocimage;
}

// Assembly:
leaq 0xd8ea5(%rip), %rax     # 0x11c0d4
movq %rax, (%rsi)
leaq 0xd8ea5(%rip), %rax     # 0x11c0de
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x43254
movq %rax, 0x18(%rsi)
leaq 0x759(%rip), %rax       # 0x439a8
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/epocimage.c
// Function: de_identify_epocimage_internal
static int de_identify_epocimage_internal(deark *c)
{
	u8 b[12];
	de_read(b, 0, 12);

	if(!de_memcmp(b, "\x37\x00\x00\x10\x42\x00\x00\x10", 8)) {
		return DE_PFMT_MBM; // EPOC MBM
	}
	if(!de_memcmp(b, "\x37\x00\x00\x10\x8a\x00\x00\x10", 8)) {
		return DE_PFMT_EXPORTED_MBM; // EPOC exported MBM
	}
	if(!de_memcmp(b, "\x37\x00\x00\x10\x6D\x00\x00\x10\x7D\x00\x00\x10", 12)) {
		return DE_PFMT_SKETCH; // EPOC Sketch
	}
	if(!de_memcmp(b, "\x37\x00\x00\x10\x6a\x00\x00\x10", 8)) {
		return DE_PFMT_AIF; // EPOC AIF
	}
	if(!de_memcmp(b, "\x37\x00\x00\x10\x38\x3a\x00\x10", 8)) {
		return DE_PFMT_AIF;
	}
	//if(!de_memcmp(b, "\x32\xb0\x1f\x10\x00\x00\x00\x00", 8)) {
	//	return DE_PFMT_?;
	//}
	return 0;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
leaq 0x4(%rsp), %rbx
movl $0xc, %ecx
movq %rbx, %rsi
xorl %edx, %edx
callq 0xee8d4
movabsq $0x1000004210000037, %rax # imm = 0x1000004210000037
cmpq %rax, (%rbx)
je 0x43a40
movabsq $0x1000008a10000037, %rax # imm = 0x1000008A10000037
cmpq %rax, 0x4(%rsp)
je 0x43a47
movabsq $0x1000006d10000037, %rax # imm = 0x1000006D10000037
xorq 0x4(%rsp), %rax
movl 0xc(%rsp), %ecx
xorq $0x1000007d, %rcx       # imm = 0x1000007D
orq %rax, %rcx
je 0x43a4e
movabsq $0x1000006a10000037, %rax # imm = 0x1000006A10000037
cmpq %rax, 0x4(%rsp)
je 0x43a55
movabsq $0x10003a3810000037, %rcx # imm = 0x10003A3810000037
xorl %eax, %eax
cmpq %rcx, 0x4(%rsp)
sete %al
shll $0x2, %eax
jmp 0x43a5a
movl $0x1, %eax
jmp 0x43a5a
movl $0x2, %eax
jmp 0x43a5a
movl $0x3, %eax
jmp 0x43a5a
movl $0x4, %eax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/epocimage.c
// Function: do_read_and_write_paint_data_section
static void do_read_and_write_paint_data_section(deark *c, lctx *d, i64 pos1)
{
	struct phys_image_ctx *pi = NULL;

	pi = de_malloc(c, sizeof(struct phys_image_ctx));
	pi->is_mask = 0;
	do_read_paint_data_section(c, d, pi, pos1);
	if(pi->img) {
		de_bitmap_write_to_file(pi->img, NULL, 0);
	}
	d->last_paint_data_section_size = pi->paint_data_section_size;
	destroy_phys_image(c, pi);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %rbx
movl $0x440, %esi            # imm = 0x440
callq 0xe8b2b
movq %rax, %r15
movl $0x0, 0x20(%rax)
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
movq %r12, %rcx
callq 0x43c10
movq 0x30(%r15), %rdi
testq %rdi, %rdi
je 0x43bf2
xorl %esi, %esi
xorl %edx, %edx
callq 0xf22dc
movq 0x38(%r15), %rax
movq %rax, 0x8(%r14)
movq %rbx, %rdi
movq %r15, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x4431f
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/epocimage.c
// Function: destroy_phys_image
static void destroy_phys_image(deark *c, struct phys_image_ctx *pi)
{
	if(!pi) return;
	if(pi->img) {
		de_bitmap_destroy(pi->img);
	}
	de_free(c, pi);
}

// Assembly:
testq %rsi, %rsi
je 0x4434e
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x30(%rsi), %rdi
testq %rdi, %rdi
je 0x4433c
callq 0xf228d
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xe8be2
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/epocimage.c
// Function: do_rle16_24
static void do_rle16_24(deark *c, lctx *d, dbuf *unc_pixels,
	i64 pos1, i64 len, i64 bytes_per_pixel)
{
	i64 i;
	i64 k;
	u8 b0;
	i64 pos;
	i64 count;
	u8 v[3];

	pos = pos1;
	while(pos<pos1+len) {
		b0 = de_getbyte(pos);
		pos++;

		if(b0<=0x7f) {
			// Next pixel should be repeated b0+1 times.
			count = 1+(i64)b0;
			for(k=0; k<bytes_per_pixel; k++) {
				v[k] = de_getbyte(pos++);
			}
			for(i=0; i<count; i++) {
				dbuf_write(unc_pixels, v, bytes_per_pixel);
			}
		}
		else {
			// 256-b0 pixels of uncompressed data.
			count = 256-(i64)b0;
			dbuf_copy(c->infile, pos, count*bytes_per_pixel, unc_pixels);
			pos += count*bytes_per_pixel;
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, 0x10(%rsp)
testq %rcx, %rcx
jle 0x4440c
movq %r8, %rbx
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
addq %rdx, 0x10(%rsp)
leaq 0xd(%rsp), %rbp
movq 0x18(%r13), %rdi
movq %r15, %rsi
callq 0xeead3
incq %r15
testb %al, %al
js 0x443dc
testq %rbx, %rbx
jle 0x443c1
movb %al, 0xc(%rsp)
xorl %r14d, %r14d
leaq (%r15,%r14), %rsi
movq 0x18(%r13), %rdi
callq 0xeead3
movb %al, 0xd(%rsp,%r14)
incq %r14
cmpq %r14, %rbx
jne 0x443a0
addq %r14, %r15
movb 0xc(%rsp), %al
incb %al
movzbl %al, %r14d
movq %r12, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
callq 0xef547
decq %r14
jne 0x443c7
jmp 0x44401
movzbl %al, %eax
movl $0x100, %r14d           # imm = 0x100
subq %rax, %r14
movq 0x18(%r13), %rdi
imulq %rbx, %r14
movq %r15, %rsi
movq %r14, %rdx
movq %r12, %rcx
callq 0xef481
addq %r14, %r15
cmpq 0x10(%rsp), %r15
jl 0x44381
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/eps.c
// Function: de_module_eps
void de_module_eps(deark *c, struct deark_module_info *mi)
{
	mi->id = "eps";
	mi->desc = "Encapsulated PostScript";
	mi->desc2 = "extract preview image";
	mi->run_fn = de_run_eps;
	mi->identify_fn = de_identify_eps;
}

// Assembly:
leaq 0xd80c3(%rip), %rax     # 0x11c4e6
movq %rax, (%rsi)
leaq 0xd80bd(%rip), %rax     # 0x11c4ea
movq %rax, 0x8(%rsi)
leaq 0xd80ca(%rip), %rax     # 0x11c502
movq %rax, 0x10(%rsi)
leaq 0x10(%rip), %rax        # 0x44453
movq %rax, 0x18(%rsi)
leaq 0x51f(%rip), %rax       # 0x4496d
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/eps.c
// Function: de_identify_eps
static int de_identify_eps(deark *c)
{
	u8 b[20];
	de_read(b, 0, (i64)sizeof(b));

	if(b[0]==0xc5 && b[1]==0xd0 && b[2]==0xd3 && b[3]==0xc6)
		return 100;

	if(!de_memcmp(b, "%!PS-Adobe-", 11) &&
		!de_memcmp(&b[14], " EPSF-", 6) )
	{
		return 100;
	}

	return 0;
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movq 0x18(%rdi), %rdi
movq %rsp, %rbx
movl $0x14, %ecx
movq %rbx, %rsi
xorl %edx, %edx
callq 0xee8d4
movdqa (%rbx), %xmm0
movd %xmm0, %ecx
movl $0x64, %eax
cmpl $0xc6d3d0c5, %ecx       # imm = 0xC6D3D0C5
je 0x449d9
movabsq $0x6f64412d53502125, %rcx # imm = 0x6F64412D53502125
xorq (%rsp), %rcx
movabsq $0x2d65626f64412d53, %rdx # imm = 0x2D65626F64412D53
xorq 0x3(%rsp), %rdx
orq %rcx, %rdx
jne 0x449d7
movl $0x53504520, %ecx       # imm = 0x53504520
xorl 0xe(%rsp), %ecx
movzwl 0x12(%rsp), %edx
xorl $0x2d46, %edx           # imm = 0x2D46
orl %ecx, %edx
je 0x449d9
xorl %eax, %eax
addq $0x20, %rsp
popq %rbx
retq
nop
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/exe.c
// Function: de_module_exe
void de_module_exe(deark *c, struct deark_module_info *mi)
{
	mi->id = "exe";
	mi->desc = "EXE executable (PE, NE, etc.)";
	mi->run_fn = de_run_exe;
	mi->identify_fn = de_identify_exe;
	mi->help_fn = de_help_exe;
}

// Assembly:
leaq 0xdef4e(%rip), %rax     # 0x123935
movq %rax, (%rsi)
leaq 0xd7cc3(%rip), %rax     # 0x11c6b4
movq %rax, 0x8(%rsi)
leaq 0x1b(%rip), %rax        # 0x44a17
movq %rax, 0x18(%rsi)
leaq 0x204e(%rip), %rax      # 0x46a55
movq %rax, 0x20(%rsi)
leaq 0x20c7(%rip), %rax      # 0x46ad9
movq %rax, 0x28(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/exe.c
// Function: de_identify_exe
static int de_identify_exe(deark *c)
{
	UI sig;
	UI lfb;
	int exe_ext;
	u8 sigMZ;

	sig = (UI)de_getu16be(0);
	if(sig==0x4d5aU) { sigMZ = 1; }
	else if(sig==0x5a4d) { sigMZ = 0; }
	else { return 0; }
	lfb = (UI)de_getu16le(2); // lenFinal

	exe_ext = de_input_file_has_ext(c, "exe");
	if(lfb>511) {
		return exe_ext ? 15 : 0;
	}
	if(exe_ext) return 80;
	return sigMZ ? 80 : 50;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
movq 0x18(%rdi), %rdi
xorl %r15d, %r15d
xorl %esi, %esi
callq 0xeeb67
movq %rax, %rbx
cmpl $0x5a4d, %ebx           # imm = 0x5A4D
je 0x46a7e
cmpl $0x4d5a, %ebx           # imm = 0x4D5A
jne 0x46ad0
movq 0x18(%r14), %rdi
movl $0x2, %esi
callq 0xeebc8
movq %rax, %r15
leaq 0xdce9f(%rip), %rsi     # 0x123935
movq %r14, %rdi
callq 0xea491
testl $0xfffffe00, %r15d      # imm = 0xFFFFFE00
je 0x46ab5
testl %eax, %eax
movl $0xf, %r15d
cmovel %eax, %r15d
jmp 0x46ad0
cmpl $0x4d5a, %ebx           # imm = 0x4D5A
movl $0x50, %ecx
movl $0x32, %r15d
cmovel %ecx, %r15d
testl %eax, %eax
cmovnel %ecx, %r15d
movl %r15d, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/exe.c
// Function: do_execomp
static void do_execomp(deark *c, lctx *d)
{
	struct fmtutil_specialexe_detection_data edd;

	if(d->execomp_mode!=1) {
		if(d->sfx_only_mode) return;
		if((!c->show_infomessages) && (c->debug_level<1)) return;
	}

	if(!d->ei) {
		d->ei = de_malloc(c, sizeof(struct fmtutil_exe_info));
		fmtutil_collect_exe_info(c, c->infile, d->ei);
	}

	de_zeromem(&edd, sizeof(struct fmtutil_specialexe_detection_data));
	edd.flags_in |= 0x1;
	fmtutil_detect_execomp(c, d->ei, &edd);
	if(!edd.detected_fmt) return;
	de_dbg(c, "detected executable compression: %s", edd.detected_fmt_name);

	if(d->execomp_mode==1) {
		try_execomp_decompress(c, d, &edd);
	}
	else if(d->execomp_mode!=0) {
		if(edd.modname) {
			de_info(c, "Note: File seems to be compressed with %s. Use \"-m %s\" "
				"or \"-opt execomp\" to attempt decompression.",
				edd.detected_fmt_name, edd.modname);
		}
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x80, %rsp
movq %rsi, %r14
movq %rdi, %rbx
cmpb $0x1, 0x2(%rsi)
jne 0x46c26
movq 0x8(%r14), %rsi
testq %rsi, %rsi
jne 0x46b57
movl $0xf0, %esi
movq %rbx, %rdi
callq 0xe8b2b
movq %rax, 0x8(%r14)
movq 0x18(%rbx), %rsi
movq %rbx, %rdi
movq %rax, %rdx
callq 0x104f96
movq 0x8(%r14), %rsi
xorps %xmm0, %xmm0
movq %rsp, %r15
movaps %xmm0, (%r15)
movaps %xmm0, 0x60(%r15)
movaps %xmm0, 0x50(%r15)
movaps %xmm0, 0x40(%r15)
movaps %xmm0, 0x30(%r15)
movaps %xmm0, 0x20(%r15)
movaps %xmm0, 0x10(%r15)
movq $0x0, 0x70(%r15)
movl $0x1, 0x8(%r15)
movq %rbx, %rdi
movq %r15, %rdx
callq 0x105185
cmpb $0x0, 0x1(%r15)
je 0x46c86
leaq 0x50(%rsp), %r15
leaq 0xd64ae(%rip), %rsi     # 0x11d05f
movq %rbx, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0xe8617
movb 0x2(%r14), %al
cmpb $0x1, %al
jne 0x46c45
cmpb $0x0, 0x1(%rsp)
je 0x46c86
movq 0x48(%rsp), %rdx
testq %rdx, %rdx
je 0x46c72
leaq 0xd654e(%rip), %rsi     # 0x11d134
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movq 0x48(%rsp), %rsi
movq 0x18(%rbx), %rcx
movq 0x18(%rcx), %r9
movq %rbx, %rdi
xorl %edx, %edx
xorl %r8d, %r8d
callq 0xe9b13
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
jmp 0x46c86
cmpb $0x0, 0x3(%r14)
jne 0x46c86
cmpl $0x0, 0xc0(%rbx)
jne 0x46b2a
cmpl $0x0, (%rbx)
jg 0x46b2a
jmp 0x46c86
testb %al, %al
setne %al
movq 0x48(%rsp), %rcx
testq %rcx, %rcx
setne %dl
andb %al, %dl
cmpb $0x1, %dl
jne 0x46c86
leaq 0xd6420(%rip), %rsi     # 0x11d083
movq %rbx, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0xe9393
jmp 0x46c86
leaq 0xd646d(%rip), %rsi     # 0x11d0e6
movq %rbx, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0xe9393
addq $0x80, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/exe.c
// Function: do_extract_CURSOR
static void do_extract_CURSOR(deark *c, lctx *d, i64 pos, i64 len, de_finfo *fi)
{
	UI firstword;
	i64 hotspot_x, hotspot_y;

	if(len<8) return;
	firstword = (UI)de_getu16le(pos);

	// For Win3 icons, the first word is the x hotspot.
	// For Win1 icons, it is one of the type codes below.
	if(d->fmt==EXE_FMT_NE && (firstword==0x0003 || firstword==0x0103 ||
		firstword==0x0203))
	{
		UI fourthword;
		// For Win3 icons, the 4th word is the high word of the
		// bitmap-info-header-size (definitely 0).
		// For Win1 icons, it is the width (definitely not 0).
		fourthword = (UI)de_getu16le(pos+6);
		if(fourthword!=0) {
			dbuf_create_file_from_slice(c->infile, pos, len, "win1.cur", fi, 0);
			return;
		}
	}

	hotspot_x = (i64)firstword;
	hotspot_y = de_getu16le(pos+2);
	de_dbg(c, "hotspot: %d,%d", (int)hotspot_x, (int)hotspot_y);
	do_extract_ico_cur(c, d, pos+4, len-4, 1, hotspot_x, hotspot_y, fi);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
cmpq $0x8, %rcx
jl 0x47616
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %rbp
movq %rdi, %r12
movq 0x18(%rdi), %rdi
movq %rdx, %rsi
callq 0xeebc8
movq %rax, %r13
cmpb $0x2, (%rbp)
jne 0x475c0
cmpl $0x3, %r13d
je 0x47583
cmpl $0x203, %r13d           # imm = 0x203
je 0x47583
cmpl $0x103, %r13d           # imm = 0x103
jne 0x475c0
movq 0x18(%r12), %rdi
leaq 0x6(%r15), %rsi
callq 0xeebc8
testl %eax, %eax
je 0x475c0
movq 0x18(%r12), %rdi
leaq 0xd5ded(%rip), %rcx     # 0x11d38e
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %r8
xorl %r9d, %r9d
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xefd48
movl %r13d, %eax
movq %rax, 0x10(%rsp)
movq 0x18(%r12), %rdi
leaq 0x2(%r15), %rsi
callq 0xeebc8
movq %rax, %rbp
leaq 0xd5db7(%rip), %rsi     # 0x11d397
movq %r12, %rdi
movl %r13d, %edx
movl %ebp, %ecx
xorl %eax, %eax
callq 0xe8617
addq $0x4, %r15
addq $-0x4, %r14
movq %rbx, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movl $0x1, %ecx
movq 0x10(%rsp), %r8
movq %rbp, %r9
callq 0x47937
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/exe.c
// Function: do_extract_BITMAP
static void do_extract_BITMAP(deark *c, lctx *d, i64 pos, i64 len, de_finfo *fi)
{
	if(len<12) return;

	if((d->fmt==EXE_FMT_NE) && (de_getbyte(pos)==0x02)) {
		do_decode_ddb(c, d, pos, len, fi);
		return;
	}

	de_dbg(c, "BITMAP at %"I64_FMT, pos);
	de_dbg_indent(c, 1);
	de_run_module_by_id_on_slice2(c, "dib", "X", c->infile, pos, len);
	de_dbg_indent(c, -1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
cmpq $0xc, %rcx
jge 0x4763e
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rcx, %r14
movq %rdx, %r15
movq %rdi, %rbx
cmpb $0x2, (%rsi)
jne 0x476d5
movq %r8, %r12
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xeead3
cmpb $0x2, %al
jne 0x476d5
leaq 0xd5d4a(%rip), %rsi     # 0x11d3b4
movq %rbx, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movl $0x70, %esi
movq %rbx, %rdi
callq 0xe8b2b
movq %rax, %r13
movq %r12, 0x28(%rax)
movq 0x18(%rbx), %rcx
leaq 0xdbd2a(%rip), %rsi     # 0x1233cd
movq %rbx, %rdi
movq %rax, %rdx
movq %r15, %r8
movq %r14, %r9
callq 0xe9aa3
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
movq %rbx, %rdi
movq %r13, %rsi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xe8be2
leaq 0xd5cca(%rip), %rsi     # 0x11d3a6
movq %rbx, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movq 0x18(%rbx), %rcx
leaq 0xdbd0e(%rip), %rsi     # 0x12340f
leaq 0xfc334(%rip), %rdx     # 0x143a3c
movq %rbx, %rdi
movq %r15, %r8
movq %r14, %r9
callq 0xe9b13
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xe8a15
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/exe.c
// Function: do_extract_ICON
static void do_extract_ICON(deark *c, lctx *d, i64 pos, i64 len, de_finfo *fi)
{
	if(d->fmt==EXE_FMT_NE && len>14) {
		UI firstword;

		firstword = (UI)de_getu16le(pos);
		// For Win3 icons, the first word is the low word of bitmap-info-header-size
		// (usually 40, definitely not one of the Win1 type codes).
		// For Win1 icons, it is one of the type codes below.
		if(firstword==0x0001 || firstword==0x0101 || firstword==0x0201) {
			dbuf_create_file_from_slice(c->infile, pos, len, "win1.ico", fi, 0);
			return;
		}
	}

	do_extract_ico_cur(c, d, pos, len, 0, 0, 0, fi);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %r8, %r15
movq %rcx, %rbx
movq %rdx, %r14
movq %rdi, %r12
cmpq $0xf, %rcx
jl 0x477ad
cmpb $0x2, (%rsi)
jne 0x477ad
movq 0x18(%r12), %rdi
movq %r14, %rsi
callq 0xeebc8
movq %rax, %r13
cmpl $0x1, %r13d
je 0x47778
cmpl $0x201, %r13d           # imm = 0x201
je 0x47778
cmpl $0x101, %r13d           # imm = 0x101
jne 0x477ad
movq 0x18(%r12), %rdi
leaq 0xd5c40(%rip), %rcx     # 0x11d3c4
movq %r14, %rsi
movq %rbx, %rdx
movq %r15, %r8
xorl %r9d, %r9d
callq 0xefd48
cmpl $0x1, %r13d
je 0x477c7
cmpl $0x101, %r13d           # imm = 0x101
je 0x477c7
cmpl $0x201, %r13d           # imm = 0x201
je 0x477c7
movq %r15, (%rsp)
movq %r12, %rdi
movq %r14, %rsi
movq %rbx, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x47937
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/exe.c
// Function: do_extract_FONT
static void do_extract_FONT(deark *c, lctx *d, i64 pos, i64 len, de_finfo *fi)
{
	i64 fntlen;

	if(len<6) return;
	// The "file size" is stored at offset 2. Respect it if possible.
	fntlen = de_getu32le(pos+2);
	if(fntlen<6 || fntlen>len) {
		fntlen = len;
	}

	get_font_facename(c, d, pos, fntlen, fi);

	dbuf_create_file_from_slice(c->infile, pos, fntlen, "fnt", fi, 0);
}

// Assembly:
cmpq $0x6, %rcx
jge 0x477dc
retq
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %rbx
movq %rcx, %r13
movq %rdx, %r14
movq %rdi, %r15
movq 0x18(%rdi), %rdi
leaq 0x2(%rdx), %rsi
callq 0xeed61
cmpq %r13, %rax
movq %r13, %r12
cmovlq %rax, %r12
cmpq $0x6, %rax
cmovlq %r13, %r12
xorl %r13d, %r13d
testq %rbx, %rbx
je 0x478dc
cmpq $0x6d, %r12
jl 0x478dc
movq 0x18(%r15), %rdi
movq %r14, %rsi
callq 0xeebc8
testl $0xfffffe00, %eax       # imm = 0xFFFFFE00
je 0x478d9
movq 0x18(%r15), %rdi
leaq 0x44(%r14), %rsi
callq 0xeebc8
movq %rax, %r13
movq 0x18(%r15), %rdi
leaq 0x69(%r14), %rsi
callq 0xeed61
movq %r12, %rbp
subq %rax, %rbp
jle 0x478d9
movq %r13, 0x8(%rsp)
movq %r15, %rdi
movq %rax, 0x10(%rsp)
callq 0xf6410
movq %rax, %r13
movq 0x18(%r15), %rdi
movq 0x10(%rsp), %rsi
addq %r14, %rsi
movl $0x1, (%rsp)
movl $0x40, %edx
movq %rbp, %rcx
movq %rax, %r8
movl $0x1, %r9d
callq 0xefc2a
cmpq $0x0, 0x10(%r13)
jle 0x478dc
leaq 0xd5b1e(%rip), %rdx     # 0x11d3d1
movq %r13, %rdi
movl $0x5, %esi
movq 0x8(%rsp), %rcx
xorl %eax, %eax
callq 0xf6653
movq %r15, %rdi
movq %rbx, %rsi
movq %r13, %rdx
xorl %ecx, %ecx
callq 0xea53f
jmp 0x478dc
xorl %r13d, %r13d
movq %r13, %rdi
callq 0xf6753
movq 0x18(%r15), %rdi
leaq 0xd5ade(%rip), %rcx     # 0x11d3cd
movq %r14, %rsi
movq %r12, %rdx
movq %rbx, %r8
xorl %r9d, %r9d
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xefd48
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/exepack.c
// Function: de_module_exepack
void de_module_exepack(deark *c, struct deark_module_info *mi)
{
	mi->id = "exepack";
	mi->desc = "EXEPACK-compressed EXE";
	mi->run_fn = de_run_exepack;
	mi->help_fn = de_help_exepack;
}

// Assembly:
leaq 0xd5f61(%rip), %rax     # 0x11da84
movq %rax, (%rsi)
leaq 0xd5f5f(%rip), %rax     # 0x11da8c
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x47b48
movq %rax, 0x18(%rsi)
leaq 0x6de(%rip), %rax       # 0x48221
movq %rax, 0x28(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/dms.c
// Function: de_module_amiga_dms
void de_module_amiga_dms(deark *c, struct deark_module_info *mi)
{
	mi->id = "amiga_dms";
	mi->desc = "Amiga DMS disk image";
	mi->run_fn = de_run_amiga_dms;
	mi->identify_fn = de_identify_amiga_dms;
}

// Assembly:
leaq 0xd57c9(%rip), %rax     # 0x11dd74
movq %rax, (%rsi)
leaq 0xd57c9(%rip), %rax     # 0x11dd7e
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x485d0
movq %rax, 0x18(%rsi)
leaq 0xf47(%rip), %rax       # 0x49512
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/dms.c
// Function: destroy_saved_dcrmpr_state
static void destroy_saved_dcrmpr_state(deark *c, struct dmsctx *d)
{
	if(d->saved_quick_state.saved_state) {
		destroy_std_cmpr_state(c, d->saved_quick_state.saved_state);
		d->saved_quick_state.saved_state = NULL;
	}
	if(d->saved_medium_state.saved_state) {
		destroy_std_cmpr_state(c, d->saved_medium_state.saved_state);
		d->saved_medium_state.saved_state = NULL;
	}
	if(d->saved_deep_cmpr_state.saved_state) {
		destroy_std_cmpr_state(c, d->saved_deep_cmpr_state.saved_state);
		d->saved_deep_cmpr_state.saved_state = NULL;
	}
	if(d->saved_heavy_state) {
		destroy_heavy_state(c, d->saved_heavy_state);
		d->saved_heavy_state = NULL;
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x12f0(%rsi), %rsi
testq %rsi, %rsi
je 0x4958a
movq %r14, %rdi
callq 0x49759
movq $0x0, 0x12f0(%rbx)
movq 0x12f8(%rbx), %rsi
testq %rsi, %rsi
je 0x495a9
movq %r14, %rdi
callq 0x49759
movq $0x0, 0x12f8(%rbx)
movq 0x1300(%rbx), %rsi
testq %rsi, %rsi
je 0x495c8
movq %r14, %rdi
callq 0x49759
movq $0x0, 0x1300(%rbx)
movq 0x1308(%rbx), %rsi
testq %rsi, %rsi
je 0x495e7
movq %r14, %rdi
callq 0x4a0d8
movq $0x0, 0x1308(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/dms.c
// Function: dmsrle_codec
static void dmsrle_codec(struct de_dfilter_ctx *dfctx, void *codec_private_params)
{
	struct dmsrle_ctx *rctx = NULL;

	rctx = de_malloc(dfctx->c, sizeof(struct dmsrle_ctx));
	rctx->state = DMSRLE_STATE_NEUTRAL;
	dfctx->codec_private = (void*)rctx;
	dfctx->codec_addbuf_fn = dmsrle_codec_addbuf;
	dfctx->codec_finish_fn = NULL;
	dfctx->codec_destroy_fn = dmsrle_codec_destroy;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
movl $0x8, %esi
callq 0xe8b2b
movl $0x0, (%rax)
movq %rax, 0x28(%rbx)
leaq 0x19(%rip), %rax        # 0x4962a
movq %rax, 0x30(%rbx)
movq $0x0, 0x40(%rbx)
leaq 0x116(%rip), %rax       # 0x4973a
movq %rax, 0x48(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/dms.c
// Function: dmsrle_codec_addbuf
static void dmsrle_codec_addbuf(struct de_dfilter_ctx *dfctx,
	const u8 *buf, i64 buf_len)
{
	i64 i;
	struct dmsrle_ctx *rctx = (struct dmsrle_ctx*)dfctx->codec_private;

	if(!rctx) goto done;

	for(i=0; i<buf_len; i++) {
		u8 n;
		i64 count;

		n = buf[i];

		switch(rctx->state) {
		case DMSRLE_STATE_NEUTRAL:
			if(n==0x90) {
				rctx->state = DMSRLE_STATE_90;
			}
			else {
				dbuf_writebyte(dfctx->dcmpro->f, n);
			}
			break;
		case DMSRLE_STATE_90:
			if(n==0x00) {
				dbuf_writebyte(dfctx->dcmpro->f, 0x90);
				rctx->state = DMSRLE_STATE_NEUTRAL;
			}
			else {
				rctx->n2 = n;
				rctx->state = DMSRLE_STATE_90_N2;
			}
			break;
		case DMSRLE_STATE_90_N2:
			if(rctx->n2==0xff) {
				rctx->n3 = n;
				rctx->state = DMSRLE_STATE_90_FF_N3;
			}
			else {
				count = (i64)rctx->n2;
				dbuf_write_run(dfctx->dcmpro->f, n, count);
				rctx->state = DMSRLE_STATE_NEUTRAL;
			}
			break;
		case DMSRLE_STATE_90_FF_N3:
			rctx->n4 = n;
			rctx->state = DMSRLE_STATE_90_FF_N3_N4;
			break;
		case DMSRLE_STATE_90_FF_N3_N4:
			count = (i64)(((UI)rctx->n4 << 8) | n);
			dbuf_write_run(dfctx->dcmpro->f, rctx->n3, count);
			rctx->state = DMSRLE_STATE_NEUTRAL;
			break;
		}
	}
done:
	;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x28(%rdi), %r12
testq %r12, %r12
sete %al
testq %rdx, %rdx
setle %cl
orb %al, %cl
jne 0x4972b
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
xorl %r13d, %r13d
leaq 0xd4700(%rip), %rbp     # 0x11dd60
movl (%r12), %ecx
cmpq $0x4, %rcx
ja 0x4970a
movb (%r14,%r13), %al
movzbl %al, %esi
movslq (%rbp,%rcx,4), %rcx
addq %rbp, %rcx
jmpq *%rcx
cmpb $-0x70, %al
jne 0x496ef
movl $0x1, (%r12)
jmp 0x4970a
movzbl 0x6(%r12), %edx
shll $0x8, %edx
orq %rsi, %rdx
movq 0x10(%r15), %rax
movq (%rax), %rdi
movzbl 0x5(%r12), %esi
jmp 0x496be
movzbl 0x4(%r12), %edx
cmpq $0xff, %rdx
je 0x496fd
movq 0x10(%r15), %rax
movq (%rax), %rdi
callq 0xf0eba
movl $0x0, (%r12)
jmp 0x4970a
movb %al, 0x6(%r12)
movl $0x4, (%r12)
jmp 0x4970a
testb %al, %al
je 0x49718
movb %al, 0x4(%r12)
movl $0x2, (%r12)
jmp 0x4970a
movq 0x10(%r15), %rax
movq (%rax), %rdi
callq 0xf0bd6
jmp 0x4970a
movb %al, 0x5(%r12)
movl $0x3, (%r12)
incq %r13
cmpq %r13, %rbx
jne 0x49660
jmp 0x4972b
movq 0x10(%r15), %rax
movq (%rax), %rdi
movl $0x90, %esi
callq 0xf0bd6
jmp 0x496c3
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/dms.c
// Function: dmsrle_codec_destroy
static void dmsrle_codec_destroy(struct de_dfilter_ctx *dfctx)
{
	struct dmsrle_ctx *rctx = (struct dmsrle_ctx*)dfctx->codec_private;

	if(rctx) {
		de_free(dfctx->c, rctx);
	}
	dfctx->codec_private = NULL;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x28(%rdi), %rsi
testq %rsi, %rsi
je 0x4974f
movq (%rbx), %rdi
callq 0xe8be2
movq $0x0, 0x28(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/dms.c
// Function: destroy_std_cmpr_state
static void destroy_std_cmpr_state(deark *c, struct dms_std_cmpr_state *cst)
{
	if(!cst) return;
	if(cst->dfctx_codec1) {
		de_dfilter_destroy(cst->dfctx_codec1);
	}
	if(cst->dfctx_rle) {
		de_dfilter_destroy(cst->dfctx_rle);
	}
	dbuf_close(cst->outf_codec1);
	de_free(c, cst);
}

// Assembly:
testq %rsi, %rsi
je 0x4979f
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x10(%rsi), %rdi
testq %rdi, %rdi
je 0x49776
callq 0xfa3d4
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x49784
callq 0xfa3d4
movq 0x28(%rbx), %rdi
callq 0xf052b
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xe8be2
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/dms.c
// Function: my_std1_write_cb
static void my_std1_write_cb(dbuf *f, void *userdata,
	const u8 *buf, i64 size)
{
	struct dms_std_cmpr_state *u = (struct dms_std_cmpr_state*)userdata;

	if(!u->dfctx_rle) {
		de_internal_err_fatal(f->c, "%s", u->cmpr_meth_name);
	}
	de_dfilter_addbuf(u->dfctx_rle, buf, size);
	u->intermediate_nbytes += size;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rax
movq 0x18(%rsi), %rdi
testq %rdi, %rdi
jne 0x497d4
movq 0x8(%rax), %rdi
movq 0x8(%r14), %rdx
leaq 0xcb596(%rip), %rsi     # 0x114d5f
xorl %eax, %eax
callq 0xe9544
movq 0x18(%r14), %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0xfa376
addq %rbx, 0x20(%r14)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/dms.c
// Function: dmsquicklz77_codec
static void dmsquicklz77_codec(struct de_dfilter_ctx *dfctx, void *codec_private_params)
{
	struct medium_ctx *mctx = NULL;

	mctx = de_malloc(dfctx->c, sizeof(struct medium_ctx));
	mctx->c = dfctx->c;
	mctx->modname = "dmsquick_lz77";
	mctx->dcmpro = dfctx->dcmpro;
	mctx->dres = dfctx->dres;

	dfctx->codec_private = (void*)mctx;
	dfctx->codec_addbuf_fn = quicklz77_codec_addbuf;
	dfctx->codec_command_fn = quicklz77_codec_command;
	dfctx->codec_destroy_fn = mediumlz77_codec_destroy;

	mctx->ringbuf = de_lz77buffer_create(dfctx->c, 256);
	de_lz77buffer_set_curpos(mctx->ringbuf, 251);

	mctx->ringbuf->userdata = (void*)mctx;
	mctx->ringbuf->writebyte_cb = medium_lz77buf_writebytecb;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
movl $0x78, %esi
callq 0xe8b2b
movq %rax, %r14
movq (%rbx), %rdi
movq %rdi, (%rax)
leaq 0xd4959(%rip), %rax     # 0x11e166
movq %rax, 0x8(%r14)
movdqu 0x8(%rbx), %xmm0
pshufd $0x4e, %xmm0, %xmm0     # xmm0 = xmm0[2,3,0,1]
movdqu %xmm0, 0x10(%r14)
movq %r14, 0x28(%rbx)
leaq 0xe1(%rip), %rax        # 0x4990d
movq %rax, 0x30(%rbx)
leaq 0x216(%rip), %rax       # 0x49a4d
movq %rax, 0x38(%rbx)
leaq 0x24f(%rip), %rax       # 0x49a91
movq %rax, 0x48(%rbx)
movl $0x100, %esi            # imm = 0x100
callq 0xfad8f
movq %rax, 0x30(%r14)
movq %rax, %rdi
movl $0xfb, %esi
callq 0xfb30d
movq 0x30(%r14), %rax
movq %r14, (%rax)
leaq 0x259(%rip), %rcx       # 0x49ac8
movq %rcx, 0x8(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/dms.c
// Function: dmsmediumlz77_codec
static void dmsmediumlz77_codec(struct de_dfilter_ctx *dfctx, void *codec_private_params)
{
	struct medium_ctx *mctx = NULL;

	mctx = de_malloc(dfctx->c, sizeof(struct medium_ctx));
	mctx->c = dfctx->c;
	mctx->modname = "dmsmedium_lz77";
	mctx->dcmpro = dfctx->dcmpro;
	mctx->dres = dfctx->dres;

	dfctx->codec_private = (void*)mctx;
	dfctx->codec_addbuf_fn = mediumlz77_codec_addbuf;
	dfctx->codec_command_fn = mediumlz77_codec_command;
	dfctx->codec_destroy_fn = mediumlz77_codec_destroy;

	mctx->ringbuf = de_lz77buffer_create(dfctx->c, 16*1024);
	// The set_curpos isn't needed, but could help with debugging. It makes our
	// internal state the same as most other DMS software.
	de_lz77buffer_set_curpos(mctx->ringbuf, 0x3fbe);

	mctx->ringbuf->userdata = (void*)mctx;
	mctx->ringbuf->writebyte_cb = medium_lz77buf_writebytecb;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
movl $0x78, %esi
callq 0xe8b2b
movq %rax, %r14
movq (%rbx), %rdi
movq %rdi, (%rax)
leaq 0xd48d5(%rip), %rax     # 0x11e174
movq %rax, 0x8(%r14)
movdqu 0x8(%rbx), %xmm0
pshufd $0x4e, %xmm0, %xmm0     # xmm0 = xmm0[2,3,0,1]
movdqu %xmm0, 0x10(%r14)
movq %r14, 0x28(%rbx)
leaq 0x234(%rip), %rax       # 0x49af2
movq %rax, 0x30(%rbx)
leaq 0x3ff(%rip), %rax       # 0x49cc8
movq %rax, 0x38(%rbx)
leaq 0x1bd(%rip), %rax       # 0x49a91
movq %rax, 0x48(%rbx)
movl $0x4000, %esi           # imm = 0x4000
callq 0xfad8f
movq %rax, 0x30(%r14)
movq %rax, %rdi
movl $0x3fbe, %esi           # imm = 0x3FBE
callq 0xfb30d
movq 0x30(%r14), %rax
movq %r14, (%rax)
leaq 0x1c7(%rip), %rcx       # 0x49ac8
movq %rcx, 0x8(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/dms.c
// Function: quicklz77_codec_command
static void quicklz77_codec_command(struct de_dfilter_ctx *dfctx, int cmd, UI flags)
{
	struct medium_ctx *mctx = (struct medium_ctx*)dfctx->codec_private;

	if(cmd==DE_DFILTER_COMMAND_FINISH_BLOCK) {
		de_bitbuf_lowlevel_empty(&mctx->bbll);
		mctx->mdst.state = MEDLZST_NEUTRAL;
		de_lz77buffer_set_curpos(mctx->ringbuf, mctx->ringbuf->curpos + 5);
	}
	else if(cmd==DE_DFILTER_COMMAND_RESET_COUNTERS) {
		mctx->nbytes_written = 0;
		mctx->errflag = 0;
		dfctx->finished_flag = 0;
	}
}

// Assembly:
pushq %rbx
movq 0x28(%rdi), %rbx
cmpl $0x4, %esi
je 0x49a7c
cmpl $0x3, %esi
jne 0x49a8f
leaq 0x38(%rbx), %rdi
callq 0xf1bdd
movl $0x0, 0x48(%rbx)
movq 0x30(%rbx), %rdi
movl 0x10(%rdi), %esi
addl $0x5, %esi
popq %rbx
jmp 0xfb30d
movq $0x0, 0x28(%rbx)
movl $0x0, 0x20(%rbx)
movb $0x0, 0x20(%rdi)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/dms.c
// Function: mediumlz77_codec_destroy
static void mediumlz77_codec_destroy(struct de_dfilter_ctx *dfctx)
{
	struct medium_ctx *mctx = (struct medium_ctx*)dfctx->codec_private;

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

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x28(%rdi), %r14
testq %r14, %r14
je 0x49ab8
movq (%rbx), %rdi
movq 0x30(%r14), %rsi
callq 0xfaed4
movq (%rbx), %rdi
movq %r14, %rsi
callq 0xe8be2
movq $0x0, 0x28(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/dms.c
// Function: medium_lz77buf_writebytecb
static void medium_lz77buf_writebytecb(struct de_lz77buffer *rb, u8 n)
{
	struct medium_ctx *mctx = (struct medium_ctx *)rb->userdata;

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

// Assembly:
pushq %rbx
movq (%rdi), %rbx
movq 0x10(%rbx), %rax
cmpb $0x0, 0x8(%rax)
je 0x49ae0
movq 0x28(%rbx), %rcx
cmpq 0x10(%rax), %rcx
jge 0x49af0
movq (%rax), %rdi
movzbl %sil, %esi
callq 0xf0bd6
incq 0x28(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/dms.c
// Function: destroy_heavy_state
static void destroy_heavy_state(deark *c, struct dmsheavy_cmpr_state *hvst)
{
	if(!hvst) return;
	dmsheavy_discard_tree(c, &hvst->literals_tree);
	dmsheavy_discard_tree(c, &hvst->offsets_tree);
	de_lz77buffer_destroy(c, hvst->ringbuf);
}

// Assembly:
testq %rsi, %rsi
je 0x4a12c
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x18(%rsi), %rsi
testq %rsi, %rsi
je 0x4a100
movq %rbx, %rdi
callq 0x104dc7
movq $0x0, 0x18(%r14)
movq 0x20(%r14), %rsi
testq %rsi, %rsi
je 0x4a119
movq %rbx, %rdi
callq 0x104dc7
movq $0x0, 0x20(%r14)
movq 0x8(%r14), %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xfaed4
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/dms.c
// Function: lha5like_lz77buf_writebytecb
static void lha5like_lz77buf_writebytecb(struct de_lz77buffer *rb, u8 n)
{
	struct lzh_ctx *cctx = (struct lzh_ctx*)rb->userdata;

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

// Assembly:
pushq %rbx
movq (%rdi), %rbx
movq 0x10(%rbx), %rax
cmpb $0x0, 0x8(%rax)
je 0x4a145
movq 0x28(%rbx), %rcx
cmpq 0x10(%rax), %rcx
jge 0x4a155
movq (%rax), %rdi
movzbl %sil, %esi
callq 0xf0bd6
incq 0x28(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/dms.c
// Function: dmsheavy_read_tree
static int dmsheavy_read_tree(struct lzh_ctx *cctx, struct lzh_tree_wrapper *htw,
	UI ncodes_nbits, UI symlen_nbits)
{
	deark *c = cctx->c;
	UI ncodes;
	UI curr_idx;
	int retval = 0;

	if(htw->ht) goto done;

	ncodes = (UI)de_bitreader_getbits(&cctx->bitrd, ncodes_nbits);
	de_dbg2(c, "num codes: %u", ncodes);

	htw->ht = fmtutil_huffman_create_decoder(c, (i64)ncodes, (i64)ncodes);

	if(ncodes==0) {
		UI null_val;

		null_val = (UI)de_bitreader_getbits(&cctx->bitrd, ncodes_nbits);
		fmtutil_huffman_add_code(c, htw->ht->bk, 0, 0, (fmtutil_huffman_valtype)null_val);
		de_dbg3(c, "val0: %u", null_val);
		retval = 1;
		goto done;
	}

	curr_idx = 0;
	while(curr_idx < ncodes) {
		UI symlen;

		symlen = (UI)de_bitreader_getbits(&cctx->bitrd, symlen_nbits);
		de_dbg3(c, "len[%u] = %u", curr_idx, symlen);
		fmtutil_huffman_record_a_code_length(c, htw->ht->builder, (fmtutil_huffman_valtype)curr_idx, symlen);
		curr_idx++;
	}
	if(cctx->bitrd.eof_flag) goto done;

	if(!fmtutil_huffman_make_canonical_code(c, htw->ht->bk, htw->ht->builder, 0, NULL)) goto done;

	retval = 1;
done:
	if(!retval) {
		lzh_set_err_flag(cctx);
	}
	return retval;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
cmpq $0x0, (%rsi)
je 0x4a18c
movb $0x1, 0x50(%r14)
movl $0x1, 0x30(%r14)
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %ecx, %ebp
movq %rsi, %r15
movq (%r14), %rbx
leaq 0x38(%r14), %r12
movq %r12, %rdi
movl %edx, 0x8(%rsp)
movl %edx, %esi
callq 0xf1bed
movq %rax, %r13
leaq 0xd4066(%rip), %rsi     # 0x11e216
movq %rbx, %rdi
movl %r13d, %edx
xorl %eax, %eax
callq 0xe87e4
movl %r13d, %edx
movq %rbx, %rdi
movq %rdx, %rsi
callq 0x104d0e
movq %rax, (%r15)
testl %r13d, %r13d
je 0x4a272
movq %r14, 0x10(%rsp)
xorl %r14d, %r14d
movq %r13, 0x8(%rsp)
movq %r15, %r13
movq %r12, %rdi
movl %ebp, %esi
callq 0xf1bed
movq %r12, %r15
movl %ebp, %r12d
movq %rax, %rbp
movq %rbx, %rdi
leaq 0xd4029(%rip), %rsi     # 0x11e22d
movl %r14d, %edx
movl %ebp, %ecx
xorl %eax, %eax
callq 0xe889f
movq (%r13), %rax
movq 0x10(%rax), %rsi
movq %rbx, %rdi
movl %r14d, %edx
movl %ebp, %ecx
movl %r12d, %ebp
movq %r15, %r12
callq 0x1049cc
incl %r14d
cmpl %r14d, 0x8(%rsp)
jne 0x4a1e7
movq 0x10(%rsp), %r14
cmpb $0x0, 0x50(%r14)
jne 0x4a16e
movq (%r13), %rax
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
movq %rbx, %rdi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x104a46
movl %eax, %ecx
movl $0x1, %eax
testl %ecx, %ecx
jne 0x4a17d
jmp 0x4a16e
movq %r12, %rdi
movl 0x8(%rsp), %esi
callq 0xf1bed
movq %rax, %r14
movq (%r15), %rax
movq 0x8(%rax), %rsi
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
movl %r14d, %r8d
callq 0x1044c1
leaq 0xd3f86(%rip), %rsi     # 0x11e224
movq %rbx, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0xe889f
movl $0x1, %eax
jmp 0x4a17d
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/dms.c
// Function: read_next_code_using_tree
static UI read_next_code_using_tree(struct lzh_ctx *cctx, struct lzh_tree_wrapper *tree)
{
	fmtutil_huffman_valtype val = 0;
	int ret;

	if(!tree->ht) goto done;

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

done:
	return (UI)val;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl $0x0, 0x4(%rsp)
testq %rsi, %rsi
je 0x4a30c
movq %rdi, %rbx
movq 0x8(%rsi), %rdi
leaq 0x38(%rbx), %rsi
xorl %r14d, %r14d
leaq 0x4(%rsp), %rdx
xorl %ecx, %ecx
callq 0x1046f3
cmpb $0x0, 0x50(%rbx)
je 0x4a311
movq (%rbx), %rdi
movq 0x18(%rbx), %rsi
movq 0x20(%rbx), %rdx
leaq 0xd3f42(%rip), %rcx     # 0x11e23a
xorl %eax, %eax
callq 0xfa21a
movb $0x1, 0x50(%rbx)
movl $0x1, 0x30(%rbx)
jmp 0x4a31a
xorl %r14d, %r14d
jmp 0x4a31a
testl %eax, %eax
je 0x4a325
movl 0x4(%rsp), %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq (%rbx), %rdi
movq 0x18(%rbx), %rsi
movq 0x20(%rbx), %rdx
leaq 0xd3f25(%rip), %rcx     # 0x11e25c
xorl %r14d, %r14d
jmp 0x4a2f8
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/colorix.c
// Function: de_module_colorix
void de_module_colorix(deark *c, struct deark_module_info *mi)
{
	mi->id = "colorix";
	mi->desc = "ColoRIX";
	mi->run_fn = de_run_colorix;
	mi->identify_fn = de_identify_colorix;
}

// Assembly:
leaq 0xd3f46(%rip), %rax     # 0x11e289
movq %rax, (%rsi)
leaq 0xd3f44(%rip), %rax     # 0x11e291
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x4a368
movq %rax, 0x18(%rsi)
leaq 0x690(%rip), %rax       # 0x4a9f3
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/colorix.c
// Function: de_identify_colorix
static int de_identify_colorix(deark *c)
{
	if(c->infile->len < RIX_MIN_FILE_SIZE) return 0;

	if(is_RIX3(c->infile)) {
		return 95;
	}

	if(c->detection_data->best_confidence_so_far >= 55) return 0;

	if(de_input_file_has_ext(c, "scr")) {
		int fmt;

		fmt = detect_old_fmt(c->infile, 1);
		if(fmt==RIXFMT_OLD_U) {
			return 35;
		}
		else if(fmt==RIXFMT_OLD_C) {
			return 55;
		}
	}
	// TODO: There is supposedly also an old ".SCP" format, 640x480x16.
	// But I can't find any samples.

	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0x18(%rdi), %rdi
xorl %ebx, %ebx
cmpq $0x24, 0x18(%rdi)
jl 0x4aa69
leaq 0xd38ad(%rip), %rdx     # 0x11e2bb
xorl %ebx, %ebx
movl $0x4, %ecx
xorl %esi, %esi
callq 0xefc85
testl %eax, %eax
je 0x4aa64
movq 0x28(%r14), %rax
cmpl $0x36, (%rax)
jg 0x4aa69
leaq 0xeb808(%rip), %rsi     # 0x136238
movq %r14, %rdi
callq 0xea491
testl %eax, %eax
je 0x4aa69
movq 0x18(%r14), %rdi
movl $0x1, %esi
callq 0x4aa73
xorl %ecx, %ecx
cmpl $0x2, %eax
movl $0x37, %edx
cmovnel %ecx, %edx
cmpl $0x1, %eax
movl $0x23, %ebx
cmovnel %edx, %ebx
jmp 0x4aa69
movl $0x5f, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq