// File: /workspace/github_c_makefile_star2_O1/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), %r12
leaq 0x78fb1(%rip), %rsi     # 0x139817
movq %r12, %rdx
xorl %eax, %eax
callq 0xe9226
leaq 0x2c(%rsp), %rsi
movq %rbx, %rdi
callq 0xe958c
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq %rbx, %rdi
movq %r14, 0x20(%rsp)
movq %r14, %rsi
movq %r12, %rdx
callq 0xc13e2
testl %eax, %eax
je 0xc0b42
leaq 0x4(%r12), %rsi
movq 0x18(%rbx), %rdi
movq 0x20(%rsp), %r14
movl 0x10(%r14), %edx
callq 0xef614
movq %rax, %rbp
leaq 0x8(%r12), %r15
leaq 0x78f64(%rip), %rsi     # 0x13982f
movq %rbx, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0xe9226
leaq (,%rbp,8), %rdi
addq %rbp, %rdi
callq 0xea7de
movq %rax, %r13
leaq 0x78f49(%rip), %rsi     # 0x13983a
movq %rbx, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0xe9226
leaq (%r12,%r13), %rsi
addq $0x8, %rsi
movq 0x18(%rbx), %rdi
movl 0x10(%r14), %edx
callq 0xef614
addq %r12, %r13
addq $0xc, %r13
leaq 0x78f31(%rip), %rsi     # 0x139852
movq %rbx, %rdi
movq %r13, %rdx
movl %eax, %ecx
xorl %eax, %eax
callq 0xe9226
movq %rbp, 0x38(%rsp)
testq %rbp, %rbp
jle 0xc0b42
movq 0x8(%rsp), %rbp
leaq 0x80(%rbp), %rax
movq %rax, 0x30(%rsp)
addq $0x58, %rbp
movq %rbp, 0x8(%rsp)
addq $0x11, %r12
xorl %r15d, %r15d
movq %r13, 0x10(%rsp)
movq 0x20(%rsp), %rcx
movq 0x28(%rcx), %rax
addq 0x30(%rcx), %rax
cmpq %rax, %r12
jg 0xc0b42
movq %r12, 0x18(%rsp)
leaq -0x9(%r12), %rcx
movq %rcx, (%rsp)
movq %rbx, %rdi
leaq 0x78f18(%rip), %rsi     # 0x1398aa
movl %r15d, %edx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq 0x18(%rbx), %rdi
movq (%rsp), %rsi
movq 0x20(%rsp), %r12
movl 0x10(%r12), %edx
callq 0xef614
movq %r13, %r14
addq %rax, %r13
movq %rbx, %rdi
leaq 0x78efa(%rip), %rsi     # 0x1398ca
movq %rax, %rdx
movq %r13, %rcx
xorl %eax, %eax
callq 0xe9226
addq $0x4, (%rsp)
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
leaq 0x67c30(%rip), %rcx     # 0x128622
callq 0xc1440
movq %rax, %r13
movq 0x18(%rbx), %rdi
movq %rsp, %rsi
callq 0xef14d
movzbl %al, %ebp
movq %rbx, %rdi
leaq 0x78ed2(%rip), %rsi     # 0x1398e5
movl %ebp, %edx
xorl %eax, %eax
callq 0xe9226
movq 0x18(%rbx), %rdi
movq (%rsp), %rsi
movl 0x10(%r12), %edx
testb %bpl, %bpl
movq %r13, 0x40(%rsp)
je 0xc0aa4
callq 0xef614
movq %r13, %rbp
leaq (%rax,%r14), %r13
movq %rbx, %rdi
leaq 0x78ead(%rip), %rsi     # 0x1398f6
movq %rax, %rdx
movq %r13, %rcx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
leaq 0x72cb3(%rip), %rcx     # 0x133719
callq 0xc1440
movq %rax, %r14
movq 0x20(%rbp), %r13
movq %r13, %rdi
leaq 0x78e96(%rip), %rsi     # 0x139912
callq 0x181a0
testl %eax, %eax
je 0xc0ac9
movq %r13, %rdi
leaq 0x78e94(%rip), %rsi     # 0x139923
callq 0x181a0
testl %eax, %eax
movq 0x18(%rsp), %r12
je 0xc0aeb
movq 0x10(%rsp), %r13
jmp 0xc0ae6
callq 0xef654
movq %rbx, %rdi
leaq 0x51cc4(%rip), %rsi     # 0x112777
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
xorl %ebp, %ebp
movq %r14, %r13
movq 0x18(%rsp), %r12
jmp 0xc0b06
movq 0x20(%r14), %rsi
movl $0x28, %edx
movq 0x8(%rsp), %rdi
callq 0xe8ded
movq 0x10(%rsp), %r13
movq 0x18(%rsp), %r12
movq %r14, %rbp
jmp 0xc0b06
movq %r14, %rbp
movq 0x20(%r14), %rsi
movl $0x28, %edx
movq 0x30(%rsp), %rdi
callq 0xe8ded
movq 0x10(%rsp), %r13
addq $0x4, (%rsp)
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
movq %rbx, %rdi
movq 0x40(%rsp), %rsi
callq 0xf00aa
movq %rbx, %rdi
movq %rbp, %rsi
callq 0xf00aa
incq %r15
addq $0x9, %r12
cmpq %r15, 0x38(%rsp)
jne 0xc0964
movl 0x2c(%rsp), %esi
movq %rbx, %rdi
callq 0xe9595
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq