LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/dms.c
// Function: write_extra_track
static void write_extra_track(deark *c, struct dmsctx *d, i64 track_idx, dbuf *trackbuf)
{
	char ext[80];
	dbuf *outf_extra = NULL;

	de_snprintf(ext, sizeof(ext), "extratrack%d.bin",
		(int)d->tracks_by_file_order[track_idx].track_num);
	outf_extra = dbuf_create_output_file(c, ext, NULL, DE_CREATEFLAG_IS_AUX);
	dbuf_copy(trackbuf, 0, trackbuf->len, outf_extra);
	dbuf_close(outf_extra);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq $0x0, -0x78(%rbp)
leaq -0x70(%rbp), %rdi
movq -0x10(%rbp), %rax
addq $0x30, %rax
movq -0x18(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x8(%rax), %ecx
movl $0x50, %esi
leaq 0x14435a(%rip), %rdx    # 0x1a9e23
movb $0x0, %al
callq 0x15a980
movq -0x8(%rbp), %rdi
leaq -0x70(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
movl $0x1, %ecx
callq 0x166c60
movq %rax, -0x78(%rbp)
movq -0x20(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rdx
movq -0x78(%rbp), %rcx
xorl %eax, %eax
movl %eax, %esi
callq 0x166070
movq -0x78(%rbp), %rdi
callq 0x1676a0
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/dms.c
// Function: get_trackflags_descr
static void get_trackflags_descr(deark *c, de_ucstring *s, UI tflags1, UI cmpr)
{
	UI tflags = tflags1;

	if(cmpr==5 || cmpr==6) {
		if(tflags & 0x4) {
			ucstring_append_flags_item(s, "w/RLE");
			tflags -= 0x4;
		}
		if(tflags & 0x2) {
			ucstring_append_flags_item(s, "track has Huffman tree defs");
			tflags -= 0x2;
		}
	}
	if(tflags & 0x1) {
		ucstring_append_flags_item(s, "solid");
		tflags -= 0x1;
	}
	if(tflags>0) ucstring_append_flags_itemf(s, "0x%02x", tflags);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x1c(%rbp)
cmpl $0x5, -0x18(%rbp)
je 0x65b48
cmpl $0x6, -0x18(%rbp)
jne 0x65b92
movl -0x1c(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x65b6c
movq -0x10(%rbp), %rdi
leaq 0x1440db(%rip), %rsi    # 0x1a9c39
callq 0x172680
movl -0x1c(%rbp), %eax
subl $0x4, %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x65b90
movq -0x10(%rbp), %rdi
leaq 0x1440bd(%rip), %rsi    # 0x1a9c3f
callq 0x172680
movl -0x1c(%rbp), %eax
subl $0x2, %eax
movl %eax, -0x1c(%rbp)
jmp 0x65b92
movl -0x1c(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x65bb6
movq -0x10(%rbp), %rdi
leaq 0x1440b3(%rip), %rsi    # 0x1a9c5b
callq 0x172680
movl -0x1c(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jbe 0x65bd1
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %edx
leaq 0x16ac51(%rip), %rsi    # 0x1d081b
movb $0x0, %al
callq 0x1726d0
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/dms.c
// Function: dms_calc_checksum
static u32 dms_calc_checksum(deark *c, struct dmsctx *d, dbuf *f)
{
	u32 cksum;

	de_crcobj_reset(d->crco_cksum);
	de_crcobj_addslice(d->crco_cksum, f, 0, f->len);
	cksum = de_crcobj_getval(d->crco_cksum);
	cksum &= 0xffff;
	return cksum;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x15f250
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rcx
xorl %eax, %eax
movl %eax, %edx
callq 0x15f500
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x15f340
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
andl $0xffff, %eax           # imm = 0xFFFF
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movl $0x8, %esi
callq 0x15b780
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movl $0x0, (%rax)
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x8(%rbp), %rax
leaq 0x4b2(%rip), %rcx       # 0x66480
movq %rcx, 0x30(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x40(%rax)
movq -0x8(%rbp), %rax
leaq 0x657(%rip), %rcx       # 0x66640
movq %rcx, 0x48(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/dms.c
// Function: do_decompress_heavy
static void do_decompress_heavy(deark *c, struct dmsctx *d, struct dms_track_info *tri,
	struct de_dfilter_in_params *dcmpri, struct de_dfilter_out_params *dcmpro,
	struct de_dfilter_results *dres)
{
	struct dmslzh_params lzhparams;

	de_zeromem(&lzhparams, sizeof(struct dmslzh_params));
	lzhparams.cmpr_type = tri->cmpr_type;
	lzhparams.dms_track_flags = tri->track_flags;
	if(tri->is_real) {
		lzhparams.heavy_state = d->saved_heavy_state;
		d->saved_heavy_state = NULL;
	}

	if(tri->track_flags & 0x04) {
		do_decompress_heavy_lzh_rle(c, d, tri, dcmpri, dcmpro, dres, &lzhparams);
	}
	else {
		// LZH, no RLE
		dmslzh_codectype1(c, dcmpri, dcmpro, dres, (void*)&lzhparams);
	}

	if(tri->is_real) {
		d->saved_heavy_state = lzhparams.heavy_state;
	}
	else {
		destroy_heavy_state(c, lzhparams.heavy_state);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
leaq -0x40(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x19140
movq -0x18(%rbp), %rax
movl 0x2c(%rax), %eax
movl %eax, -0x40(%rbp)
movq -0x18(%rbp), %rax
movl 0x28(%rax), %eax
movb %al, -0x3c(%rbp)
movq -0x18(%rbp), %rax
cmpb $0x0, 0x30(%rax)
je 0x663fc
movq -0x10(%rbp), %rax
movq 0x1308(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq $0x0, 0x1308(%rax)
movq -0x18(%rbp), %rax
movl 0x28(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x66432
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %r8
movq -0x30(%rbp), %r9
leaq -0x40(%rbp), %rax
movq %rax, (%rsp)
callq 0x670a0
jmp 0x6644b
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x30(%rbp), %rcx
leaq -0x40(%rbp), %r8
callq 0x67140
movq -0x18(%rbp), %rax
cmpb $0x0, 0x30(%rax)
je 0x66466
movq -0x38(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x1308(%rax)
jmp 0x66473
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x67330
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x6666f
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x15b820
movq -0x8(%rbp), %rax
movq $0x0, 0x28(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x666a9
jmp 0x666f3
movq -0x10(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x666c1
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x177720
movq -0x10(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x666d9
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x177720
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x1676a0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x15b820
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x66749
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rdx
leaq 0x13a3ed(%rip), %rsi    # 0x1a0b2f
movb $0x0, %al
callq 0x15c2a0
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x177620
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %rax
addq 0x20(%rax), %rcx
movq %rcx, 0x20(%rax)
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movl $0x78, %esi
callq 0x15b780
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
leaq 0x143550(%rip), %rcx    # 0x1a9d16
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x8(%rbp), %rax
leaq 0x17f(%rip), %rcx       # 0x66980
movq %rcx, 0x30(%rax)
movq -0x8(%rbp), %rax
leaq 0x360(%rip), %rcx       # 0x66b70
movq %rcx, 0x38(%rax)
movq -0x8(%rbp), %rax
leaq 0x3e1(%rip), %rcx       # 0x66c00
movq %rcx, 0x48(%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movl $0x100, %esi            # imm = 0x100
callq 0x1785d0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rdi
movl $0xfb, %esi
callq 0x178f40
movq -0x18(%rbp), %rcx
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
leaq 0x3f1(%rip), %rcx       # 0x66c60
movq %rcx, 0x8(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movl $0x78, %esi
callq 0x15b780
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
leaq 0x14345e(%rip), %rcx    # 0x1a9d24
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x8(%rbp), %rax
leaq 0x40f(%rip), %rcx       # 0x66d10
movq %rcx, 0x30(%rax)
movq -0x8(%rbp), %rax
leaq 0x700(%rip), %rcx       # 0x67010
movq %rcx, 0x38(%rax)
movq -0x8(%rbp), %rax
leaq 0x2e1(%rip), %rcx       # 0x66c00
movq %rcx, 0x48(%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movl $0x4000, %esi           # imm = 0x4000
callq 0x1785d0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rdi
movl $0x3fbe, %esi           # imm = 0x3FBE
callq 0x178f40
movq -0x18(%rbp), %rcx
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
leaq 0x2f1(%rip), %rcx       # 0x66c60
movq %rcx, 0x8(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x18(%rbp)
cmpl $0x3, -0xc(%rbp)
jne 0x66bc9
movq -0x18(%rbp), %rdi
addq $0x38, %rdi
callq 0x16a360
movq -0x18(%rbp), %rax
movl $0x0, 0x48(%rax)
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movl 0x10(%rax), %esi
addl $0x5, %esi
callq 0x178f40
jmp 0x66bf0
cmpl $0x4, -0xc(%rbp)
jne 0x66bee
movq -0x18(%rbp), %rax
movq $0x0, 0x28(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x20(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x20(%rax)
jmp 0x66bf0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x66c43
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rsi
callq 0x178950
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x15b820
movq -0x8(%rbp), %rax
movq $0x0, 0x28(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movb %sil, %al
movq %rdi, -0x8(%rbp)
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x66cc0
cmpl $0x0, %eax
je 0x66c8d
jmp 0x66cb1
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax), %rdi
movzbl -0x9(%rbp), %esi
callq 0x168380
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x28(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/dms.c
// Function: medium_have_enough_output
static int medium_have_enough_output(struct medium_ctx *mctx)
{
	if(mctx->dcmpro->len_known) {
		if(mctx->nbytes_written >= mctx->dcmpro->expected_len) {
			return 1;
		}
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
cmpb $0x0, 0x8(%rax)
je 0x66cf7
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x10(%rcx), %rcx
cmpq 0x10(%rcx), %rax
jl 0x66cf5
movl $0x1, -0x4(%rbp)
jmp 0x66cfe
jmp 0x66cf7
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/dms.c
// Function: do_decompress_heavy_lzh_rle
static void do_decompress_heavy_lzh_rle(deark *c, struct dmsctx *d, struct dms_track_info *tri,
	struct de_dfilter_in_params *dcmpri, struct de_dfilter_out_params *dcmpro,
	struct de_dfilter_results *dres, struct dmslzh_params *lzhparams)
{
	struct de_dcmpr_two_layer_params tlp;

	de_zeromem(&tlp, sizeof(struct de_dcmpr_two_layer_params));
	tlp.codec1_type1 = dmslzh_codectype1;
	tlp.codec1_private_params = (void*)lzhparams;
	tlp.codec2 = dmsrle_codec;
	tlp.dcmpri = dcmpri;
	tlp.dcmpro = dcmpro;
	tlp.dres = dres;
	tlp.intermed_expected_len = tri->intermediate_len;
	tlp.intermed_len_known = 1;
	de_dfilter_decompress_two_layer(c, &tlp);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
leaq -0x80(%rbp), %rdi
xorl %esi, %esi
movl $0x50, %edx
callq 0x19140
leaq 0x62(%rip), %rax        # 0x67140
movq %rax, -0x80(%rbp)
movq 0x10(%rbp), %rax
movq %rax, -0x70(%rbp)
leaq -0x1171(%rip), %rax     # 0x65f80
movq %rax, -0x68(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x38(%rbp)
movb $0x1, -0x40(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x178cf0
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x67349
jmp 0x6737c
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x18, %rsi
callq 0x677a0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x20, %rsi
callq 0x677a0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x178950
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movb %sil, %al
movq %rdi, -0x8(%rbp)
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x67970
cmpl $0x0, %eax
je 0x6776d
jmp 0x67791
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax), %rdi
movzbl -0x9(%rbp), %esi
callq 0x168380
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x28(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/dms.c
// Function: lzh_have_enough_output
static int lzh_have_enough_output(struct lzh_ctx *cctx)
{
	if(cctx->dcmpro->len_known) {
		if(cctx->nbytes_written >= cctx->dcmpro->expected_len) {
			return 1;
		}
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
cmpb $0x0, 0x8(%rax)
je 0x679a7
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x10(%rcx), %rcx
cmpq 0x10(%rcx), %rax
jl 0x679a5
movl $0x1, -0x4(%rbp)
jmp 0x679ae
jmp 0x679a7
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x679e6
jmp 0x67a8b
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rsi
addq $0x38, %rsi
leaq -0x14(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
callq 0x187bc0
movl %eax, -0x18(%rbp)
movq -0x8(%rbp), %rax
cmpb $0x0, 0x50(%rax)
je 0x67a4a
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rsi
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdx
leaq 0x1423b9(%rip), %rcx    # 0x1a9dea
movb $0x0, %al
callq 0x177450
movq -0x8(%rbp), %rdi
callq 0x67aa0
movl $0x0, -0x14(%rbp)
jmp 0x67a8b
cmpl $0x0, -0x18(%rbp)
jne 0x67a87
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rsi
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdx
leaq 0x14239e(%rip), %rcx    # 0x1a9e0c
movb $0x0, %al
callq 0x177450
movq -0x8(%rbp), %rdi
callq 0x67aa0
movl $0x0, -0x14(%rbp)
jmp 0x67a8b
jmp 0x67a89
jmp 0x67a8b
movl -0x14(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
leaq 0x142332(%rip), %rcx    # 0x1a9e39
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
leaq 0x14232c(%rip), %rcx    # 0x1a9e41
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
leaq 0x1c(%rip), %rcx        # 0x67b40
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
leaq 0xed(%rip), %rcx        # 0x67c20
movq %rcx, 0x20(%rax)
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/colorix.c
// Function: de_run_colorix
static void de_run_colorix(deark *c, de_module_params *mparams)
{
	struct colorix_ctx *d = NULL;

	d = de_malloc(c, sizeof(struct colorix_ctx));

	if(is_RIX3(c->infile)) {
		d->fmtver = RIXFMT_RIX3;
	}
	else {
		d->fmtver = detect_old_fmt(c->infile, 0);
		if(d->fmtver==RIXFMT_OLD_C) {
			d->is_compressed = 1;
		}
	}

	if(d->fmtver==RIXFMT_RIX3) {
		do_colorix_RIX3(c, d);
	}
	else if(d->fmtver==RIXFMT_OLD_U || d->fmtver==RIXFMT_OLD_C) {
		do_colorix_old_SCR(c, d);
	}
	else {
		de_err(c, "Unknown or unsupported RIX format");
		goto done;
	}

done:
	de_free(c, d);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movl $0x440, %esi            # imm = 0x440
callq 0x15b780
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x67ce0
cmpl $0x0, %eax
je 0x67b88
movq -0x18(%rbp), %rax
movl $0x3, (%rax)
jmp 0x67bb2
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
xorl %esi, %esi
callq 0x67d30
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movq -0x18(%rbp), %rax
cmpl $0x2, (%rax)
jne 0x67bb0
movq -0x18(%rbp), %rax
movb $0x1, 0x7(%rax)
jmp 0x67bb2
movq -0x18(%rbp), %rax
cmpl $0x3, (%rax)
jne 0x67bca
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x67e50
jmp 0x67c01
movq -0x18(%rbp), %rax
cmpl $0x1, (%rax)
je 0x67bdc
movq -0x18(%rbp), %rax
cmpl $0x2, (%rax)
jne 0x67beb
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x680e0
jmp 0x67bff
movq -0x8(%rbp), %rdi
leaq 0x142253(%rip), %rsi    # 0x1a9e49
movb $0x0, %al
callq 0x15bfb0
jmp 0x67c03
jmp 0x67c01
jmp 0x67c03
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x15b820
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
cmpq $0x24, 0x18(%rax)
jge 0x67c47
movl $0x0, -0x4(%rbp)
jmp 0x67ccb
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x67ce0
cmpl $0x0, %eax
je 0x67c62
movl $0x5f, -0x4(%rbp)
jmp 0x67ccb
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
cmpl $0x37, (%rax)
jl 0x67c78
movl $0x0, -0x4(%rbp)
jmp 0x67ccb
movq -0x10(%rbp), %rdi
leaq 0x159eb7(%rip), %rsi    # 0x1c1b3a
callq 0x15d180
cmpl $0x0, %eax
je 0x67cc4
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0x1, %esi
callq 0x67d30
movl %eax, -0x14(%rbp)
cmpl $0x1, -0x14(%rbp)
jne 0x67cb1
movl $0x23, -0x4(%rbp)
jmp 0x67ccb
cmpl $0x2, -0x14(%rbp)
jne 0x67cc0
movl $0x37, -0x4(%rbp)
jmp 0x67ccb
jmp 0x67cc2
jmp 0x67cc4
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movb %sil, %al
movq %rdi, -0x10(%rbp)
movb %al, -0x11(%rbp)
movb $0x0, -0x21(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x24, 0x18(%rax)
jge 0x67d5d
movl $0x0, -0x4(%rbp)
jmp 0x67e38
movq -0x10(%rbp), %rdi
leaq -0x40(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
movl $0x10, %ecx
callq 0x164d10
movq $0x0, -0x20(%rbp)
cmpq $0x10, -0x20(%rbp)
jae 0x67df7
cmpq $0x0, -0x20(%rbp)
jne 0x67dd0
movq -0x20(%rbp), %rax
movzbl -0x40(%rbp,%rax), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x67db5
movb $0x1, -0x21(%rbp)
movq -0x20(%rbp), %rax
movzbl -0x40(%rbp,%rax), %ecx
subl $0x80, %ecx
movb %cl, -0x40(%rbp,%rax)
jmp 0x67dce
movq -0x10(%rbp), %rax
cmpq $0x1b590, 0x18(%rax)    # imm = 0x1B590
je 0x67dcc
movl $0x0, -0x4(%rbp)
jmp 0x67e38
jmp 0x67dce
jmp 0x67dd0
movq -0x20(%rbp), %rax
movzbl -0x40(%rbp,%rax), %eax
cmpl $0x3f, %eax
jle 0x67de7
movl $0x0, -0x4(%rbp)
jmp 0x67e38
jmp 0x67de9
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x67d7b
cmpb $0x0, -0x21(%rbp)
jne 0x67e06
movl $0x1, -0x4(%rbp)
jmp 0x67e38
cmpb $0x0, -0x11(%rbp)
jne 0x67e15
movl $0x2, -0x4(%rbp)
jmp 0x67e38
movq -0x10(%rbp), %rdi
movl $0x10, %esi
callq 0x68390
cmpl $0x0, %eax
je 0x67e31
movl $0x2, -0x4(%rbp)
jmp 0x67e38
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/colorix.c
// Function: looks_like_compressed_data
static int looks_like_compressed_data(dbuf *f, i64 pos1)
{
	i64 pos = pos1;
	i64 first_image_seg_pos;
	int retval = 0;
	i64 i;
	i64 num_codebook_items;
	i64 num_items_to_check;

	// Validate the codebook size, and some of the items
	num_codebook_items = dbuf_getu16le_p(f, &pos);
	if(num_codebook_items<3 || num_codebook_items>513) goto done;
	first_image_seg_pos = pos + num_codebook_items*2;
	if(first_image_seg_pos > f->len) goto done;

	num_items_to_check = de_min_int(num_codebook_items-2, 16);
	for(i=0; i<num_items_to_check; i++) {
		UI item;

		item = (UI)dbuf_getu16le_p(f, &pos);
		if(item<0x1000) {
			if((item&0x1)!=0) goto done;
			if(pos+item >= first_image_seg_pos) goto done;
		}
		else if(item<=0x10ff) {
			;
		}
		else {
			goto done;
		}
	}

	// Validate the image segment sizes
	pos = first_image_seg_pos;
	for(i=0; i<4; i++) {
		i64 seg_len;

		if(pos+3 > f->len) goto done;
		seg_len = dbuf_getu16le_p(f, &pos);
		if(seg_len<RIX_MIN_OLD_SEGMENT_DLEN) goto done;

		pos += seg_len;
	}

	if(pos==f->len) {
		retval = 1;
	}

done:
	return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movl $0x0, -0x24(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x1652c0
movq %rax, -0x38(%rbp)
cmpq $0x3, -0x38(%rbp)
jl 0x683d1
cmpq $0x201, -0x38(%rbp)     # imm = 0x201
jle 0x683d6
jmp 0x684fb
movq -0x18(%rbp), %rax
movq -0x38(%rbp), %rcx
shlq %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x18(%rcx), %rax
jle 0x683fb
jmp 0x684fb
movq -0x38(%rbp), %rdi
subq $0x2, %rdi
movl $0x10, %esi
callq 0x15ccf0
movq %rax, -0x40(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x40(%rbp), %rax
jge 0x68485
movq -0x8(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x1652c0
movl %eax, -0x44(%rbp)
cmpl $0x1000, -0x44(%rbp)    # imm = 0x1000
jae 0x68463
movl -0x44(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x6844c
jmp 0x684fb
movq -0x18(%rbp), %rax
movl -0x44(%rbp), %ecx
addq %rcx, %rax
cmpq -0x20(%rbp), %rax
jl 0x68461
jmp 0x684fb
jmp 0x68475
cmpl $0x10ff, -0x44(%rbp)    # imm = 0x10FF
ja 0x6846e
jmp 0x68473
jmp 0x684fb
jmp 0x68475
jmp 0x68477
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x68419
movq -0x20(%rbp), %rax
movq %rax, -0x18(%rbp)
movq $0x0, -0x30(%rbp)
cmpq $0x4, -0x30(%rbp)
jge 0x684e4
movq -0x18(%rbp), %rax
addq $0x3, %rax
movq -0x8(%rbp), %rcx
cmpq 0x18(%rcx), %rax
jle 0x684b0
jmp 0x684fb
movq -0x8(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x1652c0
movq %rax, -0x50(%rbp)
cmpq $0x64, -0x50(%rbp)
jge 0x684ca
jmp 0x684fb
movq -0x50(%rbp), %rax
addq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x68495
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x18(%rcx), %rax
jne 0x684f9
movl $0x1, -0x24(%rbp)
jmp 0x684fb
movl -0x24(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/colorix.c
// Function: read_colorix_palette
static void read_colorix_palette(deark *c, struct colorix_ctx *d, i64 pos1)
{
	if(d->paltype==0xab) {
		de_read_simple_palette(c, c->infile, pos1, 16, 3, d->pal, 16, DE_RDPALTYPE_VGA18BIT, 0);
		d->pal_nbytes = 48;
	}
	else { // assume 0xaf
		de_read_simple_palette(c, c->infile, pos1, 256, 3, d->pal, 256, DE_RDPALTYPE_VGA18BIT, 0);
		d->pal_nbytes = 768;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movzbl 0x4(%rax), %eax
cmpl $0xab, %eax
jne 0x685e3
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rsi
movq -0x18(%rbp), %rdx
movq -0x10(%rbp), %r9
addq $0x40, %r9
movl $0x10, %ecx
movl $0x3, %r8d
xorl %eax, %eax
movq $0x10, (%rsp)
movl $0x2, 0x8(%rsp)
movl $0x0, 0x10(%rsp)
callq 0x16c160
movq -0x10(%rbp), %rax
movq $0x30, 0x30(%rax)
jmp 0x68631
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rsi
movq -0x18(%rbp), %rdx
movq -0x10(%rbp), %r9
addq $0x40, %r9
movl $0x100, %ecx            # imm = 0x100
movl $0x3, %r8d
xorl %eax, %eax
movq $0x100, (%rsp)          # imm = 0x100
movl $0x2, 0x8(%rsp)
movl $0x0, 0x10(%rsp)
callq 0x16c160
movq -0x10(%rbp), %rax
movq $0x300, 0x30(%rax)      # imm = 0x300
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/colorix.c
// Function: do_colorix_decompress
static int do_colorix_decompress(deark *c, struct colorix_ctx *d, i64 pos1,
	dbuf *unc_pixels)
{
	int retval = 0;
	struct de_dfilter_in_params dcmpri;
	struct de_dfilter_out_params dcmpro;
	struct de_dfilter_results dres;
	struct de_rixdecomp_params params;

	de_zeromem(&params, sizeof(struct de_rixdecomp_params));
	params.known_segment_size = d->known_segment_size;
	params.rowspan = d->rowspan;
	params.imgtype = d->imgtype;

	de_dfilter_init_objects(c, &dcmpri, &dcmpro, &dres);
	dcmpri.f = c->infile;
	dcmpri.pos = pos1;
	dcmpri.len = c->infile->len - pos1;
	dcmpro.f = unc_pixels;
	dcmpro.expected_len = d->unc_image_size;
	dcmpro.len_known = 1;

	rixdecomp_codectype1(c, &dcmpri, &dcmpro, &dres, (void*)&params);
	dbuf_flush(dcmpro.f);

	if(dres.errcode) {
		de_err(c, "Decompression failed: %s", de_dfilter_get_errmsg(c, &dres));
		goto done;
	}

	retval = 1;
done:
	return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
leaq -0xd8(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x19140
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0xd8(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0xd0(%rbp)
movq -0x10(%rbp), %rax
movb 0x6(%rax), %al
movb %al, -0xc8(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x48(%rbp), %rsi
leaq -0x60(%rbp), %rdx
leaq -0xc0(%rbp), %rcx
callq 0x1773f0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x18(%rax), %rax
subq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x50(%rbp)
movb $0x1, -0x58(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x48(%rbp), %rsi
leaq -0x60(%rbp), %rdx
leaq -0xc0(%rbp), %rcx
leaq -0xd8(%rbp), %r8
callq 0x689c0
movq -0x60(%rbp), %rdi
callq 0x167c30
cmpl $0x0, -0xc0(%rbp)
je 0x6899e
movq -0x8(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq -0x8(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x177360
movq -0xe0(%rbp), %rdi
movq %rax, %rdx
leaq 0x137668(%rip), %rsi    # 0x19fffd
movb $0x0, %al
callq 0x15bfb0
jmp 0x689a5
movl $0x1, -0x24(%rbp)
movl -0x24(%rbp), %eax
addq $0xe0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/colorix.c
// Function: rixdecomp_process_codes_segment
static void rixdecomp_process_codes_segment(deark *c, struct rixdecomp_ctx *rhctx, i64 dpos1, i64 dlen)
{
	de_zeromem(&rhctx->bitrd, sizeof(struct de_bitreader));
	rhctx->bitrd.bbll.is_lsb = 0;
	rhctx->bitrd.f = rhctx->dcmpri->f;
	rhctx->bitrd.curpos = dpos1;
	rhctx->bitrd.endpos = dpos1 + dlen;
	de_bitbuf_lowlevel_empty(&rhctx->bitrd.bbll);
	fmtutil_huffman_reset_cursor(rhctx->ht->cursor);

	rhctx->rle_state = RIX_RLESTATE_NEUTRAL;
	rhctx->rle_curr_color = 0x00;

	while(1) {
		int ret;
		fmtutil_huffman_valtype val = 0;

		ret = fmtutil_huffman_read_next_value(rhctx->ht->bk, &rhctx->bitrd, &val, NULL);
		if(!ret || val<0 || val>255) {
			// We don't always know exactly where the data stops, so don't report
			// errors here.
			goto done;
		}

		rixdecomp_process_rle_byte(c, rhctx, (u8)val);
	}

done:
	;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x10(%rbp), %rdi
addq $0x58, %rdi
xorl %esi, %esi
movl $0x30, %edx
callq 0x19140
movq -0x10(%rbp), %rax
movb $0x0, 0x78(%rax)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x58(%rax)
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x60(%rax)
movq -0x18(%rbp), %rcx
addq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x68(%rax)
movq -0x10(%rbp), %rdi
addq $0x58, %rdi
addq $0x20, %rdi
callq 0x16a360
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rax
movq (%rax), %rdi
callq 0x187700
movq -0x10(%rbp), %rax
movl $0x0, 0x98(%rax)
movq -0x10(%rbp), %rax
movb $0x0, 0x9c(%rax)
movl $0x0, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rax
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rsi
addq $0x58, %rsi
leaq -0x28(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
callq 0x187bc0
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0x6905d
cmpl $0x0, -0x28(%rbp)
jl 0x6905d
cmpl $0xff, -0x28(%rbp)
jle 0x6905f
jmp 0x69074
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x28(%rbp), %eax
movzbl %al, %edx
callq 0x69280
jmp 0x6901d
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/colorix.c
// Function: rixdecomp_process_rle_byte
static void rixdecomp_process_rle_byte(deark *c, struct rixdecomp_ctx *rhctx, u8 n)
{
	i64 count = 0;
	i64 k;
	u8 val;

	if(rhctx->nbytes_written >= rhctx->dcmpro->expected_len) {
		goto done;
	}

	switch(rhctx->rle_state) {
	case RIX_RLESTATE_NEUTRAL:
		if(n==0x00 || n==0xff) {
			rhctx->rle_state = RIX_RLESTATE_WAITING_FOR_REPEAT_COUNT;
			rhctx->rle_byte_to_repeat = n;
			goto done;
		}
		else {
			count = 1;
			val = n;
		}
		break;
	case RIX_RLESTATE_WAITING_FOR_REPEAT_COUNT:
		count = (i64)n + 1;
		val = rhctx->rle_byte_to_repeat;
		rhctx->rle_state = RIX_RLESTATE_NEUTRAL;
		break;
	}

	for(k = 0; k<count; k++) {
		if(rhctx->use_xor_filter) {
			rhctx->rle_curr_color ^= val;
		}
		else {
			rhctx->rle_curr_color = val;
		}
		dbuf_writebyte(rhctx->dcmpro->f, rhctx->rle_curr_color);
	}
	rhctx->nbytes_written += count;
done:
	;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movb %dl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb %al, -0x11(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x18(%rcx), %rcx
cmpq 0x10(%rcx), %rax
jl 0x692b8
jmp 0x693bb
movq -0x10(%rbp), %rax
movl 0x98(%rax), %eax
movl %eax, -0x30(%rbp)
testl %eax, %eax
je 0x692d5
jmp 0x692cb
movl -0x30(%rbp), %eax
subl $0x1, %eax
je 0x69319
jmp 0x69340
movzbl -0x11(%rbp), %eax
cmpl $0x0, %eax
je 0x692e9
movzbl -0x11(%rbp), %eax
cmpl $0xff, %eax
jne 0x69309
movq -0x10(%rbp), %rax
movl $0x1, 0x98(%rax)
movb -0x11(%rbp), %cl
movq -0x10(%rbp), %rax
movb %cl, 0x9d(%rax)
jmp 0x693bb
movq $0x1, -0x20(%rbp)
movb -0x11(%rbp), %al
movb %al, -0x29(%rbp)
jmp 0x69340
movzbl -0x11(%rbp), %eax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movb 0x9d(%rax), %al
movb %al, -0x29(%rbp)
movq -0x10(%rbp), %rax
movl $0x0, 0x98(%rax)
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x20(%rbp), %rax
jge 0x693ab
movq -0x10(%rbp), %rax
cmpb $0x0, 0x31(%rax)
je 0x69375
movzbl -0x29(%rbp), %edx
movq -0x10(%rbp), %rax
movzbl 0x9c(%rax), %ecx
xorl %edx, %ecx
movb %cl, 0x9c(%rax)
jmp 0x69382
movb -0x29(%rbp), %cl
movq -0x10(%rbp), %rax
movb %cl, 0x9c(%rax)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movzbl 0x9c(%rax), %esi
callq 0x168380
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x69348
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
addq 0x38(%rax), %rcx
movq %rcx, 0x38(%rax)
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/colorix.c
// Function: acquire_palette_ega64idx
static void acquire_palette_ega64idx(deark *c, struct colorix_ctx *d, i64 pos1)
{
	i64 k;
	i64 pos = pos1;
	char tmps[32];

	for(k=0; k<16; k++) {
		int index;

		index = (int)de_getbyte_p(&pos);
		index &= 0x3f;
		d->pal[k] = de_get_std_palette_entry(DE_PALID_EGA64, 0, index);
		de_snprintf(tmps, sizeof(tmps), "%2d ", index);
		de_dbg_pal_entry2(c, k, d->pal[k], tmps, NULL, NULL);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq $0x0, -0x20(%rbp)
cmpq $0x10, -0x20(%rbp)
jge 0x6948c
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x28(%rbp), %rsi
callq 0x165170
movzbl %al, %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %eax
andl $0x3f, %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %edx
movl $0x1e, %edi
xorl %esi, %esi
callq 0x161150
movl %eax, %edx
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
movl %edx, 0x40(%rax,%rcx,4)
leaq -0x50(%rbp), %rdi
movl -0x54(%rbp), %ecx
movl $0x20, %esi
leaq 0x140bd5(%rip), %rdx    # 0x1aa024
movb $0x0, %al
callq 0x15a980
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
movl 0x40(%rax,%rcx,4), %edx
leaq -0x50(%rbp), %rcx
xorl %eax, %eax
movl %eax, %r9d
movq %r9, %r8
callq 0x15bdb0
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x693f4
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
leaq 0x140ba6(%rip), %rcx    # 0x1aa05d
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
leaq 0x140b9d(%rip), %rcx    # 0x1aa062
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
leaq 0x2c(%rip), %rcx        # 0x69500
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
leaq 0x37d(%rip), %rcx       # 0x69860
movq %rcx, 0x20(%rax)
movq -0x10(%rbp), %rax
leaq 0x3ce(%rip), %rcx       # 0x698c0
movq %rcx, 0x28(%rax)
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/diet.c
// Function: de_identify_diet
static int de_identify_diet(deark *c)
{
	struct diet_identify_data idd;

	de_zeromem(&idd, sizeof(struct diet_identify_data));
	identify_diet_fmt(c, &idd, 1, NULL);
	if(idd.ftype!=FTYPE_UNKNOWN) return 90;
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
leaq -0x38(%rbp), %rdi
xorl %esi, %esi
movl $0x28, %edx
callq 0x19140
movq -0x10(%rbp), %rdi
leaq -0x38(%rbp), %rsi
movl $0x1, %edx
xorl %eax, %eax
movl %eax, %ecx
callq 0x698f0
cmpl $0x0, -0x34(%rbp)
je 0x698a1
movl $0x5a, -0x4(%rbp)
jmp 0x698a8
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/diet.c
// Function: check_diet_crc
static void check_diet_crc(deark *c, lctx *d)
{
	u32 crc_calc;
	struct de_crcobj *crco = NULL;

	if(!d->cmpr_len_known) {
		// TODO: For v1.00 COM format, we don't know how to figure out the
		// compressed data size, and it doesn't end at the end of the file.
		// (Testing the CRC *after* decompression, after we've found the "stop"
		// code, isn't the right thing to do for this type of CRC.)
		goto done;
	}
	if(d->cmpr_pos+d->cmpr_len > c->infile->len) goto done;

	crco = de_crcobj_create(c, DE_CRCOBJ_CRC16_ARC);
	de_crcobj_addslice(crco, c->infile, d->cmpr_pos, d->cmpr_len);
	crc_calc = de_crcobj_getval(crco);
	de_dbg(c, "crc (calculated): 0x%04x", (UI)crc_calc);
	// Unfortunately, this is a CRC of the *compressed* data, so we can't use it
	// to tell if we decompressed the data correctly.
	if(crc_calc!=d->crc_reported) {
		de_warn(c, "CRC check failed (expected 0x%04x, got 0x%04x). "
			"File may be corrupted.", (UI)d->crc_reported,
			(UI)crc_calc);
	}
done:
	de_crcobj_destroy(crco);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x10(%rbp), %rax
cmpb $0x0, 0x2a(%rax)
jne 0x6a227
jmp 0x6a2c5
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x10(%rbp), %rcx
addq 0x30(%rcx), %rax
movq -0x8(%rbp), %rcx
movq 0x18(%rcx), %rcx
cmpq 0x18(%rcx), %rax
jle 0x6a247
jmp 0x6a2c5
movq -0x8(%rbp), %rdi
movl $0x21, %esi
callq 0x15eac0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rdx
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rcx
callq 0x15f500
movq -0x20(%rbp), %rdi
callq 0x15f340
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %edx
leaq 0x136df3(%rip), %rsi    # 0x1a1087
movb $0x0, %al
callq 0x15b0d0
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x48(%rcx), %eax
je 0x6a2c3
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x48(%rax), %edx
movl -0x14(%rbp), %ecx
leaq 0x13ff10(%rip), %rsi    # 0x1aa1cc
movb $0x0, %al
callq 0x15bc10
jmp 0x6a2c5
movq -0x20(%rbp), %rdi
callq 0x15f2e0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/diet.c
// Function: check_unsupp_features
static void check_unsupp_features(deark *c, lctx *d)
{
	if(d->hdr_flags1&0x80) {
		d->errflag = 1;
		d->need_errmsg = 1;
		goto done;
	}

done:
	;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movzbl 0x2d(%rax), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x6a310
movq -0x10(%rbp), %rax
movb $0x1, 0x28(%rax)
movq -0x10(%rbp), %rax
movb $0x1, 0x29(%rax)
jmp 0x6a312
jmp 0x6a312
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x2, 0x4(%rax)
je 0x6a81f
movq -0x10(%rbp), %rax
movzbl 0xb(%rax), %eax
cmpl $0x0, %eax
je 0x6a82c
leaq 0x1449b0(%rip), %rax    # 0x1af1d6
movq %rax, -0x20(%rbp)
jmp 0x6a837
leaq 0x1569d4(%rip), %rax    # 0x1c1207
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
xorl %ecx, %ecx
callq 0x166c60
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movq 0x18(%rax), %rdx
movq -0x18(%rbp), %rcx
xorl %eax, %eax
movl %eax, %esi
callq 0x166070
movq -0x10(%rbp), %rax
cmpl $0x2, 0x4(%rax)
jne 0x6a882
movq -0x8(%rbp), %rdi
callq 0x15bbe0
movq -0x18(%rbp), %rdi
callq 0x1676a0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)