// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/psd.c
// Function: do_one_action
static int do_one_action(deark *c, lctx *d, zztype *zz)
{
	i64 action_pos;
	i64 idx;
	i64 num_items;
	i64 item_idx;
	de_ucstring *s = NULL;
	zztype czz;
	int saved_indent_level;
	int retval = 0;

	de_dbg_indent_save(c, &saved_indent_level);
	action_pos = zz->pos;
	idx = psd_getu16zz(zz);
	de_dbg(c, "index: %d", (int)idx);

	zz->pos += 1; // shift key flag
	zz->pos += 1; // command key flag
	zz->pos += 2; // color index info

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

	zz->pos += 1; // action-is-expanded

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

	for(item_idx=0; item_idx<num_items; item_idx++) {
		if(zz_avail(zz)<1) goto done;
		zz_init(&czz, zz);
		de_dbg(c, "item[%d] at %d (for action @%d)", (int)item_idx, (int)zz->pos, (int)action_pos);
		de_dbg_indent(c, 1);
		if(!do_action_item(c, d, &czz)) goto done;
		zz->pos += zz_used(&czz);
		de_dbg_indent(c, -1);
	}

	retval = 1;

done:
	de_dbg_indent_restore(c, saved_indent_level);
	ucstring_destroy(s);
	return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq $0x0, -0x40(%rbp)
movl $0x0, -0x60(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x5c(%rbp), %rsi
callq 0x15b580
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -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 0xa2cc0(%rip), %rsi     # 0x19e9d8
movb $0x0, %al
callq 0x15b0d0
movq -0x18(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq (%rax), %rcx
addq $0x2, %rcx
movq %rcx, (%rax)
movq -0x8(%rbp), %rdi
callq 0x1711d0
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq -0x18(%rbp), %rcx
callq 0xf54d0
movq -0x8(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x40(%rbp), %rdi
callq 0x172650
movq -0x68(%rbp), %rdi
movq %rax, %rdx
leaq 0xc473d(%rip), %rsi     # 0x1c04c7
movb $0x0, %al
callq 0x15b0d0
movq -0x18(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %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 0xf3330
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rax
movl %eax, %edx
leaq 0xbc21c(%rip), %rsi     # 0x1b7fe8
movb $0x0, %al
callq 0x15b0d0
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x30(%rbp), %rax
jge 0xfbe8d
movq -0x18(%rbp), %rdi
callq 0xf40b0
cmpq $0x1, %rax
jge 0xfbdfd
jmp 0xfbe94
movq -0x18(%rbp), %rsi
leaq -0x58(%rbp), %rdi
callq 0xf3580
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rax
movl %eax, %edx
movq -0x18(%rbp), %rax
movq (%rax), %rax
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %eax, %r8d
leaq 0xc46ae(%rip), %rsi     # 0x1c04d9
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x58(%rbp), %rdx
callq 0xfbec0
cmpl $0x0, %eax
jne 0xfbe58
jmp 0xfbe94
leaq -0x58(%rbp), %rdi
callq 0xf3820
movq %rax, %rcx
movq -0x18(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0xfbddb
movl $0x1, -0x60(%rbp)
movq -0x8(%rbp), %rdi
movl -0x5c(%rbp), %esi
callq 0x15b5a0
movq -0x40(%rbp), %rdi
callq 0x171750
movl -0x60(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)