auto-gen the C code