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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x14
mov eax, dword [0x559940]
xor eax, esp
mov dword [esp + 0x10], eax
push ebx
mov ebx, dword [ebp + 8]
xor eax, eax
push esi
push edi
mov edi, ecx
mov dword [esp + 0x18], ebx
mov esi, edx
mov dword [esp + 0x14], edi
mov dword [esp + 0xc], eax
cmp byte [edi + 0xc], al
je 0x416740
test byte [esi + 0x1c], 4
mov ecx, dword [esi + 0x14]
je 0x416711
mov eax, dword [ecx + 0x18]
cmp eax, dword [esi + 0x18]
jb 0x416711
cmp dword [ecx + 0x60], 0
je 0x416740
mov ecx, esi
call fcn.00414010
jmp 0x416738
mov eax, dword [ecx + 0x28]
test eax, eax
jne 0x416980
mov eax, dword [ecx + 0x94]
cmp eax, dword [ecx + 0x98]
mov ecx, esi
jbe 0x416733
call fcn.00415cd0
jmp 0x416738
call fcn.00415c50
test eax, eax
jne 0x416980
test byte [esi + 0x1c], 2
je 0x416755
mov ecx, esi
call fcn.00414010
test eax, eax
jne 0x416980
movzx ecx, word [esi + 0x1c]
test cl, 8
je 0x41676b
cmp dword [ebp + 0xc], 0
jne 0x41676b
mov eax, dword [esi + 0x18]
mov dword [esp + 0xc], eax
and ecx, 0xfff7
mov word [esi + 0x1c], cx
mov eax, dword [edi + 0xd0]
push 0
push ebx
push dword [eax + 0x2c]
call dword [0x55a4a4]
mov ecx, eax
add esp, 0xc
test ecx, ecx
jne 0x416797
xor ebx, ebx
jmp 0x41683a
mov ebx, dword [ecx + 4]
mov eax, dword [edi + 0xd0]
cmp dword [ebx], 0
jne 0x4167b8
mov edx, dword [esp + 0x18]
push ecx
mov ecx, eax
call fcn.0040f850
add esp, 4
mov ebx, eax
jmp 0x4167bf
inc dword [eax + 0xc]
inc word [ebx + 0x1e]
test ebx, ebx
je 0x41683a
mov ax, word [ebx + 0x1c]
and ax, 8
or word [esi + 0x1c], ax
cmp byte [edi + 0xc], 0
je 0x4167e2
mov edx, dword [edi + 0x18]
mov ecx, ebx
inc edx
call fcn.0040fae0
jmp 0x41683a
test byte [ebx + 0x1c], 2
je 0x416821
mov ecx, dword [ebx + 0xc]
cmp dword [ecx + 8], ebx
jne 0x4167f6
mov eax, dword [ebx + 0x24]
mov dword [ecx + 8], eax
mov edx, dword [ebx + 0x20]
mov eax, dword [ebx + 0x24]
test edx, edx
je 0x416805
mov dword [edx + 0x24], eax
jmp 0x416808
mov dword [ecx + 4], eax
mov edx, dword [ebx + 0x24]
mov eax, dword [ebx + 0x20]
test edx, edx
je 0x416817
mov dword [edx + 0x20], eax
jmp 0x416821
mov dword [ecx], eax
test eax, eax
jne 0x416821
mov byte [ecx + 0x21], 2
mov eax, dword [ebx + 0xc]
push 1
dec dword [eax + 0xc]
mov eax, dword [ebx + 0xc]
push dword [ebx]
push dword [eax + 0x2c]
call dword [0x55a4a8]
add esp, 0xc
mov eax, dword [esi + 0x18]
mov ecx, esi
mov edx, dword [esp + 0x18]
mov dword [esp + 0x10], eax
call fcn.0040fae0
mov ecx, esi
call fcn.0040f970
cmp byte [edi + 0xc], 0
je 0x4168b8
test ebx, ebx
je 0x4168b8
mov edx, dword [esp + 0x10]
mov ecx, ebx
call fcn.0040fae0
test byte [ebx + 0x1c], 0x20
je 0x4168b1
mov eax, dword [ebx + 0x14]
dec dword [eax + 0x78]
mov ecx, dword [eax + 0x88]
mov dword [ebx + 0x10], ecx
mov esi, dword [eax + 0x3c]
mov dword [eax + 0x88], ebx
push dword [ebx + 4]
mov eax, dword [eax + 0x98]
mov ecx, dword [ebx + 0x18]
mov edi, dword [esi]
dec ecx
cdq
push edx
push eax
push 0
push ecx
call fcn.004f4a20
push edx
push eax
mov eax, dword [edi + 0x48]
push esi
call eax
mov edi, dword [esp + 0x24]
add esp, 0x10
jmp 0x4168b8
mov ecx, ebx
call fcn.0040f8d0
mov ebx, dword [esp + 0xc]
test ebx, ebx
je 0x41697e
push 0
lea eax, [esp + 0x1c]
push eax
mov eax, dword [edi + 0xc8]
push ebx
push edi
call eax
mov esi, eax
add esp, 0x10
test esi, esi
je 0x41690a
cmp ebx, dword [edi + 0x1c]
ja 0x4168f6
push dword [edi + 0xcc]
mov ecx, dword [edi + 0x38]
mov edx, ebx
call fcn.0040f2d0
add esp, 4
mov eax, esi
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x10]
xor ecx, esp
call fcn.004f49c2
mov esp, ebp
pop ebp
ret
mov eax, dword [esp + 0x18]
or word [eax + 0x1c], 8
mov ecx, dword [esp + 0x18]
call fcn.0040f970
mov edx, dword [esp + 0x18]
test byte [edx + 0x1c], 0x20
je 0x416977
mov eax, dword [edx + 0x14]
dec dword [eax + 0x78]
mov ecx, dword [eax + 0x88]
mov dword [edx + 0x10], ecx
mov esi, dword [eax + 0x3c]
mov dword [eax + 0x88], edx
push dword [edx + 4]
mov ecx, dword [edx + 0x18]
mov eax, dword [eax + 0x98]
dec ecx
mov edi, dword [esi]
cdq
push edx
push eax
push 0
push ecx
call fcn.004f4a20
push edx
push eax
mov eax, dword [edi + 0x48]
push esi
call eax
add esp, 0x10
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x10]
xor ecx, esp
call fcn.004f49c2
mov esp, ebp
pop ebp
ret
mov ecx, edx
call fcn.0040f8d0
xor eax, eax
mov ecx, dword [esp + 0x1c]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.004f49c2
mov esp, ebp
pop ebp
ret