// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/psd.c
// Function: do_action_item
static int do_action_item(deark *c, lctx *d, zztype *zz)
{
	struct de_fourcc id4cc;
	de_ucstring *s = NULL;
	i64 dscr_flag;
	int retval = 0;

	zz->pos += 1; // action-is-expanded
	zz->pos += 1; // action-is-enabled
	zz->pos += 1; // dialogs-should-be-displayed
	zz->pos += 1; // options for displaying dialogs

	s = ucstring_create(c);

	psd_read_fourcc_zz(c, d, zz, &id4cc);
	de_dbg(c, "identifier type: '%s'", id4cc.id_dbgstr);
	if(id4cc.id==CODE_TEXT) {
		read_prefixed_string_to_ucstring(c, d, s, zz);
		de_dbg(c, "id: \"%s\"", ucstring_getpsz_d(s));
	}
	else if(id4cc.id==CODE_long) {
		i64 id_long;
		id_long = psd_getu32zz(zz);
		de_dbg(c, "itemID: %d", (int)id_long);
	}
	else {
		de_err(c, "Unsupported identifier type: '%s'", id4cc.id_sanitized_sz);
		goto done;
	}

	ucstring_empty(s);
	read_prefixed_string_to_ucstring(c, d, s, zz);
	de_dbg(c, "dictionary name: \"%s\"", ucstring_getpsz_d(s));

	dscr_flag = psd_geti32zz(zz);
	de_dbg(c, "descriptor flag: %d", (int)dscr_flag);

	if(dscr_flag == -1) {
		if(!read_descriptor(c, d, zz, 0, "")) goto done;
	}
	else if(dscr_flag==0) {
		;
	}
	else {
		de_err(c, "Unsupported descriptor flag: %d", (int)dscr_flag);
		goto done;
	}

	retval = 1;

done:
	ucstring_destroy(s);
	return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq $0x0, -0x50(%rbp)
movl $0x0, -0x5c(%rbp)
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 $0x1, %rcx
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movq -0x8(%rbp), %rdi
callq 0x1711d0
movq %rax, -0x50(%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 0xc45bd(%rip), %rsi     # 0x1c0510
movb $0x0, %al
callq 0x15b0d0
cmpl $0x54455854, -0x44(%rbp) # imm = 0x54455854
jne 0xfbfa0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x50(%rbp), %rdx
movq -0x18(%rbp), %rcx
callq 0xfc0f0
movq -0x8(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x50(%rbp), %rdi
callq 0x172650
movq -0x70(%rbp), %rdi
movq %rax, %rdx
leaq 0xbd7b8(%rip), %rsi     # 0x1b974f
movb $0x0, %al
callq 0x15b0d0
jmp 0xfc000
cmpl $0x6c6f6e67, -0x44(%rbp) # imm = 0x6C6F6E67
jne 0xfbfdf
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edx
callq 0xf3330
movq %rax, -0x68(%rbp)
movq -0x8(%rbp), %rdi
movq -0x68(%rbp), %rax
movl %eax, %edx
leaq 0xc4523(%rip), %rsi     # 0x1c04f9
movb $0x0, %al
callq 0x15b0d0
jmp 0xfbffe
movq -0x8(%rbp), %rdi
leaq -0x48(%rbp), %rdx
addq $0x8, %rdx
leaq 0xc4512(%rip), %rsi     # 0x1c0504
movb $0x0, %al
callq 0x15bfb0
jmp 0xfc0ce
jmp 0xfc000
movq -0x50(%rbp), %rdi
callq 0x171210
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x50(%rbp), %rdx
movq -0x18(%rbp), %rcx
callq 0xfc0f0
movq -0x8(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x50(%rbp), %rdi
callq 0x172650
movq -0x78(%rbp), %rdi
movq %rax, %rdx
leaq 0xc44e9(%rip), %rsi     # 0x1c0526
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 0xf5e90
movq %rax, -0x58(%rbp)
movq -0x8(%rbp), %rdi
movq -0x58(%rbp), %rax
movl %eax, %edx
leaq 0xc44d7(%rip), %rsi     # 0x1c0548
movb $0x0, %al
callq 0x15b0d0
cmpq $-0x1, -0x58(%rbp)
jne 0xfc0a2
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
xorl %ecx, %ecx
leaq 0xd4b3c(%rip), %r8      # 0x1d0bd0
callq 0xf5b50
cmpl $0x0, %eax
jne 0xfc0a0
jmp 0xfc0ce
jmp 0xfc0c7
cmpq $0x0, -0x58(%rbp)
jne 0xfc0ab
jmp 0xfc0c5
movq -0x8(%rbp), %rdi
movq -0x58(%rbp), %rax
movl %eax, %edx
leaq 0xc4480(%rip), %rsi     # 0x1c053c
movb $0x0, %al
callq 0x15bfb0
jmp 0xfc0ce
jmp 0xfc0c7
movl $0x1, -0x5c(%rbp)
movq -0x50(%rbp), %rdi
callq 0x171750
movl -0x5c(%rbp), %eax
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)