Function at 0x521850
Capabilities:
Resolve function by parsing pe exports

Disassembly:
push 0xffffffffffffffff
push 0x591428
mov eax, dword fs:[0]
push eax
sub esp, 0x14
push ebx
push ebp
push esi
push edi
mov eax, dword [0x61e69c]
xor eax, esp
push eax
lea eax, [esp + 0x28]
mov dword fs:[0], eax
mov esi, ecx
lea ebx, [esi + 0x2c]
mov ecx, ebx
call fcn.00529870
mov al, byte [esi + 8]
shr al, 3
xor edi, edi
test al, 1
je 0x5218a8
movzx eax, byte [esi + 0x62]
mov dword [esi + 0x20], edi
cmp eax, 1
je 0x5218a8
cmp eax, 2
je 0x5218a8
cmp eax, 3
je 0x5218a8
mov dword [esi + 0x24], edi
movzx ecx, word [esi + 0xa]
lea eax, [esi + 0x70]
mov dword [esp + 0x14], ecx
mov dword [esp + 0x18], eax
cmp dword [eax + 4], edi
je 0x5218c1
cmp dword [eax + 8], edi
ja 0x5218c9
push eax
mov ecx, esi
call fcn.00520c40
cmp dword [esi + 0x84], edi
lea eax, [esi + 0x80]
je 0x5218dc
cmp dword [eax + 8], edi
ja 0x5218e4
push eax
mov ecx, esi
call fcn.00520710
mov eax, dword [esi + 0x88]
cmp eax, 0xffff
jg 0x52190d
cmp dword [esi + 0x78], 0xffff
jg 0x52190d
mov ecx, ebx
call fcn.00529720
cmp eax, 0xffff
setle al
test al, al
jne 0x52191a
mov ecx, dword [esi + 0x68]
push 0xd3
call fcn.00522f00
mov eax, dword [esi + 0x78]
mov ecx, ebx
mov word [esi + 0x60], ax
call fcn.00529720
movzx edx, word [esi + 0x60]
mov ebp, eax
lea eax, [edx + ebp + 0x1e]
push edi
push eax
lea ecx, [esp + 0x24]
mov dword [esi + 0x64], eax
call fcn.00521dc0
mov eax, dword [0x61f74c]
mov cx, word [esp + 0x14]
mov dword [esp + 0x30], edi
mov edi, dword [esp + 0x20]
mov dword [edi], eax
movzx eax, word [esi + 6]
mov word [edi + 4], ax
movzx eax, word [esi + 8]
mov word [edi + 6], ax
mov word [edi + 8], cx
movzx eax, word [esi + 0xc]
mov word [edi + 0xa], ax
movzx eax, word [esi + 0xe]
mov word [edi + 0xc], ax
cmp byte [esi + 0x63], 0
je 0x521982
xor eax, eax
jmp 0x521985
mov eax, dword [esi + 0x10]
mov dword [edi + 0xe], eax
mov eax, dword [esi + 0x20]
mov dword [edi + 0x12], eax
mov eax, dword [esi + 0x24]
mov dword [edi + 0x16], eax
movzx eax, word [esi + 0x60]
mov word [edi + 0x1a], ax
mov word [edi + 0x1c], bp
movzx edx, word [esi + 0x60]
mov eax, dword [esi + 0x74]
push edx
push eax
lea eax, [edi + 0x1e]
push eax
call fcn.00500790
add esp, 0xc
test ebp, ebp
je 0x5219c9
movzx ecx, word [esi + 0x60]
lea edx, [ecx + edi + 0x1e]
push edx
mov ecx, ebx
call fcn.005296d0
mov eax, dword [esi + 0x64]
push 1
push eax
push edi
mov edi, dword [esp + 0x44]
mov ecx, edi
call fcn.00526c60
mov ecx, dword [edi + 0x3c]
and ecx, 0x70
cmp cl, 0x70
jne 0x5219ea
xor eax, eax
jmp 0x5219ee
movzx eax, word [edi + 0x24]
mov ecx, edi
mov word [esi + 0x1c], ax
call fcn.00521340
sub eax, dword [esi + 0x64]
mov ecx, ebx
mov dword [esi + 0x28], eax
call fcn.00529870
mov edi, dword [esp + 0x18]
mov esi, dword [edi + 0xc]
xor ebx, ebx
cmp esi, ebx
je 0x521a41
cmp dword [esi + 0x18], 8
jb 0x521a25
mov eax, dword [esi + 4]
push eax
call fcn.004f6734
add esp, 4
xor edx, edx
mov dword [esi + 0x18], 7
mov dword [esi + 0x14], ebx
push esi
mov word [esi + 4], dx
call fcn.004f6734
add esp, 4
mov dword [edi + 0xc], ebx
lea ecx, [esp + 0x1c]
mov dword [esp + 0x30], 0xffffffff
call fcn.00521df0
mov ecx, dword [esp + 0x28]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x20
ret 4