Rewrite optimizer for new trees
Rewrite asm writer for new trees