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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x6c
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
push edi
call dword [sym.imp.LuaLibDll.dll_lua_gettop]
add esp, 4
cmp eax, 9
mov dword [esp + 0x10], eax
jl 0x5d2010
mov esi, dword [ebp + 0xc]
push esi
push edi
call dword [sym.imp.LuaLibDll.dll_lua_tonumber]
fnstcw word [esp + 0x14]
movzx eax, word [esp + 0x14]
or eax, 0xc00
mov dword [esp + 0x20], eax
add esi, 1
push esi
fldcw word [esp + 0x24]
push edi
fistp qword [esp + 0x68]
mov ebx, dword [esp + 0x68]
fldcw word [esp + 0x1c]
call dword [sym.imp.LuaLibDll.dll_lua_tonumber]
fnstcw word [esp + 0x1c]
movzx eax, word [esp + 0x1c]
or eax, 0xc00
mov dword [esp + 0x28], eax
add esi, 1
push esi
fldcw word [esp + 0x2c]
push edi
fistp qword [esp + 0x70]
mov eax, dword [esp + 0x70]
mov dword [esp + 0x3c], eax
fldcw word [esp + 0x24]
call dword [sym.imp.LuaLibDll.dll_lua_tonumber]
fnstcw word [esp + 0x24]
movzx eax, word [esp + 0x24]
or eax, 0xc00
mov dword [esp + 0x30], eax
add esi, 1
push esi
fldcw word [esp + 0x34]
push edi
fistp qword [esp + 0x78]
mov ecx, dword [esp + 0x78]
mov dword [esp + 0x74], ecx
fldcw word [esp + 0x2c]
call dword [sym.imp.LuaLibDll.dll_lua_tonumber]
fnstcw word [esp + 0x2c]
movzx eax, word [esp + 0x2c]
or eax, 0xc00
mov dword [esp + 0x38], eax
add esi, 1
push esi
fldcw word [esp + 0x3c]
push edi
fistp qword [esp + 0x80]
mov edx, dword [esp + 0x80]
mov dword [esp + 0x80], edx
fldcw word [esp + 0x34]
call dword [sym.imp.LuaLibDll.dll_lua_tonumber]
fnstcw word [esp + 0x34]
movzx eax, word [esp + 0x34]
or eax, 0xc00
mov dword [esp + 0x40], eax
add esi, 1
push esi
fldcw word [esp + 0x44]
push edi
fistp qword [esp + 0x78]
mov eax, dword [esp + 0x78]
mov dword [esp + 0x78], eax
fldcw word [esp + 0x3c]
call dword [sym.imp.LuaLibDll.dll_lua_tonumber]
fnstcw word [esp + 0x3c]
movzx eax, word [esp + 0x3c]
or eax, 0xc00
mov dword [esp + 0x48], eax
add esi, 1
push esi
fldcw word [esp + 0x4c]
push edi
fistp qword [esp + 0x78]
mov ecx, dword [esp + 0x78]
mov dword [esp + 0x78], ecx
fldcw word [esp + 0x44]
call dword [sym.imp.LuaLibDll.dll_lua_tonumber]
fnstcw word [esp + 0x44]
add esi, 1
movzx eax, word [esp + 0x44]
or eax, 0xc00
mov dword [esp + 0x50], eax
push esi
push edi
fldcw word [esp + 0x58]
fistp qword [esp + 0x78]
mov edx, dword [esp + 0x78]
mov dword [esp + 0x74], edx
fldcw word [esp + 0x4c]
call dword [sym.imp.LuaLibDll.dll_lua_tonumber]
fnstcw word [esp + 0x4c]
movzx eax, word [esp + 0x4c]
or eax, 0xc00
mov dword [esp + 0x58], eax
add esp, 0x40
add esi, 1
fldcw word [esp + 0x18]
push esi
push edi
fistp qword [esp + 0x40]
mov eax, dword [esp + 0x40]
mov dword [esp + 0x40], eax
fldcw word [esp + 0x14]
call dword [sym.imp.LuaLibDll.dll_lua_tonumber]
fnstcw word [esp + 0x14]
movzx eax, word [esp + 0x14]
or eax, 0xc00
mov dword [esp + 0x20], eax
xor eax, eax
add esp, 8
fldcw word [esp + 0x18]
add esi, 1
cmp dword [esp + 0x10], 0xf
mov dword [esp + 0x14], eax
fistp qword [esp + 0x28]
mov ecx, dword [esp + 0x28]
mov dword [esp + 0x28], ecx
mov dword [esp + 0x60], eax
fldcw word [esp + 0xc]
mov dword [esp + 0x64], eax
mov dword [esp + 0x68], eax
mov dword [esp + 0x6c], eax
mov dword [esp + 0x70], eax
mov dword [esp + 0x74], eax
jl 0x5d1eb8
push esi
push edi
call dword [sym.imp.LuaLibDll.dll_lua_tonumber]
fnstcw word [esp + 0x14]
movzx eax, word [esp + 0x14]
or eax, 0xc00
mov dword [esp + 0x20], eax
add esi, 1
push esi
fldcw word [esp + 0x24]
push edi
fistp qword [esp + 0x28]
mov edx, dword [esp + 0x28]
mov dword [esp + 0x70], edx
fldcw word [esp + 0x1c]
call dword [sym.imp.LuaLibDll.dll_lua_tonumber]
fnstcw word [esp + 0x1c]
movzx eax, word [esp + 0x1c]
or eax, 0xc00
mov dword [esp + 0x28], eax
add esi, 1
push esi
fldcw word [esp + 0x2c]
push edi
fistp qword [esp + 0x30]
mov eax, dword [esp + 0x30]
mov dword [esp + 0x7c], eax
fldcw word [esp + 0x24]
call dword [sym.imp.LuaLibDll.dll_lua_tonumber]
fnstcw word [esp + 0x24]
movzx eax, word [esp + 0x24]
or eax, 0xc00
mov dword [esp + 0x30], eax
add esi, 1
push esi
fldcw word [esp + 0x34]
push edi
fistp qword [esp + 0x38]
mov ecx, dword [esp + 0x38]
mov dword [esp + 0x88], ecx
fldcw word [esp + 0x2c]
call dword [sym.imp.LuaLibDll.dll_lua_tonumber]
fnstcw word [esp + 0x2c]
movzx eax, word [esp + 0x2c]
or eax, 0xc00
mov dword [esp + 0x38], eax
add esi, 1
push esi
fldcw word [esp + 0x3c]
push edi
fistp qword [esp + 0x40]
mov edx, dword [esp + 0x40]
mov dword [esp + 0x94], edx
fldcw word [esp + 0x34]
call dword [sym.imp.LuaLibDll.dll_lua_tonumber]
fnstcw word [esp + 0x34]
movzx eax, word [esp + 0x34]
or eax, 0xc00
mov dword [esp + 0x40], eax
add esi, 1
push esi
fldcw word [esp + 0x44]
push edi
fistp qword [esp + 0x48]
mov eax, dword [esp + 0x48]
mov dword [esp + 0xa0], eax
fldcw word [esp + 0x3c]
call dword [sym.imp.LuaLibDll.dll_lua_tonumber]
fnstcw word [esp + 0x3c]
movzx eax, word [esp + 0x3c]
or eax, 0xc00
mov dword [esp + 0x48], eax
add esp, 0x30
add esi, 1
fldcw word [esp + 0x18]
fistp qword [esp + 0x18]
mov ecx, dword [esp + 0x18]
mov dword [esp + 0x74], ecx
fldcw word [esp + 0xc]
cmp dword [esp + 0x10], 0x10
jne 0x5d1ef3
push esi
push edi
call dword [sym.imp.LuaLibDll.dll_lua_tonumber]
fnstcw word [esp + 0x14]
movzx eax, word [esp + 0x14]
or eax, 0xc00
mov dword [esp + 0x20], eax
add esp, 8
add esi, 1
fldcw word [esp + 0x18]
fistp qword [esp + 0x18]
mov edx, dword [esp + 0x18]
mov dword [esp + 0x14], edx
fldcw word [esp + 0xc]
xor eax, eax
cmp dword [esp + 0x10], 0x12
mov dword [esp + 0x18], eax
mov dword [esp + 0xc], eax
jl 0x5d1f6e
push esi
push edi
call dword [sym.imp.LuaLibDll.dll_lua_tonumber]
fnstcw word [esp + 0x14]
movzx eax, word [esp + 0x14]
or eax, 0xc00
mov dword [esp + 0x20], eax
add esi, 1
push esi
fldcw word [esp + 0x24]
push edi
fistp dword [esp + 0x28]
mov ax, word [esp + 0x28]
movzx ecx, ax
mov dword [esp + 0x28], ecx
fldcw word [esp + 0x1c]
call dword [sym.imp.LuaLibDll.dll_lua_tonumber]
fnstcw word [esp + 0x1c]
movzx eax, word [esp + 0x1c]
add esp, 0x10
or eax, 0xc00
mov dword [esp + 0x10], eax
fldcw word [esp + 0x10]
fistp dword [esp + 0x10]
mov dx, word [esp + 0x10]
movzx eax, dx
fldcw word [esp + 0xc]
mov dword [esp + 0xc], eax
cmp ebx, 4
ja 0x5d2010
mov esi, dword [ebp + 0x10]
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x24]
mov dl, byte [esp + 0x14]
push 0
push eax
mov dword [esi + 0x574], eax
mov dword [esi + 0x3a8], eax
mov dword [esi + 0x388], ecx
mov ecx, dword [esp + 0x3c]
mov dword [esi + 0x3a4], ebx
imul ebx, ebx, 0x56fc
lea eax, [esp + 0x68]
push eax
mov eax, dword [esp + 0x4c]
push ecx
mov ecx, dword [esp + 0x58]
mov byte [esi + 0x3f0], dl
mov edx, dword [esp + 0x48]
push edx
mov edx, dword [esp + 0x68]
push eax
mov eax, dword [esp + 0x70]
push ecx
push edx
mov byte [esi + 0x3f1], 0
add ebx, dword [0x16085a0]
push eax
push esi
mov ecx, ebx
call fcn.005c9390
test eax, eax
je 0x5d2010
cmp dword [esi + 8], 4
jne 0x5d2007
mov cx, word [esp + 0x18]
mov dx, word [esp + 0xc]
mov word [esi + 0x3ac], cx
mov word [esi + 0x3ae], dx
mov al, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
pop edi
pop esi
xor al, al
pop ebx
mov esp, ebp
pop ebp
ret