Optimize nested constant right shifts