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

Disassembly:
push 0xffffffffffffffff
push 0x5433b0
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x90
mov eax, dword [0x57f188]
push ebx
push ebp
push esi
mov ecx, dword [eax]
push edi
push 0x10070002
push eax
call dword [ecx + 0xc]
mov esi, eax
test esi, esi
mov dword [esp + 0x44], esi
mov dword [esp + 0x9c], esi
je 0x5185cc
mov edx, dword [esi]
push 0x7fffffff
push 1
push esi
call dword [edx]
test esi, esi
mov dword [esp + 0xa8], 0
jne 0x5185e2
xor eax, eax
jmp 0x518c6b
mov eax, dword [esp + 0xb8]
lea ecx, [esp + 0x2c]
mov dword [esp + 0x34], eax
mov dword [esp + 0x38], eax
call fcn.0050c660
mov ecx, dword [esp + 0x34]
xor eax, eax
imul ecx, dword [esp + 0x38]
test ecx, ecx
mov byte [esp + 0xa8], 1
jle 0x51862b
mov edx, dword [esp + 0x2c]
inc eax
mov dword [edx + eax*4 - 4], 1
mov ecx, dword [esp + 0x34]
imul ecx, dword [esp + 0x38]
cmp eax, ecx
jl 0x518611
mov ebx, dword [esp + 0xb0]
mov edi, dword [esi]
push ebx
mov edx, dword [ebx]
call dword [edx + 0x18]
push eax
mov eax, dword [ebx]
push ebx
call dword [eax + 0x14]
push eax
push esi
call dword [edi + 0x2c]
mov edi, eax
test edi, edi
mov dword [esp + 0x5c], edi
mov dword [esp + 0x98], edi
je 0x518663
mov ecx, dword [edi]
push 0x7fffffff
push 1
push edi
call dword [ecx]
test edi, edi
jne 0x518697
lea ecx, [esp + 0x2c]
mov byte [esp + 0xa8], 0
call fcn.004f7080
mov edx, dword [esi]
push 0x7fffffff
push 1
push esi
mov dword [esp + 0xb4], 0xffffffff
call dword [edx + 4]
xor eax, eax
jmp 0x518c6b
mov ecx, dword [esp + 0xb4]
mov eax, dword [ecx + 4]
mov ecx, dword [ecx]
mov dword [esp + 0x24], eax
cdq
sub eax, edx
mov esi, eax
mov eax, ecx
cdq
sub eax, edx
sar esi, 1
mov ebp, eax
mov eax, esi
neg eax
sar ebp, 1
mov dword [esp + 0x8c], eax
mov eax, ebp
neg eax
test cl, 1
mov dword [esp + 0x94], esi
mov dword [esp + 0x14], eax
jle 0x5186e4
xor eax, eax
test ecx, ecx
setle al
dec eax
and eax, 2
dec eax
add ebp, eax
mov eax, dword [esp + 0x24]
test al, 1
jle 0x518701
xor ecx, ecx
test eax, eax
setle cl
dec ecx
and ecx, 2
dec ecx
add ecx, esi
mov dword [esp + 0x94], ecx
mov dword [esp + 0x64], 0
lea edx, [esp + 0x43]
lea ecx, [esp + 0x68]
push edx
mov byte [esp + 0xac], 4
call fcn.0050e020
push ebx
lea ecx, [esp + 0x68]
mov byte [esp + 0xac], 6
call fcn.0050b2d0
mov dword [esp + 0x4c], 0
lea eax, [esp + 0x13]
lea ecx, [esp + 0x50]
push eax
mov byte [esp + 0xac], 9
call fcn.0050e020
push edi
lea ecx, [esp + 0x50]
mov byte [esp + 0xac], 0xb
call fcn.0050b2d0
mov ecx, dword [ebx]
push ebx
mov byte [esp + 0xac], 0xc
xor edi, edi
call dword [ecx + 0x14]
test eax, eax
jle 0x5187c5
mov edx, dword [ebx]
push ebx
xor esi, esi
call dword [edx + 0x18]
test eax, eax
jle 0x5187ba
mov eax, dword [esp + 0x68]
mov eax, dword [eax + esi*4]
mov ecx, dword [eax + edi*4]
mov eax, dword [esp + 0xbc]
shr ecx, 0x18
cmp ecx, eax
mov ecx, 0x582c94
jb 0x5187a3
mov ecx, 0x582c98
mov edx, dword [esp + 0x50]
mov ecx, dword [ecx]
push ebx
mov eax, dword [edx + esi*4]
inc esi
mov dword [eax + edi*4], ecx
mov edx, dword [ebx]
call dword [edx + 0x18]
cmp esi, eax
jl 0x518781
mov eax, dword [ebx]
push ebx
inc edi
call dword [eax + 0x14]
cmp edi, eax
jl 0x518775
mov ecx, dword [esp + 0xbc]
mov esi, dword [esp + 0x5c]
lea edx, [esp + 0x2c]
push ecx
push edx
push esi
call fcn.00516fc0
add esp, 0xc
test al, al
jne 0x51888c
lea ecx, [esp + 0x50]
mov byte [esp + 0xa8], 0xd
call fcn.00418e50
mov eax, dword [esp + 0x4c]
mov byte [esp + 0xa8], 7
test eax, eax
je 0x518815
mov ecx, dword [eax]
push 0x7fffffff
push 1
push eax
call dword [ecx + 4]
lea ecx, [esp + 0x68]
mov byte [esp + 0xa8], 0xe
call fcn.00418e50
mov eax, dword [esp + 0x64]
mov byte [esp + 0xa8], 2
test eax, eax
je 0x518843
mov edx, dword [eax]
push 0x7fffffff
push 1
push eax
call dword [edx + 4]
mov eax, dword [esi]
push 0x7fffffff
push 1
push esi
mov byte [esp + 0xb4], 1
call dword [eax + 4]
lea ecx, [esp + 0x2c]
mov byte [esp + 0xa8], 0
call fcn.004f7080
mov eax, dword [esp + 0x44]
push 0x7fffffff
push 1
push eax
mov ecx, dword [eax]
mov dword [esp + 0xb4], 0xffffffff
call dword [ecx + 4]
xor eax, eax
jmp 0x518c6b
mov esi, dword [esp + 0x44]
mov edx, dword [ebx]
push ebx
mov edi, dword [esi]
call dword [edx + 0x18]
push eax
mov eax, dword [ebx]
push ebx
call dword [eax + 0x14]
push eax
push esi
call dword [edi + 0x2c]
mov edi, eax
xor esi, esi
cmp edi, esi
mov dword [esp + 0x28], edi
je 0x518b70
lea ecx, [esp + 0x13]
mov byte [esp + 0xa8], 0xf
push ecx
lea ecx, [esp + 0x7c]
call fcn.0050e020
push edi
lea ecx, [esp + 0x78]
mov byte [esp + 0xac], 0x11
call fcn.005162c0
mov edx, dword [ebx]
push ebx
mov byte [esp + 0xac], 0x12
mov dword [esp + 0x28], esi
call dword [edx + 0x14]
test eax, eax
jle 0x518b3e
mov eax, dword [esp + 0x14]
lea ecx, [ebp*4]
sub ebp, eax
mov dword [esp + 0x18], eax
mov dword [esp + 0x3c], ecx
mov dword [esp + 0x84], ebp
mov edx, dword [ebx]
push ebx
xor edi, edi
call dword [edx + 0x18]
test eax, eax
jle 0x518b0a
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x8c]
add ebp, eax
mov eax, dword [esp + 0x94]
lea edx, [ecx*4]
mov dword [esp + 0x60], ebp
mov dword [esp + 0x14], edx
lea edx, [eax*4]
sub eax, ecx
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x48], edx
mov dword [esp + 0x88], eax
jmp 0x518966
mov eax, dword [esp + 0x88]
mov ecx, dword [esp + 0x60]
test ecx, ecx
jl 0x5189a3
mov ecx, dword [esp + 0x1c]
lea ebp, [eax + ecx]
test ebp, ebp
jl 0x5189a3
mov edx, dword [ebx]
push ebx
call dword [edx + 0x14]
cmp dword [esp + 0x60], eax
jge 0x5189a3
mov eax, dword [ebx]
push ebx
call dword [eax + 0x18]
cmp ebp, eax
jge 0x5189a3
mov ecx, dword [esp + 0x48]
mov edx, dword [esp + 0x50]
mov eax, dword [ecx + edx]
mov ecx, dword [esp + 0x3c]
mov ebp, dword [ecx + eax]
jmp 0x5189ad
mov edx, dword [esp + 0x50]
mov eax, dword [edx + edi*4]
mov ebp, dword [esi + eax]
mov eax, dword [esp + 0x18]
test eax, eax
jl 0x5189e9
mov eax, dword [esp + 0x1c]
test eax, eax
jl 0x5189e9
mov eax, dword [ebx]
push ebx
call dword [eax + 0x14]
cmp dword [esp + 0x18], eax
jge 0x5189e9
mov ecx, dword [ebx]
push ebx
call dword [ecx + 0x18]
cmp dword [esp + 0x1c], eax
jge 0x5189e9
mov edx, dword [esp + 0x50]
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x18]
mov eax, dword [eax + edx]
mov ecx, dword [eax + ecx*4]
jmp 0x5189f3
mov edx, dword [esp + 0x50]
mov eax, dword [edx + edi*4]
mov ecx, dword [esi + eax]
mov edx, ecx
mov eax, ebp
shr edx, 0x11
shr eax, 0x11
and edx, 0x7f
and eax, 0x7f
sub eax, edx
mov dword [esp + 0x20], ecx
mov edx, ecx
mov ecx, ebp
shr edx, 9
shr ecx, 9
and edx, 0x7f
and ecx, 0x7f
sub ecx, edx
mov edx, dword [esp + 0x20]
shr edx, 1
shr ebp, 1
and edx, 0x7f
and ebp, 0x7f
sub ebp, edx
add eax, 0xff
add ecx, 0xff
add ebp, 0xff
shr eax, 1
shr ecx, 1
shr ebp, 1
cmp eax, 0xff
mov dword [esp + 0x20], ebp
jbe 0x518a52
mov eax, 0xff
cmp ecx, 0xff
jbe 0x518a5f
mov ecx, 0xff
cmp ebp, 0xff
jbe 0x518a6f
mov dword [esp + 0x20], 0xff
mov edx, dword [esp + 0x78]
and eax, 0xff
shl eax, 0x10
mov edx, dword [edx + edi*4]
push ebx
mov ebp, dword [esi + edx]
or ebp, 0xff000000
mov dword [esi + edx], ebp
mov edx, dword [esp + 0x7c]
mov edx, dword [edx + edi*4]
mov ebp, dword [esi + edx]
and ebp, 0xff00ffff
or eax, ebp
mov dword [esi + edx], eax
mov eax, dword [esp + 0x7c]
xor edx, edx
mov ebp, dword [eax + edi*4]
mov dh, cl
mov eax, dword [esi + ebp]
and ah, 0
or edx, eax
mov dword [esi + ebp], edx
mov ecx, dword [esp + 0x7c]
mov ebp, dword [esp + 0x24]
mov eax, dword [ecx + edi*4]
mov ecx, dword [esi + eax]
mov edx, ecx
xor edx, ebp
mov ebp, dword [esp + 0x18]
and edx, 0xff
xor edx, ecx
mov ecx, dword [esp + 0x4c]
mov dword [esi + eax], edx
mov edx, dword [esp + 0x20]
mov eax, 4
inc edi
add ecx, eax
add ebp, eax
mov eax, dword [ebx]
inc edx
mov dword [esp + 0x20], edx
mov dword [esp + 0x4c], ecx
mov dword [esp + 0x18], ebp
call dword [eax + 0x18]
cmp edi, eax
jl 0x51895f
mov ebp, dword [esp + 0x84]
mov edi, dword [esp + 0x24]
mov edx, dword [esp + 0x3c]
mov ecx, dword [esp + 0x18]
inc edi
add edx, 4
inc ecx
mov dword [esp + 0x18], ecx
mov ecx, dword [ebx]
push ebx
mov dword [esp + 0x28], edi
mov dword [esp + 0x40], edx
add esi, 4
call dword [ecx + 0x14]
cmp edi, eax
jl 0x518912
mov edi, dword [esp + 0x28]
xor esi, esi
lea edx, [esp + 0x78]
mov dword [esp + 0x28], edx
mov ecx, dword [esp + 0x78]
mov byte [esp + 0xa8], 0x13
cmp ecx, esi
je 0x518b70
mov eax, dword [esp + 0x80]
sub eax, ecx
sar eax, 2
push eax
push ecx
lea ecx, [esp + 0x88]
call fcn.004fdfd0
lea eax, [esp + 0x50]
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x50]
mov byte [esp + 0xa8], 0x15
cmp eax, esi
je 0x518b9c
mov ecx, dword [esp + 0x58]
sub ecx, eax
sar ecx, 2
push ecx
push eax
lea ecx, [esp + 0x60]
call fcn.004fdfd0
mov eax, dword [esp + 0x4c]
mov byte [esp + 0xa8], 7
cmp eax, esi
je 0x518bb9
mov edx, dword [eax]
push 0x7fffffff
push 1
push eax
call dword [edx + 4]
lea eax, [esp + 0x68]
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x68]
mov byte [esp + 0xa8], 0x17
cmp eax, esi
je 0x518be5
mov ecx, dword [esp + 0x70]
sub ecx, eax
sar ecx, 2
push ecx
push eax
lea ecx, [esp + 0x78]
call fcn.004fdfd0
mov eax, dword [esp + 0x64]
mov byte [esp + 0xa8], 2
cmp eax, esi
je 0x518c02
mov edx, dword [eax]
push 0x7fffffff
push 1
push eax
call dword [edx + 4]
mov eax, dword [esp + 0x5c]
push 0x7fffffff
push 1
push eax
mov ecx, dword [eax]
mov byte [esp + 0xb4], 1
call dword [ecx + 4]
mov eax, dword [esp + 0x2c]
cmp eax, esi
je 0x518c2c
push eax
call fcn.005265a0
add esp, 4
mov eax, dword [esp + 0x30]
cmp eax, esi
je 0x518c3d
push eax
call fcn.005265a0
add esp, 4
mov eax, dword [esp + 0x44]
mov dword [esp + 0x2c], esi
mov dword [esp + 0x30], esi
mov dword [esp + 0x38], esi
mov dword [esp + 0x34], esi
mov edx, dword [eax]
push 0x7fffffff
push 1
push eax
mov dword [esp + 0xb4], 0xffffffff
call dword [edx + 4]
mov eax, edi
mov ecx, dword [esp + 0xa0]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x9c
ret