// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/officeart.c
// Function: de_run_officeart
static void de_run_officeart(deark *c, de_module_params *mparams)
{
	struct officeartctx * oactx = NULL;
	dbuf *inf = c->infile;
	int saved_indent_level;

	de_dbg_indent_save(c, &saved_indent_level);
	oactx = de_malloc(c, sizeof(struct officeartctx));

	oactx->record_pos = 0;
	while(1) {
		i64 ret;

		if(oactx->record_pos >= inf->len-8) break;

		// Have we reached the end of any containers?
		while(oactx->container_end_stackptr>0 &&
			oactx->record_pos>=oactx->container_end_stack[oactx->container_end_stackptr-1])
		{
			oactx->container_end_stackptr--;
			de_dbg_indent(c, -1);
		}

		ret = do_OfficeArtStream_record(c, oactx, inf);
		if(!ret || oactx->record_bytes_consumed<=0) break;

		oactx->record_pos += oactx->record_bytes_consumed;

		// Is a new container open?
		if(oactx->is_container && oactx->container_end_stackptr<OACTX_STACKSIZE) {
			oactx->container_end_stack[oactx->container_end_stackptr++] = oactx->container_endpos;
			de_dbg_indent(c, 1);
		}
	}

	de_free(c, oactx);
	de_dbg_indent_restore(c, saved_indent_level);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
movq 0x18(%rdi), %r13
leaq 0x34(%rsp), %rsi
callq 0xe8a1c
movl $0x78, %esi
movq %rbx, %rdi
callq 0xe8b2b
movq %rax, %r14
movq $0x0, 0x58(%rax)
cmpq $0x9, 0x18(%r13)
jl 0x9ed16
xorl %r15d, %r15d
movq %r13, 0x18(%rsp)
movq 0x50(%r14), %rax
testq %rax, %rax
je 0x9e864
movq 0x58(%r14), %r15
cmpq -0x8(%r14,%rax,8), %r15
jl 0x9e864
decq %rax
movq %rax, 0x50(%r14)
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
movq 0x50(%r14), %rax
testq %rax, %rax
jne 0x9e838
movq 0x58(%r14), %r15
movq %r15, 0x10(%rsp)
xorl %eax, %eax
movq %rax, 0x60(%r14)
movl $0x0, 0x68(%r14)
movq %rax, 0x70(%r14)
movq %rbx, %rdi
leaq 0x24(%rsp), %rsi
callq 0xe8a1c
movq %r13, %rdi
leaq 0x10(%rsp), %rsi
callq 0xeebeb
movq %rax, %r12
movl %r12d, %ebp
andl $0xf, %ebp
cmpl $0xf, %ebp
jne 0x9e8ab
movl $0x1, 0x68(%r14)
movq %r13, %rdi
leaq 0x10(%rsp), %rsi
callq 0xeebeb
movq %r13, %rdi
movq %rax, %r13
notl %eax
testl $0xf000, %eax           # imm = 0xF000
jne 0x9ed03
shrl $0x4, %r12d
leaq 0x10(%rsp), %rsi
callq 0xeed83
movq %rax, 0x28(%rsp)
movl $0x8, %eax
leaq 0xe6ba6(%rip), %rcx     # 0x185490
movzwl -0x8(%rax,%rcx), %ecx
cmpl %r13d, %ecx
je 0x9e909
addq $0x18, %rax
cmpq $0x188, %rax            # imm = 0x188
jne 0x9e8e3
leaq 0x8d84a(%rip), %r10     # 0x12c151
jmp 0x9e914
leaq 0xe6b80(%rip), %rcx     # 0x185490
movq (%rax,%rcx), %r10
movq %rbx, %rdi
leaq 0x9365e(%rip), %rsi     # 0x131f7c
movq %r15, %rdx
movl %ebp, %ecx
movl %r12d, %r8d
movl %r13d, %r9d
xorl %eax, %eax
movq 0x28(%rsp), %rbp
pushq %rbp
pushq %r10
callq 0xe8617
addq $0x10, %rsp
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movq 0x10(%rsp), %r8
leaq (%r8,%rbp), %rax
movq 0x18(%rsp), %rcx
cmpq 0x18(%rcx), %rax
jg 0x9ed03
cmpl $0x0, 0x68(%r14)
je 0x9e97e
movq 0x58(%r14), %rax
addq %rbp, %rax
addq $0x8, %rax
movq %rax, 0x70(%r14)
movl $0x8, %eax
jmp 0x9e987
movq %rbp, %rax
subq %r15, %rax
addq %r8, %rax
movq %rax, 0x60(%r14)
leal -0xf118(%r13), %eax
cmpl $0xffffff00, %eax       # imm = 0xFFFFFF00
jb 0x9eb12
movzwl %r13w, %eax
addl $0xffff0fe6, %eax       # imm = 0xFFFF0FE6
cmpl $0xf, %eax
ja 0x9eafb
leaq 0x93576(%rip), %rcx     # 0x131f2c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpl $0x3d4, %r12d           # imm = 0x3D4
je 0x9eb6d
cmpl $0x3d5, %r12d           # imm = 0x3D5
jne 0x9eafb
movb $0x1, %al
movl %eax, 0xc(%rsp)
movl $0x42, %r12d
jmp 0x9eb79
cmpl $0x7a8, %r12d           # imm = 0x7A8
je 0x9eb1f
cmpl $0x7a9, %r12d           # imm = 0x7A9
jne 0x9eafb
movl $0x21, %eax
jmp 0x9eb24
cmpl $0x216, %r12d           # imm = 0x216
je 0x9eb58
cmpl $0x217, %r12d           # imm = 0x217
jne 0x9eafb
movb $0x1, %al
movl %eax, 0xc(%rsp)
movl $0x42, %r12d
jmp 0x9eb64
cmpl $0x6e4, %r12d           # imm = 0x6E4
je 0x9eb82
cmpl $0x6e5, %r12d           # imm = 0x6E5
jne 0x9eafb
movl $0x21, %eax
jmp 0x9eb87
cmpl $0x542, %r12d           # imm = 0x542
je 0x9eb93
cmpl $0x543, %r12d           # imm = 0x543
jne 0x9eafb
movl $0x42, %r12d
jmp 0x9eb99
leaq 0x94e29(%rip), %rsi     # 0x1338b2
cmpl $0x6e1, %r12d           # imm = 0x6E1
jg 0x9eacf
cmpl $0x46a, %r12d           # imm = 0x46A
movl $0x11, %eax
je 0x9ec61
cmpl $0x46b, %r12d           # imm = 0x46B
je 0x9eaea
jmp 0x9eafb
cmpl $0x6e0, %r12d           # imm = 0x6E0
je 0x9ec55
cmpl $0x6e1, %r12d           # imm = 0x6E1
jne 0x9eafb
movl $0x21, %eax
jmp 0x9ec5a
cmpl $0x6e2, %r12d           # imm = 0x6E2
movl $0x11, %eax
je 0x9ec61
cmpl $0x6e3, %r12d           # imm = 0x6E3
jne 0x9eafb
movl $0x21, %eax
leaq 0x94dbc(%rip), %rsi     # 0x1338b2
jmp 0x9ec61
movq %rbx, %rdi
leaq 0x934ba(%rip), %rsi     # 0x131fbf
movl %r12d, %edx
movl %r13d, %ecx
xorl %eax, %eax
callq 0xe8faa
xorl %r15d, %r15d
movq 0x18(%rsp), %r13
jmp 0x9ec99
movl $0x11, %eax
addq %rax, %r8
movq %r8, 0x10(%rsp)
subq %rax, %rbp
movq %rbx, %rdi
leaq 0x848d6(%rip), %rsi     # 0x12340f
leaq 0xa4efc(%rip), %rdx     # 0x143a3c
movq 0x18(%rsp), %r13
movq %r13, %rcx
movq %rbp, %r9
callq 0xe9b13
xorl %r15d, %r15d
jmp 0x9ec99
movb $0x1, %al
movl %eax, 0xc(%rsp)
movl $0x32, %r12d
leaq 0x7da0c(%rip), %r15     # 0x11c577
jmp 0x9eba8
movb $0x1, %al
movl %eax, 0xc(%rsp)
movl $0x32, %r12d
leaq 0x7c5f5(%rip), %r15     # 0x11b175
jmp 0x9eba8
movl $0x11, %eax
leaq 0xab8d9(%rip), %rsi     # 0x14a467
jmp 0x9ec61
movl $0x32, %r12d
movl $0x0, 0xc(%rsp)
leaq 0x77338(%rip), %r15     # 0x115ee0
leaq (%r8,%r12), %rsi
addq $-0x2, %rsi
movq 0x18(%rsp), %r13
movq %r13, %rdi
callq 0xeead3
movl %eax, %ebp
movzbl %al, %edx
movq %rbx, %rdi
leaq 0x7903b(%rip), %rsi     # 0x117c07
xorl %eax, %eax
callq 0xe8617
addq %r12, 0x10(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
xorl %edx, %edx
movl $0x1, %ecx
callq 0xefda1
movq %rax, %r15
cmpb $0x0, 0xc(%rsp)
jne 0x9ec01
movl $0x200, %esi            # imm = 0x200
movq %r15, %rdi
callq 0xf0d35
testb %bpl, %bpl
je 0x9ec0d
movq 0x28(%rsp), %rbp
jmp 0x9ec83
movq %r12, %rax
movq 0x28(%rsp), %r12
subq %rax, %r12
movq 0x10(%rsp), %rsi
subq $0x8, %rsp
movq %r13, %rdi
movq %r12, %rdx
movq %r15, %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq $0x1
callq 0x100594
addq $0x10, %rsp
movq 0x18(%r15), %rcx
movq %rbx, %rdi
leaq 0x82906(%rip), %rsi     # 0x12154f
movq %r12, %rdx
xorl %eax, %eax
callq 0xe8617
jmp 0x9ec99
movl $0x11, %eax
leaq 0x89acf(%rip), %rsi     # 0x128730
addq %rax, %r8
movq %r8, 0x10(%rsp)
movq %rbx, %rdi
xorl %edx, %edx
movl $0x1, %ecx
movq %rax, %r12
callq 0xefda1
movq %rax, %r15
movq 0x18(%rsp), %r13
movq 0x10(%rsp), %rsi
subq %r12, %rbp
movq %r13, %rdi
movq %rbp, %rdx
movq %r15, %rcx
callq 0xef481
movl 0x24(%rsp), %esi
movq %rbx, %rdi
callq 0xe8a25
movq %r15, %rdi
callq 0xf052b
movq 0x60(%r14), %r15
testq %r15, %r15
jle 0x9ed16
addq 0x58(%r14), %r15
movq %r15, 0x58(%r14)
cmpl $0x0, 0x68(%r14)
je 0x9ecf0
movq 0x50(%r14), %rax
cmpq $0x9, %rax
ja 0x9ecf0
movq 0x70(%r14), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, 0x50(%r14)
movq %rcx, (%r14,%rax,8)
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movq 0x58(%r14), %r15
movq 0x18(%r13), %rax
addq $-0x8, %rax
cmpq %rax, %r15
jl 0x9e82f
jmp 0x9ed16
movl 0x24(%rsp), %esi
movq %rbx, %rdi
callq 0xe8a25
xorl %edi, %edi
callq 0xf052b
movq %rbx, %rdi
movq %r14, %rsi
callq 0xe8be2
movl 0x34(%rsp), %esi
movq %rbx, %rdi
callq 0xe8a25
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq