// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/pict.c
// Function: de_run_pict
static void de_run_pict(deark *c, de_module_params *mparams)
{
	lctx *d = NULL;
	i64 pos = 0;
	i64 picsize;

	d = de_malloc(c, sizeof(lctx));

	d->input_encoding = de_get_input_encoding(c, NULL, DE_ENCODING_MACROMAN);
	d->decode_qt = de_get_ext_option_bool(c, "pict:decodeqt", 0);

	do_detect_version(c, &d->dti, 1);
	if(d->dti.file_version>0) {
		de_declare_fmtf(c, "PICT v%d%s", d->dti.file_version,
			d->dti.has_fileheader?"":", without file header");
	}

	d->version = 1;

	if(d->dti.has_fileheader) {
		pos += 512;
	}

	picsize = de_getu16be_p(&pos);
	de_dbg(c, "picSize: %"I64_FMT, picsize);
	pict_read_rect(c->infile, pos, &d->framerect, "picFrame");
	pos+=8;

	do_read_items(c, d, pos);

	dbuf_close(d->iccprofile_file);
	de_free(c, d);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
andq $0x0, 0x10(%rsp)
pushq $0x40
popq %rsi
callq 0xdecaf
movq %rax, %r14
pushq $0x11
popq %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0xe08d2
movl %eax, 0x8(%r14)
leaq 0x7e1c2(%rip), %rsi     # 0x1295cf
movq %rbx, %rdi
xorl %edx, %edx
callq 0xdfae5
movl %eax, 0x14(%r14)
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0xab784
movl (%r14), %edx
testl %edx, %edx
jle 0xab458
cmpl $0x0, 0x4(%r14)
leaq 0x7e1ac(%rip), %rax     # 0x1295e8
leaq 0x8c81d(%rip), %rcx     # 0x137c60
cmoveq %rax, %rcx
leaq 0x7e18f(%rip), %rsi     # 0x1295dd
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe0824
movl $0x1, 0xc(%r14)
cmpl $0x0, 0x4(%r14)
je 0xab470
movq $0x200, 0x10(%rsp)      # imm = 0x200
movq 0x18(%rbx), %rdi
leaq 0x10(%rsp), %r15
movq %r15, %rsi
callq 0xe3f6e
leaq 0x7e176(%rip), %rsi     # 0x1295fe
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
movq 0x18(%rbx), %rdi
movq (%r15), %rsi
movq %r14, %rdx
addq $0x20, %rdx
leaq 0x7e161(%rip), %rcx     # 0x12960b
callq 0xab87e
movq (%r15), %r13
addq $0x8, %r13
movq %r13, (%r15)
leaq 0x8(%rsp), %rax
movq %r13, (%rax)
pushq $0x40
popq %rsi
movq %rbx, %rdi
callq 0xdecaf
movq %rax, %r15
movq %rbx, (%rax)
movq %r14, 0x8(%rax)
movq 0x18(%rbx), %rax
movq %rax, 0x10(%r15)
testb $0x1, %r13b
je 0xab4f3
cmpl $0x2, 0xc(%r14)
jne 0xab4f3
incq %r13
movq %r13, 0x8(%rsp)
movq 0x18(%rbx), %rdi
cmpq 0x18(%rdi), %r13
jge 0xab70b
movq %r13, 0x20(%r15)
cmpl $0x2, 0xc(%r14)
jne 0xab51b
leaq 0x8(%rsp), %rsi
callq 0xe3f6e
movq %rax, %rdx
jmp 0xab528
leaq 0x8(%rsp), %rsi
callq 0xe3f2a
movzbl %al, %edx
movl %edx, 0x18(%r15)
movq 0x8(%rsp), %rax
movq %rax, 0x28(%r15)
andq $0x0, 0x30(%r15)
movq (%r15), %rbp
pushq $0x67
popq %r12
leaq 0xddcc0(%rip), %r13     # 0x189208
decq %r12
je 0xab56e
movzwl 0x18(%r13), %eax
addq $0x18, %r13
cmpl %eax, %edx
jne 0xab548
movq 0x8(%r13), %rcx
testq %rcx, %rcx
leaq 0x73979(%rip), %rax     # 0x11eee1
cmoveq %rax, %rcx
jmp 0xab578
xorl %r13d, %r13d
leaq 0x73969(%rip), %rcx     # 0x11eee1
movq 0x8(%r15), %rax
cmpl $0x2, 0xc(%rax)
movq 0x20(%r15), %r8
leaq 0x7e0a3(%rip), %rsi     # 0x12962e
leaq 0x7e082(%rip), %rax     # 0x129614
cmoveq %rax, %rsi
movq %rbp, %rdi
xorl %eax, %eax
callq 0xde896
testq %r12, %r12
je 0xab64e
movl 0x4(%r13), %eax
movq %rax, 0x30(%r15)
cmpq $0x0, 0x10(%r13)
je 0xab5da
movq %rbp, %rdi
pushq $0x1
popq %rsi
callq 0xdeba7
movq %r15, %rdi
callq *0x10(%r13)
movq %rbp, %rdi
pushq $-0x1
popq %rsi
callq 0xdeba7
jmp 0xab6d1
movzwl 0x2(%r13), %eax
cmpl $0x1, %eax
je 0xab6d1
cmpl $0x3, %eax
je 0xab693
cmpl $0x2, %eax
jne 0xab64e
movq 0x10(%r15), %rdi
movq 0x28(%r15), %rsi
callq 0xe3f46
movq %rax, %r13
movq %rbp, %rdi
pushq $0x1
popq %rsi
callq 0xdeba7
movq %rbp, %rdi
leaq 0x7e02d(%rip), %rsi     # 0x129648
movl %r13d, %edx
xorl %eax, %eax
callq 0xde896
cmpq $0xa, %r13
jl 0xab6c2
movq 0x10(%r15), %rdi
movq 0x28(%r15), %rsi
addq $0x2, %rsi
leaq 0x18(%rsp), %rdx
leaq 0x70499(%rip), %rcx     # 0x11bae0
callq 0xab87e
jmp 0xab6c2
movl 0x18(%r15), %edx
movl %edx, %eax
andl $-0x4, %eax
cmpl $0x2c, %eax
jne 0xab66f
movq 0x10(%r15), %rdi
movq 0x28(%r15), %rsi
callq 0xe3f46
addq $0x2, %rax
jmp 0xab68d
leal -0x8100(%rdx), %eax
cmpl $0x7eff, %eax           # imm = 0x7EFF
ja 0xab6f5
movq 0x10(%r15), %rdi
movq 0x28(%r15), %rsi
callq 0xe404f
addq $0x4, %rax
movq %rax, 0x30(%r15)
jmp 0xab6d1
movq 0x10(%r15), %rdi
movq 0x28(%r15), %rsi
callq 0xe3f46
movq %rax, %r13
movq %rbp, %rdi
pushq $0x1
popq %rsi
callq 0xdeba7
movq %rbp, %rdi
leaq 0x7dfa0(%rip), %rsi     # 0x129658
movl %r13d, %edx
xorl %eax, %eax
callq 0xde896
movq %rbp, %rdi
pushq $-0x1
popq %rsi
callq 0xdeba7
movq %r13, 0x30(%r15)
cmpb $0x0, 0x38(%r15)
jne 0xab70b
cmpl $0xff, 0x18(%r15)
je 0xab70b
movq 0x8(%rsp), %r13
addq 0x30(%r15), %r13
movq %r13, 0x8(%rsp)
jmp 0xab4de
leaq 0x7df6d(%rip), %rsi     # 0x129669
movq %rbp, %rdi
xorl %eax, %eax
callq 0xdf2a5
movb $0x1, 0x38(%r15)
movq %rbx, %rdi
movq %r15, %rsi
callq 0xded32
movq 0x18(%r14), %rdi
callq 0xe5591
movq %rbx, %rdi
movq %r14, %rsi
callq 0xded32
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq