// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/psd.c
// Function: do_item_type_obj
static int do_item_type_obj(deark *c, lctx *d, zztype *zz)
{
	i64 num_items;
	i64 i;
	int retval = 0;
	int saved_indent_level;
	zztype czz;

	de_dbg_indent_save(c, &saved_indent_level);

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

	for(i=0; i<num_items; i++) {
		struct de_fourcc type4cc;
		i64 itempos;

		itempos = zz->pos;
		if(itempos >= zz->endpos) goto done;
		psd_read_fourcc_zz(c, d, zz, &type4cc);
		de_dbg(c, "reference item[%d] '%s' at %d", (int)i, type4cc.id_dbgstr, (int)itempos);

		de_dbg_indent(c, 1);

		zz_init(&czz, zz);
		switch(type4cc.id) {
		case CODE_Enmr:
			if(!do_Enmr_reference(c, d, &czz)) goto done;
			zz->pos += zz_used(&czz);
			break;
		case CODE_prop:
			if(!do_prop_reference(c, d, &czz)) goto done;
			zz->pos += zz_used(&czz);
			break;
		case CODE_name:
			if(!do_name_reference(c, d, &czz)) goto done;
			zz->pos += zz_used(&czz);
			break;
		case CODE_Clss:
			if(!do_Clss_reference(c, d, &czz)) goto done;
			zz->pos += zz_used(&czz);
			break;
		case CODE_rele:
			if(!do_rele_reference(c, d, &czz)) goto done;
			zz->pos += zz_used(&czz);
			break;
		case CODE_indx:
			if(!do_indx_reference(c, d, &czz)) goto done;
			zz->pos += zz_used(&czz);
			break;
		default:
			// TODO: 'Idnt'
			goto done;
		}

		de_dbg_indent(c, -1);
	}

	retval = 1;
done:
	de_dbg_indent_restore(c, saved_indent_level);
	return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x0, -0x2c(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x15b580
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 0xc88f0(%rip), %rsi     # 0x1bf5b8
movb $0x0, %al
callq 0x15b0d0
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x20(%rbp), %rax
jge 0xf6f16
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rax
movq -0x18(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jl 0xf6d03
jmp 0xf6f1d
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x78(%rbp), %rcx
callq 0xf3d80
movq -0x8(%rbp), %rdi
movl -0x28(%rbp), %edx
leaq -0x68(%rbp), %rcx
movl -0x80(%rbp), %r8d
leaq 0xc88ab(%rip), %rsi     # 0x1bf5d9
xorl %eax, %eax
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x18(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0xf3580
movl -0x74(%rbp), %eax
movl %eax, -0x84(%rbp)
subl $0x436c7373, %eax       # imm = 0x436C7373
je 0xf6e62
jmp 0xf6d66
movl -0x84(%rbp), %eax
subl $0x456e6d72, %eax       # imm = 0x456E6D72
je 0xf6dc0
jmp 0xf6d75
movl -0x84(%rbp), %eax
subl $0x696e6478, %eax       # imm = 0x696E6478
je 0xf6ec5
jmp 0xf6d88
movl -0x84(%rbp), %eax
subl $0x6e616d65, %eax       # imm = 0x6E616D65
je 0xf6e2c
jmp 0xf6d9b
movl -0x84(%rbp), %eax
subl $0x70726f70, %eax       # imm = 0x70726F70
je 0xf6df6
jmp 0xf6daa
movl -0x84(%rbp), %eax
subl $0x72656c65, %eax       # imm = 0x72656C65
je 0xf6e95
jmp 0xf6ef5
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x48(%rbp), %rdx
callq 0xf7140
cmpl $0x0, %eax
jne 0xf6ddb
jmp 0xf6f1d
leaq -0x48(%rbp), %rdi
callq 0xf3820
movq %rax, %rcx
movq -0x18(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
jmp 0xf6ef7
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x48(%rbp), %rdx
callq 0xf7270
cmpl $0x0, %eax
jne 0xf6e11
jmp 0xf6f1d
leaq -0x48(%rbp), %rdi
callq 0xf3820
movq %rax, %rcx
movq -0x18(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
jmp 0xf6ef7
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x48(%rbp), %rdx
callq 0xf7370
cmpl $0x0, %eax
jne 0xf6e47
jmp 0xf6f1d
leaq -0x48(%rbp), %rdi
callq 0xf3820
movq %rax, %rcx
movq -0x18(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
jmp 0xf6ef7
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x48(%rbp), %rdx
callq 0xf7470
cmpl $0x0, %eax
jne 0xf6e7d
jmp 0xf6f1d
leaq -0x48(%rbp), %rdi
callq 0xf3820
movq %rax, %rcx
movq -0x18(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
jmp 0xf6ef7
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x48(%rbp), %rdx
callq 0xf74a0
cmpl $0x0, %eax
jne 0xf6ead
jmp 0xf6f1d
leaq -0x48(%rbp), %rdi
callq 0xf3820
movq %rax, %rcx
movq -0x18(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
jmp 0xf6ef7
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x48(%rbp), %rdx
callq 0xf75a0
cmpl $0x0, %eax
jne 0xf6edd
jmp 0xf6f1d
leaq -0x48(%rbp), %rdi
callq 0xf3820
movq %rax, %rcx
movq -0x18(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
jmp 0xf6ef7
jmp 0xf6f1d
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0xf6cd7
movl $0x1, -0x2c(%rbp)
movq -0x8(%rbp), %rdi
movl -0x30(%rbp), %esi
callq 0x15b5a0
movl -0x2c(%rbp), %eax
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)