// File: /workspace/github_c_makefile_star2_O2/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
leaq 0x58(%rsp), %rbx
andq $0x0, (%rbx)
movl $0x458, %esi            # imm = 0x458
callq 0xdecaf
movq %rax, %r14
leaq 0x4d555(%rip), %rsi     # 0x1161bf
movq %r13, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0xde896
pushq $0x1
popq %rsi
movq %r13, %rdi
callq 0xdeba7
leaq 0x60(%rsp), %r15
movq $0x6, (%r15)
movq %r13, %rdi
movq %r15, %rsi
callq 0xc9184
movq %rax, %r12
leaq 0x6a521(%rip), %rsi     # 0x1331c3
movq %r13, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
pushq $-0x1
popq %rsi
movq %r13, %rdi
callq 0xdeba7
movq %r12, (%r15)
movq %r14, %r15
movq %r13, %rdi
movq %r14, %rsi
movq %r12, %rdx
movq %rbx, %rcx
callq 0xc91f7
testl %eax, %eax
je 0xc8da0
movq 0x28(%r15), %rdx
testq %rdx, %rdx
movq %r15, 0x18(%rsp)
je 0xc8dbc
movq 0x30(%r15), %rcx
testq %rcx, %rcx
je 0xc8dbc
leaq 0x6a6e4(%rip), %rsi     # 0x1333e3
xorl %r15d, %r15d
movq %r13, %rdi
xorl %eax, %eax
callq 0xde896
pushq $0x1
popq %rsi
movq %r13, %rdi
callq 0xdeba7
movq 0x18(%rsp), %r14
cmpq $0xff, %r15
ja 0xc8dae
cmpq 0x30(%r14), %r15
jge 0xc8dae
movq 0x18(%r13), %rdi
movq 0x28(%r14), %rsi
addq %r15, %rsi
callq 0xe3eb4
movl %eax, %ebx
movq 0x18(%r13), %rdi
movq 0x28(%r14), %rsi
addq 0x30(%r14), %rsi
addq %r15, %rsi
callq 0xe3eb4
movl %eax, %ebp
movq 0x18(%r13), %rdi
movq 0x30(%r14), %rsi
addq %rsi, %rsi
addq 0x28(%r14), %rsi
addq %r15, %rsi
callq 0xe3eb4
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 0xdf23b
incq %r15
jmp 0xc8d1c
testq %r15, %r15
jne 0xc9131
jmp 0xc9153
pushq $-0x1
popq %rsi
movq %r13, %rdi
callq 0xdeba7
movq %r14, %r15
andq $0x0, 0x20(%rsp)
leaq 0x2c(%rsp), %rsi
movq %r13, %rdi
callq 0xdebae
movq 0x8(%r15), %rdx
testq %rdx, %rdx
je 0xc8e4b
leaq 0x64fe8(%rip), %rsi     # 0x12ddc7
xorl %r14d, %r14d
movq %r13, %rdi
xorl %eax, %eax
callq 0xde896
pushq $0x1
popq %rsi
movq %r13, %rdi
callq 0xdeba7
movq 0x10(%r15), %rsi
movq 0x18(%r15), %rdx
movq %r13, %rdi
callq 0xe6be1
testl %eax, %eax
je 0xc8e4e
movq 0x20(%r15), %rax
movq 0x38(%r15), %rdx
movb 0x41(%r15), %cl
testb %cl, %cl
sete %sil
movl %esi, 0x14(%rsp)
movq %rdx, 0x48(%rsp)
testq %rdx, %rdx
movq %r13, (%rsp)
je 0xc8e58
testb %cl, %cl
je 0xc8e77
pushq $0x4
popq %rbx
pushq $0x2
popq %r13
cmpq $0x10, %rax
je 0xc8e8c
cmpq $0x20, %rax
je 0xc8e8c
jmp 0xc8fe6
xorl %r14d, %r14d
xorl %ebx, %ebx
xorl %r12d, %r12d
jmp 0xc910a
testb %cl, %cl
je 0xc8ead
cmpq $0x20, %rax
jne 0xc8fe6
pushq $0x4
popq %rbx
pushq $0x4
popq %r13
movl $0x0, 0x14(%rsp)
jmp 0xc8ec4
orq $0x10, %rax
cmpq $0x18, %rax
jne 0xc8fe6
pushq $0x3
popq %rbx
pushq $0x1
popq %r13
cmpq $0x0, 0x28(%r15)
jne 0xc8ec4
leaq 0x6a565(%rip), %rsi     # 0x1333ff
xorl %r14d, %r14d
movq (%rsp), %r13
movq %r13, %rdi
xorl %eax, %eax
callq 0xdf2a5
jmp 0xc8e4e
cmpq $0x18, %rax
jne 0xc8fe6
pushq $0x3
popq %rbx
movb $0x1, %al
movl %eax, 0x14(%rsp)
pushq $0x3
popq %r13
leaq 0x6a545(%rip), %rsi     # 0x133410
movq (%rsp), %r12
movq %r12, %rdi
movl %r13d, %edx
xorl %eax, %eax
callq 0xde896
movq 0x10(%r15), %rsi
movq 0x18(%r15), %rdx
movq %r12, %rdi
movl %ebx, %ecx
callq 0xe7437
movq %rax, %r14
cmpb $0x0, 0x40(%r15)
je 0xc8ffb
xorl %ebx, %ebx
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xe59cd
movq %rax, %r12
movq %rax, %rdi
callq 0xe589c
movq 0x18(%r15), %rax
imulq 0x10(%r15), %rax
movq %rax, 0x38(%rsp)
movq 0x8(%r15), %rax
leaq 0x8(%rsp), %rcx
movq %rax, 0x30(%rsp)
movq %rax, (%rcx)
leaq 0x54(%rsp), %rbp
cmpq 0x38(%rsp), %rbx
jge 0xc9027
movq 0x8(%rsp), %rax
movq (%rsp), %rcx
movq 0x18(%rcx), %rdi
cmpq 0x18(%rdi), %rax
jg 0xc9015
movq %rbx, 0x40(%rsp)
leaq 0x8(%rsp), %rsi
callq 0xe3f2a
testb %al, %al
js 0xc8faa
incb %al
movzbl %al, %r15d
movq (%rsp), %rax
movq 0x18(%rax), %rdi
movq 0x8(%rsp), %rdx
movq %rbp, %rsi
movq %r13, %rcx
callq 0xe3cb7
addq %r13, 0x8(%rsp)
movq %r15, %rbx
subq $0x1, %rbx
jb 0xc8fd4
movq %r12, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0xe46ba
jmp 0xc8f94
andb $0x7f, %al
movzbl %al, %r15d
movq (%rsp), %rax
movq 0x18(%rax), %rdi
movq 0x8(%rsp), %rsi
movq %r13, %rbx
imulq %r15, %rbx
movq %rbx, %rdx
movq %r12, %rcx
callq 0xe45f4
addq %rbx, 0x8(%rsp)
movq 0x40(%rsp), %rbx
addq %r15, %rbx
movq 0x18(%rsp), %r15
jmp 0xc8f39
movb $0x1, (%r15)
xorl %r14d, %r14d
xorl %ebx, %ebx
xorl %r12d, %r12d
movq (%rsp), %r13
jmp 0xc910a
movq 0x18(%r12), %rdi
movq 0x8(%r15), %rsi
movq 0x18(%rdi), %rdx
subq %rsi, %rdx
callq 0xe6248
movq %rax, %r12
jmp 0xc9050
leaq 0x3ccd8(%rip), %rsi     # 0x105cf4
movq (%rsp), %rdi
xorl %eax, %eax
callq 0xdf05a
movq %r12, %rdi
callq 0xe58e8
movq 0x8(%rsp), %rdx
subq 0x30(%rsp), %rdx
movq 0x18(%r12), %rcx
leaq 0x3cc33(%rip), %rsi     # 0x105c78
movq (%rsp), %rdi
xorl %eax, %eax
callq 0xde896
xorl %r13d, %r13d
leaq 0x20(%rsp), %rbp
cmpq 0x18(%r15), %r13
jge 0xc90e4
xorl %ebx, %ebx
cmpq 0x10(%r15), %rbx
jge 0xc90dc
cmpq $0x0, 0x48(%rsp)
je 0xc9087
movq %r12, %rdi
movq %rbp, %rsi
callq 0xe3f2a
movzbl %al, %eax
movl 0x58(%r15,%rax,4), %r15d
jmp 0xc909f
movq 0x20(%rsp), %rsi
movq %r12, %rdi
xorl %edx, %edx
callq 0xe45a4
movl %eax, %r15d
addq $0x3, 0x20(%rsp)
cmpb $0x0, 0x14(%rsp)
jne 0xc90c1
movq %r12, %rdi
movq %rbp, %rsi
callq 0xe3f2a
andl $0xffffff, %r15d        # imm = 0xFFFFFF
movzbl %al, %eax
shll $0x18, %eax
orl %eax, %r15d
movq %r14, %rdi
movq %rbx, %rsi
movq %r13, %rdx
movl %r15d, %ecx
callq 0xe728c
incq %rbx
movq 0x18(%rsp), %r15
jmp 0xc9064
incq %r13
jmp 0xc9058
movq (%rsp), %r13
movq %r13, %rdi
callq 0xdfd1a
movq %rax, %rbx
movups 0x48(%r15), %xmm0
movups %xmm0, 0x68(%rax)
pushq $0x2
popq %rdx
movq %r14, %rdi
movq %rax, %rsi
callq 0xe70ab
movq %r12, %rdi
callq 0xe5591
movq %r14, %rdi
callq 0xe7084
movq %r13, %rdi
movq %rbx, %rsi
callq 0xdfd24
movl 0x2c(%rsp), %esi
movq %r13, %rdi
callq 0xdebb7
cmpb $0x0, (%r15)
je 0xc9148
leaq 0x42f2c(%rip), %rsi     # 0x10c06a
movq %r13, %rdi
xorl %eax, %eax
callq 0xdf2a5
movq %r13, %rdi
movq %r15, %rsi
callq 0xded32
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq