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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x546710
mov eax, dword fs:[0]
push eax
sub esp, 0x60
mov eax, dword [0x595978]
xor eax, esp
mov dword [esp + 0x58], eax
push ebx
push esi
push edi
mov eax, dword [0x595978]
xor eax, esp
push eax
lea eax, [esp + 0x70]
mov dword fs:[0], eax
movzx eax, word [ebp + 0x18]
mov esi, dword [ebp + 0x14]
test dword [esi + 0x14], 0x4000
mov edi, dword [ebp + 8]
mov ebx, ecx
mov dword [esp + 0x20], edi
mov dword [esp + 0x10], eax
jne 0x40fac4
movzx ecx, byte [ebp + 0x1c]
mov edx, dword [ebx]
mov edx, dword [edx + 0x1c]
push ecx
mov ecx, dword [ebp + 0xc]
push eax
mov eax, dword [ebp + 0x10]
push esi
push eax
push ecx
push edi
mov ecx, ebx
call edx
mov eax, edi
jmp 0x40fc7a
lea eax, [esp + 0x24]
push eax
mov ecx, esi
call fcn.004022e0
push eax
mov dword [esp + 0x7c], 0
call fcn.00417f20
mov dword [esp + 0x7c], 0xffffffff
mov edi, dword [esp + 0x28]
add esp, 4
mov dword [esp + 0x18], eax
test edi, edi
je 0x40fb36
push 0
lea ecx, [esp + 0x2c]
mov dword [esp + 0x18], edi
call fcn.00495eec
mov eax, dword [edi + 4]
test eax, eax
je 0x40fb14
cmp eax, 0xffffffff
jae 0x40fb14
dec eax
mov dword [edi + 4], eax
mov edi, dword [edi + 4]
neg edi
sbb edi, edi
lea ecx, [esp + 0x28]
not edi
call fcn.00495f14
and edi, dword [esp + 0x14]
je 0x40fb36
mov edx, dword [edi]
mov eax, dword [edx]
push 1
mov ecx, edi
call eax
xor ecx, ecx
mov dword [esp + 0x44], 7
mov dword [esp + 0x40], 0
mov word [esp + 0x30], cx
mov dword [esp + 0x78], 1
cmp byte [ebp + 0x1c], cl
je 0x40fb8a
mov ecx, dword [esp + 0x18]
lea edx, [esp + 0x4c]
push edx
call fcn.00413770
push eax
lea ecx, [esp + 0x34]
mov byte [esp + 0x7c], 2
call fcn.0040d620
mov byte [esp + 0x78], 1
cmp dword [esp + 0x60], 8
jb 0x40fbc0
mov eax, dword [esp + 0x4c]
push eax
jmp 0x40fbb8
lea ecx, [esp + 0x4c]
push ecx
mov ecx, dword [esp + 0x1c]
call fcn.00413690
push eax
lea ecx, [esp + 0x34]
mov byte [esp + 0x7c], 3
call fcn.0040d620
mov byte [esp + 0x78], 1
cmp dword [esp + 0x60], 8
jb 0x40fbc0
mov edx, dword [esp + 0x4c]
push edx
call fcn.0049cf83
add esp, 4
cmp dword [esi + 0x24], 0
mov edi, dword [esi + 0x20]
mov ecx, dword [esp + 0x40]
jl 0x40fbdb
jg 0x40fbd3
test edi, edi
je 0x40fbdb
cmp edi, ecx
jbe 0x40fbdb
sub edi, ecx
jmp 0x40fbdd
xor edi, edi
mov eax, dword [esi + 0x14]
and eax, 0x1c0
cmp eax, 0x40
je 0x40fc17
mov ecx, dword [esp + 0x10]
mov edx, dword [ebp + 0x10]
mov eax, dword [ebp + 0xc]
push edi
push ecx
push edx
push eax
lea ecx, [esp + 0x38]
push ecx
push ebx
call fcn.00413230
mov edx, dword [eax]
mov ecx, dword [esp + 0x58]
mov dword [ebp + 0xc], edx
mov eax, dword [eax + 4]
add esp, 0x18
mov dword [ebp + 0x10], eax
xor edi, edi
cmp dword [esp + 0x44], 8
mov eax, dword [esp + 0x30]
jae 0x40fc26
lea eax, [esp + 0x30]
mov edx, dword [ebp + 0xc]
push ecx
mov ecx, dword [ebp + 0x10]
push eax
push ecx
push edx
lea eax, [esp + 0x28]
push eax
push ebx
call fcn.004131c0
mov ecx, dword [eax]
xor edx, edx
mov dword [ebp + 0xc], ecx
mov eax, dword [eax + 4]
push edi
mov dword [esi + 0x20], edx
mov dword [esi + 0x24], edx
mov edx, dword [esp + 0x2c]
mov esi, dword [esp + 0x3c]
push edx
push eax
push ecx
push esi
push ebx
mov dword [ebp + 0x10], eax
call fcn.00413230
add esp, 0x30
cmp dword [esp + 0x44], 8
jb 0x40fc78
mov eax, dword [esp + 0x30]
push eax
call fcn.0049cf83
add esp, 4
mov eax, esi
mov ecx, dword [esp + 0x70]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x58]
xor ecx, esp
call fcn.0049cc86
mov esp, ebp
pop ebp
ret 0x18