adding cases of 'cast' instructions in optimizations