// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/emf.c
// Function: de_run_emf
static void de_run_emf(deark *c, de_module_params *mparams)
{
	lctx *d = NULL;

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

	d->input_encoding = de_get_input_encoding(c, NULL, DE_ENCODING_WINDOWS1252);

	detect_emfplus(c, d);

	if(d->is_emfplus)
		de_declare_fmt(c, "EMF+");
	else
		de_declare_fmt(c, "EMF");

	do_emf_record_list(c, d);

	de_free(c, d);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
movl $0x20, %esi
callq 0xe969b
movq %rax, %r14
movq %rbx, %rdi
xorl %esi, %esi
movl $0x9, %edx
callq 0xeb7d1
movl %eax, (%r14)
movq 0x18(%rbx), %rdi
movl $0x4, %esi
callq 0xef37e
movq %rax, %r15
movq 0x18(%rbx), %rdi
movq %rax, %rsi
callq 0xef37e
cmpq $0x46, %rax
jne 0x41d5e
movq 0x18(%rbx), %rdi
addq $0xc, %r15
movq %r15, %rsi
callq 0xef37e
cmpq $0x2b464d45, %rax       # imm = 0x2B464D45
jne 0x41d5e
movl $0x1, 0x4(%r14)
movq %r14, 0x18(%rsp)
cmpl $0x0, 0x4(%r14)
leaq 0xda070(%rip), %rax     # 0x11bddf
leaq 0xd930a(%rip), %rsi     # 0x11b080
cmoveq %rax, %rsi
movq %rbx, %rdi
callq 0xeb6d6
movq 0x18(%rbx), %rdi
cmpq $0x8, 0x18(%rdi)
jge 0x41dba
leaq 0xd92f1(%rip), %rsi     # 0x11b085
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9df7
movq %rbx, %rdi
movq 0x18(%rsp), %rsi
callq 0xe9752
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x13e7cf(%rip), %rbp    # 0x180590
xorl %r15d, %r15d
xorl %r13d, %r13d
leaq 0x4(%r13), %rsi
callq 0xef37e
leaq (%rax,%r13), %r12
movq 0x18(%rbx), %rdi
cmpq 0x18(%rdi), %r12
jg 0x41efd
cmpq $0x7, %rax
jle 0x41f16
leaq 0x8(%r13), %rcx
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x30(%rsp)
movq %r13, 0x28(%rsp)
movq %rax, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
addq $-0x8, %rax
movq %rax, 0x40(%rsp)
movq %r13, %rsi
callq 0xef37e
movl %eax, 0x20(%rsp)
xorl %r14d, %r14d
cmpl %eax, (%r14,%rbp)
je 0x41e3c
addq $0x18, %r14
cmpq $0xb28, %r14            # imm = 0xB28
jne 0x41e24
xorl %r14d, %r14d
jmp 0x41e3f
addq %rbp, %r14
testq %r14, %r14
je 0x41eaa
movq 0x8(%r14), %r9
movups 0x38(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
leaq 0xd9298(%rip), %rsi     # 0x11b0f3
movl %r15d, %edx
movq %r13, %rcx
movl %eax, %r8d
xorl %eax, %eax
callq 0xe9226
cmpq $0x0, 0x10(%r14)
je 0x41ed4
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq %rbx, %rdi
movq 0x18(%rsp), %rsi
leaq 0x20(%rsp), %rdx
callq *0x10(%r14)
movl %eax, %r13d
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
testl %r13d, %r13d
jne 0x41ed4
jmp 0x41d9e
movups 0x38(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
leaq 0xd9236(%rip), %rsi     # 0x11b0f3
movl %r15d, %edx
movq %r13, %rcx
movl %eax, %r8d
leaq 0xe9f9c(%rip), %r9      # 0x12be69
xorl %eax, %eax
callq 0xe9226
cmpl $0xe, 0x20(%rsp)
je 0x41d9e
incq %r15
leaq 0x8(%r12), %rax
movq 0x18(%rbx), %rdi
movq %r12, %r13
cmpq 0x18(%rdi), %rax
jle 0x41dc7
jmp 0x41d8d
leaq 0xd91ae(%rip), %rsi     # 0x11b0b2
movq %rbx, %rdi
movl %r15d, %edx
xorl %eax, %eax
callq 0xe9df7
jmp 0x41d9e
leaq 0xd91b9(%rip), %rsi     # 0x11b0d6
movq %rbx, %rdi
movq %rax, %rdx
movq %r13, %rcx
xorl %eax, %eax
callq 0xe9df7
jmp 0x41d9e