LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/palmpdb.c
// Function: calc_rec_len
static i64 calc_rec_len(deark *c, lctx *d, i64 rec_idx)
{
	i64 len;
	if(rec_idx+1 < d->rec_list.num_recs) {
		len = (i64)(d->rec_list.rec_data[rec_idx+1].offset - d->rec_list.rec_data[rec_idx].offset);
	}
	else {
		len = c->infile->len - (i64)d->rec_list.rec_data[rec_idx].offset;
	}
	return len;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq -0x10(%rbp), %rcx
cmpq 0xa0(%rcx), %rax
jge 0x1003a2
movq -0x10(%rbp), %rax
movq 0xa8(%rax), %rax
movq -0x18(%rbp), %rcx
movl 0x4(%rax,%rcx,4), %eax
movq -0x10(%rbp), %rcx
movq 0xa8(%rcx), %rcx
movq -0x18(%rbp), %rdx
subl (%rcx,%rdx,4), %eax
movl %eax, %eax
movq %rax, -0x20(%rbp)
jmp 0x1003c7
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0xa8(%rcx), %rcx
movq -0x18(%rbp), %rdx
movl (%rcx,%rdx,4), %ecx
subq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/palmpdb.c
// Function: do_string_rsrc
static void do_string_rsrc(deark *c, lctx *d,
	i64 pos, i64 len,
	const struct rsrc_type_info_struct *rti, unsigned int flags)
{
	de_ucstring *s = NULL;

	if(!rti || !rti->descr) return;
	s = ucstring_create(c);
	dbuf_read_to_ucstring_n(c->infile, pos, len, DE_DBG_MAX_STRLEN, s,
		DE_CONVFLAG_STOP_AT_NUL, DE_ENCODING_PALM);
	de_dbg(c, "%s: \"%s\"", rti->descr, ucstring_getpsz(s));

	if((flags&0x1) & !d->icon_name) {
		// Also save the string to d->icon_name, to be used later
		d->icon_name = ucstring_create(c);
		dbuf_read_to_ucstring_n(c->infile, pos, len, 80, d->icon_name,
			DE_CONVFLAG_STOP_AT_NUL, DE_ENCODING_PALM);
	}

	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)
cmpq $0x0, -0x28(%rbp)
je 0x10040a
movq -0x28(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x10040f
jmp 0x1004f4
movq -0x8(%rbp), %rdi
callq 0x1711d0
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x38(%rbp), %r8
movl $0x1f4, %ecx            # imm = 0x1F4
movl $0x1, %r9d
movl $0x13, (%rsp)
callq 0x166a40
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rdi
callq 0x172500
movq -0x48(%rbp), %rdi
movq -0x40(%rbp), %rdx
movq %rax, %rcx
leaq 0xb7790(%rip), %rsi     # 0x1b7c06
movb $0x0, %al
callq 0x15b0d0
movl -0x2c(%rbp), %eax
andl $0x1, %eax
movq -0x10(%rbp), %rcx
cmpq $0x0, 0xc0(%rcx)
setne %cl
xorb $-0x1, %cl
andb $0x1, %cl
movzbl %cl, %ecx
andl %ecx, %eax
cmpl $0x0, %eax
je 0x1004eb
movq -0x8(%rbp), %rdi
callq 0x1711d0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0xc0(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x10(%rbp), %rax
movq 0xc0(%rax), %r8
movl $0x50, %ecx
movl $0x1, %r9d
movl $0x13, (%rsp)
callq 0x166a40
movq -0x38(%rbp), %rdi
callq 0x171750
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/palmpdb.c
// Function: extract_item
static void extract_item(deark *c, lctx *d, i64 data_offs, i64 data_len,
	const char *ext_sz, de_ucstring *ext_ucstring,
	unsigned int createflags, int always_extract)
{
	de_finfo *fi = NULL;

	if(c->extract_level<2 && !always_extract) goto done;
	if(data_offs<0 || data_len<0) goto done;
	if(data_offs+data_len > c->infile->len) goto done;
	fi = de_finfo_create(c);
	if(ext_sz) {
		de_finfo_set_name_from_sz(c, fi, ext_sz, 0, DE_ENCODING_ASCII);
	}
	else if(ext_ucstring) {
		de_finfo_set_name_from_ucstring(c, fi, ext_ucstring, 0);
	}
	dbuf_create_file_from_slice(c->infile, data_offs, data_len, NULL, fi, createflags);
done:
	de_finfo_destroy(c, fi);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl 0x18(%rbp), %eax
movl 0x10(%rbp), %eax
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 $0x0, -0x38(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x2, 0x90(%rax)
jge 0x100546
cmpl $0x0, 0x18(%rbp)
jne 0x100546
jmp 0x1005dd
cmpq $0x0, -0x18(%rbp)
jl 0x100554
cmpq $0x0, -0x20(%rbp)
jge 0x100559
jmp 0x1005dd
movq -0x18(%rbp), %rax
addq -0x20(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x18(%rcx), %rcx
cmpq 0x18(%rcx), %rax
jle 0x100571
jmp 0x1005dd
movq -0x8(%rbp), %rdi
callq 0x15d230
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x1005a0
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x28(%rbp), %rdx
xorl %ecx, %ecx
movl $0x1, %r8d
callq 0x15d4c0
jmp 0x1005bc
cmpq $0x0, -0x30(%rbp)
je 0x1005ba
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x30(%rbp), %rdx
xorl %ecx, %ecx
callq 0x15d2c0
jmp 0x1005bc
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x38(%rbp), %r8
movl 0x10(%rbp), %r9d
xorl %eax, %eax
movl %eax, %ecx
callq 0x166be0
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x15d260
addq $0x40, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/palmpdb.c
// Function: get_rec_attr_descr
static void get_rec_attr_descr(de_ucstring *s, u8 attribs)
{
	if(attribs&0x10) ucstring_append_flags_item(s, "mRecAttrSecret");
	if(attribs&0x20) ucstring_append_flags_item(s, "dmRecAttrBusy");
	if(attribs&0x40) ucstring_append_flags_item(s, "dmRecAttrDirty");
	if(attribs&0x80) ucstring_append_flags_item(s, "dmRecAttrDelete");
	if(attribs==0) ucstring_append_flags_item(s, "none");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movb %sil, %al
movq %rdi, -0x8(%rbp)
movb %al, -0x9(%rbp)
movzbl -0x9(%rbp), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x10061e
movq -0x8(%rbp), %rdi
leaq 0xc0c26(%rip), %rsi     # 0x1c123f
callq 0x172680
movzbl -0x9(%rbp), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x10063a
movq -0x8(%rbp), %rdi
leaq 0xc0c19(%rip), %rsi     # 0x1c124e
callq 0x172680
movzbl -0x9(%rbp), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x100656
movq -0x8(%rbp), %rdi
leaq 0xc0c0b(%rip), %rsi     # 0x1c125c
callq 0x172680
movzbl -0x9(%rbp), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x100674
movq -0x8(%rbp), %rdi
leaq 0xc0bfc(%rip), %rsi     # 0x1c126b
callq 0x172680
movzbl -0x9(%rbp), %eax
cmpl $0x0, %eax
jne 0x10068d
movq -0x8(%rbp), %rdi
leaq 0x9c085(%rip), %rsi     # 0x19c70d
callq 0x172680
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/palmpdb.c
// Function: do_imgview_text
static void do_imgview_text(deark *c, lctx *d, i64 pos, i64 len)
{
	de_ucstring *s = NULL;

	if(len<1) return;

	// (I'm pretty much just guessing the format of this record.)
	s = ucstring_create(c);
	dbuf_read_to_ucstring(c->infile, pos, len, s, DE_CONVFLAG_STOP_AT_NUL, DE_ENCODING_PALM);

	// TODO: Decide when to write the text record to a file.
	// Problem is that we're already using -a to mean "write all raw records to files".
	{
		dbuf *outf = NULL;
		outf = dbuf_create_output_file(c, "comment.txt", NULL, DE_CREATEFLAG_IS_AUX);
		ucstring_write_as_utf8(c, s, outf, 1);
		dbuf_close(outf);
	}

	ucstring_destroy(s);
}

// 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 $0x0, -0x28(%rbp)
cmpq $0x1, -0x20(%rbp)
jge 0x100c09
jmp 0x100c88
movq -0x8(%rbp), %rdi
callq 0x1711d0
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movl $0x1, %r8d
movl $0x13, %r9d
callq 0x1669f0
movq $0x0, -0x30(%rbp)
movq -0x8(%rbp), %rdi
leaq 0xa3602(%rip), %rsi     # 0x1a4250
xorl %eax, %eax
movl %eax, %edx
movl $0x1, %ecx
callq 0x166c60
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
movl $0x1, %ecx
callq 0x172150
movq -0x30(%rbp), %rdi
callq 0x1676a0
movq -0x28(%rbp), %rdi
callq 0x171750
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/palmpdb.c
// Function: do_generate_image
static void do_generate_image(deark *c, lctx *d,
	dbuf *inf, i64 pos, i64 len, unsigned int cmpr_meth,
	struct img_gen_info *igi)
{
	dbuf *unc_pixels = NULL;
	i64 expected_num_uncmpr_image_bytes;

	expected_num_uncmpr_image_bytes = igi->rowbytes*igi->h;

	if(cmpr_meth==0) {
		if(expected_num_uncmpr_image_bytes > len) {
			de_warn(c, "Not enough data for image");
		}
		unc_pixels = dbuf_open_input_subfile(inf, pos, len);
	}
	else {
		unc_pixels = dbuf_create_membuf(c, expected_num_uncmpr_image_bytes, 1);
		do_decompress_imgview_image(c, d, inf, pos, len, unc_pixels);

		// TODO: The byte counts in this message are not very accurate.
		de_dbg(c, "decompressed %d bytes to %d bytes", (int)len,
			(int)unc_pixels->len);
	}

	do_generate_img_from_unc_pixels(c, d, unc_pixels, igi);

	dbuf_close(unc_pixels);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movl %r9d, -0x2c(%rbp)
movq $0x0, -0x38(%rbp)
movq 0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x10(%rbp), %rcx
imulq 0x8(%rcx), %rax
movq %rax, -0x40(%rbp)
cmpl $0x0, -0x2c(%rbp)
jne 0x100d0a
movq -0x40(%rbp), %rax
cmpq -0x28(%rbp), %rax
jle 0x100cf3
movq -0x8(%rbp), %rdi
leaq 0xc007c(%rip), %rsi     # 0x1c0d68
movb $0x0, %al
callq 0x15bc10
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x1691b0
movq %rax, -0x38(%rbp)
jmp 0x100d5f
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rsi
movl $0x1, %edx
callq 0x168020
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %r8
movq -0x38(%rbp), %r9
callq 0x100d90
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movl %eax, %edx
movq -0x38(%rbp), %rax
movq 0x18(%rax), %rax
movl %eax, %ecx
leaq 0x9c676(%rip), %rsi     # 0x19d3ce
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x38(%rbp), %rdx
movq 0x10(%rbp), %rcx
callq 0x100e70
movq -0x38(%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/palmpdb.c
// Function: do_decompress_imgview_image
static int do_decompress_imgview_image(deark *c, lctx *d, dbuf *inf,
	i64 pos1, i64 len, dbuf *unc_pixels)
{
	i64 pos = pos1;
	u8 b1, b2;
	i64 count;

	while(pos < pos1+len) {
		b1 = dbuf_getbyte(inf, pos++);
		if(b1>128) {
			count = (i64)b1-127;
			b2 = dbuf_getbyte(inf, pos++);
			dbuf_write_run(unc_pixels, b2, count);
		}
		else {
			count = (i64)b1+1;
			dbuf_copy(inf, pos, count, unc_pixels);
			pos += count;
		}
	}
	return 1;
}

// 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)
movq %r9, -0x30(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq -0x20(%rbp), %rcx
addq -0x28(%rbp), %rcx
cmpq %rcx, %rax
jge 0x100e61
movq -0x18(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq %rsi, %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
callq 0x165060
movb %al, -0x39(%rbp)
movzbl -0x39(%rbp), %eax
cmpl $0x80, %eax
jle 0x100e2f
movzbl -0x39(%rbp), %eax
subq $0x7f, %rax
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq %rsi, %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
callq 0x165060
movb %al, -0x3a(%rbp)
movq -0x30(%rbp), %rdi
movb -0x3a(%rbp), %al
movq -0x48(%rbp), %rdx
movzbl %al, %esi
callq 0x168800
jmp 0x100e5c
movzbl -0x39(%rbp), %eax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq -0x30(%rbp), %rcx
callq 0x166070
movq -0x48(%rbp), %rax
addq -0x38(%rbp), %rax
movq %rax, -0x38(%rbp)
jmp 0x100db8
movl $0x1, %eax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/palmpdb.c
// Function: do_generate_img_from_unc_pixels
static void do_generate_img_from_unc_pixels(deark *c, lctx *d, dbuf *unc_pixels,
	struct img_gen_info *igi)
{
	de_bitmap *img = NULL;
	de_color pal[16];

	if(igi->bitsperpixel==1) {
		de_convert_and_write_image_bilevel(unc_pixels, 0, igi->w, igi->h, igi->rowbytes,
			DE_CVTF_WHITEISZERO, igi->fi, igi->createflags);
		goto done;
	}
	else if(igi->bitsperpixel==2 || igi->bitsperpixel==4) {
		;
	}
	else {
		goto done;
	}

	img = de_bitmap_create(c, igi->w, igi->h, 1);
	de_make_grayscale_palette(pal, 1ULL<<igi->bitsperpixel, 0x1);
	de_convert_image_paletted(unc_pixels, 0, igi->bitsperpixel, igi->rowbytes,
		pal, img, 0);
	de_bitmap_write_to_file_finfo(img, igi->fi, igi->createflags);

done:
	de_bitmap_destroy(img);
}

// 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 $0x0, -0x28(%rbp)
movq -0x20(%rbp), %rax
cmpq $0x1, 0x10(%rax)
jne 0x100ee2
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rax
movq (%rax), %rdx
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x20(%rbp), %rax
movq 0x18(%rax), %r8
movq -0x20(%rbp), %rax
movq 0x20(%rax), %r10
movq -0x20(%rbp), %rax
movl 0x28(%rax), %eax
xorl %esi, %esi
movl $0x1, %r9d
movq %r10, (%rsp)
movl %eax, 0x8(%rsp)
callq 0x16bf50
jmp 0x100f86
movq -0x20(%rbp), %rax
cmpq $0x2, 0x10(%rax)
je 0x100ef8
movq -0x20(%rbp), %rax
cmpq $0x4, 0x10(%rax)
jne 0x100efa
jmp 0x100eff
jmp 0x100f86
jmp 0x100f01
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movq (%rax), %rsi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdx
movl $0x1, %ecx
callq 0x16b750
movq %rax, -0x28(%rbp)
leaq -0x70(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rcx
movl $0x1, %esi
shlq %cl, %rsi
movl $0x1, %edx
callq 0x16d580
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdx
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rcx
leaq -0x70(%rbp), %r8
movq -0x28(%rbp), %r9
xorl %eax, %eax
movl %eax, %esi
xorl %eax, %eax
movl $0x0, (%rsp)
callq 0x16c520
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rsi
movq -0x20(%rbp), %rax
movl 0x28(%rax), %edx
callq 0x16afa0
movq -0x28(%rbp), %rdi
callq 0x16af60
addq $0x80, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/pcpaint.c
// Function: de_module_pcpaint
void de_module_pcpaint(deark *c, struct deark_module_info *mi)
{
	mi->id = "pcpaint";
	mi->desc = "PCPaint PIC or CLP image";
	mi->run_fn = de_run_pcpaint;
	mi->identify_fn = de_identify_pcpaint;
	mi->help_fn = de_help_pcpaint;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
leaq 0xc0199(%rip), %rcx     # 0x1c14d0
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
leaq 0xc0193(%rip), %rcx     # 0x1c14d8
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
leaq 0x2c(%rip), %rcx        # 0x101380
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
leaq 0x1dd(%rip), %rcx       # 0x101540
movq %rcx, 0x20(%rax)
movq -0x10(%rbp), %rax
leaq 0x2be(%rip), %rcx       # 0x101630
movq %rcx, 0x28(%rax)
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/pcpaint.c
// Function: de_identify_pcpaint
static int de_identify_pcpaint(deark *c)
{
	u8 buf[12];
	int pic_ext, clp_ext;
	i64 x;

	pic_ext = de_input_file_has_ext(c, "pic");

	de_read(buf, 0, 12);
	if(buf[0]==0x34 && buf[1]==0x12) {
		if(buf[11]==0xff) {
			return pic_ext ? 100 : 50;
		}
		if(buf[11]==0x00 && buf[10]==0x01) {
			return pic_ext ? 60 : 10;
		}
	}

	clp_ext = de_input_file_has_ext(c, "clp");
	if(clp_ext) {
		x = de_getu16le_direct(&buf[0]);
		if(x==c->infile->len) {
			return 50;
		}
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
leaq 0xc0546(%rip), %rsi     # 0x1c1a9d
callq 0x15d180
movl %eax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x1c(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
movl $0xc, %ecx
callq 0x164d10
movzbl -0x1c(%rbp), %eax
cmpl $0x34, %eax
jne 0x1015da
movzbl -0x1b(%rbp), %eax
cmpl $0x12, %eax
jne 0x1015da
movzbl -0x11(%rbp), %eax
cmpl $0xff, %eax
jne 0x1015ae
movl -0x20(%rbp), %edx
movl $0x32, %eax
movl $0x64, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x101624
movzbl -0x11(%rbp), %eax
cmpl $0x0, %eax
jne 0x1015d8
movzbl -0x12(%rbp), %eax
cmpl $0x1, %eax
jne 0x1015d8
movl -0x20(%rbp), %edx
movl $0xa, %eax
movl $0x3c, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x101624
jmp 0x1015da
movq -0x10(%rbp), %rdi
leaq 0xad6eb(%rip), %rsi     # 0x1aecd0
callq 0x15d180
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0x10161d
leaq -0x1c(%rbp), %rdi
callq 0x165260
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x18(%rcx), %rcx
cmpq 0x18(%rcx), %rax
jne 0x10161b
movl $0x32, -0x4(%rbp)
jmp 0x101624
jmp 0x10161d
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/pcpaint.c
// Function: de_module_bsave_cmpr
void de_module_bsave_cmpr(deark *c, struct deark_module_info *mi)
{
	mi->id = "bsave_cmpr";
	mi->desc = "PCPaint compressed BSAVE";
	mi->run_fn = de_run_bsave_cmpr;
	mi->identify_fn = de_identify_bsave_cmpr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
leaq 0xbfe5a(%rip), %rcx     # 0x1c14f1
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
leaq 0xbfe57(%rip), %rcx     # 0x1c14fc
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
leaq 0x1c(%rip), %rcx        # 0x1016d0
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
leaq 0x1cd(%rip), %rcx       # 0x101890
movq %rcx, 0x20(%rax)
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/pcpaint.c
// Function: de_run_bsave_cmpr
static void de_run_bsave_cmpr(deark *c, de_module_params *mparams)
{
	lctx *d = NULL;
	int ret;
	i64 pos;
	i64 udata_size;
	dbuf *outf = NULL;

	de_declare_fmt(c, "PCPaint compressed BSAVE");
	d = de_malloc(c, sizeof(lctx));
	d->file_fmt = FMT_CMPR_BSAVE;

	udata_size = de_getu16le(7);
	d->unc_pixels = dbuf_create_membuf(c, BSAVE_HDRSIZE+udata_size, 0x1);

	// Construct the 7-byte BSAVE header
	dbuf_copy(c->infile, 0, 5, d->unc_pixels);
	dbuf_copy(c->infile, 7, 2, d->unc_pixels);

	pos = 9;
	d->num_rle_blocks = de_getu16le_p(&pos);
	de_dbg(c, "num rle blocks: %d", (int)d->num_rle_blocks);

	de_dbg(c, "decompressing");
	de_dbg_indent(c, 1);
	ret = decompress_blocks(c, d, 11);
	de_dbg_indent(c, -1);
	if(!ret) goto done;

	outf = dbuf_create_output_file(c, "unc.pic", NULL, 0);
	dbuf_copy(d->unc_pixels, 0, d->unc_pixels->len, outf);

done:
	dbuf_close(outf);
	destroy_lctx(c, d);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x8(%rbp), %rdi
leaq 0xbfe01(%rip), %rsi     # 0x1c14fc
callq 0x15e380
movq -0x8(%rbp), %rdi
movl $0x4a0, %esi            # imm = 0x4A0
callq 0x15b780
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movl $0x3, (%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0x7, %esi
callq 0x165280
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
addq $0x7, %rsi
movl $0x1, %edx
callq 0x168020
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x88(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x88(%rax), %rcx
xorl %eax, %eax
movl %eax, %esi
movl $0x5, %edx
callq 0x166070
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x88(%rax), %rcx
movl $0x7, %esi
movl $0x2, %edx
callq 0x166070
movq $0x9, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x28(%rbp), %rsi
callq 0x1652c0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x80(%rax)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x80(%rax), %rax
movl %eax, %edx
leaq 0xc0202(%rip), %rsi     # 0x1c19da
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
leaq 0xa1a98(%rip), %rsi     # 0x1a3282
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl $0xb, %edx
callq 0x103a90
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
cmpl $0x0, -0x1c(%rbp)
jne 0x10182a
jmp 0x10186b
movq -0x8(%rbp), %rdi
leaq 0xc0264(%rip), %rsi     # 0x1c1a99
xorl %eax, %eax
movl %eax, %edx
xorl %ecx, %ecx
callq 0x166c60
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rax
movq 0x88(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x88(%rax), %rax
movq 0x18(%rax), %rdx
movq -0x38(%rbp), %rcx
xorl %eax, %eax
movl %eax, %esi
callq 0x166070
movq -0x38(%rbp), %rdi
callq 0x1676a0
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x1020d0
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/pcpaint.c
// Function: destroy_lctx
static void destroy_lctx(deark *c, lctx *d)
{
	if(!d) return;
	if(d->unc_pixels) dbuf_close(d->unc_pixels);
	de_finfo_destroy(c, d->fi);
	de_free(c, d->pal_info_mainfile.data);
	de_free(c, d->pal_info_palfile.data);
	de_free(c, d);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x1020e9
jmp 0x102147
movq -0x10(%rbp), %rax
cmpq $0x0, 0x88(%rax)
je 0x102107
movq -0x10(%rbp), %rax
movq 0x88(%rax), %rdi
callq 0x1676a0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0x15d260
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rsi
callq 0x15b820
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x70(%rax), %rsi
callq 0x15b820
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x15b820
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/pcpaint.c
// Function: do_read_alt_palette_file
static int do_read_alt_palette_file(deark *c, lctx *d)
{
	const char *palfn;
	dbuf *palfile = NULL;
	int retval = 0;
	i64 magic;

	palfn = de_get_ext_option(c, "palfile");
	if(!palfn) palfn = de_get_ext_option(c, "file2");
	if(!palfn) {
		retval = 1;
		goto done;
	}

	de_dbg(c, "[reading palette from alternate file]");

	palfile = dbuf_open_input_file(c, palfn);
	if(!palfile) {
		goto done;
	}

	magic = dbuf_getu16le(palfile, 0);
	if(magic!=0x1234) {
		de_err(c, "Palette file is not in PIC format.");
		goto done;
	}

	do_read_palette_data(c, d, palfile, &d->pal_info_palfile);

	if(d->pal_info_palfile.edesc==0) {
		de_warn(c, "Palette file does not contain palette information.");
		retval = 1;
		goto done;
	}

	d->pal_info_to_use = &d->pal_info_palfile;
	retval = 1;

done:
	dbuf_close(palfile);
	return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movq -0x8(%rbp), %rdi
leaq 0xa26ea(%rip), %rsi     # 0x1a4864
callq 0x15cb30
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x10219e
movq -0x8(%rbp), %rdi
leaq 0x9a3e3(%rip), %rsi     # 0x19c578
callq 0x15cb30
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x1021b1
movl $0x1, -0x24(%rbp)
jmp 0x102264
movq -0x8(%rbp), %rdi
leaq 0xbf49a(%rip), %rsi     # 0x1c1656
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x168de0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x1021e0
jmp 0x102264
movq -0x20(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x165280
movq %rax, -0x30(%rbp)
cmpq $0x1234, -0x30(%rbp)    # imm = 0x1234
je 0x10220f
movq -0x8(%rbp), %rdi
leaq 0xbf476(%rip), %rsi     # 0x1c167c
movb $0x0, %al
callq 0x15bfb0
jmp 0x102264
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x10(%rbp), %rcx
addq $0x60, %rcx
callq 0x102660
movq -0x10(%rbp), %rax
cmpl $0x0, 0x60(%rax)
jne 0x10224d
movq -0x8(%rbp), %rdi
leaq 0xbf462(%rip), %rsi     # 0x1c169f
movb $0x0, %al
callq 0x15bc10
movl $0x1, -0x24(%rbp)
jmp 0x102264
movq -0x10(%rbp), %rcx
addq $0x60, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x78(%rax)
movl $0x1, -0x24(%rbp)
movq -0x20(%rbp), %rdi
callq 0x1676a0
movl -0x24(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/pcpaint.c
// Function: decompress_block
static int decompress_block(deark *c, lctx *d,
	i64 pos1, i64 packed_data_size, u8 run_marker)
{
	i64 pos = pos1;
	i64 end_of_this_block;
	u8 x;
	i64 run_length;

	end_of_this_block = pos1 + packed_data_size;
	if(end_of_this_block > c->infile->len) {
		end_of_this_block = c->infile->len;
	}

	while(pos<end_of_this_block) {
		x = de_getbyte_p(&pos);
		if(x!=run_marker) {
			// An non-compressed part of the image
			dbuf_writebyte(d->unc_pixels, x);
			continue;
		}

		// A compressed run.
		x = de_getbyte_p(&pos);
		if(x!=0) {
			// If nonzero, this byte is the run length.
			run_length = (i64)x;
		}
		else {
			// If zero, it is followed by a 16-bit run length
			run_length = de_getu16le_p(&pos);
		}

		// Read the byte value to repeat (run_length) times.
		x = de_getbyte_p(&pos);
		dbuf_write_run(d->unc_pixels, x, run_length);
	}

	return 1;
}

// 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 -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
addq -0x20(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x18(%rcx), %rcx
cmpq 0x18(%rcx), %rax
jle 0x102594
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x18(%rax), %rax
movq %rax, -0x38(%rbp)
jmp 0x102596
movq -0x30(%rbp), %rax
cmpq -0x38(%rbp), %rax
jge 0x102649
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x30(%rbp), %rsi
callq 0x165170
movb %al, -0x39(%rbp)
movzbl -0x39(%rbp), %eax
movzbl -0x21(%rbp), %ecx
cmpl %ecx, %eax
je 0x1025da
movq -0x10(%rbp), %rax
movq 0x88(%rax), %rdi
movzbl -0x39(%rbp), %esi
callq 0x168380
jmp 0x102596
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x30(%rbp), %rsi
callq 0x165170
movb %al, -0x39(%rbp)
movzbl -0x39(%rbp), %eax
cmpl $0x0, %eax
je 0x102601
movzbl -0x39(%rbp), %eax
movq %rax, -0x48(%rbp)
jmp 0x102616
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x30(%rbp), %rsi
callq 0x1652c0
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x30(%rbp), %rsi
callq 0x165170
movb %al, -0x39(%rbp)
movq -0x10(%rbp), %rax
movq 0x88(%rax), %rdi
movb -0x39(%rbp), %al
movq -0x48(%rbp), %rdx
movzbl %al, %esi
callq 0x168800
jmp 0x102596
movl $0x1, %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/pcpaint.c
// Function: do_read_palette_data
static int do_read_palette_data(deark *c, lctx *d, dbuf *f, struct pal_info *palinfo)
{
	palinfo->edesc = (UI)dbuf_getu16le(f, 13);
	palinfo->esize = dbuf_getu16le(f, 15);
	palinfo->data = de_malloc(c, palinfo->esize);
	dbuf_read(f, palinfo->data, 17, palinfo->esize);
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x18(%rbp), %rdi
movl $0xd, %esi
callq 0x165280
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x18(%rbp), %rdi
movl $0xf, %esi
callq 0x165280
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x15b780
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rcx
movl $0x11, %edx
callq 0x164d10
movl $0x1, %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/pcpaint.c
// Function: decode_bilevel
static void decode_bilevel(deark *c, lctx *d)
{
	i64 src_rowspan;
	int is_grayscale;
	UI edesc = d->pal_info_to_use->edesc;
	de_bitmap *img = NULL;

	if(!d->unc_pixels) goto done;

	acquire_palette(c, d, 2);

	// PCPaint's CGA and EGA 2-color modes used gray shade 170 instead of
	// white (255). Maybe they should be interpreted as white, but for
	// historical accuracy I'll go with gray170.
	if(edesc==0 && (d->video_mode==0x43 || d->video_mode==0x45)) {
		d->pal[1] = DE_MAKE_GRAY(170);
	}

	d->pdwidth = de_pad_to_n(d->npwidth, 8);
	src_rowspan = d->pdwidth/8;
	is_grayscale = de_is_grayscale_palette(d->pal, 2);
	img = de_bitmap_create2(c, d->npwidth, d->pdwidth, d->height, is_grayscale?1:3);

	de_convert_image_paletted(d->unc_pixels, 0,
		1, src_rowspan, d->pal, img, 0);

	de_bitmap_write_to_file_finfo(img, d->fi, DE_CREATEFLAG_FLIP_IMAGE|
		DE_CREATEFLAG_OPT_IMAGE);

done:
	de_bitmap_destroy(img);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x78(%rax), %rax
movl (%rax), %eax
movl %eax, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x88(%rax)
jne 0x102aa8
jmp 0x102bba
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x2, %edx
callq 0x103060
cmpl $0x0, -0x20(%rbp)
jne 0x102ae8
movq -0x10(%rbp), %rax
movzbl 0x3a(%rax), %eax
cmpl $0x43, %eax
je 0x102ada
movq -0x10(%rbp), %rax
movzbl 0x3a(%rax), %eax
cmpl $0x45, %eax
jne 0x102ae8
movq -0x10(%rbp), %rax
movl $0xffaaaaaa, 0xa0(%rax) # imm = 0xFFAAAAAA
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
movl $0x8, %esi
callq 0x15ce90
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movl $0x8, %ecx
cqto
idivq %rcx
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
addq $0x9c, %rdi
movl $0x2, %esi
callq 0x16aa20
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rdx
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rcx
movl -0x1c(%rbp), %r9d
movl $0x3, %r8d
movl $0x1, %eax
cmpl $0x0, %r9d
cmovnel %eax, %r8d
callq 0x16b7f0
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x88(%rax), %rdi
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %r8
addq $0x9c, %r8
movq -0x28(%rbp), %r9
xorl %eax, %eax
movl %eax, %esi
movl $0x1, %edx
xorl %eax, %eax
movl $0x0, (%rsp)
callq 0x16c520
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
movl $0x6, %edx
callq 0x16afa0
movq -0x28(%rbp), %rdi
callq 0x16af60
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/pcpaint.c
// Function: decode_cga4
static void decode_cga4(deark *c, lctx *d)
{
	i64 src_rowspan;
	de_bitmap *img = NULL;

	if(!d->unc_pixels) goto done;

	acquire_palette(c, d, 4);

	d->pdwidth = de_pad_to_4(d->npwidth);
	src_rowspan = d->pdwidth/4;
	img = de_bitmap_create2(c, d->npwidth, d->pdwidth, d->height, 3);

	de_convert_image_paletted(d->unc_pixels, 0,
		2, src_rowspan, d->pal, img, 0);

	de_bitmap_write_to_file_finfo(img, d->fi, DE_CREATEFLAG_FLIP_IMAGE);

done:
	de_bitmap_destroy(img);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x88(%rax)
jne 0x102bfb
jmp 0x102cb1
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x4, %edx
callq 0x103060
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x15ce30
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movl $0x4, %ecx
cqto
idivq %rcx
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rdx
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rcx
movl $0x3, %r8d
callq 0x16b7f0
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x88(%rax), %rdi
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %r8
addq $0x9c, %r8
movq -0x20(%rbp), %r9
xorl %eax, %eax
movl %eax, %esi
movl $0x2, %edx
xorl %eax, %eax
movl $0x0, (%rsp)
callq 0x16c520
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
movl $0x4, %edx
callq 0x16afa0
movq -0x20(%rbp), %rdi
callq 0x16af60
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/pcpaint.c
// Function: decode_egavga16
static void decode_egavga16(deark *c, lctx *d)
{
	i64 src_rowspan;
	de_bitmap *img = NULL;

	acquire_palette(c, d, 16);

	d->pdwidth = de_pad_to_2(d->npwidth);
	src_rowspan = d->pdwidth/2;

	img = de_bitmap_create2(c, d->npwidth, d->pdwidth, d->height, 3);
	de_convert_image_paletted(d->unc_pixels, 0, 4, src_rowspan, d->pal, img, 0);
	de_bitmap_write_to_file_finfo(img, d->fi, DE_CREATEFLAG_FLIP_IMAGE);
	de_bitmap_destroy(img);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x10, %edx
callq 0x103060
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x15cdf0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movl $0x2, %ecx
cqto
idivq %rcx
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rdx
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rcx
movl $0x3, %r8d
callq 0x16b7f0
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x88(%rax), %rdi
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %r8
addq $0x9c, %r8
movq -0x20(%rbp), %r9
xorl %eax, %eax
movl %eax, %esi
movl $0x4, %edx
xorl %eax, %eax
movl $0x0, (%rsp)
callq 0x16c520
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
movl $0x4, %edx
callq 0x16afa0
movq -0x20(%rbp), %rdi
callq 0x16af60
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/pcpaint.c
// Function: decode_vga256
static void decode_vga256(deark *c, lctx *d)
{
	de_bitmap *img = NULL;

	acquire_palette(c, d, 256);

	img = de_bitmap_create2(c, d->npwidth, d->pdwidth, d->height, 3);

	de_convert_image_paletted(d->unc_pixels, 0,
		8, img->width, d->pal, img, 0);

	de_bitmap_write_to_file_finfo(img, d->fi, DE_CREATEFLAG_FLIP_IMAGE);

	de_bitmap_destroy(img);
}

// 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
movq -0x10(%rbp), %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x103060
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rdx
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rcx
movl $0x3, %r8d
callq 0x16b7f0
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x88(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x10(%rbp), %r8
addq $0x9c, %r8
movq -0x18(%rbp), %r9
xorl %eax, %eax
movl %eax, %esi
movl $0x8, %edx
xorl %eax, %eax
movl $0x0, (%rsp)
callq 0x16c520
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
movl $0x4, %edx
callq 0x16afa0
movq -0x18(%rbp), %rdi
callq 0x16af60
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/pcpaint.c
// Function: decode_4color_planar
static void decode_4color_planar(deark *c, lctx *d)
{
	de_bitmap *img = NULL;
	i64 src_rowspan;
	i64 src_planespan;

	acquire_palette(c, d, 4);

	d->pdwidth = de_pad_to_n(d->npwidth, 8);
	src_rowspan = d->pdwidth/8;
	src_planespan = src_rowspan*d->height;

	img = de_bitmap_create2(c, d->npwidth, d->pdwidth, d->height, 3);
	de_convert_image_paletted_planar(d->unc_pixels, 0, 2, src_rowspan, src_planespan,
		d->pal, img, 0x02);
	de_bitmap_write_to_file_finfo(img, d->fi, DE_CREATEFLAG_FLIP_IMAGE);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x4, %edx
callq 0x103060
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
movl $0x8, %esi
callq 0x15ce90
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movl $0x8, %ecx
cqto
idivq %rcx
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
imulq 0x28(%rcx), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rdx
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rcx
movl $0x3, %r8d
callq 0x16b7f0
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x88(%rax), %rdi
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %r8
movq -0x10(%rbp), %r9
addq $0x9c, %r9
movq -0x18(%rbp), %rax
xorl %edx, %edx
movl %edx, %esi
movl $0x2, %edx
movq %rax, (%rsp)
movl $0x2, 0x8(%rsp)
callq 0x16c690
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
movl $0x4, %edx
callq 0x16afa0
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/pcpaint.c
// Function: decode_egavga16_planar
static void decode_egavga16_planar(deark *c, lctx *d)
{
	i64 src_rowspan;
	i64 src_planespan;
	de_bitmap *img = NULL;

	acquire_palette(c, d, 16);

	d->pdwidth = de_pad_to_n(d->npwidth, 8);
	src_rowspan = d->pdwidth/8;
	src_planespan = src_rowspan*d->height;

	img = de_bitmap_create2(c, d->npwidth, d->pdwidth, d->height, 3);
	de_convert_image_paletted_planar(d->unc_pixels, 0, 4, src_rowspan,
		src_planespan, d->pal, img, 0x2);
	de_bitmap_write_to_file_finfo(img, d->fi, DE_CREATEFLAG_FLIP_IMAGE);
	de_bitmap_destroy(img);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x10, %edx
callq 0x103060
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
movl $0x8, %esi
callq 0x15ce90
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movl $0x8, %ecx
cqto
idivq %rcx
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
imulq 0x28(%rcx), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rdx
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rcx
movl $0x3, %r8d
callq 0x16b7f0
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x88(%rax), %rdi
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %r8
movq -0x10(%rbp), %r9
addq $0x9c, %r9
movq -0x28(%rbp), %rax
xorl %edx, %edx
movl %edx, %esi
movl $0x4, %edx
movq %rax, (%rsp)
movl $0x2, 0x8(%rsp)
callq 0x16c690
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
movl $0x4, %edx
callq 0x16afa0
movq -0x28(%rbp), %rdi
callq 0x16af60
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/pcpaint.c
// Function: acquire_palette_cga4color
static void acquire_palette_cga4color(deark *c, lctx *d)
{
	u8 pal_subid = 0;
	u8 border_col = 0;

	// Image includes information about which CGA 4-color palette it uses.

	// This assumes PIC format. That should be the case, since edesc will
	// be zero for CLP format (unless we are reading the palette from a separate
	// PIC file).
	if(d->pal_info_to_use->esize >= 1)
		pal_subid = d->pal_info_to_use->data[0];
	if(d->pal_info_to_use->esize >= 2)
		border_col = d->pal_info_to_use->data[1];
	de_dbg(c, "pal id: 0x%02x", pal_subid);
	de_dbg(c, "border: 0x%02x", border_col);
	de_copy_std_palette(DE_PALID_CGA, pal_subid, 0, d->pal, 4, 0);

	// Replace the first palette color with the border/background color.
	d->pal[0] = de_get_std_palette_entry(DE_PALID_PC16, 0, (int)border_col);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb $0x0, -0x11(%rbp)
movb $0x0, -0x12(%rbp)
movq -0x10(%rbp), %rax
movq 0x78(%rax), %rax
cmpq $0x1, 0x8(%rax)
jl 0x103308
movq -0x10(%rbp), %rax
movq 0x78(%rax), %rax
movq 0x10(%rax), %rax
movb (%rax), %al
movb %al, -0x11(%rbp)
movq -0x10(%rbp), %rax
movq 0x78(%rax), %rax
cmpq $0x2, 0x8(%rax)
jl 0x103329
movq -0x10(%rbp), %rax
movq 0x78(%rax), %rax
movq 0x10(%rax), %rax
movb 0x1(%rax), %al
movb %al, -0x12(%rbp)
movq -0x8(%rbp), %rdi
movzbl -0x11(%rbp), %edx
leaq 0xbe591(%rip), %rsi     # 0x1c18c9
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movzbl -0x12(%rbp), %edx
leaq 0xbe58a(%rip), %rsi     # 0x1c18d8
movb $0x0, %al
callq 0x15b0d0
movzbl -0x11(%rbp), %esi
movq -0x10(%rbp), %rcx
addq $0x9c, %rcx
movl $0xa, %edi
xorl %eax, %eax
movl %eax, %edx
movl $0x4, %r8d
xorl %r9d, %r9d
callq 0x161320
movzbl -0x12(%rbp), %edx
movl $0x14, %edi
xorl %esi, %esi
callq 0x161150
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x9c(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/pcpaint.c
// Function: acquire_palette_indirect16col
static void acquire_palette_indirect16col(deark *c, lctx *d, i64 num_entries)
{
	i64 k;

	for(k=0; k<16; k++) {
		if(k >= d->pal_info_to_use->esize) break;
		d->pal[k] = de_get_std_palette_entry(DE_PALID_PC16, 0, (int)d->pal_info_to_use->data[k]);
		de_dbg2(c, "pal[%3d] = %u", (int)k, (UI)d->pal_info_to_use->data[k]);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
cmpq $0x10, -0x20(%rbp)
jge 0x103449
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x78(%rcx), %rcx
cmpq 0x8(%rcx), %rax
jl 0x1033db
jmp 0x103449
movq -0x10(%rbp), %rax
movq 0x78(%rax), %rax
movq 0x10(%rax), %rax
movq -0x20(%rbp), %rcx
movzbl (%rax,%rcx), %edx
movl $0x14, %edi
xorl %esi, %esi
callq 0x161150
movl %eax, %edx
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
movl %edx, 0x9c(%rax,%rcx,4)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl %eax, %edx
movq -0x10(%rbp), %rax
movq 0x78(%rax), %rax
movq 0x10(%rax), %rax
movq -0x20(%rbp), %rcx
movzbl (%rax,%rcx), %ecx
leaq 0xbe4b6(%rip), %rsi     # 0x1c18e7
movb $0x0, %al
callq 0x15b350
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x1033bc
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/pcpaint.c
// Function: acquire_palette_ega64idx
static void acquire_palette_ega64idx(deark *c, lctx *d, i64 num_entries)
{
	i64 k;
	char tmps[32];

	for(k=0; k<num_entries; k++) {
		if(k >= d->pal_info_to_use->esize) break;
		d->pal[k] = de_get_std_palette_entry(DE_PALID_EGA64, 0, (int)d->pal_info_to_use->data[k]);
		de_snprintf(tmps, sizeof(tmps), "%2d ", (int)d->pal_info_to_use->data[k]);
		de_dbg_pal_entry2(c, k, d->pal[k], tmps, NULL, NULL);
	}
}

// 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 -0x20(%rbp), %rax
cmpq -0x18(%rbp), %rax
jge 0x103526
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x78(%rcx), %rcx
cmpq 0x8(%rcx), %rax
jl 0x103491
jmp 0x103526
movq -0x10(%rbp), %rax
movq 0x78(%rax), %rax
movq 0x10(%rax), %rax
movq -0x20(%rbp), %rcx
movzbl (%rax,%rcx), %edx
movl $0x1e, %edi
xorl %esi, %esi
callq 0x161150
movl %eax, %edx
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
movl %edx, 0x9c(%rax,%rcx,4)
leaq -0x40(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x78(%rax), %rax
movq 0x10(%rax), %rax
movq -0x20(%rbp), %rcx
movzbl (%rax,%rcx), %ecx
movl $0x20, %esi
leaq 0xa6b3e(%rip), %rdx     # 0x1aa024
movb $0x0, %al
callq 0x15a980
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
movl 0x9c(%rax,%rcx,4), %edx
leaq -0x40(%rbp), %rcx
xorl %eax, %eax
movl %eax, %r9d
movq %r9, %r8
callq 0x15bdb0
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x10346c
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/pcpaint.c
// Function: set_density
static void set_density(deark *c, lctx *d)
{
	if(!d->fi) return;
	if(d->ver<2) return;

	switch(d->video_mode) {
	case 'A': // 320x200
	case 'B':
	case 'I':
	case 'J':
	case 'L':
		d->fi->density.code = DE_DENSITY_UNK_UNITS;
		d->fi->density.xdens = 240.0;
		d->fi->density.ydens = 200.0;
		break;
	case 'H': // 720x348 (Hercules)
	case 'N':
		d->fi->density.code = DE_DENSITY_UNK_UNITS;
		// Various sources suggest aspect ratios of 1.46, 1.55, 1.59, ...
		d->fi->density.xdens = 155.0;
		d->fi->density.ydens = 100.0;
		break;
	case 'E': // 640x350
	case 'F':
	case 'G':
		d->fi->density.code = DE_DENSITY_UNK_UNITS;
		d->fi->density.xdens = 480.0;
		d->fi->density.ydens = 350.0;
		break;
	case 'K':
	case 'R':
		d->fi->density.code = DE_DENSITY_UNK_UNITS;
		d->fi->density.xdens = 480.0;
		d->fi->density.ydens = 400.0;
		break;
	case 'C':
	case 'D':
		d->fi->density.code = DE_DENSITY_UNK_UNITS;
		d->fi->density.xdens = 480.0;
		d->fi->density.ydens = 200.0;
		break;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x1037ec
jmp 0x103975
movq -0x10(%rbp), %rax
cmpl $0x2, 0x4(%rax)
jge 0x1037fb
jmp 0x103975
movq -0x10(%rbp), %rax
movzbl 0x3a(%rax), %eax
addl $-0x41, %eax
movl %eax, %ecx
movq %rcx, -0x18(%rbp)
subl $0x11, %eax
ja 0x103975
movq -0x18(%rbp), %rax
leaq 0xbdc54(%rip), %rcx     # 0x1c1474
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movl $0x1, 0x78(%rax)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movsd 0x9bab0(%rip), %xmm0    # 0x19f2f8
movsd %xmm0, 0x80(%rax)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movsd 0x9bab8(%rip), %xmm0    # 0x19f318
movsd %xmm0, 0x88(%rax)
jmp 0x103975
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movl $0x1, 0x78(%rax)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movsd 0xa2a44(%rip), %xmm0    # 0x1a62d0
movsd %xmm0, 0x80(%rax)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movsd 0xa2a24(%rip), %xmm0    # 0x1a62c8
movsd %xmm0, 0x88(%rax)
jmp 0x103975
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movl $0x1, 0x78(%rax)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movsd 0xa2a08(%rip), %xmm0    # 0x1a62d8
movsd %xmm0, 0x80(%rax)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movsd 0xa29f8(%rip), %xmm0    # 0x1a62e0
movsd %xmm0, 0x88(%rax)
jmp 0x103975
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movl $0x1, 0x78(%rax)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movsd 0xa29c4(%rip), %xmm0    # 0x1a62d8
movsd %xmm0, 0x80(%rax)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movsd 0xbdb9c(%rip), %xmm0    # 0x1c14c8
movsd %xmm0, 0x88(%rax)
jmp 0x103975
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movl $0x1, 0x78(%rax)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movsd 0xa2983(%rip), %xmm0    # 0x1a62d8
movsd %xmm0, 0x80(%rax)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movsd 0x9b9ab(%rip), %xmm0    # 0x19f318
movsd %xmm0, 0x88(%rax)
popq %rbp
retq
nopw (%rax,%rax)