Recursively check for undefined variables and skip inlining if they exist