// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/misc2.c
// Function: de_run_fp_art
static void de_run_fp_art(deark *c, de_module_params *mparams)
{
	struct fp_art_ctx *d = NULL;
	UI fld1;

	d = de_malloc(c, sizeof(struct fp_art_ctx));
	fld1 = (UI)de_getu16le(0);
	if(fld1==0xffff) {
		d->hi_res = 1;
	}
	de_declare_fmtf(c, "PFS: 1st Publisher Art, %s res.",
		(d->hi_res?"high":"standard"));

	if(d->hi_res) {
		do_fp_art_hires(c, d);
	}
	else {
		do_fp_art_stdres(c, d, fld1);
	}

	if(d) {
		if(d->need_errmsg) {
			de_err(c, "Bad or unsupported ART file");
		}
		de_free(c, d);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
pushq $0x28
popq %rsi
callq 0xdecaf
movq %rax, %r14
movq 0x18(%rbx), %rdi
xorl %esi, %esi
callq 0xe3fa3
movq %rax, %r15
cmpl $0xffff, %r15d          # imm = 0xFFFF
jne 0x64916
movb $0x1, 0x20(%r14)
leaq 0xb3932(%rip), %rdx     # 0x118246
jmp 0x6492d
cmpb $0x0, 0x20(%r14)
leaq 0xc33df(%rip), %rax     # 0x127d01
leaq 0xb391d(%rip), %rdx     # 0x118246
cmoveq %rax, %rdx
leaq 0xb38f2(%rip), %rsi     # 0x118226
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe0824
cmpb $0x0, 0x20(%r14)
je 0x64a98
leaq 0x20(%rsp), %r12
movq $0x2, (%r12)
movq %rbx, %rdi
callq 0xdfd1a
movq %rax, %r15
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xe3fc4
movq %rax, %r13
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xe3fc4
movl $0x2, 0x78(%r15)
cvtsi2sd %r13, %xmm0
movsd %xmm0, 0x80(%r15)
cvtsi2sd %rax, %xmm0
movsd %xmm0, 0x88(%r15)
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xe3fc4
movq %rax, 0x8(%r14)
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xe3fc4
movq %rax, 0x10(%r14)
movq 0x8(%r14), %rsi
movq %rbx, %rdi
movq %rax, %rdx
callq 0xdf038
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xe3fc4
cmpl $0x1, %eax
jne 0x64afb
movq 0x20(%rsp), %rbp
movq 0x8(%r14), %rsi
movq 0x10(%r14), %rdx
movq %rbx, %rdi
callq 0xe6be1
testl %eax, %eax
je 0x64b00
movq 0x8(%r14), %rax
addq $0x7, %rax
pushq $0x8
popq %rcx
cqto
idivq %rcx
movq %rax, 0x18(%rsp)
addq $0x3, %rax
movq 0x10(%r14), %rsi
movq %rax, 0x10(%rsp)
imulq %rax, %rsi
incq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rdi
callq 0xe59cd
movq %rax, %r12
movq %rax, %rdi
callq 0xe589c
movq 0x18(%rbx), %rdi
movq 0x18(%rdi), %r13
subq %rbp, %r13
movq %rbp, %rsi
movq %r13, %rdx
movq %r12, %rcx
xorl %r8d, %r8d
callq 0xeed6a
movq %r12, %rdi
callq 0xe58e8
movq 0x18(%r12), %rcx
leaq 0xa1208(%rip), %rsi     # 0x105c78
movq %rbx, %rdi
movq %r13, %rdx
xorl %eax, %eax
callq 0xde896
movq 0x18(%r12), %rax
cqto
idivq 0x10(%r14)
testq %rdx, %rdx
je 0x64b4f
movb $0x1, 0x21(%r14)
jmp 0x64b03
movq %rbx, %rdi
movq %r14, %rsi
movl %r15d, %edx
callq 0x690d9
cmpb $0x0, (%r14)
je 0x64b48
movq 0x8(%r14), %rsi
movq 0x10(%r14), %rdx
movq %rbx, %rdi
callq 0xdf038
movq 0x8(%r14), %rsi
movq 0x10(%r14), %rdx
movq %rbx, %rdi
callq 0xe6be1
testl %eax, %eax
je 0x64b16
movq 0x18(%rbx), %rdi
movq 0x8(%r14), %rdx
movq 0x10(%r14), %rcx
movq 0x18(%r14), %r8
andl $0x0, 0x8(%rsp)
andq $0x0, (%rsp)
pushq $0x8
popq %rsi
xorl %r9d, %r9d
callq 0xe78af
jmp 0x64b16
movb $0x1, 0x21(%r14)
xorl %r12d, %r12d
movq %r12, %rdi
callq 0xe5591
movq %rbx, %rdi
movq %r15, %rsi
callq 0xdfd24
cmpb $0x0, 0x21(%r14)
je 0x64b2e
leaq 0xb3727(%rip), %rsi     # 0x11824b
movq %rbx, %rdi
xorl %eax, %eax
callq 0xdf2a5
movq %rbx, %rdi
movq %r14, %rsi
callq 0xded32
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x1, 0x21(%r14)
jmp 0x64b16
movq 0x10(%rsp), %rcx
movq %rax, 0x18(%r14)
movq 0x18(%rsp), %r13
cmpq %r13, %rax
jl 0x64a91
cmpq %rcx, %rax
jg 0x64a91
leaq 0xb36f1(%rip), %rsi     # 0x118267
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
movl 0x18(%r14), %edx
subl %r13d, %edx
leaq 0xb36e5(%rip), %rsi     # 0x118276
movq %rbx, %rdi
xorl %eax, %eax
callq 0xde9f1
movq 0x8(%r14), %rdx
movq 0x10(%r14), %rcx
movq 0x18(%r14), %r8
andl $0x0, 0x8(%rsp)
movq %r15, (%rsp)
movq %r12, %rdi
xorl %esi, %esi
xorl %r9d, %r9d
callq 0xe78af
jmp 0x64b03