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

Disassembly:
mov ecx, dword [0x6d0e30]
mov ecx, dword fs:[ecx]
mov ecx, dword [ecx]
lea eax, [esp - 0x5c]
cmp eax, dword [ecx + 8]
jbe 0x516583
sub esp, 0xdc
mov edx, dword [esp + 0xe0]
movzx ebx, byte [edx + 0xa8]
test bl, bl
je 0x516217
mov eax, 1
jmp 0x51622b
mov dword [esp], edx
call fcn.0051b940
movzx eax, byte [esp + 4]
mov edx, dword [esp + 0xe0]
test al, al
je 0x516251
mov ecx, dword [edx + 0x98]
mov eax, dword [edx + 0xa0]
cmp eax, ecx
jae 0x51657d
mov ebx, dword [edx + 0x94]
lea ebp, [eax + eax*8]
lea ebx, [ebx + ebp*8]
jmp 0x516253
xor ebx, ebx
test ebx, ebx
je 0x516560
cmp dword [ebx], 0x11
jne 0x5164ba
mov ebp, dword [ebx + 0x10]
mov eax, dword [ebx + 0x18]
mov ebx, dword [ebx + 0x14]
nop
mov byte [edx + 0xa8], 0
inc dword [edx + 0xa4]
mov ecx, dword [edx + 0x98]
mov esi, dword [edx + 0xa0]
cmp esi, ecx
jae 0x516576
mov ecx, dword [edx + 0x94]
lea esi, [esi + esi*8]
lea ecx, [ecx + esi*8]
cmp dword [ecx], 2
sete cl
mov byte [edx + 0x8d], cl
inc dword [edx + 0xa0]
movzx ecx, byte [edx + 0xa8]
test cl, cl
je 0x5162bf
mov ecx, 1
jmp 0x5162ed
mov dword [esp + 0x28], eax
mov dword [esp + 0x24], ebx
mov dword [esp + 0x20], ebp
mov dword [esp], edx
call fcn.0051b940
movzx eax, byte [esp + 4]
mov edx, dword [esp + 0xe0]
mov ebx, dword [esp + 0x24]
mov ebp, dword [esp + 0x20]
mov ecx, eax
mov eax, dword [esp + 0x28]
test cl, cl
je 0x516313
mov ecx, dword [edx + 0x98]
mov esi, dword [edx + 0xa0]
cmp ecx, esi
jbe 0x51656f
mov ecx, dword [edx + 0x94]
lea esi, [esi + esi*8]
lea ecx, [ecx + esi*8]
jmp 0x516315
xor ecx, ecx
test ecx, ecx
je 0x5164ab
mov ecx, dword [ecx]
cmp ecx, 0x10
je 0x5163f2
cmp ecx, 0x11
je 0x5163f2
cmp ecx, 9
je 0x5163f2
mov eax, dword [edx + 0xdc]
mov ecx, dword [edx + 0xd8]
inc ecx
mov ebx, dword [edx + 0xd4]
cmp eax, ecx
jae 0x5163b4
mov dword [esp], ebx
mov dword [esp + 4], ecx
mov dword [esp + 8], eax
mov dword [esp + 0xc], 1
lea eax, [0x55a3a0]
mov dword [esp + 0x10], eax
call fcn.0044b6b0
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x14]
mov edx, dword [esp + 0x18]
mov ebx, dword [esp + 0xe0]
mov dword [ebx + 0xdc], eax
mov eax, dword [0x6d0ed8]
test eax, eax
je 0x5163a6
call fcn.00464b00
mov dword [edi], ecx
mov eax, dword [ebx + 0xd4]
mov dword [edi + 4], eax
mov dword [ebx + 0xd4], ecx
mov eax, edx
mov edx, ebx
mov ebx, ecx
mov ecx, eax
mov dword [edx + 0xd8], ecx
mov dword [ebx + ecx*4 - 4], 0xc
mov dword [esp], edx
mov eax, dword [esp + 0xe4]
mov dword [esp + 4], eax
mov byte [esp + 8], 1
mov byte [esp + 9], 1
call fcn.00513b40
movzx eax, byte [esp + 0xc]
mov byte [esp + 0xe8], al
add esp, 0xdc
ret
mov dword [edx + 0xd0], 0xc
lea edi, [esp + 0x84]
lea esi, [0x5b6dc0]
call fcn.00465124
mov dword [esp + 0x88], ebp
mov dword [esp + 0x8c], ebx
mov dword [esp + 0x90], eax
mov dword [esp + 0x94], ebp
mov dword [esp + 0x98], ebx
mov dword [esp + 0x9c], eax
mov dword [esp + 0xcc], 0
mov dword [esp + 0xd0], 0
mov dword [esp + 0xd4], 0
mov edi, dword [esp + 0xe4]
test byte [edi], al
mov eax, dword [0x6d0ed8]
test eax, eax
je 0x516490
lea eax, [0x570820]
mov dword [esp], eax
mov dword [esp + 4], edi
lea eax, [esp + 0x84]
mov dword [esp + 8], eax
call fcn.004113d0
mov edi, dword [esp + 0xe4]
lea esi, [esp + 0x84]
call fcn.00465124
mov byte [esp + 0xe8], 1
add esp, 0xdc
ret
mov byte [esp + 0xe8], 0
add esp, 0xdc
ret
mov dword [edx + 0xd0], 0xc
mov eax, dword [ebx + 4]
mov ecx, dword [ebx + 8]
mov dword [esp + 0x28], ecx
mov edx, dword [ebx + 0xc]
lea edi, [esp + 0x2c]
lea esi, [0x5b6dc0]
call fcn.00465124
mov dword [esp + 0x30], eax
mov ecx, dword [esp + 0x28]
mov dword [esp + 0x34], ecx
mov dword [esp + 0x38], edx
mov dword [esp + 0x3c], eax
mov dword [esp + 0x40], ecx
mov dword [esp + 0x44], edx
mov dword [esp + 0x74], 0
mov dword [esp + 0x78], 0
mov dword [esp + 0x7c], 0
mov edi, dword [esp + 0xe4]
test byte [edi], al
mov eax, dword [0x6d0ed8]
test eax, eax
je 0x516548
lea eax, [0x570820]
mov dword [esp], eax
mov dword [esp + 4], edi
lea eax, [esp + 0x2c]
mov dword [esp + 8], eax
call fcn.004113d0
mov edi, dword [esp + 0xe4]
lea esi, [esp + 0x2c]
call fcn.00465124
mov byte [esp + 0xe8], 1
add esp, 0xdc
ret
mov byte [esp + 0xe8], 0
add esp, 0xdc
ret
mov eax, esi
call fcn.00464b70
mov eax, esi
call fcn.00464b70
call fcn.00464b70
nop
call fcn.004636f0
jmp fcn.005161e0