// File: /workspace/github_c_makefile_star2_O1/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
movq 0xa0(%rsp), %r12
movq $0x0, (%rsi)
xorl %eax, %eax
cmpl $0x1f, %r8d
ja 0x8b095
movl %r8d, %ecx
leaq 0xa1d41(%rip), %rdx     # 0x12cdb4
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movq %rbx, %rdi
movq %rsi, %rbx
movq %r15, %rsi
movq %rbp, %rdx
movq %r13, %rcx
movq %r14, %r8
movq %r12, %r9
pushq $0x1
jmp 0x8b105
addl $-0x40, %r8d
cmpl $0x8, %r8d
ja 0x8b67d
leaq 0xa1d8a(%rip), %rcx     # 0x12ce34
movslq (%rcx,%r8,4), %rdx
addq %rcx, %rdx
jmpq *%rdx
movq %rbx, %rdi
callq 0xf6870
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 0x8ae5f
addq $0x10, %rsp
movq %r13, %rdi
callq 0xf6bb0
jmp 0x8b678
movq %rbx, %rdi
movq %rsi, %rbx
movq %r15, %rsi
movq %rbp, %rdx
movq %r13, %rcx
movq %r14, %r8
movq %r12, %r9
pushq $0x0
pushq $0x4
callq 0x8b700
addq $0x10, %rsp
movq $0x4, (%rbx)
jmp 0x8b678
movq %rbx, %rdi
movq %rsi, %rbx
movq %r15, %rsi
movq %rbp, %rdx
movq %r13, %rcx
movq %r14, %r8
movq %r12, %r9
pushq $0x0
jmp 0x8b1d0
movq (%r15), %rdi
movq %rsi, %r15
movq %r12, %rsi
movl $0x1, %edx
callq 0xef9cf
leaq 0xa24dc(%rip), %rsi     # 0x12d62e
movq %rbx, %rdi
movq %r14, %rdx
movb $0x1, %al
callq 0xe9226
movq $0x8, (%r15)
jmp 0x8b678
movq %rbx, %rdi
movq %rsi, %rbx
movq %r15, %rsi
movq %rbp, %rdx
movq %r13, %rcx
movq %r14, %r8
movq %r12, %r9
pushq $0x0
pushq $0x1
jmp 0x8b203
movq (%r15), %rdi
movq %rsi, %r15
movq %r12, %rsi
movl $0x1, %edx
callq 0xef935
leaq 0xa248e(%rip), %rsi     # 0x12d62e
movq %rbx, %rdi
movq %r14, %rdx
movb $0x1, %al
callq 0xe9226
movq $0x4, (%r15)
jmp 0x8b678
movq %rbx, %rdi
movq %rsi, %rbx
movq %r15, %rsi
movq %rbp, %rdx
movq %r13, %rcx
movq %r14, %r8
movq %r12, %r9
pushq $0x1
pushq $0x2
callq 0x8b700
addq $0x10, %rsp
movq $0x2, (%rbx)
jmp 0x8b678
movl $0x1, %eax
movq %rbx, %rdi
movq %rsi, %rbx
movq %r15, %rsi
movq %rbp, %rdx
movq %r13, %rcx
movq %r14, %r8
movq %r12, %r9
pushq %rax
pushq %rax
callq 0x8b700
addq $0x10, %rsp
movq $0x1, (%rbx)
jmp 0x8b678
movq %rbx, %rdi
movq %rsi, %rbx
movq %r15, %rsi
movq %rbp, %rdx
movq %r13, %rcx
movq %r14, %r8
movq %r12, %r9
pushq $0x1
jmp 0x8b2e1
movq %rbx, %rdi
callq 0xf6870
movq %rax, %r13
movq (%r15), %rdi
movq %r12, %rsi
callq 0xef417
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 0xf0203
addq $0x10, %rsp
movq %r13, %rdi
callq 0xf74bd
leaq 0xa0ba8(%rip), %rsi     # 0x12be42
movq %rbx, %rdi
movq %r14, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0xe9226
movq %r13, %rdi
callq 0xf6bb0
leaq 0x4(,%rbp,2), %rax
movq 0xa8(%rsp), %rcx
movq %rax, (%rcx)
jmp 0x8b678
movq %rbx, %rdi
movq %rsi, %rbx
movq %r15, %rsi
movq %rbp, %rdx
movq %r13, %rcx
movq %r14, %r8
movq %r12, %r9
pushq $0x0
pushq $0x8
callq 0x8b700
addq $0x10, %rsp
movq $0x8, (%rbx)
jmp 0x8b678
movq %rsi, %rbp
leaq 0x20(%rsp), %r13
movq %r12, (%r13)
movq (%r15), %rdi
movq %r13, %rsi
callq 0xef3a0
movq %rax, %r12
leaq 0xa237d(%rip), %rsi     # 0x12d696
movq %rbx, %rdi
movq %r14, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0xe9226
movq (%r13), %r14
leaq (%r14,%r12), %rax
movq (%r15), %rcx
cmpq 0x18(%rcx), %rax
jg 0x8b678
movq %r12, %rdi
callq 0xea7de
addq $0x4, %rax
movq %rax, (%rbp)
cmpq $0x8, %r12
jl 0x8b55e
movq (%r15), %rdi
leaq 0x10(%rsp), %r13
movl $0x8, %ecx
movq %r13, %rsi
movq %r14, %rdx
callq 0xeeee8
cmpb $-0x1, (%r13)
jne 0x8b55e
cmpb $-0x28, 0x11(%rsp)
jne 0x8b55e
cmpb $-0x1, 0x12(%rsp)
jne 0x8b55e
movq (%r15), %rdi
leaq 0xa230d(%rip), %rcx     # 0x12d6a8
movq %r14, %rsi
movq %r12, %rdx
jmp 0x8b54b
movq %rsi, %rbp
movq (%r15), %rdi
movq %r12, %rsi
callq 0xef37e
movq %rax, %r14
leaq 0xa229f(%rip), %rsi     # 0x12d65d
movq %rbx, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0xe9226
movq (%r15), %rdi
leaq 0x8(%r12), %rsi
callq 0xef37e
movq %rax, %r13
cmpl $0x54434950, %r13d      # imm = 0x54434950
jne 0x8b4cd
leaq 0xab111(%rip), %rcx     # 0x136500
jmp 0x8b4d8
movq (%r15), %rdi
leaq 0x10(%rsp), %r15
movl $0x10, %ecx
movq %rsi, %r13
movq %r15, %rsi
movq %r12, %rdx
callq 0xeeee8
movq %r15, %rdi
callq 0xf8617
leaq 0x20(%rsp), %r12
movl $0x32, %ecx
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0xf8559
leaq 0xa221e(%rip), %rsi     # 0x12d654
movq %rbx, %rdi
movq %r14, %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0xe9226
movq $0x10, (%r13)
jmp 0x8b678
movq (%r15), %rdi
movq %r12, %rsi
callq 0xef536
movq %rax, %r15
movb $0x1, %al
cmpl $0xa, 0x8(%rbp)
jne 0x8b471
cmpl $0xa, (%r13)
setne %al
testq %r15, %r15
jle 0x8b587
testb %al, %al
je 0x8b5a3
leaq 0x10(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0xead1a
leaq 0x20(%rsp), %r13
movl $0x40, %edx
movq %r12, %rdi
movq %r13, %rsi
xorl %ecx, %ecx
callq 0xeb4f8
leaq 0x8b6cc(%rip), %rsi     # 0x116b81
movq %rbx, %rdi
movq %r14, %rdx
movq %r15, %rcx
movq %r13, %r8
xorl %eax, %eax
callq 0xe9226
jmp 0x8b669
movl %r13d, %edi
callq 0xf93cf
movq %rax, %rcx
leaq 0xa2196(%rip), %rsi     # 0x12d675
movq %rbx, %rdi
movl %r13d, %edx
xorl %eax, %eax
callq 0xe9226
leaq (%r14,%r12), %rax
addq $0x4, %rax
movq (%r15), %rcx
cmpq 0x18(%rcx), %rax
jg 0x8b678
leaq 0xc(%r12), %rcx
movq %rcx, (%rsp)
leaq -0x8(%r14), %rcx
movq %rcx, 0x8(%rsp)
movq %r14, %rdi
callq 0xea7de
movq %rax, (%rbp)
cmpl $0x8, %r13d
je 0x8b68c
cmpl $0x3, %r13d
jne 0x8b6b0
movq (%r15), %rdi
addq $0x14, %r12
addq $-0x10, %r14
leaq 0x90f22(%rip), %rcx     # 0x11c467
movq %r12, %rsi
movq %r14, %rdx
xorl %r8d, %r8d
movl $0x1, %r9d
callq 0xf0321
jmp 0x8b678
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 0xe975a
addq $0x10, %rsp
jmp 0x8b678
leaq 0x96b21(%rip), %rsi     # 0x1220af
movq %rbx, %rdi
movq %r14, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0xe9226
jmp 0x8b669
movabsq $-0x5d1c00e21dfa7e1d, %rcx # imm = 0xA2E3FF1DE20581E3
movq %r15, %rax
mulq %rcx
movq %rdx, %r8
shrq $0x27, %r8
movabsq $0xc92a69c000, %rcx     # imm = 0xC92A69C000
imulq %r8, %rcx
movq %r15, %rax
subq %rcx, %rax
movabsq $0x3d157fab35, %rcx     # imm = 0x3D157FAB35
mulq %rcx
movq %rdx, %r9
movabsq $0x3d157fab34c210b5, %rcx # imm = 0x3D157FAB34C210B5
movq %r15, %rax
mulq %rcx
shrq $0x21, %rdx
movabsq $0x861c46800, %rcx      # imm = 0x861C46800
imulq %rdx, %rcx
movq %r15, %rax
subq %rcx, %rax
movabsq $0xe5109ec21, %rcx      # imm = 0xE5109EC21
mulq %rcx
movq %rdx, %r10
shrl $0x9, %r9d
shrl %r10d
movabsq $-0x1aef613dfa284159, %rcx # imm = 0xE5109EC205D7BEA7
movq %r15, %rax
mulq %rcx
shrq $0x1d, %rdx
imull $0x23c34600, %edx, %eax # imm = 0x23C34600
movl %r15d, %ecx
subl %eax, %ecx
cvtsi2sd %ecx, %xmm0
divsd 0x86a88(%rip), %xmm0    # 0x1120d0
subq $0x8, %rsp
leaq 0xa1fe2(%rip), %rsi     # 0x12d635
movq %rbx, %rdi
movq %r14, %rdx
movq %r15, %rcx
movb $0x1, %al
pushq %r10
callq 0xe9226
addq $0x10, %rsp
movq 0xa8(%rsp), %rax
movq $0x8, (%rax)
movl $0x1, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%r15), %rcx
leaq 0x97b99(%rip), %rsi     # 0x12322f
leaq 0xb7ebf(%rip), %rdx     # 0x14355c
movq %rbx, %rdi
movq (%rsp), %r8
movq 0x8(%rsp), %r9
callq 0xea66a
jmp 0x8b678
cmpl $0x54434950, %r13d      # imm = 0x54434950
jne 0x8b678
leaq 0x8a770(%rip), %rsi     # 0x115e30
movq %rbx, %rdi
xorl %edx, %edx
movl $0x1, %ecx
callq 0xf037a
movq %rax, %rbx
movl $0x200, %esi            # imm = 0x200
movq %rax, %rdi
callq 0xf1346
movq (%r15), %rdi
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %rbx, %rcx
callq 0xefabc
movq %rbx, %rdi
callq 0xf0b13
jmp 0x8b678