generator: implement C generator