// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/olepropset.c
// Function: do_prop_toplevel
static void do_prop_toplevel(deark *c, lctx *d, struct propset_struct *si,
	struct prop_info_struct *pinfo)
{
	char dtname[80];
	u32 scalar_type;
	int ok = 0;
	i64 bytes_consumed = 0;

	// TODO: There's some confusion about whether this is a 16-bit, or a 32-bit int.
	pinfo->data_type = (u32)dbuf_getu16le(d->f, si->tbloffset+pinfo->data_offs_rel);
	de_dbg(c, "data type: 0x%04x (%s)", (unsigned int)pinfo->data_type,
		get_prop_data_type_name(dtname, sizeof(dtname), pinfo->data_type));

	scalar_type = pinfo->data_type&0x00ff;

	if((pinfo->data_type&0xff00)==0x0000) {
		ok = do_prop_simple_type(c, d, si, pinfo, scalar_type,
			(pinfo->name_disposition==1)?pinfo->name:"value",
			pinfo->dpos, &bytes_consumed);
	}
	else if((pinfo->data_type&0xff00)==0x1000) {
		if(scalar_type==0x0c) {
			ok = do_prop_vector_of_variant(c, d, si, pinfo);
		}
		else {
			ok = do_prop_vector_of_scalar(c, d, si, pinfo, scalar_type);
		}
	}

	if(!ok) {
		de_dbg(c, "[data type 0x%04x not supported]", (unsigned int)pinfo->data_type);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl $0x0, -0x78(%rbp)
movq $0x0, -0x80(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
movq -0x20(%rbp), %rax
addq 0x8(%rax), %rsi
callq 0x165280
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x8(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x20(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x84(%rbp)
leaq -0x70(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x4(%rax), %edx
movl $0x50, %esi
callq 0xcb0c0
movq -0x90(%rbp), %rdi
movl -0x84(%rbp), %edx
movq %rax, %rcx
leaq 0xee5d6(%rip), %rsi     # 0x1b93a8
movb $0x0, %al
callq 0x15b0d0
movq -0x20(%rbp), %rax
movl 0x4(%rax), %eax
andl $0xff, %eax
movl %eax, -0x74(%rbp)
movq -0x20(%rbp), %rax
movl 0x4(%rax), %eax
andl $0xff00, %eax           # imm = 0xFF00
cmpl $0x0, %eax
jne 0xcaea6
movq -0x8(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0xa0(%rbp)
movl -0x74(%rbp), %eax
movl %eax, -0x94(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x1, 0x18(%rax)
jne 0xcae4d
movq -0x20(%rbp), %rax
addq $0x1c, %rax
movq %rax, -0xc0(%rbp)
jmp 0xcae5d
leaq 0xf4704(%rip), %rax     # 0x1bf558
movq %rax, -0xc0(%rbp)
jmp 0xcae5d
movl -0x94(%rbp), %r8d
movq -0xa0(%rbp), %rcx
movq -0xa8(%rbp), %rdx
movq -0xb0(%rbp), %rsi
movq -0xb8(%rbp), %rdi
movq -0xc0(%rbp), %r9
movq -0x20(%rbp), %rax
movq 0x10(%rax), %r10
leaq -0x80(%rbp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0xcb1e0
movl %eax, -0x78(%rbp)
jmp 0xcaef9
movq -0x20(%rbp), %rax
movl 0x4(%rax), %eax
andl $0xff00, %eax           # imm = 0xFF00
cmpl $0x1000, %eax           # imm = 0x1000
jne 0xcaef7
cmpl $0xc, -0x74(%rbp)
jne 0xcaed9
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
callq 0xcb5e0
movl %eax, -0x78(%rbp)
jmp 0xcaef5
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movl -0x74(%rbp), %r8d
callq 0xcb790
movl %eax, -0x78(%rbp)
jmp 0xcaef7
jmp 0xcaef9
cmpl $0x0, -0x78(%rbp)
jne 0xcaf18
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x4(%rax), %edx
leaq 0xee4ae(%rip), %rsi     # 0x1b93bf
movb $0x0, %al
callq 0x15b0d0
addq $0xd0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)