// File: /workspace/github_c_makefile_star2_O3/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
movq $0x0, (%rbx)
movl $0x458, %esi            # imm = 0x458
callq 0xe8b2b
movq %rax, %r14
leaq 0x51afe(%rip), %rsi     # 0x12337f
movq %r13, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0xe8617
movq %r13, %rdi
movl $0x1, %esi
callq 0xe8a15
leaq 0x60(%rsp), %r15
movq $0x6, (%r15)
movq %r13, %rdi
movq %r15, %rsi
callq 0xd1dcb
movq %rax, %r12
leaq 0x6ec78(%rip), %rsi     # 0x140533
movq %r13, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
movq %r13, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
movq %r12, (%r15)
movq %r13, %rdi
movq %r14, %rsi
movq %r12, %rdx
movq %rbx, %rcx
callq 0xd1e40
testl %eax, %eax
je 0xd1a57
movq 0x28(%r14), %rdx
testq %rdx, %rdx
je 0xd19bb
movq 0x30(%r14), %rcx
testq %rcx, %rcx
je 0xd19bb
leaq 0x6ee41(%rip), %rsi     # 0x140753
movq %r13, %rdi
xorl %eax, %eax
callq 0xe8617
movq %r13, %rdi
movl $0x1, %esi
callq 0xe8a15
cmpq $0x0, 0x30(%r14)
jle 0xd19ae
xorl %r15d, %r15d
movq 0x18(%r13), %rdi
movq 0x28(%r14), %rsi
addq %r15, %rsi
callq 0xeead3
movl %eax, %ebx
movq 0x18(%r13), %rdi
movq 0x28(%r14), %rsi
addq 0x30(%r14), %rsi
addq %r15, %rsi
callq 0xeead3
movl %eax, %ebp
movq 0x18(%r13), %rdi
movq 0x30(%r14), %rsi
addq %rsi, %rsi
addq 0x28(%r14), %rsi
addq %r15, %rsi
callq 0xeead3
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 0xe91fc
cmpq $0xfe, %r15
ja 0xd19ae
incq %r15
cmpq 0x30(%r14), %r15
jl 0xd1933
movq %r13, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
movq $0x0, 0x20(%rsp)
leaq 0x2c(%rsp), %rsi
movq %r13, %rdi
callq 0xe8a1c
movq 0x8(%r14), %rdx
testq %rdx, %rdx
je 0xd1a65
leaq 0x696d2(%rip), %rsi     # 0x13b0b7
xorl %r15d, %r15d
movq %r13, %rdi
xorl %eax, %eax
callq 0xe8617
movq %r13, %rdi
movl $0x1, %esi
callq 0xe8a15
movq 0x10(%r14), %rsi
movq 0x18(%r14), %rdx
movq %r13, %rdi
callq 0xf1db1
testl %eax, %eax
je 0xd1a68
movq 0x20(%r14), %rax
movq 0x38(%r14), %rdx
movb 0x41(%r14), %cl
testb %cl, %cl
sete %sil
movl %esi, 0x14(%rsp)
movq %rdx, 0x48(%rsp)
testq %rdx, %rdx
movq %r13, (%rsp)
je 0xd1a72
testb %cl, %cl
je 0xd1a95
movl $0x2, %r13d
movl $0x4, %ebx
cmpq $0x10, %rax
je 0xd1aae
cmpq $0x20, %rax
je 0xd1aae
jmp 0xd1c11
testq %r14, %r14
jne 0xd1d74
jmp 0xd1d96
xorl %r15d, %r15d
xorl %ebx, %ebx
xorl %r12d, %r12d
jmp 0xd1d4d
testb %cl, %cl
je 0xd1acf
cmpq $0x20, %rax
jne 0xd1c11
movl $0x4, %ebx
movl $0x4, %r13d
movl $0x0, 0x14(%rsp)
jmp 0xd1aea
orq $0x10, %rax
cmpq $0x18, %rax
jne 0xd1c11
movl $0x1, %r13d
movl $0x3, %ebx
cmpq $0x0, 0x28(%r14)
jne 0xd1aea
leaq 0x6ecb3(%rip), %rsi     # 0x14076f
xorl %r15d, %r15d
movq (%rsp), %r13
movq %r13, %rdi
xorl %eax, %eax
callq 0xe9295
jmp 0xd1a68
cmpq $0x18, %rax
jne 0xd1c11
movl $0x3, %ebx
movb $0x1, %al
movl %eax, 0x14(%rsp)
movl $0x3, %r13d
leaq 0x6ec8f(%rip), %rsi     # 0x140780
movq (%rsp), %r15
movq %r15, %rdi
movl %r13d, %edx
xorl %eax, %eax
callq 0xe8617
movq 0x10(%r14), %rsi
movq 0x18(%r14), %rdx
movq %r15, %rdi
movl %ebx, %ecx
callq 0xf266a
movq %rax, 0x30(%rsp)
cmpb $0x0, 0x40(%r14)
je 0xd1c26
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xf09c5
movq %rax, %r12
movq %rax, %rdi
callq 0xf0855
movq 0x8(%r14), %rax
movq 0x18(%r14), %rcx
imulq 0x10(%r14), %rcx
movq %rax, 0x38(%rsp)
movq %rax, 0x8(%rsp)
movq %rcx, 0x40(%rsp)
testq %rcx, %rcx
jle 0xd1c51
xorl %r15d, %r15d
leaq 0x54(%rsp), %rbp
movq 0x8(%rsp), %rax
movq (%rsp), %rcx
movq 0x18(%rcx), %rdi
cmpq 0x18(%rdi), %rax
jg 0xd1c3f
leaq 0x8(%rsp), %rsi
callq 0xeeb4b
testb %al, %al
js 0xd1bce
incb %al
movzbl %al, %ebx
movq (%rsp), %rax
movq 0x18(%rax), %rdi
movq 0x8(%rsp), %rdx
movq %rbp, %rsi
movq %r13, %rcx
callq 0xee8d4
addq %r13, 0x8(%rsp)
movq %rbx, 0x18(%rsp)
movq %r12, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0xef547
decq %rbx
jne 0xd1bb4
movq 0x18(%rsp), %rax
jmp 0xd1c01
andb $0x7f, %al
movzbl %al, %ecx
movq %rcx, 0x18(%rsp)
movq (%rsp), %rax
movq 0x18(%rax), %rdi
movq 0x8(%rsp), %rsi
movq %r13, %rbx
imulq %rcx, %rbx
movq %rbx, %rdx
movq %r12, %rcx
callq 0xef481
movq 0x18(%rsp), %rax
addq %rbx, 0x8(%rsp)
addq %rax, %r15
cmpq 0x40(%rsp), %r15
jl 0xd1b68
jmp 0xd1c51
movb $0x1, (%r14)
xorl %r15d, %r15d
xorl %ebx, %ebx
xorl %r12d, %r12d
movq (%rsp), %r13
jmp 0xd1d4d
movq 0x18(%r15), %rdi
movq 0x8(%r14), %rsi
movq 0x18(%rdi), %rdx
subq %rsi, %rdx
callq 0xf1388
movq %rax, %r12
jmp 0xd1c7a
leaq 0x410ce(%rip), %rsi     # 0x112d14
movq (%rsp), %rdi
xorl %eax, %eax
callq 0xe8faa
movq %r12, %rdi
callq 0xf08ba
movq 0x8(%rsp), %rdx
subq 0x38(%rsp), %rdx
movq 0x18(%r12), %rcx
leaq 0x41029(%rip), %rsi     # 0x112c98
movq (%rsp), %rdi
xorl %eax, %eax
callq 0xe8617
movq 0x18(%r14), %rcx
testq %rcx, %rcx
jle 0xd1d20
movq 0x10(%r14), %rax
xorl %r13d, %r13d
leaq 0x20(%rsp), %rbp
testq %rax, %rax
jle 0xd1d14
xorl %ebx, %ebx
cmpq $0x0, 0x48(%rsp)
je 0xd1cb7
movq %r12, %rdi
movq %rbp, %rsi
callq 0xeeb4b
movzbl %al, %eax
movl 0x58(%r14,%rax,4), %r15d
jmp 0xd1ccf
movq 0x20(%rsp), %rsi
movq %r12, %rdi
xorl %edx, %edx
callq 0xef42f
movl %eax, %r15d
addq $0x3, 0x20(%rsp)
cmpb $0x0, 0x14(%rsp)
jne 0xd1cf1
movq %r12, %rdi
movq %rbp, %rsi
callq 0xeeb4b
andl $0xffffff, %r15d        # imm = 0xFFFFFF
movzbl %al, %eax
shll $0x18, %eax
orl %eax, %r15d
movq 0x30(%rsp), %rdi
movq %rbx, %rsi
movq %r13, %rdx
movl %r15d, %ecx
callq 0xf24bf
incq %rbx
movq 0x10(%r14), %rax
cmpq %rax, %rbx
jl 0xd1c9a
movq 0x18(%r14), %rcx
incq %r13
cmpq %rcx, %r13
jl 0xd1c93
movq (%rsp), %r13
movq %r13, %rdi
callq 0xea504
movq %rax, %rbx
movups 0x48(%r14), %xmm0
movups %xmm0, 0x68(%rax)
movq 0x30(%rsp), %r15
movq %r15, %rdi
movq %rax, %rsi
movl $0x2, %edx
callq 0xf22d0
movq %r12, %rdi
callq 0xf052b
movq %r15, %rdi
callq 0xf228d
movq %r13, %rdi
movq %rbx, %rsi
callq 0xea50e
movl 0x2c(%rsp), %esi
movq %r13, %rdi
callq 0xe8a25
cmpb $0x0, (%r14)
je 0xd1d8b
leaq 0x473d9(%rip), %rsi     # 0x11915a
movq %r13, %rdi
xorl %eax, %eax
callq 0xe9295
movq %r13, %rdi
movq %r14, %rsi
callq 0xe8be2
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq