// File: /workspace/github_c_makefile_star2_O3/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, %r12
movq %rdi, %rbx
movq 0xa8(%rsp), %rsi
movq 0xa0(%rsp), %r15
movq $0x0, (%rsi)
xorl %eax, %eax
cmpl $0x1f, %r8d
ja 0x8a8ea
movl %r8d, %ecx
leaq 0xa27d2(%rip), %rdx     # 0x12d09c
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movq (%r12), %rsi
movq %rbx, %rdi
movq %rbp, %rdx
movq %r13, %rcx
movq %r14, %r8
movq %r15, %r9
pushq $0x1
jmp 0x8a95e
addl $-0x40, %r8d
cmpl $0x8, %r8d
ja 0x8af61
leaq 0xa281d(%rip), %rcx     # 0x12d11c
movslq (%rcx,%r8,4), %rdx
addq %rcx, %rdx
jmpq *%rdx
movq %rbx, %rdi
callq 0xf6410
movq %rax, %r13
movl 0xc(%rbp), %edx
movl 0x10(%rbp), %ecx
subq $0x8, %rsp
movq %rbx, %rdi
movq %r12, %rsi
movq %r14, %r8
movq %r15, %r9
pushq %rax
pushq 0xb8(%rsp)
pushq $0x0
callq 0x8a6b8
addq $0x20, %rsp
movq %r13, %rdi
callq 0xf6753
jmp 0x8af5c
movq (%r12), %rsi
movq %rbx, %rdi
movq %rbp, %rdx
movq %r13, %rcx
movq %r14, %r8
movq %r15, %r9
pushq $0x0
pushq $0x4
callq 0x8af70
addq $0x10, %rsp
movq 0xa8(%rsp), %rax
movq $0x4, (%rax)
jmp 0x8af5c
movq (%r12), %rsi
movq %rbx, %rdi
movq %rbp, %rdx
movq %r13, %rcx
movq %r14, %r8
movq %r15, %r9
pushq $0x0
jmp 0x8aa32
movq (%r12), %rdi
movq %rsi, %r12
movq %r15, %rsi
movl $0x1, %edx
callq 0xef39e
leaq 0xa2f64(%rip), %rsi     # 0x12d916
movq %rbx, %rdi
movq %r14, %rdx
movb $0x1, %al
callq 0xe8617
movq $0x8, (%r12)
jmp 0x8af5c
movq (%r12), %rsi
movq %rbx, %rdi
movq %rbp, %rdx
movq %r13, %rcx
movq %r14, %r8
movq %r15, %r9
pushq $0x0
pushq $0x1
jmp 0x8aa6b
movq (%r12), %rdi
movq %rsi, %r12
movq %r15, %rsi
movl $0x1, %edx
callq 0xef2fc
leaq 0xa2f13(%rip), %rsi     # 0x12d916
movq %rbx, %rdi
movq %r14, %rdx
movb $0x1, %al
callq 0xe8617
movq $0x4, (%r12)
jmp 0x8af5c
movq (%r12), %rsi
movq %rbx, %rdi
movq %rbp, %rdx
movq %r13, %rcx
movq %r14, %r8
movq %r15, %r9
pushq $0x1
pushq $0x2
callq 0x8af70
addq $0x10, %rsp
movq 0xa8(%rsp), %rax
movq $0x2, (%rax)
jmp 0x8af5c
movq (%r12), %rsi
movl $0x1, %eax
movq %rbx, %rdi
movq %rbp, %rdx
movq %r13, %rcx
movq %r14, %r8
movq %r15, %r9
pushq %rax
pushq %rax
callq 0x8af70
addq $0x10, %rsp
movq 0xa8(%rsp), %rax
movq $0x1, (%rax)
jmp 0x8af5c
movq (%r12), %rsi
movq %rbx, %rdi
movq %rbp, %rdx
movq %r13, %rcx
movq %r14, %r8
movq %r15, %r9
pushq $0x1
jmp 0x8ab4f
movq %rbx, %rdi
callq 0xf6410
movq %rax, %r13
movq (%r12), %rdi
movq %r15, %rsi
callq 0xeedfa
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 (%r12), %rdi
addq $0x4, %r15
addq %rdx, %rdx
subq $0x8, %rsp
movl $0x3e8, %ecx            # imm = 0x3E8
movq %r15, %rsi
movq %r13, %r8
xorl %r9d, %r9d
pushq $0x3
callq 0xefc2a
addq $0x10, %rsp
movq %r13, %rdi
callq 0xf705c
leaq 0xa1620(%rip), %rsi     # 0x12c12a
movq %rbx, %rdi
movq %r14, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0xe8617
movq %r13, %rdi
callq 0xf6753
leaq 0x4(,%rbp,2), %rax
movq 0xa8(%rsp), %rcx
movq %rax, (%rcx)
jmp 0x8af5c
movq (%r12), %rsi
movq %rbx, %rdi
movq %rbp, %rdx
movq %r13, %rcx
movq %r14, %r8
movq %r15, %r9
pushq $0x0
pushq $0x8
callq 0x8af70
addq $0x10, %rsp
movq 0xa8(%rsp), %rax
movq $0x8, (%rax)
jmp 0x8af5c
movq %rsi, %rbp
leaq 0x20(%rsp), %r13
movq %r15, (%r13)
movq (%r12), %rdi
movq %r13, %rsi
callq 0xeed83
movq %rax, %r15
leaq 0xa2dee(%rip), %rsi     # 0x12d97e
movq %rbx, %rdi
movq %r14, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0xe8617
movq (%r13), %r14
leaq (%r14,%r15), %rax
movq (%r12), %rcx
cmpq 0x18(%rcx), %rax
jg 0x8af5c
movq %r15, %rdi
callq 0xe9c87
addq $0x4, %rax
movq %rax, (%rbp)
cmpq $0x8, %r15
jl 0x8aea5
movq (%r12), %rdi
leaq 0x10(%rsp), %r13
movl $0x8, %ecx
movq %r13, %rsi
movq %r14, %rdx
callq 0xee8d4
cmpb $-0x1, (%r13)
jne 0x8aea5
cmpb $-0x28, 0x11(%rsp)
jne 0x8aea5
cmpb $-0x1, 0x12(%rsp)
jne 0x8aea5
movq (%r12), %rdi
leaq 0xa2d7b(%rip), %rcx     # 0x12d990
movq %r14, %rsi
movq %r15, %rdx
jmp 0x8ae42
movq %rsi, %rbp
movq (%r12), %rdi
movq %r15, %rsi
callq 0xeed61
movq %rax, %r14
leaq 0xa2d0c(%rip), %rsi     # 0x12d945
movq %rbx, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0xe8617
movq (%r12), %rdi
leaq 0x8(%r15), %rsi
callq 0xeed61
movq %rax, %r13
cmpl $0x54434950, %r13d      # imm = 0x54434950
jne 0x8adc3
leaq 0xabc60(%rip), %rcx     # 0x1368ca
jmp 0x8adce
movq (%r12), %rdi
leaq 0x10(%rsp), %r12
movl $0x10, %ecx
movq %rsi, %r13
movq %r12, %rsi
movq %r15, %rdx
callq 0xee8d4
movq %r12, %rdi
callq 0xf814b
leaq 0x20(%rsp), %r15
movl $0x32, %ecx
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0xf808d
leaq 0xa2c8a(%rip), %rsi     # 0x12d93c
movq %rbx, %rdi
movq %r14, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0xe8617
movq $0x10, (%r13)
jmp 0x8af5c
movq (%r12), %rdi
movq %r15, %rsi
callq 0xeef09
movq %rax, %r15
cmpl $0xa, 0x8(%rbp)
jne 0x8ae55
testq %r15, %r15
jle 0x8aecf
cmpl $0xa, (%r13)
jne 0x8ae5a
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 0x8733f(%rip), %xmm0    # 0x1120e0
subq $0x8, %rsp
leaq 0xa2b71(%rip), %rsi     # 0x12d91d
movq %rbx, %rdi
movq %r14, %rdx
movq %r15, %rcx
movb $0x1, %al
pushq %r10
callq 0xe8617
jmp 0x8ab56
movl %r13d, %edi
callq 0xf8eb5
movq %rax, %rcx
leaq 0xa2b88(%rip), %rsi     # 0x12d95d
movq %rbx, %rdi
movl %r13d, %edx
xorl %eax, %eax
callq 0xe8617
leaq (%r14,%r15), %rax
addq $0x4, %rax
movq (%r12), %rcx
cmpq 0x18(%rcx), %rax
jg 0x8af5c
leaq 0xc(%r15), %rcx
movq %rcx, (%rsp)
leaq -0x8(%r14), %rcx
movq %rcx, 0x8(%rsp)
movq %r14, %rdi
callq 0xe9c87
movq %rax, (%rbp)
cmpl $0x8, %r13d
je 0x8aeeb
cmpl $0x3, %r13d
jne 0x8af10
movq (%r12), %rdi
addq $0x14, %r15
addq $-0x10, %r14
leaq 0x9173b(%rip), %rcx     # 0x11c577
movq %r15, %rsi
movq %r14, %rdx
xorl %r8d, %r8d
movl $0x1, %r9d
callq 0xefd48
jmp 0x8af5c
testq %r15, %r15
jle 0x8aecf
leaq 0x10(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0xea829
leaq 0x20(%rsp), %r13
movl $0x40, %edx
movq %r12, %rdi
movq %r13, %rsi
xorl %ecx, %ecx
callq 0xeaf46
leaq 0x8bda4(%rip), %rsi     # 0x116c31
movq %rbx, %rdi
movq %r14, %rdx
movq %r15, %rcx
movq %r13, %r8
xorl %eax, %eax
callq 0xe8617
jmp 0x8ab5a
movq (%r12), %rsi
subq $0x8, %rsp
movl $0x100, %r8d            # imm = 0x100
movq %rbx, %rdi
movq %r14, %rdx
movq %r15, %rcx
xorl %r9d, %r9d
pushq $0x1
callq 0xe8bea
addq $0x10, %rsp
jmp 0x8af5c
leaq 0x973e1(%rip), %rsi     # 0x1222b7
movq %rbx, %rdi
movq %r14, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0xe8617
jmp 0x8ab5a
movq (%r12), %rcx
leaq 0x98519(%rip), %rsi     # 0x12340f
leaq 0xb8b3f(%rip), %rdx     # 0x143a3c
movq %rbx, %rdi
movq (%rsp), %r8
movq 0x8(%rsp), %r9
callq 0xe9b13
jmp 0x8af5c
cmpl $0x54434950, %r13d      # imm = 0x54434950
jne 0x8af5c
leaq 0x8afc0(%rip), %rsi     # 0x115ee0
movq %rbx, %rdi
xorl %edx, %edx
movl $0x1, %ecx
callq 0xefda1
movq %rax, %rbx
movl $0x200, %esi            # imm = 0x200
movq %rax, %rdi
callq 0xf0d35
movq (%r12), %rdi
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %rbx, %rcx
callq 0xef481
movq %rbx, %rdi
callq 0xf052b
movl $0x1, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq