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

Disassembly:
sub esp, 0x94
push ebx
push ebp
or eax, 0xffffffff
push esi
mov esi, ecx
mov dword [esi + 0x58], eax
mov dword [esi + 0x5c], eax
mov eax, dword [esi + 0x1c]
xor ebp, ebp
mov dword [eax], ebp
mov ecx, dword [esi + 0x60]
mov ecx, dword [ecx + 0x1c]
push edi
mov edi, 1
mov dword [esp + 0x4c], edi
mov dword [esp + 0x30], 0
mov dword [esp + 0x20], ebp
mov byte [esp + 0x1f], 0
mov dword [esp + 0x14], ecx
test ecx, ecx
jle 0x4f7a40
xor eax, eax
test ecx, ecx
jle 0x4f7a40
lea ebx, [ebx]
mov edx, dword [esi + 0x24]
mov dword [edx + eax*4], closesocket
mov edx, dword [esi + 0x2c]
mov dword [edx + eax*4], closesocket
inc eax
cmp eax, ecx
jl 0x4f7a20
jmp 0x4f7a53
test edi, edi
jg 0x4f7a53
mov eax, dword [esi + 0x54]
mov ecx, dword [eax + 0xc]
cmp ecx, dword [eax + 8]
je 0x4f86a5
mov ecx, dword [esi + 4]
mov eax, dword [esi + 0xc]
sub eax, ecx
cmp ebp, eax
jg 0x4f86a5
cmp byte [esp + 0x1f], 0
jne 0x4f86a5
cmp ebp, eax
jge 0x4f7a7c
mov edx, dword [esi]
add ecx, ebp
movzx ebx, word [edx + ecx*2]
jmp 0x4f7a7e
xor ebx, ebx
mov dword [esp + 0x70], ebx
mov dword [esp + 0x18], 0
test edi, edi
jle 0x4f83c5
mov ecx, dword [esp + 0x18]
mov eax, dword [esi + 0x1c]
mov eax, dword [eax + ecx*4]
lea edx, [eax + eax*4]
mov eax, dword [esi + 0x60]
mov ecx, dword [eax + 4]
lea eax, [ecx + edx*4 + 0x10]
mov dword [esp + 0x74], eax
mov eax, dword [eax + 8]
xor ecx, ecx
cmp dword [eax + 8], ecx
mov dword [esp + 0x40], ecx
jle 0x4f83b4
nop
mov ebp, dword [eax + ecx*4 + 0x10]
mov eax, dword [esi + 0x60]
mov ecx, dword [eax + 4]
mov eax, dword [esp + 0x74]
lea edx, [ebp + ebp*4]
lea edx, [ecx + edx*4 + 0x10]
mov ecx, dword [eax + 0x10]
cmp dword [ecx + 0x3c], 0
mov dword [esp + 0x3c], ebp
mov dword [esp + 0x2c], edx
mov dword [esp + 0x54], 0
je 0x4f7b5b
mov edx, dword [ecx + 0x38]
mov edi, ecx
mov eax, ecx
test edx, edx
jl 0x4f7b1c
lea ebx, [ebx]
mov eax, dword [edi + edx*4 + 4]
cmp eax, ecx
je 0x4f7b17
cmp dword [eax - 8], ebp
jge 0x4f7b17
mov edi, eax
mov eax, dword [eax + edx*4 + 4]
cmp eax, ecx
jne 0x4f7b08
sub edx, 1
jns 0x4f7b00
cmp eax, ecx
je 0x4f7b25
cmp ebp, dword [eax - 8]
jge 0x4f7b27
mov eax, ecx
cmp eax, ecx
je 0x4f7b5b
mov eax, dword [eax - 4]
test eax, eax
je 0x4f7b5b
mov ecx, dword [esp + 0x18]
imul ecx, dword [esp + 0x14]
mov edx, dword [esi + 0x24]
lea ecx, [edx + ecx*4]
mov edx, dword [esp + 0x20]
push ecx
push eax
push edx
mov ecx, esi
call fcn.004f23a0
test al, al
je 0x4f8393
mov ebp, dword [esp + 0x3c]
mov eax, dword [esp + 0x2c]
mov eax, dword [eax + 4]
test eax, 0x30000
jne 0x4f7bb3
mov ecx, dword [esi + 0x60]
cmp dword [ecx + 0x30], 0
je 0x4f7b7c
cmp eax, ebx
sete al
jmp 0x4f7e1f
lea edx, [esp + 0x8a]
push edx
lea ecx, [esp + 0x62]
mov word [esp + 0x62], bx
mov word [esp + 0x66], ax
call fcn.004c57e0
mov di, word [eax]
lea eax, [esp + 0x7c]
push eax
lea ecx, [esp + 0x66]
call fcn.004c57e0
cmp word [eax], di
sete al
jmp 0x4f7e1f
cmp ebp, 1
jne 0x4f7bcb
mov ecx, dword [esp + 0x20]
mov dl, byte [esi + 0x10]
mov dword [esi + 0x58], ecx
mov byte [esp + 0x1f], dl
jmp 0x4f7e27
mov ecx, dword [esi + 0x60]
test eax, 0x10000
je 0x4f7ca8
xor eax, 0x10000
inc eax
shl eax, 4
add eax, dword [ecx + 0x20]
cmp dword [ecx + 0x30], 0
mov edi, eax
je 0x4f7bff
push ecx
mov eax, esp
mov ecx, edi
mov word [eax], bx
call fcn.004f0390
jmp 0x4f7e1f
cmp byte [edi + 8], 0
je 0x4f7c5c
lea eax, [esp + 0x84]
push eax
lea ecx, [esp + 0x5e]
mov word [esp + 0x5e], bx
call fcn.004c57e0
movzx ecx, word [eax]
push ecx
mov ecx, edi
call fcn.004f0390
test al, al
je 0x4f8393
lea edx, [esp + 0x88]
push edx
lea ecx, [esp + 0x6e]
mov word [esp + 0x6e], bx
call fcn.004c5870
movzx eax, word [eax]
push eax
mov ecx, edi
call fcn.004f0390
test al, al
jne 0x4f7e27
jmp 0x4f8393
lea ecx, [esp + 0x82]
push ecx
lea ecx, [esp + 0x56]
mov word [esp + 0x56], bx
call fcn.004c57e0
movzx edx, word [eax]
push edx
mov ecx, edi
call fcn.004f0390
test al, al
jne 0x4f7e27
lea eax, [esp + 0x7a]
push eax
lea ecx, [esp + 0x60]
mov word [esp + 0x60], bx
call fcn.004c5870
movzx ecx, word [eax]
push ecx
mov ecx, edi
call fcn.004f0390
jmp 0x4f7e1f
mov edx, dword [esp + 0x14]
mov ebp, dword [esp + 0x18]
mov edi, dword [ecx + 0x14]
imul ebp, edx
xor eax, 0x20000
add ebp, dword [edi + eax*4 + 0xc]
cmp eax, edx
jg 0x4f8393
mov edx, dword [esi + 0x24]
mov eax, dword [edx + ebp*4]
cmp eax, 0x7fffffff
je 0x4f8393
cmp dword [ecx + 0x30], 0
je 0x4f7ceb
mov ecx, dword [esi + 4]
mov edx, dword [esi]
add ecx, eax
cmp word [edx + ecx*2], bx
jmp 0x4f7d1c
lea eax, [esp + 0x7e]
push eax
lea ecx, [esp + 0x64]
mov word [esp + 0x64], bx
call fcn.004c57e0
mov di, word [eax]
mov edx, dword [esi + 0x24]
mov eax, dword [edx + ebp*4]
add eax, dword [esi + 4]
lea ecx, [esp + 0x78]
push ecx
mov ecx, dword [esi]
lea ecx, [ecx + eax*2]
call fcn.004c57e0
cmp word [eax], di
sete al
test al, al
je 0x4f8393
mov edx, dword [esi + 0x2c]
mov ecx, dword [edx + ebp*4]
cmp ecx, 0x7fffffff
jne 0x4f7d41
mov eax, dword [esi + 0x24]
mov edx, dword [eax + ebp*4]
mov ecx, dword [esp + 0x20]
jmp 0x4f7d47
mov edx, dword [esi + 0x24]
mov edx, dword [edx + ebp*4]
mov ebx, dword [esi + 4]
mov eax, dword [esi + 0xc]
sub eax, ebx
sub eax, dword [esp + 0x20]
sub ecx, edx
cmp ecx, eax
setle al
mov dword [esp + 0x34], ecx
test al, al
je 0x4f8393
cmp ecx, 1
jle 0x4f7e1f
mov eax, dword [esi + 0x60]
cmp dword [eax + 0x30], 0
mov edi, 1
je 0x4f7dac
cmp ecx, edi
jle 0x4f7e0d
mov eax, dword [esi]
mov ebp, dword [esp + 0x20]
add edx, ebx
add ebx, ebp
lea edx, [eax + edx*2 + 2]
lea eax, [eax + ebx*2 + 2]
mov bx, word [eax]
cmp word [edx], bx
jne 0x4f7e0d
inc edi
add eax, 2
add edx, 2
cmp edi, ecx
jl 0x4f7d97
jmp 0x4f7e0d
cmp ecx, 1
jle 0x4f7e0d
mov edx, dword [esi + 0x24]
mov edx, dword [edx + ebp*4]
mov eax, dword [esi + 4]
mov ecx, dword [esi]
add edx, eax
add eax, edi
add eax, dword [esp + 0x20]
add edx, edi
mov dx, word [ecx + edx*2]
mov word [esp + 0x6c], dx
mov ax, word [ecx + eax*2]
lea ecx, [esp + 0x86]
push ecx
lea ecx, [esp + 0x68]
mov word [esp + 0x68], ax
call fcn.004c57e0
mov bx, word [eax]
lea edx, [esp + 0x80]
push edx
lea ecx, [esp + 0x70]
call fcn.004c57e0
cmp word [eax], bx
jne 0x4f7e09
inc edi
cmp edi, dword [esp + 0x34]
jl 0x4f7db1
mov ecx, dword [esp + 0x34]
cmp edi, ecx
sete al
test al, al
je 0x4f8393
dec ecx
mov dword [esp + 0x54], ecx
test al, al
je 0x4f8393
mov eax, dword [esi + 0x18]
mov edx, dword [esp + 0x3c]
mov eax, dword [eax + edx*4]
mov dword [esp + 0x48], eax
cmp eax, 0xffffffff
jne 0x4f7e6c
mov eax, dword [esp + 0x30]
mov ecx, eax
inc eax
mov dword [esp + 0x30], eax
mov eax, dword [esi + 0x20]
mov dword [eax + ecx*4], edx
mov eax, dword [esi + 0x18]
mov dword [eax + edx*4], ecx
mov ebx, dword [esi + 0x30]
mov eax, ecx
imul eax, dword [esp + 0x14]
add eax, eax
mov dword [esp + 0x48], ecx
mov ecx, dword [esi + 0x28]
add eax, eax
add ecx, eax
add ebx, eax
jmp 0x4f7e72
mov ecx, dword [esi + 0x34]
mov ebx, dword [esi + 0x38]
cmp dword [esp + 0x14], 0
mov dword [esp + 0x34], ebx
mov dword [esp + 0x28], ecx
jle 0x4f819e
mov eax, dword [esp + 0x14]
mov edi, dword [esp + 0x18]
mov edx, dword [esi + 0x24]
imul edi, eax
lea ebp, [eax*4]
add edi, edi
add edi, edi
push ebp
add edx, edi
push edx
mov eax, ecx
push eax
call fcn.00586840
mov ecx, dword [esi + 0x2c]
push ebp
add ecx, edi
push ecx
push ebx
call fcn.00586840
mov eax, dword [esp + 0x8c]
mov edx, dword [eax]
mov ecx, dword [esp + 0x44]
mov dword [esp + 0x50], edx
mov edx, dword [ecx]
mov ecx, dword [eax + 0xc]
add esp, 0x18
cmp dword [ecx + 0x3c], 0
mov dword [esp + 0x2c], edx
je 0x4f80fb
mov edx, dword [ecx + 0x38]
mov ebp, dword [esp + 0x3c]
mov edi, ecx
mov eax, ecx
test edx, edx
jl 0x4f7f0c
lea ecx, [ecx]
mov eax, dword [edi + edx*4 + 4]
cmp eax, ecx
je 0x4f7f07
cmp dword [eax - 8], ebp
jge 0x4f7f07
mov edi, eax
mov eax, dword [eax + edx*4 + 4]
cmp eax, ecx
jne 0x4f7ef8
sub edx, 1
jns 0x4f7ef0
cmp eax, ecx
je 0x4f7f15
cmp ebp, dword [eax - 8]
jge 0x4f7f17
mov eax, ecx
cmp eax, ecx
je 0x4f80fb
mov edi, dword [eax - 4]
mov dword [esp + 0x44], edi
test edi, edi
je 0x4f80fb
mov eax, dword [esi + 0x60]
mov ecx, dword [eax + 0xc]
push 0
push ecx
lea ecx, [esp + 0x2c]
call fcn.005276e0
mov edx, dword [esp + 0x24]
mov eax, dword [edx]
cmp eax, 1
mov eax, dword [esp + 0x24]
jne 0x4f7f57
lea ecx, [eax + 0x10]
cmp dword [eax + 0xc], ecx
je 0x4f7f68
mov edx, dword [eax + 8]
push edx
lea ecx, [esp + 0x28]
call fcn.004c3b70
mov eax, dword [esp + 0x24]
mov edx, dword [eax + 0xc]
mov ecx, edi
sar ecx, 3
lea eax, [edx + ecx + 1]
mov ecx, edi
mov edi, dword [esp + 0x44]
and ecx, 7
mov dl, 1
shl dl, cl
inc edi
or byte [eax], dl
mov eax, dword [esi + 0x60]
cmp edi, dword [eax + 0xc]
jge 0x4f8027
mov ecx, dword [esi + 0x60]
mov edx, dword [ecx + 8]
mov eax, dword [edx + edi*8 + 0x10]
mov ebp, dword [esp + 0x24]
mov ecx, eax
and ecx, 7
add ebp, 0xc
mov edx, 1
shl edx, cl
mov ecx, dword [ebp]
sar eax, 3
mov al, byte [eax + ecx + 1]
test al, dl
je 0x4f801a
mov ecx, dword [esp + 0x24]
mov edx, dword [ecx]
mov eax, dword [esp + 0x24]
cmp edx, 1
jne 0x4f7fd2
lea ecx, [eax + 0x10]
cmp dword [ebp], ecx
je 0x4f7fe3
mov edx, dword [eax + 8]
push edx
lea ecx, [esp + 0x28]
call fcn.004c3b70
mov eax, dword [esp + 0x24]
mov edx, dword [eax + 0xc]
mov ecx, edi
sar ecx, 3
lea eax, [ecx + edx + 1]
mov ecx, edi
and ecx, 7
mov dl, 1
shl dl, cl
or byte [eax], dl
mov eax, dword [esi + 0x60]
mov ecx, dword [eax + 8]
mov eax, dword [ecx + edi*8 + 0x14]
test eax, eax
jl 0x4f801a
mov edx, dword [esp + 0x28]
mov dword [edx + eax*4], closesocket
mov dword [ebx + eax*4], closesocket
mov eax, dword [esi + 0x60]
inc edi
cmp edi, dword [eax + 0xc]
jl 0x4f7f90
mov ecx, dword [esi + 0x60]
mov edx, dword [ecx + 8]
mov eax, dword [esp + 0x44]
mov edi, dword [edx + eax*8 + 0x10]
mov ecx, dword [esp + 0x24]
or edx, 0xffffffff
lock xadd dword [ecx], edx
jne 0x4f804f
mov eax, dword [esp + 0x24]
push eax
call fcn.004cc7c0
add esp, 4
mov ebp, dword [esp + 0x28]
mov edx, dword [esp + 0x2c]
cmp edx, edi
jle 0x4f808b
jmp 0x4f8060
mov ecx, dword [esi + 0x60]
mov eax, dword [ecx + 8]
mov eax, dword [eax + edx*8 + 0x14]
test eax, eax
jl 0x4f807d
mov ecx, dword [esp + 0x20]
mov dword [ebp + eax*4], ecx
mov dword [ebx + eax*4], closesocket
mov eax, dword [esi + 0x60]
mov ecx, dword [eax + 8]
mov edx, dword [ecx + edx*8 + 0x10]
cmp edx, edi
jg 0x4f8060
cmp ebp, dword [esi + 0x34]
jne 0x4f819e
cmp dword [esp + 0x14], 0
mov dword [esp + 0x44], 0
jle 0x4f819e
mov ebp, dword [esp + 0x48]
imul ebp, dword [esp + 0x14]
mov edi, dword [esp + 0x28]
add ebp, ebp
add ebp, ebp
mov edx, ebx
mov ecx, ebp
sub edi, ebx
mov edi, edi
mov eax, dword [esi + 0x28]
mov eax, dword [ecx + eax]
sub eax, dword [edi + edx]
jne 0x4f816c
mov ebx, dword [esi + 0x30]
mov eax, dword [edx]
sub eax, dword [ebx + ecx]
mov ebx, dword [esp + 0x34]
jne 0x4f816c
mov eax, dword [esp + 0x44]
inc eax
add ecx, 4
add edx, 4
cmp eax, dword [esp + 0x14]
mov dword [esp + 0x44], eax
jl 0x4f80c0
jmp 0x4f819e
mov edx, dword [esp + 0x2c]
mov edi, dword [esp + 0x38]
mov ebp, dword [esp + 0x28]
mov ecx, edx
cmp edx, edi
je 0x4f808b
cmp edi, ecx
mov eax, dword [esi + 0x60]
mov eax, dword [eax + 8]
jle 0x4f815f
mov eax, dword [eax + edi*8 + 0x14]
test eax, eax
jl 0x4f8153
mov edx, dword [esp + 0x20]
cmp dword [ebp + eax*4], edx
jne 0x4f814c
mov edx, dword [esp + 0x2c]
mov dword [ebp + eax*4], closesocket
mov dword [ebx + eax*4], closesocket
mov eax, dword [esi + 0x60]
mov eax, dword [eax + 8]
mov edi, dword [eax + edi*8 + 0x10]
jmp 0x4f8163
mov dword [ebx + eax*4], edx
mov edx, dword [esp + 0x2c]
mov eax, dword [esi + 0x60]
mov eax, dword [eax + 8]
mov edi, dword [eax + edi*8 + 0x10]
jmp 0x4f8163
mov ecx, dword [eax + ecx*8 + 0x10]
cmp edi, ecx
jne 0x4f8111
jmp 0x4f8057
test eax, eax
setg al
test al, al
je 0x4f819e
mov edi, dword [esp + 0x14]
mov edx, dword [esp + 0x28]
mov eax, dword [esi + 0x28]
add edi, edi
add edi, edi
push edi
push edx
add eax, ebp
push eax
call fcn.00586840
mov eax, dword [esi + 0x30]
push edi
add eax, ebp
push ebx
push eax
call fcn.00586840
add esp, 0x18
cmp dword [esp + 0x54], 0
jle 0x4f8393
mov ebp, dword [esp + 0x14]
mov eax, 4
lea edi, [ebp + ebp + 2]
push eax
lea ecx, [edi*4 + 0x10]
push ecx
mov dword [esp + 0x40], eax
mov dword [esp + 0x94], eax
call fcn.004e7540
mov dword [esp + 0x18], eax
mov dword [eax], 1
mov edx, dword [esp + 0x18]
mov dword [edx + 8], edi
mov eax, dword [esp + 0x18]
mov dword [eax + 4], edi
mov eax, dword [esp + 0x18]
or dword [eax + 0xc], 1
mov eax, dword [esp + 0x18]
and dword [eax + 0xc], 0xfffffffd
mov edx, dword [esp + 0x18]
lea ecx, [edi*4]
push ecx
add edx, 0x10
push 0
push edx
call fcn.004bf250
mov eax, dword [esp + 0x24]
mov ecx, dword [eax]
add esp, 0x14
cmp ecx, 1
je 0x4f8231
mov eax, dword [esp + 0x10]
mov edx, dword [eax + 4]
mov eax, dword [eax + 8]
push edx
push eax
lea ecx, [esp + 0x18]
call fcn.004f0600
mov ecx, dword [esp + 0x20]
mov edx, dword [esp + 0x54]
mov eax, dword [esp + 0x10]
add edx, ecx
mov dword [eax + 0x10], edx
mov ecx, dword [esp + 0x10]
mov edx, dword [ecx]
cmp edx, 1
je 0x4f8262
mov eax, dword [esp + 0x10]
mov ecx, dword [eax + 4]
mov edx, dword [eax + 8]
push ecx
push edx
lea ecx, [esp + 0x18]
call fcn.004f0600
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x3c]
mov dword [eax + 0x14], ecx
test ebp, ebp
jle 0x4f82e5
mov edx, dword [esp + 0x10]
mov eax, dword [edx]
cmp eax, 1
je 0x4f8295
mov eax, dword [esp + 0x10]
mov ecx, dword [eax + 4]
mov edx, dword [eax + 8]
push ecx
push edx
lea ecx, [esp + 0x18]
call fcn.004f0600
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x10]
lea edi, [ebp*4]
push edi
push eax
add ecx, 0x18
push ecx
call fcn.00586840
mov edx, dword [esp + 0x1c]
mov eax, dword [edx]
add esp, 0xc
cmp eax, 1
je 0x4f82d2
mov eax, dword [esp + 0x10]
mov ecx, dword [eax + 4]
mov edx, dword [eax + 8]
push ecx
push edx
lea ecx, [esp + 0x18]
call fcn.004f0600
mov eax, dword [esp + 0x10]
push edi
lea ecx, [eax + ebp*4 + 0x18]
push ebx
push ecx
call fcn.00586840
add esp, 0xc
mov eax, dword [esp + 0x30]
mov edx, dword [esi + 0x20]
mov ecx, dword [esi + 0x18]
dec eax
mov dword [esp + 0x30], eax
mov eax, dword [edx + eax*4]
mov dword [ecx + eax*4], 0xffffffff
mov eax, dword [esi + 0x54]
mov edx, dword [eax]
lea ecx, [esi + 0x54]
cmp edx, 1
je 0x4f8319
push 1
push closesocket
call fcn.004f1b00
jmp 0x4f831e
call fcn.004c3270
push 4
mov ebp, eax
call fcn.005812e3
mov edi, eax
add esp, 4
test edi, edi
je 0x4f835c
mov eax, dword [esp + 0x10]
mov dword [edi], eax
mov ecx, dword [esp + 0x10]
mov edx, 1
lock xadd dword [ecx], edx
mov eax, dword [edi]
test byte [eax + 0xc], 1
jne 0x4f835e
mov ecx, dword [eax + 4]
mov edx, dword [eax + 8]
push ecx
push edx
mov ecx, edi
call fcn.004f0600
jmp 0x4f835e
xor edi, edi
mov dword [ebp], edi
mov eax, dword [esp + 0x10]
test eax, eax
je 0x4f8393
or ecx, 0xffffffff
lock xadd dword [eax], ecx
jne 0x4f8393
mov edx, dword [esp + 0x10]
mov eax, 4
push eax
push edx
mov dword [esp + 0x9c], eax
mov dword [esp + 0xa4], eax
call fcn.004e7590
add esp, 8
mov ecx, dword [esp + 0x40]
mov eax, dword [esp + 0x74]
mov eax, dword [eax + 8]
mov ebx, dword [esp + 0x70]
inc ecx
cmp ecx, dword [eax + 8]
mov dword [esp + 0x40], ecx
jl 0x4f7ac0
mov edi, dword [esp + 0x4c]
mov eax, dword [esp + 0x18]
inc eax
cmp eax, edi
mov dword [esp + 0x18], eax
jl 0x4f7a92
mov ecx, dword [esp + 0x14]
test ecx, ecx
jle 0x4f840b
mov edx, dword [esi + 0x18]
mov eax, dword [edx + 4]
cmp eax, 0xffffffff
je 0x4f840b
imul eax, ecx
add eax, eax
add eax, eax
mov ebx, eax
mov eax, dword [esi + 0x28]
lea edi, [ecx*4]
mov ecx, dword [esi + 0x3c]
push edi
add eax, ebx
push eax
push ecx
call fcn.00586840
mov edx, dword [esi + 0x30]
mov eax, dword [esi + 0x40]
push edi
add edx, ebx
push edx
push eax
call fcn.00586840
add esp, 0x18
mov eax, dword [esi + 0x54]
mov ecx, dword [eax + 0xc]
sub ecx, dword [eax + 8]
lea ebp, [esi + 0x54]
mov dword [esp + 0x18], 0
test ecx, ecx
jle 0x4f862c
jmp 0x4f8430
mov eax, dword [ebp]
mov edx, dword [eax + 8]
add edx, dword [esp + 0x18]
mov eax, dword [eax + edx*4 + 0x14]
mov ecx, dword [eax]
mov edx, dword [esp + 0x20]
cmp dword [ecx + 0x10], edx
jne 0x4f8615
mov eax, dword [ebp]
mov ecx, dword [eax + 8]
add ecx, dword [esp + 0x18]
mov eax, dword [eax + ecx*4 + 0x14]
mov eax, dword [eax]
mov ecx, dword [esp + 0x14]
mov edx, dword [eax + 0x14]
lea edi, [eax + ecx*4 + 0x18]
lea ebx, [eax + 0x18]
mov eax, dword [esi + 0x18]
mov ecx, dword [eax + edx*4]
mov dword [esp + 0x48], ebx
mov dword [esp + 0x4c], edi
cmp ecx, 0xffffffff
jne 0x4f8497
mov eax, dword [esp + 0x30]
mov ecx, eax
inc eax
mov dword [esp + 0x30], eax
mov eax, dword [esi + 0x20]
mov dword [eax + ecx*4], edx
mov eax, dword [esi + 0x18]
mov dword [eax + edx*4], ecx
jmp 0x4f8501
cmp dword [esp + 0x14], 0
mov dword [esp + 0x40], 0
jle 0x4f853e
mov eax, ecx
imul eax, dword [esp + 0x14]
add eax, eax
mov edx, ebx
add eax, eax
sub edx, edi
mov dword [esp + 0x38], edx
jmp 0x4f84c4
mov edx, dword [esp + 0x38]
mov edx, dword [edx + edi]
mov ebx, dword [esi + 0x28]
sub edx, dword [eax + ebx]
jne 0x4f84f0
mov edx, dword [esi + 0x30]
mov edx, dword [edx + eax]
sub edx, dword [edi]
jne 0x4f84f0
mov edx, dword [esp + 0x40]
inc edx
add eax, 4
add edi, 4
cmp edx, dword [esp + 0x14]
mov dword [esp + 0x40], edx
jl 0x4f84c0
jmp 0x4f853e
test edx, edx
setg al
test al, al
je 0x4f853e
mov edi, dword [esp + 0x4c]
mov ebx, dword [esp + 0x48]
mov edx, dword [esp + 0x14]
imul ecx, edx
lea eax, [edx*4]
push eax
mov eax, dword [esi + 0x28]
add ecx, ecx
add ecx, ecx
add eax, ecx
push ebx
push eax
mov dword [esp + 0x44], ecx
call fcn.00586840
mov eax, dword [esp + 0x20]
mov ecx, dword [esi + 0x30]
add ecx, dword [esp + 0x44]
add eax, eax
add eax, eax
push eax
push edi
push ecx
call fcn.00586840
add esp, 0x18
cmp dword [esp + 0x18], 0
jl 0x4f8619
mov eax, dword [ebp]
mov edx, dword [eax + 0xc]
sub edx, dword [eax + 8]
cmp dword [esp + 0x18], edx
jge 0x4f8619
mov eax, dword [eax]
cmp eax, 1
je 0x4f85c0
mov eax, dword [ebp]
mov ecx, dword [eax + 4]
mov edx, dword [eax + 8]
push ecx
mov ecx, ebp
lea ebx, [eax + edx*4 + 0x14]
call fcn.004c3610
mov edi, eax
mov eax, dword [ebp]
mov ecx, dword [eax + 0xc]
lea edx, [eax + ecx*4 + 0x14]
mov ecx, dword [eax + 8]
push ebx
push edx
lea edx, [eax + ecx*4 + 0x14]
push edx
mov ecx, ebp
call fcn.004f1290
mov eax, edi
or ecx, 0xffffffff
lock xadd dword [eax], ecx
jne 0x4f85c0
mov edx, dword [edi + 0xc]
mov ecx, dword [edi + 8]
lea eax, [edi + edx*4 + 0x14]
lea edx, [edi + ecx*4 + 0x14]
push eax
push edx
mov ecx, ebp
call fcn.004f0bc0
push edi
call fcn.004cc7c0
add esp, 4
mov eax, dword [ebp]
mov ecx, dword [eax + 8]
mov ebx, dword [esp + 0x18]
add ecx, ebx
mov edi, dword [eax + ecx*4 + 0x14]
test edi, edi
je 0x4f860b
mov eax, dword [edi]
test eax, eax
je 0x4f8602
or edx, 0xffffffff
lock xadd dword [eax], edx
jne 0x4f8602
mov eax, dword [edi]
mov ecx, 4
push ecx
push eax
mov dword [esp + 0x98], ecx
mov dword [esp + 0xa0], ecx
call fcn.004e7590
add esp, 8
push edi
call fcn.0058125d
add esp, 4
push ebx
mov ecx, ebp
call fcn.004c3440
jmp 0x4f8619
inc dword [esp + 0x18]
mov eax, dword [ebp]
mov ecx, dword [eax + 0xc]
sub ecx, dword [eax + 8]
cmp dword [esp + 0x18], ecx
jl 0x4f8430
mov ecx, dword [esp + 0x30]
xor eax, eax
test ecx, ecx
jle 0x4f864b
mov edx, dword [esi + 0x20]
mov edx, dword [edx + eax*4]
mov edi, dword [esi + 0x18]
inc eax
cmp eax, ecx
mov dword [edi + edx*4], 0xffffffff
jl 0x4f8636
cmp ecx, 1
jne 0x4f8666
mov eax, dword [esi + 0x20]
cmp dword [eax], ecx
jne 0x4f8666
mov ebp, dword [ebp]
mov edx, dword [ebp + 0xc]
cmp edx, dword [ebp + 8]
jne 0x4f8666
mov byte [esp + 0x1f], cl
mov edx, dword [esi + 0x20]
mov eax, dword [esi + 0x1c]
inc dword [esp + 0x20]
mov ebp, dword [esp + 0x20]
mov dword [esi + 0x1c], edx
mov dword [esi + 0x20], eax
mov edx, dword [esi + 0x28]
mov eax, dword [esi + 0x24]
mov dword [esi + 0x24], edx
mov dword [esi + 0x28], eax
mov edx, dword [esi + 0x30]
mov eax, dword [esi + 0x2c]
mov dword [esi + 0x2c], edx
mov dword [esi + 0x30], eax
mov edi, ecx
mov dword [esp + 0x4c], ecx
mov dword [esp + 0x30], 0
jmp 0x4f7a40
mov eax, dword [esi + 0x54]
mov ecx, dword [eax + 0xc]
lea edi, [esi + 0x54]
cmp ecx, dword [eax + 8]
je 0x4f875f
mov edx, 0x6c3094
mov eax, 1
lock xadd dword [edx], eax
cmp dword [edi], edx
je 0x4f871d
mov ecx, edx
mov edx, 1
lock xadd dword [ecx], edx
mov eax, dword [edi]
or ecx, 0xffffffff
lock xadd dword [eax], ecx
jne 0x4f8701
mov ebx, dword [edi]
mov edx, dword [ebx + 0xc]
mov ecx, dword [ebx + 8]
lea eax, [ebx + edx*4 + 0x14]
lea edx, [ebx + ecx*4 + 0x14]
push eax
push edx
mov ecx, edi
call fcn.004f0bc0
push ebx
call fcn.004cc7c0
add esp, 4
mov dword [edi], 0x6c3094
test byte [0x6c30a4], 1
jne 0x4f871d
mov eax, dword [0x6c3098]
push eax
mov ecx, edi
call fcn.004f2020
mov ecx, 0x6c3094
or edx, 0xffffffff
lock xadd dword [ecx], edx
jne 0x4f875f
mov eax, dword [0x6c30a0]
mov edx, dword [0x6c309c]
lea ecx, [eax*4 + 0x6c30a8]
push ecx
lea eax, [edx*4 + 0x6c30a8]
push eax
lea ecx, [esp + 0xa8]
call fcn.004f0bc0
push 0x6c3094
call fcn.004cc7c0
add esp, 4
dec ebp
xor eax, eax
cmp dword [esi + 0x58], eax
pop edi
mov dword [esi + 0x5c], ebp
pop esi
pop ebp
setge al
pop ebx
add esp, 0x94
ret