// File: /workspace/github_c_makefile_star2_O1/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
movq $0x0, 0x10(%rsp)
testq %rsi, %rsi
je 0x9d32b
movl $0x0, 0x40(%r15)
movl $0x18, %esi
movq %rbx, %rdi
callq 0xe969b
movq %rax, %r14
movq %rbx, %rdi
movq %r15, %rsi
movl $0x9, %edx
callq 0xeb7d1
movl %eax, (%r14)
movq %rbx, %rdi
movq %r15, %rsi
movl $0x55, %edx
callq 0xea97e
movl %eax, %ebp
xorl %edx, %edx
cmpl $0x2, 0x90(%rbx)
setge %dl
leaq 0x94360(%rip), %rsi     # 0x1316d3
movq %rbx, %rdi
callq 0xea727
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 0x9d4e4
leaq 0x8(%r14), %rbp
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%r14)
movq %r14, %r12
addq $0x10, %r12
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xef3a0
andl $0xff0000ff, %eax       # imm = 0xFF0000FF
cmpl $0x1, %eax
jne 0x9d486
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xef3a0
movq %rax, %r13
addl $-0x4, %eax
cmpl $-0x3, %eax
jb 0x9d486
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xef3a0
addq (%r12), %rax
movq %rax, (%r12)
cmpl $0x3, %r13d
jne 0x9d425
addq $0x8, %rax
movq %rax, (%r12)
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xef3a0
addq %rax, (%r12)
jmp 0x9d47e
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xef3a0
addq %rax, (%r12)
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xef3a0
addq %rax, (%r12)
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xef3a0
movq (%r12), %rcx
cmpl $0x2, %r13d
jne 0x9d464
addq %rax, %rcx
movq %rcx, 0x10(%r14)
jmp 0x9d46f
addq %rcx, %rax
addq $0x8, %rax
movq %rax, 0x10(%r14)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9e5fa
testl %eax, %eax
je 0x9d486
movq (%r12), %rax
movq %rax, (%rbp)
movq (%rbp), %rdx
testq %rdx, %rdx
jle 0x9d499
movq 0x18(%rbx), %rax
cmpq 0x18(%rax), %rdx
jle 0x9d4ac
leaq 0x9425d(%rip), %rsi     # 0x1316fd
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9461
jmp 0x9d4cb
testq %r15, %r15
je 0x9d4ba
orb $0x1, 0x40(%r15)
movq %rdx, 0x58(%r15)
leaq 0x94222(%rip), %rsi     # 0x1316e3
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9461
movq %rbx, %rdi
movq %r14, %rsi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe9752