LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/psd.c
// Function: do_item_type_VlLs
static int do_item_type_VlLs(deark *c, lctx *d,
	const struct flexible_id *key_flid, zztype *zz, i64 outer_itempos)
{
	i64 num_items;
	i64 i;
	int ret;
	int retval = 0;
	zztype czz;

	num_items = psd_getu32zz(zz);
	de_dbg(c, "number of items in list: %d", (int)num_items);
	if(num_items>5000) {
		de_warn(c, "Excessively large VlLs item (%d)", (int)num_items);
		goto done;
	}

	if(d->nesting_level>MAX_NESTING_LEVEL) goto done;

	for(i=0; i<num_items; i++) {
		i64 inner_itempos;
		inner_itempos = zz->pos;
		de_dbg(c, "item[%d] at %d (for list@%d)", (int)i,
			(int)inner_itempos, (int)outer_itempos);
		de_dbg_indent(c, 1);
		d->nesting_level++;
		zz_init(&czz, zz);
		ret = do_descriptor_item_ostype_and_data(c, d, key_flid, &czz, inner_itempos);
		d->nesting_level--;
		de_dbg_indent(c, -1);
		if(!ret) goto done;
		zz->pos += zz_used(&czz);
	}

	retval = 1;
done:
	return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movl $0x0, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edx
callq 0xf3330
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rax
movl %eax, %edx
leaq 0xc8a8e(%rip), %rsi     # 0x1bf55e
movb $0x0, %al
callq 0x15b0d0
cmpq $0x1388, -0x30(%rbp)    # imm = 0x1388
jle 0xf6afe
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rax
movl %eax, %edx
leaq 0xc8a88(%rip), %rsi     # 0x1bf57a
movb $0x0, %al
callq 0x15bc10
jmp 0xf6be8
movq -0x10(%rbp), %rax
cmpl $0x32, 0x10(%rax)
jle 0xf6b0d
jmp 0xf6be8
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x30(%rbp), %rax
jge 0xf6be1
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rax
movl %eax, %edx
movq -0x60(%rbp), %rax
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %eax, %r8d
leaq 0xc8a4f(%rip), %rsi     # 0x1bf59b
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x10(%rbp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
movq -0x20(%rbp), %rsi
leaq -0x58(%rbp), %rdi
callq 0xf3580
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x60(%rbp), %r8
leaq -0x58(%rbp), %rcx
callq 0xf62f0
movl %eax, -0x3c(%rbp)
movq -0x10(%rbp), %rax
movl 0x10(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x10(%rax)
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
cmpl $0x0, -0x3c(%rbp)
jne 0xf6bba
jmp 0xf6be8
leaq -0x58(%rbp), %rdi
callq 0xf3820
movq %rax, %rcx
movq -0x20(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0xf6b15
movl $0x1, -0x40(%rbp)
movl -0x40(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/psd.c
// Function: do_item_type_descriptor
static int do_item_type_descriptor(deark *c, lctx *d, zztype *zz, int has_version)
{
	int retval = 0;

	d->nesting_level++;
	if(d->nesting_level>MAX_NESTING_LEVEL) goto done;

	// This descriptor contains a descriptor. We have to go deeper.
	retval = read_descriptor(c, d, zz, has_version, "");

done:
	d->nesting_level--;
	return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
movq -0x10(%rbp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
movq -0x10(%rbp), %rax
cmpl $0x32, 0x10(%rax)
jle 0xf6c37
jmp 0xf6c55
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movl -0x1c(%rbp), %ecx
leaq 0xd9f83(%rip), %r8      # 0x1d0bd0
callq 0xf5b50
movl %eax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movl 0x10(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x10(%rax)
movl -0x20(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/psd.c
// Function: do_item_type_tdta
static int do_item_type_tdta(deark *c, lctx *d,
	const struct flexible_id *key_flid, zztype *zz)
{
	i64 dlen;

	// The public PSD spec does not reveal how to calculate the length of a 'tdata'
	// item. Evidence suggests it starts with a 4-byte length field.
	dlen = psd_getu32zz(zz);
	de_dbg(c, "raw data at %d, dlen=%d", (int)zz->pos, (int)dlen);
	if(zz->pos+dlen > zz->endpos) {
		return 0;
	}

	if(key_flid->sz) {
		if(!de_strcmp(key_flid->sz, "EngineData")) {
			do_text_engine_data(c, d, zz->pos, dlen);
		}
	}

	zz->pos += dlen;
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x28(%rbp), %rsi
movq -0x18(%rbp), %rax
movl 0x4(%rax), %edx
callq 0xf3330
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rax
movq (%rax), %rax
movl %eax, %edx
movq -0x30(%rbp), %rax
movl %eax, %ecx
leaq 0xc86c2(%rip), %rsi     # 0x1bf650
movb $0x0, %al
callq 0x15b0d0
movq -0x28(%rbp), %rax
movq (%rax), %rax
addq -0x30(%rbp), %rax
movq -0x28(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jle 0xf6fb3
movl $0x0, -0x4(%rbp)
jmp 0xf7006
movq -0x20(%rbp), %rax
cmpq $0x0, 0x38(%rax)
je 0xf6ff1
movq -0x20(%rbp), %rax
movq 0x38(%rax), %rdi
leaq 0xc869b(%rip), %rsi     # 0x1bf668
callq 0x191a0
cmpl $0x0, %eax
jne 0xf6fef
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rax
movq (%rax), %rdx
movq -0x30(%rbp), %rcx
callq 0xf76a0
jmp 0xf6ff1
movq -0x30(%rbp), %rcx
movq -0x28(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1711d0
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x18(%rbp), %rcx
callq 0xf54d0
movq -0x8(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x20(%rbp), %rdi
callq 0x172650
movq -0x78(%rbp), %rdi
movq %rax, %rdx
leaq 0xc83d6(%rip), %rsi     # 0x1bf446
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x70(%rbp), %rcx
callq 0xf5f70
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x70(%rbp), %rdx
leaq 0xc83bf(%rip), %rcx     # 0x1bf45e
callq 0xf5fc0
movq -0x8(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0xf6050
movq -0x20(%rbp), %rdi
callq 0x171750
movl $0x1, %eax
addq $0x80, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/psd.c
// Function: do_item_type_alis
static int do_item_type_alis(deark *c, lctx *d, zztype *zz)
{
	i64 x;

	x = psd_getu32zz(zz);
	de_dbg(c, "alias length: %d", (int)x);
	zz->pos += x;
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edx
callq 0xf3330
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl %eax, %edx
leaq 0xc858c(%rip), %rsi     # 0x1bf69d
movb $0x0, %al
callq 0x15b0d0
movq -0x20(%rbp), %rcx
movq -0x18(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
movl $0x1, %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/psd.c
// Function: do_Enmr_reference
static int do_Enmr_reference(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);

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

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

	ucstring_destroy(tmps);
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1711d0
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x18(%rbp), %rcx
callq 0xf54d0
movq -0x8(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x20(%rbp), %rdi
callq 0x172650
movq -0x78(%rbp), %rdi
movq %rax, %rdx
leaq 0xc82a6(%rip), %rsi     # 0x1bf446
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x70(%rbp), %rcx
callq 0xf5f70
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x70(%rbp), %rdx
leaq 0xc828f(%rip), %rcx     # 0x1bf45e
callq 0xf5fc0
movq -0x8(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0xf6050
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x70(%rbp), %rcx
callq 0xf5f70
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x70(%rbp), %rdx
leaq 0xc83ee(%rip), %rcx     # 0x1bf5f7
callq 0xf5fc0
movq -0x8(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0xf6050
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x70(%rbp), %rcx
callq 0xf5f70
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x70(%rbp), %rdx
leaq 0xc83bb(%rip), %rcx     # 0x1bf5fe
callq 0xf5fc0
movq -0x8(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0xf6050
movq -0x20(%rbp), %rdi
callq 0x171750
movl $0x1, %eax
addq $0x80, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/psd.c
// Function: do_name_reference
static int do_name_reference(deark *c, lctx *d, zztype *zz)
{
	de_ucstring *tmps = NULL;
	struct flexible_id flid;

	// I can't find any credible documentation of the 'name' reference format.
	// This code is based on reverse engineering, and may not be correct.

	tmps = ucstring_create(c);

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

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

	read_unicode_string(c, d, tmps, zz);
	de_dbg(c, "undocumented unicode string: \"%s\"", ucstring_getpsz_d(tmps));

	ucstring_destroy(tmps);
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1711d0
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x18(%rbp), %rcx
callq 0xf54d0
movq -0x8(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x20(%rbp), %rdi
callq 0x172650
movq -0x80(%rbp), %rdi
movq %rax, %rdx
leaq 0xc8076(%rip), %rsi     # 0x1bf446
movb $0x0, %al
callq 0x15b0d0
movq -0x20(%rbp), %rdi
callq 0x171210
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x70(%rbp), %rcx
callq 0xf5f70
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x70(%rbp), %rdx
leaq 0xc8201(%rip), %rcx     # 0x1bf609
callq 0xf5fc0
movq -0x8(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0xf6050
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x18(%rbp), %rcx
callq 0xf54d0
movq -0x8(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x20(%rbp), %rdi
callq 0x172650
movq -0x78(%rbp), %rdi
movq %rax, %rdx
leaq 0xc81cb(%rip), %rsi     # 0x1bf619
movb $0x0, %al
callq 0x15b0d0
movq -0x20(%rbp), %rdi
callq 0x171750
movl $0x1, %eax
addq $0x80, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/psd.c
// Function: do_rele_reference
static int do_rele_reference(deark *c, lctx *d, zztype *zz)
{
	de_ucstring *tmps = NULL;
	struct flexible_id flid;
	i64 offs;

	tmps = ucstring_create(c);

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

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

	offs = psd_geti32zz(zz);
	de_dbg(c, "offset: %d", (int)offs);

	ucstring_destroy(tmps);
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1711d0
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x18(%rbp), %rcx
callq 0xf54d0
movq -0x8(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x20(%rbp), %rdi
callq 0x172650
movq -0x80(%rbp), %rdi
movq %rax, %rdx
leaq 0xc7f46(%rip), %rsi     # 0x1bf446
movb $0x0, %al
callq 0x15b0d0
movq -0x20(%rbp), %rdi
callq 0x171210
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x70(%rbp), %rcx
callq 0xf5f70
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x70(%rbp), %rdx
leaq 0xc7f26(%rip), %rcx     # 0x1bf45e
callq 0xf5fc0
movq -0x8(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0xf6050
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edx
callq 0xf5e90
movq %rax, -0x78(%rbp)
movq -0x8(%rbp), %rdi
movq -0x78(%rbp), %rax
movl %eax, %edx
leaq 0xc460e(%rip), %rsi     # 0x1bbb85
movb $0x0, %al
callq 0x15b0d0
movq -0x20(%rbp), %rdi
callq 0x171750
movl $0x1, %eax
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/psd.c
// Function: do_indx_reference
static int do_indx_reference(deark *c, lctx *d, zztype *zz)
{
	de_ucstring *tmps = NULL;
	struct flexible_id flid;
	i64 x;

	// I can't find any official documentation of the 'indx' reference format.
	// This code may not be correct.

	tmps = ucstring_create(c);

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

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

	x = psd_geti32zz(zz);
	de_dbg(c, "undocumented int: %d", (int)x);

	ucstring_destroy(tmps);
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1711d0
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x18(%rbp), %rcx
callq 0xf54d0
movq -0x8(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x20(%rbp), %rdi
callq 0x172650
movq -0x80(%rbp), %rdi
movq %rax, %rdx
leaq 0xc7e46(%rip), %rsi     # 0x1bf446
movb $0x0, %al
callq 0x15b0d0
movq -0x20(%rbp), %rdi
callq 0x171210
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x70(%rbp), %rcx
callq 0xf5f70
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x70(%rbp), %rdx
leaq 0xc7fd1(%rip), %rcx     # 0x1bf609
callq 0xf5fc0
movq -0x8(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0xf6050
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edx
callq 0xf5e90
movq %rax, -0x78(%rbp)
movq -0x8(%rbp), %rdi
movq -0x78(%rbp), %rax
movl %eax, %edx
leaq 0xc7fc4(%rip), %rsi     # 0x1bf63b
movb $0x0, %al
callq 0x15b0d0
movq -0x20(%rbp), %rdi
callq 0x171750
movl $0x1, %eax
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
cmpq $0x1, -0x20(%rbp)
jge 0xf76c1
jmp 0xf7715
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movl %eax, %edx
movq -0x20(%rbp), %rax
movl %eax, %ecx
leaq 0xc7f9b(%rip), %rsi     # 0x1bf673
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
cmpl $0x2, 0x90(%rax)
jge 0xf76ee
jmp 0xf7715
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
leaq 0xc7f8d(%rip), %rcx     # 0x1bf692
xorl %eax, %eax
movl %eax, %r8d
movl $0x1, %r9d
callq 0x166be0
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/psd.c
// Function: do_pluginrsrc_mani
static void do_pluginrsrc_mani(deark *c, lctx *d, zztype *zz)
{
	struct de_fourcc fourcc;
	i64 len;
	zztype czz;

	// This function is based on reverse engineering, and may not be correct.

	if(zz_avail(zz)<4) goto done;
	psd_read_fourcc_zz(c, d, zz, &fourcc);
	de_dbg(c, "id: '%s'", fourcc.id_dbgstr);

	if(fourcc.id==CODE_IRFR) { // Most likely related to Image Ready
		if(zz_avail(zz)<4) goto done;
		len = psd_getu32zz(zz);
		de_dbg(c, "length: %d", (int)len);
		if(zz_avail(zz)<12) goto done;
		zz_init_with_len(&czz, zz, len);
		// This data seems to have the same structure as a "series of tagged
		// blocks", but with different "keys". I don't know whether the keys are
		// in a different namespace, or what.
		do_tagged_blocks(c, d, zz, 1);
	}

done:
	;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0xf40b0
cmpq $0x4, %rax
jge 0xf7988
jmp 0xf7a3f
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x48(%rbp), %rcx
callq 0xf3d80
movq -0x8(%rbp), %rdi
leaq -0x48(%rbp), %rdx
addq $0x10, %rdx
leaq 0xa8987(%rip), %rsi     # 0x1a0337
movb $0x0, %al
callq 0x15b0d0
cmpl $0x49524652, -0x44(%rbp) # imm = 0x49524652
jne 0xf7a3d
movq -0x18(%rbp), %rdi
callq 0xf40b0
cmpq $0x4, %rax
jge 0xf79d1
jmp 0xf7a3f
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edx
callq 0xf3330
movq %rax, -0x50(%rbp)
movq -0x8(%rbp), %rdi
movq -0x50(%rbp), %rax
movl %eax, %edx
leaq 0xbf4ac(%rip), %rsi     # 0x1b6eaa
movb $0x0, %al
callq 0x15b0d0
movq -0x18(%rbp), %rdi
callq 0xf40b0
cmpq $0xc, %rax
jge 0xf7a16
jmp 0xf7a3f
movq -0x18(%rbp), %rsi
movq -0x50(%rbp), %rdx
leaq -0x68(%rbp), %rdi
callq 0xf3380
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movl $0x1, %ecx
callq 0xf7ce0
jmp 0xf7a3f
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/psd.c
// Function: do_tagged_blocks
static void do_tagged_blocks(deark *c, lctx *d, zztype *zz, int tbnamespace)
{
	zztype czz;

	d->nesting_level++;
	if(d->nesting_level>MAX_NESTING_LEVEL) goto done; // Defend against excessive recursion.

	if(d->tagged_blocks_only && d->nesting_level==1) {
		// If we're reading *only* this data structure (e.g. from a TIFF file), the
		// byte order may be of interest.
		de_dbg(c, "byte order: %s-endian", d->is_le?"little":"big");
	}

	while(1) {
		if(zz->pos+12 > zz->endpos) break;
		zz_init(&czz, zz);
		if(!do_tagged_block(c, d, &czz, tbnamespace)) break;
		zz->pos += zz_used(&czz);
	}

done:
	d->nesting_level--;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
movq -0x10(%rbp), %rax
cmpl $0x32, 0x10(%rax)
jle 0xf7d13
jmp 0xf7db0
movq -0x10(%rbp), %rax
cmpl $0x0, 0xc(%rax)
je 0xf7d55
movq -0x10(%rbp), %rax
cmpl $0x1, 0x10(%rax)
jne 0xf7d55
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x4(%rax), %ecx
leaq 0xc7c02(%rip), %rdx     # 0x1bf93b
leaq 0xc7bf4(%rip), %rax     # 0x1bf934
cmpl $0x0, %ecx
cmovneq %rax, %rdx
leaq 0xc7bd0(%rip), %rsi     # 0x1bf91e
movb $0x0, %al
callq 0x15b0d0
jmp 0xf7d57
movq -0x18(%rbp), %rax
movq (%rax), %rax
addq $0xc, %rax
movq -0x18(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jle 0xf7d6e
jmp 0xf7dae
movq -0x18(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0xf3580
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x1c(%rbp), %ecx
leaq -0x38(%rbp), %rdx
callq 0xf7dd0
cmpl $0x0, %eax
jne 0xf7d96
jmp 0xf7dae
leaq -0x38(%rbp), %rdi
callq 0xf3820
movq %rax, %rcx
movq -0x18(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
jmp 0xf7d57
jmp 0xf7db0
movq -0x10(%rbp), %rax
movl 0x10(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x10(%rax)
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/psd.c
// Function: do_boolean_block
static void do_boolean_block(deark *c, lctx *d, zztype *zz,
	const struct de_fourcc *blk4cc, const char *name)
{
	u8 value;
	i64 len;

	len = zz_avail(zz);
	if(len<1 || len>4) return;
	value = psd_getbytezz(zz);
	de_dbg(c, "%s: %d", name, (int)value);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x18(%rbp), %rdi
callq 0xf40b0
movq %rax, -0x38(%rbp)
cmpq $0x1, -0x38(%rbp)
jl 0xf8917
cmpq $0x4, -0x38(%rbp)
jle 0xf8919
jmp 0xf8947
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0xf4120
movb %al, -0x29(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rdx
movzbl -0x29(%rbp), %ecx
leaq 0xd240f(%rip), %rsi     # 0x1cad4f
movb $0x0, %al
callq 0x15b0d0
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/psd.c
// Function: do_lnk2_block
static void do_lnk2_block(deark *c, lctx *d, zztype *zz, const struct de_fourcc *blk4cc)
{
	int ret;
	zztype czz;

	while(zz->pos<zz->endpos) {
		de_dbg(c, "linked layer data at %"I64_FMT"", zz->pos);
		de_dbg_indent(c, 1);
		zz_init(&czz, zz);
		ret = do_one_linked_layer(c, d, &czz, blk4cc);
		de_dbg_indent(c, -1);
		if(!ret) break;
		zz->pos += zz_used(&czz);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jge 0xf8b16
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rdx
leaq 0xc720f(%rip), %rsi     # 0x1bfcba
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x18(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0xf3580
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rcx
leaq -0x40(%rbp), %rdx
callq 0xfa1c0
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
cmpl $0x0, -0x24(%rbp)
jne 0xf8afb
jmp 0xf8b16
leaq -0x40(%rbp), %rdi
callq 0xf3820
movq %rax, %rcx
movq -0x18(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
jmp 0xf8a88
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/psd.c
// Function: do_lrFX_block
static void do_lrFX_block(deark *c, lctx *d, zztype *zz, const struct de_fourcc *blk4cc)
{
	i64 ver;
	i64 count;
	i64 i;
	u32 sig;
	struct de_fourcc sig4cc;

	ver = psd_getu16zz(zz);
	if(ver!=0) goto done;

	count = psd_getu16zz(zz);
	de_dbg(c, "effects count: %d", (int)count);

	for(i=0; i<count; i++) {
		i64 epos;
		i64 dlen;

		if(zz->pos>=zz->endpos) goto done;
		epos = zz->pos;

		sig = (u32)psd_getu32zz(zz);
		if(sig!=CODE_8BIM) {
			de_warn(c, "Bad 'effects' block signature at %d", (int)zz->pos);
			goto done;
		}

		psd_read_fourcc_zz(c, d, zz, &sig4cc);

		dlen = psd_getu32zz(zz);

		de_dbg(c, "effects[%d] '%s' at %d, dpos=%d, dlen=%d", (int)i, sig4cc.id_dbgstr,
			(int)epos, (int)zz->pos, (int)dlen);
		zz->pos += dlen;
	}

done:
	;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edx
callq 0xf3de0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0xf8b93
jmp 0xf8ccc
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edx
callq 0xf3de0
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rax
movl %eax, %edx
leaq 0xc72ec(%rip), %rsi     # 0x1bfeac
movb $0x0, %al
callq 0x15b0d0
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x30(%rbp), %rax
jge 0xf8cca
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jl 0xf8bf3
jmp 0xf8ccc
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x78(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edx
callq 0xf3330
movl %eax, -0x3c(%rbp)
cmpl $0x3842494d, -0x3c(%rbp) # imm = 0x3842494D
je 0xf8c42
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rax
movl %eax, %edx
leaq 0xc7288(%rip), %rsi     # 0x1bfebe
movb $0x0, %al
callq 0x15bc10
jmp 0xf8ccc
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x6c(%rbp), %rcx
callq 0xf3d80
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edx
callq 0xf3330
movq %rax, -0x80(%rbp)
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rax
movl %eax, %edx
leaq -0x6c(%rbp), %rcx
addq $0x10, %rcx
movq -0x78(%rbp), %rax
movl %eax, %r8d
movq -0x18(%rbp), %rax
movq (%rax), %rax
movl %eax, %r9d
movq -0x80(%rbp), %rax
leaq 0xc7241(%rip), %rsi     # 0x1bfee2
movl %eax, (%rsp)
movb $0x0, %al
callq 0x15b0d0
movq -0x80(%rbp), %rcx
movq -0x18(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0xf8bcf
jmp 0xf8ccc
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/psd.c
// Function: do_unicodestring_block
static void do_unicodestring_block(deark *c, lctx *d, zztype *zz, const struct de_fourcc *blk4cc,
	const char *name)
{
	de_ucstring *s = NULL;

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1711d0
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x18(%rbp), %rcx
callq 0xf54d0
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rdi
callq 0x172500
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rdx
movq %rax, %rcx
leaq 0xbeeb5(%rip), %rsi     # 0x1b7c06
movb $0x0, %al
callq 0x15b0d0
movq -0x30(%rbp), %rdi
callq 0x171750
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/psd.c
// Function: do_descriptor_block
static void do_descriptor_block(deark *c, lctx *d, zztype *zz,
	const struct de_fourcc *blk4cc, const char *name)
{
	char dscrname[100];

	if(name[0])
		de_snprintf(dscrname, sizeof(dscrname), " (for %s)", name);
	else
		de_strlcpy(dscrname, "", sizeof(dscrname));

	read_descriptor(c, d, zz, 1, dscrname);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpb $0x0, (%rax)
je 0xf8db8
leaq -0x90(%rbp), %rdi
movq -0x28(%rbp), %rcx
movl $0x64, %esi
leaq 0xc715c(%rip), %rdx     # 0x1bff0b
movb $0x0, %al
callq 0x15a980
jmp 0xf8dd0
leaq -0x90(%rbp), %rdi
leaq 0xd7e0a(%rip), %rsi     # 0x1d0bd0
movl $0x64, %edx
callq 0x15aa30
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x90(%rbp), %r8
movl $0x1, %ecx
callq 0xf5b50
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/psd.c
// Function: do_vmsk_block
static void do_vmsk_block(deark *c, lctx *d, zztype *zz)
{
	i64 ver;
	i64 flags;
	zztype czz;

	ver = psd_getu32zz(zz);
	if(ver!=3) return;
	flags = psd_getu32zz(zz);
	de_dbg(c, "flags: 0x%08x", (unsigned int)flags);

	de_dbg(c, "path components at %d", (int)zz->pos);
	de_dbg_indent(c, 1);
	zz_init(&czz, zz);
	do_pathinfo(c, d, &czz);
	de_dbg_indent(c, -1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edx
callq 0xf3330
movq %rax, -0x20(%rbp)
cmpq $0x3, -0x20(%rbp)
je 0xf8e3c
jmp 0xf8ec5
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edx
callq 0xf3330
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movl %eax, %edx
leaq 0xb9215(%rip), %rsi     # 0x1b207e
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rax
movl %eax, %edx
leaq 0xc7091(%rip), %rsi     # 0x1bff15
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x18(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0xf3580
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x40(%rbp), %rdx
callq 0xf7720
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/psd.c
// Function: do_fxrp_block
static void do_fxrp_block(deark *c, lctx *d, zztype *zz)
{
	double v[2];

	if(zz_avail(zz)!=16) return;
	v[0] = dbuf_getfloat64x(c->infile, zz->pos, d->is_le);
	zz->pos += 8;
	v[1] = dbuf_getfloat64x(c->infile, zz->pos, d->is_le);
	zz->pos += 8;
	de_dbg(c, "reference point: %f, %f", v[0], v[1]);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0xf40b0
cmpq $0x10, %rax
je 0xf8fc5
jmp 0xf903d
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edx
callq 0x165f20
movsd %xmm0, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rcx
addq $0x8, %rcx
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edx
callq 0x165f20
movsd %xmm0, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rcx
addq $0x8, %rcx
movq %rcx, (%rax)
movq -0x8(%rbp), %rdi
movsd -0x30(%rbp), %xmm0
movsd -0x28(%rbp), %xmm1
leaq 0xc6f36(%rip), %rsi     # 0x1bff6c
movb $0x2, %al
callq 0x15b0d0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/psd.c
// Function: do_lsct_block
static void do_lsct_block(deark *c, lctx *d, zztype *zz)
{
	i64 x;
	struct de_fourcc tmp4cc;

	if(zz_avail(zz)<4) return;
	x = psd_getu32zz(zz);
	de_dbg(c, "section divider setting type: %d", (int)x);

	zz->pos += 4; // skip '8BIM' signature

	if(zz_avail(zz)<4) return;
	psd_read_fourcc_zz(c, d, zz, &tmp4cc);
	de_dbg(c, "blend mode key: '%s'", tmp4cc.id_dbgstr);

	if(zz_avail(zz)<4) return;
	x = psd_getu32zz(zz);
	de_dbg(c, "sub type: %d", (int)x);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0xf40b0
cmpq $0x4, %rax
jge 0xf9078
jmp 0xf913f
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edx
callq 0xf3330
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl %eax, %edx
leaq 0xc6edf(%rip), %rsi     # 0x1bff84
movb $0x0, %al
callq 0x15b0d0
movq -0x18(%rbp), %rax
movq (%rax), %rcx
addq $0x4, %rcx
movq %rcx, (%rax)
movq -0x18(%rbp), %rdi
callq 0xf40b0
cmpq $0x4, %rax
jge 0xf90cb
jmp 0xf913f
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x50(%rbp), %rcx
callq 0xf3d80
movq -0x8(%rbp), %rdi
leaq -0x50(%rbp), %rdx
addq $0x10, %rdx
leaq 0xc6eb2(%rip), %rsi     # 0x1bffa5
movb $0x0, %al
callq 0x15b0d0
movq -0x18(%rbp), %rdi
callq 0xf40b0
cmpq $0x4, %rax
jge 0xf910b
jmp 0xf913f
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edx
callq 0xf3330
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl %eax, %edx
leaq 0xc6e82(%rip), %rsi     # 0x1bffba
movb $0x0, %al
callq 0x15b0d0
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/psd.c
// Function: do_lspf_block
static void do_lspf_block(deark *c, lctx *d, zztype *zz)
{
	unsigned int x;
	if(zz_avail(zz)!=4) return;
	x = (unsigned int)psd_getu32zz(zz);
	de_dbg(c, "protection flags: transparency=%u, composite=%u, position=%u",
		(x&0x1), (x&0x2)>>1, (x&0x4)>>2);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0xf40b0
cmpq $0x4, %rax
je 0xf9175
jmp 0xf91bc
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edx
callq 0xf3330
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
movl -0x1c(%rbp), %edx
andl $0x1, %edx
movl -0x1c(%rbp), %ecx
andl $0x2, %ecx
shrl %ecx
movl -0x1c(%rbp), %r8d
andl $0x4, %r8d
shrl $0x2, %r8d
leaq 0xc6e12(%rip), %rsi     # 0x1bffc7
movb $0x0, %al
callq 0x15b0d0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/psd.c
// Function: do_lfx2_block
static void do_lfx2_block(deark *c, lctx *d, zztype *zz, const struct de_fourcc *blk4cc)
{
	i64 oe_ver;
	zztype czz;

	if(zz_avail(zz)<8) return;
	oe_ver = psd_getu32zz(zz);
	de_dbg(c, "object effects version: %d", (int)oe_ver);
	if(oe_ver!=0) return;

	zz_init(&czz, zz);
	do_descriptor_block(c, d, &czz, blk4cc, "object-based effects layer info");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x18(%rbp), %rdi
callq 0xf40b0
cmpq $0x8, %rax
jge 0xf91f9
jmp 0xf925f
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edx
callq 0xf3330
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movl %eax, %edx
leaq 0xc6dde(%rip), %rsi     # 0x1c0004
movb $0x0, %al
callq 0x15b0d0
cmpq $0x0, -0x28(%rbp)
je 0xf9236
jmp 0xf925f
movq -0x18(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0xf3580
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rcx
leaq -0x40(%rbp), %rdx
leaq 0xc6dc5(%rip), %r8      # 0x1c001f
callq 0xf8d70
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/psd.c
// Function: do_TySh_block
static void do_TySh_block(deark *c, lctx *d, zztype *zz, const struct de_fourcc *blk4cc)
{
	i64 ver, textver;

	ver = psd_getu16zz(zz);
	de_dbg(c, "version: %d", (int)ver);
	if(ver!=1) goto done;

	zz->pos += 6*8; // transform

	textver = psd_getu16zz(zz);
	de_dbg(c, "text version: %d", (int)textver);
	// For 'tySh', textver should be 6 -- TODO
	// For 'TySh', textver should be 50
	if(textver!=50) goto done;

	if(!read_descriptor(c, d, zz, 1, " (for type tool object setting - text)")) {
		goto done;
	}

	zz->pos += 2; // warp version
	if(!read_descriptor(c, d, zz, 1, " (for type tool object setting - warp)")) {
		goto done;
	}

	// TODO: "left, top, right, bottom" (field purpose and data type are undocumented)
	zz->pos += 4*8;

done:
	;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edx
callq 0xf3de0
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movl %eax, %edx
leaq 0xc6f5b(%rip), %rsi     # 0x1c0210
movb $0x0, %al
callq 0x15b0d0
cmpq $0x1, -0x28(%rbp)
je 0xf92c8
jmp 0xf9377
movq -0x18(%rbp), %rax
movq (%rax), %rcx
addq $0x30, %rcx
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edx
callq 0xf3de0
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rax
movl %eax, %edx
leaq 0xc6d3c(%rip), %rsi     # 0x1c003f
movb $0x0, %al
callq 0x15b0d0
cmpq $0x32, -0x30(%rbp)
je 0xf9313
jmp 0xf9377
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movl $0x1, %ecx
leaq 0xc6d25(%rip), %r8      # 0x1c0050
callq 0xf5b50
cmpl $0x0, %eax
jne 0xf9337
jmp 0xf9377
movq -0x18(%rbp), %rax
movq (%rax), %rcx
addq $0x2, %rcx
movq %rcx, (%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movl $0x1, %ecx
leaq 0xc6d1a(%rip), %r8      # 0x1c0077
callq 0xf5b50
cmpl $0x0, %eax
jne 0xf9369
jmp 0xf9377
movq -0x18(%rbp), %rax
movq (%rax), %rcx
addq $0x20, %rcx
movq %rcx, (%rax)
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/psd.c
// Function: do_SoLd_block
static void do_SoLd_block(deark *c, lctx *d, zztype *zz)
{
	struct de_fourcc id4cc;
	i64 ver;

	psd_read_fourcc_zz(c, d, zz, &id4cc);
	de_dbg(c, "identifier: '%s'", id4cc.id_dbgstr);
	ver = psd_getu32zz(zz);
	de_dbg(c, "version: %d", (int)ver);

	read_descriptor(c, d, zz, 1, " (of placed layer information)");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x48(%rbp), %rcx
callq 0xf3d80
movq -0x8(%rbp), %rdi
leaq -0x48(%rbp), %rdx
addq $0x10, %rdx
leaq 0xc6ce2(%rip), %rsi     # 0x1c009e
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edx
callq 0xf3330
movq %rax, -0x50(%rbp)
movq -0x8(%rbp), %rdi
movq -0x50(%rbp), %rax
movl %eax, %edx
leaq 0xc6e20(%rip), %rsi     # 0x1c0210
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movl $0x1, %ecx
leaq 0xc6ca0(%rip), %r8      # 0x1c00af
callq 0xf5b50
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/psd.c
// Function: do_FXid_block
static void do_FXid_block(deark *c, lctx *d, zztype *zz, const struct de_fourcc *blk4cc)
{
	i64 ver1;
	i64 dlen1;
	i64 idx;
	i64 main_endpos;
	zztype czz;

	ver1 = psd_getu32zz(zz);
	de_dbg(c, "version: %d", (int)ver1);
	if(ver1<1 || ver1>3) goto done;

	// TODO: I suspect that this next "length" field is actually part of each
	// individual filter effect, contrary to what the documentation says.
	// That way, there can be multiple "filter effects" in the same block.
	// Sample files needed.

	dlen1 = psd_geti64zz(zz);
	de_dbg(c, "length: %"I64_FMT"", dlen1);
	de_sanitize_length(&dlen1);
	main_endpos = zz->pos + dlen1;

	idx = 0;

	{
		de_dbg(c, "filter effect[%d] at %d", (int)idx, (int)zz->pos);
		zz_init_with_len(&czz, zz, main_endpos-zz->pos);
		de_dbg_indent(c, 1);
		do_filter_effect(c, d, &czz);
		de_dbg_indent(c, -1);
		zz->pos += zz_used(&czz);
		idx++;
	}

	if(zz->pos < main_endpos) {
		de_dbg(c, "[%d bytes of data at %d]", (int)(main_endpos-zz->pos), (int)zz->pos);
	}

	zz->pos = main_endpos;
done:
	;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edx
callq 0xf3330
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movl %eax, %edx
leaq 0xc6dab(%rip), %rsi     # 0x1c0210
movb $0x0, %al
callq 0x15b0d0
cmpq $0x1, -0x28(%rbp)
jl 0xf947a
cmpq $0x3, -0x28(%rbp)
jle 0xf947f
jmp 0xf9599
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edx
callq 0xf8890
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rdx
leaq 0xa95ed(%rip), %rsi     # 0x1a2a97
movb $0x0, %al
callq 0x15b0d0
leaq -0x30(%rbp), %rdi
callq 0x15f830
movq -0x18(%rbp), %rax
movq (%rax), %rax
addq -0x30(%rbp), %rax
movq %rax, -0x40(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rax
movl %eax, %edx
movq -0x18(%rbp), %rax
movq (%rax), %rax
movl %eax, %ecx
leaq 0xc6be3(%rip), %rsi     # 0x1c00ce
movb $0x0, %al
callq 0x15b0d0
movq -0x18(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq -0x18(%rbp), %rax
subq (%rax), %rdx
leaq -0x58(%rbp), %rdi
callq 0xf3380
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x58(%rbp), %rdx
callq 0xfae50
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
leaq -0x58(%rbp), %rdi
callq 0xf3820
movq %rax, %rcx
movq -0x18(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
cmpq -0x40(%rbp), %rax
jge 0xf958e
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rax
movq -0x18(%rbp), %rcx
subq (%rcx), %rax
movl %eax, %edx
movq -0x18(%rbp), %rax
movq (%rax), %rax
movl %eax, %ecx
leaq 0xc68e1(%rip), %rsi     # 0x1bfe68
movb $0x0, %al
callq 0x15b0d0
movq -0x40(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
addq $0x60, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/psd.c
// Function: do_layer_name
static void do_layer_name(deark *c, lctx *d, zztype *zz)
{
	de_ucstring *s = NULL;

	// "Pascal string, padded to a multiple of 4 bytes"
	s = ucstring_create(c);
	read_pascal_string_to_ucstring(c, d, s, zz);
	de_dbg(c, "layer name: \"%s\"", ucstring_getpsz(s));
	zz->pos = zz->startpos + de_pad_to_4(zz_used(zz));
	ucstring_destroy(s);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1711d0
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x18(%rbp), %rcx
callq 0xf3e30
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rdi
callq 0x172500
movq -0x30(%rbp), %rdi
movq %rax, %rdx
leaq 0xc5b2c(%rip), %rsi     # 0x1bfca9
movb $0x0, %al
callq 0x15b0d0
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rdi
callq 0xf3820
movq %rax, %rdi
callq 0x15ce30
movq -0x28(%rbp), %rcx
addq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rdi
callq 0x171750
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/psd.c
// Function: extract_linked_layer_blob
static void extract_linked_layer_blob(deark *c, lctx *d, i64 pos, i64 len)
{
	struct fmtutil_fmtid_ctx *idctx = NULL;
	char ext[16];

	if(len<1) goto done;

	// Sniff the file type.
	// (The "File Type" FourCC is not reliable.)
	idctx = de_malloc(c, sizeof(struct fmtutil_fmtid_ctx));
	idctx->inf = c->infile;
	idctx->inf_pos = pos;
	idctx->inf_len = len;
	fmtutil_fmtid(c, idctx);
	// Expecting psd, psb, png, jpg, pdf, maybe others.
	de_snprintf(ext, sizeof(ext), "layer.%s", idctx->ext_sz);

	// TODO: Maybe we should try to use the "original filename" field, somehow,
	// to construct our filename.
	dbuf_create_file_from_slice(c->infile, pos, len, ext,
		NULL, DE_CREATEFLAG_IS_AUX);

done:
	de_free(c, idctx);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
cmpq $0x1, -0x20(%rbp)
jge 0xfa56c
jmp 0xfa5f6
movq -0x8(%rbp), %rdi
movl $0x78, %esi
callq 0x15b780
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x176960
leaq -0x40(%rbp), %rdi
movq -0x28(%rbp), %rcx
addq $0x6c, %rcx
movl $0x10, %esi
leaq 0xc57fe(%rip), %rdx     # 0x1bfdc9
movb $0x0, %al
callq 0x15a980
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
leaq -0x40(%rbp), %rcx
xorl %eax, %eax
movl %eax, %r8d
movl $0x1, %r9d
callq 0x166be0
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x15b820
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/psd.c
// Function: do_pattern_sequence
static void do_pattern_sequence(deark *c, lctx *d, zztype *zz)
{
	i64 pattern_idx;
	zztype czz;

	pattern_idx = 0;
	while(1) {
		if(zz_avail(zz)<16) break;
		zz_init(&czz, zz);
		if(!do_pattern(c, d, &czz, pattern_idx)) {
			break;
		}
		zz->pos += zz_used(&czz);
		pattern_idx++;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x18(%rbp), %rdi
callq 0xf40b0
cmpq $0x10, %rax
jge 0xfa63d
jmp 0xfa68a
movq -0x18(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0xf3580
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rcx
leaq -0x38(%rbp), %rdx
callq 0xfa690
cmpl $0x0, %eax
jne 0xfa666
jmp 0xfa68a
leaq -0x38(%rbp), %rdi
callq 0xf3820
movq %rax, %rcx
movq -0x18(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0xfa62c
addq $0x40, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/psd.c
// Function: do_pattern
static int do_pattern(deark *c, lctx *d, zztype *zz, i64 pattern_idx)
{
	i64 pat_dlen;
	zztype datazz; // zz for the pattern data (minus the length field)
	int retval = 0;

	if(zz_avail(zz)<16) goto done;

	de_dbg(c, "pattern[%d] at %d", (int)pattern_idx, (int)zz->pos);
	de_dbg_indent(c, 1);

	pat_dlen = psd_getu32zz(zz);
	de_dbg(c, "length: %d", (int)pat_dlen);

	zz_init_with_len(&datazz, zz, pat_dlen);

	do_pattern_internal(c, d, &datazz);

	zz->pos += de_pad_to_4(pat_dlen);

	de_dbg_indent(c, -1);

	retval = 1;
done:
	return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl $0x0, -0x44(%rbp)
movq -0x18(%rbp), %rdi
callq 0xf40b0
cmpq $0x10, %rax
jge 0xfa6c3
jmp 0xfa773
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl %eax, %edx
movq -0x18(%rbp), %rax
movq (%rax), %rax
movl %eax, %ecx
leaq 0xc56f5(%rip), %rsi     # 0x1bfdd2
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edx
callq 0xf3330
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movl %eax, %edx
leaq 0xbc78b(%rip), %rsi     # 0x1b6eaa
movb $0x0, %al
callq 0x15b0d0
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rdx
leaq -0x40(%rbp), %rdi
callq 0xf3380
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x40(%rbp), %rdx
callq 0xfa780
movq -0x28(%rbp), %rdi
callq 0x15ce30
movq %rax, %rcx
movq -0x18(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
movl $0x1, -0x44(%rbp)
movl -0x44(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)