// File: /workspace/github_c_makefile_star2_O3/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, %r12
movl $0x20, %esi
callq 0xe8b2b
movq %rax, %rbx
movq %r12, %rdi
xorl %esi, %esi
movl $0x9, %edx
callq 0xeb220
movl %eax, (%rbx)
movq 0x18(%r12), %rdi
movl $0x4, %esi
callq 0xeed61
movq %rax, %r15
movq 0x18(%r12), %rdi
movq %rax, %rsi
callq 0xeed61
cmpq $0x46, %rax
jne 0x41cf7
movq 0x18(%r12), %rdi
addq $0xc, %r15
movq %r15, %rsi
callq 0xeed61
cmpq $0x2b464d45, %rax       # imm = 0x2B464D45
jne 0x41cf7
movl $0x1, 0x4(%rbx)
movq %rbx, 0x10(%rsp)
cmpl $0x0, 0x4(%rbx)
leaq 0xda200(%rip), %rax     # 0x11bf07
leaq 0xd949a(%rip), %rsi     # 0x11b1a8
cmoveq %rax, %rsi
movq %r12, %rdi
callq 0xeb125
movq 0x18(%r12), %rdi
cmpq $0x8, 0x18(%rdi)
jge 0x41d53
leaq 0xd9480(%rip), %rsi     # 0x11b1ad
movq %r12, %rdi
xorl %eax, %eax
callq 0xe9295
movq %r12, %rdi
movq 0x10(%rsp), %rsi
callq 0xe8be2
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x13e8d6(%rip), %r14    # 0x180630
xorl %r15d, %r15d
xorl %r13d, %r13d
movq %r12, 0x8(%rsp)
leaq 0x4(%r13), %rsi
callq 0xeed61
leaq (%rax,%r13), %rbx
movq 0x18(%r12), %rdi
cmpq 0x18(%rdi), %rbx
jg 0x41eaf
movq %rax, %rbp
cmpq $0x7, %rax
jle 0x41ec8
leaq 0x8(%r13), %rax
movq $0x0, 0x20(%rsp)
movq %r13, 0x28(%rsp)
movq %rbp, 0x30(%rsp)
movq %rax, 0x18(%rsp)
movq %rax, 0x38(%rsp)
addq $-0x8, %rbp
movq %rbp, 0x40(%rsp)
movq %r13, %rsi
callq 0xeed61
movq %rax, %r12
movl %r12d, 0x20(%rsp)
movl $0x10, %eax
cmpl %r12d, -0x10(%rax,%r14)
je 0x41e0e
addq $0x18, %rax
cmpq $0xb38, %rax            # imm = 0xB38
jne 0x41dcd
movq 0x8(%rsp), %rdi
leaq 0xd942f(%rip), %rsi     # 0x11b21b
movl %r15d, %edx
movq %r13, %rcx
movl %r12d, %r8d
leaq 0xea355(%rip), %r9      # 0x12c151
xorl %eax, %eax
pushq %rbp
pushq 0x20(%rsp)
callq 0xe8617
addq $0x10, %rsp
jmp 0x41e82
movq -0x8(%rax,%r14), %r9
movq (%rax,%r14), %rax
movq 0x8(%rsp), %rdi
leaq 0xd93f8(%rip), %rsi     # 0x11b21b
movl %r15d, %edx
movq %r13, %rcx
movq %rax, %r13
movl %r12d, %r8d
xorl %eax, %eax
pushq %rbp
pushq 0x20(%rsp)
callq 0xe8617
addq $0x10, %rsp
testq %r13, %r13
je 0x41e82
movq 0x8(%rsp), %r12
movq %r12, %rdi
movl $0x1, %esi
callq 0xe8a15
movq %r12, %rdi
movq 0x10(%rsp), %rsi
leaq 0x20(%rsp), %rdx
callq *%r13
movl %eax, %ebp
movq %r12, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
testl %ebp, %ebp
je 0x41d37
movl 0x20(%rsp), %r12d
cmpl $0xe, %r12d
movq 0x8(%rsp), %r12
je 0x41d37
incq %r15
leaq 0x8(%rbx), %rax
movq 0x18(%r12), %rdi
movq %rbx, %r13
cmpq 0x18(%rdi), %rax
jle 0x41d65
jmp 0x41d26
leaq 0xd9324(%rip), %rsi     # 0x11b1da
movq %r12, %rdi
movl %r15d, %edx
xorl %eax, %eax
callq 0xe9295
jmp 0x41d37
leaq 0xd932f(%rip), %rsi     # 0x11b1fe
movq %r12, %rdi
movq %rbp, %rdx
movq %r13, %rcx
xorl %eax, %eax
callq 0xe9295
jmp 0x41d37