write the regaltrace.cpp5~ functions a bit differently than the standard wrappers