// File: /workspace/github_c_makefile_star2_O1/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
movq $0x0, 0x10(%rsp)
movl $0x40, %esi
callq 0xe969b
movq %rax, %r14
movq %rbx, %rdi
xorl %esi, %esi
movl $0x11, %edx
callq 0xeb7d1
movl %eax, 0x8(%r14)
leaq 0x83905(%rip), %rsi     # 0x136505
movq %rbx, %rdi
xorl %edx, %edx
callq 0xea727
movl %eax, 0x14(%r14)
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0xb2fb3
movl (%r14), %edx
testl %edx, %edx
jle 0xb2c4d
cmpl $0x0, 0x4(%r14)
leaq 0x838ed(%rip), %rax     # 0x13651e
leaq 0x91f98(%rip), %rcx     # 0x144bd0
cmoveq %rax, %rcx
leaq 0x838d0(%rip), %rsi     # 0x136513
movq %rbx, %rdi
xorl %eax, %eax
callq 0xeb703
movl $0x1, 0xc(%r14)
cmpl $0x0, 0x4(%r14)
je 0xb2c65
addq $0x200, 0x10(%rsp)      # imm = 0x200
movq 0x18(%rbx), %rdi
leaq 0x10(%rsp), %r15
movq %r15, %rsi
callq 0xef193
leaq 0x838b7(%rip), %rsi     # 0x136534
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq 0x18(%rbx), %rdi
movq (%r15), %rsi
movq %r14, %rdx
addq $0x20, %rdx
leaq 0x838a2(%rip), %rcx     # 0x136541
callq 0xb30ef
movq (%r15), %rax
addq $0x8, %rax
movq %rax, (%r15)
leaq 0x8(%rsp), %rcx
movq %rax, (%rcx)
movl $0x40, %esi
movq %rbx, %rdi
callq 0xe969b
movq %rax, %r12
movq %rbx, (%rax)
movq %r14, 0x8(%rax)
movq 0x18(%rbx), %rax
movq %rax, 0x10(%r12)
leaq 0xd3543(%rip), %r15     # 0x186220
movq 0x8(%rsp), %rax
testb $0x1, %al
je 0xb2cf5
cmpl $0x2, 0xc(%r14)
jne 0xb2cf5
incq %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq 0x18(%rbx), %rdi
cmpq 0x18(%rdi), %rax
jge 0xb2f34
movq %rax, 0x20(%r12)
cmpl $0x2, 0xc(%r14)
jne 0xb2d23
leaq 0x8(%rsp), %rsi
callq 0xef193
movq %rax, %rdx
jmp 0xb2d30
leaq 0x8(%rsp), %rsi
callq 0xef14d
movzbl %al, %edx
movl %edx, 0x18(%r12)
movq 0x8(%rsp), %rax
movq %rax, 0x28(%r12)
movq $0x0, 0x30(%r12)
movq (%r12), %rbp
xorl %r13d, %r13d
movzwl (%r13,%r15), %eax
cmpl %eax, %edx
je 0xb2d6b
addq $0x18, %r13
cmpq $0x990, %r13            # imm = 0x990
jne 0xb2d4f
xorl %r13d, %r13d
jmp 0xb2d6e
addq %r15, %r13
testq %r13, %r13
je 0xb2d7c
movq 0x8(%r13), %rcx
testq %rcx, %rcx
jne 0xb2d83
leaq 0x790e6(%rip), %rcx     # 0x12be69
movq 0x8(%r12), %rax
cmpl $0x2, 0xc(%rax)
movq 0x20(%r12), %r8
leaq 0x837cc(%rip), %rsi     # 0x136564
leaq 0x837ab(%rip), %rax     # 0x13654a
cmoveq %rax, %rsi
movq %rbp, %rdi
xorl %eax, %eax
callq 0xe9226
testq %r13, %r13
je 0xb2e69
movl 0x4(%r13), %eax
movq %rax, 0x30(%r12)
cmpq $0x0, 0x10(%r13)
je 0xb2dec
movq %rbp, %rdi
movl $0x1, %esi
callq 0xe9585
movq %r12, %rdi
callq *0x10(%r13)
movq %rbp, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
jmp 0xb2f12
movzwl 0x2(%r13), %eax
cmpl $0x1, %eax
je 0xb2f12
cmpl $0x3, %eax
je 0xb2ecd
cmpl $0x2, %eax
jne 0xb2e69
movq 0x10(%r12), %rdi
movq 0x28(%r12), %rsi
callq 0xef169
movq %rax, %r13
movq %rbp, %rdi
movl $0x1, %esi
callq 0xe9585
movq %rbp, %rdi
leaq 0x8374d(%rip), %rsi     # 0x13657e
movl %r13d, %edx
xorl %eax, %eax
callq 0xe9226
cmpq $0xa, %r13
jl 0xb2f00
movq 0x10(%r12), %rdi
movq 0x28(%r12), %rsi
addq $0x2, %rsi
leaq 0x18(%rsp), %rdx
leaq 0x75c91(%rip), %rcx     # 0x128af0
callq 0xb30ef
jmp 0xb2f00
movl 0x18(%r12), %edx
movl %edx, %eax
andl $-0x4, %eax
cmpl $0x2c, %eax
jne 0xb2e8d
movq 0x10(%r12), %rdi
movq 0x28(%r12), %rsi
callq 0xef169
addq $0x2, %rax
jmp 0xb2ead
leal -0x8100(%rdx), %eax
cmpl $0x7eff, %eax           # imm = 0x7EFF
ja 0xb2eb4
movq 0x10(%r12), %rdi
movq 0x28(%r12), %rsi
callq 0xef32a
addq $0x4, %rax
movq %rax, 0x30(%r12)
jmp 0xb2f12
movq %rbp, %rdi
leaq 0x836e1(%rip), %rsi     # 0x13659f
xorl %eax, %eax
callq 0xe9df7
movb $0x1, 0x38(%r12)
jmp 0xb2f12
movq 0x10(%r12), %rdi
movq 0x28(%r12), %rsi
callq 0xef169
movq %rax, %r13
movq %rbp, %rdi
movl $0x1, %esi
callq 0xe9585
movq %rbp, %rdi
leaq 0x83698(%rip), %rsi     # 0x13658e
movl %r13d, %edx
xorl %eax, %eax
callq 0xe9226
movq %rbp, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
movq %r13, 0x30(%r12)
cmpb $0x0, 0x38(%r12)
jne 0xb2f34
cmpl $0xff, 0x18(%r12)
je 0xb2f34
movq 0x30(%r12), %rax
addq %rax, 0x8(%rsp)
jmp 0xb2cdd
movq %rbx, %rdi
movq %r12, %rsi
callq 0xe9752
movq 0x18(%r14), %rdi
callq 0xf0b13
movq %rbx, %rdi
movq %r14, %rsi
callq 0xe9752
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq