You should be able to “slap on” some leading text so the scoped symbols are not visible external to the scoping boundary (conceptually not much different than labels within a function.
decorating your function::
void Func()
{
int X;
int Func_BB3_AddToX(int y)
{
return X+y;
}
X=2;
std::cout << Func_BB3_AddToX(5);
}
You may need to slap on some basic block information in case someone uses the same inner function names in nested scopes.