// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/olepropset.c
// Function: do_prop_simple_type
static int do_prop_simple_type(deark *c, lctx *d, struct propset_struct *si,
	struct prop_info_struct *pinfo, u32 scalar_type, const char *name,
	i64 pos, i64 *bytes_consumed)
{
	double dval;

	*bytes_consumed = 0;

	switch(scalar_type) {
	case 0x00: // VT_EMPTY
	case 0x01: // VT_NULL
		break;

	case 0x11: // VT_UI1 = uint8
		do_prop_any_int(c, d, si, pinfo, name, pos, 1, 0);
		*bytes_consumed = 1;
		break;
	case 0x12: // VT_UI2 = uint16
	case 0x0b: // VT_BOOL (VARIANT_BOOL)
		do_prop_any_int(c, d, si, pinfo, name, pos, 2, 0);
		*bytes_consumed = 2;
		break;
	case 0x13: // VT_UI4 = uint32
	case 0x17: // VT_UINT
		do_prop_any_int(c, d, si, pinfo, name, pos, 4, 0);
		*bytes_consumed = 4;
		break;
	case 0x15: // VT_UI8
		do_prop_any_int(c, d, si, pinfo, name, pos, 8, 0);
		*bytes_consumed = 8;
		break;

	case 0x10: // VT_I1
		do_prop_any_int(c, d, si, pinfo, name, pos, 1, 1);
		*bytes_consumed = 1;
		break;
	case 0x02: // VT_I2 = int16
		do_prop_any_int(c, d, si, pinfo, name, pos, 2, 1);
		*bytes_consumed = 2;
		break;
	case 0x03: // VT_I4 = int32
	case 0x16: // VT_INT
		do_prop_any_int(c, d, si, pinfo, name, pos, 4, 1);
		*bytes_consumed = 4;
		break;
	case 0x14: // VT_I8
		do_prop_any_int(c, d, si, pinfo, name, pos, 8, 1);
		*bytes_consumed = 8;
		break;

	case 0x04: // VT_R4 = float32
		dval = dbuf_getfloat32x(d->f, pos, 1);
		de_dbg(c, "%s: %f", name, dval);
		*bytes_consumed = 4;
		break;
	case 0x05: // VT_R8 = float64
		dval = dbuf_getfloat64x(d->f, pos, 1);
		de_dbg(c, "%s: %f", name, dval);
		*bytes_consumed = 8;
		break;
	case 0x07: // VT_DATE
		do_prop_DATE(c, d, si, pinfo, name, pos);
		*bytes_consumed = 8;
		break;

	case 0x40:
		do_prop_FILETIME(c, d, si, pinfo, name, pos);
		*bytes_consumed = 8;
		break;

	case 0x48: // VT_CLSID
		do_prop_CLSID(c, d, si, pinfo, name, pos);
		*bytes_consumed = 16;
		break;

	case 0x08: // VT_BSTR
	case 0x1e: // VT_LPSTR
	case 0x42: // VT_STREAM
	case 0x43: // VT_STORAGE
	case 0x44: // VT_STREAMED_OBJECT
	case 0x45: // VT_STORED_OBJECT
		do_prop_CodePageString(c, d, si, name, pos, 0, bytes_consumed);
		break;

	case 0x1f: // Unicodestring
		do_prop_UnicodeString(c, d, si, name, pos, bytes_consumed);
		break;

	case 0x47:
		do_prop_clipboard(c, d, si, pinfo, pos, bytes_consumed);
		break;

	case 0x41:
		do_prop_blob(c, d, si, pinfo, name, pos, bytes_consumed);
		break;

	default:
		return 0;
	}

	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %r9, %r14
movq %rcx, %r13
movq %rdx, %rbp
movq %rsi, %r15
movq %rdi, %rbx
movq 0xa8(%rsp), %rsi
andq $0x0, (%rsi)
movq 0xa0(%rsp), %r12
xorl %eax, %eax
pushq $0x1
popq %r10
cmpl $0x1f, %r8d
ja 0x85845
movl %r8d, %ecx
leaq 0x9a606(%rip), %rdx     # 0x11fe2c
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movq %rbx, %rdi
movq %r15, %rsi
movq %rbp, %rdx
movq %r13, %rcx
movq %r14, %r8
movq %r12, %r9
pushq $0x1
jmp 0x858b4
addl $-0x40, %r8d
cmpl $0x8, %r8d
ja 0x85d15
leaq 0x9a652(%rip), %rcx     # 0x11feac
movslq (%rcx,%r8,4), %rdx
addq %rcx, %rdx
jmpq *%rdx
movq %rbx, %rdi
callq 0xeac74
movq %rax, %r13
movq %rbx, %rdi
movq %r15, %rsi
movq %rbp, %rdx
movq %r14, %rcx
movq %r12, %r8
xorl %r9d, %r9d
pushq %rax
pushq 0xb0(%rsp)
callq 0x8561d
popq %rax
popq %rcx
movq %r13, %rdi
callq 0xeaf3c
pushq $0x1
popq %r10
jmp 0x85d12
movq %rbx, %rdi
movq %r15, %rsi
movq %rbp, %rdx
movq %r13, %rcx
movq %r14, %r8
movq %r12, %r9
pushq $0x0
pushq $0x4
movq %r10, %rbx
callq 0x85e97
movq %rbx, %r10
addq $0x10, %rsp
movq 0xa8(%rsp), %rax
movq $0x4, (%rax)
jmp 0x85d12
movq %rbx, %rdi
movq %r15, %rsi
movq %rbp, %rdx
movq %r13, %rcx
movq %r14, %r8
movq %r12, %r9
pushq $0x0
jmp 0x85991
movq (%r15), %rdi
pushq $0x1
popq %rdx
movq %rsi, %r13
movq %r12, %rsi
movq %r10, %r15
callq 0xe451a
leaq 0x9ad99(%rip), %rsi     # 0x1206a6
movq %rbx, %rdi
movq %r14, %rdx
movb $0x1, %al
callq 0xde896
movq %r15, %r10
movq $0x8, (%r13)
jmp 0x85d12
movq %rbx, %rdi
movq %r15, %rsi
movq %rbp, %rdx
movq %r13, %rcx
movq %r14, %r8
movq %r12, %r9
pushq $0x0
pushq $0x1
jmp 0x859cc
movq (%r15), %rdi
pushq $0x1
popq %rdx
movq %rsi, %r13
movq %r12, %rsi
movq %r10, %r15
callq 0xe4470
leaq 0x9ad46(%rip), %rsi     # 0x1206a6
movq %rbx, %rdi
movq %r14, %rdx
movb $0x1, %al
callq 0xde896
movq %r15, %r10
movq $0x4, (%r13)
jmp 0x85d12
movq %rbx, %rdi
movq %r15, %rsi
movq %rbp, %rdx
movq %r13, %rcx
movq %r14, %r8
movq %r12, %r9
pushq $0x1
pushq $0x2
movq %r10, %rbx
callq 0x85e97
movq %rbx, %r10
addq $0x10, %rsp
movq 0xa8(%rsp), %rax
movq $0x2, (%rax)
jmp 0x85d12
movq %rbx, %rdi
movq %r15, %rsi
movq %rbp, %rdx
movq %r13, %rcx
movq %r14, %r8
movq %r12, %r9
pushq %r10
pushq %r10
movq %r10, %rbx
callq 0x85e97
movq %rbx, %r10
addq $0x10, %rsp
movq 0xa8(%rsp), %rax
movq $0x1, (%rax)
jmp 0x85d12
movq %rbx, %rdi
movq %r15, %rsi
movq %rbp, %rdx
movq %r13, %rcx
movq %r14, %r8
movq %r12, %r9
pushq $0x1
jmp 0x85ab4
movq %rbx, %rdi
callq 0xeac74
movq %rax, %r13
movq (%r15), %rdi
movq %r12, %rsi
callq 0xe40f2
movq %rax, %rbp
xorl %eax, %eax
testq %rbp, %rbp
setg %al
movq %rbp, %rdx
subq %rax, %rdx
xorl %eax, %eax
testq %rdx, %rdx
cmovleq %rax, %rdx
movq (%r15), %rdi
addq $0x4, %r12
addq %rdx, %rdx
subq $0x8, %rsp
movl $0x3e8, %ecx            # imm = 0x3E8
movq %r12, %rsi
movq %r13, %r8
xorl %r9d, %r9d
pushq $0x3
callq 0xe4ced
popq %rax
popq %rcx
movq %r13, %rdi
callq 0xeb7e4
leaq 0x9944e(%rip), %rsi     # 0x11eeba
movq %rbx, %rdi
movq %r14, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0xde896
movq %r13, %rdi
callq 0xeaf3c
pushq $0x1
popq %r10
leaq 0x4(,%rbp,2), %rax
movq 0xa8(%rsp), %rcx
movq %rax, (%rcx)
jmp 0x85d12
movq %rbx, %rdi
movq %r15, %rsi
movq %rbp, %rdx
movq %r13, %rcx
movq %r14, %r8
movq %r12, %r9
pushq $0x0
pushq $0x8
movq %r10, %rbx
callq 0x85e97
movq %rbx, %r10
addq $0x10, %rsp
movq 0xa8(%rsp), %rax
movq $0x8, (%rax)
jmp 0x85d12
movq %rsi, %rbp
leaq 0x20(%rsp), %r13
movq %r12, (%r13)
movq (%r15), %rdi
movq %r13, %rsi
callq 0xe40bf
movq %rax, %r12
leaq 0x9ac14(%rip), %rsi     # 0x12070e
movq %rbx, %rdi
movq %r14, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0xde896
movq (%r13), %r14
leaq (%r14,%r12), %rax
movq (%r15), %rcx
cmpq 0x18(%rcx), %rax
jg 0x85897
movq %r12, %rdi
callq 0xdfb90
addq $0x4, %rax
movq %rax, (%rbp)
cmpq $0x8, %r12
jl 0x85dc8
movq (%r15), %rdi
leaq 0x10(%rsp), %r13
pushq $0x8
popq %rcx
movq %r13, %rsi
movq %r14, %rdx
callq 0xe3cb7
cmpb $-0x1, (%r13)
jne 0x85dc8
cmpb $-0x28, 0x11(%rsp)
jne 0x85dc8
cmpb $-0x1, 0x12(%rsp)
jne 0x85dc8
movq (%r15), %rdi
leaq 0x9aba6(%rip), %rcx     # 0x120720
pushq $0x1
popq %r9
movq %r14, %rsi
movq %r12, %rdx
jmp 0x85d72
movq %rsi, %rbp
movq (%r15), %rdi
movq %r12, %rsi
callq 0xe409f
movq %rax, %r14
leaq 0x9ab34(%rip), %rsi     # 0x1206d5
movq %rbx, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0xde896
movq (%r15), %rdi
leaq 0x8(%r12), %rsi
callq 0xe409f
movq %rax, %r13
cmpl $0x54434950, %r13d      # imm = 0x54434950
jne 0x85cde
leaq 0xa39f8(%rip), %rcx     # 0x1295ca
jmp 0x85ce9
movq (%r15), %rdi
leaq 0x10(%rsp), %r15
pushq $0x10
popq %rcx
movq %rsi, %rbp
movq %r15, %rsi
movq %r12, %rdx
movq %r10, %r13
callq 0xe3cb7
movq %r15, %rdi
callq 0xec883
leaq 0x20(%rsp), %r12
pushq $0x32
popq %rcx
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0xec7c5
leaq 0x9aab4(%rip), %rsi     # 0x1206cc
movq %rbx, %rdi
movq %r14, %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0xde896
movq %r13, %r10
movq $0x10, (%rbp)
jmp 0x85d12
movq (%r15), %rdi
movq %r12, %rsi
callq 0xe418b
movq %rax, %r15
cmpl $0xa, 0x8(%rbp)
jne 0x85d7f
testq %r15, %r15
jle 0x85def
cmpl $0xa, (%r13)
jne 0x85d84
movabsq $0xc92a69c000, %rcx     # imm = 0xC92A69C000
movq %r15, %rax
xorl %edx, %edx
divq %rcx
movq %rax, %r8
movq %rdx, %rax
movabsq $0x861c46800, %rcx      # imm = 0x861C46800
xorl %edx, %edx
divq %rcx
movq %rax, %r9
movq %r15, %rax
xorl %edx, %edx
divq %rcx
movq %rdx, %rax
movl $0x23c34600, %ecx       # imm = 0x23C34600
xorl %edx, %edx
divq %rcx
movq %rax, %r10
movq %r15, %rax
xorl %edx, %edx
divq %rcx
cvtsi2sd %edx, %xmm0
divsd 0x7f406(%rip), %xmm0    # 0x1050c0
subq $0x8, %rsp
leaq 0x9a9e8(%rip), %rsi     # 0x1206ad
movq %rbx, %rdi
movq %r14, %rdx
movq %r15, %rcx
movb $0x1, %al
pushq %r10
callq 0xde896
popq %rax
popq %rcx
jmp 0x85e06
movl %r13d, %edi
callq 0xed57e
movq %rax, %rcx
leaq 0x9a9fd(%rip), %rsi     # 0x1206ed
movq %rbx, %rdi
movl %r13d, %edx
xorl %eax, %eax
callq 0xde896
leaq (%r14,%r12), %rax
addq $0x4, %rax
movq (%r15), %rcx
cmpq 0x18(%rcx), %rax
pushq $0x1
popq %r10
jle 0x85d24
movl %r10d, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xc(%r12), %rcx
movq %rcx, (%rsp)
leaq -0x8(%r14), %rcx
movq %rcx, 0x8(%rsp)
movq %r14, %rdi
callq 0xdfb90
movq %rax, (%rbp)
cmpl $0x8, %r13d
je 0x85e1a
cmpl $0x3, %r13d
jne 0x85e41
movq (%r15), %rdi
addq $0x14, %r12
addq $-0x10, %r14
leaq 0x8971f(%rip), %rcx     # 0x10f487
pushq $0x1
popq %r9
movq %r12, %rsi
movq %r14, %rdx
xorl %r8d, %r8d
callq 0xe4e0b
jmp 0x85897
testq %r15, %r15
jle 0x85def
leaq 0x10(%rsp), %r12
pushq $0x1
popq %rdx
movq %r15, %rdi
movq %r12, %rsi
callq 0xe0051
leaq 0x20(%rsp), %r13
pushq $0x40
popq %rdx
movq %r12, %rdi
movq %r13, %rsi
xorl %ecx, %ecx
callq 0xe0644
leaq 0x83dee(%rip), %rsi     # 0x109ba1
movq %rbx, %rdi
movq %r14, %rdx
movq %r15, %rcx
movq %r13, %r8
xorl %eax, %eax
callq 0xde896
jmp 0x85e06
movq (%r15), %rsi
subq $0x8, %rsp
movl $0x100, %r8d            # imm = 0x100
movq %rbx, %rdi
movq %r14, %rdx
movq %r12, %rcx
xorl %r9d, %r9d
pushq $0x1
callq 0xded3a
popq %rax
popq %rcx
jmp 0x85897
leaq 0x8f301(%rip), %rsi     # 0x1150f7
movq %rbx, %rdi
movq %r14, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0xde896
movq 0xa8(%rsp), %rax
movq $0x8, (%rax)
jmp 0x85897
movq (%r15), %rcx
leaq 0x9042b(%rip), %rsi     # 0x11624f
leaq 0xb07c1(%rip), %rdx     # 0x1365ec
movq %rbx, %rdi
movq (%rsp), %r8
movq 0x8(%rsp), %r9
callq 0xdfa28
jmp 0x85897
cmpl $0x54434950, %r13d      # imm = 0x54434950
pushq $0x1
popq %r10
jne 0x85d12
leaq 0x82ff7(%rip), %rsi     # 0x108e50
pushq $0x1
popq %rcx
movq %rbx, %rdi
xorl %edx, %edx
callq 0xe4e62
movq %rax, %rbx
movl $0x200, %esi            # imm = 0x200
movq %rax, %rdi
callq 0xe5d20
movq (%r15), %rdi
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %rbx, %rcx
callq 0xe45f4
movq %rbx, %rdi
callq 0xe5591
jmp 0x85897