kmul is a generator of routines for optimized multiplication by an integer  constant.