LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/portfolio.c
// Function: de_module_pgc
void de_module_pgc(deark *c, struct deark_module_info *mi)
{
	mi->id = "pgc";
	mi->desc = "Atari Portfolio Graphics - compressed";
	mi->run_fn = de_run_pgc;
	mi->identify_fn = de_identify_pgc;
}

// Assembly:
leaq 0x79f5f(%rip), %rax     # 0x12ac2a
movq %rax, (%rsi)
leaq 0x79f59(%rip), %rax     # 0x12ac2e
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0xb0cf0
movq %rax, 0x18(%rsi)
leaq 0xca(%rip), %rax        # 0xb0db5
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/portfolio.c
// Function: de_run_pgc
static void de_run_pgc(deark *c, de_module_params *mparams)
{
	dbuf *unc_pixels = NULL;
	i64 pos;
	i64 count;
	u8 b, b2;

	de_declare_fmt(c, "PGC (Portfolio graphics compressed)");
	unc_pixels = dbuf_create_membuf(c, 1920, 1);

	pos = 3;
	while(pos<c->infile->len) {
		b = de_getbyte(pos);
		pos++;
		count = (i64)(b & 0x7f);
		if(b & 0x80) {
			// compressed run
			b2 = de_getbyte(pos);
			pos++;
			dbuf_write_run(unc_pixels, b2, count);
		}
		else {
			// uncompressed run
			dbuf_copy(c->infile, pos, count, unc_pixels);
			pos += count;
		}
	}

	de_convert_and_write_image_bilevel(unc_pixels, 0, 240, 64, 240/8,
		DE_CVTF_WHITEISZERO, NULL, 0);
	dbuf_close(unc_pixels);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %r14
leaq 0x7a047(%rip), %rsi     # 0x12ad4e
callq 0xe07f7
pushq $0x1
popq %rdx
movl $0x780, %esi            # imm = 0x780
movq %r14, %rdi
callq 0xe59cd
movq %rax, %rbx
pushq $0x3
popq %r15
movq 0x18(%r14), %rdi
cmpq 0x18(%rdi), %r15
jge 0xb0d7c
movq %r15, %rsi
callq 0xe3eb4
leaq 0x1(%r15), %r13
movl %eax, %ecx
andb $0x7f, %cl
movzbl %cl, %r12d
movq 0x18(%r14), %rdi
testb %al, %al
js 0xb0d60
movq %r13, %rsi
movq %r12, %rdx
movq %rbx, %rcx
callq 0xe45f4
addq %r12, %r13
movq %r13, %r15
jmp 0xb0d23
movq %r13, %rsi
callq 0xe3eb4
addq $0x2, %r15
movzbl %al, %esi
movq %rbx, %rdi
movq %r12, %rdx
callq 0xe5e40
jmp 0xb0d23
andl $0x0, 0x8(%rsp)
andq $0x0, (%rsp)
pushq $0x40
popq %rcx
pushq $0x1e
popq %r8
pushq $0x1
popq %r9
movl $0xf0, %edx
movq %rbx, %rdi
xorl %esi, %esi
callq 0xe7804
movq %rbx, %rdi
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xe5591
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/printptnr.c
// Function: de_module_pp_gph
void de_module_pp_gph(deark *c, struct deark_module_info *mi)
{
	mi->id = "pp_gph";
	mi->desc = "PrintPartner .GPH";
	mi->run_fn = de_run_pp_gph;
	mi->identify_fn = de_identify_pp_gph;
}

// Assembly:
leaq 0x79f93(%rip), %rax     # 0x12ad72
movq %rax, (%rsi)
leaq 0x79f90(%rip), %rax     # 0x12ad79
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0xb0e04
movq %rax, 0x18(%rsi)
leaq 0x4d3(%rip), %rax       # 0xb12d2
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/printptnr.c
// Function: do_write_image_fromuncpixels
static void do_write_image_fromuncpixels(deark *c, lctx *d, struct page_ctx *pg,
	dbuf *unc_pixels)
{
	de_bitmap *img = NULL;

	img = de_bitmap_create(c, pg->width, pg->height, 1);
	de_convert_image_bilevel(unc_pixels, 0, pg->width_raw, img, DE_CVTF_WHITEISZERO);
	do_write_image_frombitmap(c, d, pg, img);
	de_bitmap_destroy(img);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq (%rsi), %rsi
movq 0x8(%r14), %rdx
pushq $0x1
popq %rbp
movl %ebp, %ecx
callq 0xe7437
movq %rax, %r12
movq 0x10(%r14), %rdx
movq %rbx, %rdi
xorl %esi, %esi
movq %rax, %rcx
movl %ebp, %r8d
callq 0xe77b7
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0xb1362
movq %r12, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xe7084
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/printptnr.c
// Function: do_write_image_frombitmap
static void do_write_image_frombitmap(deark *c, lctx *d, struct page_ctx *pg,
	de_bitmap *img)
{
	de_finfo *fi = NULL;

	fi = de_finfo_create(c);
	fi->density.code = DE_DENSITY_UNK_UNITS;
	fi->density.xdens = 2;
	fi->density.ydens = 1;

	if(c->filenames_from_file && pg->imgname && (pg->imgname->len > 0)) {
		de_finfo_set_name_from_ucstring(c, fi, pg->imgname, 0);
	}
	de_bitmap_write_to_file_finfo(img, fi, DE_CREATEFLAG_IS_BWIMG);
	de_finfo_destroy(c, fi);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %rbx
callq 0xdfd1a
movq %rax, %r15
movl $0x1, 0x78(%rax)
movaps 0x66a27(%rip), %xmm0    # 0x117db0
movups %xmm0, 0x80(%rax)
cmpb $0x0, 0xd0(%rbx)
je 0xb13b7
movq 0x20(%r12), %rdx
testq %rdx, %rdx
je 0xb13b7
cmpq $0x0, 0x10(%rdx)
jle 0xb13b7
movq %rbx, %rdi
movq %r15, %rsi
xorl %ecx, %ecx
callq 0xdfd55
pushq $0x8
popq %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0xe70ab
movq %rbx, %rdi
movq %r15, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xdfd24
nop
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/packdir.c
// Function: de_module_packdir
void de_module_packdir(deark *c, struct deark_module_info *mi)
{
	mi->id = "packdir";
	mi->desc = "PackDir compressed archive format";
	mi->run_fn = de_run_packdir;
	mi->identify_fn = de_identify_packdir;
}

// Assembly:
leaq 0x79a56(%rip), %rax     # 0x12ae39
movq %rax, (%rsi)
leaq 0x79a54(%rip), %rax     # 0x12ae41
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0xb1408
movq %rax, 0x18(%rsi)
leaq 0xd0(%rip), %rax        # 0xb14d3
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/packdir.c
// Function: de_run_packdir
static void de_run_packdir(deark *c, de_module_params *mparams)
{
	struct pdctx_struct *d = NULL;
	i64 bytes_consumed;

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

	if(!do_packdir_header(c, d)) goto done;
	d->curpath = de_strarray_create(c, MAX_NESTING_LEVEL+10);
	do_packdir_object(c, d, 9, 0, &bytes_consumed);

done:
	if(d) {
		de_strarray_destroy(d->curpath);
		de_free(c, d);
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x10
popq %rsi
callq 0xdecaf
movq %rax, %r14
leaq 0x64d9e(%rip), %rsi     # 0x1161bf
movq %rbx, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0xde896
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
movq %rsp, %rsi
movq $0x5, (%rsi)
movq 0x18(%rbx), %rdi
callq 0xe40bf
leal 0xc(%rax), %ecx
movl %ecx, (%r14)
leaq 0x79a0b(%rip), %rsi     # 0x12ae63
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xde896
movl (%r14), %edx
cmpl $0x11, %edx
jb 0xb148a
leaq 0x79a09(%rip), %rsi     # 0x12ae7c
movq %rbx, %rdi
xorl %eax, %eax
callq 0xdf2a5
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
jmp 0xb14b7
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
pushq $0x2a
popq %rsi
movq %rbx, %rdi
callq 0xeb95d
movq %rax, 0x8(%r14)
pushq $0x9
popq %rdx
movq %rsp, %r8
movq %rbx, %rdi
movq %r14, %rsi
xorl %ecx, %ecx
callq 0xb1522
movq 0x8(%r14), %rdi
callq 0xeb97e
movq %rbx, %rdi
movq %r14, %rsi
callq 0xded32
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/packdir.c
// Function: de_identify_packdir
static int de_identify_packdir(deark *c)
{
	i64 n;

	if(dbuf_memcmp(c->infile, 0, "PACK\0", 5)) return 0;
	n = de_getu32le(5);
	if(n<=4) return 100; // maxbits = 12...16
	if(n<=8) return 10; // Dunno what the "maxbits" limit is.
	return 0; // Could be Git pack format
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0x18(%rdi), %rdi
leaq 0x79a72(%rip), %rdx     # 0x12af57
xorl %ebx, %ebx
pushq $0x5
popq %rcx
xorl %esi, %esi
callq 0xe4d48
testl %eax, %eax
jne 0xb1518
movq 0x18(%r14), %rdi
pushq $0x5
popq %rsi
callq 0xe409f
cmpq $0x5, %rax
jge 0xb150c
pushq $0x64
popq %rbx
jmp 0xb1518
xorl %ecx, %ecx
cmpq $0x9, %rax
pushq $0xa
popq %rbx
cmovael %ecx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/pack.c
// Function: de_module_pack
void de_module_pack(deark *c, struct deark_module_info *mi)
{
	mi->id = "pack";
	mi->desc = "Unix pack (.z)";
	mi->run_fn = de_run_pack;
	mi->identify_fn = de_identify_pack;
}

// Assembly:
leaq 0x72f4c(%rip), %rax     # 0x124af7
movq %rax, (%rsi)
leaq 0x793a8(%rip), %rax     # 0x12af5d
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0xb1bd0
movq %rax, 0x18(%rsi)
leaq 0x398(%rip), %rax       # 0xb1f63
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/packit.c
// Function: de_module_packit
void de_module_packit(deark *c, struct deark_module_info *mi)
{
	mi->id = "packit";
	mi->desc = "PackIt";
	mi->run_fn = de_run_packit;
	mi->identify_fn = de_identify_packit;
}

// Assembly:
leaq 0x7907c(%rip), %rax     # 0x12b033
movq %rax, (%rsi)
leaq 0x79079(%rip), %rax     # 0x12b03a
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0xb1fdc
movq %rax, 0x18(%rsi)
leaq 0x510(%rip), %rax       # 0xb24e7
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/packit.c
// Function: de_identify_packit
static int de_identify_packit(deark *c)
{
	u8 t;

	if(dbuf_memcmp(c->infile, 0, (const void*)"PMa", 3)) {
		return 0;
	}
	t = de_getbyte(3);
	if(t=='g' || t=='4') return 100;
	if(t>='1' && t<='7') return 35;
	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0x18(%rdi), %rdi
leaq 0x78cc7(%rip), %rdx     # 0x12b1c0
xorl %ebx, %ebx
pushq $0x3
popq %rcx
xorl %esi, %esi
callq 0xe4d48
testl %eax, %eax
je 0xb2513
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x18(%r14), %rdi
pushq $0x3
popq %rsi
callq 0xe3eb4
pushq $0x64
popq %rbx
cmpb $0x34, %al
je 0xb2509
movzbl %al, %ecx
cmpl $0x67, %ecx
je 0xb2509
addb $-0x31, %al
xorl %ecx, %ecx
cmpb $0x7, %al
pushq $0x23
popq %rbx
cmovael %ecx, %ebx
jmp 0xb2509
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/packit.c
// Function: packit_destroy_pmd
static void packit_destroy_pmd(deark *c, struct packit_md *pmd)
{
	if(!pmd) return;
	dbuf_close(pmd->unc_data);
	de_destroy_stringreaderdata(c, pmd->fname);
	de_advfile_destroy(pmd->advf);
	de_free(c, pmd);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0xe8(%rsi), %rdi
callq 0xe5591
movq 0x40(%rbx), %rsi
movq %r14, %rdi
callq 0xe4b94
movq 0x38(%rbx), %rdi
callq 0xf0812
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xded32
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/packit.c
// Function: packit_scan_member_data
static void packit_scan_member_data(deark *c, struct packit_ctx *d,
	struct packit_md *pmd)
{
	u32 datarsrc_crc_reported;
	u32 datarsrc_crc_calc;

	if(pmd->rfork_pos + pmd->rfork_len + 2 > pmd->inf->len) {
		d->fatalerrflag = 1;
		d->need_errmsg = 1;
		goto done;
	}

	datarsrc_crc_reported = (u32)dbuf_getu16be(pmd->inf, pmd->rfork_pos +
		pmd->rfork_len);
	de_dbg(c, "data/resource crc (reported): 0x%04x", (UI)datarsrc_crc_reported);

	de_crcobj_reset(d->crco_datarsrc);
	de_crcobj_addslice(d->crco_datarsrc, pmd->inf, pmd->dfork_pos,
		pmd->dfork_len + pmd->rfork_len);
	datarsrc_crc_calc = de_crcobj_getval(d->crco_datarsrc);
	de_dbg(c, "data/resource crc (calculated): 0x%04x", (UI)datarsrc_crc_calc);
	if(datarsrc_crc_reported != datarsrc_crc_calc) {
		// TODO: Maybe should be a warning? Or nonfatal?
		de_err(c, "Bad data/resource CRC (reported 0x%04x, calculated 0x%04x)",
			(UI)datarsrc_crc_reported, (UI)datarsrc_crc_calc);
		d->fatalerrflag = 1;
		goto done;
	}

done:
	;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq 0x18(%rdx), %rdi
movq 0xd8(%rdx), %rax
movq 0xe0(%rdx), %rsi
leaq (%rsi,%rax), %rcx
addq $0x2, %rcx
cmpq 0x18(%rdi), %rcx
jle 0xb290c
movw $0x101, (%rbx)          # imm = 0x101
jmp 0xb2999
movq %rdx, %r12
addq %rax, %rsi
callq 0xe3f46
movq %rax, %r15
leaq 0x787ea(%rip), %rsi     # 0x12b10b
movq %r14, %rdi
movl %r15d, %edx
xorl %eax, %eax
callq 0xde896
movq 0x8(%rbx), %rdi
callq 0xe0e44
movq 0x8(%rbx), %rdi
movq 0x18(%r12), %rsi
movq 0xc8(%r12), %rdx
movq 0xe0(%r12), %rcx
addq 0xd0(%r12), %rcx
callq 0xe0f33
movq 0x8(%rbx), %rdi
callq 0xe0e95
movl %eax, %ebp
leaq 0x787c1(%rip), %rsi     # 0x12b130
movq %r14, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xde896
cmpl %r15d, %ebp
je 0xb2999
leaq 0x787d0(%rip), %rsi     # 0x12b157
movq %r14, %rdi
movl %r15d, %edx
movl %ebp, %ecx
xorl %eax, %eax
callq 0xdf2a5
movb $0x1, (%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/pkm.c
// Function: de_module_pkm
void de_module_pkm(deark *c, struct deark_module_info *mi)
{
	mi->id = "pkm";
	mi->desc = "PKM (GrafX2)";
	mi->run_fn = de_run_pkm;
	mi->identify_fn = de_identify_pkm;
	mi->help_fn = de_help_pkm;
}

// Assembly:
leaq 0x787cd(%rip), %rax     # 0x12b1c4
movq %rax, (%rsi)
leaq 0x787c7(%rip), %rax     # 0x12b1c8
movq %rax, 0x8(%rsi)
leaq 0x1b(%rip), %rax        # 0xb2a27
movq %rax, 0x18(%rsi)
leaq 0x4ff(%rip), %rax       # 0xb2f16
movq %rax, 0x20(%rsi)
leaq 0x516(%rip), %rax       # 0xb2f38
movq %rax, 0x28(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/pklite.c
// Function: de_module_pklite
void de_module_pklite(deark *c, struct deark_module_info *mi)
{
	mi->id = "pklite";
	mi->desc = "PKLITE-compressed EXE/COM";
	mi->run_fn = de_run_pklite;
	mi->identify_fn = de_identify_pklite;
	mi->help_fn = de_help_pklite;
}

// Assembly:
leaq 0x7835a(%rip), %rax     # 0x12b2a9
movq %rax, (%rsi)
leaq 0x78357(%rip), %rax     # 0x12b2b0
movq %rax, 0x8(%rsi)
leaq 0x1b(%rip), %rax        # 0xb2f7f
movq %rax, 0x18(%rsi)
leaq 0x20fe(%rip), %rax      # 0xb506d
movq %rax, 0x20(%rsi)
leaq 0x2188(%rip), %rax      # 0xb5102
movq %rax, 0x28(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/pklite.c
// Function: de_identify_pklite
static int de_identify_pklite(deark *c)
{
	i64 verpos;

	if(c->infile->len>65280) return 0;
	if(detect_pklite_com_quick(c->infile, &verpos)) {
		if(pklite_com_has_copyright_string(c->infile, verpos)) {
			return 100;
		}
		// TODO: False positives may be possible. Maybe we should be more
		// discriminating.
		return 15;
	}
	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
movq 0x18(%rdi), %rdi
xorl %ebx, %ebx
cmpq $0xff00, 0x18(%rdi)     # imm = 0xFF00
jg 0xb50f8
leaq 0x10(%rsp), %rsi
callq 0xb5961
testl %eax, %eax
je 0xb50f8
movq 0x18(%r14), %rdi
movq 0x10(%rsp), %rdx
cmpq $0x26, %rdx
jne 0xb50be
leaq 0x76b52(%rip), %rdx     # 0x12bbfd
pushq $0x28
popq %rsi
pushq $0x8
popq %rcx
callq 0xe4d48
testl %eax, %eax
jne 0xb50f5
pushq $0x64
jmp 0xb50f7
addq $0x2, %rdx
leaq 0xc(%rsp), %rbx
pushq $0x4
popq %rcx
movq %rbx, %rsi
callq 0xe3cb7
cmpb $0x50, (%rbx)
jne 0xb50f5
movb 0xd(%rsp), %al
andb $-0x21, %al
cmpb $0x4b, %al
jne 0xb50f5
movb 0xe(%rsp), %al
andb $-0x21, %al
cmpb $0x4c, %al
jne 0xb50f5
movb 0xf(%rsp), %al
andb $-0x21, %al
cmpb $0x49, %al
je 0xb50ba
pushq $0xf
popq %rbx
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/pklite.c
// Function: do_read_version_info
static void do_read_version_info(deark *c, lctx *d, i64 pos)
{
	UI ver_info;

	ver_info = (UI)de_getu16le(pos);
	info_bytes_to_version_struct(ver_info, &d->ver_reported);
	de_dbg(c, "reported PKLITE version: %s", d->ver_reported.pklver_str);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x18(%rdi), %rdi
movq %rdx, %rsi
callq 0xe3fa3
movl %eax, %ecx
andl $0xfff, %ecx            # imm = 0xFFF
movl %ecx, 0xe0(%rbx)
addq $0xe4, %rbx
shrl $0x8, %ecx
movzbl %al, %r8d
btl $0xe, %eax
leaq 0x82afd(%rip), %rdx     # 0x137c60
leaq 0x762e6(%rip), %r9      # 0x12b450
cmovaeq %rdx, %r9
btl $0xd, %eax
leaq 0x762dd(%rip), %rsi     # 0x12b456
leaq 0x762d3(%rip), %r10     # 0x12b453
cmovaeq %rsi, %r10
btl $0xc, %eax
leaq 0x762ca(%rip), %r11     # 0x12b459
cmovaeq %rdx, %r11
leaq 0x762a8(%rip), %rdx     # 0x12b442
pushq $0x28
popq %rsi
movq %rbx, %rdi
xorl %eax, %eax
pushq %r11
pushq %r10
callq 0xde40c
popq %rax
popq %rcx
leaq 0x76272(%rip), %rsi     # 0x12b426
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xde896
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/pklite.c
// Function: pkl_search_match
static int pkl_search_match(const u8 *mem, i64 mem_len,
	i64 search_startpos, i64 search_endpos,
	const u8 *pattern, i64 pattern_len,
	u8 wildcard, UI flags, i64 *pfoundpos)
{
	i64 foundpos2;
	int ret;

	*pfoundpos = 0;

	if(pattern_len<1) return 0;
	if(search_startpos<0) search_startpos = 0;
	if(search_endpos>mem_len) search_endpos = mem_len;
	if(pattern_len > search_endpos-search_startpos) return 0;

	ret = de_memsearch_match(&mem[search_startpos], search_endpos-search_startpos,
		pattern, pattern_len, wildcard, &foundpos2);
	if(ret) {
		*pfoundpos = search_startpos + foundpos2;
	}
	return ret;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
andq $0x0, (%r9)
movq %rsi, %r14
xorl %r15d, %r15d
testq %rsi, %rsi
cmovleq %r15, %r14
movl $0x3e8, %esi            # imm = 0x3E8
cmpq %rsi, %rdx
cmovlq %rdx, %rsi
subq %r14, %rsi
cmpq %r8, %rsi
jl 0xb5742
movq %r9, %rbx
addq %r14, %rdi
pushq $0x3f
popq %rax
leaq 0x8(%rsp), %r9
movq %rcx, %rdx
movq %r8, %rcx
movl %eax, %r8d
callq 0xe1021
testl %eax, %eax
je 0xb5742
addq 0x8(%rsp), %r14
movq %r14, (%rbx)
movl %eax, %r15d
movl %r15d, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/pklite.c
// Function: fill_bitbuf
static void fill_bitbuf(deark *c, struct decompr_internal_state *dctx)
{
	UI i;

	if(dctx->d->errflag) return;
	if(dctx->dcmpr_cur_ipos+2 > dctx->inf->len) {
		de_err(c, "Unexpected end of file during decompression");
		dctx->d->errflag = 1;
		dctx->d->errmsg_handled = 1;
		return;
	}

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq (%rsi), %rax
cmpb $0x0, (%rax)
jne 0xb57a2
movq %rsi, %rbx
movq 0x8(%rsi), %rax
movq 0x28(%rsi), %rcx
addq $0x2, %rcx
cmpq 0x18(%rax), %rcx
jle 0xb57ad
leaq 0x760df(%rip), %rsi     # 0x12b872
xorl %eax, %eax
callq 0xdf2a5
movq (%rbx), %rax
movw $0x101, (%rax)          # imm = 0x101
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x28(%rbx), %r14
leaq 0x30(%rbx), %r15
pushq $0x2
popq %rbp
subl $0x1, %ebp
jb 0xb57a2
movq 0x8(%rbx), %rdi
movq %r14, %rsi
callq 0xe3f2a
movzbl %al, %esi
movq %r15, %rdi
callq 0xe69c4
jmp 0xb57b8
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/pklite.c
// Function: pklite_getbit
static u8 pklite_getbit(deark *c, struct decompr_internal_state *dctx)
{
	u8 v;

	if(dctx->d->errflag) return 0;
	v = (u8)de_bitbuf_lowlevel_get_bits(&dctx->bbll, 1);

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

	return v;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq (%rsi), %rax
cmpb $0x0, (%rax)
je 0xb57e8
xorl %r14d, %r14d
jmp 0xb580e
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x30(%rsi), %rdi
pushq $0x1
popq %rsi
callq 0xe69f9
movq %rax, %r14
cmpl $0x0, 0x34(%rbx)
jne 0xb580e
movq %r15, %rdi
movq %rbx, %rsi
callq 0xb5768
movl %r14d, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/pklite.c
// Function: read_pklite_code_using_tree
static UI read_pklite_code_using_tree(deark *c, struct decompr_internal_state *dctx,
	struct fmtutil_huffman_decoder *ht)
{
	int ret;
	fmtutil_huffman_valtype val = 0;

	while(1) {
		u8 b;

		b = pklite_getbit(c, dctx);
		if(dctx->d->errflag) goto done;

		ret = fmtutil_huffman_decode_bit(ht->bk, ht->cursor, b, &val);
		if(ret==1) goto done; // finished the code
		if(ret!=2) {
			dctx->d->errflag = 1;
			goto done;
		}
	}
done:
	return val;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x4(%rsp), %r12
andl $0x0, (%r12)
movq %r15, %rdi
movq %rbx, %rsi
callq 0xb57d6
movq (%rbx), %rcx
cmpb $0x0, (%rcx)
jne 0xb5867
movq (%r14), %rsi
movq 0x8(%r14), %rdi
movzbl %al, %edx
movq %r12, %rcx
callq 0xf8029
cmpl $0x2, %eax
je 0xb5832
cmpl $0x1, %eax
je 0xb5867
movq (%rbx), %rax
movb $0x1, (%rax)
movl 0x4(%rsp), %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/pklite.c
// Function: huffman_make_tree_from_u16array
static void huffman_make_tree_from_u16array(deark *c,
	struct fmtutil_huffman_decoder **htp,
	const u16 *lengths_and_codes, UI ncodes,
	const char *dbgtitle)
{
	UI n;
	char b2buf[72];

	if(*htp) return;
	*htp = fmtutil_huffman_create_decoder(c, ncodes, ncodes);
	if(dbgtitle) {
		de_dbg3(c, "[%s codebook]", dbgtitle);
	}
	de_dbg_indent(c, 1);
	for(n=0; n<ncodes; n++) {
		UI nbits;
		u64 code;

		nbits = ((UI)lengths_and_codes[n])>>12;
		code = ((u64)lengths_and_codes[n]) & 0x0fff;

		if(dbgtitle && c->debug_level>=3) {
			de_dbg3(c, "code: \"%s\" = %d",
				de_print_base2_fixed(b2buf, sizeof(b2buf), code, nbits), (int)n);
		}
		fmtutil_huffman_add_code(c, (*htp)->bk, code, nbits,
			(fmtutil_huffman_valtype)n);
	}
	de_dbg_indent(c, -1);
}

// Assembly:
cmpq $0x0, (%rsi)
je 0xb587e
retq
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %r8, %r13
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r14
movl %ecx, %edx
movq %rdx, %rsi
movq %rdx, 0x8(%rsp)
callq 0xf8601
movq %r12, (%rsp)
movq %rax, (%r12)
testq %r13, %r13
je 0xb58c8
leaq 0x75fa9(%rip), %rsi     # 0x12b864
movq %r14, %rdi
movq %r13, %rdx
xorl %eax, %eax
callq 0xdea83
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0xdeba7
xorl %ebp, %ebp
cmpq %rbp, 0x8(%rsp)
je 0xb5947
movq %r15, %r12
movzwl (%r15,%rbp,2), %r15d
movl %r15d, %ebx
shrl $0xc, %ebx
andl $0xfff, %r15d           # imm = 0xFFF
testq %r13, %r13
je 0xb5924
cmpl $0x3, (%r14)
jl 0xb5924
leaq 0x10(%rsp), %rdi
pushq $0x48
popq %rsi
movq %r15, %rdx
movl %ebx, %ecx
callq 0xdfc03
movq %r14, %rdi
leaq 0x5ba78(%rip), %rsi     # 0x111390
movq %rax, %rdx
movl %ebp, %ecx
xorl %eax, %eax
callq 0xdea83
movq (%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rsi
movq %r14, %rdi
movq %r15, %rdx
movl %ebx, %ecx
movl %ebp, %r8d
callq 0xf7e56
incq %rbp
movq %r12, %r15
jmp 0xb58d5
pushq $-0x1
popq %rsi
movq %r14, %rdi
callq 0xdeba7
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/pklite.c
// Function: detect_pklite_com_quick
static int detect_pklite_com_quick(dbuf *f, i64 *pverpos)
{
	u8 b[10];

	dbuf_read(f, b, 0, sizeof(b));
	if(b[0]==0xb8 && b[3]==0xba && b[6]==0x3b && b[7]==0xc4) {
		if(b[9]==0x67) { // Probably v1.00-1.14
			*pverpos = 44;
			return 1;
		}
		else if(b[9]==0x69) { // Probably v1.15 (usually mislabeled as 1.14)
			*pverpos = 46;
			return 1;
		}
	}
	else if(b[0]==0x50 && b[1]==0xb8 && b[4]==0xba && b[7]==0x3b) {
		*pverpos = 46; // v1.50-2.01
		return 1;
	}
	else if(b[0]==0xba && b[3]==0xa1 && b[6]==0x2d && b[7]==0x20) {
		*pverpos = 36; // v1.00beta
		return 1;
	}
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
xorl %r14d, %r14d
leaq 0x6(%rsp), %r15
pushq $0xa
popq %rcx
movq %r15, %rsi
xorl %edx, %edx
callq 0xe3cb7
movb (%r15), %dl
movb 0x3(%r15), %al
movl %edx, %ecx
xorb $-0x48, %cl
movl %eax, %esi
xorb $-0x46, %sil
orb %cl, %sil
movb 0x6(%r15), %cl
movl %ecx, %edi
xorb $0x3b, %dil
orb %sil, %dil
movb 0x7(%r15), %sil
movl %esi, %r8d
xorb $-0x3c, %r8b
orb %dil, %r8b
jne 0xb59c5
movzbl 0xf(%rsp), %eax
cmpl $0x67, %eax
je 0xb5a0e
cmpl $0x69, %eax
je 0xb59ee
jmp 0xb5a18
movl %edx, %edi
xorb $0x50, %dil
movb 0x7(%rsp), %r8b
movb 0xa(%rsp), %r9b
xorb $-0x48, %r8b
orb %dil, %r8b
xorb $-0x46, %r9b
orb %r8b, %r9b
movl %esi, %edi
xorb $0x3b, %dil
orb %r9b, %dil
jne 0xb59f2
pushq $0x2e
jmp 0xb5a10
xorb $-0x46, %dl
xorb $-0x5f, %al
orb %dl, %al
xorb $0x2d, %cl
orb %al, %cl
xorb $0x20, %sil
xorl %r14d, %r14d
orb %cl, %sil
jne 0xb5a18
pushq $0x24
jmp 0xb5a10
pushq $0x2c
popq %rax
movq %rax, (%rbx)
pushq $0x1
popq %r14
movl %r14d, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/pif.c
// Function: de_module_pif
void de_module_pif(deark *c, struct deark_module_info *mi)
{
	mi->id = "pif";
	mi->desc = "Windows Program Information File";
	mi->identify_fn = de_identify_pif;
	mi->run_fn = de_run_pif;
	mi->help_fn = de_help_pif;
}

// Assembly:
leaq 0x7645c(%rip), %rax     # 0x12be8b
movq %rax, (%rsi)
leaq 0x76456(%rip), %rax     # 0x12be8f
movq %rax, 0x8(%rsi)
leaq 0x1b(%rip), %rax        # 0xb5a5f
movq %rax, 0x20(%rsi)
leaq 0x7f(%rip), %rax        # 0xb5ace
movq %rax, 0x18(%rsi)
leaq 0x7b(%rip), %rax        # 0xb5ad5
movq %rax, 0x28(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/pif.c
// Function: de_identify_pif
static int de_identify_pif(deark *c)
{
	int maybe_oldfmt = 0;
	int has_id = 0;
	int has_ext;

	if(c->infile->len == PIF_BASIC_SECTION_SIZE) {
		maybe_oldfmt = 1;
	}
	else if(c->infile->len >= PIF_BASIC_SECTION_SIZE+22) {
		has_id = !dbuf_memcmp(c->infile, PIF_BASIC_SECTION_SIZE,
			(const u8*)"MICROSOFT PIFEX\0", 16);
	}

	if(!maybe_oldfmt && !has_id) return 0;
	has_ext = de_input_file_has_ext(c, "pif");
	if(maybe_oldfmt) {
		return has_ext ? 24 : 0;
	}
	return has_ext ? 100 : 35;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
movq 0x18(%rdi), %rdi
movq 0x18(%rdi), %r15
cmpq $0x171, %r15            # imm = 0x171
jne 0xb5a96
leaq 0x7640c(%rip), %rsi     # 0x12be8b
movq %r14, %rdi
callq 0xdfcd5
cmpq $0x171, %r15            # imm = 0x171
jne 0xb5abb
testl %eax, %eax
pushq $0x18
jmp 0xb5ac2
xorl %ebx, %ebx
cmpq $0x187, %r15            # imm = 0x187
jl 0xb5ac6
leaq 0x76698(%rip), %rdx     # 0x12c140
pushq $0x10
popq %rcx
movl $0x171, %esi            # imm = 0x171
callq 0xe4d48
testl %eax, %eax
jne 0xb5ac6
jmp 0xb5a78
testl %eax, %eax
pushq $0x23
popq %rax
pushq $0x64
popq %rbx
cmovel %eax, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/pif.c
// Function: de_module_desqview_dvp
void de_module_desqview_dvp(deark *c, struct deark_module_info *mi)
{
	mi->id = "desqview_dvp";
	mi->desc = "DESQview Program Information File";
	mi->identify_fn = de_identify_desqview_dvp;
	mi->run_fn = de_run_desqview_dvp;
}

// Assembly:
leaq 0x763c6(%rip), %rax     # 0x12beb0
movq %rax, (%rsi)
leaq 0x763c9(%rip), %rax     # 0x12bebd
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0xb5b0f
movq %rax, 0x20(%rsi)
leaq 0x4f(%rip), %rax        # 0xb5b59
movq %rax, 0x18(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/pif.c
// Function: de_identify_desqview_dvp
static int de_identify_desqview_dvp(deark *c)
{
	int has_ext;

	if(c->infile->len!=416) return 0;
	if(de_getbyte(0) != 0x00) return 0;
	has_ext = de_input_file_has_ext(c, "dvp");
	if(has_ext) return 40;
	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
xorl %r14d, %r14d
cmpq $0x1a0, 0x18(%rdi)      # imm = 0x1A0
jne 0xb5b4e
xorl %r14d, %r14d
xorl %esi, %esi
callq 0xe3eb4
testb %al, %al
jne 0xb5b4e
leaq 0x7637d(%rip), %rsi     # 0x12beb9
movq %rbx, %rdi
callq 0xdfcd5
testl %eax, %eax
pushq $0x28
popq %r14
cmovel %eax, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/pif.c
// Function: pif_validate_pos
static int pif_validate_pos(deark *c, struct pif_ctx *d, i64 pos)
{
	if(de_inthashtable_add_item(c, d->pos_seen, pos, NULL)) {
		return 1;
	}
	de_err(c, "Bad offset detected");
	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0x18(%rsi), %rsi
xorl %ebx, %ebx
xorl %ecx, %ecx
callq 0xe0a0b
testl %eax, %eax
je 0xb6567
pushq $0x1
popq %rbx
jmp 0xb6578
leaq 0x75a00(%rip), %rsi     # 0x12bf6e
movq %r14, %rdi
xorl %eax, %eax
callq 0xdf2a5
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/printshop.c
// Function: de_module_printshop
void de_module_printshop(deark *c, struct deark_module_info *mi)
{
	mi->id = "printshop";
	mi->desc = "The Print Shop .DAT/.NAM";
	mi->run_fn = de_run_printshop;
	mi->identify_fn = de_identify_printshop;
}

// Assembly:
leaq 0x75bf1(%rip), %rax     # 0x12c18c
movq %rax, (%rsi)
leaq 0x75bcb(%rip), %rax     # 0x12c170
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0xb65c0
movq %rax, 0x18(%rsi)
leaq 0x49(%rip), %rax        # 0xb6604
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/printshop.c
// Function: de_run_printshop
static void de_run_printshop(deark *c, de_module_params *mparams)
{
	lctx *d;
	d = de_malloc(c, sizeof(lctx));
	d->fmt = PRINTSHOP_FMT_DAT;
	de_declare_fmt(c, "The Print Shop (DAT/NAM)");
	do_printshop_etc(c, d);
	de_free(c, d);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x10
popq %rsi
callq 0xdecaf
movq %rax, %r14
movl $0x1, (%rax)
leaq 0x75c1b(%rip), %rsi     # 0x12c1fa
movq %rbx, %rdi
callq 0xe07f7
movq %rbx, %rdi
movq %r14, %rsi
callq 0xb686a
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xded32
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/printshop.c
// Function: de_module_newprintshop
void de_module_newprintshop(deark *c, struct deark_module_info *mi)
{
	// There's no surefire way to distinguish between Print Shop and
	// New Print Shop files, so it's more convenient to put them in separate
	// modules (so the user can simply use -m to select the format).
	mi->id = "newprintshop";
	mi->desc = "The New Print Shop .POG/.PNM";
	mi->run_fn = de_run_newprintshop;
	mi->identify_fn = de_identify_newprintshop;
}

// Assembly:
leaq 0x75b4a(%rip), %rax     # 0x12c189
movq %rax, (%rsi)
leaq 0x75b4d(%rip), %rax     # 0x12c196
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0xb6664
movq %rax, 0x18(%rsi)
leaq 0x49(%rip), %rax        # 0xb66a8
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/printshop.c
// Function: de_run_newprintshop
static void de_run_newprintshop(deark *c, de_module_params *mparams)
{
	lctx *d;
	d = de_malloc(c, sizeof(lctx));
	d->fmt = PRINTSHOP_FMT_POG;
	de_declare_fmt(c, "The New Print Shop (POG/PNM)");
	do_printshop_etc(c, d);
	de_free(c, d);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x10
popq %rsi
callq 0xdecaf
movq %rax, %r14
movl $0x2, (%rax)
leaq 0x75c24(%rip), %rsi     # 0x12c2a7
movq %rbx, %rdi
callq 0xe07f7
movq %rbx, %rdi
movq %r14, %rsi
callq 0xb686a
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xded32
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/printshop.c
// Function: de_module_printmaster
void de_module_printmaster(deark *c, struct deark_module_info *mi)
{
	mi->id = "printmaster";
	mi->desc = "PrintMaster .SHP/.SDR";
	mi->run_fn = de_run_printmaster;
	mi->identify_fn = de_identify_printmaster;
}

// Assembly:
leaq 0x75acb(%rip), %rax     # 0x12c1b3
movq %rax, (%rsi)
leaq 0x75acd(%rip), %rax     # 0x12c1bf
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0xb670d
movq %rax, 0x18(%rsi)
leaq 0x49(%rip), %rax        # 0xb6751
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/printshop.c
// Function: de_run_printmaster
static void de_run_printmaster(deark *c, de_module_params *mparams)
{
	lctx *d;
	d = de_malloc(c, sizeof(lctx));
	d->fmt = PRINTSHOP_FMT_SHP;
	de_declare_fmt(c, "PrintMaster (SHP/SDR)");
	do_printshop_etc(c, d);
	de_free(c, d);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x10
popq %rsi
callq 0xdecaf
movq %rax, %r14
movl $0x3, (%rax)
leaq 0x75b9c(%rip), %rsi     # 0x12c2c8
movq %rbx, %rdi
callq 0xe07f7
movq %rbx, %rdi
movq %r14, %rsi
callq 0xb686a
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xded32
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/printshop.c
// Function: de_identify_printmaster
static int de_identify_printmaster(deark *c)
{
	u8 b[4];
	int sdr_ext;

	sdr_ext = de_input_file_has_ext(c, "sdr");
	de_read(b, 0, 4);
	if(!de_memcmp(b, "\x0b\x34\x58", 3)) {
		return sdr_ext ? 90 : 10;
	}
	if(!sdr_ext) return 0;
	if(b[0]==0x0b) return 30;
	return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x75b7b(%rip), %rsi     # 0x12c2de
callq 0xdfcd5
movl %eax, %ebp
movq 0x18(%rbx), %rdi
xorl %ebx, %ebx
leaq 0xc(%rsp), %r14
pushq $0x4
popq %rcx
movq %r14, %rsi
xorl %edx, %edx
callq 0xe3cb7
leaq 0x75b59(%rip), %rsi     # 0x12c2e2
pushq $0x3
popq %rdx
movq %r14, %rdi
callq 0x18230
testl %eax, %eax
je 0xb67ab
testl %ebp, %ebp
je 0xb67b6
xorl %eax, %eax
cmpb $0xb, 0xc(%rsp)
pushq $0x1e
popq %rbx
cmovnel %eax, %ebx
jmp 0xb67b6
testl %ebp, %ebp
pushq $0xa
popq %rax
pushq $0x5a
popq %rbx
cmovel %eax, %ebx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/printshop.c
// Function: de_module_printshop_gs
void de_module_printshop_gs(deark *c, struct deark_module_info *mi)
{
	mi->id = "printshop_gs";
	mi->desc = "Print Shop - Apple IIgs";
	mi->run_fn = de_run_printshop_gs;
	mi->identify_fn = NULL;
}

// Assembly:
leaq 0x75a0d(%rip), %rax     # 0x12c1d5
movq %rax, (%rsi)
leaq 0x75a10(%rip), %rax     # 0x12c1e2
movq %rax, 0x8(%rsi)
leaq 0xa(%rip), %rax         # 0xb67e7
movq %rax, 0x18(%rsi)
andq $0x0, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/printshop.c
// Function: de_run_printshop_gs
static void de_run_printshop_gs(deark *c, de_module_params *mparams)
{
	de_bitmap *img = NULL;
	de_finfo *fi = NULL;
	static const de_color pal[8] = {
		0xffffffffU,0xffffff00U,0xffff0000U,0xffff6600U,
		0xff0000ffU,0xff00ff00U,0xffcc00ccU,0xff000000U };

	img = de_bitmap_create(c, 88, 52, 3);
	fi = de_finfo_create(c);
	fi->density.code = DE_DENSITY_UNK_UNITS;
	// I don't know what the density ratio should be.
	// But 88:52 (1.692:1), making the images square, seems pretty close
	// to what was intended.
	fi->density.xdens = 88.0;
	fi->density.ydens = 52.0;
	de_convert_image_paletted_planar(c->infile, 0, 3, 11, 11*52, pal, img, 0x2);
	de_bitmap_write_to_file_finfo(img, fi, DE_CREATEFLAG_OPT_IMAGE);
	de_bitmap_destroy(img);
	de_finfo_destroy(c, fi);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
pushq $0x58
popq %rsi
pushq $0x34
popq %rdx
pushq $0x3
popq %rcx
callq 0xe7437
movq %rax, %r14
movq %rbx, %rdi
callq 0xdfd1a
movq %rax, %r15
movl $0x1, 0x78(%rax)
movaps 0x75947(%rip), %xmm0    # 0x12c160
movups %xmm0, 0x80(%rax)
movq 0x18(%rbx), %rdi
leaq 0x75ac5(%rip), %r9      # 0x12c2f0
pushq $0x3
popq %rdx
pushq $0xb
popq %rcx
movl $0x23c, %r8d            # imm = 0x23C
xorl %esi, %esi
pushq $0x2
pushq %r14
callq 0xe7de1
popq %rax
popq %rcx
pushq $0x2
popq %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0xe70ab
movq %r14, %rdi
callq 0xe7084
movq %rbx, %rdi
movq %r15, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0xdfd24
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/psf.c
// Function: de_module_psf
void de_module_psf(deark *c, struct deark_module_info *mi)
{
	mi->id = "psf";
	mi->desc = "PC Screen Font";
	mi->run_fn = de_run_psf;
	mi->identify_fn = de_identify_psf;
	mi->help_fn = de_help_psf;
}

// Assembly:
leaq 0x7576d(%rip), %rax     # 0x12c310
movq %rax, (%rsi)
leaq 0x75767(%rip), %rax     # 0x12c314
movq %rax, 0x8(%rsi)
leaq 0x1b(%rip), %rax        # 0xb6bd3
movq %rax, 0x18(%rsi)
leaq 0x7b9(%rip), %rax       # 0xb737c
movq %rax, 0x20(%rsi)
leaq 0x7fc(%rip), %rax       # 0xb73ca
movq %rax, 0x28(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/psf.c
// Function: do_extra_codepoint
static void do_extra_codepoint(deark *c, lctx *d, struct de_bitmap_font *font,
	i64 cur_idx, i32 n)
{
	i64 extra_idx;

	if(!d->read_extra_codepoints) return;
	if(d->num_extra_codepoints >= MAX_EXTRA_CODEPOINTS) return;

	extra_idx = d->index_of_first_extra_codepoint + d->num_extra_codepoints;
	de_dbg2(c, "char[%d] alias [%d] = U+%04x", (int)cur_idx, (int)extra_idx,
		(unsigned int)n);
	if(n == font->char_array[cur_idx].codepoint_unicode) {
		de_dbg2(c, "ignoring superfluous alias");
		return;
	}
	font->char_array[extra_idx].codepoint_unicode = n;
	font->char_array[extra_idx].bitmap = font->char_array[cur_idx].bitmap;
	d->num_extra_codepoints++;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x0, 0x50(%rsi)
je 0xb7461
movq %rsi, %rbx
movq 0x68(%rsi), %r13
cmpq $0x7cf, %r13            # imm = 0x7CF
jg 0xb7461
movl %r8d, %ebp
movq %rcx, %r15
movq %rdx, %r12
movq %rdi, %r14
addq 0x60(%rbx), %r13
leaq 0x75076(%rip), %rsi     # 0x12c486
movl %r15d, %edx
movl %r13d, %ecx
xorl %eax, %eax
callq 0xde9f1
movq 0x20(%r12), %rax
imulq $0x28, %r15, %rcx
cmpl %ebp, 0x4(%rax,%rcx)
jne 0xb744b
leaq 0x75070(%rip), %rsi     # 0x12c4a3
movq %r14, %rdi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xde9f1
imulq $0x28, %r13, %rdx
movl %ebp, 0x4(%rax,%rdx)
movq 0x20(%rax,%rcx), %rcx
movq %rcx, 0x20(%rax,%rdx)
incq 0x68(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/psionapp.c
// Function: de_module_psionapp
void de_module_psionapp(deark *c, struct deark_module_info *mi)
{
	mi->id = "psionapp";
	mi->desc = "Psion .APP/.IMG and .OPA/.OPO";
	mi->desc2 = "extract images";
	mi->run_fn = de_run_psionapp;
	mi->identify_fn = de_identify_psionapp;
}

// Assembly:
leaq 0x750a9(%rip), %rax     # 0x12c520
movq %rax, (%rsi)
leaq 0x750a8(%rip), %rax     # 0x12c529
movq %rax, 0x8(%rsi)
leaq 0x750bb(%rip), %rax     # 0x12c547
movq %rax, 0x10(%rsi)
leaq 0x10(%rip), %rax        # 0xb74a7
movq %rax, 0x18(%rsi)
leaq 0x121(%rip), %rax       # 0xb75c3
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/psionapp.c
// Function: de_run_psionapp
static void de_run_psionapp(deark *c, de_module_params *mparams)
{
	u8 b;
	const char *s;
	lctx *d = NULL;

	d = de_malloc(c, sizeof(lctx));

	s = de_get_ext_option(c, "psionapp:convertpic");
	if(s) {
		d->convert_images = 1;
	}

	b = de_getbyte(0);
	if(b=='O') {
		do_opo_opa(c, d);
	}
	else {
		do_img_app(c, d);
	}

	de_free(c, d);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
pushq $0x4
popq %rsi
callq 0xdecaf
movq %rax, %r14
leaq 0x75091(%rip), %rsi     # 0x12c556
movq %rbx, %rdi
callq 0xdfa87
testq %rax, %rax
je 0xb74d9
movl $0x1, (%r14)
movq 0x18(%rbx), %rdi
xorl %esi, %esi
callq 0xe3eb4
cmpb $0x4f, %al
jne 0xb755e
leaq 0x7507b(%rip), %rsi     # 0x12c56a
movq %rbx, %rdi
callq 0xe07f7
movq 0x18(%rbx), %rdi
pushq $0x12
popq %rsi
callq 0xe3fa3
movq %rax, %r15
leaq 0x7506b(%rip), %rsi     # 0x12c578
movq %rbx, %rdi
movl %r15d, %edx
xorl %eax, %eax
callq 0xde896
movq 0x18(%rbx), %rdi
pushq $0x14
popq %rsi
callq 0xe3eb4
movzbl %al, %r12d
addq $0x15, %r12
cmpq %r15, %r12
jge 0xb75af
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xe3fa3
movq %rax, %r13
leaq 0x2(%r12), %rdx
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rcx
callq 0xb7623
addq %r13, %r12
addq $0x2, %r12
jmp 0xb752e
leaq 0x75076(%rip), %rsi     # 0x12c5db
movq %rbx, %rdi
callq 0xe07f7
pushq $0x2a
popq %r15
cmpq $0x3a, %r15
je 0xb75af
movq 0x18(%rbx), %rdi
leaq -0x2(%r15), %rsi
callq 0xe3fa3
movq %rax, %r12
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xe3fa3
testq %r12, %r12
je 0xb75af
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
movq %rax, %rcx
callq 0xb7623
addq $0x4, %r15
jmp 0xb7571
movq %rbx, %rdi
movq %r14, %rsi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xded32
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/psionapp.c
// Function: de_identify_psionapp
static int de_identify_psionapp(deark *c)
{
	u8 b[16];
	de_read(b, 0, 16);
	if(!de_memcmp(b, "ImageFileType**\0", 16))
		return 100;
	if(!de_memcmp(b, "OPLObjectFile**\0", 16))
		return 100;
	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq 0x18(%rdi), %rdi
xorl %ebx, %ebx
movq %rsp, %r14
pushq $0x10
popq %rcx
movq %r14, %rsi
xorl %edx, %edx
callq 0xe3cb7
movdqa (%r14), %xmm0
pcmpeqb 0x74f13(%rip), %xmm0    # 0x12c500
pmovmskb %xmm0, %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
je 0xb7616
movdqa (%rsp), %xmm0
pcmpeqb 0x74f0b(%rip), %xmm0    # 0x12c510
pmovmskb %xmm0, %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
pushq $0x64
popq %rax
cmovel %eax, %ebx
jmp 0xb7619
pushq $0x64
popq %rbx
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/psionapp.c
// Function: handle_embedded_file
static void handle_embedded_file(deark *c, lctx *d, i64 offset, i64 len)
{
	u8 buf[16];
	const char *ext;
	int extract_this_file;
	int is_pic;

	de_dbg(c, "embedded file at %d, len=%d", (int)offset, (int)len);
	is_pic = 0;
	ext = "bin";
	extract_this_file = 0;

	if(len>0 && c->extract_level>=2)
		extract_this_file = 1;

	// As far as I can tell, there's no way to tell the type of an
	// embedded file, except by sniffing it.
	de_read(buf, offset, 16);
	if(len>=8) {
		if(!de_memcmp(buf, "PIC\xdc\x30\x30", 6)) {
			// Looks like a PIC file
			is_pic = 1;
			ext = "pic";
			extract_this_file = 1;
		}
	}

	if(extract_this_file) {
		if(is_pic && d->convert_images) {
			// Convert PIC to PNG.
			// For consistency, this option shouldn't exist. But I'm not sure that
			// PIC files embedded in APP files are really the same as PIC files on
			// their own. They might need special handling. Until I'm sure they don't,
			// I'll leave this option here.
			de_run_module_by_id_on_slice(c, "psionpic", NULL, c->infile, offset, len);
		}
		else {
			// Just extract the file
			dbuf_create_file_from_slice(c->infile, offset, len, ext, NULL, is_pic?0:DE_CREATEFLAG_IS_AUX);
		}
	}
	else {
		de_dbg(c, "(not extracting this file)");
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r15
leaq 0x74f52(%rip), %rsi     # 0x12c594
xorl %eax, %eax
callq 0xde896
testq %rbx, %rbx
jle 0xb765c
cmpl $0x2, 0x90(%r15)
setl %bpl
jmp 0xb765f
movb $0x1, %bpl
movq 0x18(%r15), %rdi
movq %rsp, %rsi
pushq $0x10
popq %rcx
movq %r14, %rdx
callq 0xe3cb7
cmpq $0x8, %rbx
jl 0xb768d
leaq 0x74f32(%rip), %rsi     # 0x12c5b0
movq %rsp, %rdi
pushq $0x6
popq %rdx
callq 0x18230
testl %eax, %eax
je 0xb76cf
testb %bpl, %bpl
je 0xb76a5
leaq 0x74f27(%rip), %rsi     # 0x12c5c0
movq %r15, %rdi
xorl %eax, %eax
callq 0xde896
jmp 0xb76c2
pushq $0x1
popq %r9
leaq 0x70e2d(%rip), %rcx     # 0x1284dd
movq 0x18(%r15), %rdi
movq %r14, %rsi
movq %rbx, %rdx
xorl %r8d, %r8d
callq 0xe4e0b
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x0, (%r12)
je 0xb76f3
movq 0x18(%r15), %rcx
leaq 0x74ed6(%rip), %rsi     # 0x12c5b7
movq %r15, %rdi
xorl %edx, %edx
movq %r14, %r8
movq %rbx, %r9
callq 0xdf9b8
jmp 0xb76c2
xorl %r9d, %r9d
leaq 0x71788(%rip), %rcx     # 0x128e85
jmp 0xb76b0
nop
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/psionpic.c
// Function: de_module_psionpic
void de_module_psionpic(deark *c, struct deark_module_info *mi)
{
	mi->id = "psionpic";
	mi->desc = "Psion PIC, a.k.a. EPOC PIC";
	mi->run_fn = de_run_psionpic;
	mi->identify_fn = de_identify_psionpic;
	mi->help_fn = de_help_psionpic;
}

// Assembly:
leaq 0x74eb0(%rip), %rax     # 0x12c5b7
movq %rax, (%rsi)
leaq 0x74efa(%rip), %rax     # 0x12c60b
movq %rax, 0x8(%rsi)
leaq 0x1b(%rip), %rax        # 0xb7737
movq %rax, 0x18(%rsi)
leaq 0x355(%rip), %rax       # 0xb7a7c
movq %rax, 0x20(%rsi)
leaq 0x36c(%rip), %rax       # 0xb7a9e
movq %rax, 0x28(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/psionpic.c
// Function: do_bitmap_2planes
static void do_bitmap_2planes(deark *c, lctx *d, i64 pn1, i64 pn2)
{
	de_bitmap *img = NULL;
	i64 planespan;
	// AFAIK, all relevant devices support only 3 colors. Two of the four codes
	// map to black. We'll make the two blacks slightly different, just to avoid
	// losing information.
	static const de_color pal[4] = { 0xffffffff, 0xff808080U, 0xff010101U, 0xff000000U };

	de_dbg(c, "making a grayscale image from planes %d and %d", (int)pn1, (int)pn2);

	// TODO: Support -padpix (need samples with width not a multiple of 16)
	img = de_bitmap_create(c, d->plane_info[pn1].width, d->plane_info[pn1].height, 1);

	planespan = d->plane_info[1].image_pos - d->plane_info[0].image_pos;
	de_convert_image_paletted_planar(c->infile, d->plane_info[0].image_pos, 2,
		d->plane_info[0].rowspan, planespan, pal, img, 0x1);
	de_bitmap_write_to_file(img, NULL, 0);

	de_bitmap_destroy(img);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x74bf3(%rip), %rsi     # 0x12c6b4
xorl %eax, %eax
callq 0xde896
movq 0x10(%r15), %rax
imulq $0x30, %r14, %rcx
movq (%rax,%rcx), %rsi
movq 0x8(%rax,%rcx), %rdx
pushq $0x1
popq %rcx
movq %rbx, %rdi
callq 0xe7437
movq %rax, %r14
movq 0x10(%r15), %rax
movq 0x40(%rax), %r8
movq 0x10(%rax), %rsi
movq 0x20(%rax), %rcx
subq %rsi, %r8
movq 0x18(%rbx), %rdi
leaq 0x74c4b(%rip), %r9      # 0x12c750
pushq $0x2
popq %rdx
pushq $0x1
pushq %r14
callq 0xe7de1
popq %rax
popq %rcx
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xe70b7
movq %r14, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0xe7084
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/psionpic.c
// Function: do_bitmap_1plane
static void do_bitmap_1plane(deark *c, lctx *d, i64 plane_num)
{
	struct plane_info_struct *pi = &d->plane_info[plane_num];

	de_dbg(c, "making a bilevel image from plane %d", (int)plane_num);

	de_convert_and_write_image_bilevel2(c->infile, pi->image_pos, pi->width, pi->height,
		pi->rowspan, DE_CVTF_WHITEISZERO|DE_CVTF_LSBFIRST, NULL, 0);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x10(%rsi), %r14
imulq $0x30, %rdx, %r15
leaq 0x74ba0(%rip), %rsi     # 0x12c6e3
xorl %eax, %eax
callq 0xde896
movq 0x18(%rbx), %rdi
movq 0x10(%r14,%r15), %rsi
movq (%r14,%r15), %rdx
movq 0x8(%r14,%r15), %rcx
movq 0x20(%r14,%r15), %r8
pushq $0x3
popq %r9
pushq $0x0
pushq $0x0
callq 0xe78af
popq %rax
popq %rcx
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/psionpic.c
// Function: could_be_2bit
static int could_be_2bit(lctx *d, int startpos)
{
	i64 i;
	if( (d->num_planes - startpos)%2 != 0) {
		// Not an even number of bitmaps.
		return 0;
	}
	for(i=startpos; i<d->num_planes; i+=2) {
		if(d->plane_info[i].width!=d->plane_info[i+1].width ||
			d->plane_info[i].height!=d->plane_info[i+1].height)
		{
			// Bitmaps aren't the same size.
			return 0;
		}
	}
	return 1;
}

// Assembly:
movq (%rdi), %rcx
movl %ecx, %edx
subl %esi, %edx
xorl %eax, %eax
testb $0x1, %dl
jne 0xb7bc1
movl %esi, %edx
imulq $0x30, %rdx, %rsi
addq $0x38, %rsi
addq $-0x2, %rdx
pushq $0x1
popq %r8
addq $0x2, %rdx
cmpq %rcx, %rdx
jge 0xb7bc2
movq 0x10(%rdi), %r9
movq -0x38(%r9,%rsi), %r10
cmpq -0x8(%r9,%rsi), %r10
jne 0xb7bc1
movq -0x30(%r9,%rsi), %r10
leaq 0x60(%rsi), %r11
cmpq (%r9,%rsi), %r10
movq %r11, %rsi
je 0xb7b96
retq
movl %r8d, %eax
retq
nop
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/pcf.c
// Function: de_module_pcf
void de_module_pcf(deark *c, struct deark_module_info *mi)
{
	mi->id = "pcf";
	mi->desc = "PCF font";
	mi->run_fn = de_run_pcf;
	mi->identify_fn = de_identify_pcf;
}

// Assembly:
leaq 0x74bb1(%rip), %rax     # 0x12c780
movq %rax, (%rsi)
leaq 0x74bab(%rip), %rax     # 0x12c784
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0xb7bf4
movq %rax, 0x18(%rsi)
leaq 0x79b(%rip), %rax       # 0xb838a
movq %rax, 0x20(%rsi)
retq