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

Disassembly:
push 0xffffffffffffffff
push 0x574e2c
mov eax, dword fs:[0]
push eax
sub esp, 0xc8
push ebx
push ebp
push esi
push edi
mov eax, dword [0x668038]
xor eax, esp
push eax
lea eax, [esp + 0xdc]
mov dword fs:[0], eax
mov ebp, dword [esp + 0xec]
call fcn.00517fb0
mov esi, eax
mov eax, dword [esi + 0x10]
sub eax, dword [esi + 0xc]
sar eax, 1
mov dword [esp + 0x1c], eax
jne 0x5160af
call dword [sym.imp.MSVCR90.dll__invalid_parameter_noinfo]
mov ebx, dword [esi + 0xc]
push 1
lea edi, [esp + 0x40]
mov dword [esp + 0x24], ebx
call fcn.004f5740
lea eax, [esp + 0xa0]
push ebp
lea edi, [ebp + 0x14]
push eax
mov dword [esp + 0xec], 0
call fcn.004d6fd0
lea esi, [ebp + 0x28]
lea ecx, [esp + 0x94]
push esi
push ecx
mov ecx, eax
mov byte [esp + 0xf4], 1
call fcn.004d7090
lea edx, [esp + 0x4c]
push edx
lea ecx, [esp + 0xc8]
push ecx
mov edi, eax
mov byte [esp + 0xfc], 2
call fcn.004d6f70
add esp, 0x18
mov dword [esp + 0x18], eax
push 0x8000
lea edi, [esp + 0x7c]
mov byte [esp + 0xe8], 3
call fcn.004f5740
mov edi, eax
mov eax, dword [esp + 0x18]
mov edx, edi
call fcn.004d6f20
test al, al
je 0x516146
mov edi, dword [esp + 0x18]
cmp dword [edi + 0x10], 0
mov eax, dword [edi + 0xc]
mov eax, dword [eax]
je 0x516153
neg eax
lea ecx, [esp + 0x78]
mov dword [esp + 0x18], eax
call fcn.004d6df0
lea ecx, [esp + 0xb4]
mov byte [esp + 0xe4], 2
call fcn.004d6df0
lea ecx, [esp + 0x8c]
mov byte [esp + 0xe4], 1
call fcn.004d6df0
lea ecx, [esp + 0xa0]
mov byte [esp + 0xe4], 0
call fcn.004d6df0
lea ecx, [esp + 0x3c]
mov dword [esp + 0xe4], 0xffffffff
call fcn.004d6df0
lea edi, [ebp + 0x44]
call fcn.00517490
lea eax, [ebp + 0x44]
push eax
mov eax, dword [esp + 0x1c]
call fcn.00517300
mov eax, dword [ebp + 0x3c]
test eax, eax
jne 0x516206
xor edi, edi
cmp dword [esp + 0x1c], edi
jbe 0x516318
movzx edx, word [ebx + edi*2]
push edx
mov eax, esi
call fcn.004f8ef0
movzx ecx, word [ebx + edi*2]
push esi
push ecx
lea ecx, [ebp + 0x44]
push ecx
mov ecx, eax
mov edx, ebp
call fcn.00515e70
inc edi
add esp, 0xc
cmp edi, dword [esp + 0x1c]
jb 0x5161d8
jmp 0x516318
push eax
lea edi, [esp + 0x54]
call fcn.004f5740
mov edx, edi
push edx
lea eax, [esp + 0xcc]
push eax
mov edi, ebp
mov dword [esp + 0xec], 4
call fcn.004d6fd0
add esp, 8
push 1
lea ecx, [esp + 0x68]
push ecx
push eax
mov byte [esp + 0xf0], 5
call fcn.004e8350
lea ecx, [esp + 0xc8]
mov byte [esp + 0xe4], 7
call fcn.004d6df0
lea ecx, [esp + 0x50]
mov byte [esp + 0xe4], 8
call fcn.004d6df0
push 1
lea edx, [esp + 0x2c]
push edx
push esi
call fcn.004e8350
cmp dword [esp + 0x1c], 0
mov byte [esp + 0xe4], 9
mov dword [esp + 0x18], 0
jbe 0x5162f3
jmp 0x516294
mov ebx, dword [esp + 0x20]
mov eax, dword [esp + 0x18]
movzx edi, word [ebx + eax*2]
movzx ebx, di
push ebx
mov eax, esi
call fcn.004f8ef0
movzx ecx, ax
push esi
lea eax, [ebp + 0x44]
push edi
push eax
mov edx, ebp
mov dword [esp + 0x30], ecx
call fcn.00515e70
movzx eax, word [esp + 0x30]
add eax, eax
add esp, 0xc
cmp eax, ebx
jl 0x5162cb
sub eax, ebx
lea edx, [esp + 0x28]
push edx
movzx ecx, ax
lea eax, [ebp + 0x44]
push edi
push eax
lea edx, [esp + 0x70]
call fcn.00515e70
mov eax, dword [esp + 0x24]
inc eax
add esp, 0xc
mov dword [esp + 0x18], eax
cmp eax, dword [esp + 0x1c]
jb 0x516290
lea ecx, [esp + 0x28]
mov byte [esp + 0xe4], 8
call fcn.004d6df0
lea ecx, [esp + 0x64]
mov dword [esp + 0xe4], 0xffffffff
call fcn.004d6df0
mov ecx, dword [esp + 0xdc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xd4
ret 4