Compiler rewrite