// File: /workspace/github_c_makefile_star2_O1/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 0x24(%rsp), %rsi
callq 0xe958c
movl $0x78, %esi
movq %rbx, %rdi
callq 0xe969b
movq %rax, %r14
movq $0x0, 0x58(%rax)
cmpq $0x9, 0x18(%r13)
jl 0x9f59a
movq %r13, 0x10(%rsp)
movq 0x50(%r14), %rax
testq %rax, %rax
je 0x9f06a
movq 0x58(%r14), %rcx
cmpq -0x8(%r14,%rax,8), %rcx
jl 0x9f06a
decq %rax
movq %rax, 0x50(%r14)
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
jmp 0x9f040
movq 0x58(%r14), %r15
movq %r15, (%rsp)
xorl %eax, %eax
movq %rax, 0x60(%r14)
movl $0x0, 0x68(%r14)
movq %rax, 0x70(%r14)
movq %rbx, %rdi
leaq 0xc(%rsp), %rsi
callq 0xe958c
movq %r13, %rdi
movq %rsp, %rsi
callq 0xef1ed
movq %rax, %r12
movl %r12d, %ebp
andl $0xf, %ebp
cmpl $0xf, %ebp
jne 0x9f0b2
movl $0x1, 0x68(%r14)
movq %r13, %rdi
movq %rsp, %rsi
callq 0xef1ed
movq %r13, %rdi
movq %rax, %r13
notl %eax
testl $0xf000, %eax           # imm = 0xF000
jne 0x9f587
shrl $0x4, %r12d
movq %rsp, %rsi
callq 0xef3a0
movq %rax, 0x18(%rsp)
movl $0x8, %eax
leaq 0xe6363(%rip), %rdx     # 0x185450
movzwl -0x8(%rax,%rdx), %ecx
cmpl %r13d, %ecx
je 0x9f10c
addq $0x18, %rax
cmpq $0x188, %rax            # imm = 0x188
jne 0x9f0ed
leaq 0x8cd5f(%rip), %r10     # 0x12be69
jmp 0x9f110
movq (%rax,%rdx), %r10
movq %rbx, %rdi
leaq 0x92ade(%rip), %rsi     # 0x131bf8
movq %r15, %rdx
movl %ebp, %ecx
movl %r12d, %r8d
movl %r13d, %r9d
xorl %eax, %eax
movq 0x18(%rsp), %rbp
pushq %rbp
pushq %r10
callq 0xe9226
addq $0x10, %rsp
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq (%rsp), %rax
leaq (%rax,%rbp), %rcx
movq 0x10(%rsp), %rdx
cmpq 0x18(%rdx), %rcx
jg 0x9f587
cmpl $0x0, 0x68(%r14)
je 0x9f17c
movq $0x8, 0x60(%r14)
movq 0x58(%r14), %rcx
addq %rbp, %rcx
addq $0x8, %rcx
movq %rcx, 0x70(%r14)
jmp 0x9f189
movq %rbp, %rcx
subq %r15, %rcx
addq %rax, %rcx
movq %rcx, 0x60(%r14)
leal -0xf118(%r13), %ecx
cmpl $0xffffff00, %ecx       # imm = 0xFFFFFF00
jb 0x9f4a5
movzwl %r13w, %ecx
movb $0x1, %sil
addl $0xffff0fe6, %ecx       # imm = 0xFFFF0FE6
cmpl $0xf, %ecx
ja 0x9f1e2
leaq 0x929f3(%rip), %rdx     # 0x131ba8
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
cmpl $0x3d4, %r12d           # imm = 0x3D4
je 0x9f30f
cmpl $0x3d5, %r12d           # imm = 0x3D5
jne 0x9f38a
movl $0x42, %edx
jmp 0x9f314
movb $0x1, %cl
movb $0x1, %dl
leaq 0x96244(%rip), %r9      # 0x135431
jmp 0x9f3cb
cmpl $0x7a8, %r12d           # imm = 0x7A8
je 0x9f2fd
cmpl $0x7a9, %r12d           # imm = 0x7A9
jne 0x9f344
movl $0x21, %ecx
jmp 0x9f302
cmpl $0x216, %r12d           # imm = 0x216
je 0x9f306
cmpl $0x217, %r12d           # imm = 0x217
jne 0x9f370
movl $0x42, %edx
jmp 0x9f30b
cmpl $0x6e4, %r12d           # imm = 0x6E4
je 0x9f318
cmpl $0x6e5, %r12d           # imm = 0x6E5
jne 0x9f3a4
movl $0x21, %edi
jmp 0x9f31d
cmpl $0x542, %r12d           # imm = 0x542
je 0x9f32d
cmpl $0x543, %r12d           # imm = 0x543
jne 0x9f3b1
movl $0x42, %edi
jmp 0x9f332
movl $0x11, %edi
cmpl $0x6e1, %r12d           # imm = 0x6E1
jg 0x9f2d6
cmpl $0x46a, %r12d           # imm = 0x46A
je 0x9f2ed
cmpl $0x46b, %r12d           # imm = 0x46B
je 0x9f2e8
movb $0x1, %cl
movb $0x1, %dl
leaq 0x9420d(%rip), %r9      # 0x1334ba
jmp 0x9f3cb
cmpl $0x6e0, %r12d           # imm = 0x6E0
je 0x9f35e
cmpl $0x6e1, %r12d           # imm = 0x6E1
jne 0x9f3c0
movl $0x21, %edi
jmp 0x9f363
cmpl $0x6e2, %r12d           # imm = 0x6E2
je 0x9f2ed
cmpl $0x6e3, %r12d           # imm = 0x6E3
jne 0x9f2a2
movl $0x21, %edi
movb $0x1, %cl
movb $0x1, %dl
leaq 0x941c2(%rip), %r9      # 0x1334ba
jmp 0x9f3cd
movl $0x11, %ecx
xorl %edx, %edx
jmp 0x9f348
movl $0x32, %edx
xorl %ecx, %ecx
jmp 0x9f374
movl $0x32, %edx
xorl %ecx, %ecx
jmp 0x9f38e
movl $0x11, %edi
movb $0x1, %cl
movb $0x1, %dl
leaq 0xaab8f(%rip), %r9      # 0x149eb7
jmp 0x9f3cd
movl $0x32, %edi
xorl %ecx, %ecx
movb $0x1, %dl
xorl %esi, %esi
leaq 0x76af1(%rip), %r9      # 0x115e30
jmp 0x9f3cd
movb $0x1, %dl
xorl %ecx, %ecx
testb %dl, %dl
movl $0x0, %edi
cmoveq %rcx, %rdi
movb $0x1, %cl
leaq 0x83ed3(%rip), %r9      # 0x12322f
jmp 0x9f3cd
movl $0x11, %edi
movb $0x1, %cl
movb $0x1, %dl
leaq 0x89192(%rip), %r9      # 0x128500
jmp 0x9f3cd
movb $0x1, %cl
xorl %edx, %edx
testb %cl, %cl
movl $0x0, %edi
cmoveq %rdx, %rdi
movb $0x1, %dl
leaq 0x7d0df(%rip), %r9      # 0x11c467
jmp 0x9f3cd
movb $0x1, %cl
xorl %edx, %edx
testb %cl, %cl
movl $0x0, %edi
cmoveq %rdx, %rdi
movb $0x1, %dl
leaq 0x7bcab(%rip), %r9      # 0x11b04d
jmp 0x9f3cd
movb $0x1, %cl
movb $0x1, %dl
leaq 0xaab08(%rip), %r9      # 0x149eb7
jmp 0x9f3cb
xorl %esi, %esi
movb $0x1, %cl
movb $0x1, %dl
leaq 0x76a72(%rip), %r9      # 0x115e30
jmp 0x9f3cb
movb $0x1, %cl
movb $0x1, %dl
leaq 0x89135(%rip), %r9      # 0x128500
xorl %edi, %edi
testq %rdi, %rdi
je 0x9f48e
movq %rsi, 0x30(%rsp)
movb $0x1, %bpl
testb %cl, %cl
movq 0x10(%rsp), %r13
jne 0x9f42a
leaq (%rax,%rdi), %rsi
addq $-0x2, %rsi
movq %rdi, 0x28(%rsp)
movq %r13, %rdi
movl %edx, %r15d
movq %r9, %r12
callq 0xef0d5
movzbl %al, %ebp
movq %rbx, %rdi
leaq 0x786c0(%rip), %rsi     # 0x117acf
movl %ebp, %edx
xorl %eax, %eax
callq 0xe9226
movq %r12, %r9
movl %r15d, %edx
movq 0x28(%rsp), %rdi
testb %bpl, %bpl
setne %bpl
movq (%rsp), %r8
addq %rdi, %r8
movq %r8, (%rsp)
testb %dl, %dl
je 0x9f517
movq %rdi, %r12
movq %rbx, %rdi
movq %r9, %rsi
xorl %edx, %edx
movl $0x1, %ecx
callq 0xf037a
movq %rax, %r15
cmpb $0x0, 0x30(%rsp)
jne 0x9f469
movl $0x200, %esi            # imm = 0x200
movq %r15, %rdi
callq 0xf1346
testb %bpl, %bpl
movq %r12, %rax
je 0x9f540
movq (%rsp), %rsi
movq 0x18(%rsp), %rdx
subq %rax, %rdx
movq %r13, %rdi
movq %r15, %rcx
callq 0xefabc
jmp 0x9f4ad
movq %rbx, %rdi
leaq 0x927a3(%rip), %rsi     # 0x131c3b
movl %r12d, %edx
movl %r13d, %ecx
xorl %eax, %eax
callq 0xe9b27
xorl %r15d, %r15d
movq 0x10(%rsp), %r13
movl 0xc(%rsp), %esi
movq %rbx, %rdi
callq 0xe9595
movq %r15, %rdi
callq 0xf0b13
movq 0x60(%r14), %rax
testq %rax, %rax
jle 0x9f59a
addq %rax, 0x58(%r14)
cmpl $0x0, 0x68(%r14)
je 0x9f500
movq 0x50(%r14), %rax
cmpq $0x9, %rax
ja 0x9f500
movq 0x70(%r14), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, 0x50(%r14)
movq %rcx, (%r14,%rax,8)
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq 0x18(%r13), %rax
addq $-0x8, %rax
cmpq %rax, 0x58(%r14)
jl 0x9f040
jmp 0x9f59a
movq 0x18(%rsp), %r9
subq %rdi, %r9
movq %rbx, %rdi
leaq 0x83d06(%rip), %rsi     # 0x12322f
leaq 0xa402c(%rip), %rdx     # 0x14355c
movq %r13, %rcx
callq 0xea66a
xorl %r15d, %r15d
jmp 0x9f4ad
movq 0x18(%rsp), %r12
subq %rax, %r12
movq (%rsp), %rsi
subq $0x8, %rsp
movq %r13, %rdi
movq %r12, %rdx
movq %r15, %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq $0x1
callq 0x100d18
addq $0x10, %rsp
movq 0x18(%r15), %rcx
movq %rbx, %rdi
leaq 0x81ecb(%rip), %rsi     # 0x121443
movq %r12, %rdx
xorl %eax, %eax
callq 0xe9226
jmp 0x9f4ad
movl 0xc(%rsp), %esi
movq %rbx, %rdi
callq 0xe9595
xorl %edi, %edi
callq 0xf0b13
movq %rbx, %rdi
movq %r14, %rsi
callq 0xe9752
movl 0x24(%rsp), %esi
movq %rbx, %rdi
callq 0xe9595
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq