LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/atari-img.c
// Function: de_run_eggpaint
static void de_run_eggpaint(deark *c, de_module_params *mparams)
{
	struct atari_img_decode_data *adata = NULL;

	adata = de_malloc(c, sizeof(struct atari_img_decode_data));

	if(!dbuf_memcmp(c->infile, 0, "tru?", 4)) {
		de_declare_fmt(c, "Spooky Sprites");
	}
	else {
		de_declare_fmt(c, "EggPaint");
	}

	adata->bpp = 16;
	adata->w = de_getu16be(4);
	adata->h = de_getu16be(6);
	de_dbg_dimensions(c, adata->w, adata->h);
	adata->unc_pixels = dbuf_open_input_subfile(c->infile, 8, c->infile->len-8);
	adata->img = de_bitmap_create(c, adata->w, adata->h, 3);
	fmtutil_atari_decode_image(c, adata);
	de_bitmap_write_to_file(adata->img, NULL, 0);

	dbuf_close(adata->unc_pixels);
	de_bitmap_destroy(adata->img);
	de_free(c, adata);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x40, %esi
callq 0xe969b
movq %rax, %r14
movq 0x18(%rbx), %rdi
leaq 0xf167f(%rip), %rdx     # 0x113843
movl $0x4, %ecx
xorl %esi, %esi
callq 0xf025e
testl %eax, %eax
leaq 0xf166f(%rip), %rax     # 0x113848
leaq 0xf1677(%rip), %rsi     # 0x113857
cmoveq %rax, %rsi
movq %rbx, %rdi
callq 0xeb6d6
movq $0x10, (%r14)
movq 0x18(%rbx), %rdi
movl $0x4, %esi
callq 0xef169
movq %rax, 0x10(%r14)
movq 0x18(%rbx), %rdi
movl $0x6, %esi
callq 0xef169
movq %rax, 0x18(%r14)
movq 0x10(%r14), %rsi
movq %rbx, %rdi
movq %rax, %rdx
callq 0xe9b05
movq 0x18(%rbx), %rdi
movq 0x18(%rdi), %rdx
addq $-0x8, %rdx
movl $0x8, %esi
callq 0xf1988
movq %rax, 0x20(%r14)
movq 0x10(%r14), %rsi
movq 0x18(%r14), %rdx
movq %rbx, %rdi
movl $0x3, %ecx
callq 0xf2cab
movq %rax, 0x38(%r14)
movq %rbx, %rdi
movq %r14, %rsi
callq 0xf900c
movq 0x38(%r14), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xf2923
movq 0x20(%r14), %rdi
callq 0xf0b13
movq 0x38(%r14), %rdi
callq 0xf28d4
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/atari-img.c
// Function: de_module_indypaint
void de_module_indypaint(deark *c, struct deark_module_info *mi)
{
	mi->id = "indypaint";
	mi->desc = "Atari IndyPaint .TRU";
	mi->run_fn = de_run_indypaint;
	mi->identify_fn = de_identify_indypaint;
}

// Assembly:
leaq 0xf10ec(%rip), %rax     # 0x1133de
movq %rax, (%rsi)
leaq 0xf10ec(%rip), %rax     # 0x1133e8
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x22317
movq %rax, 0x18(%rsi)
leaq 0xc5(%rip), %rax        # 0x223d7
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/atari-img.c
// Function: de_run_indypaint
static void de_run_indypaint(deark *c, de_module_params *mparams)
{
	struct atari_img_decode_data *adata = NULL;

	adata = de_malloc(c, sizeof(struct atari_img_decode_data));
	adata->bpp = 16;
	adata->w = de_getu16be(4);
	adata->h = de_getu16be(6);
	de_dbg_dimensions(c, adata->w, adata->h);
	adata->unc_pixels = dbuf_open_input_subfile(c->infile, 256, c->infile->len-256);
	adata->img = de_bitmap_create(c, adata->w, adata->h, 3);
	fmtutil_atari_decode_image(c, adata);
	de_bitmap_write_to_file(adata->img, NULL, 0);

	dbuf_close(adata->unc_pixels);
	de_bitmap_destroy(adata->img);
	de_free(c, adata);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x40, %esi
callq 0xe969b
movq %rax, %r14
movq $0x10, (%rax)
movq 0x18(%rbx), %rdi
movl $0x4, %esi
callq 0xef169
movq %rax, 0x10(%r14)
movq 0x18(%rbx), %rdi
movl $0x6, %esi
callq 0xef169
movq %rax, 0x18(%r14)
movq 0x10(%r14), %rsi
movq %rbx, %rdi
movq %rax, %rdx
callq 0xe9b05
movq 0x18(%rbx), %rdi
movq $-0x100, %rdx
addq 0x18(%rdi), %rdx
movl $0x100, %esi            # imm = 0x100
callq 0xf1988
movq %rax, 0x20(%r14)
movq 0x10(%r14), %rsi
movq 0x18(%r14), %rdx
movq %rbx, %rdi
movl $0x3, %ecx
callq 0xf2cab
movq %rax, 0x38(%r14)
movq %rbx, %rdi
movq %r14, %rsi
callq 0xf900c
movq 0x38(%r14), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xf2923
movq 0x20(%r14), %rdi
callq 0xf0b13
movq 0x38(%r14), %rdi
callq 0xf28d4
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/atari-img.c
// Function: de_module_godpaint
void de_module_godpaint(deark *c, struct deark_module_info *mi)
{
	mi->id = "godpaint";
	mi->desc = "Atari Falcon GodPaint";
	mi->run_fn = de_run_godpaint;
	mi->identify_fn = de_identify_godpaint;
}

// Assembly:
leaq 0xf0ff9(%rip), %rax     # 0x1133fd
movq %rax, (%rsi)
leaq 0xf0ff8(%rip), %rax     # 0x113406
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x22429
movq %rax, 0x18(%rsi)
leaq 0xc2(%rip), %rax        # 0x224e6
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/atari-img.c
// Function: de_run_godpaint
static void de_run_godpaint(deark *c, de_module_params *mparams)
{
	struct atari_img_decode_data *adata = NULL;

	adata = de_malloc(c, sizeof(struct atari_img_decode_data));
	adata->bpp = 16;
	adata->w = de_getu16be(2);
	adata->h = de_getu16be(4);
	de_dbg_dimensions(c, adata->w, adata->h);
	adata->unc_pixels = dbuf_open_input_subfile(c->infile, 6, c->infile->len-6);
	adata->img = de_bitmap_create(c, adata->w, adata->h, 3);
	fmtutil_atari_decode_image(c, adata);
	de_bitmap_write_to_file(adata->img, NULL, 0);

	dbuf_close(adata->unc_pixels);
	de_bitmap_destroy(adata->img);
	de_free(c, adata);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x40, %esi
callq 0xe969b
movq %rax, %r14
movq $0x10, (%rax)
movq 0x18(%rbx), %rdi
movl $0x2, %esi
callq 0xef169
movq %rax, 0x10(%r14)
movq 0x18(%rbx), %rdi
movl $0x4, %esi
callq 0xef169
movq %rax, 0x18(%r14)
movq 0x10(%r14), %rsi
movq %rbx, %rdi
movq %rax, %rdx
callq 0xe9b05
movq 0x18(%rbx), %rdi
movq 0x18(%rdi), %rdx
addq $-0x6, %rdx
movl $0x6, %esi
callq 0xf1988
movq %rax, 0x20(%r14)
movq 0x10(%r14), %rsi
movq 0x18(%r14), %rdx
movq %rbx, %rdi
movl $0x3, %ecx
callq 0xf2cab
movq %rax, 0x38(%r14)
movq %rbx, %rdi
movq %r14, %rsi
callq 0xf900c
movq 0x38(%r14), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xf2923
movq 0x20(%r14), %rdi
callq 0xf0b13
movq 0x38(%r14), %rdi
callq 0xf28d4
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/atari-img.c
// Function: de_identify_godpaint
static int de_identify_godpaint(deark *c)
{
	i64 sig;

	sig = de_getu16be(0);
	if(sig!=0x4734 && sig!=0x0400) return 0;
	if(de_input_file_has_ext(c, "god")) return 100;
	if(sig==0x4734) return 5;
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r15
movq 0x18(%rdi), %rdi
xorl %r14d, %r14d
xorl %esi, %esi
callq 0xef169
movq %rax, %rbx
cmpq $0x4734, %rax           # imm = 0x4734
je 0x22510
cmpq $0x400, %rbx            # imm = 0x400
jne 0x22539
leaq 0xf1353(%rip), %rsi     # 0x11386a
movq %r15, %rdi
callq 0xea936
movl $0x64, %r14d
testl %eax, %eax
jne 0x22539
xorl %eax, %eax
cmpq $0x4734, %rbx           # imm = 0x4734
sete %al
leal (%rax,%rax,4), %r14d
movl %r14d, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/atari-img.c
// Function: de_module_tinystuff
void de_module_tinystuff(deark *c, struct deark_module_info *mi)
{
	mi->id = "tinystuff";
	mi->desc = "Atari Tiny Stuff, a.k.a. Tiny image format";
	mi->run_fn = de_run_tinystuff;
	mi->identify_fn = de_identify_tinystuff;
	mi->help_fn = de_help_tinystuff;
}

// Assembly:
leaq 0xf0ed3(%rip), %rax     # 0x11341c
movq %rax, (%rsi)
leaq 0xf0ed3(%rip), %rax     # 0x113426
movq %rax, 0x8(%rsi)
leaq 0x1b(%rip), %rax        # 0x22579
movq %rax, 0x18(%rsi)
leaq 0x688(%rip), %rax       # 0x22bf1
movq %rax, 0x20(%rsi)
leaq 0x709(%rip), %rax       # 0x22c7d
movq %rax, 0x28(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/atari-img.c
// Function: de_identify_tinystuff
static int de_identify_tinystuff(deark *c)
{
	// TODO: Can we identify these files?
	if(de_getbyte(0)>0x05) return 0;
	if(de_input_file_has_ext(c, "tny") ||
		de_input_file_has_ext(c, "tn1") ||
		de_input_file_has_ext(c, "tn2") ||
		de_input_file_has_ext(c, "tn3") ||
		de_input_file_has_ext(c, "tn4"))
	{
		return 8;
	}
	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0x18(%rdi), %rdi
xorl %ebx, %ebx
xorl %esi, %esi
callq 0xef0d5
cmpb $0x5, %al
ja 0x22c73
leaq 0xf0de4(%rip), %rsi     # 0x1139f4
movq %r14, %rdi
callq 0xea936
movl $0x8, %ebx
testl %eax, %eax
jne 0x22c73
leaq 0xf0dd0(%rip), %rsi     # 0x1139f8
movq %r14, %rdi
callq 0xea936
testl %eax, %eax
jne 0x22c73
leaq 0xf0dc1(%rip), %rsi     # 0x1139fc
movq %r14, %rdi
callq 0xea936
testl %eax, %eax
jne 0x22c73
leaq 0xf0db2(%rip), %rsi     # 0x113a00
movq %r14, %rdi
callq 0xea936
testl %eax, %eax
jne 0x22c73
leaq 0xf0da3(%rip), %rsi     # 0x113a04
movq %r14, %rdi
callq 0xea936
xorl %ebx, %ebx
testl %eax, %eax
setne %bl
shll $0x3, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/atari-img.c
// Function: de_module_doodle
void de_module_doodle(deark *c, struct deark_module_info *mi)
{
	mi->id = "doodle";
	mi->desc = "Atari Doodle";
	mi->run_fn = de_run_doodle;
	mi->identify_fn = de_identify_doodle;
}

// Assembly:
leaq 0xf07b2(%rip), %rax     # 0x113451
movq %rax, (%rsi)
leaq 0xf07af(%rip), %rax     # 0x113458
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x22cc4
movq %rax, 0x18(%rsi)
leaq 0xd1(%rip), %rax        # 0x22d90
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/atari-img.c
// Function: de_run_doodle
static void de_run_doodle(deark *c, de_module_params *mparams)
{
	struct atari_img_decode_data *adata = NULL;
	de_finfo *fi = NULL;
	u32 pal[2];

	adata = de_malloc(c, sizeof(struct atari_img_decode_data));
	adata->pal = pal;
	adata->bpp = 1;

	adata->w = 640;
	adata->h = 400;
	adata->ncolors = 2;
	adata->pal[0] = DE_STOCKCOLOR_WHITE;
	adata->pal[1] = DE_STOCKCOLOR_BLACK;

	adata->unc_pixels = c->infile;
	adata->img = de_bitmap_create(c, adata->w, adata->h, 1);
	fi = de_finfo_create(c);
	fmtutil_atari_set_standard_density(c, adata, fi);
	fmtutil_atari_decode_image(c, adata);
	de_bitmap_write_to_file_finfo(adata->img, fi, 0);

	if(adata) {
		de_bitmap_destroy(adata->img);
		de_free(c, adata);
	}
	de_finfo_destroy(c, fi);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movl $0x40, %esi
callq 0xe969b
movq %rax, %r14
leaq 0x8(%rsp), %rax
movq %rax, 0x30(%r14)
movq $0x1, (%r14)
movq $0x280, 0x10(%r14)      # imm = 0x280
movq $0x190, 0x18(%r14)      # imm = 0x190
movq $0x2, 0x8(%r14)
movabsq $-0xffffff00000001, %rcx # imm = 0xFF000000FFFFFFFF
movq %rcx, (%rax)
movq 0x18(%rbx), %rax
movq %rax, 0x20(%r14)
movl $0x280, %esi            # imm = 0x280
movl $0x190, %edx            # imm = 0x190
movq %rbx, %rdi
movl $0x1, %ecx
callq 0xf2cab
movq %rax, 0x38(%r14)
movq %rbx, %rdi
callq 0xea9a9
movq %rax, %r15
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0xf9323
movq %rbx, %rdi
movq %r14, %rsi
callq 0xf900c
movq 0x38(%r14), %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0xf2917
movq 0x38(%r14), %rdi
callq 0xf28d4
movq %rbx, %rdi
movq %r14, %rsi
callq 0xe9752
movq %rbx, %rdi
movq %r15, %rsi
callq 0xea9b3
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/atari-img.c
// Function: de_module_neochrome
void de_module_neochrome(deark *c, struct deark_module_info *mi)
{
	mi->id = "neochrome";
	mi->desc = "Atari NEOchrome image";
	mi->run_fn = de_run_neochrome;
	mi->identify_fn = de_identify_neochrome;
	mi->help_fn = de_help_neochrome;
}

// Assembly:
leaq 0xf06a0(%rip), %rax     # 0x113465
movq %rax, (%rsi)
leaq 0xf06a0(%rip), %rax     # 0x11346f
movq %rax, 0x8(%rsi)
leaq 0x1b(%rip), %rax        # 0x22df5
movq %rax, 0x18(%rsi)
leaq 0x192(%rip), %rax       # 0x22f77
movq %rax, 0x20(%rsi)
leaq 0x1b9(%rip), %rax       # 0x22fa9
movq %rax, 0x28(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/atari-img.c
// Function: de_module_neochrome_ani
void de_module_neochrome_ani(deark *c, struct deark_module_info *mi)
{
	mi->id = "neochrome_ani";
	mi->desc = "NEOchrome Animation";
	mi->run_fn = de_run_neochrome_ani;
	mi->identify_fn = de_identify_neochrome_ani;
	mi->flags |= DE_MODFLAG_NONWORKING;
}

// Assembly:
leaq 0xf04d0(%rip), %rax     # 0x113485
movq %rax, (%rsi)
leaq 0xf04d4(%rip), %rax     # 0x113493
movq %rax, 0x8(%rsi)
leaq 0x14(%rip), %rax        # 0x22fde
movq %rax, 0x18(%rsi)
leaq 0x1d2(%rip), %rax       # 0x231a7
movq %rax, 0x20(%rsi)
orb $0x2, 0x30(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/atari-img.c
// Function: de_module_animatic
void de_module_animatic(deark *c, struct deark_module_info *mi)
{
	mi->id = "animatic";
	mi->desc = "Animatic Film";
	mi->run_fn = de_run_animatic;
	mi->identify_fn = de_identify_animatic;
	mi->help_fn = de_help_animatic;
}

// Assembly:
leaq 0xf02d3(%rip), %rax     # 0x1134a7
movq %rax, (%rsi)
leaq 0xf02d2(%rip), %rax     # 0x1134b0
movq %rax, 0x8(%rsi)
leaq 0x1b(%rip), %rax        # 0x23204
movq %rax, 0x18(%rsi)
leaq 0x1f4(%rip), %rax       # 0x233e8
movq %rax, 0x20(%rsi)
leaq 0x212(%rip), %rax       # 0x23411
movq %rax, 0x28(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/atari-img.c
// Function: de_module_fpaint_pi4
void de_module_fpaint_pi4(deark *c, struct deark_module_info *mi)
{
	mi->id = "fpaint_pi4";
	mi->desc = "Atari Falcon PI4 image";
	mi->run_fn = de_run_fpaint_pi4;
	mi->identify_fn = de_identify_fpaint_pi4;
}

// Assembly:
leaq 0xf00a1(%rip), %rax     # 0x1134be
movq %rax, (%rsi)
leaq 0xf00a2(%rip), %rax     # 0x1134c9
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x23442
movq %rax, 0x18(%rsi)
leaq 0x14(%rip), %rax        # 0x23451
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/atari-img.c
// Function: de_identify_fpaint_pi4
static int de_identify_fpaint_pi4(deark *c)
{
	if(c->infile->len==77824) {
		if(de_input_file_has_ext(c, "pi4") ||
			de_input_file_has_ext(c, "pi9"))
		{
			return 50; // Must be lower than fpaint_pi9
		}
	}
	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x18(%rdi), %rax
cmpq $0x13000, 0x18(%rax)    # imm = 0x13000
jne 0x2348e
movq %rdi, %r14
leaq 0xf0058(%rip), %rsi     # 0x1134c5
callq 0xea936
movl $0x32, %ebx
testl %eax, %eax
jne 0x23490
leaq 0xf0065(%rip), %rsi     # 0x1134e7
movq %r14, %rdi
callq 0xea936
testl %eax, %eax
jne 0x23490
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/atari-img.c
// Function: de_module_fpaint_pi9
void de_module_fpaint_pi9(deark *c, struct deark_module_info *mi)
{
	mi->id = "fpaint_pi9";
	mi->desc = "Atari Falcon PI9 image";
	mi->run_fn = de_run_fpaint_pi9;
	mi->identify_fn = de_identify_fpaint_pi9;
}

// Assembly:
leaq 0xf003f(%rip), %rax     # 0x1134e0
movq %rax, (%rsi)
leaq 0xf0040(%rip), %rax     # 0x1134eb
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x234c6
movq %rax, 0x18(%rsi)
leaq 0x14(%rip), %rax        # 0x234d5
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/atari-img.c
// Function: de_identify_fpaint_pi9
static int de_identify_fpaint_pi9(deark *c)
{
	int pi4_ext, pi9_ext;

	if(c->infile->len!=77824 && c->infile->len!=65024) return 0;

	pi4_ext = de_input_file_has_ext(c, "pi4");
	pi9_ext = de_input_file_has_ext(c, "pi9");
	if(!pi4_ext && !pi9_ext) return 0;

	if(c->infile->len==65024) return 60;

	// If file size is 77824, we need to distinguish between PI4 (320x240) and
	// PI9 (320x200) format.
	// Best guess is that if the last 12800 bytes are all 0, we should assume PI9.
	if(!dbuf_is_all_zeroes(c->infile, 65024, 12800)) {
		return 0; // Will be identified elsewhere as PI4.
	}

	return 60; // PI9. Must be higher than the value PI4 uses.
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %r14
movq 0x18(%rdi), %rax
movq 0x18(%rax), %rax
xorl %ebx, %ebx
cmpq $0x13000, %rax          # imm = 0x13000
je 0x234f6
cmpq $0xfe00, %rax           # imm = 0xFE00
jne 0x23546
leaq 0xeffc8(%rip), %rsi     # 0x1134c5
movq %r14, %rdi
callq 0xea936
movl %eax, %ebp
leaq 0xeffd9(%rip), %rsi     # 0x1134e7
movq %r14, %rdi
callq 0xea936
orl %ebp, %eax
je 0x23546
movq 0x18(%r14), %rdi
movl $0x3c, %ebx
cmpq $0xfe00, 0x18(%rdi)     # imm = 0xFE00
je 0x23546
movl $0xfe00, %esi           # imm = 0xFE00
movl $0x3200, %edx           # imm = 0x3200
callq 0xf1efb
testl %eax, %eax
movl $0x3c, %ebx
cmovel %eax, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/atari-img.c
// Function: de_module_atari_pi7
void de_module_atari_pi7(deark *c, struct deark_module_info *mi)
{
	mi->id = "atari_pi7";
	mi->desc = "Atari PI7 image";
	mi->run_fn = de_run_atari_pi7;
	mi->identify_fn = de_identify_atari_pi7;
}

// Assembly:
leaq 0xeffae(%rip), %rax     # 0x113502
movq %rax, (%rsi)
leaq 0xeffae(%rip), %rax     # 0x11350c
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x23579
movq %rax, 0x18(%rsi)
leaq 0x14(%rip), %rax        # 0x23588
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/atari-img.c
// Function: de_module_falcon_xga
void de_module_falcon_xga(deark *c, struct deark_module_info *mi)
{
	mi->id = "falcon_xga";
	mi->desc = "Atari Falcon XGA image";
	mi->run_fn = de_run_falcon_xga;
	mi->identify_fn = de_identify_falcon_xga;
}

// Assembly:
leaq 0xeff5e(%rip), %rax     # 0x11351c
movq %rax, (%rsi)
leaq 0xeff5f(%rip), %rax     # 0x113527
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x235e3
movq %rax, 0x18(%rsi)
leaq 0x102(%rip), %rax       # 0x236e0
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/atari-img.c
// Function: de_run_falcon_xga
static void de_run_falcon_xga(deark *c, de_module_params *mparams)
{
	struct atari_img_decode_data *adata = NULL;
	de_finfo *fi = NULL;

	adata = de_malloc(c, sizeof(struct atari_img_decode_data));
	if(c->infile->len==153600) {
		adata->bpp = 16;
		adata->w = 320;
		adata->h = 240;
	}
	else {
		adata->bpp = 16;
		adata->w = 384;
		adata->h = 480;
	}
	de_dbg_dimensions(c, adata->w, adata->h);
	adata->unc_pixels = c->infile;
	adata->img = de_bitmap_create(c, adata->w, adata->h, 3);
	fi = de_finfo_create(c);
	if(adata->w==384 && adata->h == 480) {
		fi->density.code = DE_DENSITY_UNK_UNITS;
		fi->density.xdens = 384;
		fi->density.ydens = 640;
	}
	fmtutil_atari_decode_image(c, adata);
	de_bitmap_write_to_file_finfo(adata->img, fi, 0);
	de_bitmap_destroy(adata->img);
	de_finfo_destroy(c, fi);
	de_free(c, adata);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl $0x40, %esi
callq 0xe969b
movq %rax, %r14
movq 0x18(%rbx), %rax
xorl %esi, %esi
cmpq $0x25800, 0x18(%rax)    # imm = 0x25800
setne %sil
movq $0x10, (%r14)
movl $0xf0, %eax
movl $0x1e0, %edx            # imm = 0x1E0
cmoveq %rax, %rdx
shll $0x6, %esi
addq $0x140, %rsi            # imm = 0x140
movq %rsi, 0x10(%r14)
movq %rdx, 0x18(%r14)
movq %rbx, %rdi
callq 0xe9b05
movq 0x18(%rbx), %rax
movq %rax, 0x20(%r14)
movq 0x10(%r14), %rsi
movq 0x18(%r14), %rdx
movq %rbx, %rdi
movl $0x3, %ecx
callq 0xf2cab
movq %rax, 0x38(%r14)
movq %rbx, %rdi
callq 0xea9a9
movq %rax, %r15
cmpq $0x180, 0x10(%r14)      # imm = 0x180
jne 0x236a3
cmpq $0x1e0, 0x18(%r14)      # imm = 0x1E0
jne 0x236a3
movl $0x1, 0x78(%r15)
movabsq $0x4078000000000000, %rax # imm = 0x4078000000000000
movq %rax, 0x80(%r15)
movabsq $0x4084000000000000, %rax # imm = 0x4084000000000000
movq %rax, 0x88(%r15)
movq %rbx, %rdi
movq %r14, %rsi
callq 0xf900c
movq 0x38(%r14), %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0xf2917
movq 0x38(%r14), %rdi
callq 0xf28d4
movq %rbx, %rdi
movq %r15, %rsi
callq 0xea9b3
movq %rbx, %rdi
movq %r14, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0xe9752
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/atari-img.c
// Function: de_module_coke
void de_module_coke(deark *c, struct deark_module_info *mi)
{
	mi->id = "coke";
	mi->desc = "Atari Falcon COKE image (.TG1)";
	mi->run_fn = de_run_coke;
	mi->identify_fn = de_identify_coke;
}

// Assembly:
leaq 0xefe1e(%rip), %rax     # 0x11353e
movq %rax, (%rsi)
leaq 0xefe19(%rip), %rax     # 0x113543
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x23745
movq %rax, 0x18(%rsi)
leaq 0x123(%rip), %rax       # 0x23863
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/atari-img.c
// Function: de_run_coke
static void de_run_coke(deark *c, de_module_params *mparams)
{
	i64 imgdatapos;
	struct atari_img_decode_data *adata = NULL;
	de_finfo *fi = NULL;

	adata = de_malloc(c, sizeof(struct atari_img_decode_data));
	adata->bpp = 16;
	adata->w = de_getu16be(12);
	adata->h = de_getu16be(14);
	de_dbg_dimensions(c, adata->w, adata->h);
	imgdatapos = de_getu16be(16);
	de_dbg(c, "image data pos: %d", (int)imgdatapos);

	adata->unc_pixels = dbuf_open_input_subfile(c->infile,
		imgdatapos, c->infile->len-imgdatapos);
	adata->img = de_bitmap_create(c, adata->w, adata->h, 3);

	fi = de_finfo_create(c);
	fi->density.code = DE_DENSITY_UNK_UNITS;
	fi->density.xdens = 288;
	fi->density.ydens = 240;

	fmtutil_atari_decode_image(c, adata);
	de_bitmap_write_to_file_finfo(adata->img, fi, 0);

	if(adata) {
		dbuf_close(adata->unc_pixels);
		de_bitmap_destroy(adata->img);
		de_free(c, adata);
	}
	de_finfo_destroy(c, fi);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl $0x40, %esi
callq 0xe969b
movq %rax, %r14
movq $0x10, (%rax)
movq 0x18(%rbx), %rdi
movl $0xc, %esi
callq 0xef169
movq %rax, 0x10(%r14)
movq 0x18(%rbx), %rdi
movl $0xe, %esi
callq 0xef169
movq %rax, 0x18(%r14)
movq 0x10(%r14), %rsi
movq %rbx, %rdi
movq %rax, %rdx
callq 0xe9b05
movq 0x18(%rbx), %rdi
movl $0x10, %esi
callq 0xef169
movq %rax, %r15
leaq 0xf0319(%rip), %rsi     # 0x113ac5
movq %rbx, %rdi
movl %r15d, %edx
xorl %eax, %eax
callq 0xe9226
movq 0x18(%rbx), %rdi
movq 0x18(%rdi), %rdx
subq %r15, %rdx
movq %r15, %rsi
callq 0xf1988
movq %rax, 0x20(%r14)
movq 0x10(%r14), %rsi
movq 0x18(%r14), %rdx
movq %rbx, %rdi
movl $0x3, %ecx
callq 0xf2cab
movq %rax, 0x38(%r14)
movq %rbx, %rdi
callq 0xea9a9
movq %rax, %r15
movl $0x1, 0x78(%rax)
movabsq $0x4072000000000000, %rax # imm = 0x4072000000000000
movq %rax, 0x80(%r15)
movabsq $0x406e000000000000, %rax # imm = 0x406E000000000000
movq %rax, 0x88(%r15)
movq %rbx, %rdi
movq %r14, %rsi
callq 0xf900c
movq 0x38(%r14), %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0xf2917
movq 0x20(%r14), %rdi
callq 0xf0b13
movq 0x38(%r14), %rdi
callq 0xf28d4
movq %rbx, %rdi
movq %r14, %rsi
callq 0xe9752
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/atari-img.c
// Function: de_module_videomaster
void de_module_videomaster(deark *c, struct deark_module_info *mi)
{
	mi->id = "videomaster";
	mi->desc = "Video Master (.flm/.vid/.vsq)";
	mi->run_fn = de_run_videomaster;
	mi->identify_fn = de_identify_videomaster;
}

// Assembly:
leaq 0xefcd2(%rip), %rax     # 0x113562
movq %rax, (%rsi)
leaq 0xefcd4(%rip), %rax     # 0x11356e
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x238b5
movq %rax, 0x18(%rsi)
leaq 0x20c(%rip), %rax       # 0x23abc
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/atari-img.c
// Function: fix_dark_pal
static void fix_dark_pal(deark *c, struct atari_img_decode_data *adata)
{
	u32 ap[2];

	if(adata->bpp!=1) return;

	ap[0] = adata->pal[0]&0xffffff;
	ap[1] = adata->pal[1]&0xffffff;

	// Always respect white/black and black/white palettes.
	if(ap[0]==0xffffff && ap[1]==0x000000) return; // The usual palette
	if(ap[0]==0x000000 && ap[1]==0xffffff) return;

	// Otherwise assume white/black, unless the user told us not to.
	if(de_get_ext_option(c, "atari:respectpal")) return;

	adata->pal[0] = DE_STOCKCOLOR_WHITE;
	adata->pal[1] = DE_STOCKCOLOR_BLACK;
}

// Assembly:
cmpq $0x1, (%rsi)
jne 0x23b30
pushq %rbx
movq %rsi, %rbx
movq 0x30(%rsi), %rdx
movl $0xffffff, %eax         # imm = 0xFFFFFF
movl (%rdx), %ecx
andl %eax, %ecx
movl %ecx, %esi
xorl %eax, %esi
andl 0x4(%rdx), %eax
orl %eax, %esi
je 0x23b2f
xorl $0xffffff, %eax         # imm = 0xFFFFFF
orl %eax, %ecx
je 0x23b2f
leaq 0xefb5f(%rip), %rsi     # 0x113673
callq 0xea6cb
testq %rax, %rax
jne 0x23b2f
movq 0x30(%rbx), %rax
movabsq $-0xffffff00000001, %rcx # imm = 0xFF000000FFFFFFFF
movq %rcx, (%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/atari-img.c
// Function: tiny_setword
static void tiny_setword(deark *c, tinyctx *d, struct atari_img_decode_data *adata, const u8 *wordbuf)
{
	i64 dstpos;

	// As each word is emitted from the decompressor, we store it in the unc_pixels buffer
	// in a particular location. The location is chosen so as to make the pixel data more
	// contiguous, but (for 2bpp and 4bpp images) more work will still have to be done when
	// the image is generated.

	if(d->stopflag) return;
	d->dcmpr_word_count++;
	dstpos = d->stripe * 8 + d->column*2 + (d->ypos * d->numscans + d->scan)*d->dst_rowspan;
	dbuf_write_at(adata->unc_pixels, dstpos, wordbuf, 2);
	d->ypos++;
	if(d->ypos >= 200) {
		d->ypos = 0;
		d->stripe++;
		if(d->stripe >= d->numstripes) {
			d->stripe = 0;
			d->scan++;
			if(d->scan >= d->numscans) {
				d->scan = 0;
				d->column++;
				if(d->column >= 4) {
					d->stopflag = 1;
					return;
				}
			}
		}
	}
}

// Assembly:
cmpl $0x0, 0x78(%rdi)
je 0x23b38
retq
pushq %rbx
movq %rdi, %rbx
incq 0xa0(%rdi)
movq 0x68(%rdi), %rax
movq 0x88(%rdi), %rcx
shlq $0x3, %rcx
movq 0x98(%rdi), %rdi
leaq (%rcx,%rdi,2), %rcx
imulq 0x80(%rbx), %rax
addq 0x90(%rbx), %rax
imulq 0x70(%rbx), %rax
addq %rcx, %rax
movq 0x20(%rsi), %rdi
movl $0x2, %ecx
movq %rax, %rsi
callq 0xf11f9
movq 0x80(%rbx), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x80(%rbx)
cmpq $0xc7, %rax
jl 0x23c0d
movq $0x0, 0x80(%rbx)
movq 0x88(%rbx), %rax
incq %rax
movq %rax, 0x88(%rbx)
cmpq 0x60(%rbx), %rax
jl 0x23c0d
movq $0x0, 0x88(%rbx)
movq 0x90(%rbx), %rax
incq %rax
movq %rax, 0x90(%rbx)
cmpq 0x68(%rbx), %rax
jl 0x23c0d
movq $0x0, 0x90(%rbx)
movq 0x98(%rbx), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x98(%rbx)
cmpq $0x3, %rax
jl 0x23c0d
movl $0x1, 0x78(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/autocad.c
// Function: de_module_autocad_slb
void de_module_autocad_slb(deark *c, struct deark_module_info *mi)
{
	mi->id = "autocad_slb";
	mi->desc = "AutoCAD Slide Library";
	mi->run_fn = de_run_autocad_slb;
	mi->identify_fn = de_identify_autocad_slb;
}

// Assembly:
leaq 0xefcca(%rip), %rax     # 0x113b25
movq %rax, (%rsi)
leaq 0xefccc(%rip), %rax     # 0x113b31
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x23e80
movq %rax, 0x18(%rsi)
leaq 0x28d(%rip), %rax       # 0x24108
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/awbm.c
// Function: de_module_awbm
void de_module_awbm(deark *c, struct deark_module_info *mi)
{
	mi->id = "awbm";
	mi->desc = "Award BIOS logo";
	mi->run_fn = de_run_awbm;
	mi->identify_fn = de_identify_awbm;
	mi->help_fn = de_help_awbm;
}

// Assembly:
leaq 0xefad9(%rip), %rax     # 0x113c10
movq %rax, (%rsi)
leaq 0xefad4(%rip), %rax     # 0x113c15
movq %rax, 0x8(%rsi)
leaq 0x1b(%rip), %rax        # 0x24167
movq %rax, 0x18(%rsi)
leaq 0x32e(%rip), %rax       # 0x24485
movq %rax, 0x20(%rsi)
leaq 0x3b7(%rip), %rax       # 0x24519
movq %rax, 0x28(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/awbm.c
// Function: de_identify_awbm
static int de_identify_awbm(deark *c)
{
	u8 buf[4];
	i64 nblocks;
	int epa_ext;

	de_read(buf, 0, 4);
	if(!de_memcmp(buf, "AWBM", 4)) return 100;

	nblocks = (i64)buf[0] * (i64)buf[1];
	if(nblocks<1 || nblocks>256) return 0;
	if(c->infile->len == 2 + nblocks*15 + 70) {
		epa_ext = de_input_file_has_ext(c, "epa");
		if(epa_ext) return 100;
		return 20;
	}
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %r14
movq 0x18(%rdi), %rdi
xorl %ebx, %ebx
leaq 0xc(%rsp), %r15
movl $0x4, %ecx
movq %r15, %rsi
xorl %edx, %edx
callq 0xeeee8
cmpl $0x4d425741, (%r15)     # imm = 0x4D425741
je 0x24508
movzbl 0xc(%rsp), %ecx
movzbl 0xd(%rsp), %eax
imulq %rcx, %rax
leaq -0x101(%rax), %rcx
cmpq $-0x100, %rcx
jb 0x2450d
movq 0x18(%r14), %rcx
leaq (%rax,%rax,4), %rax
leaq (%rax,%rax,2), %rax
addq $0x48, %rax
cmpq %rax, 0x18(%rcx)
jne 0x2450d
leaq 0xef7a8(%rip), %rsi     # 0x113c97
movq %r14, %rdi
callq 0xea936
testl %eax, %eax
movl $0x14, %eax
movl $0x64, %ebx
cmovel %eax, %ebx
jmp 0x2450d
movl $0x64, %ebx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/basic-c64.c
// Function: de_module_basic_c64
void de_module_basic_c64(deark *c, struct deark_module_info *mi)
{
	mi->id = "basic_c64";
	mi->desc = "Detokenize C64 BASIC";
	mi->run_fn = de_run_basic_c64;
	mi->identify_fn = de_identify_basic_c64;
}

// Assembly:
leaq 0xef518(%rip), %rax     # 0x113cef
movq %rax, (%rsi)
leaq 0xef518(%rip), %rax     # 0x113cf9
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x247fc
movq %rax, 0x18(%rsi)
leaq 0x1b5(%rip), %rax       # 0x249ac
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/basic-c64.c
// Function: de_run_basic_c64
static void de_run_basic_c64(deark *c, de_module_params *mparams)
{
	lctx *d = NULL;
	i64 file_pos;
	i64 mem_start;
	i64 mem_pos;
	i64 next_line_ptr;
	i64 line_size;

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

	d->outf = dbuf_create_output_file(c, "c64.bas", NULL, 0);

	// TODO: What if the first two bytes are not 0x01 0x08?
	mem_start = 0x0801;

	file_pos = 2;

	while(file_pos < c->infile->len) {
		mem_pos = file_pos - 2 + mem_start;

		next_line_ptr = de_getu16le(file_pos);
		if(next_line_ptr==0x0000) {
			break;
		}

		line_size = next_line_ptr - mem_pos - 2;
		if(line_size<1) {
			break;
		}
		process_line(c, d, file_pos+2, mem_pos+2, line_size);
		file_pos += 2 + line_size;
	}

	dbuf_close(d->outf);
	de_free(c, d);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x8, %esi
callq 0xe969b
movq %rax, %r14
leaq 0xef4f0(%rip), %rsi     # 0x113d0e
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0xf037a
movq %r14, (%rsp)
movq %rax, (%r14)
movq 0x18(%rbx), %rdi
cmpq $0x3, 0x18(%rdi)
jl 0x24987
movl $0x2, %r14d
movq %r14, %r13
movq %r14, %rsi
callq 0xef1ca
testq %rax, %rax
je 0x24987
movq %rax, %r14
movq %rax, %r15
subq %r13, %r15
addq $-0x7ff, %r15           # imm = 0xF801
cmpq $0x3, %r15
jl 0x24987
leaq 0x2(%r13), %r12
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xef1ca
movq %rax, %rbp
leal 0x801(%r13), %r8d
leal -0x2(%r15), %r9d
movq %rbx, %rdi
leaq 0xef47a(%rip), %rsi     # 0x113d16
movl %ebp, %edx
movl %r12d, %ecx
xorl %eax, %eax
callq 0xe9226
movq (%rsp), %r12
movq (%r12), %rdi
leaq 0xef482(%rip), %rsi     # 0x113d39
movl %ebp, %edx
xorl %eax, %eax
callq 0xf0ec4
addq $-0x7ff, %r14           # imm = 0xF801
cmpq $0x5, %r15
movq %r12, %r15
jl 0x2496a
addq $0x4, %r13
xorl %ebp, %ebp
movq 0x18(%rbx), %rdi
movq %r13, %rsi
callq 0xef0d5
movl %eax, %r12d
testl %ebp, %ebp
je 0x24906
cmpb $0x22, %r12b
je 0x24906
movq (%r15), %rdi
movzbl %r12b, %esi
callq 0xf11be
movl $0x1, %ebp
jmp 0x2495e
testb %r12b, %r12b
js 0x2492a
je 0x2496a
movq (%r15), %rdi
movzbl %r12b, %esi
callq 0xf11be
cmpb $0x22, %r12b
jne 0x2495e
xorl %eax, %eax
testl %ebp, %ebp
sete %al
movl %eax, %ebp
jmp 0x2495e
cmpb $-0x35, %r12b
jg 0x24948
andb $0x7f, %r12b
movzbl %r12b, %eax
leaq 0xef509(%rip), %rcx     # 0x113e48
movslq (%rcx,%rax,4), %rsi
addq %rcx, %rsi
jmp 0x2494a
xorl %esi, %esi
movq (%r15), %rdi
testq %rsi, %rsi
jne 0x24959
leaq 0xef3e4(%rip), %rsi     # 0x113d3d
callq 0xf16f0
incq %r13
cmpq %r14, %r13
jl 0x248da
movq (%r15), %rdi
leaq 0xeb827(%rip), %rsi     # 0x11019b
callq 0xf16f0
movq 0x18(%rbx), %rdi
cmpq 0x18(%rdi), %r14
jl 0x24846
movq (%rsp), %r14
movq (%r14), %rdi
callq 0xf0b13
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe9752
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/arcfs.c
// Function: de_module_arcfs
void de_module_arcfs(deark *c, struct deark_module_info *mi)
{
	mi->id = "arcfs";
	mi->desc = "ArcFS (RISC OS archive)";
	mi->run_fn = de_run_arcfs;
	mi->identify_fn = de_identify_arcfs;
}

// Assembly:
leaq 0xef5a6(%rip), %rax     # 0x113fa1
movq %rax, (%rsi)
leaq 0xef5a2(%rip), %rax     # 0x113fa7
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x24a20
movq %rax, 0x18(%rsi)
leaq 0xa38(%rip), %rax       # 0x25453
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/arcfs.c
// Function: de_module_squash
void de_module_squash(deark *c, struct deark_module_info *mi)
{
	mi->id = "squash";
	mi->desc = "Squash (RISC OS compressed file)";
	mi->run_fn = de_run_squash;
	mi->identify_fn = de_identify_squash;
}

// Assembly:
leaq 0xeeb3f(%rip), %rax     # 0x113fbf
movq %rax, (%rsi)
leaq 0xeeb3c(%rip), %rax     # 0x113fc6
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x254a5
movq %rax, 0x18(%rsi)
leaq 0x28c(%rip), %rax       # 0x2572c
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/arcfs.c
// Function: de_run_squash
static void de_run_squash(deark *c, de_module_params *mparams)
{
	sqctx *d = NULL;

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

	do_squash_header(c, d, 0);
	do_squash_main(c, d);

	de_free(c, d);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rdi, %rbx
movl $0x38, %esi
callq 0xe969b
movq %rax, %r14
leaq 0x68(%rsp), %r15
movq $0x0, (%r15)
leaq 0x113e85(%rip), %rsi    # 0x13935e
movq %rbx, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
addq $0x4, (%r15)
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xef3a0
movq %rax, (%r14)
leaq 0xeebae(%rip), %rsi     # 0x1140ba
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq 0x18(%rbx), %rsi
leaq 0x8(%r14), %r13
movq (%r15), %rcx
movq %rbx, %rdi
movq %r13, %rdx
callq 0xf978c
addq $0x8, (%r15)
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
leaq 0xc(%rsp), %rsi
movq %rbx, %rdi
callq 0xe958c
leaq 0x30(%rsp), %r15
leaq 0x18(%rsp), %rdx
leaq 0x68(%rsp), %rcx
movq %rbx, %rdi
movq %r15, %rsi
callq 0xfa6e0
movq 0x18(%rbx), %rax
movq %rax, (%r15)
movq $0x14, 0x8(%r15)
movq 0x18(%rax), %rax
addq $-0x14, %rax
movq %rax, 0x10(%r15)
leaq 0x10c91f(%rip), %rsi    # 0x131ea8
movl $0x14, %edx
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq %rbx, %rdi
callq 0xea9a9
movq %rax, %r15
movq %rbx, %rdi
callq 0xf6870
movq %rax, %r12
movb $0x1, 0x10(%r15)
movl 0x14(%r14), %eax
movl %eax, 0xa0(%r15)
movl 0xc(%r14), %eax
movl %eax, 0xa4(%r15)
movl 0x10(%r14), %eax
movl %eax, 0xa8(%r15)
leaq 0x10fe49(%rip), %rsi    # 0x135431
movq %r12, %rdi
movl $0x5, %edx
callq 0xf6a40
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %r13, %rcx
xorl %r8d, %r8d
movl $0x1, %r9d
callq 0xf9907
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, 0x10(%rsp)
movq %r12, %rdx
xorl %ecx, %ecx
callq 0xea9e4
cmpb $0x0, 0x28(%r14)
je 0x25637
leaq 0x28(%r14), %rax
movups (%rax), %xmm0
movups %xmm0, 0x18(%r15)
movq %rbx, %rdi
xorl %esi, %esi
movq %r15, %rdx
xorl %ecx, %ecx
callq 0xf037a
movq %rax, %r13
movq %rax, %rdi
callq 0xf0e3f
leaq 0x18(%rsp), %rbp
movq %r13, (%rbp)
movb $0x0, 0x8(%rbp)
xorps %xmm0, %xmm0
leaq 0x50(%rsp), %r8
movaps %xmm0, (%r8)
movl $0x0, 0x10(%r8)
movl $0x1, (%r8)
orb $0x1, 0x4(%r8)
leaq 0x30(%rsp), %rsi
leaq 0x68(%rsp), %r12
movq %rbx, %rdi
movq %rbp, %rdx
movq %r12, %rcx
callq 0x102cf0
movq (%rbp), %rdi
callq 0xf0ea4
cmpl $0x0, (%r12)
je 0x256c9
leaq 0x68(%rsp), %rsi
movq %rbx, %rdi
callq 0xfa6a8
leaq 0xef5f5(%rip), %rsi     # 0x114caf
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9df7
jmp 0x256e6
movq 0x18(%r13), %rcx
movq (%r14), %rdx
cmpq %rdx, %rcx
je 0x256e6
leaq 0xeeb24(%rip), %rsi     # 0x114200
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9df7
movq %r13, %rdi
callq 0xf0b13
movq %rbx, %rdi
movq %r15, %rsi
callq 0xea9b3
movq 0x10(%rsp), %rdi
callq 0xf6bb0
movl 0xc(%rsp), %esi
movq %rbx, %rdi
callq 0xe9595
movq %rbx, %rdi
movq %r14, %rsi
callq 0xe9752
addq $0xc8, %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/apm.c
// Function: de_module_apm
void de_module_apm(deark *c, struct deark_module_info *mi)
{
	mi->id = "apm";
	mi->desc = "Apple Partition Map";
	mi->run_fn = de_run_apm;
	mi->identify_fn = de_identify_apm;
}

// Assembly:
leaq 0xeeadb(%rip), %rax     # 0x114236
movq %rax, (%rsi)
leaq 0xeead5(%rip), %rax     # 0x11423a
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x25780
movq %rax, 0x18(%rsi)
leaq 0x6a(%rip), %rax        # 0x257e5
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/apm.c
// Function: de_run_apm
static void de_run_apm(deark *c, de_module_params *mparams)
{
	lctx *d = NULL;
	i64 i;
	int ret;

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

	d->secsize = 512;

	// Read the first map entry (should set d->npartitions)
	ret = do_entry_at_sector(c, d, 1);
	if(!ret) goto done;

	// Read the rest of the entries
	for(i=1; i<d->npartitions; i++) {
		ret = do_entry_at_sector(c, d, 1+i);
		if(!ret) goto done;
	}

done:
	de_free(c, d);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl $0x10, %esi
callq 0xe969b
movq %rax, %r14
movq $0x200, (%rax)          # imm = 0x200
movl $0x1, %edx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x25831
testl %eax, %eax
je 0x257d5
movl $0x2, %r15d
leaq -0x1(%r15), %rax
cmpq 0x8(%r14), %rax
jge 0x257d5
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x25831
incq %r15
testl %eax, %eax
jne 0x257b6
movq %rbx, %rdi
movq %r14, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0xe9752
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/afcp.c
// Function: de_module_afcp
void de_module_afcp(deark *c, struct deark_module_info *mi)
{
	mi->id = "afcp";
	mi->desc = "AXS File Concatenation Protocol";
	mi->run_fn = de_run_afcp;
	mi->flags |= DE_MODFLAG_HIDDEN;
}

// Assembly:
leaq 0xee77a(%rip), %rax     # 0x1143a5
movq %rax, (%rsi)
leaq 0xee775(%rip), %rax     # 0x1143aa
movq %rax, 0x8(%rsi)
leaq 0x9(%rip), %rax         # 0x25c49
movq %rax, 0x18(%rsi)
orb $0x1, 0x30(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/arc.c
// Function: de_module_arc
void de_module_arc(deark *c, struct deark_module_info *mi)
{
	mi->id = "arc";
	mi->desc = "ARC compressed archive";
	mi->run_fn = de_run_arc;
	mi->identify_fn = de_identify_arc;
	mi->help_fn = de_help_arc;
}

// Assembly:
leaq 0xf92a3(%rip), %rax     # 0x11f45a
movq %rax, (%rsi)
leaq 0xee380(%rip), %rax     # 0x114541
movq %rax, 0x8(%rsi)
leaq 0x1b(%rip), %rax        # 0x261e7
movq %rax, 0x18(%rsi)
leaq 0x125(%rip), %rax       # 0x262fc
movq %rax, 0x20(%rsi)
leaq 0x413(%rip), %rax       # 0x265f5
movq %rax, 0x28(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/arc.c
// Function: de_run_arc
static void de_run_arc(deark *c, de_module_params *mparams)
{
	lctx *d = NULL;
	const char *s;

	d = de_malloc(c, sizeof(lctx));
	d->fmt = FMT_ARC;
	d->fmtname = "ARC";
	// TODO: Make 'recurse' configurable. Would require us to make the embedded
	// archives end with the correct marker.
	d->recurse_subdirs = 1;
	d->input_encoding_for_filenames = de_get_input_encoding(c, NULL, DE_ENCODING_CP437);
	d->input_encoding_for_comments = DE_EXTENC_MAKE(d->input_encoding_for_filenames,
		DE_ENCSUBTYPE_HYBRID);

	// TODO: It would probably be worth it to have a separate module for PAK, so we
	// can take the .PAK file extension into account when guessing what method #10
	// is. It's complicated, though, and not very useful until we support Crushed
	// decompression.

	s = de_get_ext_option(c, "arc:method10");
	if(s) {
		if(!de_strcmp(s, "trimmed")) {
			d->method10 = 1;
		}
		else if(!de_strcmp(s, "crushed")) {
			d->method10 = 2;
		}
	}

	if(de_havemodcode(c, mparams, '6')) {
		do_convert_pak16sfx(c, d);
		goto done;
	}

	do_run_arc_spark_internal(c, d);

done:
	destroy_lctx(c, d);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
movl $0x68, %esi
callq 0xe969b
movq %rax, %r14
movl $0x1, %eax
movl %eax, (%r14)
leaq 0xfe335(%rip), %rcx     # 0x124546
movq %rcx, 0x8(%r14)
movl %eax, 0x20(%r14)
movq %rbx, %rdi
xorl %esi, %esi
movl $0xd, %edx
callq 0xeb7d1
movl %eax, 0x10(%r14)
movzbl %al, %eax
orl $0x300, %eax            # imm = 0x300
movl %eax, 0x14(%r14)
leaq 0xee34e(%rip), %rsi     # 0x11458d
movq %rbx, %rdi
callq 0xea6cb
testq %rax, %rax
je 0x2627f
movq %rax, %r12
leaq 0xee344(%rip), %rsi     # 0x11459a
movq %rax, %rdi
callq 0x181a0
testl %eax, %eax
je 0x26279
leaq 0xee70c(%rip), %rsi     # 0x114975
movq %r12, %rdi
callq 0x181a0
testl %eax, %eax
jne 0x2627f
movb $0x2, %al
jmp 0x2627b
movb $0x1, %al
movb %al, 0x1c(%r14)
movq %rbx, %rdi
movq %r15, %rsi
movl $0x36, %edx
callq 0xea97e
testl %eax, %eax
je 0x262db
movl $0x4, (%r14)
movl $0x0, 0x20(%r14)
movb $0x1a, 0x24(%r14)
movq 0x18(%rbx), %rax
movq 0x18(%rax), %rcx
leaq 0x10a6(%rip), %r9       # 0x2735c
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
xorl %r8d, %r8d
callq 0x27154
movq 0x60(%r14), %rdi
testq %rdi, %rdi
je 0x262e6
movl $0xfe00, %esi           # imm = 0xFE00
callq 0xf15b0
jmp 0x262e6
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2688f
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x270be
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/arc.c
// Function: de_module_spark
void de_module_spark(deark *c, struct deark_module_info *mi)
{
	mi->id = "spark";
	mi->desc = "Spark archive";
	mi->run_fn = de_run_spark;
	mi->identify_fn = de_identify_spark;
	mi->help_fn = de_help_spark;
}

// Assembly:
leaq 0xedf4e(%rip), %rax     # 0x114558
movq %rax, (%rsi)
leaq 0xedf4a(%rip), %rax     # 0x11455e
movq %rax, 0x8(%rsi)
leaq 0x1b(%rip), %rax        # 0x2663a
movq %rax, 0x18(%rsi)
leaq 0x89(%rip), %rax        # 0x266b3
movq %rax, 0x20(%rsi)
leaq 0x140(%rip), %rax       # 0x26775
movq %rax, 0x28(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/arc.c
// Function: de_run_spark
static void de_run_spark(deark *c, de_module_params *mparams)
{
	lctx *d = NULL;

	d = de_malloc(c, sizeof(lctx));
	d->fmt = FMT_SPARK;
	d->fmtname = "Spark";
	d->input_encoding_for_filenames = de_get_input_encoding(c, NULL, DE_ENCODING_RISCOS);
	d->input_encoding_for_comments = DE_EXTENC_MAKE(d->input_encoding_for_filenames,
		DE_ENCSUBTYPE_HYBRID);
	d->recurse_subdirs = de_get_ext_option_bool(c, "spark:recurse", 1);

	do_run_arc_spark_internal(c, d);
	destroy_lctx(c, d);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x68, %esi
callq 0xe969b
movq %rax, %r14
movl $0x2, (%rax)
leaq 0xee581(%rip), %rax     # 0x114bdc
movq %rax, 0x8(%r14)
movq %rbx, %rdi
xorl %esi, %esi
movl $0x14, %edx
callq 0xeb7d1
movl %eax, 0x10(%r14)
movzbl %al, %eax
orl $0x300, %eax            # imm = 0x300
movl %eax, 0x14(%r14)
leaq 0xee55d(%rip), %rsi     # 0x114be2
movq %rbx, %rdi
movl $0x1, %edx
callq 0xea727
movl %eax, 0x20(%r14)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2688f
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x270be
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/arc.c
// Function: de_identify_spark
static int de_identify_spark(deark *c)
{
	u8 b;
	u32 load_addr;
	int ldaddrcheck = 0;
	int has_trailer = 0;

	if(de_getbyte(0) != 0x1a) return 0;
	b = de_getbyte(1); // compression method
	if(b==0x82 || b==0x83 || b==0x88 || b==0x89 || b==0xff) {
		;
	}
	else if(b==0x81 || b==0x84 || b==0x85 || b==0x86) {
		; // TODO: Verify that these are possible in Spark.
	}
	else {
		return 0;
	}

	load_addr = (u32)de_getu32le(29);
	if((load_addr & 0xfff00000) == 0xfff00000) {
		ldaddrcheck = 1;
	}

	if(de_getu16be(c->infile->len-2) == 0x1a80) {
		has_trailer = 1;
	}

	if(has_trailer && ldaddrcheck) return 85;
	if(ldaddrcheck) return 30;
	if(has_trailer) return 10;
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
xorl %r14d, %r14d
xorl %esi, %esi
callq 0xef0d5
cmpb $0x1a, %al
jne 0x2675d
movq 0x18(%rbx), %rdi
movl $0x1, %esi
callq 0xef0d5
movzbl %al, %eax
leal -0x81(%rax), %ecx
cmpl $0x8, %ecx
ja 0x2676c
cmpl $0x6, %ecx
je 0x2676c
movq 0x18(%rbx), %rdi
movl $0x1d, %esi
callq 0xef37e
movq %rax, %r15
andl $0xfff00000, %r15d      # imm = 0xFFF00000
movl $0xfff00000, %r12d      # imm = 0xFFF00000
xorq %r15, %r12
movq 0x18(%rbx), %rdi
movq 0x18(%rdi), %rsi
addq $-0x2, %rsi
callq 0xef169
movq %rax, %rcx
xorq $0x1a80, %rcx           # imm = 0x1A80
movl $0x55, %r14d
orq %r12, %rcx
je 0x2675d
xorl %ecx, %ecx
cmpq $0x1a80, %rax           # imm = 0x1A80
movl $0xa, %eax
cmovnel %ecx, %eax
cmpl $0xfff00000, %r15d      # imm = 0xFFF00000
movl $0x1e, %r14d
cmovnel %eax, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
cmpl $0xff, %eax
je 0x266f5
jmp 0x2675d
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/arc.c
// Function: de_module_arcmac
void de_module_arcmac(deark *c, struct deark_module_info *mi)
{
	mi->id = "arcmac";
	mi->desc = "ArcMac compressed archive";
	mi->run_fn = de_run_arcmac;
	mi->identify_fn = de_identify_arcmac;
}

// Assembly:
leaq 0xedde2(%rip), %rax     # 0x11456c
movq %rax, (%rsi)
leaq 0xedddf(%rip), %rax     # 0x114573
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x267af
movq %rax, 0x18(%rsi)
leaq 0x70(%rip), %rax        # 0x2681a
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/arc.c
// Function: de_run_arcmac
static void de_run_arcmac(deark *c, de_module_params *mparams)
{
	lctx *d = NULL;

	d = de_malloc(c, sizeof(lctx));
	d->fmt = FMT_ARCMAC;
	d->fmtname = "ArcMac";
	d->recurse_subdirs = 1;
	d->input_encoding_for_arcmac_fn = de_get_input_encoding(c, NULL, DE_ENCODING_MACROMAN);
	d->input_encoding_for_filenames = DE_ENCODING_CP437;
	d->input_encoding_for_comments = DE_EXTENC_MAKE(d->input_encoding_for_filenames,
		DE_ENCSUBTYPE_HYBRID);

	do_run_arc_spark_internal(c, d);
	destroy_lctx(c, d);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x68, %esi
callq 0xe969b
movq %rax, %r14
movl $0x3, (%rax)
leaq 0xee456(%rip), %rax     # 0x114c26
movq %rax, 0x8(%r14)
movl $0x1, 0x20(%r14)
movq %rbx, %rdi
xorl %esi, %esi
movl $0x11, %edx
callq 0xeb7d1
movl %eax, 0x18(%r14)
movabsq $0x30d0000000d, %rax    # imm = 0x30D0000000D
movq %rax, 0x10(%r14)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2688f
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x270be
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/arc.c
// Function: de_identify_arcmac
static int de_identify_arcmac(deark *c)
{
	u8 buf1[2];
	u8 buf2[2];

	de_read(buf1, 0, 2);
	if(buf1[0]!=0x1b) return 0;
	if(!(buf1[1]>=1 && buf1[1]<=9)) return 0;
	de_read(buf2, 59, 2);
	if(buf2[0]!=0x1a) return 0;
	if(buf2[1]!=buf1[1]) return 0;
	return 80;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %r14
movq 0x18(%rdi), %rdi
xorl %ebx, %ebx
leaq 0xc(%rsp), %r15
movl $0x2, %ecx
movq %r15, %rsi
xorl %edx, %edx
callq 0xeeee8
cmpb $0x1b, (%r15)
jne 0x26883
movb 0xd(%rsp), %al
decb %al
cmpb $0x8, %al
ja 0x26883
movq 0x18(%r14), %rdi
leaq 0xe(%rsp), %r14
movl $0x3b, %edx
movl $0x2, %ecx
movq %r14, %rsi
callq 0xeeee8
cmpb $0x1a, (%r14)
jne 0x26883
movb 0xf(%rsp), %al
xorl %ecx, %ecx
cmpb 0xd(%rsp), %al
movl $0x50, %ebx
cmovnel %ecx, %ebx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq