// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/vort.c
// Function: de_run_vort
static void de_run_vort(deark *c, de_module_params *mparams)
{
	i64 pos;
	i64 root_obj_offs;
	i64 bytes_consumed = 0;
	lctx *d = NULL;

	d = de_malloc(c, sizeof(lctx));
	pos = 0;
	de_dbg(c, "header at %"I64_FMT, pos);
	de_dbg_indent(c, 1);
	pos += 6; // signature
	root_obj_offs = read_vlq(c, &pos);
	de_dbg(c, "root object address: %"I64_FMT, root_obj_offs);
	de_dbg_indent(c, -1);

	pos = root_obj_offs;
	if(!do_full_object(c, d, root_obj_offs, &bytes_consumed)) goto done;
	do_colormap(c, d);
	do_image(c, d);

done:
	if(d) {
		if(d->need_errmsg) {
			de_err(c, "Bad or unsupported image type");
		}
		de_free(c, d);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %r13
xorl %r12d, %r12d
leaq 0x58(%rsp), %rbx
movq %r12, (%rbx)
movl $0x458, %esi            # imm = 0x458
callq 0xe969b
movq %rax, %r14
leaq 0x60(%rsp), %r15
movq %r12, (%r15)
leaq 0x50cf7(%rip), %rsi     # 0x12319f
movq %r13, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0xe9226
movq %r13, %rdi
movl $0x1, %esi
callq 0xe9585
movq $0x6, (%r15)
movq %r13, %rdi
movq %r15, %rsi
callq 0xd2a5c
movq %rax, %r12
leaq 0x6dc56(%rip), %rsi     # 0x140133
movq %r13, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq %r13, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
movq %r12, (%r15)
movq %r13, %rdi
movq %r14, %rsi
movq %r12, %rdx
movq %rbx, %rcx
callq 0xd2ad1
testl %eax, %eax
je 0xd29d5
movq 0x28(%r14), %rdx
testq %rdx, %rdx
je 0xd25dd
movq 0x30(%r14), %rcx
testq %rcx, %rcx
je 0xd25dd
leaq 0x6de1f(%rip), %rsi     # 0x140353
movq %r13, %rdi
xorl %eax, %eax
callq 0xe9226
movq %r13, %rdi
movl $0x1, %esi
callq 0xe9585
cmpq $0x0, 0x30(%r14)
jle 0xd25d0
xorl %r15d, %r15d
movq 0x18(%r13), %rdi
movq 0x28(%r14), %rsi
addq %r15, %rsi
callq 0xef0d5
movl %eax, %ebx
movq 0x18(%r13), %rdi
movq 0x28(%r14), %rsi
addq 0x30(%r14), %rsi
addq %r15, %rsi
callq 0xef0d5
movl %eax, %ebp
movq 0x18(%r13), %rdi
movq 0x30(%r14), %rsi
addq %rsi, %rsi
addq 0x28(%r14), %rsi
addq %r15, %rsi
callq 0xef0d5
movzbl %bl, %ecx
shll $0x10, %ecx
movzbl %bpl, %esi
shll $0x8, %esi
orl %ecx, %esi
movzbl %al, %edx
orl %esi, %edx
orl $0xff000000, %edx       # imm = 0xFF000000
movl %edx, 0x58(%r14,%r15,4)
movq %r13, %rdi
movq %r15, %rsi
callq 0xe9d68
cmpq $0xfe, %r15
ja 0xd25d0
incq %r15
cmpq 0x30(%r14), %r15
jl 0xd2555
movq %r13, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
movq $0x0, 0x20(%rsp)
leaq 0x2c(%rsp), %rsi
movq %r13, %rdi
callq 0xe958c
movq 0x8(%r14), %rdx
testq %rdx, %rdx
je 0xd2694
leaq 0x68718(%rip), %rsi     # 0x13ad1f
xorl %r15d, %r15d
movq %r13, %rdi
xorl %eax, %eax
callq 0xe9226
movq %r13, %rdi
movl $0x1, %esi
callq 0xe9585
movq 0x10(%r14), %rsi
movq 0x18(%r14), %rdx
movq %r13, %rdi
callq 0xf241d
testl %eax, %eax
je 0xd2697
movq 0x38(%r14), %rcx
movb 0x41(%r14), %al
testq %rcx, %rcx
movq %r13, 0x10(%rsp)
je 0xd26a1
testb %al, %al
je 0xd26e4
movq 0x20(%r14), %rcx
movl $0x2, %r13d
movl $0x4, %ebp
movl $0x0, 0xc(%rsp)
cmpq $0x10, %rcx
je 0xd2727
movl $0x0, 0x8(%rsp)
movl $0x0, %eax
cmpq $0x20, %rcx
je 0xd2731
movl $0x3, %ebp
movb $0x1, %al
movl %eax, 0xc(%rsp)
jmp 0xd26d7
xorl %r15d, %r15d
xorl %ebx, %ebx
xorl %r12d, %r12d
jmp 0xd29ae
testb %al, %al
jne 0xd26c7
cmpq $0x18, 0x20(%r14)
jne 0xd26c7
movl $0x3, %r13d
movl $0x3, %ebp
movb $0x1, %al
movl %eax, 0xc(%rsp)
xorl %eax, %eax
movb $0x1, %cl
movl %ecx, 0x8(%rsp)
jmp 0xd2731
movl $0x3, %ebp
movb $0x1, %dl
movl %edx, 0xc(%rsp)
testq %rcx, %rcx
je 0xd2711
xorl %r13d, %r13d
movb $0x1, %al
movl %eax, 0x8(%rsp)
movb $0x1, %al
jmp 0xd2731
movq 0x20(%r14), %rcx
orq $0x10, %rcx
cmpq $0x18, %rcx
jne 0xd2a29
movl $0x1, %r13d
movb $0x1, %al
movl %eax, 0x8(%rsp)
movl $0x3, %ebp
movl $0x0, 0xc(%rsp)
jmp 0xd272f
testb %al, %al
je 0xd26d7
cmpq $0x20, 0x20(%r14)
jne 0xd26d7
movl $0x4, %r13d
movl $0x4, %ebp
movl $0x0, 0x8(%rsp)
xorl %eax, %eax
testb %al, %al
je 0xd274b
movb $0x1, (%r14)
xorl %r15d, %r15d
xorl %ebx, %ebx
xorl %r12d, %r12d
movq 0x10(%rsp), %r13
jmp 0xd29ae
cmpb $0x0, 0xc(%rsp)
jne 0xd275d
cmpq $0x0, 0x28(%r14)
je 0xd2a0b
leaq 0x6dc1c(%rip), %rsi     # 0x140380
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
movl %r13d, %edx
xorl %eax, %eax
callq 0xe9226
movq 0x10(%r14), %rsi
movq 0x18(%r14), %rdx
movq %rbx, %rdi
movl %ebp, %ecx
callq 0xf2cab
movq %rax, 0x38(%rsp)
cmpb $0x0, 0x40(%r14)
je 0xd28ce
xorl %r15d, %r15d
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xf0faf
movq %rax, %r12
movq %rax, %rdi
callq 0xf0e3f
movq 0x8(%r14), %rax
movq 0x18(%r14), %rcx
imulq 0x10(%r14), %rcx
leaq 0x18(%rsp), %rdx
movq %rax, 0x40(%rsp)
movq %rax, (%rdx)
leaq 0x54(%rsp), %rbp
movq %rcx, 0x30(%rsp)
cmpq %rcx, %r15
jge 0xd2807
movq 0x18(%rsp), %rax
movq 0x10(%rsp), %rcx
movq 0x18(%rcx), %rdi
cmpq 0x18(%rdi), %rax
jle 0xd280e
xorl %ebx, %ebx
movq %rcx, %rdi
leaq 0x40509(%rip), %rsi     # 0x112d04
xorl %eax, %eax
callq 0xe9b27
jmp 0xd2895
xorl %ebx, %ebx
jmp 0xd289a
movq %r15, 0x48(%rsp)
leaq 0x18(%rsp), %rsi
callq 0xef14d
testb %al, %al
js 0xd285d
incb %al
movzbl %al, %r15d
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rdi
movq 0x18(%rsp), %rdx
movq %rbp, %rsi
movq %r13, %rcx
callq 0xeeee8
addq %r13, 0x18(%rsp)
movq %r15, %rbx
movq %r12, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0xefb82
decq %rbx
jne 0xd2848
jmp 0xd2888
andb $0x7f, %al
movzbl %al, %r15d
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rdi
movq 0x18(%rsp), %rsi
movq %r13, %rbx
imulq %r15, %rbx
movq %rbx, %rdx
movq %r12, %rcx
callq 0xefabc
addq %rbx, 0x18(%rsp)
movq 0x48(%rsp), %rax
addq %r15, %rax
movq %rax, %r15
movb $0x1, %bl
movq 0x30(%rsp), %rcx
testb %bl, %bl
jne 0xd27d6
movq %r12, %rdi
callq 0xf0ea4
movq 0x18(%rsp), %rdx
subq 0x40(%rsp), %rdx
movq 0x18(%r12), %rcx
leaq 0x403c8(%rip), %rsi     # 0x112c88
movq 0x10(%rsp), %rdi
xorl %eax, %eax
callq 0xe9226
jmp 0xd28e5
movq 0x18(%rbx), %rdi
movq 0x8(%r14), %rsi
movq 0x18(%rdi), %rdx
subq %rsi, %rdx
callq 0xf1988
movq %rax, %r12
cmpq $0x0, 0x18(%r14)
jle 0xd2980
xorl %r13d, %r13d
leaq 0x20(%rsp), %rbp
cmpq $0x0, 0x10(%r14)
jle 0xd2973
xorl %ebx, %ebx
cmpb $0x0, 0xc(%rsp)
je 0xd2922
movq 0x20(%rsp), %rsi
movq %r12, %rdi
xorl %edx, %edx
callq 0xefa60
movl %eax, %r15d
addq $0x3, 0x20(%rsp)
jmp 0xd2935
movq %r12, %rdi
movq %rbp, %rsi
callq 0xef14d
movzbl %al, %eax
movl 0x58(%r14,%rax,4), %r15d
cmpb $0x0, 0x8(%rsp)
jne 0xd2957
movq %r12, %rdi
movq %rbp, %rsi
callq 0xef14d
andl $0xffffff, %r15d        # imm = 0xFFFFFF
movzbl %al, %eax
shll $0x18, %eax
orl %eax, %r15d
movq 0x38(%rsp), %rdi
movq %rbx, %rsi
movq %r13, %rdx
movl %r15d, %ecx
callq 0xf2b02
incq %rbx
cmpq 0x10(%r14), %rbx
jl 0xd2901
incq %r13
cmpq 0x18(%r14), %r13
jl 0xd28f8
movq 0x10(%rsp), %r13
movq %r13, %rdi
callq 0xea9a9
movq %rax, %rbx
movups 0x48(%r14), %xmm0
movups %xmm0, 0x68(%rax)
movq 0x38(%rsp), %r15
movq %r15, %rdi
movq %rax, %rsi
movl $0x2, %edx
callq 0xf2917
movq %r12, %rdi
callq 0xf0b13
movq %r15, %rdi
callq 0xf28d4
movq %r13, %rdi
movq %rbx, %rsi
callq 0xea9b3
movl 0x2c(%rsp), %esi
movq %r13, %rdi
callq 0xe9595
testq %r14, %r14
je 0xd29fc
cmpb $0x0, (%r14)
je 0xd29f1
leaq 0x46653(%rip), %rsi     # 0x11903a
movq %r13, %rdi
xorl %eax, %eax
callq 0xe9df7
movq %r13, %rdi
movq %r14, %rsi
callq 0xe9752
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x6d95d(%rip), %rsi     # 0x14036f
xorl %r15d, %r15d
movq 0x10(%rsp), %r13
movq %r13, %rdi
xorl %eax, %eax
callq 0xe9df7
jmp 0xd2697
testb %al, %al
jne 0xd264f
jmp 0xd2687