// File: /workspace/github_c_makefile_star2_O3/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 $0x48, %rsp
movq %rdi, %r14
movq $0x0, 0x18(%rsp)
movl $0x40, %esi
callq 0xe8b2b
movq %rax, %rbx
movq %r14, %rdi
xorl %esi, %esi
movl $0x11, %edx
callq 0xeb220
movl %eax, 0x8(%rbx)
leaq 0x84770(%rip), %rsi     # 0x1368cf
movq %r14, %rdi
xorl %edx, %edx
callq 0xe9bd0
movl %eax, 0x14(%rbx)
movq %r14, %rdi
movq %rbx, %rsi
movl $0x1, %edx
callq 0xb2518
movl (%rbx), %edx
testl %edx, %edx
jle 0xb21a9
cmpl $0x0, 0x4(%rbx)
leaq 0x8475b(%rip), %rax     # 0x1368e8
leaq 0x92f1c(%rip), %rcx     # 0x1450b0
cmoveq %rax, %rcx
leaq 0x8473e(%rip), %rsi     # 0x1368dd
movq %r14, %rdi
xorl %eax, %eax
callq 0xeb152
movl $0x1, 0xc(%rbx)
cmpl $0x0, 0x4(%rbx)
je 0xb21bf
movq $0x200, 0x18(%rsp)      # imm = 0x200
movq 0x18(%r14), %rdi
leaq 0x18(%rsp), %r15
movq %r15, %rsi
callq 0xeeb91
leaq 0x84727(%rip), %rsi     # 0x1368fe
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
movq 0x18(%r14), %rdi
movq (%r15), %rsi
movq %rbx, %rdx
addq $0x20, %rdx
leaq 0x84712(%rip), %rcx     # 0x13690b
callq 0xb260a
movq (%r15), %r13
addq $0x8, %r13
movq %r13, (%r15)
leaq 0x8(%rsp), %rax
movq %r13, (%rax)
movl $0x40, %esi
movq %r14, %rdi
callq 0xe8b2b
movq %rax, %r15
movq %r14, (%rax)
movq %rbx, 0x8(%rax)
movq 0x18(%r14), %rax
movq %rax, 0x10(%r15)
leaq 0xd402a(%rip), %r12     # 0x186260
movq %r14, 0x20(%rsp)
movq %rbx, 0x10(%rsp)
testb $0x1, %r13b
je 0xb2254
cmpl $0x2, 0xc(%rbx)
jne 0xb2254
incq %r13
movq %r13, 0x8(%rsp)
movq 0x18(%r14), %rdi
cmpq 0x18(%rdi), %r13
jge 0xb2499
movq %r13, 0x20(%r15)
cmpl $0x2, 0xc(%rbx)
jne 0xb227b
leaq 0x8(%rsp), %rsi
callq 0xeeb91
movq %rax, %rbp
jmp 0xb2288
leaq 0x8(%rsp), %rsi
callq 0xeeb4b
movzbl %al, %ebp
movl %ebp, 0x18(%r15)
movq 0x8(%rsp), %rax
movq %rax, 0x28(%r15)
movq $0x0, 0x30(%r15)
movq (%r15), %r13
xorl %eax, %eax
movzwl (%rax,%r12), %r14d
cmpl %r14d, %ebp
je 0xb22c3
addq $0x18, %rax
cmpq $0x990, %rax            # imm = 0x990
jne 0xb22a2
xorl %ebx, %ebx
leaq 0x79e90(%rip), %rcx     # 0x12c151
jmp 0xb22da
leaq (%r12,%rax), %rbx
movq 0x8(%rax,%r12), %rcx
testq %rcx, %rcx
leaq 0x79e7b(%rip), %rax     # 0x12c151
cmoveq %rax, %rcx
movq 0x8(%r15), %rax
cmpl $0x2, 0xc(%rax)
movq 0x20(%r15), %r8
leaq 0x84641(%rip), %rsi     # 0x13692e
leaq 0x84620(%rip), %rax     # 0x136914
cmoveq %rax, %rsi
movq %r13, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0xe8617
cmpl %r14d, %ebp
movq 0x20(%rsp), %r14
jne 0xb23cb
movl 0x4(%rbx), %eax
movq %rax, 0x30(%r15)
cmpq $0x0, 0x10(%rbx)
je 0xb2345
movq %r13, %rdi
movl $0x1, %esi
callq 0xe8a15
movq %r15, %rdi
callq *0x10(%rbx)
movq %r13, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
jmp 0xb23ee
movzwl 0x2(%rbx), %eax
cmpl $0x1, %eax
movq 0x10(%rsp), %rbx
je 0xb241c
cmpl $0x3, %eax
je 0xb2440
cmpl $0x2, %eax
jne 0xb23cb
movq 0x10(%r15), %rdi
movq 0x28(%r15), %rsi
callq 0xeeb67
movq %rax, %rbp
movq %r13, %rdi
movl $0x1, %esi
callq 0xe8a15
movq %r13, %rdi
leaq 0x845bc(%rip), %rsi     # 0x136948
movl %ebp, %edx
xorl %eax, %eax
callq 0xe8617
cmpq $0xa, %rbp
jl 0xb23b8
movq 0x10(%r15), %rdi
movq 0x28(%r15), %rsi
addq $0x2, %rsi
leaq 0x28(%rsp), %rdx
leaq 0x7696d(%rip), %rcx     # 0x128d20
callq 0xb260a
movq %r13, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
movq %rbp, 0x30(%r15)
jmp 0xb23ee
movl 0x18(%r15), %edx
movl %edx, %eax
andl $-0x4, %eax
cmpl $0x2c, %eax
jne 0xb23f5
movq 0x10(%r15), %rdi
movq 0x28(%r15), %rsi
callq 0xeeb67
addq $0x2, %rax
movq %rax, 0x30(%r15)
movq 0x10(%rsp), %rbx
jmp 0xb241c
leal -0x8100(%rdx), %eax
cmpl $0x7eff, %eax           # imm = 0x7EFF
movq 0x10(%rsp), %rbx
ja 0xb2483
movq 0x10(%r15), %rdi
movq 0x28(%r15), %rsi
callq 0xeed0d
addq $0x4, %rax
movq %rax, 0x30(%r15)
cmpb $0x0, 0x38(%r15)
jne 0xb2499
cmpl $0xff, 0x18(%r15)
je 0xb2499
movq 0x8(%rsp), %r13
addq 0x30(%r15), %r13
movq %r13, 0x8(%rsp)
jmp 0xb2240
movq 0x10(%r15), %rdi
movq 0x28(%r15), %rsi
callq 0xeeb67
movq %rax, %rbp
movq %r13, %rdi
movl $0x1, %esi
callq 0xe8a15
movq %r13, %rdi
leaq 0x844f1(%rip), %rsi     # 0x136958
movl %ebp, %edx
xorl %eax, %eax
callq 0xe8617
movq %r13, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
movq %rbp, 0x30(%r15)
jmp 0xb241c
leaq 0x844df(%rip), %rsi     # 0x136969
movq %r13, %rdi
xorl %eax, %eax
callq 0xe9295
movb $0x1, 0x38(%r15)
movq %r14, %rdi
movq %r15, %rsi
callq 0xe8be2
movq 0x18(%rbx), %rdi
callq 0xf052b
movq %r14, %rdi
movq %rbx, %rsi
callq 0xe8be2
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq