Peephole optimizer: flatten
More optimization (xor identity)