// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/pcf.c
// Function: handler_properties
static void handler_properties(deark *c, lctx *d, struct table_entry *te)
{
	i64 pos = te->offset;
	i64 nprops;
	int saved_indent_level;
	i64 props_idx_pos;
	i64 props_idx_size_padded;
	i64 string_data_area_pos;
	i64 string_data_area_size;
	i64 k;

	de_dbg(c, "properties table at %"I64_FMT, pos);
	de_dbg_indent_save(c, &saved_indent_level);
	de_dbg_indent(c, 1);

	if(!read_and_check_format_field(c, d, te, pos)) goto done;
	pos += 4;

	nprops = dbuf_getu32x(c->infile, pos, te->fmt.is_le);
	pos += 4;
	de_dbg(c, "nprops: %d", (int)nprops);

	props_idx_pos = pos;
	props_idx_size_padded = de_pad_to_4(nprops*9);
	de_dbg(c, "properties index at %"I64_FMT, props_idx_pos);

	pos += props_idx_size_padded;

	string_data_area_size = dbuf_getu32x(c->infile, pos, te->fmt.is_le);
	pos += 4;
	string_data_area_pos = pos;
	de_dbg(c, "string data area at %"I64_FMT", len=%d", string_data_area_pos,
		(int)string_data_area_size);

	// Go back and read the properties table
	pos = props_idx_pos;
	for(k=0; k<nprops; k++) {
		if(pos+9 > te->offset + te->size) break;
		read_one_property(c, d, te, pos, k, string_data_area_pos);
		pos += 9;
	}

done:
	de_dbg_indent_restore(c, saved_indent_level);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %r14
movq %rsi, (%rsp)
movq %rdi, %rbx
movq 0x30(%rdx), %r15
leaq 0x79fbe(%rip), %rsi     # 0x139bb7
movq %r15, %rdx
xorl %eax, %eax
callq 0xe8617
leaq 0x14(%rsp), %rsi
movq %rbx, %rdi
callq 0xe8a1c
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0xc0832
testl %eax, %eax
je 0xbfea7
leaq 0x4(%r15), %rsi
movq 0x18(%rbx), %rdi
movl 0x10(%r14), %edx
callq 0xeeff3
movq %r15, %r12
movq %rax, %rbp
addq $0x8, %r15
leaq 0x79f7a(%rip), %rsi     # 0x139bcf
movq %rbx, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0xe8617
leaq (,%rbp,8), %rdi
addq %rbp, %rdi
callq 0xe9c87
movq %rax, %r13
leaq 0x79f5f(%rip), %rsi     # 0x139bda
movq %rbx, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0xe8617
leaq (%r12,%r13), %rsi
addq $0x8, %rsi
movq 0x18(%rbx), %rdi
movl 0x10(%r14), %edx
callq 0xeeff3
leaq (%r12,%r13), %rdx
addq $0xc, %rdx
leaq 0x79f46(%rip), %rsi     # 0x139bf2
movq %rbx, %rdi
movq %rdx, 0x20(%rsp)
movl %eax, %ecx
xorl %eax, %eax
callq 0xe8617
movq %rbp, 0x28(%rsp)
testq %rbp, %rbp
jle 0xbfea7
movq (%rsp), %rbp
leaq 0x80(%rbp), %rax
movq %rax, 0x18(%rsp)
addq $0x58, %rbp
movq %rbp, (%rsp)
movq %r12, %rbp
addq $0x11, %rbp
xorl %r15d, %r15d
movq 0x28(%r14), %rax
addq 0x30(%r14), %rax
cmpq %rax, %rbp
jg 0xbfea7
leaq -0x9(%rbp), %r13
movq %rbx, %rdi
leaq 0x79f3e(%rip), %rsi     # 0x139c4a
movl %r15d, %edx
movq %r13, %rcx
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movq 0x18(%rbx), %rdi
movl 0x10(%r14), %edx
movq %r13, %rsi
callq 0xeeff3
movq 0x20(%rsp), %r12
leaq (%rax,%r12), %r13
movq %rbx, %rdi
leaq 0x79f21(%rip), %rsi     # 0x139c6a
movq %rax, %rdx
movq %r13, %rcx
xorl %eax, %eax
callq 0xe8617
movq %rbp, 0x30(%rsp)
leaq -0x5(%rbp), %rax
movq %rax, 0x8(%rsp)
movq 0x28(%r14), %rsi
movq 0x30(%r14), %rdx
movq %rbx, %rdi
movq %r13, %rcx
leaq 0x68ad9(%rip), %r8      # 0x128852
callq 0xc0890
movq %rax, %r13
movq 0x18(%rbx), %rdi
leaq 0x8(%rsp), %rsi
callq 0xeeb4b
movzbl %al, %ebp
movq %rbx, %rdi
leaq 0x79ee9(%rip), %rsi     # 0x139c85
movl %ebp, %edx
xorl %eax, %eax
callq 0xe8617
movq 0x18(%rbx), %rdi
movq 0x8(%rsp), %rsi
movl 0x10(%r14), %edx
testb %bpl, %bpl
je 0xbfe35
callq 0xeeff3
movq %r12, %rcx
movq %r13, %r12
leaq (%rax,%rcx), %r13
movq %rbx, %rdi
leaq 0x79ec6(%rip), %rsi     # 0x139c96
movq %rax, %rdx
movq %r13, %rcx
xorl %eax, %eax
callq 0xe8617
movq 0x28(%r14), %rsi
movq 0x30(%r14), %rdx
movq %rbx, %rdi
movq %r13, %rcx
leaq 0x73d1f(%rip), %r8      # 0x133b11
callq 0xc0890
movq %rax, %rbp
movq 0x20(%r12), %r13
movq %r13, %rdi
leaq 0x79ea9(%rip), %rsi     # 0x139cb2
callq 0x181a0
testl %eax, %eax
je 0xbfe55
movq %r13, %rdi
leaq 0x79ea7(%rip), %rsi     # 0x139cc3
callq 0x181a0
testl %eax, %eax
jne 0xbfe67
movq 0x20(%rbp), %rsi
movl $0x28, %edx
movq 0x18(%rsp), %rdi
jmp 0xbfe62
callq 0xef033
movq %rbx, %rdi
leaq 0x52943(%rip), %rsi     # 0x112787
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
xorl %ebp, %ebp
movq %r13, %r12
jmp 0xbfe67
movq 0x20(%rbp), %rsi
movl $0x28, %edx
movq (%rsp), %rdi
callq 0xe8219
addq $0x4, 0x8(%rsp)
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
movq %rbx, %rdi
movq %r12, %rsi
callq 0xefaca
movq %rbx, %rdi
movq %rbp, %rsi
callq 0xefaca
incq %r15
movq 0x30(%rsp), %rbp
addq $0x9, %rbp
cmpq %r15, 0x28(%rsp)
jne 0xbfced
movl 0x14(%rsp), %esi
movq %rbx, %rdi
callq 0xe8a25
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq