Making names in generated code less likely to clash

Maybe this can be passed to `genDispatchLogic`, so it doesn't have to be defined twice.