1. fix if statement bug
2. finish range comparison rewriting and code-gen