Speed up use-after-scope (v2): rewrite into SSA