I've heard that Lua's FFI is wonderful. Maybe we should take a look how did they tackle this problem.
After some quick digging around, here is the code setting up the arguments: https://github.com/LuaJIT/LuaJIT/blob/v2.1/src/lj_ccall.c#L917
Here are the x64 specific defines used by the setting up code: https://github.com/LuaJIT/LuaJIT/blob/v2.1/src/lj_ccall.c#L132
They definitely have all the type information. They get it from parsing the C declarations.
Here is an example of the declaration part: https://github.com/luapower/chipmunk/blob/master/chipmunk_h.lua And the usage: https://github.com/luapower/chipmunk/blob/master/chipmunk_demo.lua