LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/tivariable.c
// Function: do_bitmap_8ci
static int do_bitmap_8ci(deark *c, lctx *d, i64 pos)
{
	de_bitmap *img = NULL;
	i64 i;
	i64 j;
	i64 rowspan;
	int retval = 0;
	u8 b0;

	de_dbg_dimensions(c, d->w, d->h);

	rowspan = (d->w + 1) / 2;

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

	// This a 4 bits/pixel format, but I don't even know if it's grayscale or color.
	img = de_bitmap_create(c, d->w, d->h, 1);

	for(j=0; j<d->h; j++) {
		for(i=0; i<d->w; i++) {
			b0 = de_getbyte(pos + j*rowspan + i/2);
			if(i%2)
				b0 &= 0x0f;
			else
				b0 >>= 4;

			de_bitmap_setpixel_gray(img, i, j, b0 * 17);
		}

	}

	de_bitmap_write_to_file(img, NULL, 0);
	retval = 1;
done:
	de_bitmap_destroy(img);
	return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movl $0x0, -0x3c(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdx
callq 0x15bba0
movq -0x10(%rbp), %rax
movq (%rax), %rax
addq $0x1, %rax
movl $0x2, %ecx
cqto
idivq %rcx
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rax
movq -0x38(%rbp), %rcx
movq -0x10(%rbp), %rdx
imulq 0x8(%rdx), %rcx
addq %rcx, %rax
movq -0x8(%rbp), %rcx
movq 0x18(%rcx), %rcx
cmpq 0x18(%rcx), %rax
jle 0x136b4d
movq -0x8(%rbp), %rdi
leaq 0x6827e(%rip), %rsi     # 0x19edbf
movb $0x0, %al
callq 0x15bfb0
jmp 0x136c73
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdx
callq 0x16a850
cmpl $0x0, %eax
jne 0x136b6f
jmp 0x136c73
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdx
movl $0x1, %ecx
callq 0x16b750
movq %rax, -0x20(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jge 0x136c5d
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq (%rcx), %rax
jge 0x136c4a
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x30(%rbp), %rax
imulq -0x38(%rbp), %rax
addq %rax, %rsi
movq -0x28(%rbp), %rax
movl $0x2, %ecx
cqto
idivq %rcx
addq %rax, %rsi
callq 0x165060
movb %al, -0x3d(%rbp)
movq -0x28(%rbp), %rax
movl $0x2, %ecx
cqto
idivq %rcx
cmpq $0x0, %rdx
je 0x136c14
movzbl -0x3d(%rbp), %eax
andl $0xf, %eax
movb %al, -0x3d(%rbp)
jmp 0x136c1e
movzbl -0x3d(%rbp), %eax
sarl $0x4, %eax
movb %al, -0x3d(%rbp)
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
movzbl -0x3d(%rbp), %eax
imull $0x11, %eax, %eax
movzbl %al, %ecx
callq 0x16b1c0
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x136bb2
jmp 0x136c4c
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x136b98
movq -0x20(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x16afd0
movl $0x1, -0x3c(%rbp)
movq -0x20(%rbp), %rdi
callq 0x16af60
movl -0x3c(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x0, -0x24(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdx
callq 0x15bba0
movq -0x10(%rbp), %rax
movq (%rax), %rax
addq $0x7, %rax
movl $0x8, %ecx
cqto
idivq %rcx
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rdx
imulq 0x8(%rdx), %rcx
addq %rcx, %rax
movq -0x8(%rbp), %rcx
movq 0x18(%rcx), %rcx
cmpq 0x18(%rcx), %rax
jle 0x136d12
movq -0x8(%rbp), %rdi
leaq 0x680b6(%rip), %rsi     # 0x19edbf
movb $0x0, %al
callq 0x15bfb0
jmp 0x136d57
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rax
movq (%rax), %rdx
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x20(%rbp), %r8
movl $0x1, %r9d
xorl %eax, %eax
xorl %eax, %eax
movq $0x0, (%rsp)
movl $0x0, 0x8(%rsp)
callq 0x16bf50
movl $0x1, -0x24(%rbp)
movl -0x24(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/tivariable.c
// Function: do_ti85_picture_var
static int do_ti85_picture_var(deark *c, lctx *d, i64 pos)
{
	i64 x;

	de_dbg(c, "picture at %d", (int)pos);
	x = de_getu16le(pos);
	de_dbg(c, "picture size: %d", (int)x);
	d->w = 128;
	d->h = 63;
	return do_bitmap(c, d, pos+2);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %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 0x94d9e(%rip), %rsi     # 0x1cbd13
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x165280
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl %eax, %edx
leaq 0x94d7f(%rip), %rsi     # 0x1cbd21
movb $0x0, %al
callq 0x15b0d0
movq -0x10(%rbp), %rax
movq $0x80, (%rax)
movq -0x10(%rbp), %rax
movq $0x3f, 0x8(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
addq $0x2, %rdx
callq 0x136c90
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/tivariable.c
// Function: do_ti92_var_table_entry
static void do_ti92_var_table_entry(deark *c, lctx *d, i64 pos)
{
	i64 data_offset;
	u8 type_id;

	de_dbg(c, "var table entry at %d", (int)pos);
	data_offset = de_getu32le(pos);

	type_id = de_getbyte(pos+12);
	de_dbg(c, "var type: 0x%02x", (unsigned int)type_id);
	if(type_id!=0x10) {
		// Not a picture
		return;
	}
	de_dbg(c, "data offset: %d", (int)data_offset);
	do_ti92_picture_var(c, d, data_offset);
}

// 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 0x94e70(%rip), %rsi     # 0x1cbe75
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x165540
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
addq $0xc, %rsi
callq 0x165060
movb %al, -0x21(%rbp)
movq -0x8(%rbp), %rdi
movzbl -0x21(%rbp), %edx
leaq 0x94e43(%rip), %rsi     # 0x1cbe8b
movb $0x0, %al
callq 0x15b0d0
movzbl -0x21(%rbp), %eax
cmpl $0x10, %eax
je 0x13705a
jmp 0x137083
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl %eax, %edx
leaq 0x73c80(%rip), %rsi     # 0x1aaceb
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x137090
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/tivariable.c
// Function: do_ti92_picture_var
static int do_ti92_picture_var(deark *c, lctx *d, i64 pos)
{
	i64 x;

	de_dbg(c, "picture at %d", (int)pos);
	pos+=4;

	x = de_getu16be(pos);
	de_dbg(c, "picture size: %d", (int)x);
	d->h = de_getu16be(pos+2);
	d->w = de_getu16be(pos+4);
	return do_bitmap(c, d, pos+6);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %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 0x94c5e(%rip), %rsi     # 0x1cbd13
movb $0x0, %al
callq 0x15b0d0
movq -0x18(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x1651d0
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl %eax, %edx
leaq 0x94c33(%rip), %rsi     # 0x1cbd21
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
addq $0x2, %rsi
callq 0x1651d0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
addq $0x4, %rsi
callq 0x1651d0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
addq $0x6, %rdx
callq 0x136c90
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
leaq 0x94d49(%rip), %rcx     # 0x1cbeb0
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
leaq 0x94d47(%rip), %rcx     # 0x1cbebc
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
leaq 0x3c(%rip), %rcx        # 0x1371c0
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
leaq 0x9d(%rip), %rcx        # 0x137230
movq %rcx, 0x20(%rax)
movq -0x10(%rbp), %rax
movl 0x30(%rax), %ecx
orl $0x5, %ecx
movl %ecx, 0x30(%rax)
movq -0x10(%rbp), %rax
movl $0x1, 0x34(%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/unsupported.c
// Function: de_run_unsupported
static void de_run_unsupported(deark *c, de_module_params *mparams)
{
	struct fmtinfo_struct fmti;
	get_fmt(c, &fmti);
	if(fmti.confidence>0 && fmti.descr) {
		if(fmti.special_message) {
			de_err(c, "This looks like %s", fmti.descr);
		}
		else {
			de_err(c, "This looks like %s, which is not a supported format.", fmti.descr);
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x137260
cmpl $0x0, -0x20(%rbp)
jle 0x137220
cmpq $0x0, -0x18(%rbp)
je 0x137220
cmpl $0x0, -0x1c(%rbp)
je 0x137208
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq 0x94cdf(%rip), %rsi     # 0x1cbede
movb $0x0, %al
callq 0x15bfb0
jmp 0x13721e
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq 0x94cda(%rip), %rsi     # 0x1cbef1
movb $0x0, %al
callq 0x15bfb0
jmp 0x137220
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
leaq 0x949fd(%rip), %rcx     # 0x1cc164
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
leaq 0x949f4(%rip), %rcx     # 0x1cc169
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
leaq 0x1c(%rip), %rcx        # 0x1377a0
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
leaq 0x12d(%rip), %rcx       # 0x1378c0
movq %rcx, 0x20(%rax)
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/vort.c
// Function: de_run_vort
static void de_run_vort(deark *c, de_module_params *mparams)
{
	i64 pos;
	i64 root_obj_offs;
	i64 bytes_consumed = 0;
	lctx *d = NULL;

	d = de_malloc(c, sizeof(lctx));
	pos = 0;
	de_dbg(c, "header at %"I64_FMT, pos);
	de_dbg_indent(c, 1);
	pos += 6; // signature
	root_obj_offs = read_vlq(c, &pos);
	de_dbg(c, "root object address: %"I64_FMT, root_obj_offs);
	de_dbg_indent(c, -1);

	pos = root_obj_offs;
	if(!do_full_object(c, d, root_obj_offs, &bytes_consumed)) goto done;
	do_colormap(c, d);
	do_image(c, d);

done:
	if(d) {
		if(d->need_errmsg) {
			de_err(c, "Bad or unsupported image type");
		}
		de_free(c, d);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movl $0x458, %esi            # imm = 0x458
callq 0x15b780
movq %rax, -0x30(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq 0x7757a(%rip), %rsi     # 0x1aed63
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x18(%rbp), %rax
addq $0x6, %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x137910
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rdx
leaq 0x94959(%rip), %rsi     # 0x1cc183
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
movq -0x20(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x20(%rbp), %rdx
leaq -0x28(%rbp), %rcx
callq 0x1379e0
cmpl $0x0, %eax
jne 0x137863
jmp 0x13787d
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x137b30
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x137ca0
cmpq $0x0, -0x30(%rbp)
je 0x1378ac
movq -0x30(%rbp), %rax
cmpb $0x0, (%rax)
je 0x13789f
movq -0x8(%rbp), %rdi
leaq 0x6d562(%rip), %rsi     # 0x1a4dfa
movb $0x0, %al
callq 0x15bfb0
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x15b820
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x38(%rbp), %rsi
callq 0x165170
movzbl %al, %eax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rcx
addq $0x1, %rcx
movq -0x18(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
cmpq $0x7, -0x20(%rbp)
jle 0x137966
movq $0x0, -0x8(%rbp)
jmp 0x1379d4
movq $0x0, -0x30(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x20(%rbp), %rax
jge 0x1379bb
movq -0x30(%rbp), %rax
shlq $0x8, %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x38(%rbp), %rsi
callq 0x165170
movb %al, %cl
movq -0x40(%rbp), %rax
movzbl %cl, %ecx
orq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x137976
cmpq $0x0, -0x30(%rbp)
jge 0x1379cc
movq $0x0, -0x8(%rbp)
jmp 0x1379d4
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/vort.c
// Function: do_full_object
static int do_full_object(deark *c, lctx *d, i64 pos1,
	i64 *bytes_consumed)
{
	u8 obj_type;
	i64 obj_dlen;
	i64 pos = pos1;
	i64 bytes_consumed2 = 0;
	int retval = 0;
	int saved_indent_level;

	de_dbg_indent_save(c, &saved_indent_level);
	d->nesting_level++;
	// Objects can't be nested without going through this code path, so doing
	// this check only here should be sufficient.
	if(d->nesting_level>8) goto done;

	de_dbg(c, "full object at %"I64_FMT, pos);
	de_dbg_indent(c, 1);
	obj_type = de_getbyte_p(&pos);
	de_dbg(c, "full type: %u (%s)", (UI)obj_type, get_fulltype_name(obj_type));

	obj_dlen = read_vlq(c, &pos);
	de_dbg(c, "data len: %"I64_FMT, obj_dlen);

	if(!do_object_list(c, d, pos, obj_dlen, obj_type, &bytes_consumed2)) goto done;

	pos += obj_dlen;
	retval = 1;

done:
	d->nesting_level--;
	de_dbg_indent_restore(c, saved_indent_level);
	*bytes_consumed = pos-pos1;
	return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movl $0x0, -0x44(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x15b580
movq -0x10(%rbp), %rax
movl 0x4(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x4(%rax)
movq -0x10(%rbp), %rax
cmpl $0x8, 0x4(%rax)
jle 0x137a38
jmp 0x137aff
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rdx
leaq 0x94755(%rip), %rsi     # 0x1cc19c
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x38(%rbp), %rsi
callq 0x165170
movb %al, -0x21(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x58(%rbp)
movzbl -0x21(%rbp), %eax
movl %eax, -0x4c(%rbp)
movzbl -0x21(%rbp), %edi
callq 0x138080
movq -0x58(%rbp), %rdi
movl -0x4c(%rbp), %edx
movq %rax, %rcx
leaq 0x94716(%rip), %rsi     # 0x1cc1af
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x137910
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rdx
leaq 0x86b4f(%rip), %rsi     # 0x1be60f
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x38(%rbp), %rdx
movq -0x30(%rbp), %rcx
leaq -0x40(%rbp), %r9
movzbl -0x21(%rbp), %r8d
callq 0x138100
cmpl $0x0, %eax
jne 0x137aec
jmp 0x137aff
movq -0x30(%rbp), %rax
addq -0x38(%rbp), %rax
movq %rax, -0x38(%rbp)
movl $0x1, -0x44(%rbp)
movq -0x10(%rbp), %rax
movl 0x4(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x4(%rax)
movq -0x8(%rbp), %rdi
movl -0x48(%rbp), %esi
callq 0x15b5a0
movq -0x38(%rbp), %rcx
subq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movl -0x44(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/vort.c
// Function: do_colormap
static void do_colormap(deark *c, lctx *d)
{
	i64 k;

	if(d->colormap_pos==0 || d->colormap_size==0) return;
	de_dbg(c, "colormap at %"I64_FMT", %d entries", d->colormap_pos, (int)d->colormap_size);
	de_dbg_indent(c, 1);
	for(k=0; k<d->colormap_size && k<256; k++) {
		u8 cr, cg, cb;
		cr = de_getbyte(d->colormap_pos + k);
		cg = de_getbyte(d->colormap_pos + d->colormap_size + k);
		cb = de_getbyte(d->colormap_pos + d->colormap_size*2 + k);
		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 $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x28(%rax)
je 0x137b56
movq -0x10(%rbp), %rax
cmpq $0x0, 0x30(%rax)
jne 0x137b5b
jmp 0x137c8c
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdx
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movl %eax, %ecx
leaq 0x9482b(%rip), %rsi     # 0x1cc3a3
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rdx
xorl %eax, %eax
cmpq 0x30(%rdx), %rcx
movb %al, -0x1c(%rbp)
jge 0x137bb6
cmpq $0x100, -0x18(%rbp)     # imm = 0x100
setl %al
movb %al, -0x1c(%rbp)
movb -0x1c(%rbp), %al
testb $0x1, %al
jne 0x137bc2
jmp 0x137c7e
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rsi
addq -0x18(%rbp), %rsi
callq 0x165060
movb %al, -0x19(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rsi
movq -0x10(%rbp), %rax
addq 0x30(%rax), %rsi
addq -0x18(%rbp), %rsi
callq 0x165060
movb %al, -0x1a(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
shlq %rax
addq %rax, %rsi
addq -0x18(%rbp), %rsi
callq 0x165060
movb %al, -0x1b(%rbp)
movzbl -0x19(%rbp), %edx
shll $0x10, %edx
orl $0xff000000, %edx       # imm = 0xFF000000
movzbl -0x1a(%rbp), %eax
shll $0x8, %eax
orl %eax, %edx
movzbl -0x1b(%rbp), %eax
orl %eax, %edx
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rcx
movl %edx, 0x58(%rax,%rcx,4)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rcx
movl 0x58(%rax,%rcx,4), %edx
callq 0x15bf00
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x137b95
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/vort.c
// Function: get_fulltype_name
static const char *get_fulltype_name(u8 t)
{
	const char *name;
	switch(t) {
	case VORT_V_DIRECTORY: name="directory"; break;
	case VORT_V_IMAGE: name="image"; break;
	case VORT_V_TEXT: name="text"; break;
	case VORT_V_COLORMAP: name="colormap"; break;
	default: name="?";
	}
	return name;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb %dil, %al
movb %al, -0x1(%rbp)
movzbl -0x1(%rbp), %eax
movq %rax, -0x18(%rbp)
subq $0x3, %rax
ja 0x1380e0
movq -0x18(%rbp), %rax
leaq 0x94081(%rip), %rcx     # 0x1cc124
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x67aa4(%rip), %rax     # 0x19fb57
movq %rax, -0x10(%rbp)
jmp 0x1380eb
leaq 0x783a4(%rip), %rax     # 0x1b0464
movq %rax, -0x10(%rbp)
jmp 0x1380eb
leaq 0x8070a(%rip), %rax     # 0x1b87d7
movq %rax, -0x10(%rbp)
jmp 0x1380eb
leaq 0x942ed(%rip), %rax     # 0x1cc3c7
movq %rax, -0x10(%rbp)
jmp 0x1380eb
leaq 0x7fb46(%rip), %rax     # 0x1b7c2d
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/vort.c
// Function: do_object_list
static int do_object_list(deark *c, lctx *d, i64 pos1, i64 len,
	u8 object_fulltype, i64 *bytes_consumed)
{
	i64 pos = pos1;
	int saved_indent_level;
	int retval = 0;

	de_dbg_indent_save(c, &saved_indent_level);
	de_dbg(c, "object list at %"I64_FMT", len=%"I64_FMT, pos, len);
	while(1) {
		i64 objsize;
		if(pos>=pos1+len) break;
		if(pos>=c->infile->len) goto done;

		de_dbg_indent(c, 1);
		if(!do_primitive_object(c, d, pos, object_fulltype, &objsize)) goto done;
		pos += objsize;
		de_dbg_indent(c, -1);
	}
	retval = 1;
done:
	de_dbg_indent_restore(c, saved_indent_level);
	return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %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 %r9, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
movl $0x0, -0x40(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x3c(%rbp), %rsi
callq 0x15b580
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rdx
movq -0x20(%rbp), %rcx
leaq 0x94071(%rip), %rsi     # 0x1cc1c2
movb $0x0, %al
callq 0x15b0d0
movq -0x38(%rbp), %rax
movq -0x18(%rbp), %rcx
addq -0x20(%rbp), %rcx
cmpq %rcx, %rax
jl 0x13816b
jmp 0x1381c9
movq -0x38(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x18(%rcx), %rcx
cmpq 0x18(%rcx), %rax
jl 0x13817f
jmp 0x1381d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x38(%rbp), %rdx
leaq -0x48(%rbp), %r8
movzbl -0x21(%rbp), %ecx
callq 0x1381f0
cmpl $0x0, %eax
jne 0x1381ad
jmp 0x1381d0
movq -0x48(%rbp), %rax
addq -0x38(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
jmp 0x138158
movl $0x1, -0x40(%rbp)
movq -0x8(%rbp), %rdi
movl -0x3c(%rbp), %esi
callq 0x15b5a0
movl -0x40(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/vort.c
// Function: find_obj_type_info
static const struct obj_type_info_struct *find_obj_type_info(u8 full_type, u8 primitive_type)
{
	size_t i;

	for(i=0; i<DE_ARRAYCOUNT(obj_type_info_arr); i++) {
		if(obj_type_info_arr[i].primitive_type==primitive_type &&
			obj_type_info_arr[i].full_type==full_type)
		{
			return &obj_type_info_arr[i];
		}
	}
	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb %sil, %al
movb %dil, %cl
movb %cl, -0x9(%rbp)
movb %al, -0xa(%rbp)
movq $0x0, -0x18(%rbp)
cmpq $0x1a, -0x18(%rbp)
jae 0x13844a
leaq 0xeacea(%rip), %rax     # 0x2230e0
imulq $0x18, -0x18(%rbp), %rcx
addq %rcx, %rax
movzbl 0x5(%rax), %eax
movzbl -0xa(%rbp), %ecx
cmpl %ecx, %eax
jne 0x13843a
leaq 0xeaccf(%rip), %rax     # 0x2230e0
imulq $0x18, -0x18(%rbp), %rcx
addq %rcx, %rax
movzbl 0x4(%rax), %eax
movzbl -0x9(%rbp), %ecx
cmpl %ecx, %eax
jne 0x13843a
leaq 0xeacb4(%rip), %rax     # 0x2230e0
imulq $0x18, -0x18(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x8(%rbp)
jmp 0x138452
jmp 0x13843c
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x1383e8
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x18(%rbp), %rax
movzbl 0x4(%rax), %eax
cmpl $0x1, %eax
jne 0x13855d
movq -0x18(%rbp), %rax
movzbl 0x5(%rax), %eax
movq %rax, -0x38(%rbp)
subq $0xb, %rax
ja 0x13855b
movq -0x38(%rbp), %rax
leaq 0x93c3a(%rip), %rcx     # 0x1cc134
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x30(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x13855b
movq -0x30(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
jmp 0x13855b
movq -0x30(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
jmp 0x13855b
movq -0x30(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x20(%rax)
jmp 0x13855b
movq -0x10(%rbp), %rax
movb $0x1, 0x41(%rax)
jmp 0x13855b
movq -0x30(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x38(%rax)
jmp 0x13855b
movq -0x10(%rbp), %rax
movb $0x1, 0x40(%rax)
jmp 0x1385a3
movq -0x18(%rbp), %rax
movzbl 0x4(%rax), %eax
cmpl $0x3, %eax
jne 0x1385a1
movq -0x18(%rbp), %rax
movzbl 0x5(%rax), %eax
movl %eax, -0x3c(%rbp)
testl %eax, %eax
je 0x138585
jmp 0x13857b
movl -0x3c(%rbp), %eax
subl $0x1, %eax
je 0x138593
jmp 0x13859f
movq -0x30(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x28(%rax)
jmp 0x13859f
movq -0x30(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x30(%rax)
jmp 0x1385a1
jmp 0x1385a3
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/vort.c
// Function: do_decompress
static void do_decompress(deark *c, lctx *d, i64 pos1, dbuf *unc_pixels,
	i64 num_pixels, i64 bytes_per_pixel)
{
	i64 pos = pos1;
	i64 pixel_count = 0;

	while(1) {
		u8 b;
		i64 count;

		if(pixel_count>=num_pixels) break;
		if(pos>c->infile->len) {
			de_warn(c, "Unexpected end of file");
			break;
		}

		b = de_getbyte_p(&pos);
		if(b>=128) { // uncompressed run
			count = (i64)(b-128);
			dbuf_copy(c->infile, pos, count*bytes_per_pixel, unc_pixels);
			pos += count*bytes_per_pixel;
			pixel_count += count;
		}
		else { // compressed run
			i64 k;
			u8 pixel_buf[4];

			count = 1+(i64)b;
			de_read(pixel_buf, pos, bytes_per_pixel);
			pos += bytes_per_pixel;
			for(k=0; k<count; k++) {
				dbuf_write(unc_pixels, pixel_buf, bytes_per_pixel);
			}
			pixel_count += count;
		}
	}

	dbuf_flush(unc_pixels);
	de_dbg(c, "decompressed %"I64_FMT" bytes to %"I64_FMT, (pos - pos1), unc_pixels->len);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpq -0x28(%rbp), %rax
jl 0x13866f
jmp 0x138776
movq -0x38(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x18(%rcx), %rcx
cmpq 0x18(%rcx), %rax
jle 0x138698
movq -0x8(%rbp), %rdi
leaq 0x66733(%rip), %rsi     # 0x19edbf
movb $0x0, %al
callq 0x15bc10
jmp 0x138776
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x38(%rbp), %rsi
callq 0x165170
movb %al, -0x41(%rbp)
movzbl -0x41(%rbp), %eax
cmpl $0x80, %eax
jl 0x138703
movzbl -0x41(%rbp), %eax
subl $0x80, %eax
cltq
movq %rax, -0x50(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x38(%rbp), %rsi
movq -0x50(%rbp), %rdx
imulq -0x30(%rbp), %rdx
movq -0x20(%rbp), %rcx
callq 0x166070
movq -0x50(%rbp), %rax
imulq -0x30(%rbp), %rax
addq -0x38(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x50(%rbp), %rax
addq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
jmp 0x138771
movzbl -0x41(%rbp), %eax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x5c(%rbp), %rsi
movq -0x38(%rbp), %rdx
movq -0x30(%rbp), %rcx
callq 0x164d10
movq -0x30(%rbp), %rax
addq -0x38(%rbp), %rax
movq %rax, -0x38(%rbp)
movq $0x0, -0x58(%rbp)
movq -0x58(%rbp), %rax
cmpq -0x50(%rbp), %rax
jge 0x138765
movq -0x20(%rbp), %rdi
leaq -0x5c(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x166170
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0x13873c
movq -0x50(%rbp), %rax
addq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
jmp 0x138660
movq -0x20(%rbp), %rdi
callq 0x167c30
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rdx
subq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rcx
leaq 0x665a9(%rip), %rsi     # 0x19ed43
movb $0x0, %al
callq 0x15b0d0
addq $0x60, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
leaq 0x93c2c(%rip), %rcx     # 0x1cc3f3
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
leaq 0x93c22(%rip), %rcx     # 0x1cc3f7
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
leaq 0x1c(%rip), %rcx        # 0x138800
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
leaq 0x7d(%rip), %rcx        # 0x138870
movq %rcx, 0x20(%rax)
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/wad.c
// Function: de_run_wad
static void de_run_wad(deark *c, de_module_params *mparams)
{
	lctx *d = NULL;

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

	if(!do_header(c, d, 0)) goto done;

	do_directory(c, d, d->dir_pos);

done:
	de_free(c, d);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movl $0x10, %esi
callq 0x15b780
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x1388e0
cmpl $0x0, %eax
jne 0x138842
jmp 0x138857
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdx
callq 0x1389b0
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x15b820
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/wad.c
// Function: de_identify_wad
static int de_identify_wad(deark *c)
{
	if(!dbuf_memcmp(c->infile, 1, "WAD", 3)) {
		u8 b0;
		b0 = de_getbyte(0);
		if(b0=='I' || b0=='P') return 80;
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0x1, %esi
leaq 0x93b6c(%rip), %rdx     # 0x1cc3fc
movl $0x3, %ecx
callq 0x166ab0
cmpl $0x0, %eax
jne 0x1388d0
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x165060
movb %al, -0x11(%rbp)
movzbl -0x11(%rbp), %eax
cmpl $0x49, %eax
je 0x1388c5
movzbl -0x11(%rbp), %eax
cmpl $0x50, %eax
jne 0x1388ce
movl $0x50, -0x4(%rbp)
jmp 0x1388d7
jmp 0x1388d0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/wad.c
// Function: do_header
static int do_header(deark *c, lctx *d, i64 pos)
{
	de_dbg(c, "header at %d", (int)pos);
	de_dbg_indent(c, 1);
	d->nlumps = de_getu32le(pos+4);
	de_dbg(c, "#lumps: %d", (int)d->nlumps);
	d->dir_pos = de_getu32le(pos+8);
	de_dbg(c, "dir pos: %d", (int)d->dir_pos);
	de_dbg_indent(c, -1);
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %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 0x8c689(%rip), %rsi     # 0x1c4f8e
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
addq $0x4, %rsi
callq 0x165540
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl %eax, %edx
leaq 0x93ab3(%rip), %rsi     # 0x1cc400
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
addq $0x8, %rsi
callq 0x165540
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movl %eax, %edx
leaq 0x93a82(%rip), %rsi     # 0x1cc40b
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
movl $0x1, %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/wad.c
// Function: do_directory
static int do_directory(deark *c, lctx *d, i64 pos)
{
	i64 k;
	de_dbg(c, "directory at %d", (int)pos);
	de_dbg_indent(c, 1);

	if(pos<0 || pos>=c->infile->len) goto done;
	if(d->nlumps<1 || d->nlumps>10000) goto done;

	for(k=0; k<d->nlumps; k++) {
		if(pos+16*k > c->infile->len-16) break;
		do_lump_entry(c, d, k, pos+16*k);
	}

done:
	de_dbg_indent(c, -1);
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %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 0x93a42(%rip), %rsi     # 0x1cc417
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
cmpq $0x0, -0x18(%rbp)
jl 0x138a03
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x18(%rcx), %rcx
cmpq 0x18(%rcx), %rax
jl 0x138a08
jmp 0x138a8c
movq -0x10(%rbp), %rax
cmpq $0x1, (%rax)
jl 0x138a1f
movq -0x10(%rbp), %rax
cmpq $0x2710, (%rax)         # imm = 0x2710
jle 0x138a21
jmp 0x138a8c
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq (%rcx), %rax
jge 0x138a8a
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq -0x8(%rbp), %rcx
movq 0x18(%rcx), %rcx
movq 0x18(%rcx), %rcx
subq $0x10, %rcx
cmpq %rcx, %rax
jle 0x138a5c
jmp 0x138a8a
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rcx
callq 0x138ab0
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x138a29
jmp 0x138a8c
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
movl $0x1, %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/wad.c
// Function: do_lump_entry
static void do_lump_entry(deark *c, lctx *d, i64 lump_idx, i64 pos)
{
	i64 lump_pos;
	i64 lump_size;
	struct de_stringreaderdata *srd = NULL;

	de_dbg(c, "lump[%d] dir entry at %d", (int)lump_idx, (int)pos);
	de_dbg_indent(c, 1);
	lump_pos = de_getu32le(pos);
	de_dbg(c, "data pos: %d", (int)lump_pos);
	lump_size = de_getu32le(pos+4);
	de_dbg(c, "data size: %d", (int)lump_size);

	// dbuf_read_string is used (instead of dbuf_read_to_ucstring) because
	// the names have special meanings, so someday we might want to run
	// comparisons against them. But currently we don't do that.
	srd = dbuf_read_string(c->infile, pos+8, 8, 8, DE_CONVFLAG_STOP_AT_NUL, DE_ENCODING_ASCII);
	de_dbg(c, "name: \"%s\"", ucstring_getpsz_d(srd->str));

	do_lump_extract(c, d, lump_pos, lump_size, srd);

	de_dbg_indent(c, -1);
	de_destroy_stringreaderdata(c, srd);
}

// 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, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movl %eax, %edx
movq -0x20(%rbp), %rax
movl %eax, %ecx
leaq 0x93940(%rip), %rsi     # 0x1cc427
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x165540
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movl %eax, %edx
leaq 0x66f89(%rip), %rsi     # 0x19faab
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
addq $0x4, %rsi
callq 0x165540
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rax
movl %eax, %edx
leaq 0x65f26(%rip), %rsi     # 0x19ea79
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
addq $0x8, %rsi
movl $0x8, %ecx
movl $0x1, %r9d
movq %rcx, %rdx
movl %r9d, %r8d
callq 0x1664c0
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x172650
movq -0x40(%rbp), %rdi
movq %rax, %rdx
leaq 0x75629(%rip), %rsi     # 0x1ae1d0
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x30(%rbp), %rcx
movq -0x38(%rbp), %r8
callq 0x138bf0
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x166830
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/wad.c
// Function: do_lump_extract
static void do_lump_extract(deark *c, lctx *d, i64 dpos, i64 dlen, struct de_stringreaderdata *srd)
{
	de_finfo *fi = NULL;

	// 0-length lumps are assumed to be special "virtual" lumps.
	if(dlen<=0) return;
	if(dpos<0 || dpos>=c->infile->len || dpos+dlen>c->infile->len) return;

	fi = de_finfo_create(c);
	de_finfo_set_name_from_ucstring(c, fi, srd->str, 0);
	fi->original_filename_flag = 1;
	dbuf_create_file_from_slice(c->infile, dpos, dlen, NULL, fi, 0);
	de_finfo_destroy(c, fi);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
cmpq $0x0, -0x20(%rbp)
jg 0x138c20
jmp 0x138caa
cmpq $0x0, -0x18(%rbp)
jl 0x138c4f
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x18(%rcx), %rcx
cmpq 0x18(%rcx), %rax
jge 0x138c4f
movq -0x18(%rbp), %rax
addq -0x20(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x18(%rcx), %rcx
cmpq 0x18(%rcx), %rax
jle 0x138c51
jmp 0x138caa
movq -0x8(%rbp), %rdi
callq 0x15d230
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rdx
xorl %ecx, %ecx
callq 0x15d2c0
movq -0x30(%rbp), %rax
movb $0x1, 0x8(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x30(%rbp), %r8
xorl %eax, %eax
movl %eax, %ecx
xorl %r9d, %r9d
callq 0x166be0
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x15d260
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
leaq 0x6f48c(%rip), %rcx     # 0x1a8153
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
leaq 0x6e0f9(%rip), %rcx     # 0x1a6dce
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
leaq 0x6e0fb(%rip), %rcx     # 0x1a6ddf
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rax
leaq 0x1d(%rip), %rcx        # 0x138d10
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
leaq 0x14e(%rip), %rcx       # 0x138e50
movq %rcx, 0x20(%rax)
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/wmf.c
// Function: de_run_wmf
static void de_run_wmf(deark *c, de_module_params *mparams)
{
	lctx *d = NULL;
	i64 pos = 0;

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

	d->input_encoding = de_get_input_encoding(c, NULL, DE_ENCODING_WINDOWS1252);

	if(!dbuf_memcmp(c->infile, 0, "\xd7\xcd\xc6\x9a", 4)) {
		d->has_aldus_header = 1;
		de_declare_fmt(c, "WMF (placeable)");
	}
	else {
		de_declare_fmt(c, "WMF (non-placeable)");
	}

	if(d->has_aldus_header) {
		do_read_aldus_header(c, d);
		pos = 22;
	}

	if(!do_read_wmf_header(c, d, pos)) {
		goto done;
	}
	pos += 18;

	do_wmf_record_list(c, d, pos);

done:
	if(d) {
		if(d->embedded_emf) dbuf_close(d->embedded_emf);
		de_free(c, d->object_table);
		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 $0x0, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movl $0x30, %esi
callq 0x15b780
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x9, %edx
callq 0x15e4a0
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
leaq 0x936d0(%rip), %rdx     # 0x1cc440
movl $0x4, %ecx
callq 0x166ab0
cmpl $0x0, %eax
jne 0x138d9b
movq -0x18(%rbp), %rax
movl $0x1, (%rax)
movq -0x8(%rbp), %rdi
leaq 0x936b1(%rip), %rsi     # 0x1cc445
callq 0x15e380
jmp 0x138dab
movq -0x8(%rbp), %rdi
leaq 0x936af(%rip), %rsi     # 0x1cc455
callq 0x15e380
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x138dc9
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x138f90
movq $0x16, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x139090
cmpl $0x0, %eax
jne 0x138de1
jmp 0x138dfe
movq -0x20(%rbp), %rax
addq $0x12, %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x1392f0
cmpq $0x0, -0x18(%rbp)
je 0x138e3b
movq -0x18(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x138e1d
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x1676a0
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rsi
callq 0x15b820
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/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x165280
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0x2, %esi
callq 0x165280
movl %eax, -0x18(%rbp)
cmpl $0xcdd7, -0x14(%rbp)    # imm = 0xCDD7
jne 0x138ea3
cmpl $0x9ac6, -0x18(%rbp)    # imm = 0x9AC6
jne 0x138ea3
movl $0x64, -0x4(%rbp)
jmp 0x138f86
cmpl $0x9, -0x18(%rbp)
je 0x138eb5
movl $0x0, -0x4(%rbp)
jmp 0x138f86
cmpl $0x1, -0x14(%rbp)
je 0x138ecd
cmpl $0x2, -0x14(%rbp)
je 0x138ecd
movl $0x0, -0x4(%rbp)
jmp 0x138f86
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0x4, %esi
callq 0x165280
movl %eax, -0x1c(%rbp)
cmpl $0x100, -0x1c(%rbp)     # imm = 0x100
je 0x138f00
cmpl $0x300, -0x1c(%rbp)     # imm = 0x300
je 0x138f00
movl $0x0, -0x4(%rbp)
jmp 0x138f86
movq -0x10(%rbp), %rdi
leaq 0x6f248(%rip), %rsi     # 0x1a8153
callq 0x15d180
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x138f22
movl $0x5f, -0x4(%rbp)
jmp 0x138f86
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0x6, %esi
callq 0x165540
shlq %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x18(%rcx), %rcx
cmpq 0x18(%rcx), %rax
jg 0x138f54
cmpq $0x14, -0x28(%rbp)
jge 0x138f5d
movl $0x0, -0x4(%rbp)
jmp 0x138f86
movq -0x28(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x18(%rcx), %rcx
movq 0x18(%rcx), %rcx
subq $0x8, %rcx
cmpq %rcx, %rax
jl 0x138f7f
movl $0x46, -0x4(%rbp)
jmp 0x138f86
movl $0xe, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/wmf.c
// Function: do_read_aldus_header
static void do_read_aldus_header(deark *c, lctx *d)
{
	i64 left, top, right, bottom;
	i64 units_per_inch;

	de_dbg(c, "Aldus Placeable Metafile header at 0");
	de_dbg_indent(c, 1);
	left = de_geti16le(6);
	top = de_geti16le(8);
	right = de_geti16le(10);
	bottom = de_geti16le(12);
	de_dbg(c, "location: (%d,%d) - (%d,%d)", (int)left, (int)top,
		(int)right, (int)bottom);
	units_per_inch = de_getu16le(14);
	de_dbg(c, "metafile units per inch: %d", (int)units_per_inch);
	de_dbg_indent(c, -1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x934be(%rip), %rsi     # 0x1cc469
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0x6, %esi
callq 0x165360
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0x8, %esi
callq 0x165360
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0xa, %esi
callq 0x165360
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0xc, %esi
callq 0x165360
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movl %eax, %edx
movq -0x20(%rbp), %rax
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %eax, %r8d
movq -0x30(%rbp), %rax
movl %eax, %r9d
leaq 0x93451(%rip), %rsi     # 0x1cc48e
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0xe, %esi
callq 0x165280
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rax
movl %eax, %edx
leaq 0x9343f(%rip), %rsi     # 0x1cc4aa
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/wmf.c
// Function: do_wmf_record_list
static void do_wmf_record_list(deark *c, lctx *d, i64 pos)
{
	i64 recpos;
	i64 recsize_words, recsize_bytes;
	i64 count;

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

	count = 0;
	while(1) {
		recpos = pos;
		if(recpos >= c->infile->len) break; // Unexpected EOF

		recsize_words = de_getu32le(recpos);
		recsize_bytes = recsize_words*2;
		if(recpos + recsize_bytes > c->infile->len) break; // Unexpected EOF
		if(recsize_bytes < 6) break; // Invalid size

		if(!do_wmf_record(c, d, count, recpos, recsize_bytes)) {
			break;
		}

		pos += recsize_bytes;
		count++;
	}

	de_dbg_indent(c, -1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %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 0x87d18(%rip), %rsi     # 0x1c102d
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq $0x0, -0x38(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x18(%rcx), %rcx
cmpq 0x18(%rcx), %rax
jl 0x13934e
jmp 0x1393cc
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x165540
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
shlq %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
addq -0x30(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x18(%rcx), %rcx
cmpq 0x18(%rcx), %rax
jle 0x139386
jmp 0x1393cc
cmpq $0x6, -0x30(%rbp)
jge 0x13938f
jmp 0x1393cc
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x38(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x30(%rbp), %r8
callq 0x1393e0
cmpl $0x0, %eax
jne 0x1393af
jmp 0x1393cc
movq -0x30(%rbp), %rax
addq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x139332
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
addq $0x40, %rsp
popq %rbp
retq