Function at 0x50d188
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 0x50d205
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 0x50d205
inc eax
test edx, edx
mov ecx, edx
lea edi, [esp + 0x350]
rep stosd dword es:[edi], eax
jle 0x50d205
mov ecx, edx
or eax, 0xffffffff
lea edi, [esp + 0x458]
rep stosd dword es:[edi], eax
xor edi, edi
cmp edx, edi
jne 0x50d234
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.0050308c
add esp, 0x1c
mov dword [esp + 0x18], eax
jmp 0x50d27f
dec edx
cmp edx, edi
mov dword [esp + 0x24], edx
jle 0x50d5bc
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.0050308c
add dword [esp + 0x34], eax
add dword [esp + 0x2c], 0x20
add esp, 0x1c
inc edi
cmp edi, dword [esp + 0x24]
jl 0x50d24c
cmp dword [esp + 0x18], 0
je 0x50d5bc
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.004f6211
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 0x50d4c3
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 0x50d4a8
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.004f61eb
add esp, 0xc
mov dword [esp + 0x1c], eax
push edi
lea eax, [esp + 0x144]
push eax
lea eax, [esp + 0x40]
push eax
call fcn.004f61eb
add esp, 0xc
cmp dword [esp + 0x1c], 0xffffffff
je 0x50d58e
cmp eax, 0xffffffff
je 0x50d58e
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.00502ec6
add esp, 0x1c
test eax, eax
je 0x50d496
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.004f6211
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.004f6211
mov eax, dword [esp + 0x50]
mov ecx, dword [esp + 0x3c]
add esp, 0x20
test eax, eax
mov dword [esp + eax*4 + 0x140], ecx
jne 0x50d413
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 0x50d441
mov dword [esp + 0x144], ecx
cmp dword [esp + 0x14], 0
jge 0x50d44c
test edx, edx
jl 0x50d4a8
mov ecx, dword [esp + 0x18]
mov ecx, dword [ecx]
dec ecx
mov dword [esp + 0x14], ecx
js 0x50d474
mov ecx, dword [esp + 0x14]
lea ecx, [esp + ecx*4 + 0x350]
cmp dword [ecx], edi
jne 0x50d474
dec dword [esp + 0x14]
mov edx, dword [esp + 0x10]
mov dword [ecx], edx
jns 0x50d459
mov ecx, dword [esp + 0x18]
mov edx, dword [ecx]
jmp 0x50d48d
lea ecx, [esp + edx*4 + 0x248]
cmp dword [ecx], eax
jne 0x50d4a8
mov edi, dword [esp + 0x10]
mov dword [ecx], edi
inc edx
cmp edx, dword [esp + 0x20]
jl 0x50d47c
jmp 0x50d4a8
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 0x50d2eb
mov edi, dword [esp + 0x20]
mov esi, dword [ebp + 8]
mov eax, edi
shl eax, 2
call fcn.0047dd80
mov esi, eax
push 0
lea eax, [esp + 0x144]
push eax
lea eax, [esp + 0x40]
push eax
mov dword [esp + 0x28], esi
call fcn.004f61eb
add esp, 0xc
mov dword [esi], eax
push 1
lea eax, [esp + 0x144]
push eax
lea eax, [esp + 0x40]
push eax
call fcn.004f61eb
add esp, 0xc
push 2
mov dword [esi + 4], eax
pop eax
cmp dword [esp + 0x20], eax
mov dword [esp + 0x10], eax
jle 0x50d5bc
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.004f6406
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.004f61eb
mov ecx, dword [esp + 0x30]
add esp, 0xc
test eax, eax
jl 0x50d595
cmp ecx, eax
je 0x50d595
mov ecx, dword [esp + 0x10]
mov dword [esi + ecx*4], eax
jmp 0x50d5a2
push 1
call fcn.004aadda
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 0x50d52e
mov eax, dword [esp + 0x1c]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret