LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/misc.c
// Function: de_run_lzss_oku
static void de_run_lzss_oku(deark *c, de_module_params *mparams)
{
	dbuf *outf = NULL;
	struct de_dfilter_in_params dcmpri;
	struct de_dfilter_out_params dcmpro;
	struct de_dfilter_results dres;

	outf = dbuf_create_output_file(c, "unc", NULL, 0);
	dbuf_enable_wbuffer(outf);
	de_dfilter_init_objects(c, &dcmpri, &dcmpro, &dres);
	dcmpri.f = c->infile;
	dcmpri.pos = 0;
	dcmpri.len = c->infile->len;
	dcmpro.f = outf;

	fmtutil_decompress_lzss1(c, &dcmpri, &dcmpro, &dres, 0x0);
	dbuf_flush(outf);
	if(dres.errcode) {
		de_err(c, "Decompression failed: %s", de_dfilter_get_errmsg(c, &dres));
	}

	dbuf_close(outf);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa0, %rsp
movq %rdi, %rbx
leaq 0xe6c60(%rip), %rsi     # 0x14d49a
xorl %edx, %edx
xorl %ecx, %ecx
callq 0xefda1
movq %rax, %r14
movq %rax, %rdi
callq 0xf0855
leaq 0x20(%rsp), %r15
leaq 0x8(%rsp), %r12
leaq 0x40(%rsp), %r13
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %r13, %rcx
callq 0xfa1dc
movq 0x18(%rbx), %rax
movq %rax, (%r15)
movq $0x0, 0x8(%r15)
movq 0x18(%rax), %rax
movq %rax, 0x10(%r15)
movq %r14, (%r12)
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %r13, %rcx
xorl %r8d, %r8d
callq 0xfaeff
movq %r14, %rdi
callq 0xf08ba
cmpl $0x0, (%r13)
je 0x668cd
leaq 0x40(%rsp), %rsi
movq %rbx, %rdi
callq 0xfa1a4
leaq 0xad961(%rip), %rsi     # 0x114221
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9295
movq %r14, %rdi
callq 0xf052b
addq $0xa0, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/misc.c
// Function: de_run_lzhuf
static void de_run_lzhuf(deark *c, de_module_params *mparams)
{
	i64 unc_filesize;
	dbuf *outf = NULL;
	struct de_dfilter_in_params dcmpri;
	struct de_dfilter_out_params dcmpro;
	struct de_dfilter_results dres;

	// We're assuming the size field is 4 bytes, little-endian. (But it could
	// be platform-specific.)
#define LZHUF_HDRSIZE 4
#define LZHUF_IS_LE   1

	if(c->infile->len<LZHUF_HDRSIZE) goto done;
	unc_filesize = dbuf_getint_ext(c->infile, 0, LZHUF_HDRSIZE, LZHUF_IS_LE, 0);
	de_dbg(c, "orig filesize: %"I64_FMT, unc_filesize);

	outf = dbuf_create_output_file(c, "unc", NULL, 0);
	dbuf_enable_wbuffer(outf);
	de_dfilter_init_objects(c, &dcmpri, &dcmpro, &dres);
	dcmpri.f = c->infile;
	dcmpri.pos = LZHUF_HDRSIZE;
	dcmpri.len = c->infile->len-LZHUF_HDRSIZE;
	dcmpro.f = outf;
	dcmpro.len_known = 1;
	dcmpro.expected_len = unc_filesize;

	fmtutil_lh1_codectype1(c, &dcmpri, &dcmpro, &dres, NULL);
	dbuf_flush(outf);
	if(dres.errcode) {
		de_err(c, "Decompression failed: %s", de_dfilter_get_errmsg(c, &dres));
	}
done:
	dbuf_close(outf);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
cmpq $0x4, 0x18(%rdi)
jge 0x6692e
xorl %r14d, %r14d
jmp 0x66a03
xorl %esi, %esi
movl $0x4, %edx
movl $0x1, %ecx
xorl %r8d, %r8d
callq 0xef0f6
movq %rax, %r15
leaq 0xbe199(%rip), %rsi     # 0x124ae5
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
leaq 0xe6b3a(%rip), %rsi     # 0x14d49a
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0xefda1
movq %rax, %r14
movq %rax, %rdi
callq 0xf0855
leaq 0x18(%rsp), %r12
movq %rsp, %r13
leaq 0x38(%rsp), %rbp
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %rbp, %rcx
callq 0xfa1dc
movq 0x18(%rbx), %rax
movq %rax, (%r12)
movq $0x4, 0x8(%r12)
movq 0x18(%rax), %rax
addq $-0x4, %rax
movq %rax, 0x10(%r12)
movq %r14, (%r13)
movb $0x1, 0x8(%r13)
movq %r15, 0x10(%r13)
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %rbp, %rcx
xorl %r8d, %r8d
callq 0x106c60
movq %r14, %rdi
callq 0xf08ba
cmpl $0x0, (%rbp)
je 0x66a03
leaq 0x38(%rsp), %rsi
movq %rbx, %rdi
callq 0xfa1a4
leaq 0xad82b(%rip), %rsi     # 0x114221
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9295
movq %r14, %rdi
callq 0xf052b
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/misc.c
// Function: de_module_compress_lzh
void de_module_compress_lzh(deark *c, struct deark_module_info *mi)
{
	mi->id = "compress_lzh";
	mi->desc = "SCO compress LZH";
	mi->run_fn = de_run_compress_lzh;
	mi->identify_fn = de_identify_compress_lzh;
}

// Assembly:
leaq 0xbdaf6(%rip), %rax     # 0x12451a
movq %rax, (%rsi)
leaq 0xbdaf9(%rip), %rax     # 0x124527
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x66a49
movq %rax, 0x18(%rsi)
leaq 0xf6(%rip), %rax        # 0x66b3a
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/misc.c
// Function: de_run_compress_lzh
static void de_run_compress_lzh(deark *c, de_module_params *mparams)
{
	dbuf *outf = NULL;
	struct de_dfilter_in_params dcmpri;
	struct de_dfilter_out_params dcmpro;
	struct de_dfilter_results dres;
	struct de_lh5x_params lzhparams;

#define SCOLZH_HDRSIZE 2
	if(c->infile->len<SCOLZH_HDRSIZE) goto done;
	outf = dbuf_create_output_file(c, "unc", NULL, 0);
	dbuf_enable_wbuffer(outf);
	de_dfilter_init_objects(c, &dcmpri, &dcmpro, &dres);
	dcmpri.f = c->infile;
	dcmpri.pos = SCOLZH_HDRSIZE;
	dcmpri.len = c->infile->len-SCOLZH_HDRSIZE;
	dcmpro.f = outf;

	de_zeromem(&lzhparams, sizeof(struct de_lh5x_params));
	lzhparams.fmt = DE_LH5X_FMT_LH5;
	lzhparams.zero_codes_block_behavior = DE_LH5X_ZCB_STOP;

	fmtutil_decompress_lh5x(c, &dcmpri, &dcmpro, &dres, &lzhparams);
	dbuf_flush(outf);
	if(dres.errcode) {
		de_err(c, "Decompression failed: %s", de_dfilter_get_errmsg(c, &dres));
	}
done:
	dbuf_close(outf);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb0, %rsp
movq 0x18(%rdi), %rax
cmpq $0x2, 0x18(%rax)
jge 0x66a6b
xorl %ebx, %ebx
jmp 0x66b21
movq %rdi, %r14
leaq 0xe6a25(%rip), %rsi     # 0x14d49a
xorl %edx, %edx
xorl %ecx, %ecx
callq 0xefda1
movq %rax, %rbx
movq %rax, %rdi
callq 0xf0855
leaq 0x30(%rsp), %r12
leaq 0x18(%rsp), %r13
leaq 0x50(%rsp), %r15
movq %r14, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %r15, %rcx
callq 0xfa1dc
movq 0x18(%r14), %rax
movq %rax, (%r12)
movq $0x2, 0x8(%r12)
movq 0x18(%rax), %rax
addq $-0x2, %rax
movq %rax, 0x10(%r12)
movq %rbx, (%r13)
xorps %xmm0, %xmm0
movq %rsp, %r8
movaps %xmm0, (%r8)
movl $0x5, (%r8)
movb $0x1, 0x4(%r8)
movq %r14, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %r15, %rcx
callq 0xfec18
movq %rbx, %rdi
callq 0xf08ba
cmpl $0x0, (%r15)
je 0x66b21
leaq 0x50(%rsp), %rsi
movq %r14, %rdi
callq 0xfa1a4
leaq 0xad70d(%rip), %rsi     # 0x114221
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9295
movq %rbx, %rdi
callq 0xf052b
addq $0xb0, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/misc.c
// Function: de_module_npack
void de_module_npack(deark *c, struct deark_module_info *mi)
{
	mi->id = "npack";
	mi->desc = "NPack compressed file";
	mi->run_fn = de_run_npack;
	mi->identify_fn = de_identify_npack;
}

// Assembly:
leaq 0xbd9a4(%rip), %rax     # 0x12455e
movq %rax, (%rsi)
leaq 0xbd9a0(%rip), %rax     # 0x124564
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x66bdf
movq %rax, 0x18(%rsi)
leaq 0x20(%rip), %rax        # 0x66bfa
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/misc.c
// Function: de_module_lzs221
void de_module_lzs221(deark *c, struct deark_module_info *mi)
{
	mi->id = "lzs221";
	mi->desc = "LZS221 compressed file";
	mi->run_fn = de_run_lzs221;
	mi->identify_fn = de_identify_lzs221;
}

// Assembly:
leaq 0xbd953(%rip), %rax     # 0x12457a
movq %rax, (%rsi)
leaq 0xbd950(%rip), %rax     # 0x124581
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x66c4c
movq %rax, 0x18(%rsi)
leaq 0x1d(%rip), %rax        # 0x66c64
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/misc.c
// Function: de_module_xpk
void de_module_xpk(deark *c, struct deark_module_info *mi)
{
	mi->id = "xpk";
	mi->desc = "XPK compressed file";
	mi->run_fn = de_run_xpk;
	mi->identify_fn = de_identify_xpk;
	mi->flags |= DE_MODFLAG_HIDDEN;
}

// Assembly:
leaq 0xbd907(%rip), %rax     # 0x124598
movq %rax, (%rsi)
leaq 0xbd901(%rip), %rax     # 0x12459c
movq %rax, 0x8(%rsi)
leaq 0x14(%rip), %rax        # 0x66cba
movq %rax, 0x18(%rsi)
leaq 0xfa(%rip), %rax        # 0x66dab
movq %rax, 0x20(%rsi)
orb $0x1, 0x30(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/misc.c
// Function: xor_cbfn
static int xor_cbfn(struct de_bufferedreadctx *brctx, const u8 *buf,
	i64 buf_len)
{
	i64 i;
	struct xorctx_struct *xorctx = (struct xorctx_struct*)brctx->userdata;

	for(i=0; i<buf_len; i++) {
		dbuf_writebyte(xorctx->outf, buf[i] ^ xorctx->key[xorctx->key_pos]);
		if(xorctx->key_len>1) {
			xorctx->key_pos = (xorctx->key_pos+1) % xorctx->key_len;
		}
	}
	return 1;
}

// Assembly:
testq %rdx, %rdx
jle 0x66e23
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq (%rdi), %r15
xorl %r12d, %r12d
movq (%r15), %rdi
movl 0xc(%r15), %eax
movb 0x10(%r15,%rax), %al
xorb (%r14,%r12), %al
movzbl %al, %esi
callq 0xf0bd6
movl 0x8(%r15), %ecx
cmpl $0x2, %ecx
jb 0x66e10
movl 0xc(%r15), %eax
incl %eax
xorl %edx, %edx
divl %ecx
movl %edx, 0xc(%r15)
incq %r12
cmpq %r12, %rbx
jne 0x66de1
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
movl $0x1, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/misc.c
// Function: cp437_cbfn
static int cp437_cbfn(struct de_bufferedreadctx *brctx, const u8 *buf,
	i64 buf_len)
{
	i32 u;
	i64 i;
	u8 ch;
	struct cp437ctx_struct *cp437ctx = (struct cp437ctx_struct*)brctx->userdata;

	for(i=0; i<buf_len; i++) {
		ch = buf[i];
		if(ch==0x09 || ch==0x0a || ch==0x0c || ch==0x0d) {
			// Leave HT, NL, FF, CR as-is.
			u = (i32)ch;
		}
		else if(ch==0x1a) {
			// Lots of CP437 files end with a Ctrl+Z character, but modern files
			// don't use any in-band character to signify end-of-file.
			// I don't just want to delete the character, though, so I guess I'll
			// change it to U+2404 SYMBOL FOR END OF TRANSMISSION.
			u = 0x2404;
		}
		else {
			u = de_char_to_unicode_ex((i32)ch, &cp437ctx->es);
		}
		dbuf_write_uchar_as_utf8(cp437ctx->outf, u);
	}

	return 1;
}

// Assembly:
testq %rdx, %rdx
jle 0x66e99
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq (%rdi), %r12
leaq 0x8(%r12), %r15
xorl %r13d, %r13d
movl $0x3600, %ebp           # imm = 0x3600
movzbl (%r14,%r13), %esi
cmpl $0x1a, %esi
ja 0x66e7d
btl %esi, %ebp
jae 0x66e71
movq (%r12), %rdi
callq 0xec1c4
incq %r13
cmpq %r13, %rbx
jne 0x66e4f
jmp 0x66e8b
cmpl $0x1a, %esi
jne 0x66e7d
movl $0x2404, %esi           # imm = 0x2404
jmp 0x66e5e
movl %esi, %edi
movq %r15, %rsi
callq 0xec0ad
movl %eax, %esi
jmp 0x66e5e
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
movl $0x1, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/misc.c
// Function: crc_cbfn
static int crc_cbfn(struct de_bufferedreadctx *brctx, const u8 *buf,
	i64 buf_len)
{
	struct crcctx_struct *crcctx = (struct crcctx_struct*)brctx->userdata;
	size_t n;

	for(n=0; n<CRCM_NUMCRCS; n++) {
		if(!crcctx->crcos[n]) continue;
		de_crcobj_addbuf(crcctx->crcos[n], buf, buf_len);
	}

	return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq (%rdi), %r15
movl $0x1, %r12d
movq (%r15,%r12,8), %rdi
testq %rdi, %rdi
je 0x66eca
movq %r14, %rsi
movq %rbx, %rdx
callq 0xeb8ad
incq %r12
cmpq $0xc, %r12
jne 0x66eb6
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/misc.c
// Function: bytefreq_cbfn
static int bytefreq_cbfn(struct de_bufferedreadctx *brctx, const u8 *buf,
	i64 buf_len)
{
	i64 k;
	struct bytefreqctx_struct *bfctx = (struct bytefreqctx_struct*)brctx->userdata;

	for(k=0; k<buf_len; k++) {
		struct bytefreqentry *bf = &bfctx->e[(unsigned int)buf[k]];

		// Save the location of the first few occurrences of this byte value.
		if(bf->count<DE_BYTEFREQ_NUMLOC) {
			bf->locations[bf->count] = brctx->offset + k;
		}
		bf->count++;
	}
	return 1;
}

// Assembly:
testq %rdx, %rdx
jle 0x66f22
movq (%rdi), %rax
xorl %ecx, %ecx
movzbl (%rsi,%rcx), %r9d
shll $0x5, %r9d
leaq (%rax,%r9), %r8
movq (%rax,%r9), %r9
cmpq $0x2, %r9
jg 0x66f14
movq 0x10(%rdi), %r10
addq %rcx, %r10
movq %r10, 0x8(%r8,%r9,8)
movq (%r8), %r9
incq %r9
movq %r9, (%r8)
incq %rcx
cmpq %rcx, %rdx
jne 0x66eee
movl $0x1, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/misc.c
// Function: run_deflate_internal
static void run_deflate_internal(deark *c, UI flags)
{
	dbuf *outf = NULL;
	struct de_dfilter_in_params dcmpri;
	struct de_dfilter_out_params dcmpro;
	struct de_dfilter_results dres;
	struct de_deflate_params deflparams;

	de_dfilter_init_objects(c, &dcmpri, &dcmpro, &dres);
	de_zeromem(&deflparams, sizeof(struct de_deflate_params));
	deflparams.flags = flags;

	outf = dbuf_create_output_file(c, "unc", NULL, 0);
	dbuf_enable_wbuffer(outf);
	dcmpri.f = c->infile;
	dcmpri.pos = 0;
	dcmpri.len = c->infile->len;
	dcmpro.f = outf;
	fmtutil_decompress_deflate_ex(c, &dcmpri, &dcmpro, &dres, &deflparams);
	dbuf_flush(outf);
	if(dres.errcode) {
		de_err(c, "Decompression failed: %s", de_dfilter_get_errmsg(c, &dres));
		goto done;
	}
	if(dres.bytes_consumed_valid) {
		de_dbg(c, "decompressed %"I64_FMT" bytes to %"I64_FMT, dres.bytes_consumed,
			outf->len);
	}

done:
	dbuf_close(outf);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x88(%rsp), %r12
leaq 0x70(%rsp), %r13
leaq 0x10(%rsp), %rcx
movq %r12, %rsi
movq %r13, %rdx
callq 0xfa1dc
xorps %xmm0, %xmm0
movq %rsp, %r15
movaps %xmm0, (%r15)
movl %ebp, (%r15)
leaq 0xe652b(%rip), %rsi     # 0x14d49a
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0xefda1
movq %rax, %r14
movq %rax, %rdi
callq 0xf0855
movq 0x18(%rbx), %rax
movq %rax, (%r12)
movq $0x0, 0x8(%r12)
movq 0x18(%rax), %rax
movq %rax, 0x10(%r12)
movq %r14, (%r13)
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
leaq 0x10(%rsp), %r12
movq %r12, %rcx
movq %r15, %r8
callq 0x10058f
movq %r14, %rdi
callq 0xf08ba
cmpl $0x0, (%r12)
je 0x66fef
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0xfa1a4
leaq 0xad241(%rip), %rsi     # 0x114221
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9295
jmp 0x67010
cmpb $0x0, 0x14(%rsp)
je 0x67010
movq 0x18(%rsp), %rdx
movq 0x18(%r14), %rcx
leaq 0xabc92(%rip), %rsi     # 0x112c98
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8617
movq %r14, %rdi
callq 0xf052b
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/misc.c
// Function: vgafont_common_config1
static void vgafont_common_config1(deark *c, struct vgafont_ctx *d)
{
	d->encoding_req = de_get_input_encoding(c, NULL, DE_ENCODING_UNKNOWN);
	if(d->encoding_req!=DE_ENCODING_UNKNOWN)
		d->encoding_to_use = d->encoding_req;
	else
		d->encoding_to_use = DE_ENCODING_CP437;

	d->font = de_create_bitmap_font(c);
	d->font->num_chars = 256;
	d->font->has_nonunicode_codepoints = 1;
	d->font->has_unicode_codepoints = 1;
	d->font->prefer_unicode = (d->encoding_req!=DE_ENCODING_UNKNOWN);
	d->font->nominal_width = 8;
	d->font->nominal_height = (int)d->height;
	d->font->char_array = de_mallocarray(c, d->font->num_chars,
		sizeof(struct de_bitmap_font_char));
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
xorl %esi, %esi
xorl %edx, %edx
callq 0xeb220
movl %eax, (%rbx)
testl %eax, %eax
movl $0xd, %ecx
cmovnel %eax, %ecx
movl %ecx, 0x4(%rbx)
movq %r14, %rdi
callq 0xf5358
movq %rax, 0x8(%rbx)
movq $0x100, 0x18(%rax)      # imm = 0x100
movw $0x101, 0x10(%rax)      # imm = 0x101
cmpl $0x0, (%rbx)
setne 0x12(%rax)
movl $0x8, (%rax)
movl 0x10(%rbx), %ecx
movl %ecx, 0x4(%rax)
movl $0x100, %esi            # imm = 0x100
movl $0x28, %edx
movq %r14, %rdi
callq 0xe96f7
movq 0x8(%rbx), %rcx
movq %rax, 0x20(%rcx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/misc.c
// Function: vgafont_common_config2
static void vgafont_common_config2(deark *c, struct vgafont_ctx *d)
{
	i64 i;
	struct de_encconv_state es;

	de_encconv_init(&es, d->encoding_to_use);

	for(i=0; i<d->font->num_chars; i++) {
		d->font->char_array[i].codepoint_nonunicode = (i32)i;
		if(d->font->has_unicode_codepoints) {
			d->font->char_array[i].codepoint_unicode = de_char_to_unicode_ex((i32)i, &es);
		}
		d->font->char_array[i].width = d->font->nominal_width;
		d->font->char_array[i].height = d->font->nominal_height;
		d->font->char_array[i].rowspan = 1;
		d->font->char_array[i].bitmap = &d->fontdata[i*d->font->nominal_height];
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movl 0x4(%rdi), %esi
leaq 0x8(%rsp), %rdi
callq 0xebbf7
movq 0x8(%rbx), %rcx
cmpq $0x0, 0x18(%rcx)
jle 0x67125
movq 0x20(%rcx), %rdx
xorl %r12d, %r12d
leaq 0x8(%rsp), %r14
xorl %r15d, %r15d
movl %r15d, (%rdx,%r12)
cmpb $0x0, 0x11(%rcx)
je 0x670f2
movl %r15d, %edi
movq %r14, %rsi
callq 0xec0ad
movq 0x8(%rbx), %rcx
movq 0x20(%rcx), %rdx
movl %eax, 0x4(%rdx,%r12)
movl (%rcx), %eax
movl %eax, 0x8(%rdx,%r12)
movslq 0x4(%rcx), %rax
movl %eax, 0xc(%rdx,%r12)
movq $0x1, 0x18(%rdx,%r12)
imulq %r15, %rax
addq 0x28(%rbx), %rax
movq %rax, 0x20(%rdx,%r12)
incq %r15
addq $0x28, %r12
cmpq 0x18(%rcx), %r15
jl 0x670d0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/misc.c
// Function: vgafont_main
static void vgafont_main(deark *c, struct vgafont_ctx *d, de_finfo *fi, UI createflags)
{
	u8 to_fontfmt = 0;

	de_font_decide_output_fmt(c);

	if(c->font_fmt_req!=DE_FONTFMT_IMAGE) {
		if(d->font->nominal_width==8 &&
			(d->font->nominal_height>=1 && d->font->nominal_height<=32))
		{
			to_fontfmt = 1;
		}
	}

	if(to_fontfmt) {
		// TODO? Most of the relevant formats are very similar to the PSF format
		// that this function will create. It's not ideal to go to all the trouble
		// to convert them to our internal format, only to convert them right
		// back to their original format.
		// (But since we want the option to convert them to an image, this is
		// maybe the easiest way.)
		d->font->force_fontfile_output = 1;
	}

	de_font_bitmap_font_write(c, d->font, fi, createflags);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebx
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r15
callq 0xf62bc
cmpb $0x3, 0xd5(%r15)
movq 0x8(%r12), %rsi
je 0x6716b
cmpl $0x8, (%rsi)
jne 0x6716b
movl 0x4(%rsi), %eax
decl %eax
cmpl $0x1f, %eax
ja 0x6716b
movb $0x1, 0x13(%rsi)
movq %r15, %rdi
movq %r14, %rdx
movl %ebx, %ecx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xf576f
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/misc.c
// Function: destroy_vgafont_ctx
static void destroy_vgafont_ctx(deark *c, struct vgafont_ctx *d)
{
	if(!d) return;
	if(d->font) {
		de_free(c, d->font->char_array);
		de_destroy_bitmap_font(c, d->font);
	}
	de_free(c, d->fontdata);
}

// Assembly:
testq %rsi, %rsi
je 0x671c6
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rsi), %rax
testq %rax, %rax
je 0x671b3
movq 0x20(%rax), %rsi
movq %rbx, %rdi
callq 0xe8be2
movq 0x8(%r14), %rsi
movq %rbx, %rdi
callq 0xf536d
movq 0x28(%r14), %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xe8be2
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/misc.c
// Function: dclimplode_main
static void dclimplode_main(deark *c, i64 cmpr_pos, i64 cmpr_len,
	u8 orig_len_known, i64 orig_len)
{
	dbuf *outf = NULL;
	struct de_dfilter_in_params dcmpri;
	struct de_dfilter_out_params dcmpro;
	struct de_dfilter_results dres;

	outf = dbuf_create_output_file(c, "unc", NULL, 0);
	dbuf_enable_wbuffer(outf);
	de_dfilter_init_objects(c, &dcmpri, &dcmpro, &dres);
	dcmpri.f = c->infile;
	dcmpri.pos = cmpr_pos;
	dcmpri.len = cmpr_len;
	dcmpro.f = outf;
	if(orig_len_known) {
		dcmpro.len_known = 1;
		dcmpro.expected_len = orig_len;
	}

	fmtutil_dclimplode_codectype1(c, &dcmpri, &dcmpro, &dres, NULL);
	dbuf_flush(outf);
	if(dres.errcode) {
		de_err(c, "Decompression failed: %s", de_dfilter_get_errmsg(c, &dres));
	}

	dbuf_close(outf);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %r8, 0x8(%rsp)
movl %ecx, 0x4(%rsp)
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbx
leaq 0xe62a9(%rip), %rsi     # 0x14d49a
xorl %edx, %edx
xorl %ecx, %ecx
callq 0xefda1
movq %rax, %r14
movq %rax, %rdi
callq 0xf0855
leaq 0x28(%rsp), %r15
leaq 0x10(%rsp), %rbp
leaq 0x48(%rsp), %rcx
movq %rbx, %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0xfa1dc
movq 0x18(%rbx), %rax
movq %rax, (%r15)
movq %r13, 0x8(%r15)
movq %r12, 0x10(%r15)
movq %r14, (%rbp)
cmpl $0x0, 0x4(%rsp)
je 0x6724b
movb $0x1, 0x18(%rsp)
movq 0x8(%rsp), %rax
movq %rax, 0x20(%rsp)
leaq 0x28(%rsp), %rsi
leaq 0x10(%rsp), %rdx
leaq 0x48(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rcx
xorl %r8d, %r8d
callq 0x1009eb
movq %r14, %rdi
callq 0xf08ba
cmpl $0x0, (%r15)
je 0x67297
leaq 0x48(%rsp), %rsi
movq %rbx, %rdi
callq 0xfa1a4
leaq 0xacf97(%rip), %rsi     # 0x114221
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9295
movq %r14, %rdi
callq 0xf052b
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/misc.c
// Function: do_lzstac_internal
static void do_lzstac_internal(deark *c, i64 cmpr_pos, i64 cmpr_len, UI flags)
{
	dbuf *outf = NULL;
	struct de_dfilter_in_params dcmpri;
	struct de_dfilter_out_params dcmpro;
	struct de_dfilter_results dres;
	struct de_lzstac_params lzstacparams;

	outf = dbuf_create_output_file(c, "unc", NULL, 0);
	dbuf_enable_wbuffer(outf);
	de_dfilter_init_objects(c, &dcmpri, &dcmpro, &dres);
	dcmpri.f = c->infile;
	dcmpri.pos = cmpr_pos;
	dcmpri.len = cmpr_len;
	dcmpro.f = outf;

	de_zeromem(&lzstacparams, sizeof(struct de_lzstac_params));
	lzstacparams.flags = flags;
	fmtutil_lzstac_codectype1(c, &dcmpri, &dcmpro, &dres, (void*)&lzstacparams);

	dbuf_flush(outf);
	if(dres.errcode) {
		de_err(c, "Decompression failed: %s", de_dfilter_get_errmsg(c, &dres));
		goto done;
	}
	if(dres.bytes_consumed_valid) {
		de_dbg(c, "decompressed %"I64_FMT" bytes to %"I64_FMT, dres.bytes_consumed,
			outf->len);
		if(dres.bytes_consumed<cmpr_len) {
			de_warn(c, "%"I64_FMT" extra bytes at end of file. File might not "
				"have decompressed correctly.", cmpr_len - dres.bytes_consumed);
		}
	}

done:
	dbuf_close(outf);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movl %ecx, 0xc(%rsp)
movq %rdx, 0x10(%rsp)
movq %rsi, %r12
movq %rdi, %r14
leaq 0xe61c2(%rip), %rsi     # 0x14d49a
xorl %edx, %edx
xorl %ecx, %ecx
callq 0xefda1
movq %rax, %rbx
movq %rax, %rdi
callq 0xf0855
leaq 0x98(%rsp), %r13
leaq 0x80(%rsp), %r15
leaq 0x20(%rsp), %rbp
movq %r14, %rdi
movq %r13, %rsi
movq %r15, %rdx
movq %rbp, %rcx
callq 0xfa1dc
movq 0x18(%r14), %rax
movq %rax, (%r13)
movq %r12, 0x8(%r13)
movq 0x10(%rsp), %r12
movq %r12, 0x10(%r13)
movq %rbx, (%r15)
leaq 0x1c(%rsp), %r8
movl 0xc(%rsp), %eax
movl %eax, (%r8)
movq %r14, %rdi
movq %r13, %rsi
movq %r15, %rdx
movq %rbp, %rcx
callq 0x10127e
movq %rbx, %rdi
callq 0xf08ba
cmpl $0x0, (%rbp)
je 0x67390
leaq 0x20(%rsp), %rsi
movq %r14, %rdi
callq 0xfa1a4
leaq 0xaceb8(%rip), %rsi     # 0x114221
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9295
movq %rbx, %rdi
callq 0xf052b
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpb $0x0, 0x24(%rsp)
je 0x67376
movq 0x28(%rsp), %rdx
movq 0x18(%rbx), %rcx
leaq 0xab8f1(%rip), %rsi     # 0x112c98
movq %r14, %rdi
xorl %eax, %eax
callq 0xe8617
subq 0x28(%rsp), %r12
jle 0x67376
leaq 0xbd739(%rip), %rsi     # 0x124af8
movq %r14, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0xe8faa
jmp 0x67376
nop
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/misc2.c
// Function: de_module_hpicn
void de_module_hpicn(deark *c, struct deark_module_info *mi)
{
	mi->id = "hpicn";
	mi->desc = "HP 100LX/200LX .ICN icon";
	mi->run_fn = de_run_hpicn;
	mi->identify_fn = de_identify_hpicn;
}

// Assembly:
leaq 0xbdbe9(%rip), %rax     # 0x124fc0
movq %rax, (%rsi)
leaq 0xbdbe5(%rip), %rax     # 0x124fc6
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x673fc
movq %rax, 0x18(%rsi)
leaq 0x80(%rip), %rax        # 0x67477
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/misc2.c
// Function: de_run_hpicn
static void de_run_hpicn(deark *c, de_module_params *mparams)
{
	struct hpicn_params icnp;

	read_hpicn_params(c, &icnp);
	de_dbg_dimensions(c, icnp.w, icnp.h);
	de_convert_and_write_image_bilevel2(c->infile, 8, icnp.w, icnp.h, icnp.rowspan,
		DE_CVTF_WHITEISZERO, NULL, 0);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
movl $0x4, %esi
callq 0xeebc8
movq %rax, %r14
movq 0x18(%rbx), %rdi
movl $0x6, %esi
callq 0xeebc8
movq %rax, %r15
leaq 0x7(%r14), %rax
leaq 0xe(%r14), %r12
testq %rax, %rax
cmovnsq %rax, %r12
sarq $0x3, %r12
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0xe8f88
movq 0x18(%rbx), %rdi
movl $0x8, %esi
movq %r14, %rdx
movq %r15, %rcx
movq %r12, %r8
movl $0x1, %r9d
pushq $0x0
pushq $0x0
callq 0xf2b5b
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/misc2.c
// Function: de_identify_hpicn
static int de_identify_hpicn(deark *c)
{
	struct hpicn_params icnp;

	if(dbuf_memcmp(c->infile, 0, "\x01\x00\x01\x00", 4))
		return 0;
	read_hpicn_params(c, &icnp);
	if(8 + icnp.rowspan*icnp.h != c->infile->len) return 0;
	if(icnp.w<1 || icnp.w>2048 || icnp.h<1 || icnp.h>2048) return 0;
	if(icnp.w==44 && icnp.h==32) return 100;
	return 60;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
movq 0x18(%rdi), %rdi
leaq 0xbd74e(%rip), %rdx     # 0x124bd8
xorl %ebx, %ebx
movl $0x4, %ecx
xorl %esi, %esi
callq 0xefc85
testl %eax, %eax
jne 0x67521
movq 0x18(%r14), %rdi
movl $0x4, %esi
callq 0xeebc8
movq %rax, %r15
movq 0x18(%r14), %rdi
movl $0x6, %esi
callq 0xeebc8
leaq 0x7(%r15), %rcx
leaq 0xe(%r15), %rdx
testq %rcx, %rcx
cmovnsq %rcx, %rdx
sarq $0x3, %rdx
imulq %rax, %rdx
addq $0x8, %rdx
movq 0x18(%r14), %rcx
cmpq 0x18(%rcx), %rdx
jne 0x67521
movq $-0x801, %rcx           # imm = 0xF7FF
leaq (%r15,%rcx), %rdx
movq $-0x800, %rsi           # imm = 0xF800
cmpq %rsi, %rdx
setb %dl
addq %rax, %rcx
cmpq %rsi, %rcx
setb %cl
orb %dl, %cl
jne 0x67521
xorq $0x2c, %r15
xorq $0x20, %rax
orq %r15, %rax
movl $0x64, %eax
movl $0x3c, %ebx
cmovel %eax, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/misc2.c
// Function: de_module_xpuzzle
void de_module_xpuzzle(deark *c, struct deark_module_info *mi)
{
	mi->id = "xpuzzle";
	mi->desc = "X11 \"puzzle\" image";
	mi->run_fn = de_run_xpuzzle;
	mi->identify_fn = de_identify_xpuzzle;
}

// Assembly:
leaq 0xbdaaf(%rip), %rax     # 0x124fdf
movq %rax, (%rsi)
leaq 0xbdaad(%rip), %rax     # 0x124fe7
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x67555
movq %rax, 0x18(%rsi)
leaq 0xf1(%rip), %rax        # 0x67641
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/misc2.c
// Function: de_run_xpuzzle
static void de_run_xpuzzle(deark *c, de_module_params *mparams)
{
	de_bitmap *img = NULL;
	struct xpuzzhdr hdr;
	de_color pal[256];
	i64 p;

	xpuzz_read_header(c, &hdr);
	de_dbg_dimensions(c, hdr.w, hdr.h);
	if(!de_good_image_dimensions(c, hdr.w, hdr.h)) goto done;

	img = de_bitmap_create(c,  hdr.w,  hdr.h, 3);

	// Read the palette
	p = 9;
	de_read_simple_palette(c, c->infile, p,  hdr.palentries, 3, pal, 256,
		DE_RDPALTYPE_24BIT, DE_RDPALFLAG_INITPAL);
	p += 3*hdr.palentries;

	// Read the bitmap
	de_convert_image_paletted(c->infile, p, 8, hdr.w, pal, img, 0);

	de_bitmap_write_to_file(img, NULL, 0);

done:
	de_bitmap_destroy(img);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x420, %rsp            # imm = 0x420
movq %rdi, %r14
leaq 0x8(%rsp), %r15
movq %r15, %rsi
callq 0x6cb89
movq (%r15), %rbx
movq 0x8(%r15), %r15
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0xe8f88
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0xf1db1
testl %eax, %eax
je 0x67625
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
movl $0x3, %ecx
callq 0xf266a
movq %rax, %r15
movq 0x18(%r14), %rsi
movq 0x18(%rsp), %r12
subq $0x8, %rsp
leaq 0x28(%rsp), %r13
movl $0x9, %edx
movl $0x3, %r8d
movq %r14, %rdi
movq %r12, %rcx
movq %r13, %r9
pushq $0x10
pushq $0x1
pushq $0x100                  # imm = 0x100
callq 0xf2cb1
addq $0x20, %rsp
leaq (%r12,%r12,2), %rsi
addq $0x9, %rsi
movq 0x18(%r14), %rdi
subq $0x8, %rsp
movl $0x8, %edx
movq %rbx, %rcx
movq %r13, %r8
movq %r15, %r9
pushq $0x0
callq 0xf2f79
addq $0x10, %rsp
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xf22dc
jmp 0x67628
xorl %r15d, %r15d
movq %r15, %rdi
callq 0xf228d
addq $0x420, %rsp            # imm = 0x420
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/misc2.c
// Function: de_module_bob
void de_module_bob(deark *c, struct deark_module_info *mi)
{
	mi->id = "bob";
	mi->desc = "Bob Ray Tracer bitmap image";
	mi->run_fn = de_run_bob;
	mi->identify_fn = de_identify_bob;
}

// Assembly:
leaq 0xc0d87(%rip), %rax     # 0x128443
movq %rax, (%rsi)
leaq 0xbd934(%rip), %rax     # 0x124ffa
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x676e1
movq %rax, 0x18(%rsi)
leaq 0xe2(%rip), %rax        # 0x677be
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/misc2.c
// Function: de_run_bob
static void de_run_bob(deark *c, de_module_params *mparams)
{
	de_bitmap *img = NULL;
	i64 w, h;
	u32 pal[256];
	i64 p;

	w = de_getu16le(0);
	h = de_getu16le(2);
	if(!de_good_image_dimensions(c, w, h)) goto done;
	img = de_bitmap_create(c, w, h, 3);

	// Read the palette
	p = 4;
	de_read_simple_palette(c, c->infile, p, 256, 3, pal, 256, DE_RDPALTYPE_24BIT, 0);
	p += 256*3;

	// Read the bitmap
	de_convert_image_paletted(c->infile, p, 8, w, pal, img, 0);

	de_bitmap_write_to_file(img, NULL, 0);

done:
	de_bitmap_destroy(img);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x400, %rsp            # imm = 0x400
movq %rdi, %r14
movq 0x18(%rdi), %rdi
xorl %ebx, %ebx
xorl %esi, %esi
callq 0xeebc8
movq %rax, %r15
movq 0x18(%r14), %rdi
movl $0x2, %esi
callq 0xeebc8
movq %rax, %r12
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0xf1db1
testl %eax, %eax
je 0x677a5
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
movl $0x3, %ecx
callq 0xf266a
movq %rax, %r12
movq 0x18(%r14), %rsi
subq $0x8, %rsp
leaq 0x8(%rsp), %r13
movl $0x4, %edx
movl $0x100, %ecx            # imm = 0x100
movl $0x3, %r8d
movq %r14, %rdi
movq %r13, %r9
pushq %rbx
pushq $0x1
pushq $0x100                  # imm = 0x100
callq 0xf2cb1
addq $0x20, %rsp
movq 0x18(%r14), %rdi
subq $0x8, %rsp
movl $0x304, %esi            # imm = 0x304
movl $0x8, %edx
movq %r15, %rcx
movq %r13, %r8
movq %r12, %r9
pushq %rbx
callq 0xf2f79
addq $0x10, %rsp
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xf22dc
movq %r12, %rbx
movq %rbx, %rdi
callq 0xf228d
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/misc2.c
// Function: de_identify_bob
static int de_identify_bob(deark *c)
{
	i64 w, h;

	if(!de_input_file_has_ext(c, "bob")) return 0;

	w = de_getu16le(0);
	h = de_getu16le(2);
	if(c->infile->len == 4 + 768 + w*h) {
		return 100;
	}
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0xc0c76(%rip), %rsi     # 0x128443
callq 0xea491
testl %eax, %eax
je 0x67812
movq 0x18(%rbx), %rdi
xorl %r15d, %r15d
xorl %esi, %esi
callq 0xeebc8
movq %rax, %r14
movq 0x18(%rbx), %rdi
movl $0x2, %esi
callq 0xeebc8
movq 0x18(%rbx), %rcx
imulq %r14, %rax
addq $0x304, %rax            # imm = 0x304
cmpq %rax, 0x18(%rcx)
movl $0x64, %eax
cmovnel %r15d, %eax
jmp 0x67814
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/misc2.c
// Function: de_module_alias_pix
void de_module_alias_pix(deark *c, struct deark_module_info *mi)
{
	mi->id = "alias_pix";
	mi->id_alias[0] = "vivid";
	mi->desc = "Alias PIX image, Vivid .IMG";
	mi->run_fn = de_run_alias_pix;
	mi->identify_fn = de_identify_alias_pix;
}

// Assembly:
leaq 0xbd7f5(%rip), %rax     # 0x125016
movq %rax, (%rsi)
leaq 0xbd7f5(%rip), %rax     # 0x125020
movq %rax, 0x38(%rsi)
leaq 0xbd7f0(%rip), %rax     # 0x125026
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x67851
movq %rax, 0x18(%rsi)
leaq 0x173(%rip), %rax       # 0x679bf
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/misc2.c
// Function: de_run_alias_pix
static void de_run_alias_pix(deark *c, de_module_params *mparams)
{
	de_bitmap *img = NULL;
	i64 w, h;
	i64 i;
	i64 pos;
	i64 firstline;
	i64 depth;
	i64 xpos, ypos;
	i64 runlen;
	u32 clr;

	w = de_getu16be(0);
	h = de_getu16be(2);
	firstline = de_getu16be(4);
	depth = de_getu16be(8);

	if(!de_good_image_dimensions(c, w, h)) goto done;
	if(firstline >= h) goto done;
	if(depth!=24) {
		de_err(c, "Unsupported image type");
		goto done;
	}

	img = de_bitmap_create(c, w, h, 3);

	pos = 10;
	xpos = 0;
	// I don't know for sure what to do with the "first scanline" field, in the
	// unlikely event it is not 0. The documentation doesn't say.
	ypos = firstline;
	while(1) {
		if(pos+4 > c->infile->len) {
			break; // EOF
		}
		runlen = (i64)de_getbyte(pos);
		clr = dbuf_getRGB(c->infile, pos+1, DE_GETRGBFLAG_BGR);
		pos+=4;

		for(i=0; i<runlen; i++) {
			de_bitmap_setpixel_rgb(img, xpos, ypos, clr);
			xpos++; // Runs are not allowed to span rows
		}

		if(xpos >= w) {
			xpos=0;
			ypos++;
		}
	}

	de_bitmap_write_to_file(img, NULL, 0);
done:
	de_bitmap_destroy(img);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r15
movq 0x18(%rdi), %rdi
xorl %r14d, %r14d
xorl %esi, %esi
callq 0xeeb67
movq %rax, %rbx
movq 0x18(%r15), %rdi
movl $0x2, %esi
callq 0xeeb67
movq %rax, %r13
movq 0x18(%r15), %rdi
movl $0x4, %esi
callq 0xeeb67
movq %rax, %r12
movq 0x18(%r15), %rdi
movl $0x8, %esi
callq 0xeeb67
movq %rax, %rbp
movq %r15, %rdi
movq %rbx, 0x8(%rsp)
movq %rbx, %rsi
movq %r13, %rdx
callq 0xf1db1
testl %eax, %eax
setne %al
cmpq %r13, %r12
setl %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x679a9
cmpq $0x18, %rbp
jne 0x67995
movq %r15, %rdi
movq 0x8(%rsp), %rsi
movq %r13, %rdx
movl $0x3, %ecx
callq 0xf266a
movq %rax, %r14
movq 0x18(%r15), %rdi
cmpq $0xe, 0x18(%rdi)
jl 0x67987
movl $0xa, %ebx
movl $0xe, %eax
xorl %r13d, %r13d
movq %r15, 0x10(%rsp)
movq %rbx, %rbp
movq %rax, %rbx
movq %rbp, %rsi
callq 0xeead3
movq %r15, %rcx
movl %eax, %r15d
movq 0x18(%rcx), %rdi
orq $0x1, %rbp
movq %rbp, %rsi
movl $0x1, %edx
callq 0xef42f
testb %r15b, %r15b
je 0x6795e
movl %eax, %ebp
movzbl %r15b, %r15d
movq %r14, %rdi
movq %r13, %rsi
movq %r12, %rdx
movl %ebp, %ecx
callq 0xf24ba
incq %r13
decq %r15
jne 0x67946
xorl %eax, %eax
cmpq 0x8(%rsp), %r13
setge %al
movl $0x0, %ecx
cmovgeq %rcx, %r13
addq %rax, %r12
leaq 0x4(%rbx), %rax
movq 0x10(%rsp), %r15
movq 0x18(%r15), %rdi
cmpq 0x18(%rdi), %rax
jle 0x67912
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xf22dc
jmp 0x679a9
leaq 0xafd7e(%rip), %rsi     # 0x11771a
xorl %r14d, %r14d
movq %r15, %rdi
xorl %eax, %eax
callq 0xe9295
movq %r14, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xf228d
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/misc2.c
// Function: de_identify_alias_pix
static int de_identify_alias_pix(deark *c)
{
	i64 w, h, firstline, lastline, depth;

	if(!de_input_file_has_ext(c, "img") &&
		!de_input_file_has_ext(c, "als") &&
		!de_input_file_has_ext(c, "pix"))
	{
		return 0;
	}

	w = de_getu16be(0);
	h = de_getu16be(2);
	firstline = de_getu16be(4);
	lastline = de_getu16be(6);
	depth = de_getu16be(8);

	if(depth!=24) return 0;
	if(firstline>lastline) return 0;
	// 'lastline' should usually be h-1, but XnView apparently sets it to h.
	if(firstline>h-1 || lastline>h) return 0;
	if(!de_good_image_dimensions_noerr(c, w, h)) return 0;
	return 30;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0xb80a3(%rip), %rsi     # 0x11fa77
callq 0xea491
testl %eax, %eax
jne 0x67a07
leaq 0xe3e13(%rip), %rsi     # 0x14b7f7
movq %rbx, %rdi
callq 0xea491
testl %eax, %eax
jne 0x67a07
leaq 0xc307f(%rip), %rsi     # 0x12aa76
movq %rbx, %rdi
callq 0xea491
testl %eax, %eax
je 0x67aa6
movq 0x18(%rbx), %rdi
xorl %r14d, %r14d
xorl %esi, %esi
callq 0xeeb67
movq %rax, %r15
movq 0x18(%rbx), %rdi
movl $0x2, %esi
callq 0xeeb67
movq %rax, %r12
movq 0x18(%rbx), %rdi
movl $0x4, %esi
callq 0xeeb67
movq %rax, %r13
movq 0x18(%rbx), %rdi
movl $0x6, %esi
callq 0xeeb67
movq %rax, %rbp
movq 0x18(%rbx), %rdi
movl $0x8, %esi
callq 0xeeb67
cmpq $0x18, %rax
setne %al
cmpq %rbp, %r13
setg %cl
orb %al, %cl
jne 0x67a94
cmpq %r12, %r13
setge %al
cmpq %r12, %rbp
setg %cl
orb %al, %cl
jne 0x67a94
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0xf1d84
testl %eax, %eax
movl $0x1e, %r14d
cmovel %eax, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %r14d, %r14d
jmp 0x67a94
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/misc2.c
// Function: de_module_applevol
void de_module_applevol(deark *c, struct deark_module_info *mi)
{
	mi->id = "applevol";
	mi->desc = "Apple volume label image";
	mi->run_fn = de_run_applevol;
	mi->identify_fn = de_identify_applevol;
}

// Assembly:
leaq 0xbd590(%rip), %rax     # 0x125042
movq %rax, (%rsi)
leaq 0xbd58f(%rip), %rax     # 0x12504b
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x67ad7
movq %rax, 0x18(%rsi)
leaq 0x16a(%rip), %rax       # 0x67c3c
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/misc2.c
// Function: de_run_applevol
static void de_run_applevol(deark *c, de_module_params *mparams)
{
	de_bitmap *img = NULL;
	i64 w, h;
	i64 i, j;
	i64 p;
	u8 palent;

	w = de_getu16be(1);
	h = de_getu16be(3);
	if(!de_good_image_dimensions(c, w, h)) goto done;
	img = de_bitmap_create(c, w, h, 1);

	p = 5;
	for(j=0; j<h; j++) {
		for(i=0; i<w; i++) {
			palent = de_getbyte(p+w*j+i);
			de_bitmap_setpixel_gray(img, i, j, applevol_get_gray_shade(palent));
		}
	}

	de_bitmap_write_to_file(img, NULL, 0);

done:
	de_bitmap_destroy(img);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
movl $0x1, %esi
callq 0xeeb67
movq %rax, %r14
movq 0x18(%rbx), %rdi
movl $0x3, %esi
callq 0xeeb67
movq %rax, %rbp
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0xf1db1
testl %eax, %eax
je 0x67c23
movq %rbx, %rdi
movq %r14, %rsi
movq %rbp, %rdx
movl $0x1, %ecx
callq 0xf266a
movq %rax, %r12
testq %rbp, %rbp
jle 0x67c15
movl $0x5, %r15d
xorl %r13d, %r13d
movq %rbp, (%rsp)
testq %r14, %r14
jle 0x67c02
xorl %ebp, %ebp
movq 0x18(%rbx), %rdi
leaq (%r15,%rbp), %rsi
callq 0xeead3
movzbl %al, %ecx
movb $-0x1, %al
cmpl $0xaa, %ecx
jle 0x67b8d
leal -0xf6(%rcx), %edx
cmpl $0x9, %edx
ja 0x67ba3
leaq 0xbd030(%rip), %rcx     # 0x124bb0
movslq (%rcx,%rdx,4), %rax
addq %rcx, %rax
jmpq *%rax
movb $-0x12, %al
jmp 0x67be5
cmpl $0x2a, %ecx
je 0x67bb7
cmpl $0x55, %ecx
je 0x67bbb
cmpl $0x80, %ecx
jne 0x67be5
movb $0x66, %al
jmp 0x67be5
cmpl $0xab, %ecx
je 0x67bc7
cmpl $0xd6, %ecx
jne 0x67be5
xorl %eax, %eax
jmp 0x67be5
movb $-0x34, %al
jmp 0x67be5
movb $-0x67, %al
jmp 0x67be5
movb $-0x78, %al
jmp 0x67be5
movb $0x11, %al
jmp 0x67be5
movb $0x33, %al
jmp 0x67be5
movb $-0x45, %al
jmp 0x67be5
movb $-0x56, %al
jmp 0x67be5
movb $0x44, %al
jmp 0x67be5
movb $-0x23, %al
jmp 0x67be5
movb $0x77, %al
jmp 0x67be5
movb $0x55, %al
jmp 0x67be5
movb $0x22, %al
movzbl %al, %ecx
movq %r12, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0xf2405
incq %rbp
cmpq %rbp, %r14
jne 0x67b54
incq %r13
addq %r14, %r15
movq (%rsp), %rbp
cmpq %rbp, %r13
jne 0x67b49
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xf22dc
jmp 0x67c26
xorl %r12d, %r12d
movq %r12, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xf228d
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/misc2.c
// Function: de_module_hr
void de_module_hr(deark *c, struct deark_module_info *mi)
{
	mi->id = "hr";
	mi->desc = "TRS-80 HR (High Resolution) image";
	mi->run_fn = de_run_hr;
	mi->identify_fn = de_identify_hr;
}

// Assembly:
leaq 0xbd3e2(%rip), %rax     # 0x125064
movq %rax, (%rsi)
leaq 0xbd3db(%rip), %rax     # 0x125067
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x67ca7
movq %rax, 0x18(%rsi)
leaq 0x82(%rip), %rax        # 0x67d24
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/misc2.c
// Function: de_run_hr
static void de_run_hr(deark *c, de_module_params *mparams)
{
	de_bitmap *img = NULL;
	de_finfo *fi = NULL;

	fi = de_finfo_create(c);
	fi->density.code = DE_DENSITY_UNK_UNITS;
	fi->density.xdens = 2;
	fi->density.ydens = 1;
	img = de_bitmap_create(c, 640, 240, 1);
	de_convert_image_bilevel(c->infile, 0, 640/8, img, 0);
	de_bitmap_write_to_file_finfo(img, fi, DE_CREATEFLAG_IS_BWIMG);
	de_bitmap_destroy(img);
	de_finfo_destroy(c, fi);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0xea504
movq %rax, %r14
movl $0x1, 0x78(%rax)
movaps 0xbd2eb(%rip), %xmm0    # 0x124fb0
movups %xmm0, 0x80(%rax)
movl $0x280, %esi            # imm = 0x280
movl $0xf0, %edx
movq %rbx, %rdi
movl $0x1, %ecx
callq 0xf266a
movq %rax, %r15
movq 0x18(%rbx), %rdi
movl $0x50, %edx
xorl %esi, %esi
movq %rax, %rcx
xorl %r8d, %r8d
callq 0xf2a40
movq %r15, %rdi
movq %r14, %rsi
movl $0x8, %edx
callq 0xf22d0
movq %r15, %rdi
callq 0xf228d
movq %rbx, %rdi
movq %r14, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0xea50e
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/misc2.c
// Function: de_module_ripicon
void de_module_ripicon(deark *c, struct deark_module_info *mi)
{
	mi->id = "ripicon";
	mi->desc = "RIP/RIPscrip/RIPterm Icon / BGI image";
	mi->run_fn = de_run_ripicon;
	mi->identify_fn = de_identify_ripicon;
}

// Assembly:
leaq 0xbd31b(%rip), %rax     # 0x125089
movq %rax, (%rsi)
leaq 0xbd319(%rip), %rax     # 0x125091
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x67d93
movq %rax, 0x18(%rsi)
leaq 0x45(%rip), %rax        # 0x67dd3
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/misc2.c
// Function: de_identify_ripicon
static int de_identify_ripicon(deark *c)
{
	int has_ext = 0;
	i64 pos = 0;
	size_t i;
	static const char *exts[] = { "icn", "hot", "msk", "bgi" };

	for(i=0; i<DE_ARRAYCOUNT(exts); i++) {
		if(de_input_file_has_ext(c, exts[i])) {
			has_ext = 1;
			break;
		}
	}
	if(!has_ext) return 0;

	while(1) {
		i64 bytes_consumed = 0;

		if(!do_one_ripicon(c, pos, &bytes_consumed, 1)) break;
		pos += bytes_consumed;
		if(pos == c->infile->len) return 50;
	}
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
leaq 0xbcdf8(%rip), %r15     # 0x124be0
movslq (%r14,%r15), %rsi
addq %r15, %rsi
movq %rbx, %rdi
callq 0xea491
testl %eax, %eax
jne 0x67e0a
addq $0x4, %r14
cmpq $0x10, %r14
jne 0x67de8
xorl %r14d, %r14d
jmp 0x67e65
movq %rsp, %rdx
movq $0x0, (%rdx)
xorl %r14d, %r14d
movq %rbx, %rdi
xorl %esi, %esi
movl $0x1, %ecx
callq 0x6cbdb
testl %eax, %eax
je 0x67e65
xorl %r15d, %r15d
movq %rsp, %r12
addq (%rsp), %r15
movq 0x18(%rbx), %rax
cmpq 0x18(%rax), %r15
je 0x67e5f
movq $0x0, (%rsp)
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
movl $0x1, %ecx
callq 0x6cbdb
testl %eax, %eax
jne 0x67e30
jmp 0x67e65
movl $0x32, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/misc2.c
// Function: de_module_lss16
void de_module_lss16(deark *c, struct deark_module_info *mi)
{
	mi->id = "lss16";
	mi->desc = "SYSLINUX LSS16 image";
	mi->run_fn = de_run_lss16;
	mi->identify_fn = de_identify_lss16;
}

// Assembly:
leaq 0xbd23c(%rip), %rax     # 0x1250b7
movq %rax, (%rsi)
leaq 0xbd238(%rip), %rax     # 0x1250bd
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x67ea0
movq %rax, 0x18(%rsi)
leaq 0x217(%rip), %rax       # 0x680b2
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/misc2.c
// Function: de_module_vbm
void de_module_vbm(deark *c, struct deark_module_info *mi)
{
	mi->id = "vbm";
	mi->desc = "C64/128 VBM (VDC BitMap)";
	mi->run_fn = de_run_vbm;
	mi->identify_fn = de_identify_vbm;
}

// Assembly:
leaq 0xbcff3(%rip), %rax     # 0x1250d2
movq %rax, (%rsi)
leaq 0xbcfed(%rip), %rax     # 0x1250d6
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x68104
movq %rax, 0x18(%rsi)
leaq 0x91(%rip), %rax        # 0x68190
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/misc2.c
// Function: de_run_vbm
static void de_run_vbm(deark *c, de_module_params *mparams)
{
	i64 width, height;
	u8 ver;

	ver = de_getbyte(3);
	if(ver!=2) {
		// TODO: Support VBM v3.
		de_err(c, "Unsupported VBM version (%d)", (int)ver);
		return;
	}
	width = de_getu16be(4);
	height = de_getu16be(6);
	de_convert_and_write_image_bilevel2(c->infile, 8, width, height, (width+7)/8,
		DE_CVTF_WHITEISZERO, NULL, 0);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
movl $0x3, %esi
callq 0xeead3
cmpb $0x2, %al
jne 0x68175
movq 0x18(%rbx), %rdi
movl $0x4, %esi
callq 0xeeb67
movq %rax, %r14
movq 0x18(%rbx), %rdi
movl $0x6, %esi
callq 0xeeb67
movq 0x18(%rbx), %rdi
leaq 0x7(%r14), %rcx
leaq 0xe(%r14), %r8
testq %rcx, %rcx
cmovnsq %rcx, %r8
sarq $0x3, %r8
movl $0x8, %esi
movq %r14, %rdx
movq %rax, %rcx
movl $0x1, %r9d
pushq $0x0
pushq $0x0
callq 0xf2b5b
addq $0x18, %rsp
popq %rbx
popq %r14
retq
movzbl %al, %edx
leaq 0xbd286(%rip), %rsi     # 0x125405
movq %rbx, %rdi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xe9295
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/misc2.c
// Function: de_identify_vbm
static int de_identify_vbm(deark *c)
{
	u8 b[4];
	de_read(b, 0, 4);
	if(de_memcmp(b, "BM\xcb", 3)) return 0;
	if(b[3]!=2 && b[3]!=3) return 0;
	if(de_input_file_has_ext(c, "vbm")) return 100;
	return 80;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %r14
movq 0x18(%rdi), %rdi
xorl %ebx, %ebx
leaq 0xc(%rsp), %r15
movl $0x4, %ecx
movq %r15, %rsi
xorl %edx, %edx
callq 0xee8d4
movzwl (%r15), %eax
xorl $0x4d42, %eax           # imm = 0x4D42
movzbl 0x2(%r15), %ecx
xorl $0xcb, %ecx
orw %ax, %cx
jne 0x681f7
movb 0xf(%rsp), %al
addb $-0x4, %al
cmpb $-0x2, %al
jb 0x681f7
leaq 0xbcef2(%rip), %rsi     # 0x1250d2
movq %r14, %rdi
callq 0xea491
testl %eax, %eax
movl $0x50, %eax
movl $0x64, %ebx
cmovel %eax, %ebx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/misc2.c
// Function: de_module_fp_art
void de_module_fp_art(deark *c, struct deark_module_info *mi)
{
	mi->id = "fp_art";
	mi->desc = "PFS: 1st Publisher clip art (.ART)";
	mi->run_fn = de_run_fp_art;
	mi->identify_fn = de_identify_fp_art;
}

// Assembly:
leaq 0xbcee5(%rip), %rax     # 0x1250ef
movq %rax, (%rsi)
leaq 0xbcee2(%rip), %rax     # 0x1250f6
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x6822f
movq %rax, 0x18(%rsi)
leaq 0x2ff(%rip), %rax       # 0x68529
movq %rax, 0x20(%rsi)
retq