LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/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 0x475e8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rcx, %r14
movq %rdx, %r15
movq %rdi, %rbx
cmpb $0x2, (%rsi)
jne 0x4767f
movq %r8, %r12
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xef0d5
cmpb $0x2, %al
jne 0x4767f
leaq 0xd5c90(%rip), %rsi     # 0x11d2a4
movq %rbx, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movl $0x70, %esi
movq %rbx, %rdi
callq 0xe969b
movq %rax, %r13
movq %r12, 0x28(%rax)
movq 0x18(%rbx), %rcx
leaq 0xdbba0(%rip), %rsi     # 0x1231ed
movq %rbx, %rdi
movq %rax, %rdx
movq %r15, %r8
movq %r14, %r9
callq 0xea5fa
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
movq %rbx, %rdi
movq %r13, %rsi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xe9752
leaq 0xd5c10(%rip), %rsi     # 0x11d296
movq %rbx, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq 0x18(%rbx), %rcx
leaq 0xdbb84(%rip), %rsi     # 0x12322f
leaq 0xfbeaa(%rip), %rdx     # 0x14355c
movq %rbx, %rdi
movq %r15, %r8
movq %r14, %r9
callq 0xea66a
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xe9585
// File: /workspace/github_c_makefile_star2_O1/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 0x47757
cmpb $0x2, (%rsi)
jne 0x47757
movq 0x18(%r12), %rdi
movq %r14, %rsi
callq 0xef1ca
movq %rax, %r13
cmpl $0x1, %r13d
je 0x47722
cmpl $0x201, %r13d           # imm = 0x201
je 0x47722
cmpl $0x101, %r13d           # imm = 0x101
jne 0x47757
movq 0x18(%r12), %rdi
leaq 0xd5b86(%rip), %rcx     # 0x11d2b4
movq %r14, %rsi
movq %rbx, %rdx
movq %r15, %r8
xorl %r9d, %r9d
callq 0xf0321
cmpl $0x1, %r13d
je 0x47771
cmpl $0x101, %r13d           # imm = 0x101
je 0x47771
cmpl $0x201, %r13d           # imm = 0x201
je 0x47771
movq %r15, (%rsp)
movq %r12, %rdi
movq %r14, %rsi
movq %rbx, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x478e1
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x47786
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 0xef37e
cmpq %r13, %rax
movq %r13, %r12
cmovlq %rax, %r12
cmpq $0x6, %rax
cmovlq %r13, %r12
xorl %r13d, %r13d
testq %rbx, %rbx
je 0x47886
cmpq $0x6d, %r12
jl 0x47886
movq 0x18(%r15), %rdi
movq %r14, %rsi
callq 0xef1ca
testl $0xfffffe00, %eax       # imm = 0xFFFFFE00
je 0x47883
movq 0x18(%r15), %rdi
leaq 0x44(%r14), %rsi
callq 0xef1ca
movq %rax, %r13
movq 0x18(%r15), %rdi
leaq 0x69(%r14), %rsi
callq 0xef37e
movq %r12, %rbp
subq %rax, %rbp
jle 0x47883
movq %r13, 0x8(%rsp)
movq %r15, %rdi
movq %rax, 0x10(%rsp)
callq 0xf6870
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 0xf0203
cmpq $0x0, 0x10(%r13)
jle 0x47886
leaq 0xd5a64(%rip), %rdx     # 0x11d2c1
movq %r13, %rdi
movl $0x5, %esi
movq 0x8(%rsp), %rcx
xorl %eax, %eax
callq 0xf6ab0
movq %r15, %rdi
movq %rbx, %rsi
movq %r13, %rdx
xorl %ecx, %ecx
callq 0xea9e4
jmp 0x47886
xorl %r13d, %r13d
movq %r13, %rdi
callq 0xf6bb0
movq 0x18(%r15), %rdi
leaq 0xd5a24(%rip), %rcx     # 0x11d2bd
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 0xf0321
// File: /workspace/github_c_makefile_star2_O1/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 0xd5ea5(%rip), %rax     # 0x11d974
movq %rax, (%rsi)
leaq 0xd5ea3(%rip), %rax     # 0x11d97c
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x47af4
movq %rax, 0x18(%rsi)
leaq 0x74b(%rip), %rax       # 0x4823a
movq %rax, 0x28(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xd5691(%rip), %rax     # 0x11dc64
movq %rax, (%rsi)
leaq 0xd5691(%rip), %rax     # 0x11dc6e
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x485f8
movq %rax, 0x18(%rsi)
leaq 0xf85(%rip), %rax       # 0x49578
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x495f0
movq %r14, %rdi
callq 0x497bf
movq $0x0, 0x12f0(%rbx)
movq 0x12f8(%rbx), %rsi
testq %rsi, %rsi
je 0x4960f
movq %r14, %rdi
callq 0x497bf
movq $0x0, 0x12f8(%rbx)
movq 0x1300(%rbx), %rsi
testq %rsi, %rsi
je 0x4962e
movq %r14, %rdi
callq 0x497bf
movq $0x0, 0x1300(%rbx)
movq 0x1308(%rbx), %rsi
testq %rsi, %rsi
je 0x4964d
movq %r14, %rdi
callq 0x4a17e
movq $0x0, 0x1308(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xe969b
movl $0x0, (%rax)
movq %rax, 0x28(%rbx)
leaq 0x19(%rip), %rax        # 0x49690
movq %rax, 0x30(%rbx)
movq $0x0, 0x40(%rbx)
leaq 0x116(%rip), %rax       # 0x497a0
movq %rax, 0x48(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x49791
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
xorl %r13d, %r13d
leaq 0xd458a(%rip), %rbp     # 0x11dc50
movl (%r12), %ecx
cmpq $0x4, %rcx
ja 0x49770
movb (%r14,%r13), %al
movzbl %al, %esi
movslq (%rbp,%rcx,4), %rcx
addq %rbp, %rcx
jmpq *%rcx
cmpb $-0x70, %al
jne 0x49755
movl $0x1, (%r12)
jmp 0x49770
movzbl 0x6(%r12), %edx
shll $0x8, %edx
orq %rsi, %rdx
movq 0x10(%r15), %rax
movq (%rax), %rdi
movzbl 0x5(%r12), %esi
jmp 0x49724
movzbl 0x4(%r12), %edx
cmpq $0xff, %rdx
je 0x49763
movq 0x10(%r15), %rax
movq (%rax), %rdi
callq 0xf14bd
movl $0x0, (%r12)
jmp 0x49770
movb %al, 0x6(%r12)
movl $0x4, (%r12)
jmp 0x49770
testb %al, %al
je 0x4977e
movb %al, 0x4(%r12)
movl $0x2, (%r12)
jmp 0x49770
movq 0x10(%r15), %rax
movq (%rax), %rdi
callq 0xf11be
jmp 0x49770
movb %al, 0x5(%r12)
movl $0x3, (%r12)
incq %r13
cmpq %r13, %rbx
jne 0x496c6
jmp 0x49791
movq 0x10(%r15), %rax
movq (%rax), %rdi
movl $0x90, %esi
callq 0xf11be
jmp 0x49729
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x497b5
movq (%rbx), %rdi
callq 0xe9752
movq $0x0, 0x28(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x49805
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x10(%rsi), %rdi
testq %rdi, %rdi
je 0x497dc
callq 0xfa8d8
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x497ea
callq 0xfa8d8
movq 0x28(%rbx), %rdi
callq 0xf0b13
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xe9752
retq
// File: /workspace/github_c_makefile_star2_O1/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
cmpq $0x0, 0x18(%rsi)
jne 0x49831
movq 0x8(%rdi), %rdi
movq 0x8(%r14), %rdx
leaq 0xcb485(%rip), %rsi     # 0x114caf
xorl %eax, %eax
callq 0xea0a6
movq 0x18(%r14), %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0xfa87a
addq %rbx, 0x20(%r14)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xe969b
movq %rax, %r14
movq (%rbx), %rdi
movq %rdi, (%rax)
leaq 0xd47e8(%rip), %rax     # 0x11e056
movq %rax, 0x8(%r14)
movq 0x10(%rbx), %rax
movq %rax, 0x10(%r14)
movq 0x8(%rbx), %rax
movq %rax, 0x18(%r14)
movq %r14, 0x28(%rbx)
leaq 0xe1(%rip), %rax        # 0x4996e
movq %rax, 0x30(%rbx)
leaq 0x212(%rip), %rax       # 0x49aaa
movq %rax, 0x38(%rbx)
leaq 0x24b(%rip), %rax       # 0x49aee
movq %rax, 0x48(%rbx)
movl $0x100, %esi            # imm = 0x100
callq 0xfb2c3
movq %rax, 0x30(%r14)
movq %rax, %rdi
movl $0xfb, %esi
callq 0xfb86a
movq 0x30(%r14), %rax
movq %r14, (%rax)
leaq 0x255(%rip), %rcx       # 0x49b25
movq %rcx, 0x8(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xe969b
movq %rax, %r14
movq (%rbx), %rdi
movq %rdi, (%rax)
leaq 0xd4764(%rip), %rax     # 0x11e064
movq %rax, 0x8(%r14)
movq 0x10(%rbx), %rax
movq %rax, 0x10(%r14)
movq 0x8(%rbx), %rax
movq %rax, 0x18(%r14)
movq %r14, 0x28(%rbx)
leaq 0x230(%rip), %rax       # 0x49b4f
movq %rax, 0x30(%rbx)
leaq 0x3fe(%rip), %rax       # 0x49d28
movq %rax, 0x38(%rbx)
leaq 0x1b9(%rip), %rax       # 0x49aee
movq %rax, 0x48(%rbx)
movl $0x4000, %esi           # imm = 0x4000
callq 0xfb2c3
movq %rax, 0x30(%r14)
movq %rax, %rdi
movl $0x3fbe, %esi           # imm = 0x3FBE
callq 0xfb86a
movq 0x30(%r14), %rax
movq %r14, (%rax)
leaq 0x1c3(%rip), %rcx       # 0x49b25
movq %rcx, 0x8(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x49ad9
cmpl $0x3, %esi
jne 0x49aec
leaq 0x38(%rbx), %rdi
callq 0xf2261
movl $0x0, 0x48(%rbx)
movq 0x30(%rbx), %rdi
movl 0x10(%rdi), %esi
addl $0x5, %esi
popq %rbx
jmp 0xfb86a
movq $0x0, 0x28(%rbx)
movl $0x0, 0x20(%rbx)
movb $0x0, 0x20(%rdi)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x49b15
movq (%rbx), %rdi
movq 0x30(%r14), %rsi
callq 0xfb408
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/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 0x49b3d
movq 0x28(%rbx), %rcx
cmpq 0x10(%rax), %rcx
jge 0x49b4d
movq (%rax), %rdi
movzbl %sil, %esi
callq 0xf11be
incq 0x28(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x4a1d2
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x18(%rsi), %rsi
testq %rsi, %rsi
je 0x4a1a6
movq %rbx, %rdi
callq 0x10521e
movq $0x0, 0x18(%r14)
movq 0x20(%r14), %rsi
testq %rsi, %rsi
je 0x4a1bf
movq %rbx, %rdi
callq 0x10521e
movq $0x0, 0x20(%r14)
movq 0x8(%r14), %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xfb408
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x4a1eb
movq 0x28(%rbx), %rcx
cmpq 0x10(%rax), %rcx
jge 0x4a1fb
movq (%rax), %rdi
movzbl %sil, %esi
callq 0xf11be
incq 0x28(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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, %rbp
movb $0x1, %r12b
cmpq $0x0, (%rsi)
je 0x4a238
xorl %eax, %eax
testb %r12b, %r12b
je 0x4a229
movb $0x1, 0x50(%rbp)
movl $0x1, 0x30(%rbp)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %edx, %ebx
movq %rsi, %r15
movl %ecx, %r12d
movq (%rbp), %r14
leaq 0x38(%rbp), %rdi
movq %rdi, 0x8(%rsp)
movl %edx, %esi
callq 0xf2271
movq %rax, %r13
leaq 0xd3ea8(%rip), %rsi     # 0x11e106
movq %r14, %rdi
movl %r13d, %edx
xorl %eax, %eax
callq 0xe93cf
movl %r13d, %edx
movq %r14, %rdi
movq %rdx, %rsi
callq 0x105165
movq %rax, (%r15)
testl %r13d, %r13d
je 0x4a2dc
movq %rbp, 0x10(%rsp)
xorl %ebx, %ebx
movq 0x8(%rsp), %rdi
movl %r12d, %esi
callq 0xf2271
movq %rax, %rbp
movq %r14, %rdi
leaq 0xd3e7b(%rip), %rsi     # 0x11e11d
movl %ebx, %edx
movl %ebp, %ecx
xorl %eax, %eax
callq 0xe9461
movq (%r15), %rax
movq 0x10(%rax), %rsi
movq %r14, %rdi
movl %ebx, %edx
movl %ebp, %ecx
callq 0x104de7
incl %ebx
cmpl %ebx, %r13d
jne 0x4a288
movq 0x10(%rsp), %rbp
cmpb $0x0, 0x50(%rbp)
je 0x4a321
xorl %eax, %eax
movb $0x1, %r12b
jmp 0x4a219
movq 0x8(%rsp), %rdi
movl %ebx, %esi
callq 0xf2271
movq %rax, %rbx
movq (%r15), %rax
movq 0x8(%rax), %rsi
xorl %r12d, %r12d
movq %r14, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
movl %ebx, %r8d
callq 0x104901
leaq 0xd3e09(%rip), %rsi     # 0x11e114
movq %r14, %rdi
movl %ebx, %edx
xorl %eax, %eax
callq 0xe9461
movl $0x1, %eax
jmp 0x4a219
movq (%r15), %rax
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
movq %r14, %rdi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x104e5d
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
sete %r12b
setne %al
jmp 0x4a219
// File: /workspace/github_c_makefile_star2_O1/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 %rbx
subq $0x10, %rsp
movl $0x0, 0xc(%rsp)
movq (%rsi), %rax
testq %rax, %rax
je 0x4a3af
movq %rdi, %rbx
movq 0x8(%rax), %rdi
leaq 0x38(%rbx), %rsi
leaq 0xc(%rsp), %rdx
xorl %ecx, %ecx
callq 0x104b4d
cmpb $0x0, 0x50(%rbx)
je 0x4a3ab
movq (%rbx), %rdi
movq 0x18(%rbx), %rsi
movq 0x20(%rbx), %rdx
leaq 0xd3d9b(%rip), %rcx     # 0x11e12a
xorl %eax, %eax
callq 0xfa71e
movb $0x1, 0x50(%rbx)
movl $0x1, 0x30(%rbx)
movl $0x0, 0xc(%rsp)
jmp 0x4a3af
testl %eax, %eax
je 0x4a3b9
movl 0xc(%rsp), %eax
addq $0x10, %rsp
popq %rbx
retq
movq (%rbx), %rdi
movq 0x18(%rbx), %rsi
movq 0x20(%rbx), %rdx
leaq 0xd3d81(%rip), %rcx     # 0x11e14c
jmp 0x4a38f
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/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 0xd3da2(%rip), %rax     # 0x11e179
movq %rax, (%rsi)
leaq 0xd3da0(%rip), %rax     # 0x11e181
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x4a3fc
movq %rax, 0x18(%rsi)
leaq 0x693(%rip), %rax       # 0x4aa8a
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x4ab0a
leaq 0xd3706(%rip), %rdx     # 0x11e1ab
xorl %ebx, %ebx
movl $0x4, %ecx
xorl %esi, %esi
callq 0xf025e
testl %eax, %eax
je 0x4aaf2
movq 0x28(%r14), %rax
cmpl $0x36, (%rax)
jg 0x4ab0a
leaq 0xeb32e(%rip), %rsi     # 0x135df5
movq %r14, %rdi
callq 0xea936
testl %eax, %eax
je 0x4ab08
movq 0x18(%r14), %rdi
movl $0x1, %esi
callq 0x4ab14
cmpl $0x1, %eax
je 0x4aaf9
cmpl $0x2, %eax
jne 0x4ab02
movl $0x37, %ebx
jmp 0x4aafe
movl $0x5f, %ebx
jmp 0x4ab0a
movl $0x23, %ebx
xorl %eax, %eax
jmp 0x4ab04
movb $0x1, %al
testb %al, %al
je 0x4ab0a
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/colorix.c
// Function: detect_old_fmt
static int detect_old_fmt(dbuf *f, u8 strict)
{
	size_t i;
	u8 cmpr_flag = 0;
	u8 buf[16];

	if(f->len<RIX_MIN_FILE_SIZE) return 0;

	// Check the palette
	dbuf_read(f, buf, 0, 16);
	for(i=0; i<16; i++) {
		if(i==0) {
			if((buf[i] & 0x80)!=0) {
				cmpr_flag = 1;
				buf[i] -= 0x80;
			}
			else {
				if(f->len!=RIX_UNC_SCR_FILE_SIZE) return 0;
			}
		}

		if(buf[i]>0x3f) return 0;
	}
	if(!cmpr_flag) return RIXFMT_OLD_U;
	if(!strict) return RIXFMT_OLD_C;

	if(looks_like_compressed_data(f, 16)) {
		return RIXFMT_OLD_C;
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
cmpq $0x24, 0x18(%rdi)
jge 0x4ab38
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl %esi, %ebp
movq %rdi, %rbx
xorl %r15d, %r15d
leaq 0x10(%rsp), %r14
movl $0x10, %ecx
movq %r14, %rsi
xorl %edx, %edx
callq 0xeeee8
movb (%r14), %al
xorl %ecx, %ecx
testq %rcx, %rcx
jne 0x4ab77
testb %al, %al
js 0x4ab6e
cmpq $0x1b590, 0x18(%rbx)    # imm = 0x1B590
je 0x4ab77
jmp 0x4ab27
andb $0x7f, %al
movb %al, 0x10(%rsp)
movb $0x1, %r15b
cmpb $0x3f, 0x10(%rsp,%rcx)
ja 0x4ab27
incq %rcx
cmpq $0x10, %rcx
jne 0x4ab59
testb %r15b, %r15b
je 0x4ac88
testb %bpl, %bpl
je 0x4ac92
leaq 0x8(%rsp), %rsi
movq $0x10, (%rsi)
movq %rbx, %rdi
callq 0xef1ed
leaq -0x202(%rax), %rcx
xorl %ebp, %ebp
cmpq $-0x1ff, %rcx           # imm = 0xFE01
jb 0x4ab29
leaq (%rax,%rax), %r12
addq 0x8(%rsp), %r12
cmpq 0x18(%rbx), %r12
jg 0x4ab29
addq $-0x2, %rax
movl $0x10, %esi
movq %rax, %rdi
callq 0xea792
testq %rax, %rax
jle 0x4ac32
movq %rax, %r14
leaq 0x8(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0xef1ed
cmpl $0xfff, %eax            # imm = 0xFFF
ja 0x4ac22
testb $0x1, %al
jne 0x4ab29
andl $0xfff, %eax            # imm = 0xFFF
addq 0x8(%rsp), %rax
cmpq %r12, %rax
jl 0x4ac2d
jmp 0x4ab29
cmpl $0x10ff, %eax           # imm = 0x10FF
ja 0x4ab29
decq %r14
jne 0x4abf4
leaq 0x8(%rsp), %r14
movq %r12, (%r14)
movl $0x4, %r15d
movq 0x8(%rsp), %rax
addq $0x3, %rax
cmpq 0x18(%rbx), %rax
jg 0x4ab29
movq %rbx, %rdi
movq %r14, %rsi
callq 0xef1ed
cmpq $0x64, %rax
jl 0x4ab29
addq 0x8(%rsp), %rax
movq %rax, 0x8(%rsp)
decq %r15
jne 0x4ac40
xorl %ebp, %ebp
cmpq 0x18(%rbx), %rax
sete %bpl
addl %ebp, %ebp
jmp 0x4ab29
movl $0x1, %ebp
jmp 0x4ab29
movl $0x2, %ebp
jmp 0x4ab29
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/colorix.c
// Function: rixdecomp_interpret_nodetable_item
static void rixdecomp_interpret_nodetable_item(struct rixdecomp_ctx *rhctx,
	i64 itempos, u64 currcode, UI currcode_nbits)
{
	u16 dval;

	if(rhctx->errflag) return;
	if((itempos < rhctx->nodetable_dpos) ||
		(itempos+2 > rhctx->nodetable_dpos+rhctx->nodetable_dlen))
	{
		rhctx->errflag = 1;
		return;
	}
	if(currcode_nbits>=FMTUTIL_HUFFMAN_MAX_CODE_LENGTH) return;

	dval = (u16)dbuf_getu16le(rhctx->dcmpri->f, itempos);
	de_dbg2(rhctx->c, "item@%"I64_FMT": 0x%04x", itempos, (UI)dval);

	if(dval>=2 && dval<0x1000 && (dval%2==0)) { // a "pointer" item
		// The very next item is the start of the "1" subtree.
		rixdecomp_interpret_nodetable_item(rhctx, itempos+2, ((currcode<<1) | 1), currcode_nbits+1);
		if(rhctx->errflag) goto done;

		// The pointer item tells how many bytes are between the pointer item
		// and the start of the "0" subtree.
		rixdecomp_interpret_nodetable_item(rhctx, itempos+2+(i64)dval, currcode<<1, currcode_nbits+1);
		if(rhctx->errflag) goto done;
	}
	else if(dval>=0x1000 && dval<=0x10ff) { // a leaf item
		fmtutil_huffman_valtype adj_value;

		adj_value = (fmtutil_huffman_valtype)(dval-0x1000);
		if(rhctx->c->debug_level>=3) {
			de_dbg3(rhctx->c, "code: \"%s\" = %d",
				de_print_base2_fixed(rhctx->tmpbuf, sizeof(rhctx->tmpbuf), currcode, currcode_nbits),
				(int)adj_value);
		}
		if(!fmtutil_huffman_add_code(rhctx->c, rhctx->ht->bk, currcode, currcode_nbits, adj_value)) {
			rhctx->errflag = 1;
		}
	}
	else {
		rhctx->errflag = 1;
		goto done;
	}

done:
	;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebp
movq %rdx, %r13
movq %rsi, %r15
movq %rdi, %rbx
cmpb $0x0, 0x30(%rbx)
jne 0x4b3bd
movq 0x88(%rbx), %rax
cmpq %r15, %rax
jg 0x4b3b9
leaq 0x2(%r15), %r12
addq 0x90(%rbx), %rax
cmpq %rax, %r12
jg 0x4b3b9
cmpl $0x2f, %ebp
ja 0x4b3bd
movq %r13, (%rsp)
movq 0x10(%rbx), %rax
movq (%rax), %rdi
movq %r15, %rsi
callq 0xef1ca
movq %rax, %r14
movq (%rbx), %rdi
movzwl %r14w, %r13d
leaq 0xd3043(%rip), %rsi     # 0x11e343
movq %r15, %rdx
movl %r13d, %ecx
xorl %eax, %eax
callq 0xe93cf
testb $0x1, %r14b
jne 0x4b34e
leal -0x2(%r13), %eax
cmpl $0xffd, %eax            # imm = 0xFFD
ja 0x4b34e
movq (%rsp), %r13
leaq 0x1(,%r13,2), %rdx
incl %ebp
movq %rbx, %rdi
movq %r12, %rsi
movl %ebp, %ecx
callq 0x4b28f
cmpb $0x0, 0x30(%rbx)
jne 0x4b3bd
addq %r13, %r13
movzwl %r14w, %r15d
addq %r12, %r15
jmp 0x4b2a5
andl $0xff00, %r14d          # imm = 0xFF00
cmpl $0x1000, %r14d          # imm = 0x1000
jne 0x4b3b9
addl $0xfffff000, %r13d      # imm = 0xFFFFF000
movq (%rbx), %r14
cmpl $0x3, (%r14)
jl 0x4b39c
leaq 0x9e(%rbx), %rdi
movl $0x48, %esi
movq (%rsp), %rdx
movl %ebp, %ecx
callq 0xea85a
leaq 0xd2fc8(%rip), %rsi     # 0x11e354
movq %r14, %rdi
movq %rax, %rdx
movl %r13d, %ecx
xorl %eax, %eax
callq 0xe9461
movq (%rbx), %rdi
movq 0x50(%rbx), %rax
movq 0x8(%rax), %rsi
movq (%rsp), %rdx
movl %ebp, %ecx
movl %r13d, %r8d
callq 0x104901
testl %eax, %eax
jne 0x4b3bd
movb $0x1, 0x30(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/diet.c
// Function: de_module_diet
void de_module_diet(deark *c, struct deark_module_info *mi)
{
	mi->id = "diet";
	mi->desc = "DIET compression";
	mi->run_fn = de_run_diet;
	mi->identify_fn = de_identify_diet;
	mi->help_fn = de_help_diet;
}

// Assembly:
leaq 0xd2fe6(%rip), %rax     # 0x11e3b9
movq %rax, (%rsi)
leaq 0xd2fe1(%rip), %rax     # 0x11e3be
movq %rax, 0x8(%rsi)
leaq 0x1b(%rip), %rax        # 0x4b403
movq %rax, 0x18(%rsi)
leaq 0x97e(%rip), %rax       # 0x4bd71
movq %rax, 0x20(%rsi)
leaq 0x9af(%rip), %rax       # 0x4bdad
movq %rax, 0x28(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/diet.c
// Function: write_data_or_com_file
static void write_data_or_com_file(deark *c, lctx *d)
{
	dbuf *outf = NULL;
	const char *ext;

	if(d->idd.ftype==FTYPE_COM || d->idd.com2exe_flag) ext = "com";
	else ext = "bin";

	outf = dbuf_create_output_file(c, ext, NULL, 0);
	dbuf_copy(d->dcmpr_code, 0, d->dcmpr_code->len, outf);

	if(d->idd.ftype==FTYPE_COM) {
		de_stdwarn_execomp(c);
	}

	dbuf_close(outf);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
cmpl $0x2, 0x4(%rsi)
jne 0x4c219
leaq 0xd74ae(%rip), %rsi     # 0x1236c5
jmp 0x4c230
cmpb $0x0, 0xb(%r14)
leaq 0xe920c(%rip), %rax     # 0x135431
leaq 0xd7499(%rip), %rsi     # 0x1236c5
cmoveq %rax, %rsi
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0xf037a
movq %rax, %r15
movq 0x58(%r14), %rdi
movq 0x18(%rdi), %rdx
xorl %esi, %esi
movq %rax, %rcx
callq 0xefabc
cmpl $0x2, 0x4(%r14)
jne 0x4c260
movq %rbx, %rdi
callq 0xe9b19
movq %r15, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0xf0b13
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/diet.c
// Function: diet_getbit
static u8 diet_getbit(deark *c, lctx *d)
{
	u8 v;

	if(d->errflag) return 0;

	if(d->bbll.nbits_in_bitbuf==0) {
		fill_bitbuf(c, d);
	}

	v = (u8)de_bitbuf_lowlevel_get_bits(&d->bbll, 1);

	if(d->bbll.nbits_in_bitbuf==0) {
		fill_bitbuf(c, d);
	}

	return v;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
cmpb $0x0, 0x28(%rsi)
je 0x4c9dd
xorl %r15d, %r15d
jmp 0x4ca19
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x70(%rsi), %r15
cmpl $0x0, 0x74(%rsi)
jne 0x4c9f8
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4ca22
movq %r15, %rdi
movl $0x1, %esi
callq 0xf221e
movq %rax, %r15
cmpl $0x0, 0x74(%rbx)
jne 0x4ca19
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4ca22
movl %r15d, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/diet.c
// Function: fill_bitbuf
static void fill_bitbuf(deark *c, lctx *d)
{
	UI i;

	if(d->errflag) return;
	if(d->dcmpr_cur_ipos+2 > c->infile->len) {
		d->errflag = 1;
		d->need_errmsg = 1;
		return;
	}

	for(i=0; i<2; i++) {
		u8 b;
		b = de_getbyte_p(&d->dcmpr_cur_ipos);
		de_bitbuf_lowlevel_add_byte(&d->bbll, b);
	}
}

// Assembly:
cmpb $0x0, 0x28(%rsi)
je 0x4ca29
retq
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x68(%rsi), %rax
addq $0x2, %rax
movq 0x18(%rdi), %rcx
cmpq 0x18(%rcx), %rax
jle 0x4ca50
movw $0x101, 0x28(%rbx)      # imm = 0x101
jmp 0x4ca78
leaq 0x68(%rbx), %r15
addq $0x70, %rbx
movl $0x1, %ebp
movq 0x18(%r14), %rdi
movq %r15, %rsi
callq 0xef14d
movzbl %al, %esi
movq %rbx, %rdi
callq 0xf21e9
decl %ebp
je 0x4ca5d
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/divgs.c
// Function: de_module_div_map
void de_module_div_map(deark *c, struct deark_module_info *mi)
{
	mi->id = "div_map";
	mi->desc = "DIV Games Studio .map";
	mi->run_fn = de_run_div_map;
	mi->identify_fn = de_identify_div_map;
}

// Assembly:
leaq 0xd1d25(%rip), %rax     # 0x11e7b0
movq %rax, (%rsi)
leaq 0xd1d23(%rip), %rax     # 0x11e7b8
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x4cab0
movq %rax, 0x18(%rsi)
leaq 0x165(%rip), %rax       # 0x4cc10
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/divgs.c
// Function: de_run_div_map
static void de_run_div_map(deark *c, de_module_params *mparams)
{
	struct div_ctx *d = NULL;
	struct div_image_ctx *md = NULL;
	i64 pos;

	d = de_malloc(c, sizeof(struct div_ctx));
	d->fmt = identify_div_fmt(c);
	if(d->fmt==DIVFMT_MAP) {
		de_declare_fmt(c, "DIV MAP");
	}
	else {
		d->need_errmsg = 1;
		goto done;
	}
	d->input_encoding = de_get_input_encoding(c, NULL, DE_ENCODING_CP850);

	md = de_malloc(c, sizeof(struct div_image_ctx));
	if(de_getbyte(7) != 0) {
		d->need_errmsg = 1;
		goto done;
	}

	pos = 8;
	md->w = de_getu16le_p(&pos);
	md->h = de_getu16le_p(&pos);
	de_dbg_dimensions(c, md->w, md->h);

	pos = 16;

	// TODO: Figure out why the description is often garbage
	//div_read_descr_p(c, d, md, &pos);
	pos += 32;

	div_read_pal_p(c, d, &pos);

	div_read_cpoints_p(c, d, &pos);

	md->bitmap_pos = pos;
	div_do_bitmap(c, d, md);

done:
	div_image_destroy(c, md);
	if(d) {
		if(d->need_errmsg) {
			de_err(c, "Bad or unsupported MAP file");
		}
		de_free(c, d);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x408, %esi            # imm = 0x408
callq 0xe969b
movq %rax, %r14
movq %rbx, %rdi
callq 0x4cfca
movb %al, 0x4(%r14)
cmpb $0x1, %al
jne 0x4cb25
leaq 0xd1d0d(%rip), %rsi     # 0x11e7ec
movq %rbx, %rdi
callq 0xeb6d6
movq %rbx, %rdi
xorl %esi, %esi
movl $0xe, %edx
callq 0xeb7d1
movl %eax, (%r14)
movl $0x40, %esi
movq %rbx, %rdi
callq 0xe969b
movq %rax, %r15
movq 0x18(%rbx), %rdi
movl $0x7, %esi
callq 0xef0d5
testb %al, %al
je 0x4cb32
movb $0x1, 0x6(%r14)
jmp 0x4cbd1
movb $0x1, 0x6(%r14)
xorl %r15d, %r15d
jmp 0x4cbd1
movq %rsp, %r12
movq $0x8, (%r12)
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xef1ed
movq %rax, 0x18(%r15)
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xef1ed
movq %rax, 0x20(%r15)
movq 0x18(%r15), %rsi
movq %rbx, %rdi
movq %rax, %rdx
callq 0xe9b05
movq $0x30, (%r12)
movq 0x18(%rbx), %rsi
leaq 0x8(%r14), %r9
subq $0x8, %rsp
movl $0x30, %edx
movl $0x100, %ecx            # imm = 0x100
movl $0x3, %r8d
movq %rbx, %rdi
pushq $0x0
pushq $0x2
pushq $0x100                  # imm = 0x100
callq 0xf32f2
addq $0x20, %rsp
addq $0x540, (%r12)          # imm = 0x540
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x4d072
movq (%r12), %rax
movq %rax, 0x10(%r15)
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x4d098
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4d1b3
testq %r14, %r14
je 0x4cc04
cmpb $0x0, 0x6(%r14)
je 0x4cbf9
leaq 0xd1c05(%rip), %rsi     # 0x11e7f4
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9df7
movq %rbx, %rdi
movq %r14, %rsi
callq 0xe9752
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/divgs.c
// Function: de_module_div_fpg
void de_module_div_fpg(deark *c, struct deark_module_info *mi)
{
	mi->id = "div_fpg";
	mi->desc = "DIV Games Studio .fpg";
	mi->run_fn = de_run_div_fpg;
	mi->identify_fn = de_identify_div_fpg;
}

// Assembly:
leaq 0xd1ba3(%rip), %rax     # 0x11e7ce
movq %rax, (%rsi)
leaq 0xd1ba1(%rip), %rax     # 0x11e7d6
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x4cc50
movq %rax, 0x18(%rsi)
leaq 0x36b(%rip), %rax       # 0x4cfb6
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/divgs.c
// Function: identify_div_fmt
static u8 identify_div_fmt(deark *c)
{
	u8 buf[7];

	if(de_getbyte(3) != 0x1a) return 0;
	de_read(buf, 0, sizeof(buf));
	if(de_memcmp(&buf[4], (const void*)"\x0d\x0a\0", 3)) return 0;
	if(!de_memcmp(buf, (const void*)"map", 3)) return DIVFMT_MAP;
	if(!de_memcmp(buf, (const void*)"fpg", 3)) return DIVFMT_FPG;
	if(!de_memcmp(buf, (const void*)"f16", 3)) return DIVFMT_F16;
	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
movl $0x3, %esi
callq 0xef0d5
cmpb $0x1a, %al
jne 0x4d05e
movq 0x18(%rbx), %rdi
xorl %ebx, %ebx
leaq 0x1(%rsp), %r14
movl $0x7, %ecx
movq %r14, %rsi
xorl %edx, %edx
callq 0xeeee8
movzwl 0x4(%r14), %eax
xorl $0xa0d, %eax            # imm = 0xA0D
movzbl 0x6(%r14), %ecx
orw %ax, %cx
jne 0x4d060
movzwl 0x1(%rsp), %eax
xorl $0x616d, %eax           # imm = 0x616D
movzbl 0x3(%rsp), %ecx
xorl $0x70, %ecx
orw %ax, %cx
je 0x4d06a
movzwl 0x1(%rsp), %eax
xorl $0x7066, %eax           # imm = 0x7066
movzbl 0x3(%rsp), %ecx
xorl $0x67, %ecx
orw %ax, %cx
je 0x4d06e
movzwl 0x1(%rsp), %eax
xorl $0x3166, %eax           # imm = 0x3166
movzbl 0x3(%rsp), %ecx
xorl $0x36, %ecx
xorl %edx, %edx
orw %ax, %cx
sete %dl
leal (%rdx,%rdx,2), %ebx
jmp 0x4d060
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movb $0x1, %bl
jmp 0x4d060
movb $0x2, %bl
jmp 0x4d060
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/divgs.c
// Function: div_read_cpoints_p
static void div_read_cpoints_p(deark *c, struct div_ctx *d, i64 *ppos)
{
	i64 n;

	// number of 4-byte "cpoints" items
	if(d->is_archive) {
		n = de_getu32le_p(ppos);
	}
	else {
		n = de_getu16le_p(ppos);
	}
	*ppos += 4*n;
}

// Assembly:
pushq %rbx
movq %rdx, %rbx
cmpb $0x0, 0x5(%rsi)
movq 0x18(%rdi), %rdi
movq %rdx, %rsi
je 0x4d08a
callq 0xef3a0
jmp 0x4d08f
callq 0xef1ed
shlq $0x2, %rax
addq %rax, (%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/divgs.c
// Function: div_do_bitmap
static void div_do_bitmap(deark *c, struct div_ctx *d, struct div_image_ctx *md)
{
	de_bitmap *img = NULL;

	de_dbg(c, "bitmap at %"I64_FMT, md->bitmap_pos);
	if(!de_good_image_dimensions(c, md->w, md->h)) goto done;
	img = de_bitmap_create(c, md->w, md->h, 3);

	if(d->fmt==DIVFMT_F16) {
		div_convert_f16(c, d, md, img);
	}
	else {
		de_convert_image_paletted(c->infile, md->bitmap_pos, 8,
			md->w, d->pal, img, 0);
	}
	de_bitmap_write_to_file_finfo(img, md->fi, DE_CREATEFLAG_OPT_IMAGE);
done:
	de_bitmap_destroy(img);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movq %rsi, %r12
movq %rdi, %r15
movq 0x10(%rdx), %rdx
leaq 0xe9108(%rip), %rsi     # 0x1361c2
xorl %r14d, %r14d
xorl %eax, %eax
callq 0xe9226
movq 0x18(%rbx), %rsi
movq 0x20(%rbx), %rdx
movq %r15, %rdi
callq 0xf241d
testl %eax, %eax
je 0x4d19c
movq 0x18(%rbx), %rsi
movq 0x20(%rbx), %rdx
movq %r15, %rdi
movl $0x3, %ecx
callq 0xf2cab
movq %rax, %r14
cmpb $0x3, 0x4(%r12)
jne 0x4d164
cmpq $0x0, 0x20(%rbx)
jle 0x4d18b
xorl %r12d, %r12d
leaq 0x10(%rsp), %r13
movq 0x18(%rbx), %rax
movq %r12, %rcx
imulq %rax, %rcx
addq %rcx, %rcx
addq 0x10(%rbx), %rcx
movq %rcx, 0x10(%rsp)
testq %rax, %rax
jle 0x4d159
xorl %ebp, %ebp
movq 0x18(%r15), %rdi
movq %r13, %rsi
callq 0xef1ed
movl %eax, %edi
callq 0xece9d
movq %r14, %rdi
movq %rbp, %rsi
movq %r12, %rdx
movl %eax, %ecx
callq 0xf2afd
incq %rbp
cmpq 0x18(%rbx), %rbp
jl 0x4d12d
incq %r12
cmpq 0x20(%rbx), %r12
jl 0x4d10f
jmp 0x4d18b
movq 0x18(%r15), %rdi
movq 0x10(%rbx), %rsi
movq 0x18(%rbx), %rcx
addq $0x8, %r12
movl $0x0, (%rsp)
movl $0x8, %edx
movq %r12, %r8
movq %r14, %r9
callq 0xf35b8
movq 0x38(%rbx), %rsi
movq %r14, %rdi
movl $0x2, %edx
callq 0xf2917
movq %r14, %rdi
callq 0xf28d4
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/divgs.c
// Function: div_image_destroy
static void div_image_destroy(deark *c, struct div_image_ctx *md)
{
	if(!md) return;
	ucstring_destroy(md->descr);
	ucstring_destroy(md->fn);
	de_finfo_destroy(c, md->fi);
	de_free(c, md);
}

// Assembly:
testq %rsi, %rsi
je 0x4d1f2
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x28(%rsi), %rdi
callq 0xf6bb0
movq 0x30(%rbx), %rdi
callq 0xf6bb0
movq 0x38(%rbx), %rsi
movq %r14, %rdi
callq 0xea9b3
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xe9752
retq
nop
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/dosbackup.c
// Function: de_module_dosbackup33
void de_module_dosbackup33(deark *c, struct deark_module_info *mi)
{
	mi->id = "dosbackup33";
	mi->desc = "MS-DOS BACKUP (v3.3+)";
	mi->run_fn = de_run_dosbackup33;
	mi->identify_fn = de_identify_dosbackup33;
	mi->flags |= DE_MODFLAG_MULTIPART;
}

// Assembly:
leaq 0xd167b(%rip), %rax     # 0x11e876
movq %rax, (%rsi)
leaq 0xd167d(%rip), %rax     # 0x11e882
movq %rax, 0x8(%rsi)
leaq 0x14(%rip), %rax        # 0x4d224
movq %rax, 0x18(%rsi)
leaq 0xa18(%rip), %rax       # 0x4dc33
movq %rax, 0x20(%rsi)
orb $0x40, 0x30(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/dosbackup.c
// Function: de_module_dosbackup20
void de_module_dosbackup20(deark *c, struct deark_module_info *mi)
{
	mi->id = "dosbackup20";
	mi->desc = "MS-DOS BACKUP (v2.0-3.2)";
	mi->run_fn = de_run_dosbackup20;
	mi->identify_fn = de_identify_dosbackup20;
	mi->flags |= DE_MODFLAG_MULTIPART;
}

// Assembly:
leaq 0xd0c48(%rip), %rax     # 0x11e898
movq %rax, (%rsi)
leaq 0xd0c4a(%rip), %rax     # 0x11e8a4
movq %rax, 0x8(%rsi)
leaq 0x14(%rip), %rax        # 0x4dc79
movq %rax, 0x18(%rsi)
leaq 0x559(%rip), %rax       # 0x4e1c9
movq %rax, 0x20(%rsi)
orb $0x40, 0x30(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/dosbackup.c
// Function: de_identify_dosbackup20
static int de_identify_dosbackup20(deark *c)
{
	u8 b0;
	u8 b;
	u8 fnlen;
	UI seq_num;
	UI n;
	i64 nulpos;

	if(c->infile->len<128) return 0;
	b0 = de_getbyte(0);
	if(b0!=0 && b0!=0xff) return 0;

	// first letter of filename
	b = de_getbyte(5);
	if(b!='\\' && b!='/') return 0;

	seq_num = (UI)de_getu16le(1);
	if(seq_num==0 || seq_num>255) return 0;

	n = (UI)de_getu16le(3); // unknown bytes, expecting 0
	if(n!=0) return 0;

	// len seems to include the trailing NUL
	fnlen = de_getbyte(83);
	if(fnlen<3 || fnlen>78) return 0;
	nulpos = 5+(i64)fnlen-1;

	// last letter of filename
	b = de_getbyte(nulpos-1);
	if(b<33) return 0;

	// Expecting zeros from the filename trailing NUL, until the fn
	// length byte.
	if(!dbuf_is_all_zeroes(c->infile, nulpos, 83-nulpos)) return 0;

	// Expecting zeroes to fill out the 128-byte header.
	if(!dbuf_is_all_zeroes(c->infile, 84, 44)) return 0;

	return (b0==0xff && seq_num==1) ? 45 : 29;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %r15
movq 0x18(%rdi), %rdi
xorl %ebx, %ebx
cmpq $0x80, 0x18(%rdi)
jl 0x4e2cb
xorl %ebx, %ebx
xorl %esi, %esi
callq 0xef0d5
movl %eax, %r14d
leal -0x1(%r14), %eax
cmpb $-0x2, %al
jb 0x4e2cb
movq 0x18(%r15), %rdi
movl $0x5, %esi
callq 0xef0d5
cmpb $0x5c, %al
je 0x4e21f
movzbl %al, %eax
cmpl $0x2f, %eax
jne 0x4e2cb
movq 0x18(%r15), %rdi
movl $0x1, %esi
callq 0xef1ca
movq %rax, %r12
addl $0xffffff00, %eax       # imm = 0xFFFFFF00
cmpl $0xffffff01, %eax       # imm = 0xFFFFFF01
jb 0x4e2cb
movq 0x18(%r15), %rdi
movl $0x3, %esi
callq 0xef1ca
testl %eax, %eax
jne 0x4e2cb
movq 0x18(%r15), %rdi
movl $0x53, %esi
callq 0xef0d5
leal -0x4f(%rax), %ecx
cmpb $-0x4c, %cl
jb 0x4e2cb
movzbl %al, %r13d
movq 0x18(%r15), %rdi
leaq 0x3(%r13), %rsi
callq 0xef0d5
cmpb $0x21, %al
jb 0x4e2cb
addq $0x4, %r13
movq 0x18(%r15), %rdi
movl $0x53, %edx
subq %r13, %rdx
movq %r13, %rsi
callq 0xf1efb
testl %eax, %eax
je 0x4e2cb
movq 0x18(%r15), %rdi
movl $0x54, %esi
movl $0x2c, %edx
callq 0xf1efb
testl %eax, %eax
je 0x4e2cb
xorl %eax, %eax
cmpl $0x1, %r12d
sete %al
shll $0x4, %eax
addl $0x1d, %eax
cmpb $-0x1, %r14b
movl $0x1d, %ebx
cmovel %eax, %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/dosbackup.c
// Function: dbk_destroy_lctx
static void dbk_destroy_lctx(deark *c, lctx *d)
{
	if(!d) return;

	logical_member_finish_and_free(c, d);

	if(d->need_errmsg) {
		de_err(c, "Failed to process this MS-DOS BACKUP set");
	}
	ucstring_destroy(d->v33_cur_dir_name);
	de_free(c, d->v33_control_file_xidxs);
	de_free(c, d->data_file_xidxs);
	de_free(c, d->v20_fsig_expected);
	de_free(c, d);
}

// Assembly:
testq %rsi, %rsi
je 0x4e341
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x4e3ae
cmpb $0x0, 0x9(%rbx)
je 0x4e302
leaq 0xd07bc(%rip), %rsi     # 0x11eab4
movq %r14, %rdi
xorl %eax, %eax
callq 0xe9df7
movq 0x38(%rbx), %rdi
callq 0xf6bb0
movq 0x20(%rbx), %rsi
movq %r14, %rdi
callq 0xe9752
movq 0x28(%rbx), %rsi
movq %r14, %rdi
callq 0xe9752
movq 0x40(%rbx), %rsi
movq %r14, %rdi
callq 0xe9752
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xe9752
retq