LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/pif.c
// Function: de_identify_pif
static int de_identify_pif(deark *c)
{
	int maybe_oldfmt = 0;
	int has_id = 0;
	int has_ext;

	if(c->infile->len == PIF_BASIC_SECTION_SIZE) {
		maybe_oldfmt = 1;
	}
	else if(c->infile->len >= PIF_BASIC_SECTION_SIZE+22) {
		has_id = !dbuf_memcmp(c->infile, PIF_BASIC_SECTION_SIZE,
			(const u8*)"MICROSOFT PIFEX\0", 16);
	}

	if(!maybe_oldfmt && !has_id) return 0;
	has_ext = de_input_file_has_ext(c, "pif");
	if(maybe_oldfmt) {
		return has_ext ? 24 : 0;
	}
	return has_ext ? 100 : 35;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
movq 0x18(%rdi), %rdi
movq 0x18(%rdi), %r15
cmpq $0x171, %r15            # imm = 0x171
jne 0xbdd25
leaq 0x7b114(%rip), %rsi     # 0x138e1f
movq %r14, %rdi
callq 0xea936
cmpq $0x171, %r15            # imm = 0x171
jne 0xbdd4c
testl %eax, %eax
movl $0x18, %ebx
jmp 0xbdd58
xorl %ebx, %ebx
cmpq $0x187, %r15            # imm = 0x187
jl 0xbdd5b
leaq 0x7b39d(%rip), %rdx     # 0x1390d4
movl $0x171, %esi            # imm = 0x171
movl $0x10, %ecx
callq 0xf025e
testl %eax, %eax
jne 0xbdd5b
jmp 0xbdd04
testl %eax, %eax
movl $0x23, %eax
movl $0x64, %ebx
cmovel %eax, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/pif.c
// Function: de_module_desqview_dvp
void de_module_desqview_dvp(deark *c, struct deark_module_info *mi)
{
	mi->id = "desqview_dvp";
	mi->desc = "DESQview Program Information File";
	mi->identify_fn = de_identify_desqview_dvp;
	mi->run_fn = de_run_desqview_dvp;
}

// Assembly:
leaq 0x7b0c5(%rip), %rax     # 0x138e44
movq %rax, (%rsi)
leaq 0x7b0c8(%rip), %rax     # 0x138e51
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0xbdda4
movq %rax, 0x20(%rsi)
leaq 0x51(%rip), %rax        # 0xbddf0
movq %rax, 0x18(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/pif.c
// Function: de_identify_desqview_dvp
static int de_identify_desqview_dvp(deark *c)
{
	int has_ext;

	if(c->infile->len!=416) return 0;
	if(de_getbyte(0) != 0x00) return 0;
	has_ext = de_input_file_has_ext(c, "dvp");
	if(has_ext) return 40;
	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
xorl %r14d, %r14d
cmpq $0x1a0, 0x18(%rdi)      # imm = 0x1A0
jne 0xbdde5
xorl %r14d, %r14d
xorl %esi, %esi
callq 0xef0d5
testb %al, %al
jne 0xbdde5
leaq 0x7b07c(%rip), %rsi     # 0x138e4d
movq %rbx, %rdi
callq 0xea936
testl %eax, %eax
movl $0x28, %r14d
cmovel %eax, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/printshop.c
// Function: de_module_printshop
void de_module_printshop(deark *c, struct deark_module_info *mi)
{
	mi->id = "printshop";
	mi->desc = "The Print Shop .DAT/.NAM";
	mi->run_fn = de_run_printshop;
	mi->identify_fn = de_identify_printshop;
}

// Assembly:
leaq 0x7a8ae(%rip), %rax     # 0x139101
movq %rax, (%rsi)
leaq 0x7a888(%rip), %rax     # 0x1390e5
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0xbe878
movq %rax, 0x18(%rsi)
leaq 0x4b(%rip), %rax        # 0xbe8be
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/printshop.c
// Function: de_run_printshop
static void de_run_printshop(deark *c, de_module_params *mparams)
{
	lctx *d;
	d = de_malloc(c, sizeof(lctx));
	d->fmt = PRINTSHOP_FMT_DAT;
	de_declare_fmt(c, "The Print Shop (DAT/NAM)");
	do_printshop_etc(c, d);
	de_free(c, d);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x10, %esi
callq 0xe969b
movq %rax, %r14
movl $0x1, (%rax)
leaq 0x7a8d6(%rip), %rsi     # 0x13916f
movq %rbx, %rdi
callq 0xeb6d6
movq %rbx, %rdi
movq %r14, %rsi
callq 0xbeb95
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xe9752
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/printshop.c
// Function: de_module_newprintshop
void de_module_newprintshop(deark *c, struct deark_module_info *mi)
{
	// There's no surefire way to distinguish between Print Shop and
	// New Print Shop files, so it's more convenient to put them in separate
	// modules (so the user can simply use -m to select the format).
	mi->id = "newprintshop";
	mi->desc = "The New Print Shop .POG/.PNM";
	mi->run_fn = de_run_newprintshop;
	mi->identify_fn = de_identify_newprintshop;
}

// Assembly:
leaq 0x7a7e7(%rip), %rax     # 0x1390fe
movq %rax, (%rsi)
leaq 0x7a7ea(%rip), %rax     # 0x13910b
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0xbe93c
movq %rax, 0x18(%rsi)
leaq 0x4b(%rip), %rax        # 0xbe982
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/printshop.c
// Function: de_run_newprintshop
static void de_run_newprintshop(deark *c, de_module_params *mparams)
{
	lctx *d;
	d = de_malloc(c, sizeof(lctx));
	d->fmt = PRINTSHOP_FMT_POG;
	de_declare_fmt(c, "The New Print Shop (POG/PNM)");
	do_printshop_etc(c, d);
	de_free(c, d);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x10, %esi
callq 0xe969b
movq %rax, %r14
movl $0x2, (%rax)
leaq 0x7a8bf(%rip), %rsi     # 0x13921c
movq %rbx, %rdi
callq 0xeb6d6
movq %rbx, %rdi
movq %r14, %rsi
callq 0xbeb95
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xe9752
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/printshop.c
// Function: de_module_printmaster
void de_module_printmaster(deark *c, struct deark_module_info *mi)
{
	mi->id = "printmaster";
	mi->desc = "PrintMaster .SHP/.SDR";
	mi->run_fn = de_run_printmaster;
	mi->identify_fn = de_identify_printmaster;
}

// Assembly:
leaq 0x7a744(%rip), %rax     # 0x139128
movq %rax, (%rsi)
leaq 0x7a746(%rip), %rax     # 0x139134
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0xbea09
movq %rax, 0x18(%rsi)
leaq 0x4b(%rip), %rax        # 0xbea4f
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/printshop.c
// Function: de_run_printmaster
static void de_run_printmaster(deark *c, de_module_params *mparams)
{
	lctx *d;
	d = de_malloc(c, sizeof(lctx));
	d->fmt = PRINTSHOP_FMT_SHP;
	de_declare_fmt(c, "PrintMaster (SHP/SDR)");
	do_printshop_etc(c, d);
	de_free(c, d);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x10, %esi
callq 0xe969b
movq %rax, %r14
movl $0x3, (%rax)
leaq 0x7a813(%rip), %rsi     # 0x13923d
movq %rbx, %rdi
callq 0xeb6d6
movq %rbx, %rdi
movq %r14, %rsi
callq 0xbeb95
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xe9752
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/printshop.c
// Function: de_identify_printmaster
static int de_identify_printmaster(deark *c)
{
	u8 b[4];
	int sdr_ext;

	sdr_ext = de_input_file_has_ext(c, "sdr");
	de_read(b, 0, 4);
	if(!de_memcmp(b, "\x0b\x34\x58", 3)) {
		return sdr_ext ? 90 : 10;
	}
	if(!sdr_ext) return 0;
	if(b[0]==0x0b) return 30;
	return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x7a7f2(%rip), %rsi     # 0x139253
callq 0xea936
movl %eax, %ebp
movq 0x18(%rbx), %rdi
xorl %ebx, %ebx
leaq 0xc(%rsp), %r14
movl $0x4, %ecx
movq %r14, %rsi
xorl %edx, %edx
callq 0xeeee8
movzwl (%r14), %eax
xorl $0x340b, %eax           # imm = 0x340B
movzbl 0x2(%r14), %ecx
xorl $0x58, %ecx
orw %ax, %cx
je 0xbeaad
testl %ebp, %ebp
je 0xbeabc
xorl %eax, %eax
cmpb $0xb, 0xc(%rsp)
movl $0x1e, %ebx
cmovnel %eax, %ebx
jmp 0xbeabc
testl %ebp, %ebp
movl $0xa, %eax
movl $0x5a, %ebx
cmovel %eax, %ebx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/printshop.c
// Function: de_module_printshop_gs
void de_module_printshop_gs(deark *c, struct deark_module_info *mi)
{
	mi->id = "printshop_gs";
	mi->desc = "Print Shop - Apple IIgs";
	mi->run_fn = de_run_printshop_gs;
	mi->identify_fn = NULL;
}

// Assembly:
leaq 0x7a67c(%rip), %rax     # 0x13914a
movq %rax, (%rsi)
leaq 0x7a67f(%rip), %rax     # 0x139157
movq %rax, 0x8(%rsi)
leaq 0xd(%rip), %rax         # 0xbeaf0
movq %rax, 0x18(%rsi)
movq $0x0, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/printshop.c
// Function: de_run_printshop_gs
static void de_run_printshop_gs(deark *c, de_module_params *mparams)
{
	de_bitmap *img = NULL;
	de_finfo *fi = NULL;
	static const de_color pal[8] = {
		0xffffffffU,0xffffff00U,0xffff0000U,0xffff6600U,
		0xff0000ffU,0xff00ff00U,0xffcc00ccU,0xff000000U };

	img = de_bitmap_create(c, 88, 52, 3);
	fi = de_finfo_create(c);
	fi->density.code = DE_DENSITY_UNK_UNITS;
	// I don't know what the density ratio should be.
	// But 88:52 (1.692:1), making the images square, seems pretty close
	// to what was intended.
	fi->density.xdens = 88.0;
	fi->density.ydens = 52.0;
	de_convert_image_paletted_planar(c->infile, 0, 3, 11, 11*52, pal, img, 0x2);
	de_bitmap_write_to_file_finfo(img, fi, DE_CREATEFLAG_OPT_IMAGE);
	de_bitmap_destroy(img);
	de_finfo_destroy(c, fi);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl $0x58, %esi
movl $0x34, %edx
movl $0x3, %ecx
callq 0xf2cab
movq %rax, %r14
movq %rbx, %rdi
callq 0xea9a9
movq %rax, %r15
movl $0x1, 0x78(%rax)
movabsq $0x4056000000000000, %rax # imm = 0x4056000000000000
movq %rax, 0x80(%r15)
movabsq $0x404a000000000000, %rax # imm = 0x404A000000000000
movq %rax, 0x88(%r15)
movq 0x18(%rbx), %rdi
leaq 0x7a712(%rip), %r9      # 0x139260
movl $0x3, %edx
movl $0xb, %ecx
movl $0x23c, %r8d            # imm = 0x23C
xorl %esi, %esi
pushq $0x2
pushq %r14
callq 0xf36f9
addq $0x10, %rsp
movq %r14, %rdi
movq %r15, %rsi
movl $0x2, %edx
callq 0xf2917
movq %r14, %rdi
callq 0xf28d4
movq %rbx, %rdi
movq %r15, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0xea9b3
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/psf.c
// Function: de_module_psf
void de_module_psf(deark *c, struct deark_module_info *mi)
{
	mi->id = "psf";
	mi->desc = "PC Screen Font";
	mi->run_fn = de_run_psf;
	mi->identify_fn = de_identify_psf;
	mi->help_fn = de_help_psf;
}

// Assembly:
leaq 0x7a3c9(%rip), %rax     # 0x139280
movq %rax, (%rsi)
leaq 0x7a3c3(%rip), %rax     # 0x139284
movq %rax, 0x8(%rsi)
leaq 0x1b(%rip), %rax        # 0xbeee7
movq %rax, 0x18(%rsi)
leaq 0x80e(%rip), %rax       # 0xbf6e5
movq %rax, 0x20(%rsi)
leaq 0x859(%rip), %rax       # 0xbf73b
movq %rax, 0x28(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/psf.c
// Function: do_extra_codepoint
static void do_extra_codepoint(deark *c, lctx *d, struct de_bitmap_font *font,
	i64 cur_idx, i32 n)
{
	i64 extra_idx;

	if(!d->read_extra_codepoints) return;
	if(d->num_extra_codepoints >= MAX_EXTRA_CODEPOINTS) return;

	extra_idx = d->index_of_first_extra_codepoint + d->num_extra_codepoints;
	de_dbg2(c, "char[%d] alias [%d] = U+%04x", (int)cur_idx, (int)extra_idx,
		(unsigned int)n);
	if(n == font->char_array[cur_idx].codepoint_unicode) {
		de_dbg2(c, "ignoring superfluous alias");
		return;
	}
	font->char_array[extra_idx].codepoint_unicode = n;
	font->char_array[extra_idx].bitmap = font->char_array[cur_idx].bitmap;
	d->num_extra_codepoints++;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x0, 0x50(%rsi)
je 0xbf7d9
movq %rsi, %rbx
movq 0x68(%rsi), %r13
cmpq $0x7cf, %r13            # imm = 0x7CF
jg 0xbf7d9
movl %r8d, %ebp
movq %rcx, %r15
movq %rdx, %r12
movq %rdi, %r14
addq 0x60(%rbx), %r13
leaq 0x79c75(%rip), %rsi     # 0x1393f6
movl %r15d, %edx
movl %r13d, %ecx
xorl %eax, %eax
callq 0xe93cf
movq 0x20(%r12), %rax
leaq (%r15,%r15,4), %rcx
cmpl %ebp, 0x4(%rax,%rcx,8)
jne 0xbf7bc
leaq 0x79c6f(%rip), %rsi     # 0x139413
movq %r14, %rdi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe93cf
leaq (,%r13,4), %rdx
addq %r13, %rdx
movl %ebp, 0x4(%rax,%rdx,8)
movq 0x20(%rax,%rcx,8), %rcx
movq %rcx, 0x20(%rax,%rdx,8)
incq 0x68(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/psionapp.c
// Function: de_module_psionapp
void de_module_psionapp(deark *c, struct deark_module_info *mi)
{
	mi->id = "psionapp";
	mi->desc = "Psion .APP/.IMG and .OPA/.OPO";
	mi->desc2 = "extract images";
	mi->run_fn = de_run_psionapp;
	mi->identify_fn = de_identify_psionapp;
}

// Assembly:
leaq 0x79ca1(%rip), %rax     # 0x139490
movq %rax, (%rsi)
leaq 0x79ca0(%rip), %rax     # 0x139499
movq %rax, 0x8(%rsi)
leaq 0x79cb3(%rip), %rax     # 0x1394b7
movq %rax, 0x10(%rsi)
leaq 0x10(%rip), %rax        # 0xbf81f
movq %rax, 0x18(%rsi)
leaq 0x127(%rip), %rax       # 0xbf941
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/psionapp.c
// Function: de_run_psionapp
static void de_run_psionapp(deark *c, de_module_params *mparams)
{
	u8 b;
	const char *s;
	lctx *d = NULL;

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

	s = de_get_ext_option(c, "psionapp:convertpic");
	if(s) {
		d->convert_images = 1;
	}

	b = de_getbyte(0);
	if(b=='O') {
		do_opo_opa(c, d);
	}
	else {
		do_img_app(c, d);
	}

	de_free(c, d);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movl $0x4, %esi
callq 0xe969b
movq %rax, %r14
leaq 0x79c87(%rip), %rsi     # 0x1394c6
movq %rbx, %rdi
callq 0xea6cb
testq %rax, %rax
je 0xbf853
movl $0x1, (%r14)
movq 0x18(%rbx), %rdi
xorl %esi, %esi
callq 0xef0d5
cmpb $0x4f, %al
jne 0xbf8dc
leaq 0x79c71(%rip), %rsi     # 0x1394da
movq %rbx, %rdi
callq 0xeb6d6
movq 0x18(%rbx), %rdi
movl $0x12, %esi
callq 0xef1ca
movq %rax, %r15
leaq 0x79c5f(%rip), %rsi     # 0x1394e8
movq %rbx, %rdi
movl %r15d, %edx
xorl %eax, %eax
callq 0xe9226
movq 0x18(%rbx), %rdi
movl $0x14, %esi
callq 0xef0d5
movzbl %al, %r12d
addq $0x15, %r12
cmpq %r15, %r12
jge 0xbf92d
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xef1ca
movq %rax, %r13
leaq 0x2(%r12), %rdx
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rcx
callq 0xbf9a7
addq %r13, %r12
addq $0x2, %r12
jmp 0xbf8ac
leaq 0x79c68(%rip), %rsi     # 0x13954b
movq %rbx, %rdi
callq 0xeb6d6
movl $0x28, %r15d
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xef1ca
movq %rax, %r12
movq 0x18(%rbx), %rdi
leaq 0x2(%r15), %rsi
callq 0xef1ca
testq %r12, %r12
je 0xbf92d
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
movq %rax, %rcx
callq 0xbf9a7
addq $0x4, %r15
cmpq $0x38, %r15
jne 0xbf8f1
movq %rbx, %rdi
movq %r14, %rsi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xe9752
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/psionapp.c
// Function: de_identify_psionapp
static int de_identify_psionapp(deark *c)
{
	u8 b[16];
	de_read(b, 0, 16);
	if(!de_memcmp(b, "ImageFileType**\0", 16))
		return 100;
	if(!de_memcmp(b, "OPLObjectFile**\0", 16))
		return 100;
	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq 0x18(%rdi), %rdi
xorl %ebx, %ebx
movq %rsp, %r14
movl $0x10, %ecx
movq %r14, %rsi
xorl %edx, %edx
callq 0xeeee8
movdqa (%r14), %xmm0
pcmpeqb 0x79b03(%rip), %xmm0    # 0x139470
pmovmskb %xmm0, %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
je 0xbf998
movdqa (%rsp), %xmm0
pcmpeqb 0x79afb(%rip), %xmm0    # 0x139480
pmovmskb %xmm0, %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
movl $0x64, %eax
cmovel %eax, %ebx
jmp 0xbf99d
movl $0x64, %ebx
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/psionapp.c
// Function: handle_embedded_file
static void handle_embedded_file(deark *c, lctx *d, i64 offset, i64 len)
{
	u8 buf[16];
	const char *ext;
	int extract_this_file;
	int is_pic;

	de_dbg(c, "embedded file at %d, len=%d", (int)offset, (int)len);
	is_pic = 0;
	ext = "bin";
	extract_this_file = 0;

	if(len>0 && c->extract_level>=2)
		extract_this_file = 1;

	// As far as I can tell, there's no way to tell the type of an
	// embedded file, except by sniffing it.
	de_read(buf, offset, 16);
	if(len>=8) {
		if(!de_memcmp(buf, "PIC\xdc\x30\x30", 6)) {
			// Looks like a PIC file
			is_pic = 1;
			ext = "pic";
			extract_this_file = 1;
		}
	}

	if(extract_this_file) {
		if(is_pic && d->convert_images) {
			// Convert PIC to PNG.
			// For consistency, this option shouldn't exist. But I'm not sure that
			// PIC files embedded in APP files are really the same as PIC files on
			// their own. They might need special handling. Until I'm sure they don't,
			// I'll leave this option here.
			de_run_module_by_id_on_slice(c, "psionpic", NULL, c->infile, offset, len);
		}
		else {
			// Just extract the file
			dbuf_create_file_from_slice(c->infile, offset, len, ext, NULL, is_pic?0:DE_CREATEFLAG_IS_AUX);
		}
	}
	else {
		de_dbg(c, "(not extracting this file)");
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r15
leaq 0x79b3e(%rip), %rsi     # 0x139504
xorl %ebp, %ebp
xorl %eax, %eax
callq 0xe9226
testq %rbx, %rbx
jle 0xbf9e2
xorl %ebp, %ebp
cmpl $0x2, 0x90(%r15)
setge %bpl
movq 0x18(%r15), %rdi
movq %rsp, %rsi
movl $0x10, %ecx
movq %r14, %rdx
callq 0xeeee8
movb $0x1, %al
leaq 0x75a32(%rip), %rcx     # 0x135431
cmpq $0x8, %rbx
jl 0xbfa2a
movl $0xdc434950, %edx       # imm = 0xDC434950
xorl (%rsp), %edx
movzwl 0x4(%rsp), %esi
xorl $0x3030, %esi           # imm = 0x3030
orl %edx, %esi
jne 0xbfa2a
movl $0x1, %ebp
leaq 0x763b5(%rip), %rcx     # 0x135ddd
xorl %eax, %eax
testl %ebp, %ebp
je 0xbfa6e
testb %al, %al
jne 0xbfa56
cmpl $0x0, (%r12)
je 0xbfa56
movq 0x18(%r15), %rcx
leaq 0x79ae3(%rip), %rsi     # 0x139527
movq %r15, %rdi
xorl %edx, %edx
movq %r14, %r8
movq %rbx, %r9
callq 0xea5fa
jmp 0xbfa7f
movq 0x18(%r15), %rdi
movzbl %al, %r9d
movq %r14, %rsi
movq %rbx, %rdx
xorl %r8d, %r8d
callq 0xf0321
jmp 0xbfa7f
leaq 0x79abb(%rip), %rsi     # 0x139530
movq %r15, %rdi
xorl %eax, %eax
callq 0xe9226
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/psionpic.c
// Function: de_module_psionpic
void de_module_psionpic(deark *c, struct deark_module_info *mi)
{
	mi->id = "psionpic";
	mi->desc = "Psion PIC, a.k.a. EPOC PIC";
	mi->run_fn = de_run_psionpic;
	mi->identify_fn = de_identify_psionpic;
	mi->help_fn = de_help_psionpic;
}

// Assembly:
leaq 0x79a94(%rip), %rax     # 0x139527
movq %rax, (%rsi)
leaq 0x79ade(%rip), %rax     # 0x13957b
movq %rax, 0x8(%rsi)
leaq 0x1b(%rip), %rax        # 0xbfac3
movq %rax, 0x18(%rsi)
leaq 0x38f(%rip), %rax       # 0xbfe42
movq %rax, 0x20(%rsi)
leaq 0x3aa(%rip), %rax       # 0xbfe68
movq %rax, 0x28(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/psionpic.c
// Function: do_bitmap_2planes
static void do_bitmap_2planes(deark *c, lctx *d, i64 pn1, i64 pn2)
{
	de_bitmap *img = NULL;
	i64 planespan;
	// AFAIK, all relevant devices support only 3 colors. Two of the four codes
	// map to black. We'll make the two blacks slightly different, just to avoid
	// losing information.
	static const de_color pal[4] = { 0xffffffff, 0xff808080U, 0xff010101U, 0xff000000U };

	de_dbg(c, "making a grayscale image from planes %d and %d", (int)pn1, (int)pn2);

	// TODO: Support -padpix (need samples with width not a multiple of 16)
	img = de_bitmap_create(c, d->plane_info[pn1].width, d->plane_info[pn1].height, 1);

	planespan = d->plane_info[1].image_pos - d->plane_info[0].image_pos;
	de_convert_image_paletted_planar(c->infile, d->plane_info[0].image_pos, 2,
		d->plane_info[0].rowspan, planespan, pal, img, 0x1);
	de_bitmap_write_to_file(img, NULL, 0);

	de_bitmap_destroy(img);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x79799(%rip), %rsi     # 0x139624
xorl %eax, %eax
callq 0xe9226
movq 0x10(%r15), %rax
leaq (%r14,%r14,2), %rcx
shlq $0x4, %rcx
movq (%rax,%rcx), %rsi
movq 0x8(%rax,%rcx), %rdx
movq %rbx, %rdi
movl $0x1, %ecx
callq 0xf2cab
movq %rax, %r14
movq 0x10(%r15), %rax
movq 0x40(%rax), %r8
movq 0x10(%rax), %rsi
movq 0x20(%rax), %rcx
subq %rsi, %r8
movq 0x18(%rbx), %rdi
leaq 0x797eb(%rip), %r9      # 0x1396c0
movl $0x2, %edx
pushq $0x1
pushq %r14
callq 0xf36f9
addq $0x10, %rsp
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xf2923
movq %r14, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0xf28d4
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/psionpic.c
// Function: do_bitmap_1plane
static void do_bitmap_1plane(deark *c, lctx *d, i64 plane_num)
{
	struct plane_info_struct *pi = &d->plane_info[plane_num];

	de_dbg(c, "making a bilevel image from plane %d", (int)plane_num);

	de_convert_and_write_image_bilevel2(c->infile, pi->image_pos, pi->width, pi->height,
		pi->rowspan, DE_CVTF_WHITEISZERO|DE_CVTF_LSBFIRST, NULL, 0);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x10(%rsi), %r14
leaq (%rdx,%rdx,2), %r15
shlq $0x4, %r15
leaq 0x79738(%rip), %rsi     # 0x139653
xorl %eax, %eax
callq 0xe9226
movq 0x18(%rbx), %rdi
movq 0x10(%r14,%r15), %rsi
movq (%r14,%r15), %rdx
movq 0x8(%r14,%r15), %rcx
movq 0x20(%r14,%r15), %r8
movl $0x3, %r9d
pushq $0x0
pushq $0x0
callq 0xf319c
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/psionpic.c
// Function: could_be_2bit
static int could_be_2bit(lctx *d, int startpos)
{
	i64 i;
	if( (d->num_planes - startpos)%2 != 0) {
		// Not an even number of bitmaps.
		return 0;
	}
	for(i=startpos; i<d->num_planes; i+=2) {
		if(d->plane_info[i].width!=d->plane_info[i+1].width ||
			d->plane_info[i].height!=d->plane_info[i+1].height)
		{
			// Bitmaps aren't the same size.
			return 0;
		}
	}
	return 1;
}

// Assembly:
movq (%rdi), %rcx
movl %ecx, %edx
subl %esi, %edx
xorl %eax, %eax
testb $0x1, %dl
jne 0xbff9f
movl %esi, %edx
cmpq %rdx, %rcx
jle 0xbff9a
movq 0x10(%rdi), %rsi
leaq (%rdx,%rdx,2), %rdi
shlq $0x4, %rdi
addq %rdi, %rsi
addq $0x38, %rsi
movq -0x38(%rsi), %rdi
cmpq -0x8(%rsi), %rdi
jne 0xbff9f
movq -0x30(%rsi), %rdi
cmpq (%rsi), %rdi
jne 0xbff9f
addq $0x2, %rdx
addq $0x60, %rsi
cmpq %rcx, %rdx
jl 0xbff7a
movl $0x1, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/pcf.c
// Function: de_module_pcf
void de_module_pcf(deark *c, struct deark_module_info *mi)
{
	mi->id = "pcf";
	mi->desc = "PCF font";
	mi->run_fn = de_run_pcf;
	mi->identify_fn = de_identify_pcf;
}

// Assembly:
leaq 0x79749(%rip), %rax     # 0x1396f0
movq %rax, (%rsi)
leaq 0x79743(%rip), %rax     # 0x1396f4
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0xbffcc
movq %rax, 0x18(%rsi)
leaq 0x855(%rip), %rax       # 0xc081c
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/pcf.c
// Function: read_and_check_format_field
static int read_and_check_format_field(deark *c, lctx *d, struct table_entry *te, i64 pos)
{
	u32 format;

	format = (u32)de_getu32le_p(&pos);
	de_dbg(c, "format: 0x%08x", (unsigned int)format);
	if(format != te->fmt.raw_format) {
		de_err(c, "Can't handle conflicting \"format\" fields");
		return 0;
	}
	return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8(%rsp), %rsi
movq %rdx, (%rsi)
movq 0x18(%rdi), %rdi
callq 0xef3a0
movq %rax, %r15
leaq 0x78466(%rip), %rsi     # 0x139872
movq %rbx, %rdi
movl %r15d, %edx
xorl %eax, %eax
callq 0xe9226
movl $0x1, %eax
cmpl %r15d, (%r14)
je 0xc1436
leaq 0x78457(%rip), %rsi     # 0x139881
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9df7
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/plist.c
// Function: de_module_plist
void de_module_plist(deark *c, struct deark_module_info *mi)
{
	mi->id = "plist";
	mi->desc = ".plist property list, binary format";
	mi->run_fn = de_run_plist;
	mi->identify_fn = de_identify_plist;
}

// Assembly:
leaq 0x55761(%rip), %rax     # 0x116c0c
movq %rax, (%rsi)
leaq 0x787fb(%rip), %rax     # 0x139cb0
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0xc14d0
movq %rax, 0x18(%rsi)
leaq 0x321(%rip), %rax       # 0xc17ec
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/plist.c
// Function: do_object_int
static void do_object_int(deark *c, lctx *d, i64 pos, i64 dlen_raw)
{
	unsigned int nbytes;
	i64 n;

	if(dlen_raw<0 || dlen_raw>3) return;
	nbytes = 1U<<(unsigned int)dlen_raw;
	n = dbuf_getint_ext(c->infile, pos, nbytes, 0, 1);
	de_dbg(c, "value: %"I64_FMT, n);
}

// Assembly:
cmpq $0x3, %rdx
jbe 0xc1bfd
retq
pushq %rbx
movq %rdi, %rbx
movl $0x1, %eax
movl %edx, %ecx
shll %cl, %eax
movq 0x18(%rdi), %rdi
movl %eax, %edx
xorl %ecx, %ecx
movl $0x1, %r8d
callq 0xef6f2
leaq 0x50b53(%rip), %rsi     # 0x112777
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
popq %rbx
jmp 0xe9226
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/plist.c
// Function: do_object_real
static void do_object_real(deark *c, lctx *d, i64 pos, i64 dlen_raw)
{
	double val;

	if(dlen_raw==2) {
		val = dbuf_getfloat32x(c->infile, pos, 0);
	}
	else if(dlen_raw==3) {
		val = dbuf_getfloat64x(c->infile, pos, 0);
	}
	else {
		return;
	}

	de_dbg(c, "value: %f", val);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpq $0x3, %rdx
je 0xc1c4f
cmpq $0x2, %rdx
jne 0xc1c6c
movq 0x18(%rbx), %rdi
xorl %edx, %edx
callq 0xef935
jmp 0xc1c5a
movq 0x18(%rbx), %rdi
xorl %edx, %edx
callq 0xef9cf
leaq 0x5939d(%rip), %rsi     # 0x11affe
movq %rbx, %rdi
movb $0x1, %al
popq %rbx
jmp 0xe9226
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/plist.c
// Function: do_object_date
static void do_object_date(deark *c, lctx *d, i64 pos)
{
	double val_flt;
	i64 val_int;
	struct de_timestamp ts;
	char timestamp_buf[64];

	val_flt = dbuf_getfloat64x(c->infile, pos, 0);
	val_int = (i64)val_flt;
	// Epoch is Jan 1, 2001. There are 31 years, with 8 leap days, between
	// that and the Unix time epoch.
	de_unix_time_to_timestamp(val_int + ((365*31 + 8)*86400), &ts, 0x1);
	de_timestamp_to_string(&ts, timestamp_buf, sizeof(timestamp_buf), 0);
	de_dbg(c, "value: %f (%s)", val_flt, timestamp_buf);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x60, %rsp
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
xorl %edx, %edx
callq 0xef9cf
movsd %xmm0, 0x8(%rsp)
cvttsd2si %xmm0, %rdi
addq $0x3a4fc880, %rdi       # imm = 0x3A4FC880
leaq 0x10(%rsp), %r14
movq %r14, %rsi
movl $0x1, %edx
callq 0xeace2
leaq 0x20(%rsp), %r15
movl $0x40, %edx
movq %r14, %rdi
movq %r15, %rsi
xorl %ecx, %ecx
callq 0xeb4f8
leaq 0x7822a(%rip), %rsi     # 0x139ef1
movq %rbx, %rdi
movsd 0x8(%rsp), %xmm0
movq %r15, %rdx
movb $0x1, %al
callq 0xe9226
addq $0x60, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/plist.c
// Function: do_object_string
static void do_object_string(deark *c, lctx *d, i64 pos, i64 len)
{
	de_ucstring *s = NULL;

	s = ucstring_create(c);
	dbuf_read_to_ucstring_n(c->infile, pos, len, DE_DBG_MAX_STRLEN, s, 0, DE_ENCODING_ASCII);
	de_dbg(c, "value: \"%s\"", ucstring_getpsz_d(s));
	ucstring_destroy(s);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
callq 0xf6870
movq %rax, %rbx
movq 0x18(%r12), %rdi
movl $0x1, (%rsp)
movl $0x1f4, %ecx            # imm = 0x1F4
movq %r15, %rsi
movq %r14, %rdx
movq %rax, %r8
xorl %r9d, %r9d
callq 0xf0203
movq %rbx, %rdi
callq 0xf7557
leaq 0x50a2d(%rip), %rsi     # 0x11275b
movq %r12, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xf6bb0
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/plist.c
// Function: do_object_utf16string
static void do_object_utf16string(deark *c, lctx *d, i64 pos, i64 len)
{
	de_ucstring *s = NULL;

	s = ucstring_create(c);
	dbuf_read_to_ucstring_n(c->infile, pos, len*2, DE_DBG_MAX_STRLEN*2, s, 0, DE_ENCODING_UTF16BE);
	de_dbg(c, "value: \"%s\"", ucstring_getpsz_d(s));
	ucstring_destroy(s);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r14
callq 0xf6870
movq %rax, %rbx
movq 0x18(%r14), %rdi
addq %r15, %r15
movl $0x4, (%rsp)
movl $0x3e8, %ecx            # imm = 0x3E8
movq %r12, %rsi
movq %r15, %rdx
movq %rax, %r8
xorl %r9d, %r9d
callq 0xf0203
movq %rbx, %rdi
callq 0xf7557
leaq 0x509c1(%rip), %rsi     # 0x11275b
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xf6bb0
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/plist.c
// Function: do_object_array_or_set
static void do_object_array_or_set(deark *c, lctx *d, const char *tn,
	i64 objpos, i64 pos1, i64 numitems)
{
	i64 k;
	i64 pos = pos1;
	int saved_indent_level;

	de_dbg_indent_save(c, &saved_indent_level);
	d->nesting_level++;
	if(d->nesting_level>MAX_PLIST_NESTING_LEVEL) {
		report_nesting_level_exceeded(c, d);
		goto done;
	}

	for(k=0; k<numitems; k++) {
		i64 refnum;

		if(d->exceeded_max_objects) goto done;
		de_dbg(c, "item[%d] (for %s@%"I64_FMT")", (int)k, tn, objpos);
		de_dbg_indent(c, 1);

		refnum = dbuf_getint_ext(c->infile, pos, d->nbytes_per_object_refnum, 0, 0);
		pos += (i64)d->nbytes_per_object_refnum;

		de_dbg(c, "refnum: %u", (unsigned int)refnum);
		if(!do_one_object_by_refnum(c, d, refnum)) goto done;

		de_dbg_indent(c, -1);
	}

done:
	d->nesting_level--;
	de_dbg_indent_restore(c, saved_indent_level);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, %rbp
movq %r8, %r12
movq %rcx, 0x20(%rsp)
movq %rdx, 0x18(%rsp)
movq %rsi, %r14
movq %rdi, %rbx
leaq 0xc(%rsp), %rsi
callq 0xe958c
movl (%r14), %eax
leal 0x1(%rax), %ecx
movl %ecx, (%r14)
cmpl $0x9, %eax
jle 0xc1e0c
leaq 0x78119(%rip), %rsi     # 0x139f16
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9df7
jmp 0xc1ec7
testq %rbp, %rbp
jle 0xc1ec7
decq %rbp
xorl %r13d, %r13d
movq %rbp, 0x10(%rsp)
movb $0x1, %r15b
cmpl $0x0, 0x4(%r14)
jne 0xc1eb2
movq %rbx, %rdi
leaq 0x780c8(%rip), %rsi     # 0x139f00
movl %r13d, %edx
movq 0x18(%rsp), %rcx
movq 0x20(%rsp), %r8
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq 0x18(%rbx), %rdi
movl 0x14(%r14), %edx
movq %r12, %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0xef6f2
movq %rax, %rbp
movl 0x14(%r14), %eax
addq %rax, %r12
movq %rbx, %rdi
leaq 0x77eeb(%rip), %rsi     # 0x139d6d
movl %ebp, %edx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movq %r14, %rsi
movq %rbp, %rdx
callq 0xc1812
testl %eax, %eax
je 0xc1ead
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
xorl %r15d, %r15d
movq 0x10(%rsp), %rbp
testb %r15b, %r15b
jne 0xc1ec7
leaq 0x1(%r13), %rax
cmpq %r13, %rbp
movq %rax, %r13
jne 0xc1e20
decl (%r14)
movl 0xc(%rsp), %esi
movq %rbx, %rdi
callq 0xe9595
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/plist.c
// Function: do_object_dict
static void do_object_dict(deark *c, lctx *d, i64 objpos, i64 pos1,
	i64 dictsize)
{
	i64 k;
	int saved_indent_level;

	de_dbg_indent_save(c, &saved_indent_level);
	d->nesting_level++;
	if(d->nesting_level>MAX_PLIST_NESTING_LEVEL) {
		report_nesting_level_exceeded(c, d);
		goto done;
	}

	for(k=0; k<dictsize; k++) {
		i64 keyrefnum;
		i64 valrefnum;

		if(d->exceeded_max_objects) goto done;
		de_dbg(c, "entry[%d] (for dict@%"I64_FMT")", (int)k, objpos);
		de_dbg_indent(c, 1);

		keyrefnum = dbuf_getint_ext(c->infile, pos1+k*(i64)d->nbytes_per_object_refnum,
			d->nbytes_per_object_refnum, 0, 0);
		de_dbg(c, "key objrefnum: %u", (unsigned int)keyrefnum);
		de_dbg_indent(c, 1);
		if(!do_one_object_by_refnum(c, d, keyrefnum)) goto done;
		de_dbg_indent(c, -1);

		valrefnum = dbuf_getint_ext(c->infile, pos1+(dictsize+k)*(i64)d->nbytes_per_object_refnum,
			d->nbytes_per_object_refnum, 0, 0);
		de_dbg(c, "val objrefnum: %u", (unsigned int)valrefnum);
		de_dbg_indent(c, 1);
		if(!do_one_object_by_refnum(c, d, valrefnum)) goto done;
		de_dbg_indent(c, -1);

		de_dbg_indent(c, -1);
	}

done:
	d->nesting_level--;
	de_dbg_indent_restore(c, saved_indent_level);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %r15
movq %rcx, %r12
movq %rdx, 0x10(%rsp)
movq %rsi, %r14
movq %rdi, %rbx
leaq 0xc(%rsp), %rsi
callq 0xe958c
movl (%r14), %eax
leal 0x1(%rax), %ecx
movl %ecx, (%r14)
cmpl $0x9, %eax
jle 0xc1f32
leaq 0x77ff3(%rip), %rsi     # 0x139f16
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9df7
jmp 0xc2049
testq %r15, %r15
jle 0xc2049
xorl %ebp, %ebp
cmpl $0x0, 0x4(%r14)
jne 0xc2049
movq %rbx, %rdi
leaq 0x77fe3(%rip), %rsi     # 0x139f35
movl %ebp, %edx
movq 0x10(%rsp), %rcx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq 0x18(%rbx), %rdi
movl 0x14(%r14), %edx
movq %rdx, %rsi
imulq %rbp, %rsi
addq %r12, %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0xef6f2
movq %rax, %r13
movq %rbx, %rdi
leaq 0x77fb8(%rip), %rsi     # 0x139f4e
movl %r13d, %edx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq %rbx, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0xc1812
testl %eax, %eax
je 0xc2049
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
movq 0x18(%rbx), %rdi
leaq (%r15,%rbp), %rsi
movl 0x14(%r14), %edx
imulq %rdx, %rsi
addq %r12, %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0xef6f2
movq %rax, %r13
movq %rbx, %rdi
leaq 0x77f66(%rip), %rsi     # 0x139f60
movl %r13d, %edx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq %rbx, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0xc1812
testl %eax, %eax
je 0xc2049
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
incq %rbp
cmpq %rbp, %r15
jne 0xc1f3d
decl (%r14)
movl 0xc(%rsp), %esi
movq %rbx, %rdi
callq 0xe9595
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/qtif.c
// Function: de_module_qtif
void de_module_qtif(deark *c, struct deark_module_info *mi)
{
	mi->id = "qtif";
	mi->desc = "QTIF (QuickTime Image Format)";
	mi->run_fn = de_run_qtif;
	mi->identify_fn = de_identify_qtif;
}

// Assembly:
leaq 0x74d9b(%rip), %rax     # 0x136e0a
movq %rax, (%rsi)
leaq 0x77ef9(%rip), %rax     # 0x139f72
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0xc2094
movq %rax, 0x18(%rsi)
leaq 0x122(%rip), %rax       # 0xc21b1
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/qtif.c
// Function: de_run_qtif
static void de_run_qtif(deark *c, de_module_params *mparams)
{
	lctx *d = NULL;

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

	if(mparams) {
		if(mparams->in_params.flags & 0x1) {
			d->fail_gracefully_mode = 1;
		}
	}

	if(de_havemodcode(c, mparams, 'I')) {
		// Raw data from a PICT file
		do_raw_idsc_data(c, d);
	}
	else {
		do_qtif_file_format(c, d);
	}

	if(mparams && d->decoded_ok) {
		mparams->out_params.flags |= 0x1;
	}

	de_free(c, d);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movl $0x90, %esi
callq 0xe969b
movq %rax, %r15
testq %r14, %r14
je 0xc20bf
testb $0x1, 0x8(%r14)
je 0xc20bf
movb $0x1, (%r15)
movq %rbx, %rdi
movq %r14, %rsi
movl $0x49, %edx
callq 0xea97e
testl %eax, %eax
je 0xc213d
leaq 0x77eb6(%rip), %rsi     # 0x139f90
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq 0x18(%rbx), %rax
movq 0x18(%rax), %rcx
movq %rbx, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0xc2201
movl %eax, %ebp
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
testl %ebp, %ebp
je 0xc218d
movq 0x20(%r15), %rax
movq %rax, 0x8(%r15)
movq 0x18(%rbx), %rcx
movq 0x18(%rcx), %rcx
subq %rax, %rcx
movq %rcx, 0x10(%r15)
movq %rbx, %rdi
movq %r15, %rsi
callq 0xc2386
jmp 0xc218d
movl $0x30, %esi
movq %rbx, %rdi
callq 0xe969b
movq %rax, %r12
movq %r15, (%rax)
movq 0x18(%rbx), %rax
movq %rax, 0x10(%r12)
leaq 0x507(%rip), %rax       # 0xc2667
movq %rax, 0x20(%r12)
movq %rbx, %rdi
movq %r12, %rsi
callq 0xf87fc
cmpl $0x0, 0x4(%r15)
je 0xc2182
movq %rbx, %rdi
movq %r15, %rsi
callq 0xc2386
movq %rbx, %rdi
movq %r12, %rsi
callq 0xe9752
testq %r14, %r14
je 0xc219e
cmpb $0x0, 0x1(%r15)
je 0xc219e
orb $0x1, 0x40(%r14)
movq %rbx, %rdi
movq %r15, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xe9752
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/qtif.c
// Function: do_read_idsc
static int do_read_idsc(deark *c, lctx *d, i64 pos, i64 len)
{
	int retval = 0;

	if(len<8) goto done;

	d->idsc_found = 1;

	d->idsc_size = de_getu32be(pos);
	de_dbg(c, "idsc size: %d", (int)d->idsc_size);

	dbuf_read_fourcc(c->infile, pos+4, &d->cmpr4cc, 4, 0x0);
	de_dbg(c, "compression type: \"%s\"", d->cmpr4cc.id_dbgstr);

	if(len<86) goto done;
	if(d->idsc_size<86) goto done;

	d->width = de_getu16be(pos+32);
	d->height = de_getu16be(pos+34);
	d->hres = dbuf_fmtutil_read_fixed_16_16(c->infile, pos+36);
	d->vres = dbuf_fmtutil_read_fixed_16_16(c->infile, pos+40);
	de_dbg(c, "dpi: %.2f"DE_CHAR_TIMES"%.2f", d->hres, d->vres);
	d->idat_data_size = de_getu32be(pos+44);
	de_dbg(c, "reported data size: %d", (int)d->idat_data_size);
	if(d->idat_data_size>c->infile->len) d->idat_data_size=0;
	d->bitdepth = de_getu16be(pos+82);
	d->palette_id = de_getu16be(pos+84);
	de_dbg(c, "dimensions: %d"DE_CHAR_TIMES"%d, bitdepth: %d, palette: %d", (int)d->width,
		(int)d->height, (int)d->bitdepth, (int)d->palette_id);
	retval = 1;
done:
	return retval;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
xorl %ebp, %ebp
cmpq $0x8, %rcx
jl 0xc237b
movq %rcx, %r12
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movl $0x1, 0x18(%rsi)
movq 0x18(%rdi), %rdi
movq %rdx, %rsi
callq 0xef32a
movq %rax, 0x20(%r14)
leaq 0x77d67(%rip), %rsi     # 0x139fa6
xorl %ebp, %ebp
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movq 0x18(%rbx), %rdi
leaq 0x4(%r15), %rsi
leaq 0x30(%r14), %rdx
movl $0x4, %ecx
xorl %r8d, %r8d
callq 0xf1d74
leaq 0x40(%r14), %rdx
leaq 0x77dba(%rip), %rsi     # 0x13a02b
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
cmpq $0x56, %r12
jl 0xc237b
cmpq $0x56, 0x20(%r14)
jl 0xc237b
movq 0x18(%rbx), %rdi
leaq 0x20(%r15), %rsi
callq 0xef169
movq %rax, 0x60(%r14)
movq 0x18(%rbx), %rdi
leaq 0x22(%r15), %rsi
callq 0xef169
movq %rax, 0x68(%r14)
movq 0x18(%rbx), %rdi
leaq 0x24(%r15), %rsi
callq 0xf8544
movsd %xmm0, 0x80(%r14)
movq 0x18(%rbx), %rdi
leaq 0x28(%r15), %rsi
callq 0xf8544
movaps %xmm0, %xmm1
movsd %xmm0, 0x88(%r14)
movsd 0x80(%r14), %xmm0
leaq 0x74a81(%rip), %rsi     # 0x136d72
movq %rbx, %rdi
movb $0x2, %al
callq 0xe9226
movq 0x18(%rbx), %rdi
leaq 0x2c(%r15), %rsi
callq 0xef32a
movq %rax, 0x28(%r14)
leaq 0x77ca1(%rip), %rsi     # 0x139fb4
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movq 0x28(%r14), %rax
movq 0x18(%rbx), %rdi
cmpq 0x18(%rdi), %rax
jle 0xc2335
movq $0x0, 0x28(%r14)
leaq 0x52(%r15), %rsi
callq 0xef169
movq %rax, 0x70(%r14)
movq 0x18(%rbx), %rdi
addq $0x54, %r15
movq %r15, %rsi
callq 0xef169
movq %rax, 0x78(%r14)
movl 0x60(%r14), %edx
movl 0x68(%r14), %ecx
movl 0x70(%r14), %r8d
leaq 0x77c62(%rip), %rsi     # 0x139fcb
movq %rbx, %rdi
movl %eax, %r9d
xorl %eax, %eax
callq 0xe9226
movl $0x1, %ebp
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/qtif.c
// Function: quicktime_box_handler
static int quicktime_box_handler(deark *c, struct de_boxesctx *bctx)
{
	lctx *d = (lctx*)bctx->userdata;
	struct de_boxdata *curbox = bctx->curbox;

	if(curbox->boxtype==BOX_idat) {
		d->idat_found = 1;
		d->idat_pos = curbox->payload_pos;
		d->idat_size = curbox->payload_len;
	}
	else if(curbox->boxtype==BOX_idsc) {
		do_read_idsc(c, d, curbox->payload_pos, curbox->payload_len);
	}
	else if(curbox->is_uuid) {
		return fmtutil_default_box_handler(c, bctx);
	}

	return 1;
}

// Assembly:
movq %rsi, %rax
movq (%rsi), %rsi
movq 0x28(%rax), %rcx
movl 0xc(%rcx), %edx
cmpl $0x69647363, %edx       # imm = 0x69647363
je 0xc269d
cmpl $0x69646174, %edx       # imm = 0x69646174
jne 0xc26b1
movl $0x1, 0x4(%rsi)
movq 0x38(%rcx), %rax
movq %rax, 0x8(%rsi)
movq 0x40(%rcx), %rax
movq %rax, 0x10(%rsi)
jmp 0xc26bf
pushq %rax
movq 0x38(%rcx), %rdx
movq 0x40(%rcx), %rcx
callq 0xc2201
addq $0x8, %rsp
jmp 0xc26bf
cmpl $0x0, 0x10(%rcx)
je 0xc26bf
movq %rax, %rsi
jmp 0xf8650
movl $0x1, %eax
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/riff.c
// Function: de_module_riff
void de_module_riff(deark *c, struct deark_module_info *mi)
{
	mi->id = "riff";
	mi->desc = "RIFF-based formats";
	mi->run_fn = de_run_riff;
	mi->identify_fn = de_identify_riff;
}

// Assembly:
leaq 0x779a4(%rip), %rax     # 0x13a073
movq %rax, (%rsi)
leaq 0x7799f(%rip), %rax     # 0x13a078
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0xc26f4
movq %rax, 0x18(%rsi)
leaq 0x117(%rip), %rax       # 0xc2806
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/riff.c
// Function: de_run_riff
static void de_run_riff(deark *c, de_module_params *mparams)
{
	lctx *d = NULL;
	struct de_iffctx *ictx = NULL;
	u8 buf[4];

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

	ictx = fmtutil_create_iff_decoder(c);
	ictx->userdata = (void*)d;
	ictx->preprocess_chunk_fn = my_preprocess_riff_chunk_fn;
	ictx->handle_chunk_fn = my_riff_chunk_handler;
	ictx->on_std_container_start_fn = my_on_std_container_start_fn;
	ictx->on_container_end_fn = my_on_container_end_fn;
	ictx->input_encoding = de_get_input_encoding(c, NULL, DE_ENCODING_WINDOWS1252);
	ictx->f = c->infile;

	de_read(buf, 0, 4);

	if(!de_memcmp(buf, "RIFF", 4)) {
		ictx->is_le = 1;
		ictx->reversed_4cc = 0;
	}
	else if(!de_memcmp(buf, "RIFX", 4)) {
		ictx->is_le = 0;
		ictx->reversed_4cc = 0;
	}
	else if(!de_memcmp(buf, "XFIR", 4)) {
		ictx->is_le = 1;
		ictx->reversed_4cc = 1;
	}
	else {
		de_warn(c, "This is probably not a RIFF file.");
		ictx->is_le = 1;
		ictx->reversed_4cc = 0;
	}

	fmtutil_read_iff_format(ictx, 0, ictx->f->len);

	fmtutil_destroy_iff_decoder(ictx);
	if(d) {
		ucstring_destroy(d->INAM_data);
		de_free(c, d);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x20, %esi
callq 0xe969b
movq %rax, %r14
movq %rbx, %rdi
callq 0x107b04
movq %rax, %r15
movq %r14, 0x10(%rax)
leaq 0x14c(%rip), %rax       # 0xc2871
movq %rax, 0x28(%r15)
leaq 0x201(%rip), %rax       # 0xc2931
movq %rax, 0x20(%r15)
leaq 0x5d5(%rip), %rax       # 0xc2d10
movq %rax, 0x30(%r15)
leaq 0x7c8(%rip), %rax       # 0xc2f0e
movq %rax, 0x38(%r15)
xorl %r13d, %r13d
movq %rbx, %rdi
xorl %esi, %esi
movl $0x9, %edx
callq 0xeb7d1
movl %eax, 0x60(%r15)
movq 0x18(%rbx), %rdi
movq %rdi, 0x18(%r15)
leaq 0x4(%rsp), %r12
movl $0x4, %ecx
movq %r12, %rsi
xorl %edx, %edx
callq 0xeeee8
movl $0x1, %ebp
cmpl $0x46464952, (%r12)     # imm = 0x46464952
je 0xc27bc
cmpl $0x58464952, 0x4(%rsp)  # imm = 0x58464952
je 0xc27b5
cmpl $0x52494658, 0x4(%rsp)  # imm = 0x52494658
je 0xc27b9
leaq 0x778ef(%rip), %rsi     # 0x13a095
xorl %r13d, %r13d
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9b27
jmp 0xc27bc
xorl %ebp, %ebp
jmp 0xc27bc
movb $0x1, %r13b
movl %ebp, 0x58(%r15)
movb %r13b, 0x5c(%r15)
movq 0x18(%r15), %rax
movq 0x18(%rax), %rdx
movq %r15, %rdi
xorl %esi, %esi
callq 0x107b28
movq %r15, %rdi
callq 0x107b17
testq %r14, %r14
je 0xc27f7
movq 0x18(%r14), %rdi
callq 0xf6bb0
movq %rbx, %rdi
movq %r14, %rsi
callq 0xe9752
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/riff.c
// Function: de_identify_riff
static int de_identify_riff(deark *c)
{
	u8 buf[4];
	int has_sig;
	i64 dlen;

	de_read(buf, 0, 4);
	has_sig = (!de_memcmp(buf, "RIFF", 4)) ||
		(!de_memcmp(buf, "XFIR", 4)) ||
		(!de_memcmp(buf, "RIFX", 4));
	if(!has_sig) return 0;

	dlen = de_getu32le(4);
	// This check screens out .AMV format, for example.
	if(dlen==0 && c->infile->len!=8) return 0;

	return 50;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
leaq 0x4(%rsp), %r14
movl $0x4, %ecx
movq %r14, %rsi
xorl %edx, %edx
callq 0xeeee8
cmpl $0x46464952, (%r14)     # imm = 0x46464952
je 0xc2842
cmpl $0x52494658, 0x4(%rsp)  # imm = 0x52494658
je 0xc2842
cmpl $0x58464952, 0x4(%rsp)  # imm = 0x58464952
jne 0xc2867
movq 0x18(%rbx), %rdi
movl $0x4, %esi
callq 0xef37e
testq %rax, %rax
jne 0xc2860
movq 0x18(%rbx), %rax
cmpq $0x8, 0x18(%rax)
jne 0xc2867
movl $0x32, %eax
jmp 0xc2869
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/riff.c
// Function: my_preprocess_riff_chunk_fn
static int my_preprocess_riff_chunk_fn(struct de_iffctx *ictx)
{
	const char *name = NULL;

	// TODO: Need a better way to do this.
	switch(ictx->chunkctx->chunk4cc.id) {
	case CHUNK_DISP: name="display"; break;
	case CHUNK_IART: name="artist"; break;
	case CHUNK_ICOP: name="copyright"; break;
	case CHUNK_ICMT: name="comments"; break;
	case CHUNK_IKEY: name="keywords"; break;
	case CHUNK_ISBJ: name="subject"; break;
	case CHUNK_JUNK: name="filler"; break;
	case CHUNK_LIST: name="subchunk container"; break;
	}

	if(name) {
		ictx->chunkctx->chunk_name = name;
	}
	return 1;
}

// Assembly:
movq 0x128(%rdi), %rax
movl 0x4(%rax), %esi
movb $0x1, %dl
xorl %ecx, %ecx
cmpl $0x494b4558, %esi       # imm = 0x494B4558
jg 0xc28ac
cmpl $0x49434d53, %esi       # imm = 0x49434D53
jg 0xc28cd
cmpl $0x44495350, %esi       # imm = 0x44495350
je 0xc28ff
cmpl $0x49415254, %esi       # imm = 0x49415254
jne 0xc2923
leaq 0x6557a(%rip), %rcx     # 0x127e24
jmp 0xc2921
cmpl $0x4a554e4a, %esi       # imm = 0x4A554E4A
jg 0xc28e6
cmpl $0x494b4559, %esi       # imm = 0x494B4559
je 0xc2908
cmpl $0x4953424a, %esi       # imm = 0x4953424A
jne 0xc2923
leaq 0x69553(%rip), %rcx     # 0x12be1e
jmp 0xc2921
cmpl $0x49434d54, %esi       # imm = 0x49434D54
je 0xc2911
cmpl $0x49434f50, %esi       # imm = 0x49434F50
jne 0xc2923
leaq 0x4fdfb(%rip), %rcx     # 0x1126df
jmp 0xc2921
cmpl $0x4a554e4b, %esi       # imm = 0x4A554E4B
je 0xc291a
cmpl $0x4c495354, %esi       # imm = 0x4C495354
jne 0xc2923
leaq 0x777ca(%rip), %rcx     # 0x13a0c7
jmp 0xc2921
leaq 0x5380c(%rip), %rcx     # 0x116112
jmp 0xc2921
leaq 0x777a8(%rip), %rcx     # 0x13a0b7
jmp 0xc2921
leaq 0x4f6c5(%rip), %rcx     # 0x111fdd
jmp 0xc2921
leaq 0x7779f(%rip), %rcx     # 0x13a0c0
xorl %edx, %edx
testb %dl, %dl
jne 0xc292b
movq %rcx, 0x58(%rax)
movl $0x1, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/riff.c
// Function: my_on_container_end_fn
static int my_on_container_end_fn(struct de_iffctx *ictx)
{
	lctx *d = (lctx*)ictx->userdata;

	if(ictx->curr_container_contentstype4cc.id==CODE_movi &&
		d->in_movi && ictx->level==d->in_movi_level)
	{
		d->in_movi = 0;
	}

	return 1;
}

// Assembly:
cmpl $0x6d6f7669, 0xfc(%rdi) # imm = 0x6D6F7669
jne 0xc2f30
movq 0x10(%rdi), %rax
cmpb $0x0, 0xe(%rax)
je 0xc2f30
movl 0x64(%rdi), %ecx
cmpl 0x10(%rax), %ecx
jne 0xc2f30
movb $0x0, 0xe(%rax)
movl $0x1, %eax
retq