LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/tiff.c
// Function: handler_utf16
static void handler_utf16(deark *c, lctx *d, const struct taginfo *tg, const struct tagnuminfo *tni)
{
	de_ucstring *s = NULL;

	if(tg->datatype!=DATATYPE_BYTE && tg->datatype!=DATATYPE_UNDEF) goto done;
	if(tg->total_size % 2) goto done; // Something's wrong if the byte count is odd.

	s = ucstring_create(c);
	dbuf_read_to_ucstring_n(c->infile, tg->val_offset, tg->total_size,
		DE_TIFF_MAX_CHARS_TO_PRINT*2, s, 0, DE_ENCODING_UTF16LE);
	ucstring_truncate_at_NUL(s);
	de_dbg(c, "UTF-16 string: \"%s\"", ucstring_getpsz(s));

done:
	ucstring_destroy(s);
	return;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r15
movq %rdi, %r14
movl 0xc(%rdx), %eax
cmpl $0x7, %eax
je 0xc6bb3
cmpl $0x1, %eax
jne 0xc6c0e
testb $0x1, 0x30(%r15)
jne 0xc6c0e
movq %r14, %rdi
callq 0xeac74
movq %rax, %rbx
movq 0x18(%r14), %rdi
movq 0x20(%r15), %rsi
movq 0x30(%r15), %rdx
movl $0x3, (%rsp)
movl $0x3e8, %ecx            # imm = 0x3E8
movq %rax, %r8
xorl %r9d, %r9d
callq 0xe4ced
movq %rbx, %rdi
callq 0xeacc0
movq %rbx, %rdi
callq 0xeb7e4
leaq 0x6b66f(%rip), %rsi     # 0x13226e
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
jmp 0xc6c10
xorl %ebx, %ebx
movq %rbx, %rdi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0xeaf3c
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/tiff.c
// Function: handler_jxr_pixelformat
static void handler_jxr_pixelformat(deark *c, lctx *d, const struct taginfo *tg, const struct tagnuminfo *tni)
{
	u64 n1, n2;

	if(tg->total_size != 16) return;
	n1 = dbuf_getu64be(c->infile, tg->val_offset);
	n2 = dbuf_getu64be(c->infile, tg->val_offset+8);
	de_dbg(c, "id: 0x%016"U64_FMTx"%016"U64_FMTx, n1, n2);
}

// Assembly:
cmpq $0x10, 0x30(%rdx)
jne 0xc71f1
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
movq 0x20(%rdx), %rsi
callq 0xe41f2
movq %rax, %r15
movq 0x18(%rbx), %rdi
movq 0x20(%r14), %rsi
addq $0x8, %rsi
callq 0xe41f2
leaq 0x6b434(%rip), %rsi     # 0x132610
movq %rbx, %rdi
movq %r15, %rdx
movq %rax, %rcx
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0xde896
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/tiff.c
// Function: handler_dngprivatedata
static void handler_dngprivatedata(deark *c, lctx *d, const struct taginfo *tg, const struct tagnuminfo *tni)
{
	struct de_stringreaderdata *srd;
	i64 nbytes_to_scan;

	nbytes_to_scan = tg->total_size;
	if(nbytes_to_scan>128) nbytes_to_scan=128;

	srd = dbuf_read_string(c->infile, tg->val_offset, nbytes_to_scan, nbytes_to_scan,
		DE_CONVFLAG_STOP_AT_NUL, DE_ENCODING_ASCII);
	if(srd->found_nul) {
		de_dbg(c, "identifier: \"%s\"", ucstring_getpsz(srd->str));
	}
	de_destroy_stringreaderdata(c, srd);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x20(%rdx), %rsi
movq 0x30(%rdx), %rax
movl $0x80, %ecx
cmpq %rcx, %rax
cmovlq %rax, %rcx
movq 0x18(%rdi), %rdi
pushq $0x1
popq %r8
movq %rcx, %rdx
movl %r8d, %r9d
callq 0xe495c
movq %rax, %r14
cmpl $0x0, 0x34(%rax)
je 0xc724e
movq 0x18(%r14), %rdi
callq 0xeb7e4
leaq 0x60186(%rip), %rsi     # 0x1273c7
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xe4b94
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/tiff.c
// Function: handler_bplist
static void handler_bplist(deark *c, lctx *d, const struct taginfo *tg, const struct tagnuminfo *tni)
{
	if(tg->total_size>=40 &&
		!dbuf_memcmp(c->infile, tg->val_offset, "bplist", 6))
	{
		de_dbg(c, "binary .plist at %"I64_FMT", len=%"I64_FMT, tg->val_offset, tg->total_size);
		de_dbg_indent(c, 1);
		fmtutil_handle_plist(c, c->infile, tg->val_offset, tg->total_size, NULL, 0x0);
		de_dbg_indent(c, -1);
	}
	else {
		handler_hexdump(c, d, tg, tni);
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rdi, %rbx
cmpq $0x28, 0x30(%rdx)
jl 0xc72f3
movq 0x18(%rbx), %rdi
movq 0x20(%r14), %rsi
leaq 0x65a93(%rip), %rdx     # 0x12cd7a
pushq $0x6
popq %rcx
callq 0xe4d48
testl %eax, %eax
je 0xc7305
movq %rbx, %rdi
movq %r14, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xc6502
movq 0x20(%r14), %rdx
movq 0x30(%r14), %rcx
leaq 0x6b36d(%rip), %rsi     # 0x132681
movq %rbx, %rdi
xorl %eax, %eax
callq 0xde896
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
movq 0x18(%rbx), %rsi
movq 0x20(%r14), %rdx
movq 0x30(%r14), %rcx
movq %rbx, %rdi
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0xec602
pushq $-0x1
popq %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xdeba7
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/tiff.c
// Function: lookup_str
static const char *lookup_str(const struct int_and_str *items, size_t num_items, i64 n)
{
	i64 i;

	for(i=0; i<(i64)num_items; i++) {
		if(items[i].n==n && items[i].s!=NULL) {
			return items[i].s;
		}
	}
	return "?";
}

// Assembly:
xorl %ecx, %ecx
testq %rsi, %rsi
cmovgq %rsi, %rcx
addq $0x8, %rdi
leaq 0x57980(%rip), %rsi     # 0x11eee1
subq $0x1, %rcx
jb 0xc757b
cmpq %rdx, -0x8(%rdi)
jne 0xc7575
movq (%rdi), %rax
testq %rax, %rax
jne 0xc757e
addq $0x10, %rdi
jmp 0xc7561
movq %rsi, %rax
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/tiff.c
// Function: decompress_strile_fax34
static void decompress_strile_fax34(deark *c, lctx *d, struct page_ctx *pg,
	struct decode_page_ctx *dctx)
{
	struct de_fax34_params fax34params;

	de_zeromem(&fax34params, sizeof(struct de_fax34_params));
	fax34params.image_width = dctx->strileset_width;
	fax34params.image_height = dctx->strileset_height;
	fax34params.tiff_cmpr_meth = (UI)pg->compression;
	fax34params.t4options = pg->t4options;
	fax34params.t6options = pg->t6options;
	fax34params.is_lsb = (pg->fill_order==2)?1:0;

	fmtutil_fax34_codectype1(c, &dctx->dcmpri, &dctx->dcmpro, &dctx->dres,
		 (void*)&fax34params);
}

// Assembly:
subq $0x28, %rsp
xorps %xmm0, %xmm0
movq %rsp, %r8
movaps %xmm0, 0x10(%r8)
movdqu 0x50(%rcx), %xmm0
pshufd $0x4e, %xmm0, %xmm0     # xmm0 = xmm0[2,3,0,1]
movdqa %xmm0, (%r8)
movl 0x1c(%rdx), %eax
movl %eax, 0x18(%r8)
movq 0x48(%rdx), %rax
movq %rax, 0x20(%r8)
cmpl $0x2, 0x34(%rdx)
sete 0x1c(%r8)
leaq 0xe8(%rcx), %rsi
leaq 0x108(%rcx), %rdx
addq $0x120, %rcx            # imm = 0x120
callq 0xf233c
addq $0x28, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/tiff.c
// Function: decompress_strile_lzw
static void decompress_strile_lzw(deark *c, lctx *d, struct page_ctx *pg,
	struct decode_page_ctx *dctx)
{
	struct de_lzw_params delzwp;

	if(dctx->dfctx) {
		de_dfilter_destroy(dctx->dfctx);
		dctx->dfctx = NULL;
		// TODO: Make the LZW decoder support DE_DFILTER_COMMAND_REINITIALIZE
	}

	de_zeromem(&delzwp, sizeof(struct de_lzw_params));
	delzwp.fmt =  (pg->is_old_lzw)?DE_LZWFMT_TIFFOLD:DE_LZWFMT_TIFFNEW;
	delzwp.max_code_size = 12;

	dctx->dfctx = de_dfilter_create(c, dfilter_lzw_codec, (void*)&delzwp, &dctx->dcmpro, &dctx->dres);

	de_dfilter_addslice(dctx->dfctx, dctx->dcmpri.f, dctx->dcmpri.pos, dctx->dcmpri.len);
	de_dfilter_finish(dctx->dfctx);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rcx, %rbx
movq %rdx, %r15
movq %rdi, %r14
movq 0xe0(%rcx), %rdi
testq %rdi, %rdi
je 0xc76d8
callq 0xee9dd
andq $0x0, 0xe0(%rbx)
xorps %xmm0, %xmm0
leaq 0xc(%rsp), %rdx
movups %xmm0, 0x4(%rdx)
xorl %eax, %eax
cmpb $0x1, 0x98(%r15)
adcl $0x5, %eax
movl %eax, (%rdx)
movl $0xc, 0xc(%rdx)
leaq 0x108(%rbx), %rcx
leaq 0x120(%rbx), %r8
leaq 0x2ed58(%rip), %rsi     # 0xf6467
movq %r14, %rdi
callq 0xee930
movq %rax, 0xe0(%rbx)
movq 0xe8(%rbx), %rsi
movq 0xf0(%rbx), %rdx
movq 0xf8(%rbx), %rcx
movq %rax, %rdi
callq 0xeea0d
movq 0xe0(%rbx), %rdi
callq 0xee9d1
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/tiff.c
// Function: decompress_strile_packbits
static void decompress_strile_packbits(deark *c, lctx *d, struct page_ctx *pg,
	struct decode_page_ctx *dctx)
{
	if(dctx->dfctx) {
		de_dfilter_command(dctx->dfctx, DE_DFILTER_COMMAND_REINITIALIZE, 0);
	}
	else {
		dctx->dfctx = de_dfilter_create(c, dfilter_packbits_codec, NULL,
			&dctx->dcmpro, &dctx->dres);
	}

	de_dfilter_addslice(dctx->dfctx, dctx->dcmpri.f, dctx->dcmpri.pos, dctx->dcmpri.len);
	de_dfilter_finish(dctx->dfctx);
}

// Assembly:
pushq %rbx
movq %rcx, %rbx
movq 0xe0(%rcx), %rax
testq %rax, %rax
je 0xc77ab
pushq $0x2
popq %rsi
movq %rax, %rdi
xorl %edx, %edx
callq 0xee9b4
movq 0xe0(%rbx), %rdi
jmp 0xc77d1
leaq 0x108(%rbx), %rcx
leaq 0x120(%rbx), %r8
leaq 0x2733b(%rip), %rsi     # 0xeeafb
xorl %edx, %edx
callq 0xee930
movq %rax, %rdi
movq %rax, 0xe0(%rbx)
movq 0xe8(%rbx), %rsi
movq 0xf0(%rbx), %rdx
movq 0xf8(%rbx), %rcx
callq 0xeea0d
movq 0xe0(%rbx), %rdi
popq %rbx
jmp 0xee9d1
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/tiff.c
// Function: alloc_striledata
static int alloc_striledata(deark *c, struct page_ctx *pg, i64 nstriles)
{
	if(nstriles<1) nstriles = 1;
	if(pg->strile_count >= nstriles) return 1;
	if(nstriles>DE_TIFF_MAX_STRILES) return 0;
	pg->strile_data = de_reallocarray(c, pg->strile_data, pg->strile_count, sizeof(struct strile_data_struct), nstriles);
	pg->strile_count = nstriles;
	return 1;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %rcx
cmpq $0x2, %rdx
pushq $0x1
popq %r14
cmovgeq %rdx, %r14
movq 0xb0(%rsi), %rdx
pushq $0x1
popq %rbp
cmpq %r14, %rdx
jge 0xc7848
xorl %eax, %eax
cmpq $0x10000, %rcx          # imm = 0x10000
jg 0xc784a
movq %rsi, %rbx
movq 0xb8(%rsi), %rsi
pushq $0x10
popq %rcx
movq %r14, %r8
callq 0xdf6b6
movq %rax, 0xb8(%rbx)
movq %r14, 0xb0(%rbx)
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/tim.c
// Function: de_module_tim
void de_module_tim(deark *c, struct deark_module_info *mi)
{
	mi->id = "tim";
	mi->desc = "PlayStation graphics";
	mi->run_fn = de_run_tim;
	mi->identify_fn = de_identify_tim;
}

// Assembly:
leaq 0x6af9e(%rip), %rax     # 0x132a1d
movq %rax, (%rsi)
leaq 0x6af98(%rip), %rax     # 0x132a21
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0xc7aa4
movq %rax, 0x18(%rsi)
leaq 0x423(%rip), %rax       # 0xc7ec2
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/tim.c
// Function: de_identify_tim
static int de_identify_tim(deark *c)
{
	i64 x;

	if(dbuf_memcmp(c->infile, 0, "\x10\x00\x00\x00", 4))
		return 0;

	x = de_getu32le(4);
	if(x<=3 || x==8 || x==9) {
		if(de_input_file_has_ext(c, "tim")) return 100;
		return 15;
	}
	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0x18(%rdi), %rdi
leaq 0x6ab44(%rip), %rdx     # 0x132a18
xorl %ebx, %ebx
pushq $0x4
popq %rcx
xorl %esi, %esi
callq 0xe4d48
testl %eax, %eax
jne 0xc7f20
movq 0x18(%r14), %rdi
pushq $0x4
popq %rsi
callq 0xe409f
cmpq $0x4, %rax
setge %cl
andq $-0x2, %rax
cmpq $0x8, %rax
setne %al
testb %al, %cl
jne 0xc7f20
leaq 0x6ab10(%rip), %rsi     # 0x132a1d
movq %r14, %rdi
callq 0xdfcd5
testl %eax, %eax
pushq $0xf
popq %rax
pushq $0x64
popq %rbx
cmovel %eax, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/tivariable.c
// Function: de_module_tivariable
void de_module_tivariable(deark *c, struct deark_module_info *mi)
{
	mi->id = "tivariable";
	mi->desc = "TI calculator variable or picture file";
	mi->run_fn = de_run_tivariable;
	mi->identify_fn = de_identify_tivariable;
}

// Assembly:
leaq 0x6ac86(%rip), %rax     # 0x132bb9
movq %rax, (%rsi)
leaq 0x6ac87(%rip), %rax     # 0x132bc4
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0xc7f58
movq %rax, 0x18(%rsi)
leaq 0x7e(%rip), %rax        # 0xc7fd1
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/tivariable.c
// Function: de_run_tivariable
static void de_run_tivariable(deark *c, de_module_params *mparams)
{
	lctx *d = NULL;

	d = de_malloc(c, sizeof(lctx));
	d->fmt = identify_internal(c);

	if(!ti_ver_info_arr[d->fmt].decoder_fn) {
		de_err(c, "Unknown or unsupported TI variable file version");
		goto done;
	}

	de_declare_fmt(c, ti_ver_info_arr[d->fmt].description);
	ti_ver_info_arr[d->fmt].decoder_fn(c, d);

done:
	de_free(c, d);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
pushq $0x18
popq %rsi
callq 0xdecaf
movq %rax, %r14
movq %rbx, %rdi
callq 0xc7fea
movl %eax, 0x10(%r14)
cltq
imulq $0x18, %rax, %rax
leaq 0xc7dfc(%rip), %r15     # 0x18fd80
cmpq $0x0, 0x10(%rax,%r15)
je 0xc7fb0
addq %r15, %rax
movq 0x8(%rax), %rsi
movq %rbx, %rdi
callq 0xe07f7
movslq 0x10(%r14), %rax
imulq $0x18, %rax, %rax
movq %rbx, %rdi
movq %r14, %rsi
callq *0x10(%rax,%r15)
jmp 0xc7fc1
leaq 0x6ac34(%rip), %rsi     # 0x132beb
movq %rbx, %rdi
xorl %eax, %eax
callq 0xdf2a5
movq %rbx, %rdi
movq %r14, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0xded32
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/tivariable.c
// Function: identify_internal
static int identify_internal(deark *c)
{
	u8 buf[8];
	int i;

	de_read(buf, 0, 8);

	if(de_memcmp(buf, "**TI", 4)) return DE_FMT_NOT_TI;

	for(i=2; i<DE_FMT_COUNT; i++) {
		if(!de_memcmp(buf, ti_ver_info_arr[i].sig, 8)) {
			return i;
		}
	}
	return DE_FMT_UNKNOWN_TI;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x18(%rdi), %rdi
xorl %ebx, %ebx
movq %rsp, %r14
pushq $0x8
popq %rcx
movq %r14, %rsi
xorl %edx, %edx
callq 0xe3cb7
cmpl $0x49542a2a, (%r14)     # imm = 0x49542A2A
jne 0xc8041
pushq $0x2
popq %rax
movq $-0xd8, %rcx
pushq $0x1
popq %rbx
leaq 0xc7d5f(%rip), %rdx     # 0x18fd80
testq %rcx, %rcx
je 0xc8041
movq 0x108(%rcx,%rdx), %rsi
movq (%rsp), %rdi
cmpq (%rsi), %rdi
je 0xc803f
incl %eax
addq $0x18, %rcx
jmp 0xc8021
movl %eax, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/tivariable.c
// Function: do_ti92
static void do_ti92(deark *c, lctx *d)
{
	i64 pos;
	i64 numvars;
	i64 x;
	i64 i;

	// 0-7: signature
	// 8-9: 0x01 0x00
	// 10-17: default folder name
	// 18-57: comment

	numvars = de_getu16le(58);
	de_dbg(c, "number of variables/folders: %d", (int)numvars);
	if(!de_good_image_count(c, numvars)) goto done;

	pos = 60;
	for(i=0; i<numvars; i++) {
		do_ti92_var_table_entry(c, d, pos);
		pos+=16;
	}

	// Data section
	x = de_getu32le(pos);
	de_dbg(c, "reported file size: %d", (int)x);

done:
	;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
pushq $0x3a
popq %rsi
callq 0xe3fa3
movq %rax, %r15
leaq 0x6a820(%rip), %rsi     # 0x132eb9
movq %rbx, %rdi
movl %r15d, %edx
xorl %eax, %eax
callq 0xde896
movq %rbx, %rdi
movq %r15, %rsi
callq 0xe6ccb
testl %eax, %eax
je 0xc87ce
xorl %eax, %eax
testq %r15, %r15
cmovleq %rax, %r15
pushq $0x3c
popq %r12
subq $0x1, %r15
jb 0xc87a1
movq %rbx, %rdi
leaq 0x6a7ff(%rip), %rsi     # 0x132ed9
movl %r12d, %edx
xorl %eax, %eax
callq 0xde896
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xe409f
movq %rax, %r13
movq 0x18(%rbx), %rdi
leaq 0xc(%r12), %rsi
callq 0xe3eb4
movzbl %al, %ebp
movq %rbx, %rdi
leaq 0x6a7e1(%rip), %rsi     # 0x132eef
movl %ebp, %edx
xorl %eax, %eax
callq 0xde896
cmpb $0x10, %bpl
jne 0xc8798
movq %rbx, %rdi
leaq 0x49978(%rip), %rsi     # 0x11209f
movl %r13d, %edx
xorl %eax, %eax
callq 0xde896
movq %rbx, %rdi
leaq 0x6a63c(%rip), %rsi     # 0x132d77
movl %r13d, %edx
xorl %eax, %eax
callq 0xde896
leaq 0x4(%r13), %rsi
movq 0x18(%rbx), %rdi
callq 0xe3f46
movq %rbx, %rdi
leaq 0x6a629(%rip), %rsi     # 0x132d85
movl %eax, %edx
xorl %eax, %eax
callq 0xde896
movq 0x18(%rbx), %rdi
leaq 0x6(%r13), %rsi
callq 0xe3f46
movq %rax, 0x8(%r14)
movq 0x18(%rbx), %rdi
leaq 0x8(%r13), %rsi
callq 0xe3f46
movq %rax, (%r14)
addq $0xa, %r13
movq %rbx, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0xc87dd
addq $0x10, %r12
jmp 0xc86c6
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xe409f
leaq 0x4ab24(%rip), %rsi     # 0x1132d8
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xde896
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/tivariable.c
// Function: do_bitmap
static int do_bitmap(deark *c, lctx *d, i64 pos)
{
	i64 rowspan;
	int retval = 0;

	de_dbg_dimensions(c, d->w, d->h);
	rowspan = (d->w+7)/8;

	if(pos+rowspan*d->h > c->infile->len) {
		de_err(c, "Unexpected end of file");
		goto done;
	}

	de_convert_and_write_image_bilevel(c->infile, pos, d->w, d->h, rowspan,
		DE_CVTF_WHITEISZERO, NULL, 0);
	retval = 1;
done:
	return retval;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq (%rsi), %rsi
movq 0x8(%r15), %rdx
callq 0xdf038
movq (%r15), %r8
movq 0x8(%r15), %rcx
leaq 0x7(%r8), %rax
pushq $0x8
popq %rsi
cqto
idivq %rsi
movq %rax, %rdx
imulq %rcx, %rdx
addq %rbx, %rdx
movq 0x18(%r14), %rdi
cmpq 0x18(%rdi), %rdx
jle 0xc8834
leaq 0x3d4cf(%rip), %rsi     # 0x105cf4
movq %r14, %rdi
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0xdf2a5
pushq $0x1
popq %r9
movq %rbx, %rsi
movq %r8, %rdx
movq %rax, %r8
pushq $0x0
pushq $0x0
callq 0xe7804
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/unsupported.c
// Function: de_module_unsupported
void de_module_unsupported(deark *c, struct deark_module_info *mi)
{
	mi->id = "unsupported";
	mi->desc = "Identify some unsupported formats";
	mi->run_fn = de_run_unsupported;
	mi->identify_fn = de_identify_unsupported;
	mi->flags |= DE_MODFLAG_HIDDEN | DE_MODFLAG_NOEXTRACT;
	mi->unique_id = 1;
}

// Assembly:
leaq 0x6a6b5(%rip), %rax     # 0x132f10
movq %rax, (%rsi)
leaq 0x6a6b7(%rip), %rax     # 0x132f1c
movq %rax, 0x8(%rsi)
leaq 0x1b(%rip), %rax        # 0xc888b
movq %rax, 0x18(%rsi)
leaq 0x6f(%rip), %rax        # 0xc88ea
movq %rax, 0x20(%rsi)
orb $0x5, 0x30(%rsi)
movl $0x1, 0x34(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/vort.c
// Function: de_module_vort
void de_module_vort(deark *c, struct deark_module_info *mi)
{
	mi->id = "vort";
	mi->desc = "VORT ray tracer PIX image";
	mi->run_fn = de_run_vort;
	mi->identify_fn = de_identify_vort;
}

// Assembly:
leaq 0x6a58d(%rip), %rax     # 0x1331a4
movq %rax, (%rsi)
leaq 0x6a588(%rip), %rax     # 0x1331a9
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0xc8c3c
movq %rax, 0x18(%rsi)
leaq 0x52b(%rip), %rax       # 0xc9162
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/vort.c
// Function: read_vlq
static i64 read_vlq(deark *c, i64 *fpos)
{
	i64 nlen;
	i64 k;
	i64 val;
	i64 pos = *fpos;

	nlen = (i64)de_getbyte_p(&pos);
	*fpos += 1+nlen;
	if(nlen>7) {
		return 0;
	}

	val = 0;
	for(k=0; k<nlen; k++) {
		val = (val<<8) | (i64)de_getbyte_p(&pos);
	}
	if(val<0) return 0;
	return val;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %rax
movq %rsp, %rsi
movq %rax, (%rsi)
movq 0x18(%rdi), %rdi
callq 0xe3f2a
movzbl %al, %r15d
movq (%r14), %rax
addq %r15, %rax
incq %rax
movq %rax, (%r14)
cmpb $0x7, %r15b
jbe 0xc91be
xorl %eax, %eax
jmp 0xc91eb
xorl %r12d, %r12d
movq %rsp, %r14
subq $0x1, %r15
jb 0xc91e2
shlq $0x8, %r12
movq 0x18(%rbx), %rdi
movq %r14, %rsi
callq 0xe3f2a
movzbl %al, %eax
orq %rax, %r12
jmp 0xc91c4
xorl %eax, %eax
testq %r12, %r12
cmovgq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/vort.c
// Function: decode_simple_item
static void decode_simple_item(deark *c, lctx *d,
	const struct obj_type_info_struct *oti,
	i64 pos, i64 dlen, i64 val)
{
	if(oti->full_type==VORT_V_IMAGE) {
		switch(oti->primitive_type) {
		case VORT_I_ADDR: d->image_data_pos = val; break;
		case VORT_I_IMWIDTH: d->image_width = val; break;
		case VORT_I_IMHEIGHT: d->image_height = val; break;
		case VORT_I_IMDEPTH: d->reported_image_depth = val; break;
		case VORT_I_ALPHA: d->image_alpha_flag = 1; break;
		case VORT_I_COLORMAP: d->image_colormap_addr = val; break;
		case VORT_I_RLE_CODED: d->rle_flag = 1; break;
		}
	}
	else if(oti->full_type==VORT_V_COLORMAP) {
		switch(oti->primitive_type) {
		case VORT_C_ADDR: d->colormap_pos = val; break;
		case VORT_C_SIZE: d->colormap_size = val; break;
		}
	}
}

// Assembly:
movzbl 0x4(%rdx), %eax
cmpl $0x3, %eax
je 0xc954f
cmpl $0x1, %eax
jne 0xc9565
movzbl 0x5(%rdx), %eax
cmpq $0xb, %rax
ja 0xc9565
leaq 0x69c23(%rip), %rcx     # 0x133164
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %r9, 0x8(%rsi)
retq
movzbl 0x5(%rdx), %eax
cmpl $0x1, %eax
je 0xc9561
testl %eax, %eax
jne 0xc9565
movq %r9, 0x28(%rsi)
retq
movq %r9, 0x30(%rsi)
retq
movq %r9, 0x38(%rsi)
retq
movq %r9, 0x10(%rsi)
retq
movb $0x1, 0x40(%rsi)
retq
movq %r9, 0x18(%rsi)
retq
movq %r9, 0x20(%rsi)
retq
movb $0x1, 0x41(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/wad.c
// Function: de_module_wad
void de_module_wad(deark *c, struct deark_module_info *mi)
{
	mi->id = "wad";
	mi->desc = "Doom WAD";
	mi->run_fn = de_run_wad;
	mi->identify_fn = de_identify_wad;
}

// Assembly:
leaq 0x69e44(%rip), %rax     # 0x133433
movq %rax, (%rsi)
leaq 0x69e3e(%rip), %rax     # 0x133437
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0xc9614
movq %rax, 0x18(%rsi)
leaq 0x263(%rip), %rax       # 0xc9872
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/wmf.c
// Function: de_module_wmf
void de_module_wmf(deark *c, struct deark_module_info *mi)
{
	mi->id = "wmf";
	mi->desc = "Windows Metafile";
	mi->desc2 = "extract bitmaps only";
	mi->run_fn = de_run_wmf;
	mi->identify_fn = de_identify_wmf;
}

// Assembly:
leaq 0x45bc4(%rip), %rax     # 0x10f487
movq %rax, (%rsi)
leaq 0x447c5(%rip), %rax     # 0x10e092
movq %rax, 0x8(%rsi)
leaq 0x447cb(%rip), %rax     # 0x10e0a3
movq %rax, 0x10(%rsi)
leaq 0x10(%rip), %rax        # 0xc98f3
movq %rax, 0x18(%rsi)
leaq 0x496(%rip), %rax       # 0xc9d84
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/wmf.c
// Function: de_identify_wmf
static int de_identify_wmf(deark *c)
{
	UI w0, w1, ver;
	i64 sz;
	int has_ext;

	w0 = (UI)de_getu16le(0);
	w1 = (UI)de_getu16le(2);
	if(w0==0xcdd7 && w1==0x9ac6) {
		return 100;
	}
	if(w1!=0x09) return 0;
	if(w0!=0x01 && w0!=0x02) return 0;
	ver = (UI)de_getu16le(4);
	if(ver!=0x0100 && ver!=0x0300) return 0;

	has_ext = de_input_file_has_ext(c, "wmf");
	if(has_ext) return 95;
	sz = de_getu32le(6) * 2;
	if(sz > c->infile->len || sz < 20) return 0;
	if(sz >= c->infile->len-8) return 70;
	return 14;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
movq 0x18(%rdi), %rdi
xorl %ebx, %ebx
xorl %esi, %esi
callq 0xe3fa3
movq %rax, %r15
movq 0x18(%r14), %rdi
pushq $0x2
popq %rsi
callq 0xe3fa3
movl %r15d, %ecx
xorl $0xcdd7, %ecx           # imm = 0xCDD7
movl %eax, %edx
xorl $0x9ac6, %edx           # imm = 0x9AC6
orl %ecx, %edx
jne 0xc9dc2
pushq $0x64
popq %rbx
jmp 0xc9e41
cmpl $0x9, %eax
setne %al
addl $-0x3, %r15d
cmpl $-0x2, %r15d
setb %cl
orb %al, %cl
jne 0xc9e41
movq 0x18(%r14), %rdi
pushq $0x4
popq %rsi
callq 0xe3fa3
andl $0xfffffdff, %eax       # imm = 0xFFFFFDFF
cmpl $0x100, %eax            # imm = 0x100
jne 0xc9e41
leaq 0x45691(%rip), %rsi     # 0x10f487
movq %r14, %rdi
callq 0xdfcd5
testl %eax, %eax
je 0xc9e06
pushq $0x5f
jmp 0xc9dbf
movq 0x18(%r14), %rdi
pushq $0x6
popq %rsi
callq 0xe409f
leaq (%rax,%rax), %rcx
movq 0x18(%r14), %rdx
movq 0x18(%rdx), %rdx
cmpq %rdx, %rcx
setg %sil
cmpq $0xa, %rax
setl %al
orb %sil, %al
jne 0xc9e41
addq $-0x8, %rdx
cmpq %rdx, %rcx
pushq $0xe
popq %rax
pushq $0x46
popq %rbx
cmovll %eax, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/wmf.c
// Function: handler_colorref
static int handler_colorref(deark *c, lctx *d, struct decoder_params *dp)
{
	u32 colorref;

	if(dp->dlen<4) goto done;
	colorref = (u32)de_getu32le(dp->dpos);
	do_dbg_colorref(c, d, dp, colorref);
done:
	return 1;
}

// Assembly:
cmpq $0x4, 0x28(%rdx)
jl 0xc9e6c
pushq %rbx
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
movq 0x20(%rdx), %rsi
callq 0xe409f
movq %rbx, %rdi
movl %eax, %esi
callq 0xca9bf
popq %rbx
pushq $0x1
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/wmf.c
// Function: wmf_handler_TEXTOUT
static int wmf_handler_TEXTOUT(deark *c, lctx *d, struct decoder_params *dp)
{
	i64 pos = dp->dpos;
	i64 stringlen;
	de_ucstring *s = NULL;

	stringlen = de_getu16le(pos);
	pos += 2;

	if(pos+stringlen > dp->dpos+dp->dlen) goto done;
	s = ucstring_create(c);
	dbuf_read_to_ucstring_n(c->infile, pos, stringlen, DE_DBG_MAX_STRLEN, s,
		0, d->input_encoding);
	de_dbg(c, "text: \"%s\"", ucstring_getpsz(s));

done:
	ucstring_destroy(s);
	return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r14
movq %rsi, %r13
movq %rdi, %rbx
movq 0x20(%rdx), %r15
movq 0x18(%rdi), %rdi
movq %r15, %rsi
callq 0xe3fa3
movq %rax, %r12
addq %r15, %rax
addq $0x2, %rax
movq 0x28(%r14), %rcx
addq 0x20(%r14), %rcx
cmpq %rcx, %rax
jle 0xc9eb2
xorl %r14d, %r14d
jmp 0xc9efe
addq $0x2, %r15
movq %rbx, %rdi
callq 0xeac74
movq %rax, %r14
movq 0x18(%rbx), %rdi
movl 0x4(%r13), %eax
movl %eax, (%rsp)
movl $0x1f4, %ecx            # imm = 0x1F4
movq %r15, %rsi
movq %r12, %rdx
movq %r14, %r8
xorl %r9d, %r9d
callq 0xe4ced
movq %r14, %rdi
callq 0xeb7e4
leaq 0x63ec3(%rip), %rsi     # 0x12ddb4
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
movq %r14, %rdi
callq 0xeaf3c
pushq $0x1
popq %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/wmf.c
// Function: handler_FILLREGION
static int handler_FILLREGION(deark *c, lctx *d, struct decoder_params *dp)
{
	unsigned int oi;
	i64 pos = dp->dpos;

	oi = (unsigned int)de_getu16le_p(&pos);
	de_dbg(c, "region object index: %u", oi);
	oi = (unsigned int)de_getu16le_p(&pos);
	de_dbg(c, "brush object index: %u", oi);
	return 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x20(%rdx), %rax
movq %rsp, %r14
movq %rax, (%r14)
movq 0x18(%rdi), %rdi
movq %r14, %rsi
callq 0xe3fc4
leaq 0x6989a(%rip), %rsi     # 0x133d0b
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xde896
movq 0x18(%rbx), %rdi
movq %r14, %rsi
callq 0xe3fc4
leaq 0x69893(%rip), %rsi     # 0x133d23
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xde896
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/wmf.c
// Function: wmf_handler_EXTTEXTOUT
static int wmf_handler_EXTTEXTOUT(deark *c, lctx *d, struct decoder_params *dp)
{
	i64 pos = dp->dpos;
	i64 stringlen;
	de_ucstring *s = NULL;
	u32 fwOpts;

	pos += 4; // Y, X

	stringlen = de_getu16le(pos);
	pos += 2;

	fwOpts = (u32)de_getu16le(pos);
	pos += 2;

	if(fwOpts & 0x0004) {
		// My best guess is that this flag determines whether the
		// Rectangle field exists. The specification says the field is
		// optional, but AFAICT does not say how to tell whether it exists.
		pos += 8; // Rectangle
	}

	if(pos+stringlen > dp->dpos+dp->dlen) goto done;
	s = ucstring_create(c);
	dbuf_read_to_ucstring_n(c->infile, pos, stringlen, DE_DBG_MAX_STRLEN, s,
		0, d->input_encoding);
	de_dbg(c, "text: \"%s\"", ucstring_getpsz(s));

done:
	ucstring_destroy(s);
	return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
movq 0x20(%rdx), %r13
leaq 0x4(%r13), %rsi
movq 0x18(%rdi), %rdi
callq 0xe3fa3
movq %rax, %r14
leaq 0x6(%r13), %rsi
movq 0x18(%rbx), %rdi
callq 0xe3fa3
andl $0x4, %eax
leaq (,%rax,2), %rcx
addq %r13, %rcx
addq %r14, %rcx
addq $0x8, %rcx
movq 0x28(%r15), %rdx
addq 0x20(%r15), %rdx
cmpq %rdx, %rcx
jle 0xca52e
xorl %r15d, %r15d
jmp 0xca57c
leaq 0x8(%r13,%rax,2), %r13
movq %rbx, %rdi
callq 0xeac74
movq %rax, %r15
movq 0x18(%rbx), %rdi
movl 0x4(%r12), %eax
movl %eax, (%rsp)
movl $0x1f4, %ecx            # imm = 0x1F4
movq %r13, %rsi
movq %r14, %rdx
movq %r15, %r8
xorl %r9d, %r9d
callq 0xe4ced
movq %r15, %rdi
callq 0xeb7e4
leaq 0x63845(%rip), %rsi     # 0x12ddb4
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
movq %r15, %rdi
callq 0xeaf3c
pushq $0x1
popq %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/wmf.c
// Function: wmf_handler_DIBSTRETCHBLT_STRETCHDIB
static int wmf_handler_DIBSTRETCHBLT_STRETCHDIB(deark *c, lctx *d, struct decoder_params *dp)
{
	i64 dib_pos;
	i64 dib_len;
	int hdrsize;
	int has_src_bitmap = 1;

	if(dp->rectype==0x41) { // DIBSTRETCHBLT
		has_src_bitmap = (dp->recsize_words != ((i64)(dp->recfunc>>8)+3));
		de_dbg(c, "has src bitmap: %d", has_src_bitmap);
	}

	if(!has_src_bitmap) goto done;
	if(dp->rectype==0x41) // DIBSTRETCHBLT
		hdrsize = 26;
	else
		hdrsize = 28;

	if(dp->recsize_bytes < hdrsize) goto done;
	dib_pos = dp->recpos + hdrsize;
	dib_len = dp->recsize_bytes - hdrsize;
	if(dib_len < 12) goto done;
	de_dbg(c, "DIB at %d, size=%d", (int)dib_pos, (int)dib_len);

	de_dbg_indent(c, 1);
	de_run_module_by_id_on_slice(c, "dib", NULL, c->infile, dib_pos, dib_len);
	de_dbg_indent(c, -1);

done:
	return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rdi, %rbx
cmpb $0x41, 0x2(%rdx)
jne 0xca5e8
movq 0x10(%r14), %r15
movzbl 0x1(%r14), %r12d
addq $0x3, %r12
xorl %edx, %edx
cmpq %r12, %r15
setne %dl
leaq 0x691de(%rip), %rsi     # 0x1337a3
movq %rbx, %rdi
xorl %eax, %eax
callq 0xde896
cmpq %r12, %r15
je 0xca647
xorl %eax, %eax
cmpb $0x41, 0x2(%r14)
setne %al
leaq 0x1a(,%rax,2), %r15
jmp 0xca5ec
pushq $0x1c
popq %r15
movq 0x18(%r14), %r12
subq %r15, %r12
jl 0xca647
cmpq $0xc, %r12
jl 0xca647
addq 0x8(%r14), %r15
leaq 0x69210(%rip), %rsi     # 0x133816
movq %rbx, %rdi
movl %r15d, %edx
movl %r12d, %ecx
xorl %eax, %eax
callq 0xde896
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
movq 0x18(%rbx), %rcx
leaq 0x4bc23(%rip), %rsi     # 0x11624f
movq %rbx, %rdi
xorl %edx, %edx
movq %r15, %r8
movq %r12, %r9
callq 0xdf9b8
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/wmf.c
// Function: handler_DELETEOBJECT
static int handler_DELETEOBJECT(deark *c, lctx *d, struct decoder_params *dp)
{
	unsigned int oi;
	oi = (unsigned int)de_getu16le(dp->dpos);
	de_dbg(c, "object index: %u", oi);
	if(d->object_table && oi<d->num_objects) {
		d->object_table[oi] = 0; // Mark this index as available
	}
	return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r15
movq 0x18(%rdi), %rdi
movq 0x20(%rdx), %rsi
callq 0xe3fa3
movq %rax, %r14
leaq 0x697d5(%rip), %rsi     # 0x133e4d
movq %r15, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0xde896
movq 0x28(%rbx), %rax
testq %rax, %rax
je 0xca69b
cmpl %r14d, 0x18(%rbx)
jbe 0xca69b
movl %r14d, %ecx
movb $0x0, (%rax,%rcx)
pushq $0x1
popq %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/wmf.c
// Function: handler_CREATEPENINDIRECT
static int handler_CREATEPENINDIRECT(deark *c, lctx *d, struct decoder_params *dp)
{
	u32 colorref;
	i64 pos = dp->dpos;
	unsigned int width;
	unsigned int style;
	unsigned int base_style;
	de_ucstring *style_descr = NULL;

	if(dp->dlen<10) goto done;
	style = (unsigned int)de_getu16le_p(&pos);
	base_style = style&0x0f; // ?
	style_descr = ucstring_create(c);
	ucstring_append_flags_item(style_descr, get_penbasestyle_name(base_style));
	if((style&0x0f00)==0x0100) ucstring_append_flags_item(style_descr, "PS_ENDCAP_SQUARE");
	if((style&0x0f00)==0x0200) ucstring_append_flags_item(style_descr, "PS_ENDCAP_FLAG");
	if((style&0xf000)==0x1000) ucstring_append_flags_item(style_descr, "PS_JOIN_BEVEL");
	if((style&0xf000)==0x2000) ucstring_append_flags_item(style_descr, "PS_JOIN_MITER");
	de_dbg(c, "style: 0x%04x (%s)", style, ucstring_getpsz(style_descr));

	if(base_style!=0x5) {
		width = (unsigned int)de_getu32le(pos);
		width &= 0x0000ffffU;
		de_dbg(c, "width: %u", width);
	}
	pos += 4;

	if(base_style!=0x5) {
		colorref = (u32)de_getu32le(pos);
		do_dbg_colorref(c, d, dp, colorref);
	}

done:
	ucstring_destroy(style_descr);
	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq 0x20(%rdx), %rax
movq %rax, 0x8(%rsp)
cmpq $0xa, 0x28(%rdx)
jge 0xca6c8
xorl %r14d, %r14d
jmp 0xca7f1
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
leaq 0x8(%rsp), %rsi
callq 0xe3fc4
movq %rax, %r15
movl %r15d, %ebp
movl %r15d, %r12d
andl $0xf, %r12d
movq %rbx, %rdi
callq 0xeac74
movq %rax, %r14
cmpl $0x8, %r12d
ja 0xca70d
movl %r15d, %eax
andl $0xf, %eax
leaq 0x69778(%rip), %rcx     # 0x133e7c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmp 0xca70f
xorl %eax, %eax
testq %rax, %rax
leaq 0x547c8(%rip), %rsi     # 0x11eee1
cmovneq %rax, %rsi
movq %r14, %rdi
callq 0xeb884
movl %ebp, %eax
andl $0xf00, %eax            # imm = 0xF00
cmpl $0x100, %eax            # imm = 0x100
je 0xca743
cmpl $0x200, %eax            # imm = 0x200
jne 0xca752
leaq 0x6960a(%rip), %rsi     # 0x133d4b
jmp 0xca74a
leaq 0x695f0(%rip), %rsi     # 0x133d3a
movq %r14, %rdi
callq 0xeb884
andl $0xf000, %r15d          # imm = 0xF000
cmpw $0x1000, %r15w          # imm = 0x1000
je 0xca773
cmpl $0x2000, %r15d          # imm = 0x2000
jne 0xca782
leaq 0x695f7(%rip), %rsi     # 0x133d68
jmp 0xca77a
leaq 0x695e0(%rip), %rsi     # 0x133d5a
movq %r14, %rdi
callq 0xeb884
movq %r14, %rdi
callq 0xeb7e4
leaq 0x695e5(%rip), %rsi     # 0x133d76
movq %rbx, %rdi
movl %ebp, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0xde896
cmpl $0x5, %r12d
jne 0xca7ae
addq $0x4, 0x8(%rsp)
jmp 0xca7f1
movq 0x18(%rbx), %rdi
movq 0x8(%rsp), %rsi
callq 0xe409f
movzwl %ax, %edx
leaq 0x695c3(%rip), %rsi     # 0x133d89
movq %rbx, %rdi
xorl %eax, %eax
callq 0xde896
movq 0x8(%rsp), %rsi
addq $0x4, %rsi
movq %rsi, 0x8(%rsp)
movq 0x18(%rbx), %rdi
callq 0xe409f
movq %rbx, %rdi
movl %eax, %esi
callq 0xca9bf
movq %r14, %rdi
callq 0xeaf3c
pushq $0x1
popq %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/wmf.c
// Function: handler_CREATEFONTINDIRECT
static int handler_CREATEFONTINDIRECT(deark *c, lctx *d, struct decoder_params *dp)
{
	i64 facename_size;
	i64 n, n2;
	u8 b;
	i64 pos = dp->dpos;

	n = de_geti16le_p(&pos);
	n2 = de_geti16le_p(&pos);
	de_dbg(c, "height,width: %d,%d", (int)n, (int)n2);
	pos += 9;
	b = de_getbyte_p(&pos);
	de_dbg(c, "charset: 0x%02x (%s)", (unsigned int)b,
		fmtutil_get_windows_charset_name(b));

	facename_size = dp->dlen-18;
	if(facename_size>32) facename_size=32;
	if(facename_size>=2) {
		de_ucstring *facename = NULL;
		facename = ucstring_create(c);
		dbuf_read_to_ucstring(c->infile, dp->dpos+18, facename_size, facename,
			DE_CONVFLAG_STOP_AT_NUL, DE_ENCODING_WINDOWS1252);
		de_dbg(c, "facename: \"%s\"", ucstring_getpsz_d(facename));
		ucstring_destroy(facename);
	}
	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r14
movq %rdi, %rbx
movq 0x20(%rdx), %rax
leaq 0x8(%rsp), %r15
movq %rax, (%r15)
movq 0x18(%rdi), %rdi
movq %r15, %rsi
callq 0xe4038
movq %rax, %r12
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xe4038
leaq 0x44595(%rip), %rsi     # 0x10edde
movq %rbx, %rdi
movl %r12d, %edx
movl %eax, %ecx
xorl %eax, %eax
callq 0xde896
addq $0x9, (%r15)
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xe3f2a
movzbl %al, %ebp
movl %ebp, %edi
callq 0xed552
leaq 0x44579(%rip), %rsi     # 0x10edf2
movq %rbx, %rdi
movl %ebp, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0xde896
movq 0x28(%r14), %rax
cmpq $0x14, %rax
jl 0xca8f0
cmpq $0x32, %rax
pushq $0x32
popq %r12
cmovbq %rax, %r12
addq $-0x12, %r12
movq %rbx, %rdi
callq 0xeac74
movq %rax, %r15
movq 0x18(%rbx), %rdi
movq 0x20(%r14), %rsi
addq $0x12, %rsi
pushq $0x1
popq %r8
pushq $0x9
popq %r9
movq %r12, %rdx
movq %rax, %rcx
callq 0xe4c9a
movq %r15, %rdi
callq 0xeb877
leaq 0x4452c(%rip), %rsi     # 0x10ee07
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
movq %r15, %rdi
callq 0xeaf3c
pushq $0x1
popq %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/wmf.c
// Function: handler_CREATEBRUSHINDIRECT
static int handler_CREATEBRUSHINDIRECT(deark *c, lctx *d, struct decoder_params *dp)
{
	unsigned int style;
	i64 pos = dp->dpos;

	if(dp->dlen<8) goto done;
	style = (unsigned int)de_getu16le_p(&pos);
	de_dbg(c, "style: 0x%04x (%s)", style, get_brushstyle_name(style));

	if(style==0x0 || style==0x2) {
		u32 colorref;
		colorref = (u32)de_getu32le(pos);
		do_dbg_colorref(c, d, dp, colorref);
	}
	pos += 4;

	if(style==0x2) {
		unsigned int h;
		h = (unsigned int)de_getu16le(pos);
		de_dbg(c, "hatch: %u", h);
	}

done:
	return 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x20(%rdx), %rax
movq %rax, (%rsp)
cmpq $0x8, 0x28(%rdx)
jl 0xca9b4
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
movq %rsp, %rsi
callq 0xe3fc4
movq %rax, %r14
cmpl $0x6, %r14d
ja 0xca942
movl %r14d, %eax
andl $0x7, %eax
leaq 0xc6214(%rip), %rcx     # 0x190b50
movq (%rcx,%rax,8), %rax
jmp 0xca944
xorl %eax, %eax
testq %rax, %rax
leaq 0x54593(%rip), %rcx     # 0x11eee1
cmovneq %rax, %rcx
leaq 0x6941d(%rip), %rsi     # 0x133d76
movq %rbx, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0xde896
testl $0xfffffffd, %r14d      # imm = 0xFFFFFFFD
jne 0xca986
movq 0x18(%rbx), %rdi
movq (%rsp), %rsi
callq 0xe409f
movq %rbx, %rdi
movl %eax, %esi
callq 0xca9bf
movq (%rsp), %rsi
addq $0x4, %rsi
movq %rsi, (%rsp)
cmpl $0x2, %r14d
jne 0xca9b4
movq 0x18(%rbx), %rdi
callq 0xe3fa3
leaq 0x6944d(%rip), %rsi     # 0x133df5
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xde896
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/wpg.c
// Function: de_module_wpg
void de_module_wpg(deark *c, struct deark_module_info *mi)
{
	mi->id = "wpg";
	mi->desc = "WordPerfect Graphics";
	mi->run_fn = de_run_wpg;
	mi->identify_fn = de_identify_wpg;
}

// Assembly:
leaq 0x69481(%rip), %rax     # 0x133ea0
movq %rax, (%rsi)
leaq 0x6947b(%rip), %rax     # 0x133ea4
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0xcaa44
movq %rax, 0x18(%rsi)
leaq 0x302(%rip), %rax       # 0xcad41
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/wpg.c
// Function: handler_colormap
static void handler_colormap(deark *c, lctx *d, u8 rectype, i64 dpos1, i64 dlen)
{
	i64 start_index;
	i64 num_entries;
	i64 pos = dpos1;

	d->has_pal = 1;
	start_index = de_getu16le(pos);
	de_dbg(c, "start index: %d", (int)start_index);
	pos += 2;

	num_entries = de_getu16le(pos);
	de_dbg(c, "num entries: %d", (int)num_entries);
	pos += 2;

	if(start_index+num_entries>256) num_entries = 256 - start_index;
	if(start_index<0 || start_index+num_entries>256) return;

	if(num_entries > d->num_pal_entries) {
		d->num_pal_entries = num_entries;
	}

	de_read_palette_rgb(c->infile, pos, num_entries, 3, &d->pal[start_index],
		256-start_index, 0);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rcx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movl $0x1, 0x10(%rsi)
movq 0x18(%rdi), %rdi
movq %rcx, %rsi
callq 0xe3fa3
movq %rax, %r12
leaq 0x68ea9(%rip), %rsi     # 0x1341dc
movq %r15, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0xde896
leaq 0x2(%rbx), %rsi
movq 0x18(%r15), %rdi
callq 0xe3fa3
movq %rax, %r13
leaq 0x41a60(%rip), %rsi     # 0x10cdb7
movq %r15, %rdi
movl %r13d, %edx
xorl %eax, %eax
callq 0xde896
leaq (%r12,%r13), %rax
movl $0x100, %r9d            # imm = 0x100
subq %r12, %r9
cmpq $0x101, %rax            # imm = 0x101
cmovgeq %r9, %r13
testq %r12, %r12
js 0xcb3be
leaq (%r12,%r13), %rax
cmpq $0x100, %rax            # imm = 0x100
jg 0xcb3be
addq $0x4, %rbx
cmpq 0x418(%r14), %r13
jle 0xcb3a0
movq %r13, 0x418(%r14)
movq 0x18(%r15), %rdi
leaq (%r14,%r12,4), %r8
addq $0x14, %r8
andl $0x0, (%rsp)
pushq $0x3
popq %rcx
movq %rbx, %rsi
movq %r13, %rdx
callq 0xe7963
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/wri.c
// Function: de_module_wri
void de_module_wri(deark *c, struct deark_module_info *mi)
{
	mi->id = "wri";
	mi->desc = "Microsoft Write";
	mi->run_fn = de_run_wri;
	mi->identify_fn = de_identify_wri;
	mi->help_fn = de_help_wri;
}

// Assembly:
leaq 0x68dc6(%rip), %rax     # 0x1341f1
movq %rax, (%rsi)
leaq 0x68dc0(%rip), %rax     # 0x1341f5
movq %rax, 0x8(%rsi)
leaq 0x1b(%rip), %rax        # 0xcb45b
movq %rax, 0x18(%rsi)
leaq 0xfef(%rip), %rax       # 0xcc43a
movq %rax, 0x20(%rsi)
leaq 0x104c(%rip), %rax      # 0xcc4a2
movq %rax, 0x28(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/wri.c
// Function: de_identify_wri
static int de_identify_wri(deark *c)
{
	u8 buf[6];
	de_read(buf, 0, 6);

	if((buf[0]==0x31 || buf[0]==0x32) &&
		!de_memcmp(&buf[1], "\xbe\x00\x00\x00\xab", 5))
	{
		i64 pnMac;
		pnMac = de_getu16le(48*2);
		if(pnMac==0) return 0; // Apparently MSWord, not Write
		return 100;
	}
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %r14
movq 0x18(%rdi), %rdi
xorl %ebx, %ebx
leaq 0xa(%rsp), %r15
pushq $0x6
popq %rcx
movq %r15, %rsi
xorl %edx, %edx
callq 0xe3cb7
movb (%r15), %al
addb $-0x31, %al
cmpb $0x1, %al
ja 0xcc496
leaq 0xb(%rsp), %rdi
leaq 0x683e1(%rip), %rsi     # 0x134854
pushq $0x5
popq %rdx
callq 0x18230
testl %eax, %eax
jne 0xcc496
movq 0x18(%r14), %rdi
pushq $0x60
popq %rsi
callq 0xe3fa3
xorl %ecx, %ecx
testq %rax, %rax
pushq $0x64
popq %rbx
cmovel %ecx, %ebx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/wri.c
// Function: do_emit_raw_sz
static void do_emit_raw_sz(deark *c, lctx *d, struct para_info *pinfo, const char *sz)
{
	size_t sz_len = de_strlen(sz);
	if(sz_len<1) return;
	dbuf_write(d->html_outf, (const u8*)sz, (i64)sz_len);
	if(sz[sz_len-1]=='\n') {
		pinfo->xpos = 0;
	}
	else {
		pinfo->xpos += (int)sz_len;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r12
movq %rdx, %rdi
callq 0x180e0
testq %rax, %rax
je 0xcc509
movq %rax, %r15
movq 0x70(%r12), %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0xe46ba
cmpb $0xa, -0x1(%r14,%r15)
jne 0xcc505
andl $0x0, 0x20(%rbx)
jmp 0xcc509
addl %r15d, 0x20(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/wri.c
// Function: end_para
static void end_para(deark *c, lctx *d, struct para_info *pinfo)
{
	if(!pinfo->in_para) return;

	if(pinfo->in_span) {
		do_emit_raw_sz(c, d, pinfo, "</span>");
		pinfo->in_span = 0;
	}

	if(!pinfo->has_content) {
		// No empty paragraphs allowed. HTML will collapse them, but Write does not.
		do_emit_codepoint(c, d, pinfo, 0xa0);
	}
	do_emit_raw_sz(c, d, pinfo, "</p>\n");
	pinfo->in_para = 0;
	default_text_styles(&pinfo->text_styles_current);
}

// Assembly:
cmpl $0x0, 0x1c(%rdx)
je 0xcc57d
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
cmpl $0x0, 0x2c(%rdx)
je 0xcc545
leaq 0x70232(%rip), %rdx     # 0x13c768
movq %r14, %rdi
movq %rbx, %rsi
callq 0xcc4c6
andl $0x0, 0x2c(%rbx)
cmpl $0x0, 0x24(%rbx)
jne 0xcc55e
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
movl $0xa0, %ecx
callq 0xcc57e
leaq 0x68265(%rip), %rdx     # 0x1347ca
movq %r14, %rdi
movq %rbx, %rsi
callq 0xcc4c6
andl $0x0, 0x1c(%rbx)
movb $0x0, 0x31(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/wri.c
// Function: do_emit_codepoint
static void do_emit_codepoint(deark *c, lctx *d, struct para_info *pinfo, i32 outcp)
{
	int styles_changed;

	if(!pinfo->in_para) {
		ensure_in_para(c, d, pinfo);
	}

	styles_changed = text_styles_differ(&pinfo->text_styles_current, &pinfo->text_styles_wanted);

	if(pinfo->in_span && styles_changed) {
		do_emit_raw_sz(c, d, pinfo, "</span>");
		pinfo->in_span = 0;
	}
	if(styles_changed) {
		if(pinfo->text_styles_wanted.tab_style) {
			do_emit_raw_sz(c, d, pinfo, "<span class=c>");
			pinfo->in_span = 1;
		}
		pinfo->text_styles_current = pinfo->text_styles_wanted; // struct copy
	}

	de_write_codepoint_to_html(c, d->html_outf, outcp);

	// FIXME: We'd like to know how many characters (not bytes) were written,
	// but we don't currently have a good way to do that in the case where the
	// codepoint was written as an HTML entity.
	pinfo->xpos++;

	if(outcp!=32) {
		pinfo->has_content = 1;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebp
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
cmpl $0x0, 0x1c(%rdx)
jne 0xcc5a5
movq %r15, %rdi
movq %rbx, %rsi
callq 0xcc631
movb 0x30(%rbx), %r12b
movb 0x31(%rbx), %r13b
cmpb %r12b, %r13b
setne %al
cmpl $0x0, 0x2c(%rbx)
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0xcc5d7
leaq 0x701a0(%rip), %rdx     # 0x13c768
movq %r15, %rdi
movq %rbx, %rsi
callq 0xcc4c6
andl $0x0, 0x2c(%rbx)
cmpb %r12b, %r13b
je 0xcc605
cmpb $0x0, 0x30(%rbx)
je 0xcc600
leaq 0x681a6(%rip), %rdx     # 0x13478f
movq %r15, %rdi
movq %rbx, %rsi
callq 0xcc4c6
movl $0x1, 0x2c(%rbx)
movb 0x30(%rbx), %al
jmp 0xcc602
xorl %eax, %eax
movb %al, 0x31(%rbx)
movq 0x70(%r15), %rsi
movq %r14, %rdi
movl %ebp, %edx
callq 0xe1fc7
incl 0x20(%rbx)
cmpl $0x20, %ebp
je 0xcc622
movl $0x1, 0x24(%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/wri.c
// Function: ensure_in_para
static void ensure_in_para(deark *c, lctx *d, struct para_info *pinfo)
{
	if(pinfo->in_para) return;
	do_emit_raw_sz(c, d, pinfo, "<p");
	switch(pinfo->justification) {
	case 1: do_emit_raw_sz(c, d, pinfo, " class=tc"); break;
	case 2: do_emit_raw_sz(c, d, pinfo, " class=tr"); break;
	case 3: do_emit_raw_sz(c, d, pinfo, " class=tj"); break;
	}
	do_emit_raw_sz(c, d, pinfo, ">");
	pinfo->in_para = 1;
}

// Assembly:
cmpl $0x0, 0x1c(%rsi)
je 0xcc638
retq
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x68155(%rip), %rdx     # 0x13479e
callq 0xcc4c6
movb 0x19(%rbx), %al
decb %al
cmpb $0x2, %al
ja 0xcc673
movzbl %al, %eax
leaq 0x68207(%rip), %rcx     # 0x134868
movslq (%rcx,%rax,4), %rdx
addq %rcx, %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0xcc4c6
leaq 0x70a6f(%rip), %rdx     # 0x13d0e9
movq %r14, %rdi
movq %rbx, %rsi
callq 0xcc4c6
movl $0x1, 0x1c(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/xface.c
// Function: de_module_xface
void de_module_xface(deark *c, struct deark_module_info *mi)
{
	mi->id = "xface";
	mi->desc = "X-Face icon/avatar";
	mi->run_fn = de_run_xface;
	mi->identify_fn = de_identify_xface;
}

// Assembly:
leaq 0x681d9(%rip), %rax     # 0x134874
movq %rax, (%rsi)
leaq 0x681d5(%rip), %rax     # 0x13487a
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0xcc6c0
movq %rax, 0x18(%rsi)
leaq 0x47e(%rip), %rax       # 0xccb39
movq %rax, 0x20(%rsi)
retq