Sema: rewrite `analyzeMinMax`

I only wanted to fix a bug originally, but this logic was kind of a
rat's nest. But now... okay, it still *is*, but it's now a slightly more
navigable nest, with cute little signs occasionally, painted by adorable
rats desparately trying to follow the specification.

Hopefully #3806 comes along at some point to simplify this logic a
little.

Resolves: #23139
07a5efd072mlugg committed on 5/18/2025, 11:27:01 PMparentb77e601
2 files changedLine totals unavailable