LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/nufx.c
// Function: nufx_filename_to_ucstring
static void nufx_filename_to_ucstring(deark *c, struct nufx_ctx *d,
	struct nufx_record *rec, dbuf *inf, i64 pos1, i64 fnlen1,
	de_ucstring *s)
{
	i64 fnlen;
	u8 strip_high_bit = 0;
	dbuf *tmpdbuf = NULL;

	fnlen = de_min_int(fnlen1, 255);
	if(fnlen<1) return;

	// Documentation says only 7 bits are significant in ProDOS pathnames.
	// This is probably not the best we could do. I suspect filesys_id is not
	// always set correctly.
	if(d->using_default_encoding && rec->filesys_id==0x0001) { // 0x0001 = ProDOS
		strip_high_bit = 1;
	}

	if(strip_high_bit) {
		i64 i;
		i64 pos = pos1;

		tmpdbuf = dbuf_create_membuf(c, fnlen, 0);
		for(i=0; i<fnlen; i++) {
			u8 b;

			b = dbuf_getbyte_p(inf, &pos);
			b &= 0x7f;
			dbuf_writebyte(tmpdbuf, b);
		}
		dbuf_read_to_ucstring(tmpdbuf, 0, fnlen, s, 0, d->input_encoding);
	}
	else {
		dbuf_read_to_ucstring(inf, pos1, fnlen, s, 0, d->input_encoding);
	}

	dbuf_close(tmpdbuf);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movb $0x0, -0x39(%rbp)
movq $0x0, -0x48(%rbp)
movq -0x30(%rbp), %rdi
movl $0xff, %esi
callq 0x15ccf0
movq %rax, -0x38(%rbp)
cmpq $0x1, -0x38(%rbp)
jge 0xd6ede
jmp 0xd6fb0
movq -0x10(%rbp), %rax
movzbl 0x3(%rax), %eax
cmpl $0x0, %eax
je 0xd6ef9
movq -0x18(%rbp), %rax
cmpl $0x1, 0x30(%rax)
jne 0xd6ef9
movb $0x1, -0x39(%rbp)
cmpb $0x0, -0x39(%rbp)
je 0xd6f87
movq -0x28(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rsi
xorl %edx, %edx
callq 0x168020
movq %rax, -0x48(%rbp)
movq $0x0, -0x50(%rbp)
movq -0x50(%rbp), %rax
cmpq -0x38(%rbp), %rax
jge 0xd6f65
movq -0x20(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x165170
movb %al, -0x59(%rbp)
movzbl -0x59(%rbp), %eax
andl $0x7f, %eax
movb %al, -0x59(%rbp)
movq -0x48(%rbp), %rdi
movzbl -0x59(%rbp), %esi
callq 0x168380
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0xd6f26
movq -0x48(%rbp), %rdi
movq -0x38(%rbp), %rdx
movq 0x10(%rbp), %rcx
movq -0x10(%rbp), %rax
movl 0x8(%rax), %r9d
xorl %eax, %eax
movl %eax, %esi
xorl %r8d, %r8d
callq 0x1669f0
jmp 0xd6fa7
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x38(%rbp), %rdx
movq 0x10(%rbp), %rcx
movq -0x10(%rbp), %rax
movl 0x8(%rax), %r9d
xorl %r8d, %r8d
callq 0x1669f0
movq -0x48(%rbp), %rdi
callq 0x1676a0
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/nufx.c
// Function: get_cmpr_meth_name
static const char *get_cmpr_meth_name(UI n)
{
	const char *name = NULL;

	switch(n) {
	case 0: name="uncompressed"; break;
	case 1: name="Squeeze"; break;
	case 2: name="ShrinkIt LZW/1"; break;
	case 3: name="ShrinkIt LZW/2"; break;
	case 4: name="Unix compress 12-bit"; break;
	case 5: name="Unix compress 16-bit"; break;
	}
	return name?name:"?";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x4(%rbp)
movq $0x0, -0x10(%rbp)
movl -0x4(%rbp), %eax
movq %rax, -0x18(%rbp)
subq $0x5, %rax
ja 0xd747c
movq -0x18(%rbp), %rax
leaq 0xe3a3d(%rip), %rcx     # 0x1bae64
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0xfea01(%rip), %rax     # 0x1d5e38
movq %rax, -0x10(%rbp)
jmp 0xd747c
leaq 0xe3d20(%rip), %rax     # 0x1bb164
movq %rax, -0x10(%rbp)
jmp 0xd747c
leaq 0xe3d1b(%rip), %rax     # 0x1bb16c
movq %rax, -0x10(%rbp)
jmp 0xd747c
leaq 0xe3d1d(%rip), %rax     # 0x1bb17b
movq %rax, -0x10(%rbp)
jmp 0xd747c
leaq 0xe3d1f(%rip), %rax     # 0x1bb18a
movq %rax, -0x10(%rbp)
jmp 0xd747c
leaq 0xe3d27(%rip), %rax     # 0x1bb19f
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0xd748d
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0xd749a
leaq 0xe0799(%rip), %rax     # 0x1b7c2d
movq %rax, -0x20(%rbp)
jmp 0xd749a
movq -0x20(%rbp), %rax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/nufx.c
// Function: get_thread_type_name
static const char *get_thread_type_name(UI cla, UI kind)
{
	if(cla==0) { // "message"
		if(kind==0) return "text (obsolete)";
		if(kind==1) return "comment"; // (?)
		if(kind==2) return "icon";
	}
	if(cla==1) { // "control"
		if(kind==0) return "directory";
		return "unknown 'control' thread";
	}
	if(cla==2) { // "data"
		if(kind==0) return "data fork";
		if(kind==1) return "disk image";
		if(kind==2) return "resource fork";
		return "unknown 'data' thread";
	}
	if(cla==3) { // "filename"
		if(kind==0) return "filename";
	}
	return "?";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0xc(%rbp)
movl %esi, -0x10(%rbp)
cmpl $0x0, -0xc(%rbp)
jne 0xd74f4
cmpl $0x0, -0x10(%rbp)
jne 0xd74c6
leaq 0xe3cf7(%rip), %rax     # 0x1bb1b4
movq %rax, -0x8(%rbp)
jmp 0xd758c
cmpl $0x1, -0x10(%rbp)
jne 0xd74dc
leaq 0xf8e72(%rip), %rax     # 0x1d0345
movq %rax, -0x8(%rbp)
jmp 0xd758c
cmpl $0x2, -0x10(%rbp)
jne 0xd74f2
leaq 0xd8f61(%rip), %rax     # 0x1b044a
movq %rax, -0x8(%rbp)
jmp 0xd758c
jmp 0xd74f4
cmpl $0x1, -0xc(%rbp)
jne 0xd751a
cmpl $0x0, -0x10(%rbp)
jne 0xd750d
leaq 0xc8650(%rip), %rax     # 0x19fb57
movq %rax, -0x8(%rbp)
jmp 0xd758c
leaq 0xe3cb0(%rip), %rax     # 0x1bb1c4
movq %rax, -0x8(%rbp)
jmp 0xd758c
cmpl $0x2, -0xc(%rbp)
jne 0xd7566
cmpl $0x0, -0x10(%rbp)
jne 0xd7533
leaq 0xcb3ce(%rip), %rax     # 0x1a28fb
movq %rax, -0x8(%rbp)
jmp 0xd758c
cmpl $0x1, -0x10(%rbp)
jne 0xd7546
leaq 0xd690f(%rip), %rax     # 0x1ade4f
movq %rax, -0x8(%rbp)
jmp 0xd758c
cmpl $0x2, -0x10(%rbp)
jne 0xd7559
leaq 0xcb5ca(%rip), %rax     # 0x1a2b1d
movq %rax, -0x8(%rbp)
jmp 0xd758c
leaq 0xe3c7d(%rip), %rax     # 0x1bb1dd
movq %rax, -0x8(%rbp)
jmp 0xd758c
cmpl $0x3, -0xc(%rbp)
jne 0xd7581
cmpl $0x0, -0x10(%rbp)
jne 0xd757f
leaq 0xe0812(%rip), %rax     # 0x1b7d8b
movq %rax, -0x8(%rbp)
jmp 0xd758c
jmp 0xd7581
leaq 0xe06a5(%rip), %rax     # 0x1b7c2d
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/nufx.c
// Function: fixup_filename
static void fixup_filename(deark *c, struct nufx_record *rec)
{
	i64 i;
	de_rune pathsep;

	pathsep = (de_rune)(rec->filesys_info & 0xff);
	if(pathsep=='/') return;

	for(i=0; i<rec->filename->len; i++) {
		de_rune x;

		x = rec->filename->str[i];
		if(x==pathsep) {
			rec->filename->str[i] = '/';
		}
		else if(x=='/') {
			rec->filename->str[i] = '_';
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl 0x34(%rax), %eax
andl $0xff, %eax
movl %eax, -0x1c(%rbp)
cmpl $0x2f, -0x1c(%rbp)
jne 0xd77c6
jmp 0xd7855
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x98(%rcx), %rcx
cmpq 0x10(%rcx), %rax
jge 0xd7855
movq -0x10(%rbp), %rax
movq 0x98(%rax), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jne 0xd7820
movq -0x10(%rbp), %rax
movq 0x98(%rax), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rcx
movl $0x2f, (%rax,%rcx,4)
jmp 0xd7842
cmpl $0x2f, -0x20(%rbp)
jne 0xd7840
movq -0x10(%rbp), %rax
movq 0x98(%rax), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rcx
movl $0x5f, (%rax,%rcx,4)
jmp 0xd7842
jmp 0xd7844
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0xd77ce
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/nufx.c
// Function: do_extract_aux_thread
static void do_extract_aux_thread(deark *c, struct nufx_ctx *d,
	struct nufx_record *rec, struct nufx_thread *t, const char *name)
{
	de_finfo *fi = NULL;
	dbuf *outf = NULL;

	fi = de_finfo_create(c);
	// TODO: Better file naming
	de_finfo_set_name_from_sz(c, fi, name, 0, DE_ENCODING_UTF8);
	outf = dbuf_create_output_file(c, NULL, fi, DE_CREATEFLAG_IS_AUX);
	decompress_thread(c, d, rec, t, outf);
	dbuf_close(outf);
	de_finfo_destroy(c, fi);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x8(%rbp), %rdi
callq 0x15d230
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x28(%rbp), %rdx
xorl %ecx, %ecx
movl $0x2, %r8d
callq 0x15d4c0
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rdx
xorl %eax, %eax
movl %eax, %esi
movl $0x1, %ecx
callq 0x166c60
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x38(%rbp), %r8
callq 0xd75a0
movq -0x38(%rbp), %rdi
callq 0x1676a0
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x15d260
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/nufx.c
// Function: do_dbg_comment
static void do_dbg_comment(deark *c, struct nufx_ctx *d,
	struct nufx_record *rec, struct nufx_thread *t)
{
	dbuf *tmpdbuf = NULL;
	de_ucstring *s = NULL;

	tmpdbuf = dbuf_create_membuf(c, DE_DBG_MAX_STRLEN, 0x1);
	if(!decompress_thread(c, d, rec, t, tmpdbuf)) goto done;

	s = ucstring_create(c);
	dbuf_read_to_ucstring_n(tmpdbuf, 0, tmpdbuf->len, DE_DBG_MAX_STRLEN,
		s, 0, d->input_encoding);
	de_dbg(c, "comment: \"%s\"", ucstring_getpsz_d(s));

done:
	dbuf_close(tmpdbuf);
	ucstring_destroy(s);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movl $0x1f4, %esi            # imm = 0x1F4
movl $0x1, %edx
callq 0x168020
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %r8
callq 0xd75a0
cmpl $0x0, %eax
jne 0xd7caf
jmp 0xd7d0d
movq -0x8(%rbp), %rdi
callq 0x1711d0
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rdi
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rdx
movq -0x30(%rbp), %r8
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
xorl %ecx, %ecx
movl %ecx, %esi
movl $0x1f4, %ecx            # imm = 0x1F4
xorl %r9d, %r9d
movl %eax, (%rsp)
callq 0x166a40
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rdi
callq 0x172650
movq -0x38(%rbp), %rdi
movq %rax, %rdx
leaq 0xc8946(%rip), %rsi     # 0x1a064c
movb $0x0, %al
callq 0x15b0d0
movq -0x28(%rbp), %rdi
callq 0x1676a0
movq -0x30(%rbp), %rdi
callq 0x171750
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/nufx.c
// Function: decompress_chunk_lzw1_lzw_layer
static void decompress_chunk_lzw1_lzw_layer(deark *c,
	struct de_dfilter_in_params *dcmpri,
	struct de_dfilter_out_params *dcmpro, struct de_dfilter_results *dres)
{
	struct de_lzw_params delzwp;

	de_zeromem(&delzwp, sizeof(struct de_lzw_params));
	delzwp.fmt = DE_LZWFMT_SHRINKIT1;
	delzwp.max_code_size = 12;
	fmtutil_decompress_lzw(c, dcmpri, dcmpro, dres, &delzwp);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
leaq -0x34(%rbp), %rdi
xorl %esi, %esi
movl $0x14, %edx
callq 0x19140
movl $0x9, -0x34(%rbp)
movl $0xc, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
leaq -0x34(%rbp), %r8
callq 0x1843b0
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/nufx.c
// Function: decompress_chunk_rle_layer
static void decompress_chunk_rle_layer(deark *c, struct de_dfilter_in_params *dcmpri,
	struct de_dfilter_out_params *dcmpro, struct de_dfilter_results *dres, u8 rlechar)
{
	i64 srcpos = dcmpri->pos;
	i64 endpos;
	i64 nbytes_written = 0;
	const char *modname = "rle";

	endpos = dcmpri->pos + dcmpri->len;
	while(srcpos < endpos) {
		u8 x;

		if(nbytes_written >= dcmpro->expected_len) break;
		x = dbuf_getbyte_p(dcmpri->f, &srcpos);
		if(x==rlechar) {
			i64 count;
			u8 val;

			val = dbuf_getbyte_p(dcmpri->f, &srcpos);
			count = 1 + (i64)dbuf_getbyte_p(dcmpri->f, &srcpos);
			if(nbytes_written+count > dcmpro->expected_len) {
				goto done;
			}
			dbuf_write_run(dcmpro->f, val, count);
			nbytes_written += count;
		}
		else {
			dbuf_writebyte(dcmpro->f, x);
			nbytes_written++;
		}
	}

done:
	if(nbytes_written != dcmpro->expected_len) {
		de_dfilter_set_generic_error(c, dres, modname);
	}
	dres->bytes_consumed = srcpos - dcmpri->pos;
	dres->bytes_consumed_valid = 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movb %r8b, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movb %al, -0x21(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
movq $0x0, -0x40(%rbp)
leaq 0xd7e0a(%rip), %rax     # 0x1b0703
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rcx
addq 0x10(%rcx), %rax
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x38(%rbp), %rax
jge 0xd89d8
movq -0x40(%rbp), %rax
movq -0x18(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jl 0xd8932
jmp 0xd89d8
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq -0x30(%rbp), %rsi
callq 0x165170
movb %al, -0x49(%rbp)
movzbl -0x49(%rbp), %eax
movzbl -0x21(%rbp), %ecx
cmpl %ecx, %eax
jne 0xd89b7
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq -0x30(%rbp), %rsi
callq 0x165170
movb %al, -0x59(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq -0x30(%rbp), %rsi
callq 0x165170
movzbl %al, %eax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
movq -0x40(%rbp), %rax
addq -0x58(%rbp), %rax
movq -0x18(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jle 0xd8993
jmp 0xd89da
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movb -0x59(%rbp), %al
movq -0x58(%rbp), %rdx
movzbl %al, %esi
callq 0x168800
movq -0x58(%rbp), %rax
addq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
jmp 0xd89d3
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movzbl -0x49(%rbp), %esi
callq 0x168380
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0xd8911
jmp 0xd89da
movq -0x40(%rbp), %rax
movq -0x18(%rbp), %rcx
cmpq 0x10(%rcx), %rax
je 0xd89f9
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x48(%rbp), %rdx
callq 0x177560
movq -0x30(%rbp), %rcx
movq -0x10(%rbp), %rax
subq 0x8(%rax), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rax
movb $0x1, 0x4(%rax)
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/nufx.c
// Function: my_advfile_cbfn_diskimage
static int my_advfile_cbfn_diskimage(deark *c, struct de_advfile *advf,
	struct de_advfile_cbparams *afp)
{
	struct nufx_record *rec = (struct nufx_record*)advf->userdata;
	struct nufx_ctx *d = rec->d;

	if(afp->whattodo == DE_ADVFILE_WRITEMAIN) {
		decompress_thread(c, d, rec, rec->disk_image_thread_ptr, afp->outf);
	}

	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x1, (%rax)
jne 0xd8aa8
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x20(%rbp), %rax
movq 0xc0(%rax), %rcx
movq -0x18(%rbp), %rax
movq 0x8(%rax), %r8
callq 0xd75a0
movl $0x1, %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/nufx.c
// Function: my_advfile_cbfn
static int my_advfile_cbfn(deark *c, struct de_advfile *advf,
	struct de_advfile_cbparams *afp)
{
	struct nufx_record *rec = (struct nufx_record*)advf->userdata;
	struct nufx_ctx *d = rec->d;

	if(afp->whattodo == DE_ADVFILE_WRITEMAIN) {
		decompress_thread(c, d, rec, rec->data_thread_ptr, afp->outf);
	}
	else if(afp->whattodo == DE_ADVFILE_WRITERSRC) {
		decompress_thread(c, d, rec, rec->resource_thread_ptr, afp->outf);
	}

	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x1, (%rax)
jne 0xd8b1a
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x20(%rbp), %rax
movq 0xb0(%rax), %rcx
movq -0x18(%rbp), %rax
movq 0x8(%rax), %r8
callq 0xd75a0
jmp 0xd8b49
movq -0x18(%rbp), %rax
cmpl $0x2, (%rax)
jne 0xd8b47
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x20(%rbp), %rax
movq 0xb8(%rax), %rcx
movq -0x18(%rbp), %rax
movq 0x8(%rax), %r8
callq 0xd75a0
jmp 0xd8b49
movl $0x1, %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/macpaint.c
// Function: de_module_macpaint
void de_module_macpaint(deark *c, struct deark_module_info *mi)
{
	mi->id = "macpaint";
	mi->desc = "MacPaint image";
	mi->run_fn = de_run_macpaint;
	mi->identify_fn = de_identify_macpaint;
	mi->help_fn = de_help_macpaint;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
leaq 0xe2908(%rip), %rcx     # 0x1bb47f
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
leaq 0xe2903(%rip), %rcx     # 0x1bb488
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
leaq 0x2c(%rip), %rcx        # 0xd8bc0
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
leaq 0x2dd(%rip), %rcx       # 0xd8e80
movq %rcx, 0x20(%rax)
movq -0x10(%rbp), %rax
leaq 0x3de(%rip), %rcx       # 0xd8f90
movq %rcx, 0x28(%rax)
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/macpaint.c
// Function: de_identify_macpaint
static int de_identify_macpaint(deark *c)
{
	u8 buf[8];

	if(is_fmac2com(c)) return 85;
	de_read(buf, 65, 8);

	// Not all MacPaint files can be easily identified, but this will work
	// for some of them.
	if(!de_memcmp(buf, "PNTG", 4)) {
		if(c->detection_data->is_macbinary) return 100;
		if(!de_memcmp(&buf[4], "MPNT", 4)) return 80;
		return 70;
	}

	if(de_input_file_has_ext(c, "mac")) return 10;
	if(de_input_file_has_ext(c, "macp")) return 15;
	if(de_input_file_has_ext(c, "pntg")) return 15;
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0xd8fd0
cmpb $0x0, %al
je 0xd8ea5
movl $0x55, -0x4(%rbp)
jmp 0xd8f7d
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x18(%rbp), %rsi
movl $0x41, %edx
movl $0x8, %ecx
callq 0x164d10
leaq -0x18(%rbp), %rax
movl (%rax), %eax
subl $0x47544e50, %eax       # imm = 0x47544E50
setne %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0xd8f1c
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
cmpb $0x0, 0x4(%rax)
je 0xd8ef0
movl $0x64, -0x4(%rbp)
jmp 0xd8f7d
leaq -0x18(%rbp), %rax
addq $0x4, %rax
movl (%rax), %eax
subl $0x544e504d, %eax       # imm = 0x544E504D
setne %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0xd8f13
movl $0x50, -0x4(%rbp)
jmp 0xd8f7d
movl $0x46, -0x4(%rbp)
jmp 0xd8f7d
movq -0x10(%rbp), %rdi
leaq 0xc74ef(%rip), %rsi     # 0x1a0416
callq 0x15d180
cmpl $0x0, %eax
je 0xd8f3a
movl $0xa, -0x4(%rbp)
jmp 0xd8f7d
movq -0x10(%rbp), %rdi
leaq 0xe292e(%rip), %rsi     # 0x1bb873
callq 0x15d180
cmpl $0x0, %eax
je 0xd8f58
movl $0xf, -0x4(%rbp)
jmp 0xd8f7d
movq -0x10(%rbp), %rdi
leaq 0xe2915(%rip), %rsi     # 0x1bb878
callq 0x15d180
cmpl $0x0, %eax
je 0xd8f76
movl $0xf, -0x4(%rbp)
jmp 0xd8f7d
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/macpaint.c
// Function: is_fmac2com
static u8 is_fmac2com(deark *c)
{
	if(dbuf_memcmp(c->infile, 0, (const void*)"\xeb\x79\x90", 3)) return 0;
	if(dbuf_memcmp(c->infile, 608,
		(const void*)"\x80\x03\x83\xc3\x0f\xb1\x04\xd3\xeb\xb4\x4a\xcd\x21\xb4\x48\xbb", 16))
	{
		return 0;
	}
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
leaq 0xe2614(%rip), %rdx     # 0x1bb603
movl $0x3, %ecx
callq 0x166ab0
cmpl $0x0, %eax
je 0xd9004
movb $0x0, -0x1(%rbp)
jmp 0xd9031
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0x260, %esi            # imm = 0x260
leaq 0xe25ef(%rip), %rdx     # 0x1bb607
movl $0x10, %ecx
callq 0x166ab0
cmpl $0x0, %eax
je 0xd902d
movb $0x0, -0x1(%rbp)
jmp 0xd9031
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/macpaint.c
// Function: do_decode_rsrc
static void do_decode_rsrc(deark *c, lctx *d)
{
	if(!d->rf_known) return;
	if(d->expected_rflen<1) return;
	if(d->expected_rfpos+d->expected_rflen > c->infile->len) {
		return;
	}
	de_dbg(c, "resource fork at %"I64_FMT", len=%"I64_FMT, d->expected_rfpos, d->expected_rflen);
	de_dbg_indent(c, 1);
	de_run_module_by_id_on_slice2(c, "macrsrc", NULL, c->infile,
		d->expected_rfpos, d->expected_rflen);
	de_dbg_indent(c, -1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpb $0x0, 0x6(%rax)
jne 0xd9d2f
jmp 0xd9dc9
movq -0x10(%rbp), %rax
cmpq $0x1, 0x20(%rax)
jge 0xd9d3f
jmp 0xd9dc9
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
addq 0x20(%rcx), %rax
movq -0x8(%rbp), %rcx
movq 0x18(%rcx), %rcx
cmpq 0x18(%rcx), %rax
jle 0xd9d5f
jmp 0xd9dc9
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdx
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rcx
leaq 0xe1970(%rip), %rsi     # 0x1bb6ea
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x10(%rbp), %rax
movq 0x10(%rax), %r8
movq -0x10(%rbp), %rax
movq 0x20(%rax), %r9
leaq 0xc8c36(%rip), %rsi     # 0x1a29e8
xorl %eax, %eax
movl %eax, %edx
callq 0x15cab0
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/macpaint.c
// Function: get_pattern_set_info
static const char *get_pattern_set_info(u32 patcrc, int *is_blank)
{
	*is_blank = 0;
	switch(patcrc) {
	case 0x284a7a15: return "variant 1";
	case 0x33d2d8d6: return "standard";
	case 0x47514647: *is_blank = 1; return "blank";
	case 0xb5348fd2: *is_blank = 1; return "blank variant 1";
	}
	return "unrecognized";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0xc(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rax
movl $0x0, (%rax)
movl -0xc(%rbp), %eax
movl %eax, -0x1c(%rbp)
subl $0xb5348fd2, %eax       # imm = 0xB5348FD2
je 0xda029
jmp 0xd9fd4
movl -0x1c(%rbp), %eax
subl $0x284a7a15, %eax       # imm = 0x284A7A15
je 0xd9ff8
jmp 0xd9fe0
movl -0x1c(%rbp), %eax
subl $0x33d2d8d6, %eax       # imm = 0x33D2D8D6
je 0xda005
jmp 0xd9fec
movl -0x1c(%rbp), %eax
subl $0x47514647, %eax       # imm = 0x47514647
je 0xda012
jmp 0xda040
leaq 0xe1860(%rip), %rax     # 0x1bb85f
movq %rax, -0x8(%rbp)
jmp 0xda04b
leaq 0xe6a25(%rip), %rax     # 0x1c0a31
movq %rax, -0x8(%rbp)
jmp 0xda04b
movq -0x18(%rbp), %rax
movl $0x1, (%rax)
leaq 0xe1830(%rip), %rax     # 0x1bb853
movq %rax, -0x8(%rbp)
jmp 0xda04b
movq -0x18(%rbp), %rax
movl $0x1, (%rax)
leaq 0xe181f(%rip), %rax     # 0x1bb859
movq %rax, -0x8(%rbp)
jmp 0xda04b
leaq 0xc900c(%rip), %rax     # 0x1a3053
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/makichan.c
// Function: de_module_makichan
void de_module_makichan(deark *c, struct deark_module_info *mi)
{
	mi->id = "makichan";
	mi->desc = "MAKIchan graphics";
	mi->run_fn = de_run_makichan;
	mi->identify_fn = de_identify_makichan;
	mi->help_fn = de_help_makichan;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
leaq 0xe189c(%rip), %rcx     # 0x1bb913
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
leaq 0xe1897(%rip), %rcx     # 0x1bb91c
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
leaq 0x2c(%rip), %rcx        # 0xda0c0
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
leaq 0x11d(%rip), %rcx       # 0xda1c0
movq %rcx, 0x20(%rax)
movq -0x10(%rbp), %rax
leaq 0x15e(%rip), %rcx       # 0xda210
movq %rcx, 0x28(%rax)
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/makichan.c
// Function: de_run_makichan
static void de_run_makichan(deark *c, de_module_params *mparams)
{
	lctx *d = NULL;

	d = de_malloc(c, sizeof(lctx));
	d->opt_allowbad = (u8)de_get_ext_option_bool(c, "makichan:allowbad", 0);

	if(!dbuf_memcmp(c->infile, 0, "MAKI01", 6)) {
		d->is_mki = 1;
		if(de_getbyte(6)=='B') {
			d->is_mki_b = 1;
		}
	}

	if(d->is_mki) {
		do_mki(c, d);
	}
	else {
		do_mag(c, d);
	}

	dbuf_close(d->unc_pixels);
	dbuf_close(d->virtual_screen);
	de_free(c, d);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movl $0x490, %esi            # imm = 0x490
callq 0x15b780
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
leaq 0xe1839(%rip), %rsi     # 0x1bb92e
xorl %edx, %edx
callq 0x15cbc0
movb %al, %cl
movq -0x18(%rbp), %rax
movb %cl, (%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
leaq 0xe1829(%rip), %rdx     # 0x1bb940
movl $0x6, %ecx
callq 0x166ab0
cmpl $0x0, %eax
jne 0xda158
movq -0x18(%rbp), %rax
movl $0x1, 0x78(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0x6, %esi
callq 0x165060
movzbl %al, %eax
cmpl $0x42, %eax
jne 0xda156
movq -0x18(%rbp), %rax
movl $0x1, 0x7c(%rax)
jmp 0xda158
movq -0x18(%rbp), %rax
cmpl $0x0, 0x78(%rax)
je 0xda171
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xda240
jmp 0xda17e
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xda2e0
movq -0x18(%rbp), %rax
movq 0x88(%rax), %rdi
callq 0x1676a0
movq -0x18(%rbp), %rax
movq 0x80(%rax), %rdi
callq 0x1676a0
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x15b820
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/makichan.c
// Function: do_mki
static void do_mki(deark *c, lctx *d)
{
	d->header_pos = 32;
	if(!read_mki_header(c, d)) goto done;
	read_palette(c, d, d->header_pos+16);
	if(!de_good_image_dimensions(c, d->width, d->height)) goto done;
	mki_decompress_virtual_screen(c, d);
	mki_decompress_pixels(c, d);
	do_create_image(c, d);
done:
	;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq $0x20, 0x18(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xda380
cmpl $0x0, %eax
jne 0xda270
jmp 0xda2d0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdx
addq $0x10, %rdx
callq 0xda770
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdx
callq 0x16a850
cmpl $0x0, %eax
jne 0xda2a9
jmp 0xda2d0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xda890
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xdab10
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xdacd0
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/makichan.c
// Function: do_mag
static void do_mag(deark *c, lctx *d)
{
	if(!find_mag_header(c, d)) goto done;
	if(!read_mag_header(c, d)) goto done;
	read_palette(c, d, d->header_pos+32);
	if(!de_good_image_dimensions(c, d->width, d->height)) goto done;
	if(!do_mag_decompress(c, d)) goto done;
	do_create_image(c, d);
done:
	;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xdae00
cmpl $0x0, %eax
jne 0xda304
jmp 0xda372
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xdaed0
cmpl $0x0, %eax
jne 0xda318
jmp 0xda372
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdx
addq $0x20, %rdx
callq 0xda770
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdx
callq 0x16a850
cmpl $0x0, %eax
jne 0xda351
jmp 0xda372
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xdb330
cmpl $0x0, %eax
jne 0xda365
jmp 0xda372
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xdacd0
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/makichan.c
// Function: read_palette
static void read_palette(deark *c, lctx *d, i64 pos)
{
	i64 k;
	u8 cr, cg, cb;

	de_dbg(c, "palette at %d", (int)pos);
	de_dbg_indent(c, 1);

	for(k=0; k<d->num_colors; k++) {
		cg = de_getbyte(pos+3*k);
		cr = de_getbyte(pos+3*k+1);
		cb = de_getbyte(pos+3*k+2);
		d->pal[k] = DE_MAKE_RGB(cr,cg,cb);
		de_dbg_pal_entry(c, k, d->pal[k]);
	}

	de_dbg_indent(c, -1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movl %eax, %edx
leaq 0xe17bb(%rip), %rsi     # 0x1bbf50
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x48(%rcx), %rax
jge 0xda878
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
imulq $0x3, -0x20(%rbp), %rax
addq %rax, %rsi
callq 0x165060
movb %al, -0x22(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
imulq $0x3, -0x20(%rbp), %rax
addq %rax, %rsi
addq $0x1, %rsi
callq 0x165060
movb %al, -0x21(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
imulq $0x3, -0x20(%rbp), %rax
addq %rax, %rsi
addq $0x2, %rsi
callq 0x165060
movb %al, -0x23(%rbp)
movzbl -0x21(%rbp), %edx
shll $0x10, %edx
orl $0xff000000, %edx       # imm = 0xFF000000
movzbl -0x22(%rbp), %eax
shll $0x8, %eax
orl %eax, %edx
movzbl -0x23(%rbp), %eax
orl %eax, %edx
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
movl %edx, 0x90(%rax,%rcx,4)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
movl 0x90(%rax,%rcx,4), %edx
callq 0x15bf00
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0xda7b2
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/makichan.c
// Function: mki_decompress_pixels
static void mki_decompress_pixels(deark *c, lctx *d)
{
	i64 i, j;
	i64 p_pos;
	i64 delta_y;
	i64 vs_pos;
	int vs_bitnum;
	u8 vs_byte = 0x00;

	d->rowspan = d->width_adj/2;
	vs_pos = 0;
	vs_bitnum = -1;
	p_pos = d->pixels_offset;
	delta_y = d->is_mki_b ? 4 : 2;
	d->unc_pixels = dbuf_create_membuf(c, d->rowspan*d->height_adj, 1);

	for(j=0; j<d->height; j++) {
		for(i=0; i<d->rowspan; i++) {
			u8 vs_bit;
			u8 v;

			// Read the next virtual-screen bit
			if(vs_bitnum<0) {
				vs_byte = dbuf_getbyte(d->virtual_screen, vs_pos++);
				vs_bitnum = 7;
			}
			vs_bit = vs_byte & (1 << vs_bitnum--);

			if(vs_bit) {
				v = de_getbyte(p_pos++);
			}
			else {
				v = 0x00;
			}

			if(j>=delta_y) {
				v ^= dbuf_getbyte(d->unc_pixels, (j-delta_y)*d->rowspan + i);
			}
			dbuf_writebyte(d->unc_pixels, v);
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb $0x0, -0x3d(%rbp)
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rax
movl $0x2, %ecx
cqto
idivq %rcx
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x58(%rax)
movq $0x0, -0x38(%rbp)
movl $0xffffffff, -0x3c(%rbp) # imm = 0xFFFFFFFF
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movl 0x7c(%rax), %edx
movl $0x2, %eax
movl $0x4, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
cltq
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rsi
movq -0x10(%rbp), %rax
imulq 0x68(%rax), %rsi
movl $0x1, %edx
callq 0x168020
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x88(%rax)
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jge 0xdacc4
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x58(%rcx), %rax
jge 0xdacb1
cmpl $0x0, -0x3c(%rbp)
jge 0xdac09
movq -0x10(%rbp), %rax
movq 0x80(%rax), %rdi
movq -0x38(%rbp), %rsi
movq %rsi, %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
callq 0x165060
movb %al, -0x3d(%rbp)
movl $0x7, -0x3c(%rbp)
movzbl -0x3d(%rbp), %eax
movl -0x3c(%rbp), %ecx
movl %ecx, %edx
addl $-0x1, %edx
movl %edx, -0x3c(%rbp)
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
andl %ecx, %eax
movb %al, -0x3e(%rbp)
cmpb $0x0, -0x3e(%rbp)
je 0xdac4d
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x28(%rbp), %rsi
movq %rsi, %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
callq 0x165060
movb %al, -0x3f(%rbp)
jmp 0xdac51
movb $0x0, -0x3f(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x30(%rbp), %rax
jl 0xdac8c
movq -0x10(%rbp), %rax
movq 0x88(%rax), %rdi
movq -0x20(%rbp), %rsi
subq -0x30(%rbp), %rsi
movq -0x10(%rbp), %rax
imulq 0x58(%rax), %rsi
addq -0x18(%rbp), %rsi
callq 0x165060
movzbl %al, %ecx
movzbl -0x3f(%rbp), %eax
xorl %ecx, %eax
movb %al, -0x3f(%rbp)
movq -0x10(%rbp), %rax
movq 0x88(%rax), %rdi
movzbl -0x3f(%rbp), %esi
callq 0x168380
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0xdabc8
jmp 0xdacb3
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0xdabae
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/makichan.c
// Function: do_create_image
static void do_create_image(deark *c, lctx *d)
{
	de_bitmap *img = NULL;
	de_finfo *fi = NULL;

	img = de_bitmap_create(c, d->width, d->height, 3);

	fi = de_finfo_create(c);

	if(d->aspect_ratio_flag) {
		fi->density.code = DE_DENSITY_UNK_UNITS;
		fi->density.xdens = 2.0;
		fi->density.ydens = 1.0;
	}

	de_convert_image_paletted(d->unc_pixels, 0,
		d->bits_per_pixel, d->rowspan, d->pal, img, 0);

	de_bitmap_write_to_file_finfo(img, fi, 0);
	de_bitmap_destroy(img);
	de_finfo_destroy(c, fi);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdx
movl $0x3, %ecx
callq 0x16b750
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x15d230
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
cmpb $0x0, 0x70(%rax)
je 0xdad5c
movq -0x20(%rbp), %rax
movl $0x1, 0x78(%rax)
movq -0x20(%rbp), %rax
movsd 0xd56e8(%rip), %xmm0    # 0x1b0428
movsd %xmm0, 0x80(%rax)
movq -0x20(%rbp), %rax
movsd 0xc6464(%rip), %xmm0    # 0x1a11b8
movsd %xmm0, 0x88(%rax)
movq -0x10(%rbp), %rax
movq 0x88(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rdx
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rcx
movq -0x10(%rbp), %r8
addq $0x90, %r8
movq -0x18(%rbp), %r9
xorl %eax, %eax
movl %eax, %esi
xorl %eax, %eax
movl $0x0, (%rsp)
callq 0x16c520
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
xorl %edx, %edx
callq 0x16afa0
movq -0x18(%rbp), %rdi
callq 0x16af60
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x15d260
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/makichan.c
// Function: find_mag_header
static int find_mag_header(deark *c, lctx *d)
{
	i64 pos_1a = 0;
	int ret;

	// Find the first 0x1a byte.
	ret = dbuf_search_byte(c->infile, '\x1a', 0, c->infile->len, &pos_1a);
	if(ret) {
		// Find the first 0x00 byte after the first 0x1a byte.
		// TODO: Is this the correct algorithm, or should we just assume the
		// header starts immediately after the first 0x1a byte?
		ret = dbuf_search_byte(c->infile, '\0', pos_1a+1, c->infile->len-pos_1a-1, &d->header_pos);
		if(ret) {
			de_dbg(c, "header found at %d", (int)d->header_pos);
			return 1;
		}
	}

	de_err(c, "Failed to find header. This is probably not a MAKIchan file.");
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x18(%rax), %rcx
movl $0x1a, %esi
xorl %eax, %eax
movl %eax, %edx
leaq -0x20(%rbp), %r8
callq 0x1667a0
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0xdaeaa
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rdx
addq $0x1, %rdx
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x18(%rax), %rcx
subq -0x20(%rbp), %rcx
subq $0x1, %rcx
movq -0x18(%rbp), %r8
addq $0x18, %r8
xorl %esi, %esi
callq 0x1667a0
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0xdaea8
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movl %eax, %edx
leaq 0xe8ad7(%rip), %rsi     # 0x1c396f
movb $0x0, %al
callq 0x15b0d0
movl $0x1, -0x4(%rbp)
jmp 0xdaec3
jmp 0xdaeaa
movq -0x10(%rbp), %rdi
leaq 0xe0c13(%rip), %rsi     # 0x1bbac8
movb $0x0, %al
callq 0x15bfb0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/mbk.c
// Function: de_module_mbk
void de_module_mbk(deark *c, struct deark_module_info *mi)
{
	mi->id = "stos";
	mi->desc = "STOS Memory Bank (.MBK)";
	mi->run_fn = de_run_mbk_mbs;
	mi->identify_fn = de_identify_mbk;
	mi->help_fn = de_help_mbk;
	mi->id_alias[0] = "mbk";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
leaq 0xe0670(%rip), %rcx     # 0x1bbc97
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
leaq 0xe0667(%rip), %rcx     # 0x1bbc9c
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
leaq 0x3c(%rip), %rcx        # 0xdb680
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
leaq 0x5d(%rip), %rcx        # 0xdb6b0
movq %rcx, 0x20(%rax)
movq -0x10(%rbp), %rax
leaq 0xfe(%rip), %rcx        # 0xdb760
movq %rcx, 0x28(%rax)
movq -0x10(%rbp), %rax
leaq 0xe0643(%rip), %rcx     # 0x1bbcb4
movq %rcx, 0x38(%rax)
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/mbk.c
// Function: de_identify_mbk
static int de_identify_mbk(deark *c)
{
	u8 buf[10];
	UI id;

	de_read(buf, 0, sizeof(buf));
	if(!de_memcmp(buf, g_lion_sig, 10))
		return 99;
	id = (UI)de_getu32be_direct(buf);
	if(id==BANKID_SPRITE) {
		return 100;
	}
	else if(id==BANKID_PKSCREEN) {
		int is_pkscr;
		UI res;

		is_pkscr = is_stos_packedscreen(c, &res);
		if(is_pkscr) {
			return 99;
		}
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x1a(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
movl $0xa, %ecx
callq 0x164d10
leaq -0x1a(%rbp), %rdi
movq 0x14a14f(%rip), %rsi    # 0x225830
movl $0xa, %edx
callq 0x19170
cmpl $0x0, %eax
jne 0xdb6f9
movl $0x63, -0x4(%rbp)
jmp 0xdb74a
leaq -0x1a(%rbp), %rdi
callq 0x165430
movl %eax, -0x20(%rbp)
cmpl $0x19861987, -0x20(%rbp) # imm = 0x19861987
jne 0xdb717
movl $0x64, -0x4(%rbp)
jmp 0xdb74a
cmpl $0x6071963, -0x20(%rbp) # imm = 0x6071963
jne 0xdb741
movq -0x10(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0xddcd0
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0xdb73f
movl $0x63, -0x4(%rbp)
jmp 0xdb74a
jmp 0xdb741
jmp 0xdb743
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/mbk.c
// Function: de_module_stos_pp1
void de_module_stos_pp1(deark *c, struct deark_module_info *mi)
{
	mi->id = "stos_pp1";
	mi->desc = "Picture Packer low res";
	mi->run_fn = de_run_stos_pp1;
	mi->identify_fn = de_identify_stos_pp1;
	mi->help_fn = de_help_mbk;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
leaq 0xe0501(%rip), %rcx     # 0x1bbcb8
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
leaq 0xe04fc(%rip), %rcx     # 0x1bbcc1
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
leaq 0x2c(%rip), %rcx        # 0xdb800
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
leaq 0x4d(%rip), %rcx        # 0xdb830
movq %rcx, 0x20(%rax)
movq -0x10(%rbp), %rax
leaq -0x92(%rip), %rcx       # 0xdb760
movq %rcx, 0x28(%rax)
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/mbk.c
// Function: de_identify_stos_pp1
static int de_identify_stos_pp1(deark *c)
{
	int has_ext;
	int is_pkscr;
	UI res;

	has_ext = de_input_file_has_ext(c, "pp1");
	if(!has_ext) return 0;
	is_pkscr = is_stos_packedscreen(c, &res);
	if(is_pkscr && res==1) return 100;
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
leaq 0xe0476(%rip), %rsi     # 0x1bbcbd
callq 0x15d180
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0xdb85e
movl $0x0, -0x4(%rbp)
jmp 0xdb88a
movq -0x10(%rbp), %rdi
leaq -0x1c(%rbp), %rsi
callq 0xddcd0
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
je 0xdb883
cmpl $0x1, -0x1c(%rbp)
jne 0xdb883
movl $0x64, -0x4(%rbp)
jmp 0xdb88a
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/mbk.c
// Function: de_module_stos_pp2
void de_module_stos_pp2(deark *c, struct deark_module_info *mi)
{
	mi->id = "stos_pp2";
	mi->desc = "Picture Packer med res";
	mi->run_fn = de_run_stos_pp2;
	mi->identify_fn = de_identify_stos_pp2;
	mi->help_fn = de_help_mbk;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
leaq 0xe0421(%rip), %rcx     # 0x1bbcd8
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
leaq 0xe041c(%rip), %rcx     # 0x1bbce1
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
leaq 0x2c(%rip), %rcx        # 0xdb900
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
leaq 0x4d(%rip), %rcx        # 0xdb930
movq %rcx, 0x20(%rax)
movq -0x10(%rbp), %rax
leaq -0x192(%rip), %rcx      # 0xdb760
movq %rcx, 0x28(%rax)
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/mbk.c
// Function: de_identify_stos_pp2
static int de_identify_stos_pp2(deark *c)
{
	int has_ext;
	int is_pkscr;
	UI res;

	has_ext = de_input_file_has_ext(c, "pp2");
	if(!has_ext) return 0;
	is_pkscr = is_stos_packedscreen(c, &res);
	if(is_pkscr && res==1) return 100;
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
leaq 0xe0396(%rip), %rsi     # 0x1bbcdd
callq 0x15d180
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0xdb95e
movl $0x0, -0x4(%rbp)
jmp 0xdb98a
movq -0x10(%rbp), %rdi
leaq -0x1c(%rbp), %rsi
callq 0xddcd0
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
je 0xdb983
cmpl $0x1, -0x1c(%rbp)
jne 0xdb983
movl $0x64, -0x4(%rbp)
jmp 0xdb98a
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/mbk.c
// Function: de_module_stos_pp3
void de_module_stos_pp3(deark *c, struct deark_module_info *mi)
{
	mi->id = "stos_pp3";
	mi->desc = "Picture Packer high res";
	mi->run_fn = de_run_stos_pp3;
	mi->identify_fn = de_identify_stos_pp3;
	mi->help_fn = de_help_mbk;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
leaq 0xe0341(%rip), %rcx     # 0x1bbcf8
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
leaq 0xe033c(%rip), %rcx     # 0x1bbd01
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
leaq 0x2c(%rip), %rcx        # 0xdba00
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
leaq 0x4d(%rip), %rcx        # 0xdba30
movq %rcx, 0x20(%rax)
movq -0x10(%rbp), %rax
leaq -0x292(%rip), %rcx      # 0xdb760
movq %rcx, 0x28(%rax)
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/mbk.c
// Function: de_identify_stos_pp3
static int de_identify_stos_pp3(deark *c)
{
	int has_ext;
	int is_pkscr;
	UI res;

	has_ext = de_input_file_has_ext(c, "pp3");
	if(!has_ext) return 0;
	is_pkscr = is_stos_packedscreen(c, &res);
	if(is_pkscr && res==1) return 100;
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
leaq 0xe02b6(%rip), %rsi     # 0x1bbcfd
callq 0x15d180
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0xdba5e
movl $0x0, -0x4(%rbp)
jmp 0xdba8a
movq -0x10(%rbp), %rdi
leaq -0x1c(%rbp), %rsi
callq 0xddcd0
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
je 0xdba83
cmpl $0x1, -0x1c(%rbp)
jne 0xdba83
movl $0x64, -0x4(%rbp)
jmp 0xdba8a
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/mbk.c
// Function: de_module_stos_daj
void de_module_stos_daj(deark *c, struct deark_module_info *mi)
{
	mi->id = "stos_daj";
	mi->desc = "Picture Packer DAJ";
	mi->run_fn = de_run_stos_daj;
	mi->identify_fn = de_identify_stos_daj;
	mi->help_fn = de_help_mbk;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
leaq 0xe0262(%rip), %rcx     # 0x1bbd19
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
leaq 0xe025d(%rip), %rcx     # 0x1bbd22
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
leaq 0x2c(%rip), %rcx        # 0xdbb00
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
leaq 0x4d(%rip), %rcx        # 0xdbb30
movq %rcx, 0x20(%rax)
movq -0x10(%rbp), %rax
leaq -0x392(%rip), %rcx      # 0xdb760
movq %rcx, 0x28(%rax)
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/mbk.c
// Function: de_identify_stos_daj
static int de_identify_stos_daj(deark *c)
{
	int has_ext;
	int is_pkscr;
	UI res;

	has_ext = de_input_file_has_ext(c, "daj");
	if(!has_ext) return 0;
	is_pkscr = is_stos_packedscreen(c, &res);
	if(is_pkscr && (res==0 || res==1)) return 100;
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
leaq 0xe01d7(%rip), %rsi     # 0x1bbd1e
callq 0x15d180
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0xdbb5e
movl $0x0, -0x4(%rbp)
jmp 0xdbb90
movq -0x10(%rbp), %rdi
leaq -0x1c(%rbp), %rsi
callq 0xddcd0
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
je 0xdbb89
cmpl $0x0, -0x1c(%rbp)
je 0xdbb80
cmpl $0x1, -0x1c(%rbp)
jne 0xdbb89
movl $0x64, -0x4(%rbp)
jmp 0xdbb90
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)