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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x4c
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
push esi
call dword [sym.imp.LuaLibDll.dll_lua_gettop]
add esp, 4
cmp eax, 9
mov dword [esp + 0x14], eax
jl 0x5d28ff
push 1
push esi
call dword [sym.imp.LuaLibDll.dll_lua_tonumber]
fnstcw word [esp + 0x18]
movzx eax, word [esp + 0x18]
or eax, 0xc00
mov dword [esp + 0x40], eax
push 2
push esi
fldcw word [esp + 0x48]
fistp qword [esp + 0x48]
mov eax, dword [esp + 0x48]
mov dword [esp + 0x28], eax
fldcw word [esp + 0x20]
call dword [sym.imp.LuaLibDll.dll_lua_tonumber]
fnstcw word [esp + 0x20]
movzx eax, word [esp + 0x20]
or eax, 0xc00
mov dword [esp + 0x48], eax
push 3
push esi
fldcw word [esp + 0x50]
fistp qword [esp + 0x50]
mov ebx, dword [esp + 0x50]
fldcw word [esp + 0x28]
call dword [sym.imp.LuaLibDll.dll_lua_tonumber]
fnstcw word [esp + 0x28]
movzx eax, word [esp + 0x28]
or eax, 0xc00
mov dword [esp + 0x50], eax
push 4
push esi
fldcw word [esp + 0x58]
fistp qword [esp + 0x58]
mov ecx, dword [esp + 0x58]
mov dword [esp + 0x50], ecx
fldcw word [esp + 0x30]
call dword [sym.imp.LuaLibDll.dll_lua_tonumber]
fnstcw word [esp + 0x30]
movzx eax, word [esp + 0x30]
or eax, 0xc00
mov dword [esp + 0x58], eax
push 5
push esi
fldcw word [esp + 0x60]
fistp qword [esp + 0x60]
mov edx, dword [esp + 0x60]
mov dword [esp + 0x5c], edx
fldcw word [esp + 0x38]
call dword [sym.imp.LuaLibDll.dll_lua_tonumber]
fnstcw word [esp + 0x38]
movzx eax, word [esp + 0x38]
or eax, 0xc00
mov dword [esp + 0x60], eax
push 6
push esi
fldcw word [esp + 0x68]
fistp qword [esp + 0x68]
mov eax, dword [esp + 0x68]
mov dword [esp + 0x50], eax
fldcw word [esp + 0x40]
call dword [sym.imp.LuaLibDll.dll_lua_tonumber]
fnstcw word [esp + 0x40]
movzx eax, word [esp + 0x40]
or eax, 0xc00
mov dword [esp + 0x68], eax
push 7
push esi
fldcw word [esp + 0x70]
fistp qword [esp + 0x70]
mov ecx, dword [esp + 0x70]
mov dword [esp + 0x54], ecx
fldcw word [esp + 0x48]
call dword [sym.imp.LuaLibDll.dll_lua_tonumber]
fnstcw word [esp + 0x48]
movzx eax, word [esp + 0x48]
or eax, 0xc00
mov dword [esp + 0x70], eax
fldcw word [esp + 0x70]
fistp qword [esp + 0x70]
fldcw word [esp + 0x48]
mov edx, dword [esp + 0x70]
push 8
push esi
mov dword [esp + 0x68], edx
call dword [sym.imp.LuaLibDll.dll_lua_tonumber]
fnstcw word [esp + 0x50]
movzx eax, word [esp + 0x50]
or eax, 0xc00
mov dword [esp + 0x78], eax
add esp, 0x40
push 9
fldcw word [esp + 0x3c]
push esi
fistp qword [esp + 0x40]
mov eax, dword [esp + 0x40]
mov dword [esp + 0x34], eax
fldcw word [esp + 0x18]
call dword [sym.imp.LuaLibDll.dll_lua_tonumber]
fnstcw word [esp + 0x18]
movzx eax, word [esp + 0x18]
or eax, 0xc00
mov dword [esp + 0x40], eax
xor eax, eax
add esp, 8
fldcw word [esp + 0x38]
xor edi, edi
cmp dword [esp + 0x14], 9
fistp qword [esp + 0x38]
mov ecx, dword [esp + 0x38]
mov dword [esp + 0x24], ecx
mov dword [esp + 0x40], eax
fldcw word [esp + 0x10]
mov dword [esp + 0x44], eax
mov dword [esp + 0x48], eax
mov dword [esp + 0x4c], eax
mov dword [esp + 0x50], eax
mov dword [esp + 0x54], eax
jle 0x5d2652
push 0xa
push esi
call dword [sym.imp.LuaLibDll.dll_lua_tonumber]
fnstcw word [esp + 0x18]
movzx eax, word [esp + 0x18]
add esp, 8
or eax, 0xc00
mov dword [esp + 0x38], eax
fldcw word [esp + 0x38]
fistp qword [esp + 0x38]
mov eax, dword [esp + 0x38]
fldcw word [esp + 0x10]
jmp 0x5d2654
xor eax, eax
cmp dword [esp + 0x14], 0xf
mov dword [esp + 0x40], eax
jl 0x5d274f
push 0xb
push esi
call dword [sym.imp.LuaLibDll.dll_lua_tonumber]
fnstcw word [esp + 0x18]
movzx eax, word [esp + 0x18]
or eax, 0xc00
mov dword [esp + 0x40], eax
push 0xc
push esi
fldcw word [esp + 0x48]
fistp qword [esp + 0x48]
mov edx, dword [esp + 0x48]
mov dword [esp + 0x54], edx
fldcw word [esp + 0x20]
call dword [sym.imp.LuaLibDll.dll_lua_tonumber]
fnstcw word [esp + 0x20]
movzx eax, word [esp + 0x20]
or eax, 0xc00
mov dword [esp + 0x48], eax
push 0xd
push esi
fldcw word [esp + 0x50]
fistp qword [esp + 0x50]
mov eax, dword [esp + 0x50]
mov dword [esp + 0x60], eax
fldcw word [esp + 0x28]
call dword [sym.imp.LuaLibDll.dll_lua_tonumber]
fnstcw word [esp + 0x28]
movzx eax, word [esp + 0x28]
or eax, 0xc00
mov dword [esp + 0x50], eax
push 0xe
push esi
fldcw word [esp + 0x58]
fistp qword [esp + 0x58]
mov ecx, dword [esp + 0x58]
mov dword [esp + 0x6c], ecx
fldcw word [esp + 0x30]
call dword [sym.imp.LuaLibDll.dll_lua_tonumber]
fnstcw word [esp + 0x30]
movzx eax, word [esp + 0x30]
or eax, 0xc00
mov dword [esp + 0x58], eax
push 0xf
push esi
fldcw word [esp + 0x60]
fistp qword [esp + 0x60]
mov edx, dword [esp + 0x60]
mov dword [esp + 0x78], edx
fldcw word [esp + 0x38]
call dword [sym.imp.LuaLibDll.dll_lua_tonumber]
fnstcw word [esp + 0x38]
movzx eax, word [esp + 0x38]
add esp, 0x28
or eax, 0xc00
mov dword [esp + 0x38], eax
fldcw word [esp + 0x38]
fistp qword [esp + 0x38]
mov eax, dword [esp + 0x38]
fldcw word [esp + 0x10]
jmp 0x5d275f
mov dword [esp + 0x44], eax
mov dword [esp + 0x48], eax
mov dword [esp + 0x4c], eax
mov dword [esp + 0x50], eax
cmp dword [esp + 0x14], 0x10
mov dword [esp + 0x54], eax
jne 0x5d2798
push 0x10
push esi
call dword [sym.imp.LuaLibDll.dll_lua_tonumber]
fnstcw word [esp + 0x18]
movzx eax, word [esp + 0x18]
add esp, 8
or eax, 0xc00
mov dword [esp + 0x38], eax
fldcw word [esp + 0x38]
fistp qword [esp + 0x38]
mov edi, dword [esp + 0x38]
fldcw word [esp + 0x10]
xor eax, eax
cmp dword [esp + 0x14], 0x12
mov dword [esp + 0x38], eax
mov dword [esp + 0x10], eax
jl 0x5d2812
push 0x11
push esi
call dword [sym.imp.LuaLibDll.dll_lua_tonumber]
fnstcw word [esp + 0x18]
movzx eax, word [esp + 0x18]
or eax, 0xc00
mov dword [esp + 0x40], eax
push 0x12
push esi
fldcw word [esp + 0x48]
fistp dword [esp + 0x48]
mov cx, word [esp + 0x48]
movzx edx, cx
mov dword [esp + 0x48], edx
fldcw word [esp + 0x20]
call dword [sym.imp.LuaLibDll.dll_lua_tonumber]
fnstcw word [esp + 0x20]
movzx eax, word [esp + 0x20]
add esp, 0x10
or eax, 0xc00
mov dword [esp + 0x14], eax
fldcw word [esp + 0x14]
fistp dword [esp + 0x14]
mov ax, word [esp + 0x14]
movzx ecx, ax
fldcw word [esp + 0x10]
mov dword [esp + 0x10], ecx
mov eax, dword [esp + 0x18]
cmp eax, 4
ja 0x5d28ff
test ebx, ebx
jne 0x5d2860
mov ecx, dword [esp + 0x20]
push 1
push ebx
push edi
push ebx
push ebx
push eax
mov eax, dword [esp + 0x34]
lea edx, [esp + 0x58]
push edx
mov edx, dword [esp + 0x40]
push eax
mov eax, dword [esp + 0x48]
push ecx
mov ecx, dword [esp + 0x50]
push edx
mov edx, dword [esp + 0x58]
push eax
mov eax, dword [esp + 0x60]
push ecx
push edx
push eax
mov ecx, 0x161c2f0
call fcn.005e4b70
mov edi, eax
jmp 0x5d28bd
call dword [sym.imp.engine.dll_unsigned_int___cdecl_g_GetRandomSeed_void_]
push ebx
mov esi, eax
call dword [sym.imp.engine.dll_void___cdecl_g_RandomSeed_unsigned_int_]
mov ecx, dword [esp + 0x1c]
mov eax, dword [esp + 0x20]
add esp, 4
push 1
push 0
push edi
push 0
push ebx
push ecx
mov ecx, dword [esp + 0x38]
lea edx, [esp + 0x58]
push edx
mov edx, dword [esp + 0x40]
push eax
mov eax, dword [esp + 0x48]
push ecx
mov ecx, dword [esp + 0x50]
push edx
mov edx, dword [esp + 0x58]
push eax
mov eax, dword [esp + 0x60]
push ecx
push edx
push eax
mov ecx, 0x161c2f0
call fcn.005e4b70
push esi
mov edi, eax
call dword [sym.imp.engine.dll_void___cdecl_g_RandomSeed_unsigned_int_]
add esp, 4
test edi, edi
jle 0x5d28f6
mov ecx, dword [0x1341190]
mov eax, edi
imul eax, eax, 0x57c
cmp dword [eax + ecx + 8], 4
jne 0x5d28f6
movzx edx, word [esp + 0x38]
mov word [eax + ecx + 0x3ac], dx
movzx edx, word [esp + 0x10]
mov ecx, dword [0x1341190]
mov word [eax + ecx + 0x3ae], dx
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret