// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/ole1.c
// Function: de_run_ole1
static void de_run_ole1(deark *c, de_module_params *mparams)
{
	lctx *d = NULL;
	i64 bytes_consumed = 0;
	int u_flag;

	if(mparams) {
		mparams->out_params.flags = 0;
	}

	d = de_malloc(c, sizeof(lctx));

	d->input_encoding = de_get_input_encoding(c, mparams, DE_ENCODING_WINDOWS1252);
	// Use the "U" code if the exact size of the object is unknown. This will
	// improve the debug messages.
	u_flag = de_havemodcode(c, mparams, 'U');
	d->extract_all = de_get_ext_option_bool(c, "ole1:extractall",
		((c->extract_level>=2)?1:0));

	(void)do_ole_object(c, d, 0, c->infile->len, (u_flag?0:1),
		0, &bytes_consumed);
	calc_ole_obj_size(c, d);
	if(d->calculated_size>0 && d->calculated_size<=c->infile->len) {
		if(mparams) {
			mparams->out_params.flags |= 0x1;
			mparams->out_params.int64_1 = d->calculated_size;
		}
		de_dbg3(c, "ole1: calculated size=%"I64_FMT, d->calculated_size);
	}
	else {
		de_dbg3(c, "ole1: failed to calculate object size");
	}

	de_free(c, d);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r15
movq %rdi, %rbx
testq %rsi, %rsi
je 0x96f84
andl $0x0, 0x40(%r15)
pushq $0x18
popq %rsi
movq %rbx, %rdi
callq 0xdecaf
movq %rax, %r14
pushq $0x9
popq %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0xe08d2
movl %eax, (%r14)
pushq $0x55
popq %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0xdfcf4
movl %eax, %ebp
xorl %edx, %edx
cmpl $0x2, 0x90(%rbx)
setge %dl
leaq 0x8d7a5(%rip), %rsi     # 0x12476b
movq %rbx, %rdi
callq 0xdfae5
movl %eax, 0x4(%r14)
movq 0x18(%rbx), %rax
movq 0x18(%rax), %rcx
xorl %r8d, %r8d
testl %ebp, %ebp
sete %r8b
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
xorl %r9d, %r9d
callq 0x97125
leaq 0x8(%r14), %rbp
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%r14)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x981ed
testl %eax, %eax
je 0x97035
movq %r14, %r12
addq $0x10, %r12
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xe40bf
movq %rax, %r13
addl $-0x4, %eax
cmpl $-0x3, %eax
jae 0x9703e
movq (%rbp), %rdx
jmp 0x970cb
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xe40bf
addq (%r12), %rax
movq %rax, (%r12)
cmpl $0x3, %r13d
jne 0x97072
addq $0x8, %rax
movq %rax, (%r12)
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xe40bf
addq %rax, (%r12)
jmp 0x970c3
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xe40bf
addq %rax, (%r12)
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xe40bf
addq %rax, (%r12)
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xe40bf
addq (%r12), %rax
cmpl $0x2, %r13d
je 0x970ac
addq $0x8, %rax
movq %rax, 0x10(%r14)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9820c
testl %eax, %eax
je 0x97035
movq (%r12), %rdx
movq %rdx, (%rbp)
testq %rdx, %rdx
jle 0x970da
movq 0x18(%rbx), %rax
cmpq 0x18(%rax), %rdx
jle 0x970ed
leaq 0x8d6b4(%rip), %rsi     # 0x124795
movq %rbx, %rdi
xorl %eax, %eax
callq 0xdea83
jmp 0x9710c
testq %r15, %r15
je 0x970fb
orb $0x1, 0x40(%r15)
movq %rdx, 0x58(%r15)
leaq 0x8d679(%rip), %rsi     # 0x12477b
movq %rbx, %rdi
xorl %eax, %eax
callq 0xdea83
movq %rbx, %rdi
movq %r14, %rsi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xded32