LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/installshld.c
// Function: de_module_is_sfx
void de_module_is_sfx(deark *c, struct deark_module_info *mi)
{
	mi->id = "is_sfx";
	mi->desc = "InstallShield SFX EXE";
	mi->run_fn = de_run_is_sfx;
	mi->flags |= DE_MODFLAG_HIDDEN | DE_MODFLAG_INTERNALONLY;
}

// Assembly:
leaq 0x7aa51(%rip), %rax     # 0x11d8a3
movq %rax, (%rsi)
leaq 0x8f538(%rip), %rax     # 0x132394
movq %rax, 0x8(%rsi)
leaq 0x9(%rip), %rax         # 0xa2e70
movq %rax, 0x18(%rsi)
orb $-0x7f, 0x30(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/os2ea.c
// Function: de_module_ea_data
void de_module_ea_data(deark *c, struct deark_module_info *mi)
{
	mi->id = "ea_data";
	mi->desc = "EA DATA (OS/2 extended attributes)";
	mi->run_fn = de_run_eadata;
	mi->identify_fn = de_identify_eadata;
	mi->help_fn = de_help_eadata;
}

// Assembly:
leaq 0x7f5e2(%rip), %rax     # 0x12279d
movq %rax, (%rsi)
leaq 0x8f58b(%rip), %rax     # 0x132750
movq %rax, 0x8(%rsi)
leaq 0x1b(%rip), %rax        # 0xa31eb
movq %rax, 0x18(%rsi)
leaq 0x2d9(%rip), %rax       # 0xa34b4
movq %rax, 0x20(%rsi)
leaq 0x32e(%rip), %rax       # 0xa3514
movq %rax, 0x28(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/os2ea.c
// Function: de_identify_eadata
static int de_identify_eadata(deark *c)
{
	if(de_getu16be(0)!=0x4544) return 0;
	if(de_input_file_has_ext(c, " sf")) return 100;
	if(dbuf_is_all_zeroes(c->infile, 2, 30)) {
		return 20;
	}
	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
xorl %r14d, %r14d
xorl %esi, %esi
callq 0xef169
cmpq $0x4544, %rax           # imm = 0x4544
jne 0xa3509
leaq 0x8f3e2(%rip), %rsi     # 0x1328ba
movq %rbx, %rdi
callq 0xea936
movl $0x64, %r14d
testl %eax, %eax
jne 0xa3509
movq 0x18(%rbx), %rdi
movl $0x2, %esi
movl $0x1e, %edx
callq 0xf1efb
testl %eax, %eax
movl $0x14, %r14d
cmovel %eax, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/os2ea.c
// Function: eadata_do_raw_list
static void eadata_do_raw_list(deark *c, struct eadata_ctx *d, i64 pos1, i64 len)
{
	i64 pos = pos1;
	i64 endpos;
	de_ucstring *tmps = NULL;
	int saved_indent_level;

	de_dbg_indent_save(c, &saved_indent_level);
	tmps = ucstring_create(c);

	endpos = pos1 + len;

	while(1) {
		int ret;
		i64 bytes_consumed = 0;
		i64 offset_to_next_attr;
		i64 attr_pos;

		if(pos >= endpos) goto done;

		attr_pos = pos;
		de_dbg(c, "attribute at %"I64_FMT, attr_pos);
		de_dbg_indent(c, 1);
		offset_to_next_attr = de_getu32le_p(&pos);
		de_dbg(c, "offset to next attr: %"I64_FMT, offset_to_next_attr);

		ret = eadata_do_attribute(c, d, pos, endpos-pos, tmps, &bytes_consumed);
		if(!ret || bytes_consumed<1) goto done;
		if(offset_to_next_attr==0) goto done;
		pos = attr_pos + offset_to_next_attr;
		de_dbg_indent(c, -1);
	}

done:
	ucstring_destroy(tmps);
	de_dbg_indent_restore(c, saved_indent_level);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r14
movq %rdx, %r13
movq %rsi, %r15
movq %rdi, %rbx
movq %rdx, (%rsp)
leaq 0x14(%rsp), %rsi
callq 0xe958c
movq %rbx, %rdi
callq 0xf6870
movq %rax, %r12
addq %r13, %r14
movq $0x0, 0x8(%rsp)
movq (%rsp), %rbp
cmpq %r14, %rbp
jge 0xa35f9
movq %rbx, %rdi
leaq 0x8f246(%rip), %rsi     # 0x1327be
movq %rbp, %rdx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq 0x18(%rbx), %rdi
movq %rsp, %rsi
callq 0xef3a0
movq %rax, %r13
movq %rbx, %rdi
leaq 0x8f227(%rip), %rsi     # 0x1327cf
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq (%rsp), %rdx
movq %r14, %rcx
subq %rdx, %rcx
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %r8
leaq 0x8(%rsp), %r9
callq 0xa38c3
testq %r13, %r13
je 0xa35f9
testl %eax, %eax
je 0xa35f9
cmpq $0x0, 0x8(%rsp)
jle 0xa35f9
addq %rbp, %r13
movq %r13, (%rsp)
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
jmp 0xa3558
movq %r12, %rdi
callq 0xf6bb0
movl 0x14(%rsp), %esi
movq %rbx, %rdi
callq 0xe9595
addq $0x18, %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/os2bootlogo.c
// Function: de_module_os2bootlogo
void de_module_os2bootlogo(deark *c, struct deark_module_info *mi)
{
	mi->id = "os2bootlogo";
	mi->desc = "OS/2 boot logo";
	mi->run_fn = de_run_os2bootlogo;
	mi->identify_fn = de_identify_os2bootlogo;
}

// Assembly:
leaq 0x8eaaf(%rip), %rax     # 0x1328fa
movq %rax, (%rsi)
leaq 0x8eab1(%rip), %rax     # 0x132906
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0xa3e70
movq %rax, 0x18(%rsi)
leaq 0x631(%rip), %rax       # 0xa449c
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/os2bootlogo.c
// Function: de_identify_os2bootlogo
static int de_identify_os2bootlogo(deark *c)
{
	UI offs;
	UI len;
	UI i;
	UI next_expected_offs = 32;
	i64 pos = 0;

	for(i=0; i<4; i++) {
		offs = (UI)de_getu32le_p(&pos);
		if(offs!=next_expected_offs) return 0;
		len = (UI)de_getu32le_p(&pos);
		if(len<2) return 0;
		next_expected_offs = offs+len;
	}
	if(next_expected_offs!=c->infile->len) return 0;
	return 55;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rsp, %r14
movq $0x0, (%r14)
movl $0x20, %r15d
movl $0x4, %r13d
xorl %ebp, %ebp
movq 0x18(%rbx), %rdi
movq %r14, %rsi
callq 0xef3a0
movq %rax, %r12
cmpl %r12d, %r15d
jne 0xa4508
movq 0x18(%rbx), %rdi
movq %r14, %rsi
callq 0xef3a0
movq %rax, %r15
cmpl $0x2, %r15d
jb 0xa4508
addl %r12d, %r15d
decl %r13d
jne 0xa44c2
movl %r15d, %eax
movq 0x18(%rbx), %rcx
xorl %edx, %edx
cmpq %rax, 0x18(%rcx)
movl $0x37, %ebp
cmovnel %edx, %ebp
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_O1/jsummers[P]deark/modules/psd.c
// Function: de_module_psd
void de_module_psd(deark *c, struct deark_module_info *mi)
{
	mi->id = "psd";
	mi->desc = "Photoshop PSD";
	mi->run_fn = de_run_psd;
	mi->identify_fn = de_identify_psd;
}

// Assembly:
leaq 0x8e4e9(%rip), %rax     # 0x132a20
movq %rax, (%rsi)
leaq 0x8e4e3(%rip), %rax     # 0x132a24
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0xa455c
movq %rax, 0x18(%rsi)
leaq 0xa5e(%rip), %rax       # 0xa4fb5
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/psd.c
// Function: de_identify_psd
static int de_identify_psd(deark *c)
{
	u8 buf[4];

	de_read(buf, 0, 4);
	if(!de_memcmp(buf, "8BPS", 4)) return 100;
	if(!de_memcmp(buf, "8BIM", 4)) {
		// We sometimes write .8bim files, so we want to identify them.
		// This is not necessarily a standard file format.
		if(de_input_file_has_ext(c, "8bim")) return 100;
		return 75;
	}
	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 $0x53504238, (%r15)     # imm = 0x53504238
je 0xa500e
cmpl $0x4d494238, 0xc(%rsp)  # imm = 0x4D494238
jne 0xa5013
leaq 0x8db4c(%rip), %rsi     # 0x132b41
movq %r14, %rdi
callq 0xea936
testl %eax, %eax
movl $0x4b, %eax
movl $0x64, %ebx
cmovel %eax, %ebx
jmp 0xa5013
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/psd.c
// Function: de_module_ps_action
void de_module_ps_action(deark *c, struct deark_module_info *mi)
{
	mi->id = "ps_action";
	mi->desc = "Photoshop Action";
	mi->run_fn = de_run_ps_action;
	mi->identify_fn = de_identify_ps_action;
}

// Assembly:
leaq 0x8da0c(%rip), %rax     # 0x132a32
movq %rax, (%rsi)
leaq 0x8da0c(%rip), %rax     # 0x132a3c
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0xa504b
movq %rax, 0x18(%rsi)
leaq 0x654(%rip), %rax       # 0xa569a
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/psd.c
// Function: de_identify_ps_action
static int de_identify_ps_action(deark *c)
{
	int ver=0;

	if(!dbuf_memcmp(c->infile, 0, "\x00\x00\x00\x10\x00\x00", 6)) {
		ver = 16;
	}
	else if(!dbuf_memcmp(c->infile, 0, "\x00\x00\x00\x0c", 4)) {
		ver = 12;
	}
	if(ver==0) return 0;
	if(!de_input_file_has_ext(c, "atn")) return 0;
	if(ver==16) return 100;
	return 5; // A version we don't support
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0x18(%rdi), %rdi
leaq 0x8f38b(%rip), %rdx     # 0x134a37
xorl %ebx, %ebx
movl $0x6, %ecx
xorl %esi, %esi
callq 0xf025e
testl %eax, %eax
je 0xa56e0
movq 0x18(%r14), %rdi
leaq 0x8f375(%rip), %rdx     # 0x134a3e
movl $0x4, %ecx
xorl %esi, %esi
callq 0xf025e
testl %eax, %eax
jne 0xa56f9
movl $0x5, %ebx
jmp 0xa56e5
movl $0x64, %ebx
leaq 0x8f031(%rip), %rsi     # 0x13471d
movq %r14, %rdi
callq 0xea936
testl %eax, %eax
cmovel %eax, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/psd.c
// Function: de_module_ps_gradient
void de_module_ps_gradient(deark *c, struct deark_module_info *mi)
{
	mi->id = "ps_gradient";
	mi->desc = "Photoshop Gradient";
	mi->run_fn = de_run_ps_gradient;
	mi->identify_fn = de_identify_ps_gradient;
}

// Assembly:
leaq 0x8d343(%rip), %rax     # 0x132a4d
movq %rax, (%rsi)
leaq 0x8d345(%rip), %rax     # 0x132a59
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0xa572f
movq %rax, 0x18(%rsi)
leaq 0xe7(%rip), %rax        # 0xa5811
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/psd.c
// Function: de_run_ps_gradient
static void de_run_ps_gradient(deark *c, de_module_params *mparams)
{
	lctx *d = NULL;
	zztype *zz = NULL;
	i64 grd_ver;

	de_declare_fmt(c, "Photoshop Gradient");

	d = de_malloc(c, sizeof(lctx));
	d->version = 1;
	init_version_specific_info(c, d);

	zz = de_malloc(c, sizeof(zztype));
	zz_init_absolute(zz, 0, c->infile->len);

	zz->pos += 4; // 8BGR signature
	grd_ver = psd_getu16zz(zz);
	de_dbg(c, "file version: %d", (int)grd_ver);

	if(grd_ver==5) {
		read_descriptor(c, d, zz, 1, "");
	}
	else {
		de_err(c, "Unsupported Photoshop Gradient file version: %d", (int)grd_ver);
	}

	de_free(c, zz);
	de_free(c, d);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x8d318(%rip), %rsi     # 0x132a59
callq 0xeb6d6
movl $0x58, %esi
movq %rbx, %rdi
callq 0xe969b
movq %rax, %r14
movl $0x1, (%rax)
movq %rbx, %rdi
movq %rax, %rsi
callq 0xa64c0
movl $0x18, %esi
movq %rbx, %rdi
callq 0xe969b
movq %rax, %r15
movq 0x18(%rbx), %rdi
movq 0x18(%rdi), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%r15)
movq %rax, 0x10(%r15)
movq $0x4, (%r15)
movl 0x4(%r14), %edx
movl $0x4, %esi
callq 0xef570
movq %rax, %r12
addq $0x2, (%r15)
leaq 0x8efca(%rip), %rsi     # 0x134777
movq %rbx, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0xe9226
cmpq $0x5, %r12
jne 0xa57dc
leaq 0x9f409(%rip), %r8      # 0x144bd0
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
movl $0x1, %ecx
callq 0xa8173
jmp 0xa57f0
leaq 0x8ef3e(%rip), %rsi     # 0x134721
movq %rbx, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0xe9df7
movq %rbx, %rdi
movq %r15, %rsi
callq 0xe9752
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xe9752
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/psd.c
// Function: de_module_ps_styles
void de_module_ps_styles(deark *c, struct deark_module_info *mi)
{
	mi->id = "ps_styles";
	mi->desc = "Photoshop Styles";
	mi->run_fn = de_run_ps_styles;
	mi->identify_fn = de_identify_ps_styles;
}

// Assembly:
leaq 0x8d204(%rip), %rax     # 0x132a6c
movq %rax, (%rsi)
leaq 0x8d204(%rip), %rax     # 0x132a76
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0xa588d
movq %rax, 0x18(%rsi)
leaq 0x35c(%rip), %rax       # 0xa5be4
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/psd.c
// Function: de_module_ps_brush
void de_module_ps_brush(deark *c, struct deark_module_info *mi)
{
	mi->id = "ps_brush";
	mi->desc = "Photoshop Brush";
	mi->run_fn = de_run_ps_brush;
	mi->identify_fn = de_identify_ps_brush;
}

// Assembly:
leaq 0x8ce56(%rip), %rax     # 0x132a87
movq %rax, (%rsi)
leaq 0x8ce55(%rip), %rax     # 0x132a90
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0xa5c56
movq %rax, 0x18(%rsi)
leaq 0x24f(%rip), %rax       # 0xa5ea0
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/psd.c
// Function: de_module_ps_csh
void de_module_ps_csh(deark *c, struct deark_module_info *mi)
{
	mi->id = "ps_csh";
	mi->desc = "Photoshop Custom Shape";
	mi->run_fn = de_run_ps_csh;
	mi->identify_fn = de_identify_ps_csh;
}

// Assembly:
leaq 0x8cbbb(%rip), %rax     # 0x132aa0
movq %rax, (%rsi)
leaq 0x8cbb8(%rip), %rax     # 0x132aa7
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0xa5f0a
movq %rax, 0x18(%rsi)
leaq 0x340(%rip), %rax       # 0xa6245
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/psd.c
// Function: de_module_ps_pattern
void de_module_ps_pattern(deark *c, struct deark_module_info *mi)
{
	mi->id = "ps_pattern";
	mi->desc = "Photoshop Pattern";
	mi->run_fn = de_run_ps_pattern;
	mi->identify_fn = de_identify_ps_pattern;
}

// Assembly:
leaq 0x8c822(%rip), %rax     # 0x132abe
movq %rax, (%rsi)
leaq 0x8c823(%rip), %rax     # 0x132ac9
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0xa62c1
movq %rax, 0x18(%rsi)
leaq 0x1b4(%rip), %rax       # 0xa6470
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/psd.c
// Function: de_run_ps_pattern
static void de_run_ps_pattern(deark *c, de_module_params *mparams)
{
	lctx *d = NULL;
	zztype *zz = NULL;
	i64 pat_ver;
	i64 num_patterns;
	i64 i;
	zztype czz;

	d = de_malloc(c, sizeof(lctx));
	d->version = 1;
	init_version_specific_info(c, d);

	zz = de_malloc(c, sizeof(zztype));
	zz_init_absolute(zz, 0, c->infile->len);

	zz->pos += 4; // Skip over '8BPT' signature

	pat_ver = psd_getu16zz(zz);
	de_dbg(c, "file version: %d", (int)pat_ver);

	if(pat_ver!=1) {
		de_warn(c, "PAT v%d format might not be supported correctly", (int)pat_ver);
	}

	num_patterns = psd_getu32zz(zz);
	de_dbg(c, "number of patterns: %d", (int)num_patterns);

	for(i=0; i<num_patterns; i++) {
		if(zz_avail(zz)<4) break;
		de_dbg(c, "pattern[%d] at %d", (int)i, (int)zz->pos);
		zz_init(&czz, zz);
		de_dbg_indent(c, 1);
		if(!do_pattern_internal(c, d, &czz)) break;
		de_dbg_indent(c, -1);
		zz->pos += zz_used(&czz);
	}

	de_free(c, zz);
	de_free(c, d);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movl $0x58, %esi
callq 0xe969b
movq %rax, %r14
movl $0x1, (%rax)
movq %rbx, %rdi
movq %rax, %rsi
callq 0xa64c0
movl $0x18, %esi
movq %rbx, %rdi
callq 0xe969b
movq %rax, %r15
movq 0x18(%rbx), %rdi
movq 0x18(%rdi), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%r15)
movq %rax, 0x10(%r15)
movq $0x4, (%r15)
movl 0x4(%r14), %edx
movl $0x4, %esi
callq 0xef570
movq %rax, %r12
addq $0x2, (%r15)
leaq 0x8e441(%rip), %rsi     # 0x134777
movq %rbx, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0xe9226
cmpq $0x1, %r12
je 0xa635d
leaq 0x8e679(%rip), %rsi     # 0x1349c9
movq %rbx, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0xe9b27
movq 0x18(%rbx), %rdi
movl 0x4(%r14), %edx
movq (%r15), %rsi
callq 0xef614
movq %rax, %r12
addq $0x4, (%r15)
leaq 0x8e67e(%rip), %rsi     # 0x1349f9
movq %rbx, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0xe9226
testq %r12, %r12
jle 0xa644c
movq %rsp, %rbp
xorl %r13d, %r13d
movq (%r15), %rcx
movq 0x10(%r15), %rdx
movq %rdx, %rax
subq %rcx, %rax
jle 0xa63b7
movq 0x8(%r15), %rsi
cmpq %rsi, %rcx
jge 0xa63b9
subq %rsi, %rdx
movq %rdx, %rax
jmp 0xa63b9
xorl %eax, %eax
cmpq $0x4, %rax
jl 0xa644c
movq %rbx, %rdi
leaq 0x8dbc6(%rip), %rsi     # 0x133f93
movl %r13d, %edx
xorl %eax, %eax
callq 0xe9226
movq (%r15), %rax
movq 0x10(%r15), %rcx
movq %rax, 0x8(%rsp)
movq %rax, (%rsp)
movq %rcx, 0x10(%rsp)
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq %rbx, %rdi
movq %r14, %rsi
movq %rbp, %rdx
callq 0xabd7d
testl %eax, %eax
je 0xa644c
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
movq 0x8(%rsp), %rcx
movq 0x10(%rsp), %rsi
movq %rsi, %rax
subq %rcx, %rax
jle 0xa643b
movq (%rsp), %rdx
cmpq %rsi, %rdx
jg 0xa643d
subq %rcx, %rdx
movq %rdx, %rax
jmp 0xa643d
xorl %eax, %eax
addq %rax, (%r15)
incq %r13
cmpq %r13, %r12
jne 0xa6397
movq %rbx, %rdi
movq %r15, %rsi
callq 0xe9752
movq %rbx, %rdi
movq %r14, %rsi
addq $0x18, %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/psd.c
// Function: do_external_tagged_blocks
static void do_external_tagged_blocks(deark *c, lctx *d, zztype *zz)
{
	u32 code;

	d->tagged_blocks_only = 1;
	if(zz_avail(zz)<4) return;

	// Evidently, it is possible for this to use little-endian byte order. Weird.

	// Peek at the first 4 bytes
	code = (u32)de_getu32le(0);
	if(code==CODE_8BIM || code==CODE_8B64) {
		d->is_le = 1;
	}

	do_tagged_blocks(c, d, zz, 0);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movl $0x1, 0xc(%rsi)
movq (%rdx), %rdx
movq 0x10(%rbx), %rcx
movq %rcx, %rax
subq %rdx, %rax
jle 0xa692a
movq 0x8(%rbx), %rsi
cmpq %rsi, %rdx
jge 0xa692c
subq %rsi, %rcx
movq %rcx, %rax
jmp 0xa692c
xorl %eax, %eax
cmpq $0x4, %rax
jge 0xa6938
popq %rbx
popq %r14
popq %r15
retq
movq 0x18(%r15), %rdi
xorl %esi, %esi
callq 0xef37e
cmpl $0x3842494d, %eax       # imm = 0x3842494D
je 0xa6951
cmpl $0x38423634, %eax       # imm = 0x38423634
jne 0xa6959
movl $0x1, 0x4(%r14)
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
xorl %ecx, %ecx
popq %rbx
popq %r14
popq %r15
jmp 0xa9600
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/psd.c
// Function: read_pascal_string_to_ucstring
static void read_pascal_string_to_ucstring(deark *c, lctx *d, de_ucstring *s, zztype *zz)
{
	i64 dlen;

	if(zz_avail(zz)<1) return;

	// First byte is the string length
	dlen = (i64)psd_getbytezz(zz);

	if(zz->pos + dlen > zz->endpos) { // error
		zz->pos = zz->endpos;
		return;
	}

	dbuf_read_to_ucstring(c->infile, zz->pos, dlen, s, 0, d->input_encoding);
	zz->pos += dlen;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movq (%rcx), %rsi
movq 0x10(%rcx), %rcx
movq %rcx, %rax
subq %rsi, %rax
jle 0xa69a3
movq 0x8(%rbx), %rdx
cmpq %rdx, %rsi
jge 0xa69a5
subq %rdx, %rcx
movq %rcx, %rax
jmp 0xa69a5
xorl %eax, %eax
testq %rax, %rax
jle 0xa69f2
movq 0x18(%r12), %rdi
callq 0xef0d5
movq (%rbx), %rdx
movq 0x10(%rbx), %rcx
leaq 0x1(%rdx), %rsi
movq %rsi, (%rbx)
movzbl %al, %r13d
leaq (%rdx,%r13), %rax
incq %rax
cmpq %rcx, %rax
jg 0xa69ef
movq 0x18(%r12), %rdi
movl 0x8(%r15), %r9d
movq %r13, %rdx
movq %r14, %rcx
xorl %r8d, %r8d
callq 0xf01b0
addq (%rbx), %r13
movq %r13, %rcx
movq %rcx, (%rbx)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/psd.c
// Function: hrsrc_resolutioninfo
static void hrsrc_resolutioninfo(deark *c, lctx *d, zztype *zz, const struct rsrc_info *ri)
{
	i64 xres_int, yres_int;
	double xres, yres;
	i64 xres_unit, yres_unit;

	if(zz_avail(zz)!=16) return;
	xres_int = psd_getu32(zz->pos);
	xres = ((double)xres_int)/65536.0;
	de_dbg(c, "xres=%.2f dpi", xres);
	xres_unit = psd_getu16(zz->pos+4);
	de_dbg(c, "xres display unit: %d (%s)", (int)xres_unit, units_name(xres_unit));
	//width_unit = psd_getu16(pos+6);

	yres_int = psd_getu32(zz->pos+8);
	yres = ((double)yres_int)/65536.0;
	de_dbg(c, "yres=%.2f dpi", yres);
	yres_unit = psd_getu16(zz->pos+12);
	de_dbg(c, "yres display unit: %d (%s)", (int)yres_unit, units_name(yres_unit));
	//height_unit = psd_getu16(pos+14);

	d->density.code = DE_DENSITY_DPI;
	d->density.xdens = xres;
	d->density.ydens = yres;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdx), %rsi
movq 0x10(%rdx), %rcx
movq %rcx, %rax
subq %rsi, %rax
jle 0xa6e94
movq 0x8(%r15), %rdx
cmpq %rdx, %rsi
jge 0xa6e96
subq %rdx, %rcx
movq %rcx, %rax
jmp 0xa6e96
xorl %eax, %eax
cmpq $0x10, %rax
jne 0xa6fae
movq 0x18(%r14), %rdi
movl 0x4(%rbx), %edx
callq 0xef614
cvtsi2sd %rax, %xmm0
mulsd 0x7f69f(%rip), %xmm0    # 0x126558
movsd %xmm0, 0x10(%rsp)
leaq 0x8c462(%rip), %rsi     # 0x133328
movq %r14, %rdi
movb $0x1, %al
callq 0xe9226
movq 0x18(%r14), %rdi
movq (%r15), %rsi
addq $0x4, %rsi
movl 0x4(%rbx), %edx
callq 0xef570
cmpq $0x2, %rax
leaq 0x8c498(%rip), %r13     # 0x133386
leaq 0x84f74(%rip), %r12     # 0x12be69
movq %r12, %rcx
cmoveq %r13, %rcx
cmpq $0x1, %rax
leaq 0x8c473(%rip), %rbp     # 0x13337a
cmoveq %rbp, %rcx
leaq 0x8c424(%rip), %rsi     # 0x133336
movq %r14, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movq 0x18(%r14), %rdi
movq (%r15), %rsi
addq $0x8, %rsi
movl 0x4(%rbx), %edx
callq 0xef614
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
mulsd 0x7f617(%rip), %xmm0    # 0x126558
movsd %xmm0, 0x8(%rsp)
leaq 0x8c403(%rip), %rsi     # 0x133351
movq %r14, %rdi
movb $0x1, %al
callq 0xe9226
movq 0x18(%r14), %rdi
movq (%r15), %rsi
addq $0xc, %rsi
movl 0x4(%rbx), %edx
callq 0xef570
cmpq $0x2, %rax
cmoveq %r13, %r12
cmpq $0x1, %rax
cmoveq %rbp, %r12
leaq 0x8c3dd(%rip), %rsi     # 0x13335f
movq %r14, %rdi
movl %eax, %edx
movq %r12, %rcx
xorl %eax, %eax
callq 0xe9226
movl $0x2, 0x38(%rbx)
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x40(%rbx)
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x48(%rbx)
addq $0x18, %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/psd.c
// Function: hrsrc_namesofalphachannels
static void hrsrc_namesofalphachannels(deark *c, lctx *d, zztype *zz, const struct rsrc_info *ri)
{
	de_ucstring *s = NULL;
	int idx = 0;

	// This is a "series of Pascal strings", whatever that is.

	s = ucstring_create(c);
	while(zz->pos < (zz->endpos-1)) {
		ucstring_empty(s);
		read_pascal_string_to_ucstring(c, d, s, zz);
		de_dbg(c, "%s[%d]: \"%s\"", ri->idname, idx, ucstring_getpsz_d(s));
		idx++;
	}
	ucstring_destroy(s);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
callq 0xf6870
movq %rax, %r13
movq 0x10(%r14), %rax
decq %rax
cmpq %rax, (%r14)
jge 0xa703e
xorl %ebp, %ebp
movq %r15, (%rsp)
movq %r13, %rdi
callq 0xf6883
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
movq %r14, %rcx
callq 0xa696e
movq 0x8(%rbx), %r15
movq %r13, %rdi
callq 0xf7557
movq %r12, %rdi
leaq 0x8c373(%rip), %rsi     # 0x133390
movq %r15, %rdx
movq (%rsp), %r15
movl %ebp, %ecx
movq %rax, %r8
xorl %eax, %eax
callq 0xe9226
incl %ebp
movq 0x10(%r14), %rax
decq %rax
cmpq %rax, (%r14)
jl 0xa6fee
movq %r13, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xf6bb0
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/psd.c
// Function: hrsrc_printflags
static void hrsrc_printflags(deark *c, lctx *d, zztype *zz, const struct rsrc_info *ri)
{
	u8 fl[9];
	if(zz_avail(zz)!=9) return;
	de_read(fl, zz->pos, 9);
	de_dbg(c, "%s: labels=%d, crop marks=%d, color bars=%d, registration marks=%d, "
		"negative=%d, flip=%d, interpolate=%d, caption=%d, print flags=%d",
		ri->idname, (int)fl[0], (int)fl[1], (int)fl[2], (int)fl[3],
		(int)fl[4], (int)fl[5], (int)fl[6], (int)fl[7], (int)fl[8]);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rcx, %r14
movq %rdx, %rax
movq %rdi, %rbx
movq (%rdx), %rdx
movq 0x10(%rax), %rsi
movq %rsi, %rcx
subq %rdx, %rcx
jle 0xa708a
movq 0x8(%rax), %rax
cmpq %rax, %rdx
jge 0xa708c
subq %rax, %rsi
movq %rsi, %rcx
jmp 0xa708c
xorl %ecx, %ecx
cmpq $0x9, %rcx
jne 0xa70f9
movq 0x18(%rbx), %rdi
leaq 0x7(%rsp), %r15
movl $0x9, %ecx
movq %r15, %rsi
callq 0xeeee8
movq 0x8(%r14), %rdx
movzbl (%r15), %ecx
movzbl 0x1(%r15), %r8d
movzbl 0x2(%r15), %r9d
movzbl 0x3(%r15), %r10d
movzbl 0x4(%r15), %r11d
movzbl 0x5(%r15), %r14d
movzbl 0x6(%r15), %r12d
movzbl 0x7(%r15), %r13d
movzbl 0x8(%r15), %r15d
leaq 0x8c2be(%rip), %rsi     # 0x13339d
movq %rbx, %rdi
xorl %eax, %eax
pushq %r15
pushq %r13
pushq %r12
pushq %r14
pushq %r11
pushq %r10
callq 0xe9226
addq $0x30, %rsp
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/psd.c
// Function: hrsrc_uint16
static void hrsrc_uint16(deark *c, lctx *d, zztype *zz, const struct rsrc_info *ri)
{
	i64 n;
	if(zz_avail(zz)!=2) return;
	n = psd_getu16zz(zz);
	de_dbg(c, "%s: %d", ri->idname, (int)n);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %rax
movq %rdi, %rbx
movq (%rdx), %rsi
movq 0x10(%rdx), %rdx
movq %rdx, %rcx
subq %rsi, %rcx
jle 0xa7138
movq 0x8(%r15), %rdi
cmpq %rdi, %rsi
jge 0xa713a
subq %rdi, %rdx
movq %rdx, %rcx
jmp 0xa713a
xorl %ecx, %ecx
cmpq $0x2, %rcx
jne 0xa716c
movq 0x18(%rbx), %rdi
movl 0x4(%rax), %edx
callq 0xef570
addq $0x2, (%r15)
movq 0x8(%r14), %rdx
leaq 0x97b88(%rip), %rsi     # 0x13ece3
movq %rbx, %rdi
movl %eax, %ecx
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0xe9226
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/psd.c
// Function: hrsrc_byte
static void hrsrc_byte(deark *c, lctx *d, zztype *zz, const struct rsrc_info *ri)
{
	u8 b;
	if(zz_avail(zz)!=1) return;
	b = psd_getbytezz(zz);
	de_dbg(c, "%s: %d", ri->idname, (int)b);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rcx, %r14
movq %rdx, %r15
movq %rdi, %rbx
movq (%rdx), %rsi
movq 0x10(%rdx), %rcx
movq %rcx, %rax
subq %rsi, %rax
jle 0xa7356
movq 0x8(%r15), %rdx
cmpq %rdx, %rsi
jge 0xa7358
subq %rdx, %rcx
movq %rcx, %rax
jmp 0xa7358
xorl %eax, %eax
cmpq $0x1, %rax
jne 0xa7387
movq 0x18(%rbx), %rdi
callq 0xef0d5
incq (%r15)
movq 0x8(%r14), %rdx
movzbl %al, %ecx
leaq 0x9796b(%rip), %rsi     # 0x13ece3
movq %rbx, %rdi
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0xe9226
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/psd.c
// Function: hrsrc_plaintext
static void hrsrc_plaintext(deark *c, lctx *d, zztype *zz, const struct rsrc_info *ri)
{
	de_ucstring *s = NULL;

	s = ucstring_create(c);
	dbuf_read_to_ucstring_n(c->infile, zz->pos, zz_avail(zz), DE_DBG_MAX_STRLEN,
		s, 0, d->input_encoding);
	de_dbg(c, "%s: \"%s\"", ri->idname, ucstring_getpsz(s));
	ucstring_destroy(s);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rcx, %r15
movq %rdx, %r13
movq %rsi, %r12
movq %rdi, %r14
callq 0xf6870
movq %rax, %rbx
movq 0x18(%r14), %rdi
movq (%r13), %rsi
movq 0x10(%r13), %rax
movq %rax, %rdx
subq %rsi, %rdx
jle 0xa73d3
movq 0x8(%r13), %rcx
cmpq %rcx, %rsi
jge 0xa73d5
subq %rcx, %rax
movq %rax, %rdx
jmp 0xa73d5
xorl %edx, %edx
movl 0x8(%r12), %eax
movl %eax, (%rsp)
movl $0x1f4, %ecx            # imm = 0x1F4
movq %rbx, %r8
xorl %r9d, %r9d
callq 0xf0203
movq 0x8(%r15), %r15
movq %rbx, %rdi
callq 0xf74bd
leaq 0x84a42(%rip), %rsi     # 0x12be42
movq %r14, %rdi
movq %r15, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xf6bb0
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/psd.c
// Function: hrsrc_uint32
static void hrsrc_uint32(deark *c, lctx *d, zztype *zz, const struct rsrc_info *ri)
{
	i64 n;
	if(zz_avail(zz)!=4) return;
	n = psd_getu32zz(zz);
	de_dbg(c, "%s: %d", ri->idname, (int)n);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %rax
movq %rdi, %rbx
movq (%rdx), %rsi
movq 0x10(%rdx), %rdx
movq %rdx, %rcx
subq %rsi, %rcx
jle 0xa7456
movq 0x8(%r15), %rdi
cmpq %rdi, %rsi
jge 0xa7458
subq %rdi, %rdx
movq %rdx, %rcx
jmp 0xa7458
xorl %ecx, %ecx
cmpq $0x4, %rcx
jne 0xa748a
movq 0x18(%rbx), %rdi
movl 0x4(%rax), %edx
callq 0xef614
addq $0x4, (%r15)
movq 0x8(%r14), %rdx
leaq 0x9786a(%rip), %rsi     # 0x13ece3
movq %rbx, %rdi
movl %eax, %ecx
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0xe9226
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/psd.c
// Function: hrsrc_unicodestring_multi
static void hrsrc_unicodestring_multi(deark *c, lctx *d, zztype *zz,
	const struct rsrc_info *ri)
{
	de_ucstring *s = NULL;
	int idx = 0;

	s = ucstring_create(c);
	while(zz_avail(zz)>=4) {
		ucstring_empty(s);
		read_unicode_string(c, d, s, zz);
		de_dbg(c, "%s[%d]: \"%s\"", ri->idname, idx, ucstring_getpsz_d(s));
		idx++;
	}
	ucstring_destroy(s);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, (%rsp)
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
callq 0xf6870
movq %rax, %r13
xorl %ebp, %ebp
movq (%r14), %rdx
movq 0x10(%r14), %rcx
movq %rcx, %rax
subq %rdx, %rax
jle 0xa7510
movq 0x8(%r14), %rsi
cmpq %rsi, %rdx
jge 0xa7512
subq %rsi, %rcx
movq %rcx, %rax
jmp 0xa7512
xorl %eax, %eax
cmpq $0x4, %rax
jl 0xa755e
movq %r13, %rdi
callq 0xf6883
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
movq %r14, %rcx
callq 0xa803f
movq (%rsp), %rax
movq 0x8(%rax), %rbx
movq %r13, %rdi
callq 0xf7557
movq %r12, %rdi
leaq 0x8be45(%rip), %rsi     # 0x133390
movq %rbx, %rdx
movl %ebp, %ecx
movq %rax, %r8
xorl %eax, %eax
callq 0xe9226
incl %ebp
jmp 0xa74f0
movq %r13, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xf6bb0
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/psd.c
// Function: hrsrc_unicodestring
static void hrsrc_unicodestring(deark *c, lctx *d, zztype *zz, const struct rsrc_info *ri)
{
	de_ucstring *s = NULL;

	s = ucstring_create(c);
	read_unicode_string(c, d, s, zz);
	de_dbg(c, "%s: \"%s\"", ri->idname, ucstring_getpsz_d(s));
	ucstring_destroy(s);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
callq 0xf6870
movq %rax, %r13
movq %r12, %rdi
movq %r15, %rsi
movq %rax, %rdx
movq %r14, %rcx
callq 0xa803f
movq 0x8(%rbx), %rbx
movq %r13, %rdi
callq 0xf7557
leaq 0x84426(%rip), %rsi     # 0x12be42
movq %r12, %rdi
movq %rbx, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0xe9226
movq %r13, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xf6bb0
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/psd.c
// Function: hrsrc_urllist
static void hrsrc_urllist(deark *c, lctx *d, zztype *zz, const struct rsrc_info *ri)
{
	de_ucstring *s = NULL;
	i64 count;
	i64 i;

	count = psd_getu32zz(zz);
	de_dbg(c, "URL count: %d", (int)count);

	s = ucstring_create(c);

	for(i=0; i<count; i++) {
		struct de_fourcc url4cc;
		i64 id;

		// undocumented field, seems to be a fourcc
		psd_read_fourcc_zz(c, d, zz, &url4cc);

		id = psd_getu32zz(zz);

		read_unicode_string(c, d, s, zz);
		de_dbg(c, "URL[%d]: '%s', id=%d, value=\"%s\"", (int)i,
			url4cc.id_dbgstr, (int)id, ucstring_getpsz(s));
		ucstring_empty(s);
	}

	ucstring_destroy(s);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x18(%rdi), %rdi
movl 0x4(%rsi), %edx
movq (%rbx), %rsi
callq 0xef614
movq %rax, %r12
addq $0x4, (%rbx)
leaq 0x8bdfe(%rip), %rsi     # 0x13386f
movq %r15, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0xe9226
movq %r15, %rdi
callq 0xf6870
movq %rax, %r13
testq %r12, %r12
jle 0xa7b27
xorl %ebp, %ebp
movq %r12, (%rsp)
movq 0x18(%r15), %rdi
movq (%rbx), %rsi
xorl %r8d, %r8d
cmpl $0x0, 0x4(%r14)
setne %r8b
leaq 0x8(%rsp), %rdx
movl $0x4, %ecx
callq 0xf1d74
movq (%rbx), %rsi
addq $0x4, %rsi
movq %rsi, (%rbx)
movq 0x18(%r15), %rdi
movl 0x4(%r14), %edx
callq 0xef614
movq %rax, %r12
addq $0x4, (%rbx)
movq %r15, %rdi
movq %r14, %rsi
movq %r13, %rdx
movq %rbx, %rcx
callq 0xa803f
movq %r13, %rdi
callq 0xf74bd
movq %r15, %rdi
leaq 0x8bd82(%rip), %rsi     # 0x13387d
movl %ebp, %edx
leaq 0x18(%rsp), %rcx
movl %r12d, %r8d
movq (%rsp), %r12
movq %rax, %r9
xorl %eax, %eax
callq 0xe9226
movq %r13, %rdi
callq 0xf6883
incq %rbp
cmpq %rbp, %r12
jne 0xa7a98
movq %r13, %rdi
callq 0xf6bb0
addq $0x38, %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/psd.c
// Function: hrsrc_versioninfo
static void hrsrc_versioninfo(deark *c, lctx *d, zztype *zz, const struct rsrc_info *ri)
{
	i64 ver, file_ver;
	u8 b;
	de_ucstring *s = NULL;

	ver = psd_getu32zz(zz);
	de_dbg(c, "version: %d", (int)ver);

	b = psd_getbytezz(zz);
	de_dbg(c, "hasRealMergedData: %d", (int)b);

	s = ucstring_create(c);
	read_unicode_string(c, d, s, zz);
	de_dbg(c, "writer name: \"%s\"", ucstring_getpsz(s));

	ucstring_empty(s);
	read_unicode_string(c, d, s, zz);
	de_dbg(c, "reader name: \"%s\"", ucstring_getpsz(s));

	file_ver = psd_getu32zz(zz);
	de_dbg(c, "file version: %d", (int)file_ver);

	ucstring_destroy(s);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
movl 0x4(%rsi), %edx
movq (%r14), %rsi
callq 0xef614
addq $0x4, (%r14)
leaq 0x8c868(%rip), %rsi     # 0x1343d1
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movq 0x18(%rbx), %rdi
movq (%r14), %rsi
callq 0xef0d5
incq (%r14)
movzbl %al, %edx
leaq 0x8bd10(%rip), %rsi     # 0x13389e
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
callq 0xf6870
movq %rax, %r12
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
movq %r14, %rcx
callq 0xa803f
movq %r12, %rdi
callq 0xf74bd
leaq 0x8bcf1(%rip), %rsi     # 0x1338b4
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq %r12, %rdi
callq 0xf6883
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %r14, %rcx
callq 0xa803f
movq %r12, %rdi
callq 0xf74bd
leaq 0x8bcce(%rip), %rsi     # 0x1338c6
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq 0x18(%rbx), %rdi
movl 0x4(%r15), %edx
movq (%r14), %rsi
callq 0xef614
addq $0x4, (%r14)
leaq 0x8cb57(%rip), %rsi     # 0x134777
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movq %r12, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xf6bb0
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/psd.c
// Function: hrsrc_printscale
static void hrsrc_printscale(deark *c, lctx *d, zztype *zz, const struct rsrc_info *ri)
{
	i64 style;
	double xloc, yloc, scale;
	if(zz_avail(zz)!=14) return;
	style = psd_getu16zz(zz);
	de_dbg(c, "style: %d", (int)style);
	xloc = dbuf_getfloat32x(c->infile, zz->pos, d->is_le);
	zz->pos += 4;
	yloc = dbuf_getfloat32x(c->infile, zz->pos, d->is_le);
	zz->pos += 4;
	de_dbg(c, "location: (%f,%f)", xloc, yloc);
	scale = dbuf_getfloat32x(c->infile, zz->pos, d->is_le);
	zz->pos += 4;
	de_dbg(c, "scale: %f", scale);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq (%rdx), %rsi
movq 0x10(%rdx), %rcx
movq %rcx, %rax
subq %rsi, %rax
jle 0xa7ce0
movq 0x8(%r14), %rdx
cmpq %rdx, %rsi
jge 0xa7ce2
subq %rdx, %rcx
movq %rcx, %rax
jmp 0xa7ce2
xorl %eax, %eax
cmpq $0xe, %rax
jne 0xa7d89
movq 0x18(%rbx), %rdi
movl 0x4(%r15), %edx
callq 0xef570
addq $0x2, (%r14)
leaq 0x8bbd4(%rip), %rsi     # 0x1338d8
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movq 0x18(%rbx), %rdi
movq (%r14), %rsi
movl 0x4(%r15), %edx
callq 0xef935
movsd %xmm0, 0x8(%rsp)
movq (%r14), %rsi
addq $0x4, %rsi
movq %rsi, (%r14)
movq 0x18(%rbx), %rdi
movl 0x4(%r15), %edx
callq 0xef935
movaps %xmm0, %xmm1
addq $0x4, (%r14)
leaq 0x8bb97(%rip), %rsi     # 0x1338e2
movq %rbx, %rdi
movsd 0x8(%rsp), %xmm0
movb $0x2, %al
callq 0xe9226
movq 0x18(%rbx), %rdi
movq (%r14), %rsi
movl 0x4(%r15), %edx
callq 0xef935
addq $0x4, (%r14)
leaq 0x8bb7e(%rip), %rsi     # 0x1338f4
movq %rbx, %rdi
movb $0x1, %al
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0xe9226
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/psd.c
// Function: hrsrc_pixelaspectratio
static void hrsrc_pixelaspectratio(deark *c, lctx *d, zztype *zz, const struct rsrc_info *ri)
{
	i64 version;
	double ratio;
	if(zz_avail(zz)!=12) return;
	version = psd_getu32zz(zz);
	de_dbg(c, "version: %d", (int)version);
	ratio = dbuf_getfloat64x(c->infile, zz->pos, d->is_le);
	zz->pos += 8;
	de_dbg(c, "x/y: %f", ratio);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq (%rdx), %rsi
movq 0x10(%rdx), %rcx
movq %rcx, %rax
subq %rsi, %rax
jle 0xa7dc1
movq 0x8(%r14), %rdx
cmpq %rdx, %rsi
jge 0xa7dc3
subq %rdx, %rcx
movq %rcx, %rax
jmp 0xa7dc3
xorl %eax, %eax
cmpq $0xc, %rax
jne 0xa7e17
movq 0x18(%rbx), %rdi
movl 0x4(%r15), %edx
callq 0xef614
addq $0x4, (%r14)
leaq 0x8c5f0(%rip), %rsi     # 0x1343d1
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movq 0x18(%rbx), %rdi
movq (%r14), %rsi
movl 0x4(%r15), %edx
callq 0xef9cf
addq $0x8, (%r14)
leaq 0x8baf6(%rip), %rsi     # 0x1338fe
movq %rbx, %rdi
movb $0x1, %al
popq %rbx
popq %r14
popq %r15
jmp 0xe9226
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/psd.c
// Function: hrsrc_layerselectionids
static void hrsrc_layerselectionids(deark *c, lctx *d, zztype *zz, const struct rsrc_info *ri)
{
	i64 count;
	int i;

	if(zz_avail(zz)<2) return;
	count = psd_getu16zz(zz);
	de_dbg(c, "count: %d", (int)count);
	if(zz_avail(zz)<4*count) return;
	for(i=0; i<count; i++) {
		i64 lyid;
		lyid = psd_getu32zz(zz);
		de_dbg(c, "layer id[%d]: %u", (int)i, (unsigned int)lyid);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq (%rdx), %rsi
movq 0x10(%rdx), %rcx
movq %rcx, %rax
subq %rsi, %rax
jle 0xa7e51
movq 0x8(%rbx), %rdx
cmpq %rdx, %rsi
jge 0xa7e53
subq %rdx, %rcx
movq %rcx, %rax
jmp 0xa7e53
xorl %eax, %eax
cmpq $0x2, %rax
jl 0xa7ef5
movq 0x18(%r15), %rdi
movl 0x4(%r14), %edx
callq 0xef570
movq %rax, %r12
addq $0x2, (%rbx)
leaq 0x6ad48(%rip), %rsi     # 0x112bc0
movq %r15, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0xe9226
movq (%rbx), %rdx
movq 0x10(%rbx), %rcx
movq %rcx, %rax
subq %rdx, %rax
jle 0xa7ea5
movq 0x8(%rbx), %rsi
cmpq %rsi, %rdx
jge 0xa7ea7
subq %rsi, %rcx
movq %rcx, %rax
jmp 0xa7ea7
xorl %eax, %eax
leaq (,%r12,4), %rcx
cmpq %rcx, %rax
setl %al
testq %r12, %r12
setle %cl
orb %al, %cl
jne 0xa7ef5
leaq 0x8ba40(%rip), %r13     # 0x133906
xorl %ebp, %ebp
movq 0x18(%r15), %rdi
movl 0x4(%r14), %edx
movq (%rbx), %rsi
callq 0xef614
addq $0x4, (%rbx)
movq %r15, %rdi
movq %r13, %rsi
movl %ebp, %edx
movl %eax, %ecx
xorl %eax, %eax
callq 0xe9226
incq %rbp
cmpq %rbp, %r12
jne 0xa7ec8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/psd.c
// Function: hrsrc_pascalstring
static void hrsrc_pascalstring(deark *c, lctx *d, zztype *zz, const struct rsrc_info *ri)
{
	de_ucstring *s = NULL;

	s = ucstring_create(c);
	read_pascal_string_to_ucstring(c, d, s, zz);
	de_dbg(c, "%s: \"%s\"", ri->idname, ucstring_getpsz(s));
	ucstring_destroy(s);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
callq 0xf6870
movq %rax, %r13
movq %r12, %rdi
movq %r15, %rsi
movq %rax, %rdx
movq %r14, %rcx
callq 0xa696e
movq 0x8(%rbx), %rbx
movq %r13, %rdi
callq 0xf74bd
leaq 0x83efd(%rip), %rsi     # 0x12be42
movq %r12, %rdi
movq %rbx, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0xe9226
movq %r13, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xf6bb0
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/psd.c
// Function: hrsrc_printflagsinfo
static void hrsrc_printflagsinfo(deark *c, lctx *d, zztype *zz, const struct rsrc_info *ri)
{
	i64 version, bleed_width_value, bleed_width_scale;
	u8 crop_marks;

	if(zz_avail(zz)!=10) return;
	version = psd_getu16zz(zz);
	crop_marks = psd_getbytezz(zz);
	zz->pos++;
	bleed_width_value = psd_getu32zz(zz);
	bleed_width_scale = psd_getu16zz(zz);
	de_dbg(c, "%s: version=%d, crop marks=%d, bleed width value=%d, bleed width scale=%d",
		ri->idname, (int)version, (int)crop_marks,
		(int)bleed_width_value, (int)bleed_width_scale);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
movq (%rdx), %rsi
movq 0x10(%rdx), %rcx
movq %rcx, %rax
subq %rsi, %rax
jle 0xa7fa0
movq 0x8(%r15), %rdx
cmpq %rdx, %rsi
jge 0xa7fa2
subq %rdx, %rcx
movq %rcx, %rax
jmp 0xa7fa2
xorl %eax, %eax
cmpq $0xa, %rax
jne 0xa8030
movq 0x18(%rbx), %rdi
movl 0x4(%r12), %edx
callq 0xef570
movq %rax, 0x10(%rsp)
movq (%r15), %rsi
addq $0x2, %rsi
movq %rsi, (%r15)
movq 0x18(%rbx), %rdi
callq 0xef0d5
movl %eax, %r13d
movq (%r15), %rsi
addq $0x2, %rsi
movq %rsi, (%r15)
movq 0x18(%rbx), %rdi
movl 0x4(%r12), %edx
callq 0xef614
movq %rax, %rbp
movq (%r15), %rsi
addq $0x4, %rsi
movq %rsi, (%r15)
movq 0x18(%rbx), %rdi
movl 0x4(%r12), %edx
callq 0xef570
addq $0x2, (%r15)
movq 0x8(%r14), %rdx
movzbl %r13b, %r8d
movl %eax, (%rsp)
leaq 0x8b8f9(%rip), %rsi     # 0x133917
movq %rbx, %rdi
movq 0x10(%rsp), %rcx
movl %ebp, %r9d
xorl %eax, %eax
callq 0xe9226
addq $0x18, %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/psd.c
// Function: read_unicode_string
static void read_unicode_string(deark *c, lctx *d, de_ucstring *s, zztype *zz)
{
	i64 num_code_units;

	if(zz_avail(zz)<4) { // error
		zz->pos = zz->endpos;
		return;
	}

	num_code_units = psd_getu32zz(zz);
	if(zz->pos + num_code_units*2 > zz->endpos) { // error
		zz->pos = zz->endpos;
		return;
	}

	// Use DE_DBG_MAX_STRLEN, because we assume the string is being read for
	// the purposes of printing it in the debug info.
	dbuf_read_to_ucstring_n(c->infile, zz->pos, num_code_units*2, DE_DBG_MAX_STRLEN*2, s, 0,
		d->is_le ? DE_ENCODING_UTF16LE : DE_ENCODING_UTF16BE);
	zz->pos += num_code_units*2;

	// For no apparent reason, a fair number of these strings have been observed
	// to end with an extraneous U+0000 character.
	ucstring_strip_trailing_NUL(s);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movq (%rcx), %rsi
movq 0x10(%rcx), %rax
movq %rax, %rcx
subq %rsi, %rcx
jle 0xa8078
movq 0x8(%rbx), %rdx
cmpq %rdx, %rsi
jge 0xa807a
movq %rax, %rcx
subq %rdx, %rcx
jmp 0xa807a
xorl %ecx, %ecx
cmpq $0x3, %rcx
jle 0xa80ac
movq 0x18(%r12), %rdi
movl 0x4(%r15), %edx
callq 0xef614
movq %rax, %r13
movq (%rbx), %rcx
movq 0x10(%rbx), %rax
leaq 0x4(%rcx), %rsi
movq %rsi, (%rbx)
leaq (%rcx,%r13,2), %rcx
addq $0x4, %rcx
cmpq %rax, %rcx
jle 0xa80bd
movq %rax, (%rbx)
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
addq %r13, %r13
movq 0x18(%r12), %rdi
xorl %eax, %eax
cmpl $0x1, 0x4(%r15)
adcl $0x3, %eax
movl %eax, (%rsp)
movl $0x3e8, %ecx            # imm = 0x3E8
movq %r13, %rdx
movq %r14, %r8
xorl %r9d, %r9d
callq 0xf0203
addq %r13, (%rbx)
movq %r14, %rdi
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xf68e3
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/psd.c
// Function: read_rectangle_tlbr
static void read_rectangle_tlbr(deark *c, lctx *d, zztype *zz, const char *name)
{
	i64 n[4];
	i64 k;
	for(k=0; k<4; k++) {
		n[k] = psd_geti32zz(zz);
	}
	de_dbg(c, "%s: (%d,%d)-(%d,%d)", name, (int)n[1], (int)n[0], (int)n[3], (int)n[2]);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rcx, %rbx
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r14
xorl %r13d, %r13d
movq 0x18(%r14), %rdi
movl 0x4(%r12), %edx
movq (%r15), %rsi
callq 0xef654
addq $0x4, (%r15)
movq %rax, 0x10(%rsp,%r13,8)
incq %r13
cmpq $0x4, %r13
jne 0xa8119
movl 0x10(%rsp), %r8d
movl 0x18(%rsp), %ecx
movl 0x28(%rsp), %r9d
movl 0x20(%rsp), %eax
movl %eax, (%rsp)
leaq 0x8b411(%rip), %rsi     # 0x133569
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0xe9226
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/psd.c
// Function: flexible_id_free_contents
static void flexible_id_free_contents(deark *c, struct flexible_id *flid)
{
	if(flid->s) {
		ucstring_destroy(flid->s);
		flid->s = NULL;
	}
	if(flid->sz) {
		de_free(c, flid->sz);
		flid->sz = NULL;
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x40(%rsi), %rdi
testq %rdi, %rdi
je 0xa8625
callq 0xf6bb0
movq $0x0, 0x40(%rbx)
movq 0x38(%rbx), %rsi
testq %rsi, %rsi
je 0xa863e
movq %r14, %rdi
callq 0xe9752
movq $0x0, 0x38(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/psd.c
// Function: do_item_type_class
static int do_item_type_class(deark *c, lctx *d, zztype *zz)
{
	de_ucstring *tmps = NULL;
	struct flexible_id flid;

	tmps = ucstring_create(c);
	read_unicode_string(c, d, tmps, zz);
	de_dbg(c, "name from classID: \"%s\"", ucstring_getpsz_d(tmps));

	read_flexible_id_zz(c, d, zz, &flid);
	dbg_print_flexible_id(c, d, &flid, "classID");
	flexible_id_free_contents(c, &flid);

	ucstring_destroy(tmps);
	return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x50, %rsp
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
callq 0xf6870
movq %rax, %r14
movq %rbx, %rdi
movq %r12, %rsi
movq %rax, %rdx
movq %r15, %rcx
callq 0xa803f
movq %r14, %rdi
callq 0xf7557
leaq 0x8a219(%rip), %rsi     # 0x133607
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq %rsp, %r13
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r13, %rcx
callq 0xa84c7
leaq 0x8a209(%rip), %rdx     # 0x13361f
movq %rbx, %rdi
movq %r13, %rsi
callq 0xa85b9
movq %rbx, %rdi
movq %r13, %rsi
callq 0xa8605
movq %r14, %rdi
callq 0xf6bb0
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/psd.c
// Function: do_text_engine_data
static void do_text_engine_data(deark *c, lctx *d, i64 pos, i64 len)
{
	if(len<1) return;
	de_dbg(c, "text engine data at %d, len=%d", (int)pos, (int)len);
	if(c->extract_level<2) return;
	dbuf_create_file_from_slice(c->infile, pos, len, "enginedata", NULL, DE_CREATEFLAG_IS_AUX);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %rdx, %rdx
jle 0xa9472
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x8a3d8(%rip), %rsi     # 0x133834
movl %r14d, %edx
movl %ebx, %ecx
xorl %eax, %eax
callq 0xe9226
cmpl $0x2, 0x90(%r15)
jge 0xa9478
popq %rbx
popq %r14
popq %r15
retq
movq 0x18(%r15), %rdi
leaq 0x8a3d0(%rip), %rcx     # 0x133853
movq %r14, %rsi
movq %rbx, %rdx
xorl %r8d, %r8d
movl $0x1, %r9d
popq %rbx
popq %r14
popq %r15
jmp 0xf0321