// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/eps.c
// Function: de_run_eps
static void de_run_eps(deark *c, de_module_params *mparams)
{
	u8 b[2];

	de_read(b, 0, (i64)sizeof(b));

	if(b[0]==0xc5 && b[1]==0xd0) {
		de_run_eps_binary(c);
	}
	else if(b[0]=='%' && b[1]=='!') {
		de_run_eps_normal(c);
	}
	else {
		de_err(c, "Not an EPS file");
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x458, %rsp            # imm = 0x458
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
leaq 0x3e(%rsp), %r14
movl $0x2, %ecx
movq %r14, %rsi
xorl %edx, %edx
callq 0xee8d4
movb (%r14), %al
movb 0x1(%r14), %cl
movl %eax, %edx
xorb $-0x3b, %dl
movl %ecx, %esi
xorb $-0x30, %sil
orb %dl, %sil
jne 0x445cc
leaq 0xd8087(%rip), %rsi     # 0x11c528
movq %rbx, %rdi
callq 0xeb125
movq 0x18(%rbx), %rdi
movl $0x4, %esi
callq 0xeed61
movq %rax, %rbp
movq 0x18(%rbx), %rdi
movl $0x8, %esi
callq 0xeed61
movq %rax, %r14
movq 0x18(%rbx), %rdi
movl $0xc, %esi
callq 0xeed61
movq %rax, %r12
movq 0x18(%rbx), %rdi
movl $0x10, %esi
callq 0xeed61
movq %rax, %r13
movq 0x18(%rbx), %rdi
movl $0x14, %esi
callq 0xeed61
movq %rax, 0x28(%rsp)
movq 0x18(%rbx), %rdi
movl $0x18, %esi
callq 0xeed61
movq %rax, %r15
testq %r14, %r14
jle 0x44548
leaq 0xd8016(%rip), %rsi     # 0x11c533
movq %rbx, %rdi
movl %ebp, %edx
movl %r14d, %ecx
xorl %eax, %eax
callq 0xe8617
movq 0x18(%rbx), %rdi
leaq 0xd7faf(%rip), %rcx     # 0x11c4e6
movq %rbp, %rsi
movq %r14, %rdx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0xefd48
testq %r13, %r13
jle 0x44583
leaq 0xd7ffd(%rip), %rsi     # 0x11c551
movq %rbx, %rdi
movl %r12d, %edx
movl %r13d, %ecx
xorl %eax, %eax
callq 0xe8617
movq 0x18(%rbx), %rdi
leaq 0xd8000(%rip), %rcx     # 0x11c56f
movq %r12, %rsi
movq %r13, %rdx
xorl %r8d, %r8d
movl $0x1, %r9d
callq 0xefd48
testq %r15, %r15
jle 0x446c1
leaq 0xd7fe8(%rip), %rsi     # 0x11c57b
movq %rbx, %rdi
movq 0x28(%rsp), %r14
movl %r14d, %edx
movl %r15d, %ecx
xorl %eax, %eax
callq 0xe8617
movq 0x18(%rbx), %rdi
leaq 0xd7fe7(%rip), %rcx     # 0x11c59a
movq %r14, %rsi
movq %r15, %rdx
xorl %r8d, %r8d
movl $0x1, %r9d
callq 0xefd48
jmp 0x446c1
xorb $0x25, %al
xorb $0x21, %cl
orb %al, %cl
jne 0x446b0
leaq 0xd7f0a(%rip), %rsi     # 0x11c4ea
movq %rbx, %rdi
callq 0xeb125
movq 0x18(%rbx), %rdi
leaq 0x10(%rsp), %rdx
leaq 0x30(%rsp), %rcx
xorl %esi, %esi
callq 0xf166d
testl %eax, %eax
je 0x446c1
movabsq $0x506e696765422525, %r14 # imm = 0x506E696765422525
movabsq $0x3a77656976657250, %r12 # imm = 0x3A77656976657250
leaq 0x10(%rsp), %r13
leaq 0x30(%rsp), %rbp
xorl %r15d, %r15d
movl 0x10(%rsp), %ecx
movl 0x30(%rsp), %r8d
movq %rbx, %rdi
leaq 0xd7f6d(%rip), %rsi     # 0x11c5a6
movl %r15d, %edx
xorl %eax, %eax
callq 0xe87e4
movq 0x10(%rsp), %rcx
cmpq $0x400, %rcx            # imm = 0x400
jl 0x4465f
movq $0x3ff, 0x10(%rsp)      # imm = 0x3FF
movl $0x3ff, %ecx            # imm = 0x3FF
movq 0x18(%rbx), %rdi
leaq 0x50(%rsp), %rsi
movq %r15, %rdx
callq 0xee8d4
movq 0x10(%rsp), %rax
movb $0x0, 0x50(%rsp,%rax)
movq 0x50(%rsp), %rax
xorq %r14, %rax
movq 0x57(%rsp), %rcx
xorq %r12, %rcx
orq %rax, %rcx
je 0x446d3
addq 0x30(%rsp), %r15
movq 0x18(%rbx), %rdi
movq %r15, %rsi
movq %r13, %rdx
movq %rbp, %rcx
callq 0xf166d
testl %eax, %eax
jne 0x44626
jmp 0x446c1
leaq 0xd7e61(%rip), %rsi     # 0x11c518
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9295
addq $0x458, %rsp            # imm = 0x458
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5f(%rsp), %r12
addq 0x30(%rsp), %r15
movl $0x450, %esi            # imm = 0x450
movq %rbx, %rdi
callq 0xe8b2b
movq %rax, %r14
leaq 0xd7ee1(%rip), %rsi     # 0x11c5d5
leaq 0x24(%rsp), %rdx
leaq 0x20(%rsp), %rcx
leaq 0x1c(%rsp), %r8
leaq 0x18(%rsp), %r9
movq %r12, %rdi
xorl %eax, %eax
callq 0x18220
cmpl $0x4, %eax
jne 0x447e4
movl 0x24(%rsp), %edx
movl 0x20(%rsp), %ecx
movl 0x1c(%rsp), %r8d
movl 0x18(%rsp), %r9d
leaq 0xd7ecf(%rip), %rsi     # 0x11c603
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8617
movslq 0x24(%rsp), %rax
movq %rax, (%r14)
movslq 0x20(%rsp), %rcx
movq %rcx, 0x8(%r14)
movslq 0x1c(%rsp), %r8
movq %r8, 0x18(%r14)
movslq 0x18(%rsp), %rdx
movq %rdx, 0x28(%r14)
cmpq $0x8, %r8
ja 0x44949
movl $0x116, %edx            # imm = 0x116
btl %r8d, %edx
jae 0x44949
imulq %r8, %rax
leaq 0x7(%rax), %rdx
addq $0xe, %rax
testq %rdx, %rdx
cmovnsq %rdx, %rax
movq %rax, %rdx
sarq $0x3, %rdx
movq %rdx, 0x20(%r14)
andq $-0x8, %rax
cqto
idivq %r8
movq %rax, 0x10(%r14)
movq %rbx, %rdi
movq %rax, %rsi
movq %rcx, %rdx
callq 0xf1db1
testl %eax, %eax
je 0x4495d
movq $-0x186a1, %rax         # imm = 0xFFFE795F
movq 0x28(%r14), %rcx
addq %rax, %rcx
cmpq %rax, %rcx
ja 0x447f0
leaq 0xd7e62(%rip), %rsi     # 0x11c637
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9295
jmp 0x4495d
leaq 0xd7df7(%rip), %rsi     # 0x11c5e2
jmp 0x446b7
movq $0x0, 0x30(%r14)
movq 0x8(%r14), %rsi
imulq 0x10(%r14), %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0xf09c5
movq %rax, 0x28(%rsp)
cmpq $0x0, 0x28(%r14)
jle 0x448b6
xorl %ebp, %ebp
leaq 0x38(%rsp), %r13
movq 0x18(%rbx), %rdi
movq %r15, %rsi
leaq 0x40(%rsp), %rdx
leaq 0x48(%rsp), %rcx
callq 0xf166d
testl %eax, %eax
je 0x448b6
cmpq $0x0, 0x40(%rsp)
jle 0x448a4
xorl %r12d, %r12d
movq 0x18(%rbx), %rdi
leaq (%r15,%r12), %rsi
callq 0xeead3
movzbl %al, %edi
movq %r13, %rsi
callq 0xebbbc
cmpl $0x0, 0x38(%rsp)
jne 0x4489a
movq 0x30(%r14), %rcx
testb $0x1, %cl
jne 0x44879
movb %al, 0x48(%r14)
orq $0x1, %rcx
jmp 0x44896
movb 0x48(%r14), %cl
shlb $0x4, %cl
orb %al, %cl
movzbl %cl, %esi
movq 0x28(%rsp), %rdi
callq 0xf0bd6
movq 0x30(%r14), %rcx
incq %rcx
movq %rcx, 0x30(%r14)
incq %r12
cmpq 0x40(%rsp), %r12
jl 0x44847
addq 0x48(%rsp), %r15
incq %rbp
cmpq 0x28(%r14), %rbp
jl 0x44822
movq 0x10(%r14), %rdx
movq (%r14), %rsi
movq 0x8(%r14), %rcx
movq %rbx, %rdi
movl $0x1, %r8d
callq 0xf26a5
movq %rax, %r15
movq %r14, %r13
addq $0x4c, %r13
movb 0x18(%r14), %cl
movl $0x1, %esi
shlq %cl, %rsi
movq %r13, %rdi
movl $0x1, %edx
callq 0xf3bdb
movq 0x18(%r14), %rdx
movq 0x20(%r14), %rcx
movl $0x0, (%rsp)
movq 0x28(%rsp), %r12
movq %r12, %rdi
xorl %esi, %esi
movq %r13, %r8
movq %r15, %r9
callq 0xf2f79
cmpq $0x1, 0x18(%r14)
movl $0x9, %eax
movl $0x3, %edx
cmovel %eax, %edx
leaq 0xd0d8e(%rip), %rsi     # 0x1156bd
movq %r15, %rdi
callq 0xf22dc
movq %r15, %rdi
callq 0xf228d
movq %r12, %rdi
callq 0xf052b
jmp 0x4495d
leaq 0xd7cc7(%rip), %rsi     # 0x11c617
movq %rbx, %rdi
movl %r8d, %edx
xorl %eax, %eax
callq 0xe9295
movq %rbx, %rdi
movq %r14, %rsi
callq 0xe8be2
jmp 0x446c1