appended old code from CBackend (to try to generate C file output)