Tried to get optimization working.  Needed to use 2.11.x to avoid a crash bug, but still misses optimization for specialized case.
Added bytecode in comments.