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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff0
sub esp, 0x194
mov eax, dword [0x5b16b0]
xor eax, esp
mov dword [esp + 0x190], eax
mov edx, dword [ebp + 0x14]
mov ecx, dword [ebp + 0x18]
mov eax, dword [ebp + 8]
push ebx
mov dword [esp + 0x38], edx
mov edx, dword [edx*4 + 0x589550]
lea ecx, [ecx + ecx*2 + 0xde]
push esi
mov dword [esp + 0x18], eax
shl ecx, 4
add edx, ecx
lea eax, [eax + edx*4]
push edi
mov edi, dword [ebp + 0xc]
mov ecx, dword [edi]
mov edx, dword [ecx*4 + 0x589a28]
mov dword [esp + 0x64], eax
lea eax, [eax + edx*2]
mov dword [esp + 0x60], eax
mov eax, dword [ecx*8 + 0x5893d0]
sar eax, 2
mov dword [esp + 0x44], eax
mov eax, dword [ecx*8 + 0x5893d4]
sar eax, 2
test ecx, ecx
mov dword [esp + 0x68], ecx
mov dword [esp + 0x58], eax
jne 0x510e2d
mov eax, dword [edi + 0x48]
cdq
mov dword [esp + 0x38], eax
mov dword [esp + 0x3c], edx
jmp 0x510e3d
mov dword [esp + 0x38], 0
mov dword [esp + 0x3c], 0x10000000
test ecx, ecx
movsx ebx, word [edi + 0x4c]
movsx esi, word [edi + 0x4e]
je 0x510e6f
cmp dword [esp + 0x40], 0
je 0x510e6f
mov edx, dword [esp + 0x44]
mov eax, dword [esp + 0x40]
lea ecx, [edi + 0x40]
push ecx
mov ecx, dword [ebp + 0x18]
push edx
mov edx, dword [esp + 0x24]
push eax
push ecx
push edx
call fcn.004cb730
add esp, 0x14
movsx eax, word [edi + 0x40]
movsx ecx, word [edi + 0x42]
lea edx, [eax + eax]
mov dword [esp + 0x30], eax
mov eax, dword [edi + 4]
mov dword [esp + 0x2c], ecx
mov ecx, eax
sub ecx, edx
mov dword [esp + 0x5c], ecx
mov ecx, dword [esp + 0x2c]
add ecx, ecx
sub eax, ecx
mov ecx, dword [esp + 0x44]
mov dword [esp + 0x48], eax
mov eax, dword [esp + 0x58]
add eax, eax
add eax, eax
push eax
mov eax, dword [edi + 0x38]
add ecx, ecx
add ecx, ecx
push ecx
push esi
push ebx
push eax
mov eax, dword [esp + 0x30]
lea edx, [edi + 0x10]
push edx
lea ecx, [esp + 0x30]
push ecx
mov ecx, dword [eax + 0x4cd0]
lea edx, [esp + 0xac]
push edx
mov dword [esp + 0x38], 0x10
call ecx
mov edx, dword [esp + 0x38]
mov ecx, dword [esp + 0x3c]
push edx
mov edx, dword [esp + 0x8c]
push eax
mov eax, dword [edi + 0x28]
push 0x10
push eax
mov eax, dword [ecx + edx*4 + 0x4b5c]
call eax
mov ecx, dword [esp + 0x78]
movsx edx, word [ecx + esi*2]
mov ecx, dword [esp + 0x8c]
add eax, edx
movsx edx, word [ecx + ebx*2]
add eax, edx
mov edx, dword [esp + 0x90]
mov dword [esp + 0x64], eax
movzx ecx, bx
mov eax, esi
shl eax, 0x10
add eax, ecx
mov ecx, dword [esp + 0x94]
mov dword [edx], eax
mov dword [ecx], eax
mov edx, dword [edi]
mov eax, dword [esp + 0x70]
mov ecx, dword [ebp + 0x10]
push edx
mov edx, dword [esp + 0x50]
push eax
push ecx
push edx
call fcn.004e3190
add esp, 0x40
cmp edx, dword [esp + 0x3c]
ja 0x510f5c
jb 0x510f54
cmp eax, dword [esp + 0x38]
jae 0x510f5c
mov dword [esp + 0x38], eax
mov dword [esp + 0x3c], edx
cmp ebx, dword [esp + 0x30]
jne 0x510f6c
cmp esi, dword [esp + 0x2c]
je 0x5110ca
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x30]
cmp ecx, dword [eax + 0x1f34]
jl 0x5110ca
mov edx, ecx
cmp edx, dword [eax + 0x1f3c]
jg 0x5110ca
mov ecx, dword [esp + 0x2c]
mov edx, eax
cmp ecx, dword [edx + 0x1f38]
jl 0x5110ca
mov eax, ecx
mov ecx, edx
cmp eax, dword [ecx + 0x1f40]
jg 0x5110ca
mov eax, dword [esp + 0x58]
mov edx, dword [esp + 0x2c]
mov ecx, dword [edi + 0x38]
add eax, eax
add eax, eax
push eax
mov eax, dword [esp + 0x48]
add eax, eax
add eax, eax
push eax
mov eax, dword [esp + 0x38]
push edx
push eax
push ecx
mov ecx, dword [esp + 0x30]
lea eax, [edi + 0x10]
push eax
lea edx, [esp + 0x30]
push edx
mov edx, dword [ecx + 0x4cd0]
lea eax, [esp + 0xac]
push eax
mov dword [esp + 0x38], 0x10
call edx
mov ecx, dword [esp + 0x38]
mov edx, dword [edi + 0x28]
push ecx
mov ecx, dword [esp + 0x8c]
push eax
mov eax, dword [esp + 0x44]
push 0x10
push edx
mov edx, dword [eax + ecx*4 + 0x4b5c]
call edx
mov ecx, dword [esp + 0x5c]
mov edx, dword [esp + 0x78]
add ecx, ecx
movsx ecx, word [ecx + edx]
mov edx, dword [esp + 0x8c]
add eax, ecx
mov ecx, dword [esp + 0x60]
add ecx, ecx
movsx ecx, word [ecx + edx]
add eax, ecx
add esp, 0x30
cmp eax, dword [esp + 0x34]
jae 0x511049
mov ecx, eax
mov dword [esp + 0x34], ecx
jmp 0x51104d
mov ecx, dword [esp + 0x34]
mov edx, ecx
shl edx, 4
add edx, ecx
shr edx, 4
cmp eax, edx
ja 0x5110ae
movzx ecx, word [esp + 0x30]
mov eax, dword [esp + 0x2c]
mov edx, dword [esp + 0x60]
shl eax, 0x10
add eax, ecx
mov ecx, dword [esp + 0x64]
mov dword [edx], eax
mov dword [ecx], eax
mov edx, dword [edi]
mov eax, dword [esp + 0x40]
mov ecx, dword [ebp + 0x10]
push edx
mov edx, dword [esp + 0x20]
push eax
push ecx
push edx
call fcn.004e3190
add esp, 0x10
cmp edx, dword [esp + 0x3c]
ja 0x5110ae
jb 0x51109c
cmp eax, dword [esp + 0x38]
jae 0x5110ae
mov ebx, dword [esp + 0x30]
mov esi, dword [esp + 0x2c]
mov dword [esp + 0x38], eax
mov dword [esp + 0x3c], edx
jmp 0x5110ba
cmp ebx, dword [esp + 0x30]
jne 0x5110ca
cmp esi, dword [esp + 0x2c]
jne 0x5110ca
movsx eax, word [edi + 0x4c]
movsx ecx, word [edi + 0x4e]
mov dword [esp + 0x30], eax
mov dword [esp + 0x2c], ecx
lea edx, [esp + 0x70]
mov ecx, 0x5898c0
mov dword [esp + 0x28], 0xfffffffe
mov dword [esp + 0x4c], ebx
mov dword [esp + 0x54], esi
mov dword [esp + 0x24], edx
mov dword [esp + 0x20], ecx
jmp 0x5110f0
mov eax, dword [ecx]
add eax, ebx
cmp eax, dword [esp + 0x30]
jne 0x511114
mov edx, dword [ecx + 4]
add edx, esi
cmp edx, dword [esp + 0x2c]
jne 0x511114
mov eax, dword [esp + 0x24]
mov dword [eax], 0x10000000
jmp 0x5111b9
mov ecx, dword [esp + 0x58]
add ecx, ecx
add ecx, ecx
push ecx
mov ecx, dword [esp + 0x48]
add ecx, ecx
add ecx, ecx
push ecx
mov ecx, dword [esp + 0x28]
mov edx, dword [ecx + 4]
add edx, esi
push edx
push eax
mov eax, dword [edi + 0x38]
push eax
lea eax, [edi + 0x10]
push eax
mov eax, dword [esp + 0x34]
lea ecx, [esp + 0x30]
push ecx
mov ecx, dword [eax + 0x4cd0]
lea edx, [esp + 0xac]
push edx
mov dword [esp + 0x38], 0x10
call ecx
mov edx, dword [esp + 0x38]
mov ecx, dword [esp + 0x3c]
push edx
mov edx, dword [esp + 0x8c]
push eax
mov eax, dword [edi + 0x28]
push 0x10
push eax
mov eax, dword [ecx + edx*4 + 0x4b5c]
call eax
mov ecx, dword [esp + 0x50]
mov edx, dword [ecx + 4]
mov ecx, dword [esp + 0x78]
add edx, esi
movsx edx, word [ecx + edx*2]
mov ecx, dword [esp + 0x50]
add eax, edx
mov edx, dword [ecx]
mov ecx, dword [esp + 0x8c]
add edx, ebx
movsx edx, word [ecx + edx*2]
mov ecx, dword [esp + 0x54]
add eax, edx
add esp, 0x30
cmp eax, dword [esp + 0x34]
mov dword [ecx], eax
mov ecx, dword [esp + 0x20]
jae 0x5111b9
mov dword [esp + 0x34], eax
add dword [esp + 0x24], 4
add ecx, 8
cmp ecx, 0x5898f0
mov dword [esp + 0x20], ecx
jl 0x5110f0
mov ecx, dword [esp + 0x34]
mov eax, ecx
shl eax, 4
add eax, ecx
shr eax, 4
mov dword [esp + 0x20], 0
mov dword [esp + 0x24], eax
jmp 0x5111f0
mov edx, dword [esp + 0x24]
mov eax, dword [esp + 0x20]
cmp dword [esp + eax*4 + 0x70], edx
ja 0x51127b
mov ecx, dword [eax*8 + 0x5898c0]
mov edx, dword [eax*8 + 0x5898c4]
add ecx, dword [esp + 0x4c]
add edx, dword [esp + 0x54]
and ecx, 0xffff
shl edx, 0x10
lea eax, [ecx + edx]
mov ecx, dword [esp + 0x60]
mov edx, dword [esp + 0x64]
mov dword [ecx], eax
mov ecx, dword [esp + 0x40]
mov dword [edx], eax
mov eax, dword [edi]
mov edx, dword [ebp + 0x10]
push eax
mov eax, dword [esp + 0x20]
push ecx
push edx
push eax
call fcn.004e3190
add esp, 0x10
cmp edx, dword [esp + 0x3c]
ja 0x51127b
jb 0x511253
cmp eax, dword [esp + 0x38]
jae 0x51127b
mov dword [esp + 0x38], eax
mov eax, dword [esp + 0x20]
mov ebx, dword [eax*8 + 0x5898c0]
mov esi, dword [eax*8 + 0x5898c4]
add ebx, dword [esp + 0x4c]
add esi, dword [esp + 0x54]
mov dword [esp + 0x3c], edx
mov dword [esp + 0x28], eax
jmp 0x51127f
mov eax, dword [esp + 0x20]
add eax, 1
cmp eax, 6
mov dword [esp + 0x20], eax
jl 0x5111f0
cmp dword [esp + 0x28], 0xfffffffe
je 0x5114cb
mov dword [esp + 0x50], 1
mov eax, dword [esp + 0x1c]
mov edx, dword [eax + 0x1f40]
mov ecx, dword [esp + 0x28]
mov ecx, dword [ecx*4 + 0x58989c]
sub edx, 2
cmp esi, edx
mov dword [esp + 0x6c], ecx
jg 0x5114cb
mov eax, dword [eax + 0x1f38]
sub eax, 2
cmp esi, eax
jl 0x5114cb
xor edx, edx
lea ecx, [ecx*8 + 0x5898b8]
mov dword [esp + 0x28], 0xfffffffe
mov dword [esp + 0x4c], ebx
mov dword [esp + 0x54], esi
mov dword [esp + 0x20], edx
mov dword [esp + 0x24], ecx
mov eax, dword [ecx]
add eax, ebx
cmp eax, dword [esp + 0x30]
jne 0x51131a
mov ecx, dword [ecx + 4]
add ecx, esi
cmp ecx, dword [esp + 0x2c]
jne 0x51131a
mov dword [esp + edx*4 + 0x70], 0x10000000
jmp 0x5113bd
mov ecx, dword [esp + 0x58]
mov edx, dword [esp + 0x24]
add ecx, ecx
add ecx, ecx
push ecx
mov ecx, dword [esp + 0x48]
add ecx, ecx
add ecx, ecx
push ecx
mov ecx, dword [edx + 4]
mov edx, dword [edi + 0x38]
add ecx, esi
push ecx
push eax
push edx
mov edx, dword [esp + 0x30]
lea eax, [edi + 0x10]
push eax
lea eax, [esp + 0x30]
push eax
mov eax, dword [edx + 0x4cd0]
lea ecx, [esp + 0xac]
push ecx
mov dword [esp + 0x38], 0x10
call eax
mov ecx, dword [esp + 0x38]
mov edx, dword [edi + 0x28]
push ecx
mov ecx, dword [esp + 0x8c]
push eax
mov eax, dword [esp + 0x44]
push 0x10
push edx
mov edx, dword [eax + ecx*4 + 0x4b5c]
call edx
mov ecx, dword [esp + 0x54]
mov edx, dword [ecx]
mov ecx, dword [esp + 0x8c]
add edx, ebx
movsx edx, word [ecx + edx*2]
mov ecx, dword [esp + 0x54]
add eax, edx
mov edx, dword [ecx + 4]
mov ecx, dword [esp + 0x78]
add edx, esi
movsx edx, word [ecx + edx*2]
mov ecx, dword [esp + 0x50]
add eax, edx
add esp, 0x30
cmp eax, dword [esp + 0x34]
mov dword [esp + ecx*4 + 0x70], eax
jae 0x5113bd
mov dword [esp + 0x34], eax
mov edx, dword [esp + 0x20]
mov ecx, dword [esp + 0x24]
add edx, 1
add ecx, 8
cmp edx, 3
mov dword [esp + 0x20], edx
mov dword [esp + 0x24], ecx
jl 0x5112f8
mov ecx, dword [esp + 0x34]
mov edx, dword [esp + 0x6c]
mov eax, ecx
shl eax, 4
add eax, ecx
shr eax, 4
mov dword [esp + 0x24], eax
lea eax, [edx*8 + 0x5898bc]
mov dword [esp + 0x20], 0
mov dword [esp + 0x18], eax
jmp 0x511410
mov ecx, dword [esp + 0x24]
mov edx, dword [esp + 0x20]
cmp dword [esp + edx*4 + 0x70], ecx
ja 0x511497
mov eax, dword [esp + 0x18]
mov ecx, dword [eax - 4]
mov edx, dword [eax]
add ecx, dword [esp + 0x4c]
add edx, dword [esp + 0x54]
and ecx, 0xffff
shl edx, 0x10
lea eax, [ecx + edx]
mov ecx, dword [esp + 0x60]
mov edx, dword [esp + 0x64]
mov dword [ecx], eax
mov ecx, dword [esp + 0x40]
mov dword [edx], eax
mov eax, dword [edi]
mov edx, dword [ebp + 0x10]
push eax
mov eax, dword [esp + 0x20]
push ecx
push edx
push eax
call fcn.004e3190
add esp, 0x10
cmp edx, dword [esp + 0x3c]
ja 0x511497
jb 0x51146e
cmp eax, dword [esp + 0x38]
jae 0x511497
mov ecx, dword [esp + 0x6c]
mov dword [esp + 0x38], eax
mov eax, dword [esp + 0x18]
mov ebx, dword [eax - 4]
mov esi, dword [eax]
add ebx, dword [esp + 0x4c]
add esi, dword [esp + 0x54]
mov dword [esp + 0x3c], edx
mov edx, dword [esp + 0x20]
lea eax, [ecx + edx - 1]
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x20]
add dword [esp + 0x18], 8
add eax, 1
cmp eax, 3
mov dword [esp + 0x20], eax
jl 0x511410
cmp dword [esp + 0x28], 0xfffffffe
je 0x5114cb
mov eax, dword [esp + 0x50]
add eax, 1
cmp eax, 0xa
mov dword [esp + 0x50], eax
jl 0x5112a2
lea ecx, [esp + 0x70]
mov dword [esp + 0x18], ecx
mov ecx, 0x5898f8
mov dword [esp + 0x4c], ebx
mov dword [esp + 0x54], esi
mov dword [esp + 0x28], ecx
mov edx, dword [ecx]
lea eax, [edx + ebx]
cmp eax, dword [esp + 0x30]
jne 0x511509
mov edx, dword [ecx + 4]
add edx, esi
cmp edx, dword [esp + 0x2c]
jne 0x511509
mov eax, dword [esp + 0x18]
mov dword [eax], 0x10000000
jmp 0x5115ae
mov ecx, dword [esp + 0x58]
add ecx, ecx
add ecx, ecx
push ecx
mov ecx, dword [esp + 0x48]
add ecx, ecx
add ecx, ecx
push ecx
mov ecx, dword [esp + 0x30]
mov edx, dword [ecx + 4]
add edx, esi
push edx
push eax
mov eax, dword [edi + 0x38]
push eax
lea eax, [edi + 0x10]
push eax
mov eax, dword [esp + 0x34]
lea ecx, [esp + 0x68]
push ecx
mov ecx, dword [eax + 0x4cd0]
lea edx, [esp + 0xac]
push edx
mov dword [esp + 0x70], 0x10
call ecx
mov edx, dword [esp + 0x70]
mov ecx, dword [esp + 0x3c]
push edx
mov edx, dword [esp + 0x8c]
push eax
mov eax, dword [edi + 0x28]
push 0x10
push eax
mov eax, dword [ecx + edx*4 + 0x4b5c]
call eax
mov ecx, dword [esp + 0x58]
mov edx, dword [ecx]
mov ecx, dword [esp + 0x8c]
add edx, ebx
movsx edx, word [ecx + edx*2]
mov ecx, dword [esp + 0x58]
add eax, edx
mov edx, dword [ecx + 4]
mov ecx, dword [esp + 0x78]
add edx, esi
movsx edx, word [ecx + edx*2]
mov ecx, dword [esp + 0x48]
add eax, edx
add esp, 0x30
cmp eax, dword [esp + 0x34]
mov dword [ecx], eax
mov ecx, dword [esp + 0x28]
jae 0x5115ae
mov dword [esp + 0x34], eax
add dword [esp + 0x18], 4
add ecx, 8
cmp ecx, 0x589938
mov dword [esp + 0x28], ecx
jl 0x5114e4
mov ecx, dword [esp + 0x34]
mov eax, ecx
shl eax, 4
add eax, ecx
shr eax, 4
lea edx, [esp + 0x70]
mov dword [esp + 0x24], eax
mov dword [esp + 0x18], 0x5898fc
mov dword [esp + 0x48], edx
jmp 0x5115f0
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x48]
cmp dword [ecx], eax
ja 0x511666
mov eax, dword [esp + 0x18]
mov edx, dword [eax - 4]
mov eax, dword [eax]
add eax, dword [esp + 0x54]
add edx, dword [esp + 0x4c]
mov ecx, dword [esp + 0x60]
and edx, 0xffff
shl eax, 0x10
add eax, edx
mov edx, dword [esp + 0x64]
mov dword [ecx], eax
mov ecx, dword [esp + 0x40]
mov dword [edx], eax
mov eax, dword [edi]
mov edx, dword [ebp + 0x10]
push eax
mov eax, dword [esp + 0x20]
push ecx
push edx
push eax
call fcn.004e3190
add esp, 0x10
cmp edx, dword [esp + 0x3c]
ja 0x511666
jb 0x51164b
cmp eax, dword [esp + 0x38]
jae 0x511666
mov dword [esp + 0x38], eax
mov eax, dword [esp + 0x18]
mov ebx, dword [eax - 4]
mov esi, dword [eax]
add ebx, dword [esp + 0x4c]
add esi, dword [esp + 0x54]
mov dword [esp + 0x3c], edx
jmp 0x51166a
mov eax, dword [esp + 0x18]
add dword [esp + 0x48], 4
add eax, 8
cmp eax, 0x58993c
mov dword [esp + 0x18], eax
jl 0x5115f0
mov eax, dword [esp + 0x1c]
mov ecx, dword [eax + 0x1f40]
mov eax, dword [eax + 0x1f38]
cmp esi, eax
jge 0x511699
mov esi, eax
jmp 0x51169f
cmp esi, ecx
jle 0x51169f
mov esi, ecx
mov ecx, dword [esp + 0x38]
mov dword [edi + 0x48], ecx
mov ecx, dword [ebp + 0x18]
movzx edx, bx
mov eax, esi
shl eax, 0x10
add eax, edx
mov edx, dword [esp + 0x40]
lea ecx, [ecx + ecx*2]
add ecx, ecx
mov word [edi + 0x4c], bx
mov word [edi + 0x4e], si
movzx edx, byte [edx + 0x589728]
add edx, ecx
mov dword [esp + 0x6c], ecx
mov ecx, dword [esp + 0x40]
movzx ecx, byte [ecx + 0x589718]
lea edx, [ecx + edx*8]
mov ecx, dword [esp + 0x1c]
lea ecx, [ecx + edx*4 + 0x37b0]
mov edx, dword [esp + 0x58]
test edx, edx
jle 0x511727
add ecx, 8
mov dword [esp + 0x50], edx
lea esp, [esp]
mov edx, dword [esp + 0x44]
cmp edx, 2
mov dword [ecx - 8], eax
jl 0x51170f
mov dword [ecx - 4], eax
cmp edx, 4
jne 0x511719
mov dword [ecx], eax
mov dword [ecx + 4], eax
add ecx, 0x20
sub dword [esp + 0x50], 1
jne 0x511700
mov edx, dword [esp + 0x58]
movsx eax, word [edi + 0x42]
mov ecx, dword [esp + 0x44]
sub esi, eax
movzx eax, word [edi + 0x40]
sub ebx, eax
mov eax, dword [esp + 0x40]
movzx edi, byte [eax + 0x589728]
add edi, dword [esp + 0x6c]
movzx eax, byte [eax + 0x589718]
shl esi, 0x10
and ebx, 0xffff
lea eax, [eax + edi*8]
mov edi, dword [esp + 0x1c]
add esi, ebx
test edx, edx
lea eax, [edi + eax*4 + 0x3930]
jle 0x51178d
add eax, 8
lea ecx, [ecx]
cmp ecx, 2
mov dword [eax - 8], esi
jl 0x51177b
mov dword [eax - 4], esi
cmp ecx, 4
jne 0x511785
mov dword [eax], esi
mov dword [eax + 4], esi
add eax, 0x20
sub edx, 1
jne 0x511770
mov ecx, dword [esp + 0x19c]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.00499441
mov esp, ebp
pop ebp
ret