gen convert code for c