// File: /workspace/github_c_makefile_star2_O2/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 $0x48, %rsp
movq %rdx, %r14
movq %rsi, 0x8(%rsp)
movq %rdi, %rbx
movq 0x30(%rdx), %r13
leaq 0x74493(%rip), %rsi     # 0x12c8a7
movq %r13, %rdx
xorl %eax, %eax
callq 0xde896
leaq 0x24(%rsp), %rsi
movq %rbx, %rdi
callq 0xdebae
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
movq %rbx, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0xb8f61
testl %eax, %eax
je 0xb86ae
leaq 0x4(%r13), %rsi
movq 0x18(%rbx), %rdi
movl 0x10(%r14), %edx
callq 0xe41cb
movq %rax, %r15
leaq 0x8(%r13), %rbp
leaq 0x74454(%rip), %rsi     # 0x12c8bf
movq %rbx, %rdi
movl %r15d, %edx
xorl %eax, %eax
callq 0xde896
leaq (%r15,%r15,8), %rdi
callq 0xdfb90
movq %rax, %r12
leaq 0x7443f(%rip), %rsi     # 0x12c8ca
movq %rbx, %rdi
movq %rbp, %rdx
xorl %eax, %eax
callq 0xde896
leaq (%r12,%r13), %rsi
addq $0x8, %rsi
movq 0x18(%rbx), %rdi
movl 0x10(%r14), %edx
callq 0xe41cb
addq %r13, %r12
addq $0xc, %r12
leaq 0x74427(%rip), %rsi     # 0x12c8e2
movq %rbx, %rdi
movq %r12, %rdx
movl %eax, %ecx
xorl %eax, %eax
callq 0xde896
movq 0x8(%rsp), %rbp
leaq 0x80(%rbp), %rax
movq %rax, 0x28(%rsp)
addq $0x58, %rbp
movq %rbp, 0x8(%rsp)
testq %r15, %r15
movl $0x0, %eax
cmovleq %rax, %r15
movq %r15, 0x30(%rsp)
addq $0x11, %r13
xorl %edx, %edx
movq %r12, 0x10(%rsp)
cmpq %rdx, 0x30(%rsp)
je 0xb86ae
movq 0x28(%r14), %rax
addq 0x30(%r14), %rax
cmpq %rax, %r13
jg 0xb86ae
movq %r12, %r15
leaq -0x9(%r13), %r12
movq %rbx, %rdi
leaq 0x7440d(%rip), %rsi     # 0x12c93a
movq %rdx, 0x38(%rsp)
movq %r12, %rcx
xorl %eax, %eax
callq 0xde896
movq %rbx, %rdi
pushq $0x1
popq %rsi
callq 0xdeba7
movq 0x18(%rbx), %rdi
movl 0x10(%r14), %edx
movq %r12, %rsi
callq 0xe41cb
leaq (%rax,%r15), %r12
movq %rbx, %rdi
leaq 0x743f5(%rip), %rsi     # 0x12c95a
movq %rax, %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0xde896
movq %r13, 0x40(%rsp)
leaq -0x5(%r13), %rax
movq %rax, 0x18(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
leaq 0x63082(%rip), %rcx     # 0x11b612
callq 0xb8fbe
movq %rax, %r13
movq 0x18(%rbx), %rdi
leaq 0x18(%rsp), %rsi
callq 0xe3f2a
movzbl %al, %ebp
movq %rbx, %rdi
leaq 0x743c2(%rip), %rsi     # 0x12c975
movl %ebp, %edx
xorl %eax, %eax
callq 0xde896
movq 0x18(%rbx), %rdi
movq 0x18(%rsp), %rsi
movl 0x10(%r14), %edx
testb %bpl, %bpl
je 0xb863b
callq 0xe41cb
leaq (%rax,%r15), %r12
movq %rbx, %rdi
leaq 0x743a5(%rip), %rsi     # 0x12c986
movq %rax, %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0xde896
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
leaq 0x6e23b(%rip), %rcx     # 0x126839
callq 0xb8fbe
movq %rax, %rbp
movq 0x20(%r13), %r12
movq %r12, %rdi
leaq 0x7438e(%rip), %rsi     # 0x12c9a2
callq 0x181a0
testl %eax, %eax
je 0xb865b
movq %r12, %rdi
leaq 0x7438c(%rip), %rsi     # 0x12c9b3
callq 0x181a0
testl %eax, %eax
jne 0xb866c
movq 0x20(%rbp), %rsi
movq 0x28(%rsp), %rdi
jmp 0xb8664
callq 0xe41d8
movq %rbx, %rdi
leaq 0x4d11d(%rip), %rsi     # 0x105767
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
xorl %ebp, %ebp
movq %r15, %r12
jmp 0xb8671
movq 0x20(%rbp), %rsi
movq 0x8(%rsp), %rdi
pushq $0x28
popq %rdx
callq 0xde492
movq 0x10(%rsp), %r12
addq $0x4, 0x18(%rsp)
movq %rbx, %rdi
pushq $-0x1
popq %rsi
callq 0xdeba7
movq %rbx, %rdi
movq %r13, %rsi
callq 0xe4b94
movq %rbx, %rdi
movq %rbp, %rsi
callq 0xe4b94
movq 0x38(%rsp), %rdx
incq %rdx
movq 0x40(%rsp), %r13
addq $0x9, %r13
jmp 0xb8500
movl 0x24(%rsp), %esi
movq %rbx, %rdi
callq 0xdebb7
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq