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

Disassembly:
sub esp, 0x48
mov eax, dword [esp + 0x54]
imul edx, eax, 0x160c
push ebx
mov ebx, dword [esp + 0x54]
push ebp
push esi
push edi
mov ecx, dword [ebx + 0x4c]
mov esi, dword [ebx + 0xc]
mov ecx, dword [edx + ecx + 0x15d0]
xor edx, edx
div dword [ebx + 0x18]
mov dword [esp + 0x64], ecx
mov ecx, dword [esp + 0x5c]
mov edi, eax
mov eax, dword [esp + 0x68]
imul esi, edx
mov ebp, dword [ecx + 0x18]
mov ecx, dword [ecx]
mov dword [esp + 0x10], ebp
add esi, dword [ebx + 4]
cmp esi, ecx
cmova ecx, esi
xor edx, edx
mov dword [eax], ecx
mov eax, dword [ebx + 0xc]
add eax, esi
mov esi, dword [esp + 0x5c]
adc edx, edx
neg edx
mov ecx, dword [esi + 8]
or edx, eax
mov eax, dword [esp + 0x6c]
cmp edx, ecx
cmovb ecx, edx
mov edx, dword [esp + 0x70]
mov dword [eax], ecx
mov ecx, dword [ebx + 0x10]
mov eax, dword [esi + 4]
imul ecx, edi
add ecx, dword [ebx + 8]
cmp ecx, eax
cmova eax, ecx
mov dword [edx], eax
xor edx, edx
mov eax, dword [ebx + 0x10]
add eax, ecx
mov ecx, dword [esi + 0xc]
adc edx, edx
neg edx
or edx, eax
mov eax, dword [esp + 0x74]
cmp edx, ecx
cmovb ecx, edx
mov dword [eax], ecx
xor ecx, ecx
mov eax, dword [esp + 0x80]
mov dword [esp + 0x2c], ecx
mov dword [eax], 0
mov eax, dword [esp + 0x84]
mov dword [eax], 0
mov eax, dword [esp + 0x78]
mov dword [eax], closesocket
mov eax, dword [esp + 0x7c]
mov dword [eax], closesocket
cmp dword [esi + 0x10], ecx
jbe 0x51cd68
mov eax, dword [esp + 0x64]
add eax, 4
mov dword [esp + 0x14], eax
nop dword [eax]
nop dword [eax + eax]
mov eax, dword [esp + 0x88]
mov esi, dword [eax + ecx*4]
mov eax, dword [ebp]
cdq
mov ecx, eax
mov ebp, edx
mov eax, dword [esp + 0x68]
push ebp
push ecx
mov dword [esp + 0x6c], ecx
mov eax, dword [eax]
cdq
add eax, ecx
adc edx, ebp
sub eax, 1
sbb edx, 0
push edx
push eax
call fcn.00577fc0
mov dword [esp + 0x60], eax
mov eax, dword [esp + 0x10]
mov eax, dword [eax + 4]
cdq
mov ebx, eax
mov edi, edx
mov eax, dword [esp + 0x70]
push edi
push ebx
mov eax, dword [eax]
cdq
add eax, ebx
adc edx, edi
sub eax, 1
sbb edx, 0
push edx
push eax
call fcn.00577fc0
mov ecx, dword [esp + 0x64]
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x6c]
push ebp
push ecx
mov eax, dword [eax]
cdq
add eax, ecx
adc edx, ebp
sub eax, 1
sbb edx, 0
push edx
push eax
call fcn.00577fc0
mov ebp, eax
mov eax, dword [esp + 0x74]
push edi
push ebx
mov eax, dword [eax]
cdq
add eax, ebx
adc edx, edi
sub eax, 1
sbb edx, 0
push edx
push eax
call fcn.00577fc0
mov ecx, dword [esp + 0x14]
mov edi, eax
mov eax, dword [esp + 0x84]
mov edx, dword [ecx]
cmp edx, dword [eax]
jbe 0x51cafd
mov dword [eax], edx
mov ebx, dword [ecx]
mov dword [esp + 0x24], 0
test ebx, ebx
je 0x51cd3d
mov eax, dword [esp + 0x60]
cdq
mov dword [esp + 0x30], eax
mov eax, dword [esp + 0x28]
mov dword [esp + 0x34], edx
cdq
mov dword [esp + 0x38], eax
mov eax, ebp
mov dword [esp + 0x3c], edx
cdq
mov dword [esp + 0x40], eax
mov eax, edi
mov dword [esp + 0x44], edx
cdq
mov dword [esp + 0x48], eax
lea eax, [ecx + 0x3ac]
mov dword [esp + 0x4c], edx
mov dword [esp + 0x28], eax
nop dword [eax]
mov ebp, dword [eax - 0x84]
dec ebx
mov eax, dword [eax]
mov dword [esi], ebp
mov dword [esp + 0x60], ebx
lea ecx, [ebx + ebp]
mov dword [esp + 0x64], eax
mov dword [esi + 4], eax
cmp ecx, 0x20
jae 0x51cb98
mov eax, dword [esp + 0x10]
mov edi, 1
shl edi, cl
xor edx, edx
mov ecx, dword [eax]
or eax, 0xffffffff
div edi
cmp ecx, eax
mov eax, dword [esp + 0x64]
ja 0x51cb98
imul edi, ecx
mov ecx, dword [esp + 0x78]
cmp dword [ecx], edi
cmovl edi, dword [ecx]
mov dword [ecx], edi
lea ecx, [eax + ebx]
cmp ecx, 0x20
jae 0x51cbc7
mov eax, dword [esp + 0x10]
mov edi, 1
shl edi, cl
xor edx, edx
mov ecx, dword [eax + 4]
or eax, 0xffffffff
div edi
cmp ecx, eax
ja 0x51cbc7
imul edi, ecx
mov ecx, dword [esp + 0x7c]
cmp dword [ecx], edi
cmovl edi, dword [ecx]
mov dword [ecx], edi
mov edx, dword [esp + 0x34]
mov eax, ebx
mov ecx, dword [esp + 0x60]
xor edi, edi
bts edi, eax
xor ebx, ebx
cmp eax, 0x20
cmovae ebx, edi
xor edi, ebx
cmp eax, 0x40
mov eax, dword [esp + 0x30]
cmovae ebx, edi
add eax, edi
adc edx, ebx
sub eax, 1
sbb edx, 0
call fcn.00578360
mov edx, dword [esp + 0x3c]
mov ecx, dword [esp + 0x60]
mov dword [esp + 0x18], eax
mov eax, dword [esp + 0x38]
add eax, edi
adc edx, ebx
sub eax, 1
sbb edx, 0
call fcn.00578360
mov edx, dword [esp + 0x44]
mov ecx, dword [esp + 0x60]
mov dword [esp + 0x20], eax
mov eax, dword [esp + 0x40]
add eax, edi
adc edx, ebx
sub eax, 1
sbb edx, 0
call fcn.00578360
mov edx, dword [esp + 0x4c]
mov ecx, dword [esp + 0x60]
mov dword [esp + 0x50], eax
mov eax, dword [esp + 0x48]
add eax, edi
adc edx, ebx
sub eax, 1
sbb edx, 0
call fcn.00578360
mov edx, dword [esp + 0x20]
xor edi, edi
mov dword [esp + 0x1c], eax
xor ebx, ebx
mov eax, dword [esp + 0x64]
mov ecx, eax
mov eax, dword [esp + 0x1c]
bts edi, ecx
sar edx, cl
shl edx, cl
cmp ecx, 0x20
mov dword [esp + 0x54], edx
cmovae ebx, edi
cdq
xor edi, ebx
cmp ecx, 0x40
cmovae ebx, edi
add eax, edi
mov edi, ecx
adc edx, ebx
sub eax, 1
sbb edx, 0
call fcn.00578360
mov edx, dword [esp + 0x50]
mov ebx, eax
mov ecx, edi
shl ebx, cl
cmp dword [esp + 0x18], edx
jne 0x51ccab
xor eax, eax
jmp 0x51ccea
xor ecx, ecx
mov eax, ebp
bts ecx, eax
xor edi, edi
cmp eax, 0x20
cmovae edi, ecx
xor ecx, edi
cmp eax, 0x40
mov eax, edx
cmovae edi, ecx
cdq
add eax, ecx
mov ecx, ebp
adc edx, edi
sub eax, 1
sbb edx, 0
call fcn.00578360
mov edx, dword [esp + 0x18]
mov ecx, ebp
mov edi, dword [esp + 0x64]
sar edx, cl
shl eax, cl
shl edx, cl
sub eax, edx
sar eax, cl
mov ecx, dword [esp + 0x1c]
cmp dword [esp + 0x20], ecx
jne 0x51ccf8
xor ebx, ebx
jmp 0x51cd00
sub ebx, dword [esp + 0x54]
mov ecx, edi
sar ebx, cl
mov dword [esi + 8], eax
mov dword [esi + 0xc], ebx
add esi, 0x10
imul ebx, eax
mov eax, dword [esp + 0x80]
cmp ebx, dword [eax]
jbe 0x51cd19
mov dword [eax], ebx
mov edi, dword [esp + 0x24]
mov ecx, dword [esp + 0x14]
inc edi
mov eax, dword [esp + 0x28]
mov ebx, dword [esp + 0x60]
add eax, 4
mov dword [esp + 0x24], edi
mov dword [esp + 0x28], eax
cmp edi, dword [ecx]
jb 0x51cb50
mov eax, dword [esp + 0x5c]
add ecx, 0x438
mov ebp, dword [esp + 0x10]
mov dword [esp + 0x14], ecx
add ebp, 0x34
mov ecx, dword [esp + 0x2c]
inc ecx
mov dword [esp + 0x10], ebp
mov dword [esp + 0x2c], ecx
cmp ecx, dword [eax + 0x10]
jb 0x51ca50
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x48
ret