decode string literals only once, rework emitting toplevel statements