Added smart register allocation. (Free only unused registers in local or global variables)