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

Disassembly:
sub esp, 0x74
cmp dword [esp + 0x84], 0xa
push ebx
push ebp
push esi
push edi
jb 0x516987
mov edx, dword [esp + 0x98]
mov eax, dword [esp + 0x8c]
mov ebp, dword [esp + 0x88]
add eax, ebp
mov esi, dword [esp + 0x90]
mov ebx, dword [edx]
mov dword [esp + 0x38], eax
lea eax, [edx + 4]
mov dword [esp + 0x18], eax
add edx, 4
xor eax, eax
inc eax
lea ecx, [ebx - 1]
shl eax, cl
push esi
lea eax, [edx + eax*4]
mov dword [esp + 0x14], eax
call fcn.0050d5e3
movzx eax, ax
mov dword [esp + 0x38], eax
lea eax, [esi + 2]
push eax
call fcn.0050d5e3
movzx eax, ax
mov dword [esp + 0x24], eax
lea eax, [esi + 4]
push eax
call fcn.0050d5e3
movzx edi, ax
lea ecx, [esi + 6]
mov eax, dword [esp + 0x98]
add esp, 0xc
mov esi, dword [esp + 0x94]
add eax, 3
shr eax, 2
sub esi, edi
sub esi, dword [esp + 0x1c]
mov dword [esp + 0x3c], ecx
add ecx, dword [esp + 0x34]
lea edx, [eax + ebp]
mov dword [esp + 0x24], ecx
lea ecx, [edx + eax]
mov dword [esp + 0x40], edx
add eax, ecx
mov dword [esp + 0x2c], ecx
mov dword [esp + 0x30], eax
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x34]
sub esi, eax
sub esi, 6
mov dword [esp + 0x28], edx
mov dword [esp + 0x20], ecx
cmp esi, dword [esp + 0x94]
ja 0x516987
push eax
push dword [esp + 0x40]
lea eax, [esp + 0x7c]
push eax
call fcn.005150a2
add esp, 0xc
cmp eax, 0xffffff88
ja 0x51698a
push dword [esp + 0x1c]
lea eax, [esp + 0x68]
push dword [esp + 0x28]
push eax
call fcn.005150a2
add esp, 0xc
cmp eax, 0xffffff88
ja 0x51698a
mov eax, dword [esp + 0x24]
add eax, dword [esp + 0x1c]
push edi
push eax
lea eax, [esp + 0x5c]
push eax
call fcn.005150a2
add esp, 0xc
cmp eax, 0xffffff88
ja 0x51698a
mov eax, dword [esp + 0x24]
add eax, dword [esp + 0x1c]
add eax, edi
push esi
push eax
lea eax, [esp + 0x4c]
push eax
call fcn.005150a2
add esp, 0xc
cmp eax, 0xffffff88
ja 0x51698a
lea eax, [esp + 0x44]
push eax
call fcn.00513cc3
mov edi, eax
lea eax, [esp + 0x58]
push eax
call fcn.00513cc3
or edi, eax
lea eax, [esp + 0x6c]
push eax
call fcn.00513cc3
mov esi, eax
lea eax, [esp + 0x80]
push eax
or esi, edi
call fcn.00513cc3
mov ecx, dword [esp + 0x40]
add esp, 0x10
mov edx, dword [esp + 0x2c]
or eax, esi
cmp edx, ecx
ja 0x5168c1
mov esi, edx
test eax, eax
jne 0x5168bd
mov eax, dword [esp + 0x38]
add eax, 0xfffffff0
cmp dword [esp + 0x14], eax
ja 0x5168bd
mov edi, dword [esp + 0x18]
lea eax, [esp + 0x74]
push ebx
push dword [esp + 0x14]
push edi
push eax
push ebp
call fcn.00515df8
push ebx
push dword [esp + 0x28]
add ebp, eax
lea eax, [esp + 0x80]
push edi
mov edi, dword [esp + 0x48]
push eax
push edi
call fcn.00515df8
push ebx
push dword [esp + 0x3c]
add edi, eax
lea eax, [esp + 0x84]
push dword [esp + 0x48]
push eax
push esi
call fcn.00515df8
push ebx
push dword [esp + 0x50]
add esi, eax
lea eax, [esp + 0x88]
push dword [esp + 0x5c]
push eax
push dword [esp + 0x60]
call fcn.00515df8
add dword [esp + 0x64], eax
add esp, 0x50
lea eax, [esp + 0x74]
push ebx
push dword [esp + 0x14]
push dword [esp + 0x20]
push eax
push ebp
call fcn.00515df8
push ebx
push dword [esp + 0x28]
add ebp, eax
lea eax, [esp + 0x80]
push dword [esp + 0x34]
push eax
push edi
call fcn.00515df8
push ebx
push dword [esp + 0x3c]
add edi, eax
lea eax, [esp + 0x84]
mov dword [esp + 0x58], edi
mov edi, dword [esp + 0x48]
push edi
push eax
push esi
call fcn.00515df8
push ebx
push dword [esp + 0x50]
add esi, eax
lea eax, [esp + 0x88]
push edi
push eax
mov dword [esp + 0x6c], esi
mov esi, dword [esp + 0x60]
push esi
call fcn.00515df8
add esp, 0x50
add esi, eax
lea eax, [esp + 0x44]
mov dword [esp + 0x14], esi
push eax
call fcn.00513cc3
mov edi, eax
lea eax, [esp + 0x58]
push eax
call fcn.00513cc3
or edi, eax
lea eax, [esp + 0x6c]
push eax
call fcn.00513cc3
mov esi, eax
lea eax, [esp + 0x80]
push eax
or esi, edi
call fcn.00513cc3
mov ecx, dword [esp + 0x40]
or eax, esi
mov esi, dword [esp + 0x30]
add esp, 0x10
cmp esi, ecx
jbe 0x51677f
mov edx, dword [esp + 0x2c]
mov eax, dword [esp + 0x40]
cmp ebp, eax
ja 0x516987
mov edi, dword [esp + 0x28]
cmp edi, edx
ja 0x516987
mov esi, dword [esp + 0x20]
cmp esi, ecx
ja 0x516987
push ebx
push dword [esp + 0x9c]
push eax
lea eax, [esp + 0x80]
push eax
push ebp
call fcn.00515c20
mov ebp, dword [esp + 0xac]
lea eax, [esp + 0x78]
push ebx
push ebp
push dword [esp + 0x48]
push eax
push edi
call fcn.00515c20
push ebx
push ebp
push dword [esp + 0x60]
lea eax, [esp + 0x88]
push eax
push esi
call fcn.00515c20
push ebx
push ebp
push dword [esp + 0x7c]
lea eax, [esp + 0x8c]
push eax
push dword [esp + 0x60]
call fcn.00515c20
add esp, 0x50
lea eax, [esp + 0x44]
push eax
call fcn.00509bdd
mov edx, eax
lea eax, [esp + 0x58]
push eax
call fcn.00509bdd
and edx, eax
lea eax, [esp + 0x6c]
push eax
call fcn.00509bdd
and edx, eax
lea eax, [esp + 0x80]
push eax
call fcn.00509bdd
add esp, 0x10
test eax, edx
mov eax, dword [esp + 0x8c]
push 0xffffffffffffffec
pop ecx
cmove eax, ecx
jmp 0x51698a
push 0xffffffffffffffec
pop eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x74
ret