Generalize LSR's OptimizeMax to handle the new kinds of max expressions