implemented basic post-allocation rewriting