Function at 0x51aed0
Capabilities:
Access peb ldr_data

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x5f4848
mov eax, dword fs:[0]
push eax
sub esp, 0x24
push ebx
push edi
mov eax, dword [0x667050]
xor eax, esp
push eax
lea eax, [esp + 0x30]
mov dword fs:[0], eax
mov eax, dword [esi + 4]
cmp eax, 8
jae 0x51af4f
push 8
call fcn.005e693a
add esp, 4
cmp dword [esi + 4], 0
mov edi, eax
jbe 0x51af35
mov ecx, dword [esi + 8]
test ecx, ecx
je 0x51af35
mov eax, dword [esi + 4]
cmp eax, 8
jb 0x51af29
mov eax, 8
push eax
push ecx
push edi
call dword [0x610618]
add esp, 0xc
mov eax, dword [esi + 8]
test eax, eax
je 0x51af45
push eax
call fcn.005e6a6c
add esp, 4
mov dword [esi + 8], edi
mov dword [esi + 4], 8
mov ebx, dword [ebp + 8]
mov eax, dword [ebx + 0x10]
mov ecx, dword [esi + 8]
mov dword [ecx], eax
mov eax, dword [esi + 8]
xor ecx, ecx
mov dword [eax + 4], ecx
mov eax, dword [esi + 4]
cmp eax, 8
jb 0x51af6f
mov eax, 8
mov dword [esi + 0xc], eax
mov eax, dword [ebx + 0x10]
cmp eax, ecx
mov dword [esp + 0x10], ecx
jbe 0x51b10b
mov edi, dword [ebx + 0xc]
add eax, edi
cmp edi, eax
jbe 0x51af90
call dword [0x6105e8]
mov eax, dword [ebx + 0xc]
mov ecx, dword [esp + 0x10]
mov edx, dword [ebx + 0x10]
add edi, ecx
add edx, eax
cmp edi, edx
ja 0x51afa6
cmp edi, eax
jae 0x51afac
call dword [0x6105e8]
mov eax, dword [ebx + 0x10]
add eax, dword [ebx + 0xc]
cmp edi, eax
jb 0x51afbc
call dword [0x6105e8]
mov eax, dword [ebx + 8]
cmp eax, edi
ja 0x51afc5
sub edi, eax
mov ecx, dword [ebx + 4]
mov ecx, dword [ecx + edi*4]
lea edx, [esp + 0x1c]
push edx
call fcn.0051c7f0
mov dword [esp + 0x38], 0
mov ecx, dword [esi + 4]
mov edi, dword [esp + 0x28]
mov edx, dword [esi + 0xc]
mov eax, ecx
add edi, 4
sub eax, edx
cmp eax, edi
jae 0x51b097
mov eax, ecx
test eax, eax
mov dword [esp + 0x14], eax
fild dword [esp + 0x14]
lea edx, [ecx + edi*4]
jge 0x51b00d
fadd qword [0x638578]
fmul qword [0x6385f8]
fnstcw word [esp + 0xc]
movzx eax, word [esp + 0xc]
or eax, 0xc00
mov dword [esp + 0x14], eax
fldcw word [esp + 0x14]
fistp qword [esp + 0x14]
mov ebx, dword [esp + 0x14]
cmp ebx, edx
fldcw word [esp + 0xc]
ja 0x51b03b
mov ebx, edx
cmp ebx, ecx
je 0x51b094
test ebx, ebx
mov dword [esp + 0xc], 0
jbe 0x51b07a
push ebx
call fcn.005e693a
add esp, 4
cmp dword [esi + 4], 0
mov dword [esp + 0xc], eax
jbe 0x51b07a
mov edx, dword [esi + 8]
test edx, edx
je 0x51b08a
mov ecx, dword [esi + 4]
cmp ecx, ebx
jb 0x51b06e
mov ecx, ebx
push ecx
push edx
push eax
call dword [0x610618]
add esp, 0xc
mov eax, dword [esi + 8]
test eax, eax
je 0x51b08a
push eax
call fcn.005e6a6c
add esp, 4
mov ecx, dword [esp + 0xc]
mov dword [esi + 8], ecx
mov dword [esi + 4], ebx
mov ebx, dword [ebp + 8]
mov ecx, dword [esi + 0xc]
mov eax, dword [esi + 8]
mov edx, dword [esp + 0x28]
add eax, ecx
mov dword [eax], edx
mov ecx, dword [esp + 0x28]
mov edx, dword [esp + 0x24]
push ecx
add eax, 4
push edx
push eax
call fcn.005e796e
mov eax, dword [esi + 0xc]
mov ecx, dword [esi + 4]
add eax, edi
add esp, 0xc
cmp eax, ecx
jbe 0x51b0c9
mov eax, ecx
mov dword [esp + 0x38], 0xffffffff
mov dword [esi + 0xc], eax
mov eax, dword [esp + 0x24]
test eax, eax
mov dword [esp + 0x1c], 0x6124ac
je 0x51b0f5
push eax
call fcn.005e6a6c
add esp, 4
mov dword [esp + 0x24], 0
mov ecx, dword [esp + 0x10]
mov eax, dword [ebx + 0x10]
add ecx, 1
cmp ecx, eax
mov dword [esp + 0x10], ecx
jb 0x51af81
mov eax, dword [esi + 0xc]
mov ecx, dword [esi + 8]
sub eax, 8
mov dword [ecx + 4], eax
mov ecx, dword [esp + 0x30]
mov dword fs:[0], ecx
pop ecx
pop edi
pop ebx
mov esp, ebp
pop ebp
ret