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

Disassembly:
sub esp, 0x78
push ebx
push ebp
push esi
mov esi, ecx
mov eax, dword [esi + 0x1f0]
xor ebx, ebx
push edi
cmp eax, ebx
je 0x511156
push eax
mov eax, dword [esi + 0x20]
push eax
call dword [0x587714]
mov dword [esi + 0x1f0], ebx
mov edi, dword [esp + 0x8c]
mov dword [esi + 0x1f4], ebx
cmp edi, dword [esi + 0x5c]
jne 0x511174
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x78
ret 4
xor eax, eax
lea ecx, [esp + 0x70]
push ecx
mov dword [esp + 0x7c], eax
mov dword [esp + 0x80], eax
mov dword [esp + 0x84], eax
mov ecx, esi
mov dword [esp + 0x74], eax
mov dword [esp + 0x78], eax
mov dword [esp + 0x88], eax
mov dword [esp + 0x84], 0xffffffff
mov dword [esp + 0x7c], 0x80d7
mov dword [esp + 0x80], edi
call fcn.0050bf60
test eax, eax
je 0x5111ce
mov eax, dword [esi + 0x5c]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x78
ret 4
mov ebp, dword [esi + 0x5c]
mov ecx, esi
mov dword [esp + 0x20], ebp
mov dword [esi + 0x5c], edi
call fcn.0050b9c0
cmp byte [eax + 4], bl
je 0x511467
test dword [esi + 0x74], 0x2000
je 0x511467
cmp ebp, ebx
je 0x511467
cmp dword [esi + 0x5c], ebx
je 0x511467
lea edx, [esp + 0x60]
push edx
mov ecx, esi
call fcn.005096f0
push eax
call dword [0x587780]
test eax, eax
jne 0x511467
mov eax, dword [esi + 0x5c]
push eax
mov ecx, esi
call fcn.0050d880
mov ebx, eax
push ebp
mov ecx, esi
mov dword [esp + 0x2c], ebx
call fcn.0050d880
mov edi, eax
mov dword [esp + 0x2c], edi
cmp edi, 0xffffffff
je 0x511460
xor ecx, ecx
cmp edi, ebx
setl cl
push ebp
mov dword [esp + 0x20], ecx
mov ecx, esi
call fcn.0050dd30
lea edx, [esp + 0x60]
push edx
mov ecx, esi
mov dword [esp + 0x38], eax
call fcn.005096f0
mov ecx, dword [esp + 0x6c]
mov ebp, dword [esp + 0x64]
sub ecx, ebp
mov eax, 0x66666667
imul ecx
sar edx, 3
mov ecx, edx
shr ecx, 0x1f
add ecx, edx
lea eax, [ecx - 1]
mov dword [esp + 0x10], 0x14
mov dword [esp + 0x14], 0
mov dword [esp + 0x3c], eax
test eax, eax
jle 0x51145c
mov eax, ecx
cdq
sub eax, edx
sar eax, 1
mov dword [esp + 0x24], eax
mov eax, dword [esp + 0x68]
sub eax, dword [esp + 0x60]
mov dword [esp + 0x30], eax
mov eax, 0x64
cdq
idiv ecx
mov dword [esp + 0x38], eax
lea esp, [esp]
mov eax, dword [esp + 0x14]
cmp eax, dword [esp + 0x24]
jle 0x5112e6
inc dword [esp + 0x14]
mov dword [esp + 0x10], 0x28
mov eax, 0xffff
mov dword [esp + 0x40], eax
mov dword [esp + 0x44], eax
xor eax, eax
cmp edi, ebx
mov dword [esp + 0x48], eax
mov dword [esp + 0x4c], eax
mov eax, edi
jl 0x511305
mov eax, ebx
lea ecx, [eax + 1]
cmp edi, ebx
mov dword [esp + 0x18], ecx
mov eax, edi
jg 0x511314
mov eax, ebx
cmp ecx, eax
jg 0x5113d8
push ecx
mov ecx, esi
call fcn.0050b8e0
lea ecx, [esp + 0x50]
push ecx
mov edi, eax
push edi
mov ecx, esi
call fcn.0050bfc0
mov eax, dword [esp + 0x50]
cmp dword [esp + 0x40], eax
jl 0x511341
mov dword [esp + 0x40], eax
mov eax, dword [esp + 0x54]
cmp dword [esp + 0x44], eax
jl 0x51134f
mov dword [esp + 0x44], eax
mov eax, dword [esp + 0x58]
cmp dword [esp + 0x48], eax
jg 0x51135d
mov dword [esp + 0x48], eax
mov eax, dword [esp + 0x5c]
cmp dword [esp + 0x4c], eax
jg 0x51136b
mov dword [esp + 0x4c], eax
cmp dword [esp + 0x1c], 0
mov eax, dword [esp + 0x10]
je 0x511378
neg eax
push eax
push 0
lea edx, [esp + 0x58]
push edx
call dword [0x5876b4]
mov ecx, dword [esp + 0x54]
cmp dword [esp + 0x44], ecx
jl 0x511394
mov dword [esp + 0x44], ecx
mov edx, dword [esp + 0x5c]
cmp dword [esp + 0x4c], edx
jg 0x5113a2
mov dword [esp + 0x4c], edx
mov ebx, dword [esp + 0x50]
sub esp, 0x10
mov eax, esp
mov dword [eax], ebx
mov dword [eax + 4], ecx
mov ecx, dword [esp + 0x68]
mov dword [eax + 8], ecx
push edi
lea ecx, [esi + 0x138]
mov dword [eax + 0xc], edx
call fcn.0050fa40
mov ecx, dword [esp + 0x18]
mov ebx, dword [esp + 0x28]
mov edi, dword [esp + 0x2c]
inc ecx
jmp 0x511308
cmp dword [esp + 0x1c], 0
je 0x5113e9
mov edx, dword [esp + 0x10]
sub dword [esp + 0x6c], edx
jmp 0x5113ed
add ebp, dword [esp + 0x10]
mov eax, dword [esp + 0x60]
mov ecx, dword [esp + 0x68]
mov edx, dword [esp + 0x30]
mov dword [esi + 0x154], eax
mov dword [esi + 0x158], ebp
mov dword [esi + 0x15c], ecx
mov ecx, dword [esp + 0x6c]
push 0
mov dword [esi + 0x160], ecx
sub ecx, ebp
push ecx
push edx
push ebp
push eax
mov eax, dword [esp + 0x48]
push eax
call dword [0x587678]
mov edx, dword [esi + 0x20]
push 0x105
push 0
lea ecx, [esp + 0x48]
push ecx
push edx
call dword [0x5876e0]
mov eax, dword [esp + 0x38]
push eax
call dword [0x587428]
mov eax, dword [esp + 0x14]
inc eax
cmp eax, dword [esp + 0x3c]
mov dword [esp + 0x14], eax
jl 0x5112d0
mov ebp, dword [esp + 0x20]
mov edi, dword [esp + 0x8c]
mov edx, dword [esi]
mov eax, dword [edx + 0x154]
mov ecx, esi
call eax
push ebp
mov ecx, esi
call fcn.0050f700
mov ecx, dword [esi + 0x20]
push 0x105
push 0
push 0
push ecx
call dword [0x5876e0]
mov edx, dword [esi + 0x5c]
push 1
push edx
mov ecx, esi
call fcn.0050f750
lea eax, [esp + 0x70]
push eax
mov ecx, esi
mov dword [esp + 0x7c], 0x80d5
mov dword [esp + 0x80], edi
call fcn.0050bf60
pop edi
pop esi
mov eax, ebp
pop ebp
pop ebx
add esp, 0x78
ret 4