Function at 0x50dd88
Capabilities:
Terminate process

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0xd54
and dword [esp + 0xc], 0
and dword [esp + 0x10], 0
push ebx
mov ebx, dword [ebp + 0xc]
mov edx, dword [ebx + 0x504]
test edx, edx
mov eax, dword [ebx + 0x510]
push esi
push edi
mov dword [esp + 0x28], eax
mov dword [esp + 0x20], edx
mov esi, 0xffffff38
jle 0x50de05
mov eax, esi
mov ecx, edx
lea edi, [esp + 0x38]
rep stosd dword es:[edi], eax
mov ecx, edx
lea edi, [esp + 0x140]
rep stosd dword es:[edi], eax
xor eax, eax
test edx, edx
mov ecx, edx
lea edi, [esp + 0x248]
rep stosd dword es:[edi], eax
jle 0x50de05
inc eax
test edx, edx
mov ecx, edx
lea edi, [esp + 0x350]
rep stosd dword es:[edi], eax
jle 0x50de05
mov ecx, edx
or eax, 0xffffffff
lea edi, [esp + 0x458]
rep stosd dword es:[edi], eax
xor edi, edi
cmp edx, edi
jne 0x50de34
push dword [esp + 0x28]
mov eax, dword [ebx + 0x508]
push eax
lea ecx, [esp + 0x568]
push ecx
push eax
push edi
push dword [ebp + 0x10]
push dword [ebp + 0x14]
call fcn.00503c8c
add esp, 0x1c
mov dword [esp + 0x18], eax
jmp 0x50de7f
dec edx
cmp edx, edi
mov dword [esp + 0x24], edx
jle 0x50e1bc
lea eax, [esp + 0x560]
mov dword [esp + 0x10], eax
push dword [esp + 0x28]
push dword [ebx + 0x508]
push dword [esp + 0x18]
push dword [ebx + edi*4 + 4]
push dword [ebx + edi*4]
push dword [ebp + 0x10]
push dword [ebp + 0x14]
call fcn.00503c8c
add dword [esp + 0x34], eax
add dword [esp + 0x2c], 0x20
add esp, 0x1c
inc edi
cmp edi, dword [esp + 0x24]
jl 0x50de4c
cmp dword [esp + 0x18], 0
je 0x50e1bc
mov edi, dword [esp + 0x20]
lea eax, [esp + 0x14]
push eax
lea eax, [esp + 0x20]
push eax
lea eax, [edi - 1]
push eax
lea eax, [esp + 0x56c]
push eax
mov dword [esp + 0x2c], esi
mov dword [esp + 0x24], esi
call fcn.004f6e11
mov eax, dword [esp + 0x2c]
add esp, 0x10
mov dword [esp + 0x38], eax
mov dword [esp + 0x140], eax
mov eax, dword [esp + 0x14]
push 2
mov dword [esp + 0x148], eax
mov dword [esp + 0x40], eax
pop eax
cmp edi, eax
mov dword [esp + 0x10], eax
jle 0x50e0c3
lea eax, [ebx + 0x210]
mov dword [esp + 0x18], eax
mov eax, dword [esp + 0x18]
mov eax, dword [eax]
shl eax, 2
mov ecx, dword [esp + eax + 0x248]
mov edi, dword [esp + eax + 0x350]
lea eax, [esp + ecx*4 + 0x458]
cmp dword [eax], edi
mov dword [esp + 0x30], ecx
je 0x50e0a8
mov edx, dword [ebx + ecx*4 + 0x208]
mov dword [eax], edi
push ecx
lea eax, [esp + 0x144]
push eax
lea eax, [esp + 0x40]
push eax
mov dword [esp + 0x40], edx
call fcn.004f6deb
add esp, 0xc
mov dword [esp + 0x1c], eax
push edi
lea eax, [esp + 0x144]
push eax
lea eax, [esp + 0x40]
push eax
call fcn.004f6deb
add esp, 0xc
cmp dword [esp + 0x1c], 0xffffffff
je 0x50e18e
cmp eax, 0xffffffff
je 0x50e18e
mov ecx, dword [esp + 0x28]
push ecx
push dword [ebp + 0x10]
push dword [ebp + 0x14]
push eax
push dword [esp + 0x2c]
mov eax, dword [esp + 0x44]
push dword [ecx + edi*4 + 0x344]
push dword [ecx + eax*4 + 0x344]
call fcn.00503ac6
add esp, 0x1c
test eax, eax
je 0x50e096
lea eax, [esp + 0x14]
push eax
lea eax, [esp + 0x20]
push eax
mov eax, dword [esp + 0x20]
mov ecx, dword [eax]
mov eax, dword [esp + 0x3c]
sub ecx, eax
shl eax, 5
push ecx
lea eax, [esp + eax + 0x56c]
push eax
mov dword [esp + 0x2c], esi
mov dword [esp + 0x24], esi
mov dword [esp + 0x3c], esi
mov dword [esp + 0x34], esi
call fcn.004f6e11
mov ecx, dword [ebx + edi*4 + 0x208]
lea eax, [esp + 0x34]
push eax
lea eax, [esp + 0x40]
push eax
mov eax, dword [esp + 0x30]
mov eax, dword [eax]
sub ecx, eax
shl eax, 5
push ecx
lea eax, [esp + eax + 0x57c]
push eax
call fcn.004f6e11
mov eax, dword [esp + 0x50]
mov ecx, dword [esp + 0x3c]
add esp, 0x20
test eax, eax
mov dword [esp + eax*4 + 0x140], ecx
jne 0x50e013
mov dword [esp + 0x38], ecx
mov ecx, dword [esp + 0x10]
mov edx, dword [esp + 0x14]
shl ecx, 2
cmp edi, 1
mov dword [esp + ecx + 0x38], edx
mov edx, dword [esp + 0x2c]
mov dword [esp + ecx + 0x140], edx
mov ecx, dword [esp + 0x24]
mov dword [esp + edi*4 + 0x38], ecx
jne 0x50e041
mov dword [esp + 0x144], ecx
cmp dword [esp + 0x14], 0
jge 0x50e04c
test edx, edx
jl 0x50e0a8
mov ecx, dword [esp + 0x18]
mov ecx, dword [ecx]
dec ecx
mov dword [esp + 0x14], ecx
js 0x50e074
mov ecx, dword [esp + 0x14]
lea ecx, [esp + ecx*4 + 0x350]
cmp dword [ecx], edi
jne 0x50e074
dec dword [esp + 0x14]
mov edx, dword [esp + 0x10]
mov dword [ecx], edx
jns 0x50e059
mov ecx, dword [esp + 0x18]
mov edx, dword [ecx]
jmp 0x50e08d
lea ecx, [esp + edx*4 + 0x248]
cmp dword [ecx], eax
jne 0x50e0a8
mov edi, dword [esp + 0x10]
mov dword [ecx], edi
inc edx
cmp edx, dword [esp + 0x20]
jl 0x50e07c
jmp 0x50e0a8
mov eax, dword [esp + 0x10]
shl eax, 2
mov dword [esp + eax + 0x38], esi
mov dword [esp + eax + 0x140], esi
inc dword [esp + 0x10]
mov eax, dword [esp + 0x10]
add dword [esp + 0x18], 4
cmp eax, dword [esp + 0x20]
jl 0x50deeb
mov edi, dword [esp + 0x20]
mov esi, dword [ebp + 8]
mov eax, edi
shl eax, 2
call fcn.0047e980
mov esi, eax
push 0
lea eax, [esp + 0x144]
push eax
lea eax, [esp + 0x40]
push eax
mov dword [esp + 0x28], esi
call fcn.004f6deb
add esp, 0xc
mov dword [esi], eax
push 1
lea eax, [esp + 0x144]
push eax
lea eax, [esp + 0x40]
push eax
call fcn.004f6deb
add esp, 0xc
push 2
mov dword [esi + 4], eax
pop eax
cmp dword [esp + 0x20], eax
mov dword [esp + 0x10], eax
jle 0x50e1bc
mov edi, dword [esp + 0x28]
lea eax, [edi + 0x34c]
mov dword [esp + 0x14], eax
add ebx, 0x30c
mov edx, dword [esp + 0x14]
push dword [edx]
mov ecx, dword [ebx]
mov esi, dword [esp + 0x20]
push dword [esi + ecx*4]
mov eax, dword [ebx + 0xfc]
push dword [esi + eax*4]
push dword [edi + ecx*4 + 0x344]
push dword [edi + eax*4 + 0x344]
call fcn.004f7006
add esp, 0x14
push dword [esp + 0x10]
mov dword [esp + 0x28], eax
lea eax, [esp + 0x144]
push eax
lea eax, [esp + 0x40]
push eax
call fcn.004f6deb
mov ecx, dword [esp + 0x30]
add esp, 0xc
test eax, eax
jl 0x50e195
cmp ecx, eax
je 0x50e195
mov ecx, dword [esp + 0x10]
mov dword [esi + ecx*4], eax
jmp 0x50e1a2
push 1
call fcn.004ab9da
mov eax, dword [esp + 0x10]
or ecx, 0x8000
mov dword [esi + eax*4], ecx
inc dword [esp + 0x10]
mov eax, dword [esp + 0x10]
add dword [esp + 0x14], 4
add ebx, 4
cmp eax, dword [esp + 0x20]
jl 0x50e12e
mov eax, dword [esp + 0x1c]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret