Foreign Function Verification Through Metaprogramming