LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/drhalo.c
// Function: get_pic_modeinfo
static const struct pic_modeinfo_item *get_pic_modeinfo(UI board_id, UI mode_id)
{
	size_t i;

	for(i=0; i<DE_ARRAYCOUNT(pic_modeinfo_arr); i++) {
		const struct pic_modeinfo_item *m = &pic_modeinfo_arr[i];

		if((UI)m->board_id!=board_id) continue;
		if(m->hdrlen>=12) {
			if((UI)m->mode_id!=mode_id) continue;
		}
		return m;
	}
	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0xc(%rbp)
movl %esi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
cmpq $0x10, -0x18(%rbp)
jae 0x58b00
leaq 0x14dae0(%rip), %rax    # 0x1a6590
imulq $0x18, -0x18(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movzwl (%rax), %eax
cmpl -0xc(%rbp), %eax
je 0x58aca
jmp 0x58af2
movq -0x20(%rbp), %rax
movzwl 0xc(%rax), %eax
cmpl $0xc, %eax
jl 0x58ae8
movq -0x20(%rbp), %rax
movzwl 0x2(%rax), %eax
cmpl -0x10(%rbp), %eax
je 0x58ae6
jmp 0x58af2
jmp 0x58ae8
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x58b08
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x58aa2
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/drhalo.c
// Function: set_pic_mode_name
static void set_pic_mode_name(deark *c, lctx *d)
{
	const char *m1;

	switch(d->modeinfo->board_id) {
	case 0x01: m1="CGA"; break;
	case 0x07: m1="Hercules"; break;
	case 0x15: m1="EGA"; break;
	case 0x3c: case 0x47: m1="VGA"; break;
	default: m1="?";
	}

	de_snprintf(d->modename, sizeof(d->modename), "%s %u" DE_CHAR_TIMES "%u %d-color", m1,
		(UI)d->modeinfo->width, (UI)d->modeinfo->height,
		(int)d->ncolors);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x438(%rax), %rax
movzwl (%rax), %eax
movl %eax, -0x1c(%rbp)
subl $0x1, %eax
je 0x58b60
jmp 0x58b38
movl -0x1c(%rbp), %eax
subl $0x7, %eax
je 0x58b6d
jmp 0x58b42
movl -0x1c(%rbp), %eax
subl $0x15, %eax
je 0x58b7a
jmp 0x58b4c
movl -0x1c(%rbp), %eax
subl $0x3c, %eax
je 0x58b87
jmp 0x58b56
movl -0x1c(%rbp), %eax
subl $0x47, %eax
je 0x58b87
jmp 0x58b94
leaq 0x168b73(%rip), %rax    # 0x1c16da
movq %rax, -0x18(%rbp)
jmp 0x58b9f
leaq 0x14d9e9(%rip), %rax    # 0x1a655d
movq %rax, -0x18(%rbp)
jmp 0x58b9f
leaq 0x14d9e5(%rip), %rax    # 0x1a6566
movq %rax, -0x18(%rbp)
jmp 0x58b9f
leaq 0x168b8e(%rip), %rax    # 0x1c171c
movq %rax, -0x18(%rbp)
jmp 0x58b9f
leaq 0x15f092(%rip), %rax    # 0x1b7c2d
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
addq $0x440, %rdi            # imm = 0x440
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq 0x438(%rax), %rax
movzwl 0x4(%rax), %r8d
movq -0x10(%rbp), %rax
movq 0x438(%rax), %rax
movzwl 0x6(%rax), %r9d
movq -0x10(%rbp), %rax
movq 0x428(%rax), %rax
movl $0x32, %esi
leaq 0x14d985(%rip), %rdx    # 0x1a656a
movl %eax, (%rsp)
movb $0x0, %al
callq 0x15a980
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/drhalo.c
// Function: make_stdpal_256col
static void make_stdpal_256col(deark *c, lctx *d)
{
	UI i;
	static const u8 samples8[8] = {
		0, 35, 67, 99, 131, 163, 195, 227 };
	static const u8 samples4[4] = { 0, 67, 131, 195 };

	for(i=0; i<256; i++) {
		u8 r, g, b;

		r = samples8[i%8];
		g = samples8[(i%64)/8];
		b = samples4[i/64];
		d->pal[i] = DE_MAKE_RGB(r, g, b);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
cmpl $0x100, -0x14(%rbp)     # imm = 0x100
jae 0x58c99
movl -0x14(%rbp), %eax
andl $0x7, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x14dae3(%rip), %rax    # 0x1a6710
movb (%rax,%rcx), %al
movb %al, -0x15(%rbp)
movl -0x14(%rbp), %eax
andl $0x3f, %eax
shrl $0x3, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x14dac9(%rip), %rax    # 0x1a6710
movb (%rax,%rcx), %al
movb %al, -0x16(%rbp)
movl -0x14(%rbp), %eax
shrl $0x6, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x14daba(%rip), %rax    # 0x1a6718
movb (%rax,%rcx), %al
movb %al, -0x17(%rbp)
movzbl -0x15(%rbp), %edx
shll $0x10, %edx
orl $0xff000000, %edx       # imm = 0xFF000000
movzbl -0x16(%rbp), %eax
shll $0x8, %eax
orl %eax, %edx
movzbl -0x17(%rbp), %eax
orl %eax, %edx
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
movl %edx, 0x18(%rax,%rcx,4)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x58c13
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/drhalo.c
// Function: do_decompress_pic
static int do_decompress_pic(deark *c, lctx *d, dbuf *unc_pixels)
{
	i64 pn;
	i64 pos;

	pos = (i64)d->modeinfo->hdrlen;
	for(pn=0; pn<(i64)d->modeinfo->nplanes; pn++) {
		i64 old_unc_pixels_len;

		dbuf_truncate(unc_pixels, pn * (i64)d->modeinfo->nominal_bytes_per_plane);

		de_dbg(c, "plane[%u] at %"I64_FMT, (UI)pn, pos);
		de_dbg_indent(c, 1);
		old_unc_pixels_len = unc_pixels->len;
		do_decompress_pic_plane(c, d, pos, c->infile->len-pos, unc_pixels);

		de_dbg(c, "decompressed %"I64_FMT" bytes to %"I64_FMT" bytes",
			d->dcmpr_endpos - pos, unc_pixels->len - old_unc_pixels_len);
		de_dbg_indent(c, -1);

		pos = d->dcmpr_endpos;
	}

	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x438(%rax), %rax
movzwl 0xc(%rax), %eax
movq %rax, -0x28(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x438(%rcx), %rcx
movzwl 0x8(%rcx), %ecx
cmpq %rcx, %rax
jge 0x58dc0
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x10(%rbp), %rax
movq 0x438(%rax), %rax
movl 0x10(%rax), %eax
imulq %rax, %rsi
callq 0x168900
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl %eax, %edx
movq -0x28(%rbp), %rcx
leaq 0x14d85e(%rip), %rsi    # 0x1a657d
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x18(%rax), %rcx
subq -0x28(%rbp), %rcx
movq -0x18(%rbp), %r8
callq 0x59100
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x430(%rax), %rdx
subq -0x28(%rbp), %rdx
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rcx
subq -0x30(%rbp), %rcx
leaq 0x14d658(%rip), %rsi    # 0x1a63e3
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
movq -0x10(%rbp), %rax
movq 0x430(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x58ccf
movl $0x1, %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/drhalo.c
// Function: deinterlace_pic_16k
static void deinterlace_pic_16k(deark *c, lctx *d, dbuf *unc_pixels)
{
	dbuf *tmpdbuf = NULL;
	i64 i;

	tmpdbuf = dbuf_create_membuf(c, unc_pixels->len, 0);
	dbuf_copy(unc_pixels, 0, unc_pixels->len, tmpdbuf);

	dbuf_truncate(unc_pixels, 0);

	for(i=0; i<200; i++) {
		i64 spos;

		spos = (i/2)*80 + (i%2)*8192;
		dbuf_copy(tmpdbuf, spos, 80, unc_pixels);

	}

	dbuf_close(tmpdbuf);
}

// 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)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rsi
xorl %edx, %edx
callq 0x168020
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdx
movq -0x20(%rbp), %rcx
xorl %eax, %eax
movl %eax, %esi
callq 0x166070
movq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x168900
movq $0x0, -0x28(%rbp)
cmpq $0xc8, -0x28(%rbp)
jge 0x58e92
movq -0x28(%rbp), %rax
movl $0x2, %ecx
cqto
idivq %rcx
imulq $0x50, %rax, %rax
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rax
movl $0x2, %ecx
cqto
idivq %rcx
movq -0x38(%rbp), %rax
shlq $0xd, %rdx
addq %rdx, %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x18(%rbp), %rcx
movl $0x50, %edx
callq 0x166070
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x58e31
movq -0x20(%rbp), %rdi
callq 0x1676a0
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/drhalo.c
// Function: deinterlace_pic_hercules
static void deinterlace_pic_hercules(deark *c, lctx *d, dbuf *unc_pixels)
{
	dbuf *tmpdbuf = NULL;
	i64 i;

	tmpdbuf = dbuf_create_membuf(c, unc_pixels->len, 0);
	dbuf_copy(unc_pixels, 0, unc_pixels->len, tmpdbuf);
	dbuf_truncate(unc_pixels, 0);

	for(i=0; i<348; i++) {
		i64 spos;

		spos = (i/4)*90 + (i%4)*8192;
		dbuf_copy(tmpdbuf, spos, 90, unc_pixels);
	}

	dbuf_close(tmpdbuf);
}

// 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)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rsi
xorl %edx, %edx
callq 0x168020
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdx
movq -0x20(%rbp), %rcx
xorl %eax, %eax
movl %eax, %esi
callq 0x166070
movq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x168900
movq $0x0, -0x28(%rbp)
cmpq $0x15c, -0x28(%rbp)     # imm = 0x15C
jge 0x58f72
movq -0x28(%rbp), %rax
movl $0x4, %ecx
cqto
idivq %rcx
imulq $0x5a, %rax, %rax
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rax
movl $0x4, %ecx
cqto
idivq %rcx
movq -0x38(%rbp), %rax
shlq $0xd, %rdx
addq %rdx, %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x18(%rbp), %rcx
movl $0x5a, %edx
callq 0x166070
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x58f11
movq -0x20(%rbp), %rdi
callq 0x1676a0
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/drhalo.c
// Function: pic_set_density
static void pic_set_density(deark *c, lctx *d, de_finfo *fi)
{
	u16 w = d->modeinfo->width;
	u16 h = d->modeinfo->height;

	if(w==320 && h==200) {
		fi->density.code = DE_DENSITY_UNK_UNITS;
		fi->density.xdens = 240.0;
		fi->density.ydens = 200.0;
	}
	else if(w==640 && h==350) {
		fi->density.code = DE_DENSITY_UNK_UNITS;
		fi->density.xdens = 480.0;
		fi->density.ydens = 350.0;
	}
	else if(w==640 && h==200) {
		fi->density.code = DE_DENSITY_UNK_UNITS;
		fi->density.xdens = 480.0;
		fi->density.ydens = 200.0;
	}
	else if(w==720 && h==348) {
		fi->density.code = DE_DENSITY_UNK_UNITS;
		fi->density.xdens = 155.0;
		fi->density.ydens = 100.0;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x438(%rax), %rax
movw 0x4(%rax), %ax
movw %ax, -0x1a(%rbp)
movq -0x10(%rbp), %rax
movq 0x438(%rax), %rax
movw 0x6(%rax), %ax
movw %ax, -0x1c(%rbp)
movzwl -0x1a(%rbp), %eax
cmpl $0x140, %eax            # imm = 0x140
jne 0x59014
movzwl -0x1c(%rbp), %eax
cmpl $0xc8, %eax
jne 0x59014
movq -0x18(%rbp), %rax
movl $0x1, 0x78(%rax)
movq -0x18(%rbp), %rax
movsd 0x146305(%rip), %xmm0   # 0x19f2f8
movsd %xmm0, 0x80(%rax)
movq -0x18(%rbp), %rax
movsd 0x146311(%rip), %xmm0   # 0x19f318
movsd %xmm0, 0x88(%rax)
jmp 0x590fc
movzwl -0x1a(%rbp), %eax
cmpl $0x280, %eax            # imm = 0x280
jne 0x59062
movzwl -0x1c(%rbp), %eax
cmpl $0x15e, %eax            # imm = 0x15E
jne 0x59062
movq -0x18(%rbp), %rax
movl $0x1, 0x78(%rax)
movq -0x18(%rbp), %rax
movsd 0x14d297(%rip), %xmm0   # 0x1a62d8
movsd %xmm0, 0x80(%rax)
movq -0x18(%rbp), %rax
movsd 0x14d28b(%rip), %xmm0   # 0x1a62e0
movsd %xmm0, 0x88(%rax)
jmp 0x590fa
movzwl -0x1a(%rbp), %eax
cmpl $0x280, %eax            # imm = 0x280
jne 0x590ad
movzwl -0x1c(%rbp), %eax
cmpl $0xc8, %eax
jne 0x590ad
movq -0x18(%rbp), %rax
movl $0x1, 0x78(%rax)
movq -0x18(%rbp), %rax
movsd 0x14d249(%rip), %xmm0   # 0x1a62d8
movsd %xmm0, 0x80(%rax)
movq -0x18(%rbp), %rax
movsd 0x146275(%rip), %xmm0   # 0x19f318
movsd %xmm0, 0x88(%rax)
jmp 0x590f8
movzwl -0x1a(%rbp), %eax
cmpl $0x2d0, %eax            # imm = 0x2D0
jne 0x590f6
movzwl -0x1c(%rbp), %eax
cmpl $0x15c, %eax            # imm = 0x15C
jne 0x590f6
movq -0x18(%rbp), %rax
movl $0x1, 0x78(%rax)
movq -0x18(%rbp), %rax
movsd 0x14d1f6(%rip), %xmm0   # 0x1a62d0
movsd %xmm0, 0x80(%rax)
movq -0x18(%rbp), %rax
movsd 0x14d1da(%rip), %xmm0   # 0x1a62c8
movsd %xmm0, 0x88(%rax)
jmp 0x590f8
jmp 0x590fa
jmp 0x590fc
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/drhalo.c
// Function: do_decompress_pic_plane
static int do_decompress_pic_plane(deark *c, lctx *d,
	i64 pos1, i64 len, dbuf *unc_pixels)
{
	u8 b, b2;
	i64 count;
	i64 pos = pos1;

	dbuf_enable_wbuffer(unc_pixels);
	while(1) {
		if((pos-pos1) >= len) break;

		b = de_getbyte_p(&pos);

		if(b==0x00) {
			pos = de_pad_to_n(pos, 512);
			break;
		}
		if(b==0x80) {
			pos = de_pad_to_n(pos, 512);
			continue;
		}

		if(b & 0x80) { // RLE block
			count = (i64)(b - 0x80);
			b2 = de_getbyte_p(&pos);
			dbuf_write_run(unc_pixels, b2, count);
		}
		else { // uncompressed block
			count = (i64)b;
			dbuf_copy(c->infile, pos, count, unc_pixels);
			pos += count;
		}
	}

	dbuf_disable_wbuffer(unc_pixels);
	d->dcmpr_endpos = pos;
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x28(%rbp), %rdi
callq 0x167b90
movq -0x40(%rbp), %rax
subq -0x18(%rbp), %rax
cmpq -0x20(%rbp), %rax
jl 0x59140
jmp 0x5920b
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x40(%rbp), %rsi
callq 0x165170
movb %al, -0x29(%rbp)
movzbl -0x29(%rbp), %eax
cmpl $0x0, %eax
jne 0x59174
movq -0x40(%rbp), %rdi
movl $0x200, %esi            # imm = 0x200
callq 0x15ce90
movq %rax, -0x40(%rbp)
jmp 0x5920b
movzbl -0x29(%rbp), %eax
cmpl $0x80, %eax
jne 0x59193
movq -0x40(%rbp), %rdi
movl $0x200, %esi            # imm = 0x200
callq 0x15ce90
movq %rax, -0x40(%rbp)
jmp 0x5912d
movzbl -0x29(%rbp), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x591d9
movzbl -0x29(%rbp), %eax
subl $0x80, %eax
cltq
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x40(%rbp), %rsi
callq 0x165170
movb %al, -0x2a(%rbp)
movq -0x28(%rbp), %rdi
movb -0x2a(%rbp), %al
movq -0x38(%rbp), %rdx
movzbl %al, %esi
callq 0x168800
jmp 0x59206
movzbl -0x29(%rbp), %eax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x40(%rbp), %rsi
movq -0x38(%rbp), %rdx
movq -0x28(%rbp), %rcx
callq 0x166070
movq -0x38(%rbp), %rax
addq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
jmp 0x5912d
movq -0x28(%rbp), %rdi
callq 0x167be0
movq -0x40(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x430(%rax)
movl $0x1, %eax
addq $0x40, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/ebml.c
// Function: de_module_ebml
void de_module_ebml(deark *c, struct deark_module_info *mi)
{
	mi->id = "ebml";
	mi->desc = "EBML";
	mi->run_fn = de_run_ebml;
	mi->identify_fn = de_identify_ebml;
	mi->help_fn = de_help_ebml;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
leaq 0x14d521(%rip), %rcx    # 0x1a6768
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
leaq 0x14d518(%rip), %rcx    # 0x1a676d
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
leaq 0x2c(%rip), %rcx        # 0x59290
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
leaq 0xbd(%rip), %rcx        # 0x59330
movq %rcx, 0x20(%rax)
movq -0x10(%rbp), %rax
leaq 0xfe(%rip), %rcx        # 0x59380
movq %rcx, 0x28(%rax)
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/ebml.c
// Function: de_run_ebml
static void de_run_ebml(deark *c, de_module_params *mparams)
{
	lctx *d = NULL;
	i64 pos;

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

	if(de_get_ext_option(c, "ebml:encodedid")) {
		d->show_encoded_id = 1;
	}

	pos = 0;
	do_element_sequence(c, d, pos, c->infile->len);

	if(d) {
		destroy_attachment_data(c, d);
		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
leaq 0x14d4ad(%rip), %rsi    # 0x1a6772
callq 0x15cb30
cmpq $0x0, %rax
je 0x592db
movq -0x18(%rbp), %rax
movl $0x1, 0x4(%rax)
movq $0x0, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x18(%rax), %rcx
callq 0x593b0
cmpq $0x0, -0x18(%rbp)
je 0x59321
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x594c0
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/ebml.c
// Function: do_element_sequence
static int do_element_sequence(deark *c, lctx *d, i64 pos1, i64 len)
{
	int ret;
	int retval = 0;
	i64 pos = pos1;
	int saved_indent_level;

	// TODO:
	// From the EBML spec:
	// "data that is not part of an EBML Element is permitted to be present
	// within a Master Element if unknownsizeallowed is enabled within the
	// definition for that Master Element. In this case, the EBML Reader
	// should skip data until a valid Element ID of the same EBMLParentPath or
	// the next upper level Element Path of the Master Element is found."
	//
	// We do not support this. We can't even detect it, so our parser will go
	// off the rails. How do you even support it efficiently? What kind of
	// psychopath designs a format like this? It's incredibly fragile (a new
	// format version that defines a new optional element will completely
	// break backward compatibility), and its abstractions are leaking all
	// over the place.

	d->level++;
	de_dbg_indent_save(c, &saved_indent_level);
	if(d->level > 16) goto done;
	if(len==0) { retval = 1; goto done; }

	de_dbg(c, "element sequence at %"I64_FMT", max_len=%"I64_FMT, pos1, len);
	de_dbg_indent(c, 1);

	while(1) {
		i64 ele_len = 0;
		if(pos >= pos1+len) {
			break;
		}
		ret = do_element(c, d, pos, pos1+len-pos, &ele_len);
		if(!ret) goto done;
		if(ele_len<1) goto done;

		pos += ele_len;
	}
	retval = 1;

done:
	de_dbg_indent_restore(c, saved_indent_level);
	d->level--;
	return retval;
}

// 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)
movl $0x0, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq -0x8(%rbp), %rdi
leaq -0x34(%rbp), %rsi
callq 0x15b580
movq -0x10(%rbp), %rax
cmpl $0x10, (%rax)
jle 0x593fd
jmp 0x5949d
cmpq $0x0, -0x20(%rbp)
jne 0x59410
movl $0x1, -0x28(%rbp)
jmp 0x5949d
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
leaq 0x14d35e(%rip), %rsi    # 0x1a6781
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq $0x0, -0x40(%rbp)
movq -0x30(%rbp), %rax
movq -0x18(%rbp), %rcx
addq -0x20(%rbp), %rcx
cmpq %rcx, %rax
jl 0x59453
jmp 0x59496
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x18(%rbp), %rcx
addq -0x20(%rbp), %rcx
subq -0x30(%rbp), %rcx
leaq -0x40(%rbp), %r8
callq 0x59510
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jne 0x5947f
jmp 0x5949d
cmpq $0x1, -0x40(%rbp)
jge 0x59488
jmp 0x5949d
movq -0x40(%rbp), %rax
addq -0x30(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x59438
movl $0x1, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movl -0x34(%rbp), %esi
callq 0x15b5a0
movq -0x10(%rbp), %rax
movl (%rax), %ecx
addl $-0x1, %ecx
movl %ecx, (%rax)
movl -0x28(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/ebml.c
// Function: destroy_attachment_data
static void destroy_attachment_data(deark *c, lctx *d)
{
	if(!d->attachmentctx) return;
	ucstring_destroy(d->attachmentctx->filename);
	de_free(c, d->attachmentctx);
	d->attachmentctx = NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x594dd
jmp 0x5950a
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rdi
callq 0x171750
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x15b820
movq -0x10(%rbp), %rax
movq $0x0, 0x8(%rax)
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/ebml.c
// Function: find_ele_id_info
static const struct ele_id_info *find_ele_id_info(i64 ele_id)
{
	size_t k;
	for(k=0; k<DE_ARRAYCOUNT(ele_id_info_arr); k++) {
		if(ele_id_info_arr[k].ele_id == ele_id) {
			return &ele_id_info_arr[k];
		}
	}
	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
cmpq $0x6c, -0x18(%rbp)
jae 0x59bdb
movq -0x18(%rbp), %rcx
leaq 0x1bbffe(%rip), %rax    # 0x215ba0
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
cmpq -0x10(%rbp), %rax
jne 0x59bcb
movq -0x18(%rbp), %rcx
leaq 0x1bbfe2(%rip), %rax    # 0x215ba0
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x8(%rbp)
jmp 0x59be3
jmp 0x59bcd
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x59b90
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/ebml.c
// Function: print_encoded_id
static void print_encoded_id(deark *c, lctx *d, i64 pos, i64 len)
{
	de_ucstring *s = NULL;
	i64 i;

	if(len>8) return;
	s = ucstring_create(c);
	for(i=0; i<len; i++) {
		ucstring_printf(s, DE_ENCODING_LATIN1, "[%02x]",
			(unsigned int)de_getbyte(pos+i));
	}
	de_dbg(c, "encoded id: %s", ucstring_getpsz_d(s));
	ucstring_destroy(s);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
cmpq $0x8, -0x20(%rbp)
jle 0x59c1c
jmp 0x59caf
movq -0x8(%rbp), %rdi
callq 0x1711d0
movq %rax, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x20(%rbp), %rax
jge 0x59c80
movq -0x28(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
addq -0x30(%rbp), %rsi
callq 0x165060
movq -0x38(%rbp), %rdi
movzbl %al, %ecx
movl $0x5, %esi
leaq 0x14d0b7(%rip), %rdx    # 0x1a6d22
movb $0x0, %al
callq 0x171660
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x59c31
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x28(%rbp), %rdi
callq 0x172650
movq -0x40(%rbp), %rdi
movq %rax, %rdx
leaq 0x14d08a(%rip), %rsi    # 0x1a6d29
movb $0x0, %al
callq 0x15b0d0
movq -0x28(%rbp), %rdi
callq 0x171750
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/ebml.c
// Function: get_type_name
static const char *get_type_name(unsigned int t)
{
	const char *name;
	switch(t) {
	case TY_m: name="master"; break;
	case TY_u: name="unsigned int"; break;
	case TY_i: name="signed int"; break;
	case TY_s: name="string"; break;
	case TY_8: name="UTF-8 string"; break;
	case TY_b: name="binary"; break;
	case TY_f: name="float"; break;
	case TY_d: name="date"; break;
	default: name="?";
	}
	return name;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x4(%rbp)
movl -0x4(%rbp), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x18(%rbp)
subl $0x7, %eax
ja 0x59d53
movq -0x18(%rbp), %rax
leaq 0x14ca5a(%rip), %rcx    # 0x1a673c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x145855(%rip), %rax    # 0x19f547
movq %rax, -0x10(%rbp)
jmp 0x59d5e
leaq 0x1475ec(%rip), %rax    # 0x1a12eb
movq %rax, -0x10(%rbp)
jmp 0x59d5e
leaq 0x1475e1(%rip), %rax    # 0x1a12ed
movq %rax, -0x10(%rbp)
jmp 0x59d5e
leaq 0x16bd23(%rip), %rax    # 0x1c5a3c
movq %rax, -0x10(%rbp)
jmp 0x59d5e
leaq 0x14d012(%rip), %rax    # 0x1a6d38
movq %rax, -0x10(%rbp)
jmp 0x59d5e
leaq 0x1722c5(%rip), %rax    # 0x1cbff8
movq %rax, -0x10(%rbp)
jmp 0x59d5e
leaq 0x14d005(%rip), %rax    # 0x1a6d45
movq %rax, -0x10(%rbp)
jmp 0x59d5e
leaq 0x15f443(%rip), %rax    # 0x1b9190
movq %rax, -0x10(%rbp)
jmp 0x59d5e
leaq 0x15ded3(%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/ebml.c
// Function: decode_uint
static void decode_uint(deark *c, lctx *d, const struct ele_id_info *ele_id,
	  i64 pos, i64 len1)
{
	unsigned int k;
	unsigned int len;
	u64 v = 0;

	if(len1==0) goto done;
	if(len1<1 || len1>8) return;
	len = (unsigned int)len1;

	v = 0;
	for(k=0; k<len; k++) {
		u64 x;
		x = (u64)de_getbyte(pos+(i64)k);
		v |= x<<((len-1-k)*8);
	}

done:
	de_dbg(c, "value: %"U64_FMT, v);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq $0x0, -0x38(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x59d9d
jmp 0x59e13
cmpq $0x1, -0x28(%rbp)
jl 0x59dab
cmpq $0x8, -0x28(%rbp)
jle 0x59dad
jmp 0x59e29
movq -0x28(%rbp), %rax
movl %eax, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x30(%rbp), %eax
jae 0x59e11
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
movl -0x2c(%rbp), %eax
addq %rax, %rsi
callq 0x165060
movzbl %al, %eax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movl -0x30(%rbp), %ecx
subl $0x1, %ecx
subl -0x2c(%rbp), %ecx
shll $0x3, %ecx
movl %ecx, %ecx
shlq %cl, %rax
orq -0x38(%rbp), %rax
movq %rax, -0x38(%rbp)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x59dc3
jmp 0x59e13
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rdx
leaq 0x14cf29(%rip), %rsi    # 0x1a6d4b
movb $0x0, %al
callq 0x15b0d0
addq $0x40, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/ebml.c
// Function: decode_float
static void decode_float(deark *c, lctx *d, const struct ele_id_info *ele_id,
	  i64 pos, i64 len)
{
	double v;

	if(len==4) {
		v = dbuf_getfloat32x(c->infile, pos, 0);
	}
	else if(len==8) {
		v = dbuf_getfloat64x(c->infile, pos, 0);
	}
	else {
		return;
	}
	de_dbg(c, "value: %f", v);
}

// 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)
cmpq $0x4, -0x28(%rbp)
jne 0x59e6d
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
xorl %edx, %edx
callq 0x165e00
movsd %xmm0, -0x30(%rbp)
jmp 0x59e92
cmpq $0x8, -0x28(%rbp)
jne 0x59e8e
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
xorl %edx, %edx
callq 0x165f20
movsd %xmm0, -0x30(%rbp)
jmp 0x59e90
jmp 0x59ea9
jmp 0x59e92
movq -0x8(%rbp), %rdi
movsd -0x30(%rbp), %xmm0
leaq 0x14ceb4(%rip), %rsi    # 0x1a6d56
movb $0x1, %al
callq 0x15b0d0
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/ebml.c
// Function: decode_string
static void decode_string(deark *c, lctx *d, const struct ele_id_info *ele_id,
	  i64 pos, i64 len, de_ext_encoding ee)
{
	de_ucstring *s = NULL;

	s = ucstring_create(c);
	dbuf_read_to_ucstring_n(c->infile, pos, len, DE_DBG_MAX_STRLEN, s,
		DE_CONVFLAG_STOP_AT_NUL, ee);
	de_dbg(c, "value: \"%s\"", ucstring_getpsz_d(s));

	ucstring_destroy(s);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movl %r9d, -0x2c(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1711d0
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x38(%rbp), %r8
movl -0x2c(%rbp), %eax
movl $0x1f4, %ecx            # imm = 0x1F4
movl $0x1, %r9d
movl %eax, (%rsp)
callq 0x166a40
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rdi
callq 0x172650
movq -0x40(%rbp), %rdi
movq %rax, %rdx
leaq 0x1448fd(%rip), %rsi    # 0x19e82b
movb $0x0, %al
callq 0x15b0d0
movq -0x38(%rbp), %rdi
callq 0x171750
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/ebml.c
// Function: decode_date
static void decode_date(deark *c, lctx *d, const struct ele_id_info *ele_id,
	  i64 pos, i64 len)
{
	i64 dt_int;
	struct de_timestamp ts;
	char buf[64];

	if(len!=8) return;
	dt_int = de_geti64be(pos);
	EBMLdate_to_timestamp(dt_int, &ts);
	de_timestamp_to_string(&ts, buf, sizeof(buf), 0);
	de_dbg(c, "value: %"I64_FMT" (%s)", dt_int, buf);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
cmpq $0x8, -0x28(%rbp)
je 0x59f78
jmp 0x59fc8
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x165730
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x5a320
leaq -0x80(%rbp), %rsi
leaq -0x40(%rbp), %rdi
movl $0x40, %edx
xorl %ecx, %ecx
callq 0x15e130
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rdx
leaq -0x80(%rbp), %rcx
leaq 0x1448ac(%rip), %rsi    # 0x19e86d
movb $0x0, %al
callq 0x15b0d0
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/ebml.c
// Function: handler_filename
static void handler_filename(deark *c, lctx *d, struct handler_params *hp)
{
	if(!d->attachmentctx) return;
	if(d->attachmentctx->filename) return;
	if(hp->dlen<1) return;

	d->attachmentctx->filename = ucstring_create(c);
	dbuf_read_to_ucstring_n(c->infile, hp->dpos, hp->dlen, 300,
		d->attachmentctx->filename,
		DE_CONVFLAG_STOP_AT_NUL, DE_ENCODING_UTF8);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x5a0a1
jmp 0x5a10e
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
cmpq $0x0, (%rax)
je 0x5a0b1
jmp 0x5a10e
movq -0x18(%rbp), %rax
cmpq $0x1, 0x8(%rax)
jge 0x5a0be
jmp 0x5a10e
movq -0x8(%rbp), %rdi
callq 0x1711d0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq (%rax), %r8
movl $0x12c, %ecx            # imm = 0x12C
movl $0x1, %r9d
movl $0x2, (%rsp)
callq 0x166a40
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/ebml.c
// Function: handler_attachedfile_end
static void handler_attachedfile_end(deark *c, lctx *d)
{
	de_finfo *fi = NULL;

	if(!d->attachmentctx) goto done;
	if(d->attachmentctx->data_pos==0) goto done;

	fi = de_finfo_create(c);

	// TODO: We could do a better job of constructing filenames in various
	// situations.
	if(d->attachmentctx->filename &&
		(d->attachmentctx->filename->len > 0) &&
		c->filenames_from_file)
	{
		de_finfo_set_name_from_ucstring(c, fi, d->attachmentctx->filename, 0);
	}
	else
	{
		de_finfo_set_name_from_sz(c, fi, "bin", 0, DE_ENCODING_UTF8);
	}

	dbuf_create_file_from_slice(c->infile, d->attachmentctx->data_pos,
		d->attachmentctx->data_len, NULL, fi, DE_CREATEFLAG_IS_AUX);

done:
	de_finfo_destroy(c, fi);
	destroy_attachment_data(c, d);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x5a1e8
jmp 0x5a2a4
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
cmpq $0x0, 0x8(%rax)
jne 0x5a1fc
jmp 0x5a2a4
movq -0x8(%rbp), %rdi
callq 0x15d230
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
cmpq $0x0, (%rax)
je 0x5a255
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
cmpq $0x0, 0x10(%rax)
jle 0x5a255
movq -0x8(%rbp), %rax
movzbl 0xd0(%rax), %eax
cmpl $0x0, %eax
je 0x5a255
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rdx
xorl %ecx, %ecx
callq 0x15d2c0
jmp 0x5a271
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
leaq 0x166fa3(%rip), %rdx    # 0x1c1207
xorl %ecx, %ecx
movl $0x2, %r8d
callq 0x15d4c0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rax), %rdx
movq -0x18(%rbp), %r8
xorl %eax, %eax
movl %eax, %ecx
movl $0x1, %r9d
callq 0x166be0
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x15d260
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x594c0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/ebml.c
// Function: EBMLdate_to_timestamp
static void EBMLdate_to_timestamp(i64 ed, struct de_timestamp *ts)
{
	i64 t;

	// ed is the number of nanoseconds since the beginning of 2001.
	t = ed/1000000000;
	// Now t is seconds since the beginning of 2001.
	// We want seconds since the beginning of 1970.
	// So, add the number of seconds in the years from 1970 through 2000. This
	// is 31 years.
	// There are 86400 seconds in a day.
	// There are 8 leap days in this range ('72, 76, 80, 84, 88, 92, 96, 00).
	t += 86400LL * (31*365 + 8);
	de_unix_time_to_timestamp(t, ts, 0x1);
	de_timestamp_set_subsec(ts, ((double)(ed%1000000000))/1000000000.0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movl $0x3b9aca00, %ecx       # imm = 0x3B9ACA00
cqto
idivq %rcx
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
addq $0x3a4fc880, %rax       # imm = 0x3A4FC880
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x1, %edx
callq 0x15d530
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movl $0x3b9aca00, %ecx       # imm = 0x3B9ACA00
cqto
idivq %rcx
cvtsi2sd %rdx, %xmm0
movsd 0x14c3df(%rip), %xmm1   # 0x1a6760
divsd %xmm1, %xmm0
callq 0x15d5e0
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/emf.c
// Function: de_module_emf
void de_module_emf(deark *c, struct deark_module_info *mi)
{
	mi->id = "emf";
	mi->desc = "Enhanced Windows Metafile";
	mi->desc2 = "extract bitmaps only";
	mi->run_fn = de_run_emf;
	mi->identify_fn = de_identify_emf;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
leaq 0x14ca1a(%rip), %rcx    # 0x1a6dc1
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
leaq 0x14ca10(%rip), %rcx    # 0x1a6dc5
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
leaq 0x14ca1b(%rip), %rcx    # 0x1a6ddf
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rax
leaq 0x1d(%rip), %rcx        # 0x5a3f0
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
leaq 0xae(%rip), %rcx        # 0x5a490
movq %rcx, 0x20(%rax)
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/emf.c
// Function: de_run_emf
static void de_run_emf(deark *c, de_module_params *mparams)
{
	lctx *d = NULL;

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

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

	detect_emfplus(c, d);

	if(d->is_emfplus)
		de_declare_fmt(c, "EMF+");
	else
		de_declare_fmt(c, "EMF");

	do_emf_record_list(c, d);

	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 $0x20, %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, (%rax)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x5a500
movq -0x18(%rbp), %rax
cmpl $0x0, 0x4(%rax)
je 0x5a45d
movq -0x8(%rbp), %rdi
leaq 0x14c99e(%rip), %rsi    # 0x1a6df4
callq 0x15e380
jmp 0x5a46d
movq -0x8(%rbp), %rdi
leaq 0x14d6f4(%rip), %rsi    # 0x1a7b5c
callq 0x15e380
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x5a570
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x15b820
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/emf.c
// Function: de_identify_emf
static int de_identify_emf(deark *c)
{
	if(!dbuf_memcmp(c->infile, 0, "\x01\x00\x00\x00", 4) &&
		!dbuf_memcmp(c->infile, 40, " EMF", 4))
	{
		return 100;
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
leaq 0x14c90d(%rip), %rdx    # 0x1a6dbc
movl $0x4, %ecx
callq 0x166ab0
cmpl $0x0, %eax
jne 0x5a4ea
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0x28, %esi
leaq 0x14d689(%rip), %rdx    # 0x1a7b5b
movl $0x4, %ecx
callq 0x166ab0
cmpl $0x0, %eax
jne 0x5a4ea
movl $0x64, -0x4(%rbp)
jmp 0x5a4f1
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/emf.c
// Function: detect_emfplus
static void detect_emfplus(deark *c, lctx *d)
{
	i64 nextpos;
	nextpos = de_getu32le(4);
	if(de_getu32le(nextpos)==0x46 &&
		de_getu32le(nextpos+12)==CODE_EMFPLUS)
	{
		d->is_emfplus = 1;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0x4, %esi
callq 0x165540
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x165540
cmpq $0x46, %rax
jne 0x5a565
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
addq $0xc, %rsi
callq 0x165540
cmpq $0x2b464d45, %rax       # imm = 0x2B464D45
jne 0x5a565
movq -0x10(%rbp), %rax
movl $0x1, 0x4(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/emf.c
// Function: do_emf_record_list
static void do_emf_record_list(deark *c, lctx *d)
{
	i64 pos = 0;
	i64 recpos;
	i64 recsize_bytes;
	i64 count = 0;

	// The entire EMF file is a sequence of records. The header record
	// (type 0x01) is expected to appear first.

	while(1) {
		recpos = pos;

		if(recpos+8 > c->infile->len) {
			de_err(c, "Unexpected end of file (no EOF record found)");
			goto done;
		}

		recsize_bytes = de_getu32le(recpos+4);
		if(recpos+recsize_bytes > c->infile->len) {
			de_err(c, "Unexpected end of file in record %d", (int)count);
			goto done;
		}
		if(recsize_bytes<8) {
			de_err(c, "Bad record size (%"I64_FMT") at %"I64_FMT, recsize_bytes, recpos);
			goto done;
		}

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

		pos += recsize_bytes;
		count++;
	}

done:
	;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
addq $0x8, %rax
movq -0x8(%rbp), %rcx
movq 0x18(%rcx), %rcx
cmpq 0x18(%rcx), %rax
jle 0x5a5c5
movq -0x8(%rbp), %rdi
leaq 0x14c840(%rip), %rsi    # 0x1a6df9
movb $0x0, %al
callq 0x15bfb0
jmp 0x5a670
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
addq $0x4, %rsi
callq 0x165540
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
addq -0x28(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x18(%rcx), %rcx
cmpq 0x18(%rcx), %rax
jle 0x5a60e
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rax
movl %eax, %edx
leaq 0x14c821(%rip), %rsi    # 0x1a6e26
movb $0x0, %al
callq 0x15bfb0
jmp 0x5a670
cmpq $0x8, -0x28(%rbp)
jge 0x5a631
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rdx
movq -0x20(%rbp), %rcx
leaq 0x14c822(%rip), %rsi    # 0x1a6e4a
movb $0x0, %al
callq 0x15bfb0
jmp 0x5a670
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %r8
callq 0x5a680
cmpl $0x0, %eax
jne 0x5a651
jmp 0x5a66e
movq -0x28(%rbp), %rax
addq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x5a590
jmp 0x5a670
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/emf.c
// Function: do_emf_record
static int do_emf_record(deark *c, lctx *d, i64 recnum, i64 recpos,
	i64 recsize_bytes)
{
	int ret;
	const struct emf_func_info *fnci;
	struct decoder_params dp;

	de_zeromem(&dp, sizeof(struct decoder_params));
	dp.recpos = recpos;
	dp.recsize_bytes = recsize_bytes;
	dp.dpos = recpos+8;
	dp.dlen = recsize_bytes-8;
	if(dp.dlen<0) dp.dlen=0;

	dp.rectype = (u32)de_getu32le(recpos);

	fnci = find_emf_func_info(dp.rectype);

	de_dbg(c, "record #%d at %"I64_FMT", type=0x%02x (%s), dpos=%"I64_FMT", dlen=%"I64_FMT,
		(int)recnum, recpos, (UI)dp.rectype,
		fnci ? fnci->name : "?", dp.dpos, dp.dlen);

	if(fnci && fnci->fn) {
		de_dbg_indent(c, 1);
		ret = fnci->fn(c, d, &dp);
		de_dbg_indent(c, -1);
		if(!ret) return 0;
	}

	return (dp.rectype==0x0e) ? 0 : 1; // 0x0e = EOF record
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
leaq -0x68(%rbp), %rdi
xorl %esi, %esi
movl $0x28, %edx
callq 0x19140
movq -0x28(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x28(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x50(%rbp)
movq -0x30(%rbp), %rax
subq $0x8, %rax
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
jge 0x5a6e6
movq $0x0, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x28(%rbp), %rsi
callq 0x165540
movl %eax, -0x68(%rbp)
movl -0x68(%rbp), %edi
callq 0x5a800
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x20(%rbp), %rax
movl %eax, -0x7c(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x78(%rbp)
movl -0x68(%rbp), %eax
movl %eax, -0x6c(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0x5a73e
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x90(%rbp)
jmp 0x5a74e
leaq 0x15d4e8(%rip), %rax    # 0x1b7c2d
movq %rax, -0x90(%rbp)
jmp 0x5a74e
movl -0x6c(%rbp), %r8d
movq -0x78(%rbp), %rcx
movl -0x7c(%rbp), %edx
movq -0x88(%rbp), %rdi
movq -0x90(%rbp), %r9
movq -0x50(%rbp), %r10
movq -0x48(%rbp), %rax
leaq 0x14c6f1(%rip), %rsi    # 0x1a6e67
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
movb $0x0, %al
callq 0x15b0d0
cmpq $0x0, -0x40(%rbp)
je 0x5a7de
movq -0x40(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x5a7de
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
leaq -0x68(%rbp), %rdx
callq *%rax
movl %eax, -0x34(%rbp)
movq -0x10(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
cmpl $0x0, -0x34(%rbp)
jne 0x5a7dc
movl $0x0, -0x4(%rbp)
jmp 0x5a7f1
jmp 0x5a7de
movl -0x68(%rbp), %edx
movl $0x1, %eax
xorl %ecx, %ecx
cmpl $0xe, %edx
cmovel %ecx, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xa0, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/emf.c
// Function: find_emf_func_info
static const struct emf_func_info *find_emf_func_info(u32 rectype)
{
	size_t i;

	for(i=0; i<DE_ARRAYCOUNT(emf_func_info_arr); i++) {
		if(emf_func_info_arr[i].rectype == rectype) {
			return &emf_func_info_arr[i];
		}
	}
	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0xc(%rbp)
movq $0x0, -0x18(%rbp)
cmpq $0x77, -0x18(%rbp)
jae 0x5a851
leaq 0x1bc103(%rip), %rax    # 0x216920
imulq $0x18, -0x18(%rbp), %rcx
addq %rcx, %rax
movl (%rax), %eax
cmpl -0xc(%rbp), %eax
jne 0x5a841
leaq 0x1bc0ed(%rip), %rax    # 0x216920
imulq $0x18, -0x18(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x8(%rbp)
jmp 0x5a859
jmp 0x5a843
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x5a80f
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/emf.c
// Function: handler_object_index
static int handler_object_index(deark *c, lctx *d, struct decoder_params *dp)
{
	i64 pos = dp->dpos;

	if(dp->dlen<4) return 1;
	read_object_index_p(c, d, &pos);
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
cmpq $0x4, 0x20(%rax)
jge 0x5ab64
movl $0x1, -0x4(%rbp)
jmp 0x5ab7c
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
leaq -0x28(%rbp), %rdx
callq 0x5b5a0
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/emf.c
// Function: handler_CREATEPEN
static int handler_CREATEPEN(deark *c, lctx *d, struct decoder_params *dp)
{
	i64 pos = dp->dpos;

	if(dp->dlen<20) return 1;
	read_object_index_p(c, d, &pos);
	read_LogPen(c, d, pos);
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
cmpq $0x14, 0x20(%rax)
jge 0x5abc4
movl $0x1, -0x4(%rbp)
jmp 0x5abed
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
leaq -0x28(%rbp), %rdx
callq 0x5b5a0
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x5b6d0
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/emf.c
// Function: handler_CREATEBRUSHINDIRECT
static int handler_CREATEBRUSHINDIRECT(deark *c, lctx *d, struct decoder_params *dp)
{
	i64 pos = dp->dpos;

	if(dp->dlen<16) return 1;
	read_object_index_p(c, d, &pos);
	read_LogBrushEx(c, d, pos);
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
cmpq $0x10, 0x20(%rax)
jge 0x5ac34
movl $0x1, -0x4(%rbp)
jmp 0x5ac5d
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
leaq -0x28(%rbp), %rdx
callq 0x5b5a0
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x5b770
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/emf.c
// Function: handler_EXTCREATEFONTINDIRECTW
static int handler_EXTCREATEFONTINDIRECTW(deark *c, lctx *d, struct decoder_params *dp)
{
	i64 pos = dp->dpos;
	i64 elw_size;

	read_object_index_p(c, d, &pos); // ihFonts

	// "If the size of the elw field is equal to or less than the size of a
	// LogFontPanose object, elw MUST be treated as a fixed-length LogFont object.
	// [Else LogFontExDv.] The size of a LogFontPanose object is 320 decimal."
	elw_size = dp->dlen - 4;

	if(elw_size<=320) {
		do_LogFont(c, d, dp, pos, elw_size);
	}
	else {
		do_LogFontExDv(c, d, dp, pos, elw_size);
	}

	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x20(%rbp), %rdx
callq 0x5b5a0
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
subq $0x4, %rax
movq %rax, -0x28(%rbp)
cmpq $0x140, -0x28(%rbp)     # imm = 0x140
jg 0x5b366
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %r8
callq 0x5c5a0
jmp 0x5b37f
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %r8
callq 0x5c6f0
movl $0x1, %eax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/emf.c
// Function: emf_handler_53
static int emf_handler_53(deark *c, lctx *d, struct decoder_params *dp)
{
	i64 pos = dp->recpos;

	pos += 8; // type, size
	pos += 16; // bounds
	pos += 12; // iGraphicsMode, exScale, eyScale
	do_emf_aEmrText(c, d, dp->recpos, pos, dp->recpos+dp->recsize_bytes - pos);
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
addq $0xc, %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x20(%rbp), %rcx
movq -0x18(%rbp), %rax
movq 0x8(%rax), %r8
movq -0x18(%rbp), %rax
addq 0x10(%rax), %r8
subq -0x20(%rbp), %r8
callq 0x5c770
movl $0x1, %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)