// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/olepropset.c
// Function: do_prop_vector_of_variant
static int do_prop_vector_of_variant(deark *c, lctx *d, struct propset_struct *si,
	struct prop_info_struct *pinfo)
{
	i64 k;
	i64 nitems;
	i64 pos = pinfo->dpos;
	int saved_indent_level;

	de_dbg_indent_save(c, &saved_indent_level);

	read_vectorheader(c, d, si, pinfo, &nitems);
	pos += 4;

	for(k=0; k<nitems; k++) {
		u32 data_type;
		i64 bytes_consumed = 0;
		int ok;
		char dtname[80];

		if(pos >= d->f->len) break;
		if(k>500) break;

		de_dbg(c, "item[%u]:", (unsigned int)k);
		de_dbg_indent(c, 1);

		data_type = (u32)dbuf_getu16le_p(d->f, &pos);
		de_dbg(c, "data type: 0x%04x (%s)", (unsigned int)data_type,
			get_prop_data_type_name(dtname, sizeof(dtname), data_type));
		pos += 2; // padding

		// TODO: Probably need a better way to detect errors here.
		// Unlike in a vector, bytes_consumed can legitimately be 0.
		ok = do_prop_simple_type(c, d, si, pinfo, data_type, "value", pos, &bytes_consumed);
		if(!ok) goto done;
		pos += bytes_consumed;

		de_dbg_indent(c, -1);
	}

done:
	de_dbg_indent_restore(c, saved_indent_level);
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x3c(%rbp), %rsi
callq 0x15b580
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
leaq -0x30(%rbp), %r8
callq 0xcc160
movq -0x38(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x38(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x30(%rbp), %rax
jge 0xcb76e
movq $0x0, -0x48(%rbp)
movq -0x38(%rbp), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
cmpq 0x18(%rcx), %rax
jl 0xcb66d
jmp 0xcb76e
cmpq $0x1f4, -0x28(%rbp)     # imm = 0x1F4
jle 0xcb67c
jmp 0xcb76e
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movl %eax, %edx
leaq 0xede6b(%rip), %rsi     # 0x1b94f8
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq -0x38(%rbp), %rsi
callq 0x1652c0
movl %eax, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xb0(%rbp)
movl -0x40(%rbp), %eax
movl %eax, -0xa4(%rbp)
leaq -0xa0(%rbp), %rdi
movl -0x40(%rbp), %edx
movl $0x50, %esi
callq 0xcb0c0
movq -0xb0(%rbp), %rdi
movl -0xa4(%rbp), %edx
movq %rax, %rcx
leaq 0xedcb4(%rip), %rsi     # 0x1b93a8
movb $0x0, %al
callq 0x15b0d0
movq -0x38(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movl -0x40(%rbp), %r8d
movq -0x38(%rbp), %r10
leaq 0xf3e32(%rip), %r9      # 0x1bf558
leaq -0x48(%rbp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0xcb1e0
movl %eax, -0x4c(%rbp)
cmpl $0x0, -0x4c(%rbp)
jne 0xcb743
jmp 0xcb770
movq -0x48(%rbp), %rax
addq -0x38(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0xcb641
jmp 0xcb770
movq -0x8(%rbp), %rdi
movl -0x3c(%rbp), %esi
callq 0x15b5a0
movl $0x1, %eax
addq $0xc0, %rsp
popq %rbp
retq
nopw (%rax,%rax)