// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/pcf.c
// Function: read_one_property
static void read_one_property(deark *c, lctx *d, struct table_entry *te,
	i64 pos1, i64 prop_idx, i64 string_data_area_pos)
{
	i64 pos = pos1;
	u8 isstringprop;
	i64 name_offset;
	struct de_stringreaderdata *srd_name = NULL;
	struct de_stringreaderdata *srd_strval = NULL;

	de_dbg(c, "property[%d] index entry at %"I64_FMT, (int)prop_idx, pos);
	de_dbg_indent(c, 1);

	name_offset = dbuf_getu32x(c->infile, pos, te->fmt.is_le);
	de_dbg(c, "name offset: %"I64_FMT" (abs=%"I64_FMT")", name_offset,
		string_data_area_pos+name_offset);
	pos += 4;
	srd_name = read_prop_string(c, d, te, string_data_area_pos+name_offset, "name");

	isstringprop = de_getbyte_p(&pos);
	de_dbg(c, "isStringProp: %u", (unsigned int)isstringprop);

	if(isstringprop) {
		i64 value_offset;

		value_offset = dbuf_getu32x(c->infile, pos, te->fmt.is_le);
		de_dbg(c, "value offset: %"I64_FMT" (abs=%"I64_FMT")", value_offset,
			string_data_area_pos+value_offset);
		srd_strval = read_prop_string(c, d, te, string_data_area_pos+value_offset, "value");

		if(!de_strcmp(srd_name->sz_utf8, "CHARSET_REGISTRY")) {
			de_strlcpy(d->charset_registry, srd_strval->sz_utf8, sizeof(d->charset_registry));
		}
		else if(!de_strcmp(srd_name->sz_utf8, "CHARSET_ENCODING")) {
			de_strlcpy(d->charset_encoding, srd_strval->sz_utf8, sizeof(d->charset_encoding));
		}
	}
	else {
		i64 value;

		value = dbuf_geti32x(c->infile, pos, te->fmt.is_le);
		de_dbg(c, "value: %"I64_FMT, value);
	}
	pos += 4;

	de_dbg_indent(c, -1);
	de_destroy_stringreaderdata(c, srd_name);
	de_destroy_stringreaderdata(c, srd_strval);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x38(%rbp)
movq $0x0, -0x50(%rbp)
movq $0x0, -0x58(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movl %eax, %edx
movq -0x38(%rbp), %rcx
leaq 0xa88cd(%rip), %rsi     # 0x1c54aa
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x38(%rbp), %rsi
movq -0x18(%rbp), %rax
movl 0x10(%rax), %edx
callq 0x1658c0
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rdi
movq -0x48(%rbp), %rdx
movq -0x30(%rbp), %rcx
addq -0x48(%rbp), %rcx
leaq 0xa88a5(%rip), %rsi     # 0x1c54ca
movb $0x0, %al
callq 0x15b0d0
movq -0x38(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x30(%rbp), %rcx
addq -0x48(%rbp), %rcx
leaq 0x9739b(%rip), %r8      # 0x1b3fee
callq 0x11cdd0
movq %rax, -0x50(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x38(%rbp), %rsi
callq 0x165170
movb %al, -0x39(%rbp)
movq -0x8(%rbp), %rdi
movzbl -0x39(%rbp), %edx
leaq 0xa8866(%rip), %rsi     # 0x1c54e5
movb $0x0, %al
callq 0x15b0d0
cmpb $0x0, -0x39(%rbp)
je 0x11cd5d
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x38(%rbp), %rsi
movq -0x18(%rbp), %rax
movl 0x10(%rax), %edx
callq 0x1658c0
movq %rax, -0x60(%rbp)
movq -0x8(%rbp), %rdi
movq -0x60(%rbp), %rdx
movq -0x30(%rbp), %rcx
addq -0x60(%rbp), %rcx
leaq 0xa8833(%rip), %rsi     # 0x1c54f6
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x30(%rbp), %rcx
addq -0x60(%rbp), %rcx
leaq 0xa2873(%rip), %r8      # 0x1bf558
callq 0x11cdd0
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rax
movq 0x20(%rax), %rdi
leaq 0xa8815(%rip), %rsi     # 0x1c5512
callq 0x191a0
cmpl $0x0, %eax
jne 0x11cd23
movq -0x10(%rbp), %rdi
addq $0x58, %rdi
movq -0x58(%rbp), %rax
movq 0x20(%rax), %rsi
movl $0x28, %edx
callq 0x15aa30
jmp 0x11cd5b
movq -0x50(%rbp), %rax
movq 0x20(%rax), %rdi
leaq 0xa87f1(%rip), %rsi     # 0x1c5523
callq 0x191a0
cmpl $0x0, %eax
jne 0x11cd59
movq -0x10(%rbp), %rdi
addq $0x80, %rdi
movq -0x58(%rbp), %rax
movq 0x20(%rax), %rsi
movl $0x28, %edx
callq 0x15aa30
jmp 0x11cd5b
jmp 0x11cd8f
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x38(%rbp), %rsi
movq -0x18(%rbp), %rax
movl 0x10(%rax), %edx
callq 0x165910
movq %rax, -0x68(%rbp)
movq -0x8(%rbp), %rdi
movq -0x68(%rbp), %rdx
leaq 0x81abf(%rip), %rsi     # 0x19e847
movb $0x0, %al
callq 0x15b0d0
movq -0x38(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
movq -0x8(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0x166830
movq -0x8(%rbp), %rdi
movq -0x58(%rbp), %rsi
callq 0x166830
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax)