parse and annotate the C code in one pass instead of repeated parse+replace operations
clean up some code
fix copy&past bug