LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/grasp.c
// Function: de_identify_graspfont
static int de_identify_graspfont(deark *c)
{
	i64 reported_filesize;
	i64 num_chars;
	i64 bytes_per_glyph;

	if(!de_input_file_has_ext(c, "set") && !de_input_file_has_ext(c, "fnt"))
		return 0;

	if(gfont_is_new_format(c)) {
		return 30;
	}

	reported_filesize = de_getu16le(0);
	if(reported_filesize != c->infile->len) return 0;
	num_chars = (i64)de_getbyte(2);
	if(num_chars==0) num_chars=256;
	bytes_per_glyph = (i64)de_getbyte(6);
	if(7+num_chars*bytes_per_glyph == reported_filesize)
		return 100;
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0xcb127(%rip), %rsi     # 0x11ebe1
callq 0xea491
testl %eax, %eax
jne 0x53ad6
leaq 0xc9903(%rip), %rsi     # 0x11d3cd
movq %rbx, %rdi
callq 0xea491
testl %eax, %eax
je 0x53b46
movq %rbx, %rdi
callq 0x53b52
movl $0x1e, %r15d
testl %eax, %eax
jne 0x53b49
movq 0x18(%rbx), %rdi
xorl %r15d, %r15d
xorl %esi, %esi
callq 0xeebc8
movq 0x18(%rbx), %rdi
cmpq 0x18(%rdi), %rax
jne 0x53b49
movq %rax, %r14
movl $0x2, %esi
callq 0xeead3
movzbl %al, %eax
testb %al, %al
movl $0x100, %r15d           # imm = 0x100
cmovneq %rax, %r15
movq 0x18(%rbx), %rdi
movl $0x6, %esi
callq 0xeead3
movzbl %al, %eax
imulq %r15, %rax
addq $0x7, %rax
xorl %ecx, %ecx
cmpq %r14, %rax
movl $0x64, %r15d
cmovnel %ecx, %r15d
jmp 0x53b49
xorl %r15d, %r15d
movl %r15d, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/grob.c
// Function: de_module_grob
void de_module_grob(deark *c, struct deark_module_info *mi)
{
	mi->id = "grob";
	mi->desc = "GROB - HP48/49 calculator image";
	mi->run_fn = de_run_grob;
	mi->identify_fn = de_identify_grob;
	mi->help_fn = de_help_grob;
}

// Assembly:
leaq 0xcc8b5(%rip), %rax     # 0x120448
movq %rax, (%rsi)
leaq 0xcc8b0(%rip), %rax     # 0x12044d
movq %rax, 0x8(%rsi)
leaq 0x1b(%rip), %rax        # 0x53bc3
movq %rax, 0x18(%rsi)
leaq 0x49c(%rip), %rax       # 0x5404f
movq %rax, 0x20(%rsi)
leaq 0x51f(%rip), %rax       # 0x540dd
movq %rax, 0x28(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/grob.c
// Function: de_identify_grob
static int de_identify_grob(deark *c)
{
	u8 buf[10];
	de_read(buf, 0, 10);

	if(buf[0]=='H' && buf[1]=='P' && buf[2]=='H' && buf[3]=='P' &&
		buf[4]=='4' && (buf[5]=='8' || buf[5]=='9') &&
		buf[8]==0x1e && buf[9]==0x2b)
	{
			return 100;
	}

	if(buf[0]=='G' && buf[1]=='R' && buf[2]=='O' && buf[3]=='B') {
		return 90;
	}

	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq 0x18(%rdi), %rdi
xorl %r14d, %r14d
leaq 0xe(%rsp), %rbx
movl $0xa, %ecx
movq %rbx, %rsi
xorl %edx, %edx
callq 0xee8d4
movb (%rbx), %dl
cmpb $0x48, %dl
setne %al
movd 0x1(%rbx), %xmm0
movd %xmm0, %ecx
cmpl $0x34504850, %ecx       # imm = 0x34504850
setne %sil
orb %al, %sil
jne 0x540ae
movb 0x13(%rsp), %al
andb $-0x2, %al
cmpb $0x38, %al
jne 0x540ae
cmpb $0x1e, 0x16(%rsp)
jne 0x540ae
movl $0x64, %eax
cmpb $0x2b, 0x17(%rsp)
je 0x540d5
xorb $0x47, %dl
movl %ecx, %eax
xorb $0x52, %al
orb %dl, %al
movl %ecx, %edx
shrl $0x8, %edx
xorb $0x4f, %dl
orb %al, %dl
shrl $0x10, %ecx
xorb $0x42, %cl
orb %dl, %cl
movl $0x5a, %eax
cmovel %eax, %r14d
movl %r14d, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/grob.c
// Function: grob_read_binary_bitmap
static void grob_read_binary_bitmap(deark *c, lctx *d, dbuf *inf, i64 pos)
{
	i64 h_logical;
	i64 rowspan;
	i64 pdwidth;
	de_bitmap *img = NULL;
	de_color pal[256];

	if(d->num_planes<=1) {
		de_convert_and_write_image_bilevel2(inf, pos, d->w, d->h_phys, (d->w+7)/8,
			DE_CVTF_WHITEISZERO|DE_CVTF_LSBFIRST, NULL, 0);
		return;
	}
	if(d->num_planes>8) goto done;

	if((d->h_phys % d->num_planes) != 0) {
		de_warn(c, "Number of rows is not divisible by number of planes. The grob:planes "
			"setting is probably not correct.");
	}
	h_logical = d->h_phys/d->num_planes;

	if(!de_good_image_dimensions(c, d->w, h_logical))
		goto done;

	de_dbg(c, "logical dimensions: %d"DE_CHAR_TIMES"%d", (int)d->w, (int)h_logical);

	rowspan = (d->w+7)/8;
	pdwidth = rowspan * 8;
	img = de_bitmap_create2(c, d->w, pdwidth, h_logical, 1);

	de_zeromem(pal, sizeof(pal));
	de_make_grayscale_palette(pal, 1ULL<<d->num_planes, 0x1);

	de_convert_image_paletted_planar(inf, pos, d->num_planes,
		rowspan, h_logical*rowspan, pal, img, 0x1 | (d->grayscale_lsb?0x02:0));

	de_bitmap_write_to_file_finfo(img, NULL, 0);
done:
	de_bitmap_destroy(img);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq 0x18(%rsi), %rsi
cmpq $0x1, %rsi
jg 0x54160
movq (%r15), %rdx
movq 0x8(%r15), %rcx
leaq 0x7(%rdx), %rax
leaq 0xe(%rdx), %r8
testq %rax, %rax
cmovnsq %rax, %r8
sarq $0x3, %r8
movq %r14, %rdi
movq %rbx, %rsi
movl $0x3, %r9d
pushq $0x0
pushq $0x0
callq 0xf2b5b
addq $0x418, %rsp            # imm = 0x418
jmp 0x54279
cmpq $0x8, %rsi
ja 0x54267
movq %rdi, %r13
movq 0x8(%r15), %rcx
movq %rcx, %rax
cqto
idivq %rsi
testq %rdx, %rdx
je 0x54197
leaq 0xcc3c6(%rip), %rsi     # 0x12054b
movq %r13, %rdi
xorl %eax, %eax
callq 0xe8faa
movq 0x8(%r15), %rcx
movq 0x18(%r15), %rsi
movq %rcx, %rax
cqto
idivq %rsi
movq %rax, %r12
movq (%r15), %rsi
movq %r13, %rdi
movq %rax, %rdx
callq 0xf1db1
testl %eax, %eax
je 0x54267
movl (%r15), %edx
leaq 0xcc3ef(%rip), %rsi     # 0x1205b1
movq %r13, %rdi
movl %r12d, %ecx
xorl %eax, %eax
callq 0xe8617
movq (%r15), %rsi
leaq 0x7(%rsi), %rax
leaq 0xe(%rsi), %rdx
testq %rax, %rax
cmovnsq %rax, %rdx
movq %rdx, %rbp
sarq $0x3, %rbp
andq $-0x8, %rdx
movq %r13, %rdi
movq %r12, %rcx
movl $0x1, %r8d
callq 0xf26a5
movq %rax, %r13
movq %rsp, %rdi
movl $0x400, %edx            # imm = 0x400
xorl %esi, %esi
callq 0x18140
movb 0x18(%r15), %cl
movl $0x1, %esi
shlq %cl, %rsi
movq %rsp, %rdi
movl $0x1, %edx
callq 0xf3bdb
movq 0x18(%r15), %rdx
imulq %rbp, %r12
xorl %eax, %eax
cmpl $0x0, 0x20(%r15)
setne %al
leal 0x1(%rax,%rax), %eax
movq %r14, %rdi
movq %rbx, %rsi
movq %rbp, %rcx
movq %r12, %r8
movq %rsp, %r9
pushq %rax
pushq %r13
callq 0xf30b3
addq $0x10, %rsp
movq %r13, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xf22d0
jmp 0x5426a
xorl %r13d, %r13d
movq %r13, %rdi
callq 0xf228d
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/gzip.c
// Function: de_module_gzip
void de_module_gzip(deark *c, struct deark_module_info *mi)
{
	mi->id = "gzip";
	mi->desc = "gzip compressed file";
	mi->run_fn = de_run_gzip;
	mi->identify_fn = de_identify_gzip;
}

// Assembly:
leaq 0xcc404(%rip), %rax     # 0x12068f
movq %rax, (%rsi)
leaq 0xcc3ff(%rip), %rax     # 0x120694
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x542b0
movq %rax, 0x18(%rsi)
leaq 0x5a0(%rip), %rax       # 0x5484b
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/corel.c
// Function: de_module_cdr_wl
void de_module_cdr_wl(deark *c, struct deark_module_info *mi)
{
	mi->id = "cdr_wl";
	mi->desc = "CorelDRAW (old WL format)";
	mi->desc2 = "extract preview image";
	mi->run_fn = de_run_cdr_wl;
	mi->identify_fn = de_identify_cdr_wl;
	mi->help_fn = de_help_cdr_wl;
}

// Assembly:
leaq 0xcbffd(%rip), %rax     # 0x120898
movq %rax, (%rsi)
leaq 0xcbffa(%rip), %rax     # 0x12089f
movq %rax, 0x8(%rsi)
leaq 0xc7c52(%rip), %rax     # 0x11c502
movq %rax, 0x10(%rsi)
leaq 0x1b(%rip), %rax        # 0x548d6
movq %rax, 0x18(%rsi)
leaq 0x14e(%rip), %rax       # 0x54a14
movq %rax, 0x20(%rsi)
leaq 0x193(%rip), %rax       # 0x54a64
movq %rax, 0x28(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/corel.c
// Function: de_module_corel_clb
void de_module_corel_clb(deark *c, struct deark_module_info *mi)
{
	mi->id = "corel_clb";
	mi->desc = "CorelMOSAIC .CLB library";
	mi->run_fn = de_run_corel_clb;
	mi->identify_fn = de_identify_corel_clb;
	mi->help_fn = de_help_corel_clb;
}

// Assembly:
leaq 0xcbe40(%rip), %rax     # 0x1208b9
movq %rax, (%rsi)
leaq 0xcbe40(%rip), %rax     # 0x1208c3
movq %rax, 0x8(%rsi)
leaq 0x1b(%rip), %rax        # 0x54aa9
movq %rax, 0x18(%rsi)
leaq 0x405(%rip), %rax       # 0x54e9e
movq %rax, 0x20(%rsi)
leaq 0x480(%rip), %rax       # 0x54f24
movq %rax, 0x28(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/corel.c
// Function: de_identify_corel_clb
static int de_identify_corel_clb(deark *c)
{
	i64 nlen, n;

	// This might be too strict. Need more samples.
	if(!de_input_file_has_ext(c, "clb")) return 0;
	nlen = de_getu16le(0);
	if(nlen<1 || nlen>63) return 0;
	if(de_getbyte(2+nlen-1)!=0x00) return 0;
	n = de_getu32le(2+nlen+4);
	if(n!=0x00000001) return 0;
	n = de_getu32le(2+nlen+16);
	if(n!=2+nlen+20 && n!=0) return 0;
	return 100;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
leaq 0xcba12(%rip), %rsi     # 0x1208bf
callq 0xea491
testl %eax, %eax
je 0x54f1a
movq 0x18(%r14), %rdi
xorl %ebx, %ebx
xorl %esi, %esi
callq 0xeebc8
movq %rax, %r15
addq $-0x40, %rax
cmpq $-0x3f, %rax
jb 0x54f1c
movq 0x18(%r14), %rdi
leaq 0x1(%r15), %rsi
callq 0xeead3
testb %al, %al
jne 0x54f1c
movq 0x18(%r14), %rdi
leaq 0x6(%r15), %rsi
callq 0xeed61
cmpq $0x1, %rax
jne 0x54f1c
movq 0x18(%r14), %rdi
leaq 0x12(%r15), %rsi
callq 0xeed61
addq $0x16, %r15
xorl %ebx, %ebx
testq %rax, %rax
movl $0x64, %ecx
cmovel %ecx, %ebx
cmpq %r15, %rax
cmovel %ecx, %ebx
jmp 0x54f1c
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/corel.c
// Function: de_module_corel_bmf
void de_module_corel_bmf(deark *c, struct deark_module_info *mi)
{
	mi->id = "corel_bmf";
	mi->desc = "Corel Gallery BMF";
	mi->run_fn = de_run_corel_bmf;
	mi->identify_fn = de_identify_corel_bmf;
}

// Assembly:
leaq 0xcb9a3(%rip), %rax     # 0x1208dc
movq %rax, (%rsi)
leaq 0xcb9a3(%rip), %rax     # 0x1208e6
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x54f5e
movq %rax, 0x18(%rsi)
leaq 0x102(%rip), %rax       # 0x5505b
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/corel.c
// Function: de_run_corel_bmf
static void de_run_corel_bmf(deark *c, de_module_params *mparams1)
{
	de_module_params *mparams2 = NULL;
	int saved_indent_level;
	i64 pos;
	i64 n;
	i64 seg_size;

	de_dbg_indent_save(c, &saved_indent_level);
	pos = 65;
	seg_size = de_getu32le_p(&pos);
	de_dbg(c, "preview image segment at %"I64_FMT", len=%"I64_FMT, pos, seg_size);
	de_dbg_indent(c, 1);

	if(pos + seg_size > c->infile->len) {
		seg_size = c->infile->len - pos;
	}

	n = de_getu32le(pos);
	if(n!=40) {
		de_err(c, "Unsupported Corel BMF version");
		goto done;
	}

	mparams2 = de_malloc(c, sizeof(de_module_params));
	mparams2->in_params.codes = "X";
	mparams2->in_params.flags = 0x81;
	de_run_module_by_id_on_slice(c, "dib", mparams2, c->infile, pos, seg_size);

done:
	de_free(c, mparams2);
	de_dbg_indent_restore(c, saved_indent_level);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x4(%rsp), %rsi
callq 0xe8a1c
leaq 0x8(%rsp), %r15
movq $0x41, (%r15)
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xeed83
movq %rax, %r14
movq (%r15), %rdx
leaq 0xcbaa7(%rip), %rsi     # 0x120a44
movq %rbx, %rdi
movq %rax, %rcx
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movq (%r15), %r15
movq 0x18(%rbx), %rdi
movq 0x18(%rdi), %r13
movq %r15, %rsi
callq 0xeed61
cmpq $0x28, %rax
jne 0x55022
movq %r13, %r12
subq %r15, %r12
addq %r14, %r15
cmpq %r13, %r15
cmovleq %r14, %r12
movl $0x70, %esi
movq %rbx, %rdi
callq 0xe8b2b
movq %rax, %r14
leaq 0xeea45(%rip), %rax     # 0x143a3c
movq %rax, (%r14)
movl $0x81, 0x8(%r14)
movq 0x18(%rbx), %rcx
movq 0x8(%rsp), %r8
leaq 0xce3fd(%rip), %rsi     # 0x12340f
movq %rbx, %rdi
movq %r14, %rdx
movq %r12, %r9
callq 0xe9aa3
jmp 0x55036
leaq 0xcba41(%rip), %rsi     # 0x120a6a
xorl %r14d, %r14d
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9295
movq %rbx, %rdi
movq %r14, %rsi
callq 0xe8be2
movl 0x4(%rsp), %esi
movq %rbx, %rdi
callq 0xe8a25
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/corel.c
// Function: de_module_corel_ccx
void de_module_corel_ccx(deark *c, struct deark_module_info *mi)
{
	mi->id = "corel_ccx";
	mi->desc = "Corel CCX";
	mi->desc2 = "Decompress to CMX";
	mi->run_fn = de_run_corel_ccx;
	mi->identify_fn = de_identify_corel_ccx;
}

// Assembly:
leaq 0xcb870(%rip), %rax     # 0x1208f8
movq %rax, (%rsi)
leaq 0xcb870(%rip), %rax     # 0x120902
movq %rax, 0x8(%rsi)
leaq 0xcb86f(%rip), %rax     # 0x12090c
movq %rax, 0x10(%rsi)
leaq 0x10(%rip), %rax        # 0x550b8
movq %rax, 0x18(%rsi)
leaq 0x327(%rip), %rax       # 0x553da
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/corel.c
// Function: my_ccx_chunk_handler
static int my_ccx_chunk_handler(struct de_iffctx *ictx)
{
	lctx *d = (lctx*)ictx->userdata;

	switch(ictx->chunkctx->chunk4cc.id) {
	case CODE_RIFF:
		ictx->is_std_container = 1;
		return 1;
	case CODE_pack:
		d->pack_pos = ictx->chunkctx->pos;
		d->pack_dpos = ictx->chunkctx->dpos;
		d->pack_dlen = ictx->chunkctx->dlen;
		// We have what we need; tell the RIFF parser to stop.
		return 0;
	}

	ictx->handled = 1; // We're just scanning the file, so suppress default chunk handling
	return 1;
}

// Assembly:
movq 0x128(%rdi), %rax
movl 0x4(%rax), %ecx
cmpl $0x7061636b, %ecx       # imm = 0x7061636B
je 0x5543a
cmpl $0x52494646, %ecx       # imm = 0x52494646
jne 0x55450
movl $0x1, 0x134(%rdi)
jmp 0x5545a
movq 0x10(%rdi), %rcx
movq 0x30(%rax), %rdx
movq %rdx, (%rcx)
movups 0x40(%rax), %xmm0
movups %xmm0, 0x8(%rcx)
xorl %eax, %eax
retq
movl $0x1, 0x130(%rdi)
movl $0x1, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/hfs.c
// Function: de_module_hfs
void de_module_hfs(deark *c, struct deark_module_info *mi)
{
	mi->id = "hfs";
	mi->desc = "HFS filesystem image";
	mi->run_fn = de_run_hfs;
	mi->identify_fn = de_identify_hfs;
}

// Assembly:
leaq 0xbefdc(%rip), %rax     # 0x114443
movq %rax, (%rsi)
leaq 0xcb6f2(%rip), %rax     # 0x120b63
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x5548c
movq %rax, 0x18(%rsi)
leaq 0x442(%rip), %rax       # 0x558c9
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/hfs.c
// Function: de_identify_hfs
static int de_identify_hfs(deark *c)
{
	i64 drAlBlkSiz;
	int has_ext;

	if(dbuf_memcmp(c->infile, 1024, "BD", 2)) return 0;

	// Allocation block size must be a nonzero multiple of 512.
	drAlBlkSiz = de_getu32be(1024+20);
	if(drAlBlkSiz==0 || (drAlBlkSiz%512)!=0) return 0;

	has_ext = de_input_file_has_ext(c, "hfs");
	return has_ext?90:15;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
leaq 0xcb765(%rip), %rdx     # 0x12103f
movl $0x400, %esi            # imm = 0x400
movl $0x2, %ecx
callq 0xefc85
xorl %ebp, %ebp
testl %eax, %eax
jne 0x5592d
movq 0x18(%rbx), %rdi
movl $0x414, %esi            # imm = 0x414
callq 0xeed0d
testq %rax, %rax
sete %cl
testl $0x1ff, %eax            # imm = 0x1FF
setne %al
orb %cl, %al
jne 0x5592d
leaq 0xbeb2d(%rip), %rsi     # 0x114443
movq %rbx, %rdi
callq 0xea491
testl %eax, %eax
movl $0xf, %eax
movl $0x5a, %ebp
cmovel %eax, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/hfs.c
// Function: read_one_timestamp
static void read_one_timestamp(deark *c, lctx *d, i64 pos, struct de_timestamp *returned_ts,
	const char *name)
{
	i64 ts_raw;
	struct de_timestamp ts;
	char timestamp_buf[64];

	de_zeromem(&ts, sizeof(struct de_timestamp));
	ts.is_valid = 0;
	ts_raw = de_getu32be(pos);
	if(ts_raw!=0) {
		de_mac_time_to_timestamp(ts_raw, &ts);
	}

	if(returned_ts) {
		*returned_ts = ts;
	}

	if(ts.is_valid) {
		de_timestamp_to_string(&ts, timestamp_buf, sizeof(timestamp_buf), 0);
	}
	else {
		de_strlcpy(timestamp_buf, "unknown", sizeof(timestamp_buf));
	}
	de_dbg(c, "%s: %"I64_FMT" (%s)", name, ts_raw, timestamp_buf);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rcx, %rbx
movq %rdx, %r12
movq %rdi, %r14
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq 0x18(%rdi), %rdi
callq 0xeed0d
movq %rax, %r15
testq %rax, %rax
je 0x5596d
movq %rsp, %rsi
movq %r15, %rdi
callq 0xea8ff
testq %r12, %r12
je 0x5597b
movaps (%rsp), %xmm0
movups %xmm0, (%r12)
cmpb $0x0, (%rsp)
je 0x55997
movq %rsp, %rdi
leaq 0x10(%rsp), %rsi
movl $0x40, %edx
xorl %ecx, %ecx
callq 0xeaf46
jmp 0x559ad
leaq 0xbcafe(%rip), %rsi     # 0x11249c
leaq 0x10(%rsp), %rdi
movl $0x40, %edx
callq 0xe8219
leaq 0xc127d(%rip), %rsi     # 0x116c31
leaq 0x10(%rsp), %r8
movq %r14, %rdi
movq %rbx, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0xe8617
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/hfs.c
// Function: read_ExtDataRecs
static void read_ExtDataRecs(deark *c, lctx *d, i64 pos1,
	struct ExtDescriptor *eds, size_t num_eds, const char *name)
{
	size_t i;
	i64 pos = pos1;

	for(i=0; i<num_eds; i++) {
		eds[i].first_alloc_blk = de_getu16be_p(&pos);
		eds[i].num_alloc_blks = de_getu16be_p(&pos);
		de_dbg(c, "%s[%u]: first_blk=%u, num_blks=%u", name, (unsigned int)i,
			(unsigned int)eds[i].first_alloc_blk, (unsigned int)eds[i].num_alloc_blks);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rdi, %r15
movq %rsp, %r12
movq %rsi, (%r12)
leaq 0xcb29c(%rip), %r13     # 0x120c93
xorl %ebp, %ebp
movq 0x18(%r15), %rdi
movq %r12, %rsi
callq 0xeeb91
movq %rax, (%r14)
movq 0x18(%r15), %rdi
movq %r12, %rsi
callq 0xeeb91
movq %rax, 0x8(%r14)
movl (%r14), %r8d
movq %r15, %rdi
movq %r13, %rsi
movq %rbx, %rdx
movl %ebp, %ecx
movl %eax, %r9d
xorl %eax, %eax
callq 0xe8617
incq %rbp
addq $0x10, %r14
cmpq $0x3, %rbp
jne 0x559f9
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/hfs.c
// Function: do_all_leaf_nodes
static int do_all_leaf_nodes(deark *c, lctx *d, struct nodedata *hdr_node, int pass)
{
	i64 curr_nodenum;
	struct nodedata *nd = NULL;
	int retval = 0;

	de_dbg(c, "reading leaf nodes, pass %d", pass);
	de_dbg_indent(c, 1);

	// Read all leaf nodes, using the leaf-to-leaf links
	curr_nodenum = hdr_node->bthFNode;

	while(curr_nodenum!=0) {
		nd = de_malloc(c, sizeof(struct nodedata));
		nd->nodenum = curr_nodenum;

		if(!do_node(c, d, nd, pass)) goto done;

		curr_nodenum = nd->f_link;
		destroy_nodedata(c, nd);
		nd = NULL;
	}
	retval = 1;

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %r14d
movq %rdx, %r13
movq %rsi, %r15
movq %rdi, %rbx
leaq 0xcadf4(%rip), %rsi     # 0x121023
xorl %r12d, %r12d
movl %ecx, %edx
xorl %eax, %eax
callq 0xe8617
movl $0x1, %ebp
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movq 0x38(%r13), %r13
testq %r13, %r13
je 0x5629b
movl $0x50, %esi
movq %rbx, %rdi
callq 0xe8b2b
movq %rax, %r12
movq %r13, 0x8(%rax)
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
movl %r14d, %ecx
callq 0x55a4c
testl %eax, %eax
je 0x56299
movq 0x18(%r12), %r13
movq %rbx, %rdi
movq %r12, %rsi
callq 0x562c4
testq %r13, %r13
jne 0x56256
xorl %r12d, %r12d
jmp 0x5629b
xorl %ebp, %ebp
movq %rbx, %rdi
movq %r12, %rsi
callq 0x562c4
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/hfs.c
// Function: get_full_path_from_dirid
static void get_full_path_from_dirid(deark *c, lctx *d, u32 dirid, de_ucstring *s,
	int depth)
{
	void *item;
	int ret;
	struct dirid_item_struct *dirid_item;

	if(depth>20) goto done;
	if(dirid==0) goto done;
	ret = de_inthashtable_get_item(c, d->dirid_hash, (i64)dirid, &item);
	if(!ret && dirid>1) {
		de_warn(c, "Unknown parent directory (ID %u)", (unsigned int)dirid);
	}
	if(!ret) goto done;
	dirid_item = (struct dirid_item_struct*)item;

	if(dirid_item->ParID!=0 && dirid_item->ParID!=dirid) {
		get_full_path_from_dirid(c, d, dirid_item->ParID, s, depth+1);
	}

	if(!ucstring_isnonempty(dirid_item->name)) goto done;
	ucstring_append_ucstring(s, dirid_item->name);
	ucstring_append_sz(s, "/", DE_ENCODING_LATIN1);
done:
	;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
cmpl $0x15, %r8d
setge %al
testl %edx, %edx
sete %cl
orb %al, %cl
jne 0x56865
movl %r8d, %ebp
movl %edx, %r12d
movq %rsi, %r15
movq %rdi, %r14
movq 0xb0(%rsi), %rsi
movl %edx, %edx
movq %rsp, %rcx
callq 0xeb2f8
testl %eax, %eax
setne %cl
cmpl $0x2, %r12d
setb %dl
orb %cl, %dl
jne 0x5680a
leaq 0xca61b(%rip), %rsi     # 0x120e16
movq %r14, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0xe8faa
jmp 0x56865
testl %eax, %eax
je 0x56865
movq (%rsp), %r13
movl (%r13), %edx
testl %edx, %edx
sete %al
cmpl %r12d, %edx
sete %cl
orb %al, %cl
jne 0x56838
incl %ebp
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rcx
movl %ebp, %r8d
callq 0x567a5
movq 0x8(%r13), %rdi
callq 0xf67a3
testl %eax, %eax
je 0x56865
movq 0x8(%r13), %rsi
movq %rbx, %rdi
callq 0xf6509
leaq 0xbb826(%rip), %rsi     # 0x11207e
movq %rbx, %rdi
movl $0x5, %edx
callq 0xf65e3
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/hfs.c
// Function: read_timestamp_fields
static void read_timestamp_fields(deark *c, lctx *d, i64 pos1,
	de_finfo *fi1)
{
	i64 pos = pos1;

	read_one_timestamp(c, d, pos, &fi1->timestamp[DE_TIMESTAMPIDX_CREATE], "create date");
	pos += 4;
	read_one_timestamp(c, d, pos, &fi1->timestamp[DE_TIMESTAMPIDX_MODIFY], "mod date");
	pos += 4;
	read_one_timestamp(c, d, pos, &fi1->timestamp[DE_TIMESTAMPIDX_BACKUP], "backup date");
	//pos += 4;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x18(%rdx), %r12
addq $0x28, %rdx
leaq 0xca314(%rip), %rcx     # 0x120ba8
callq 0x55936
leaq 0x4(%r14), %rsi
leaq 0xca31a(%rip), %rcx     # 0x120bbe
movq %r15, %rdi
movq %r12, %rdx
callq 0x55936
addq $0x8, %r14
addq $0x58, %rbx
leaq 0xc035b(%rip), %rcx     # 0x116c19
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x55936
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/hfs.c
// Function: do_extract_fork_init
static void do_extract_fork_init(deark *c, lctx *d, struct recorddata *rd,
	struct fork_info *fki)
{
	i64 len_avail;

	len_avail = d->drAlBlkSiz * (fki->ExtRec[0].num_alloc_blks +
		fki->ExtRec[1].num_alloc_blks + fki->ExtRec[2].num_alloc_blks);
	if(fki->logical_eof > len_avail) {
		// TODO: Need to be able to read the Extents Overflow tree.
		de_err(c, "%s: Files with more than 3 fragments are not supported",
			rd->name_srd?ucstring_getpsz(rd->name_srd->str):"");
		fki->extract_error_flag = 1;
		goto done;
	}

done:
	;
}

// Assembly:
movq 0x38(%rcx), %rax
addq 0x28(%rcx), %rax
addq 0x48(%rcx), %rax
imulq %rsi, %rax
cmpq %rax, 0x10(%rcx)
jle 0x56931
pushq %r14
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdi, %r14
movq 0x18(%rdx), %rax
testq %rax, %rax
je 0x5690e
movq 0x18(%rax), %rdi
callq 0xf705c
movq %rax, %rdx
jmp 0x56915
leaq 0xee79b(%rip), %rdx     # 0x1450b0
leaq 0xca5fd(%rip), %rsi     # 0x120f19
movq %r14, %rdi
xorl %eax, %eax
callq 0xe9295
movb $0x1, 0x2(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/hfs.c
// Function: do_extract_fork_run
static void do_extract_fork_run(deark *c, lctx *d, struct recorddata *rd,
	struct fork_info *fki, dbuf *outf)
{
	i64 nbytes_still_to_write;
	size_t k;

	nbytes_still_to_write = fki->logical_eof;

	for(k=0; k<3; k++) {
		i64 fragment_dpos;
		i64 nbytes_to_write_this_time;

		if(nbytes_still_to_write<=0) break;

		fragment_dpos = allocation_blk_dpos(d, fki->ExtRec[k].first_alloc_blk);
		nbytes_to_write_this_time = d->drAlBlkSiz * fki->ExtRec[k].num_alloc_blks;
		if(nbytes_to_write_this_time > nbytes_still_to_write) {
			nbytes_to_write_this_time = nbytes_still_to_write;
		}

		if(fragment_dpos + nbytes_to_write_this_time > c->infile->len) {
			de_err(c, "Member file data goes beyond end of file");
			goto done;
		}

		dbuf_copy(c->infile, fragment_dpos, nbytes_to_write_this_time, outf);

		nbytes_still_to_write -= nbytes_to_write_this_time;
	}

done:
	;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, (%rsp)
movq 0x10(%rdx), %rbp
testq %rbp, %rbp
jle 0x569e9
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
addq $0x28, %r15
xorl %r14d, %r14d
movq 0x20(%r12), %r13
movq 0x30(%r12), %rax
imulq 0x8(%r12), %rax
movq -0x8(%r15), %rsi
imulq %r13, %rsi
imulq (%r15), %r13
addq %rax, %rsi
cmpq %rbp, %r13
cmovgeq %rbp, %r13
leaq (%rsi,%r13), %rax
movq 0x18(%rbx), %rdi
cmpq 0x18(%rdi), %rax
jg 0x569f8
movq %r13, %rdx
movq (%rsp), %rcx
callq 0xef481
cmpq $0x1, %r14
ja 0x569e9
subq %r13, %rbp
incq %r14
addq $0x10, %r15
testq %rbp, %rbp
jg 0x56994
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xca551(%rip), %rsi     # 0x120f50
movq %rbx, %rdi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe9295
nop
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/hlp.c
// Function: de_module_hlp
void de_module_hlp(deark *c, struct deark_module_info *mi)
{
	mi->id = "hlp";
	mi->desc = "HLP";
	mi->run_fn = de_run_hlp;
	mi->identify_fn = de_identify_hlp;
	mi->help_fn = de_help_hlp;
}

// Assembly:
leaq 0xca6a1(%rip), %rax     # 0x1210c0
movq %rax, (%rsi)
leaq 0xca69b(%rip), %rax     # 0x1210c4
movq %rax, 0x8(%rsi)
leaq 0x1b(%rip), %rax        # 0x56a4f
movq %rax, 0x18(%rsi)
leaq 0x2a2(%rip), %rax       # 0x56ce1
movq %rax, 0x20(%rsi)
leaq 0x2bd(%rip), %rax       # 0x56d07
movq %rax, 0x28(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/hlp.c
// Function: do_extract_raw_file
static void do_extract_raw_file(deark *c, lctx *d, i64 pos1, i64 used_space,
	struct de_stringreaderdata *fn)
{
	de_finfo *fi = NULL;
	const char *ext = NULL;

	fi = de_finfo_create(c);
	fi->timestamp[DE_TIMESTAMPIDX_MODIFY] = d->gendate;
	if(fn && ucstring_isnonempty(fn->str)) {
		de_finfo_set_name_from_ucstring(c, fi, fn->str, 0);
		fi->original_filename_flag = 1;
	}
	else {
		ext = "bin";
	}
	dbuf_create_file_from_slice(c->infile, pos1, used_space, ext, fi, 0);

	de_finfo_destroy(c, fi);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbp
movq %rcx, %r14
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbx
callq 0xea504
movq %rax, %r15
movups 0x120(%r13), %xmm0
movups %xmm0, 0x18(%rax)
leaq 0xde8a8(%rip), %r13     # 0x1357bd
testq %rbp, %rbp
je 0x56f40
movq 0x18(%rbp), %rdi
callq 0xf67a3
testl %eax, %eax
je 0x56f40
movq 0x18(%rbp), %rdx
xorl %r13d, %r13d
movq %rbx, %rdi
movq %r15, %rsi
xorl %ecx, %ecx
callq 0xea53f
movb $0x1, 0x8(%r15)
movq 0x18(%rbx), %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %r13, %rcx
movq %r15, %r8
xorl %r9d, %r9d
callq 0xefd48
movq %rbx, %rdi
movq %r15, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xea50e
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/hlp.c
// Function: do_file_PhrImage
static void do_file_PhrImage(deark *c, lctx *d, i64 pos1, i64 len)
{
	de_dbg(c, "PhrImage data at %"I64_FMT", len=%"I64_FMT, pos1, len);
	if(len < d->PhrImageCmprSize) {
		return;
	}

	if(d->PhrImageCmprSize == d->PhrImageUncSize) {
		dbuf_copy(c->infile, pos1, d->PhrImageCmprSize, d->phrases_data);
	}
	else {
		decompress_Phrases(c, d, pos1, d->PhrImageCmprSize, d->PhrImageUncSize);
		de_dbg(c, "decompressed to %"I64_FMT" bytes", d->phrases_data->len);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r12
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
leaq 0xc9304(%rip), %rsi     # 0x1219e1
xorl %eax, %eax
callq 0xe8617
movq 0xe8(%r14), %rcx
cmpq %r12, %rcx
jle 0x586fc
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0xe0(%r14), %r8
cmpq %r8, %rcx
jne 0x5872c
movq 0x18(%rbx), %rdi
movq 0xf0(%r14), %rax
movq %r15, %rsi
movq %rcx, %rdx
movq %rax, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xef481
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x59556
movq 0xf0(%r14), %rax
movq 0x18(%rax), %rdx
leaq 0xbb17a(%rip), %rsi     # 0x1138c6
movq %rbx, %rdi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xe8617
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/hlp.c
// Function: do_file_SHG
static void do_file_SHG(deark *c, lctx *d, i64 pos1, i64 used_space)
{
	i64 oldsig;
	const char *ext;
	dbuf *outf = NULL;
	de_finfo *fi = NULL;

	// Reportedly, 0x506c = SHG = 1 image, and 0x706c = MRB = >1 image.
	// But I'm not convinced that's correct.
	// I'm not sure what to do, as far as selecting a file extension, and potentially
	// correcting the signature. Current behavior is to leave the signature the same,
	// and derive the file extension from the number of images.
	oldsig = de_getu16le(pos1);

	if(oldsig==0x506c || oldsig==0x706c) {
		i64 num_images;

		num_images = de_getu16le(pos1+2);
		if(num_images>1) {
			ext="mrb";
		}
		else {
			ext="shg";
		}
	}
	else {
		ext="bin";
	}

	fi = de_finfo_create(c);
	// (Note that if we were to correct the signature, we probably should not copy
	// the mod time.)
	fi->timestamp[DE_TIMESTAMPIDX_MODIFY] = d->gendate;
	outf = dbuf_create_output_file(c, ext, fi, 0);
	dbuf_copy(c->infile, pos1, used_space, outf);
	dbuf_close(outf);
	de_finfo_destroy(c, fi);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
movq %rdx, %rsi
callq 0xeebc8
andq $-0x2001, %rax          # imm = 0xDFFF
cmpq $0x506c, %rax           # imm = 0x506C
jne 0x58ccb
movq 0x18(%rbx), %rdi
leaq 0x2(%r15), %rsi
callq 0xeebc8
cmpq $0x2, %rax
leaq 0xc8efb(%rip), %rax     # 0x121bb9
leaq 0xc848b(%rip), %r13     # 0x121150
cmovgeq %rax, %r13
jmp 0x58cd2
leaq 0xdcaeb(%rip), %r13     # 0x1357bd
movq %rbx, %rdi
callq 0xea504
movq %rax, %rbp
movups 0x120(%r12), %xmm0
movups %xmm0, 0x18(%rax)
movq %rbx, %rdi
movq %r13, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0xefda1
movq %rax, %r12
movq 0x18(%rbx), %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rax, %rcx
callq 0xef481
movq %r12, %rdi
callq 0xf052b
movq %rbx, %rdi
movq %rbp, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xea50e
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/hlp.c
// Function: format_topiclink
static void format_topiclink(deark *c, lctx *d, u32 n, char *buf, size_t buf_len)
{
	if(d->ver_minor<=16) {
		de_snprintf(buf, buf_len, "%u", (UI)n);
	}
	else {
		if(n==INVALIDPOS) {
			de_strlcpy(buf, "-1", buf_len);
		}
		else {
			de_snprintf(buf, buf_len, "Blk%u:%u", (UI)(n/16384),
				(UI)(n%16384));
		}
	}
}

// Assembly:
movq %rdx, %rax
movl %esi, %r8d
cmpl $0x10, %edi
jg 0x58d54
leaq 0xbc732(%rip), %rdx     # 0x115474
movl $0x18, %esi
movq %rax, %rdi
movl %r8d, %ecx
xorl %eax, %eax
jmp 0xe8193
cmpl $-0x1, %r8d
je 0x58d7d
movl %r8d, %ecx
shrl $0xe, %ecx
andl $0x3fff, %r8d           # imm = 0x3FFF
leaq 0xc87d8(%rip), %rdx     # 0x121546
movl $0x18, %esi
movq %rax, %rdi
xorl %eax, %eax
jmp 0xe8193
leaq 0xbd556(%rip), %rsi     # 0x1162da
movl $0x18, %edx
movq %rax, %rdi
jmp 0xe8219
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/hlp.c
// Function: do_phrase_decompression
static void do_phrase_decompression(deark *c, lctx *d, dbuf *inf, i64 pos1, i64 len,
	dbuf *outf,  i64 unc_len_expected)
{
	i64 pos = pos1;
	i64 endpos = pos1+len;

	if(!d->phrases_data) return;

	while(1) {
		u8 b;

		if(pos >= endpos) break;
		b = dbuf_getbyte_p(inf, &pos);
		if(b==0 || b>=0x10) {
			dbuf_writebyte(outf, b);
		}
		else {
			u8 b2;
			UI n;

			if(pos >= endpos) break;
			b2 = dbuf_getbyte_p(inf, &pos);
			n = ((UI)(b-1)<<8) | b2;
			emit_phrase(c, d, outf, n>>1);
			if(n & 0x1) {
				dbuf_writebyte(outf, ' ');
			}
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, 0x8(%rsp)
movq %rdx, 0x10(%rsp)
testq %rcx, %rcx
jle 0x58e67
movq 0x8(%rsp), %rax
cmpq $0x0, 0xf0(%rax)
je 0x58e67
movq %r8, %r12
movq %rcx, %r14
movq %rsi, %r15
addq %rdx, %r14
leaq 0x10(%rsp), %rbp
movq %r15, %rdi
movq %rbp, %rsi
callq 0xeeb4b
leal -0x10(%rax), %ecx
cmpb $-0xf, %cl
jb 0x58e51
cmpq %r14, 0x10(%rsp)
jge 0x58e67
movzbl %al, %r13d
movq %r15, %rdi
movq %rbp, %rbx
movq %rbp, %rsi
callq 0xeeb4b
movl %eax, %ebp
shll $0x8, %r13d
movzbl %al, %eax
addl %r13d, %eax
addl $0xffffff00, %eax       # imm = 0xFFFFFF00
shrl %eax
movq 0x8(%rsp), %rcx
cmpl %eax, 0xf8(%rcx)
jbe 0x58e46
movq 0x8(%rsp), %rcx
movq 0xf0(%rcx), %rdi
movq 0x100(%rcx), %rcx
movl %eax, %eax
movl (%rcx,%rax,8), %esi
movl 0x4(%rcx,%rax,8), %edx
movq %r12, %rcx
callq 0xef481
movb $0x20, %al
testb $0x1, %bpl
movq %rbx, %rbp
je 0x58e5c
movzbl %al, %esi
movq %r12, %rdi
callq 0xf0bd6
cmpq %r14, 0x10(%rsp)
jl 0x58dd6
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/hlp.c
// Function: do_hall_decompression
static void do_hall_decompression(deark *c, lctx *d, dbuf *inf, i64 pos1, i64 len,
	dbuf *outf, i64 unc_len_expected)
{
	static const u8 action[16] = {0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4};
	i64 pos = pos1;
	i64 endpos = pos1+len;
	UI n;
	i64 outf_expected_endpos;

	outf_expected_endpos = outf->len + unc_len_expected;

	while(1) {
		u8 b;

		if(outf->len >= outf_expected_endpos) goto unc_done;
		if(pos >= endpos) goto unc_done;
		b = dbuf_getbyte_p(inf, &pos);
		switch(action[b&0x0f]) {
		case 0:
			emit_phrase(c, d, outf, b>>1);
			break;
		case 1:
			if(pos >= endpos) goto unc_done;
			n = (((UI)b & 0xfc) << 6) | 0x80;
			n += dbuf_getbyte_p(inf, &pos);
			emit_phrase(c, d, outf, n);
			break;
		case 2:
			n = (b >> 3) +1;
			if(pos + (i64)n > endpos) goto unc_done;
			dbuf_copy(inf, pos, (i64)n, outf);
			pos += (i64)n;
			break;
		case 3:
			dbuf_write_run(outf, ' ', (i64)(b>>4)+1);
			break;
		default: // 4
			dbuf_write_zeroes(outf, (i64)(b>>4)+1);
			break;
		}
	}
unc_done:
	;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r15
movq %rdi, 0x10(%rsp)
movq %rdx, 0x8(%rsp)
testq %r9, %r9
setle %al
testq %rcx, %rcx
setle %cl
orb %al, %cl
jne 0x58fe9
movq %r9, %rbx
movq %r8, %r14
movq %rsi, %r12
addq 0x18(%r8), %rbx
addq %rdx, %r15
leaq 0xc81c8(%rip), %r13     # 0x121084
movq %r12, %rdi
leaq 0x8(%rsp), %rsi
callq 0xeeb4b
movzbl %al, %ebp
movl %ebp, %eax
andl $0xf, %eax
leaq 0xc8d68(%rip), %rcx     # 0x121c40
movzbl (%rax,%rcx), %eax
cmpq $0x3, %rax
ja 0x58fc8
movslq (%r13,%rax,4), %rax
addq %r13, %rax
jmpq *%rax
shrl %ebp
movq 0x10(%rsp), %rax
cmpl %ebp, 0xf8(%rax)
jbe 0x58fd8
movq 0x10(%rsp), %rax
movq 0xf0(%rax), %rdi
movq 0x100(%rax), %rax
movl %ebp, %ecx
movl (%rax,%rcx,8), %esi
movl 0x4(%rax,%rcx,8), %edx
jmp 0x58fbe
shrl $0x3, %ebp
movq 0x8(%rsp), %rsi
leaq (%rsi,%rbp), %rax
incq %rax
cmpq %r15, %rax
jg 0x58fe9
incq %rbp
movq %r12, %rdi
movq %rbp, %rdx
movq %r14, %rcx
callq 0xef481
addq %rbp, 0x8(%rsp)
jmp 0x58fd8
shrl $0x4, %ebp
incl %ebp
movq %r14, %rdi
movl $0x20, %esi
movq %rbp, %rdx
callq 0xf0eba
jmp 0x58fd8
cmpq %r15, 0x8(%rsp)
jge 0x58fe9
shll $0x6, %ebp
andl $0x3f00, %ebp           # imm = 0x3F00
movq %r12, %rdi
leaq 0x8(%rsp), %rsi
callq 0xeeb4b
movzbl %al, %eax
addl %ebp, %eax
addl $0x80, %eax
movq 0x10(%rsp), %rcx
cmpl %eax, 0xf8(%rcx)
jbe 0x58fd8
movq 0x10(%rsp), %rcx
movq 0xf0(%rcx), %rdi
movq 0x100(%rcx), %rcx
movl %eax, %eax
movl (%rcx,%rax,8), %esi
movl 0x4(%rcx,%rax,8), %edx
movq %r14, %rcx
callq 0xef481
jmp 0x58fd8
shrl $0x4, %ebp
incl %ebp
movq %r14, %rdi
movq %rbp, %rsi
callq 0xf0d35
cmpq %rbx, 0x18(%r14)
jge 0x58fe9
cmpq %r15, 0x8(%rsp)
jl 0x58ebc
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/hlp.c
// Function: do_topiclink_rectype_2
static void do_topiclink_rectype_2(deark *c, lctx *d,
	struct topic_ctx *tctx, struct topiclink_data *tld, dbuf *linkdata2)
{
	if(!d->extract_text) goto done;
	ensure_text_output_file_open(c, d);

	do_topiclink_rectype_2_linkdata2(c, d, tctx, tld, linkdata2);
done:
	;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x0, 0x8(%rsi)
je 0x59365
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
callq 0x59371
movq 0xd0(%rbx), %rdi
xorl %esi, %esi
callq 0xf0f27
movq 0xc0(%rbx), %rdi
testq %rdi, %rdi
je 0x592da
leaq 0xc84d3(%rip), %rsi     # 0x1217a8
callq 0xf10ed
cmpq $0x0, 0x18(%r15)
jle 0x5932a
xorl %r12d, %r12d
movq %r15, %rdi
movq %r12, %rsi
callq 0xeead3
testb %al, %al
je 0x5930d
movq 0xd0(%rbx), %rdi
movzbl %al, %esi
callq 0xf0bd6
incq %r12
cmpq 0x18(%r15), %r12
jl 0x592e4
jmp 0x59312
testl %r12d, %r12d
je 0x5932a
movq 0xd0(%rbx), %rdx
movq 0x18(%rdx), %rcx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x59468
jmp 0x59342
movq 0xc0(%rbx), %rdi
testq %rdi, %rdi
je 0x59365
leaq 0xc846e(%rip), %rsi     # 0x1217ab
callq 0xf10ed
movq 0xc0(%rbx), %rdi
testq %rdi, %rdi
je 0x59365
leaq 0xc8467(%rip), %rsi     # 0x1217bc
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xf10ed
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/hlp.c
// Function: ensure_text_output_file_open
static void ensure_text_output_file_open(deark *c, lctx *d)
{
	if(d->outf_text) return;
	d->outf_text = dbuf_create_output_file(c, "dump.txt", NULL, 0);
	if(d->output_is_utf8 && c->write_bom) {
		dbuf_write_uchar_as_utf8(d->outf_text, 0xfeff);
	}
	if(ucstring_isnonempty(d->help_file_title)) {
		dbuf_puts(d->outf_text, "Title: ");
		// TODO: This doesn't do the right thing if !d->output_is_utf8.
		ucstring_write_as_utf8(c, d->help_file_title, d->outf_text, 0);
		dbuf_puts(d->outf_text, "\n");
	}
	if(ucstring_isnonempty(d->help_file_copyright)) {
		dbuf_puts(d->outf_text, "Copyright: ");
		ucstring_write_as_utf8(c, d->help_file_copyright, d->outf_text, 0);
		dbuf_puts(d->outf_text, "\n");
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpq $0x0, 0xc0(%rsi)
je 0x59387
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xc83c8(%rip), %rsi     # 0x12175c
xorl %edx, %edx
xorl %ecx, %ecx
callq 0xefda1
movq %rax, 0xc0(%rbx)
cmpl $0x0, 0x4(%rbx)
je 0x593c1
cmpb $0x0, 0xcc(%r14)
je 0x593c1
movq %rax, %rdi
movl $0xfeff, %esi           # imm = 0xFEFF
callq 0xec1c4
movq 0x110(%rbx), %rdi
callq 0xf67a3
testl %eax, %eax
je 0x5940f
movq 0xc0(%rbx), %rdi
leaq 0xc8386(%rip), %rsi     # 0x121765
callq 0xf10ed
movq 0xc0(%rbx), %rdx
movq 0x110(%rbx), %rsi
movq %r14, %rdi
xorl %ecx, %ecx
callq 0xf6da2
movq 0xc0(%rbx), %rdi
leaq 0xb6d7d(%rip), %rsi     # 0x110187
callq 0xf10ed
movq 0x118(%rbx), %rdi
callq 0xf67a3
testl %eax, %eax
je 0x5937f
movq 0xc0(%rbx), %rdi
leaq 0xc833c(%rip), %rsi     # 0x12176d
callq 0xf10ed
movq 0xc0(%rbx), %rdx
movq 0x118(%rbx), %rsi
movq %r14, %rdi
xorl %ecx, %ecx
callq 0xf6da2
movq 0xc0(%rbx), %rdi
leaq 0xb6d2b(%rip), %rsi     # 0x110187
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xf10ed
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/hlp.c
// Function: emit_slice
static void emit_slice(deark *c, lctx *d, dbuf *inf, i64 pos, i64 len)
{
	if(!d->outf_text) return;

	if(!d->output_is_utf8) {
		dbuf_copy(inf, pos, len, d->outf_text);
		return;
	}

	ucstring_empty(d->tmpucstring1);
	dbuf_read_to_ucstring(inf, pos, len, d->tmpucstring1, 0, d->input_encoding);
	ucstring_write_as_utf8(c, d->tmpucstring1, d->outf_text, 0);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq 0xc0(%rsi), %rcx
testq %rcx, %rcx
je 0x594d7
movq %rdx, %r12
movq %rsi, %r15
cmpl $0x0, 0x4(%rsi)
je 0x594e3
movq %rdi, %r14
movq 0x108(%r15), %rdi
callq 0xf6423
movq 0x108(%r15), %rcx
movl (%r15), %r9d
movq %r12, %rdi
xorl %esi, %esi
movq %rbx, %rdx
xorl %r8d, %r8d
callq 0xefbd7
movq 0xc0(%r15), %rdx
movq 0x108(%r15), %rsi
movq %r14, %rdi
xorl %ecx, %ecx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xf6da2
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %r12, %rdi
xorl %esi, %esi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xef481
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/hlp.c
// Function: dump_phrase_offset_table
static void dump_phrase_offset_table(deark *c, lctx *d)
{
	UI k;

	for(k=0; k<d->num_phrases; k++) {
		de_dbg2(c, "phrase[%u]: offs=%u, len=%u", k, d->phrase_info[k].pos,
			d->phrase_info[k].len);
	}
}

// Assembly:
cmpl $0x0, 0xf8(%rsi)
je 0x59555
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xc8421(%rip), %r15     # 0x12193a
xorl %r12d, %r12d
movq 0x100(%rbx), %rax
movl (%rax,%r12,8), %ecx
movl 0x4(%rax,%r12,8), %r8d
movq %r14, %rdi
movq %r15, %rsi
movl %r12d, %edx
xorl %eax, %eax
callq 0xe87e4
incq %r12
movl 0xf8(%rbx), %eax
cmpq %rax, %r12
jb 0x5951c
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/hlp.c
// Function: decompress_Phrases
static void decompress_Phrases(deark *c, lctx *d, i64 pos, i64 cmpr_len, i64 uncmpr_len)
{
	struct de_dfilter_in_params dcmpri;
	struct de_dfilter_out_params dcmpro;
	struct de_dfilter_results dres;

	de_dfilter_init_objects(c, &dcmpri, &dcmpro, &dres);
	dcmpri.f = c->infile;
	dcmpri.pos = pos;
	dcmpri.len = cmpr_len;
	dcmpro.f = d->phrases_data;
	dcmpro.len_known = 1;
	dcmpro.expected_len = uncmpr_len;
	fmtutil_hlp_lz77_codectype1(c, &dcmpri, &dcmpro, &dres, NULL);
	if(dres.errcode || (d->phrases_data->len!=uncmpr_len)) {
		de_warn(c, "Phrases decompression may have failed");
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %r8, 0x8(%rsp)
movq %rcx, %r12
movq %rdx, %r13
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x28(%rsp), %rbp
leaq 0x10(%rsp), %r14
leaq 0x48(%rsp), %rcx
movq %rbp, %rsi
movq %r14, %rdx
callq 0xfa1dc
movq 0x18(%rbx), %rax
movq %rax, (%rbp)
movq %r13, 0x8(%rbp)
movq %r12, 0x10(%rbp)
movq %r15, %r12
movq 0x8(%rsp), %r15
movq 0xf0(%r12), %rax
movq %rax, (%r14)
movb $0x1, 0x8(%r14)
movq %r15, 0x10(%r14)
movq %rbx, %rdi
movq %rbp, %rsi
movq %r14, %rdx
leaq 0x48(%rsp), %r14
movq %r14, %rcx
xorl %r8d, %r8d
callq 0xfaf12
cmpl $0x0, (%r14)
jne 0x595eb
movq 0xf0(%r12), %rax
cmpq %r15, 0x18(%rax)
je 0x595fc
leaq 0xc8364(%rip), %rsi     # 0x121956
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8faa
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/hlp.c
// Function: do_display_and_store_STRINGZ
static void do_display_and_store_STRINGZ(deark *c, lctx *d, i64 pos1, i64 len,
	const char *name, de_ucstring *s1)
{
	de_ucstring *s_tmp = NULL;
	de_ucstring *s;

	if(s1) {
		s = s1;
	}
	else {
		s_tmp = ucstring_create(c);
		s = s_tmp;
	}

	ucstring_empty(s);
	if(len<1) return;

	dbuf_read_to_ucstring_n(c->infile,
		pos1, len, DE_DBG_MAX_STRLEN,
		s, DE_CONVFLAG_STOP_AT_NUL, d->input_encoding);
	de_dbg(c, "%s: \"%s\"", name, ucstring_getpsz(s));

	if(s_tmp) ucstring_destroy(s_tmp);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, 0x10(%rsp)
movq %rcx, %r12
movq %rdx, %rbp
movq %rsi, %rbx
movq %rdi, %r15
testq %r9, %r9
je 0x5963a
movq %r9, %r13
xorl %r14d, %r14d
jmp 0x59648
movq %r15, %rdi
callq 0xf6410
movq %rax, %r14
movq %rax, %r13
movq %r13, %rdi
callq 0xf6423
testq %r12, %r12
jle 0x596b3
movq 0x18(%r15), %rdi
movl (%rbx), %eax
movl %eax, (%rsp)
movl $0x1f4, %ecx            # imm = 0x1F4
movq %rbp, %rsi
movq %r12, %rdx
movq %r13, %r8
movl $0x1, %r9d
callq 0xefc2a
movq %r13, %rdi
callq 0xf705c
leaq 0xd2aa4(%rip), %rsi     # 0x12c12a
movq %r15, %rdi
movq 0x10(%rsp), %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0xe8617
testq %r14, %r14
je 0x596b3
movq %r14, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xf6753
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/dsstore.c
// Function: de_module_dsstore
void de_module_dsstore(deark *c, struct deark_module_info *mi)
{
	mi->id = "dsstore";
	mi->desc = "Mac Finder .DS_Store format";
	mi->run_fn = de_run_dsstore;
	mi->identify_fn = de_identify_dsstore;
	mi->help_fn = de_help_dsstore;
}

// Assembly:
leaq 0xc8585(%rip), %rax     # 0x121c50
movq %rax, (%rsi)
leaq 0xc8583(%rip), %rax     # 0x121c58
movq %rax, 0x8(%rsi)
leaq 0x1b(%rip), %rax        # 0x596fb
movq %rax, 0x18(%rsi)
leaq 0x41b(%rip), %rax       # 0x59b06
movq %rax, 0x20(%rsi)
leaq 0x436(%rip), %rax       # 0x59b2c
movq %rax, 0x28(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/fli.c
// Function: de_module_fli
void de_module_fli(deark *c, struct deark_module_info *mi)
{
	mi->id = "fli";
	mi->desc = "FLI/FLC animation";
	mi->run_fn = de_run_fli;
	mi->identify_fn = de_identify_fli;
}

// Assembly:
leaq 0xc7ea1(%rip), %rax     # 0x122050
movq %rax, (%rsi)
leaq 0xc7e9b(%rip), %rax     # 0x122054
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x5a1d4
movq %rax, 0x18(%rsi)
leaq 0x5e(%rip), %rax        # 0x5a22d
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/fli.c
// Function: de_run_fli
static void de_run_fli(deark *c, de_module_params *mparams)
{
	lctx *d = NULL;
	i64 bytes_consumed = 0;

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

	(void)do_chunk(c, d, NULL, 0, c->infile->len, 0, &bytes_consumed);

	if(d) {
		de_free(c, d);
	}
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movl $0x50, %esi
callq 0xe8b2b
movq %rax, %r14
movq 0x18(%rbx), %rax
movq 0x18(%rax), %r8
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r9d, %r9d
callq 0x5a2aa
testq %r14, %r14
je 0x5a225
movq %rbx, %rdi
movq %r14, %rsi
addq $0x18, %rsp
popq %rbx
popq %r14
jmp 0xe8be2
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/fli.c
// Function: de_identify_fli
static int de_identify_fli(deark *c)
{
	UI ct;
	int has_ext;

	ct = (UI)de_getu16le(4);
	if((ct>>8) != 0xaf) return 0;
	has_ext = de_input_file_has_ext(c, "fli") ||
		de_input_file_has_ext(c, "flc");
	if(ct==CHUNKTYPE_FLI || ct==CHUNKTYPE_FLC) {
		if(has_ext) return 100;
		return 20;
	}
	if(has_ext) return 9;
	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0x18(%rdi), %rdi
movl $0x4, %esi
callq 0xeebc8
movq %rax, %rbx
movl %ebx, %ecx
andl $0xffffff00, %ecx       # imm = 0xFFFFFF00
xorl %eax, %eax
cmpl $0xaf00, %ecx           # imm = 0xAF00
jne 0x5a2a2
leaq 0xc7df2(%rip), %rsi     # 0x122050
movq %r14, %rdi
callq 0xea491
movb $0x1, %cl
testl %eax, %eax
jne 0x5a280
leaq 0xc8146(%rip), %rsi     # 0x1223b9
movq %r14, %rdi
callq 0xea491
testl %eax, %eax
setne %cl
addl $0xffff50ef, %ebx       # imm = 0xFFFF50EF
cmpl $0x1, %ebx
ja 0x5a29c
testb %cl, %cl
movl $0x64, %ecx
movl $0x14, %eax
cmovnel %ecx, %eax
jmp 0x5a2a2
movzbl %cl, %eax
leal (%rax,%rax,8), %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq