add assertion
fix max locals assert, and use aggressive variable elimination to try to avoid hitting it