Look, I don't care if your patch is NOT LLM written or otherwise, if the code se...

@pinskia@hachyderm.io

Look, I don't care if your patch is NOT LLM written or otherwise, if the code seems too complex you should break it up and do it in steps. I (and my others) are not going to do the review. Seriously start small. Even if it is just it improve just one simple case; it is easier to review when it catches that simplier case and then expand it out to catch more. Yes you don't get the full optimizations right away but at least things easier to review and understand. Even more it is easier to understand why the complexity is needed.
If you need to add some heurstics stopping stuff; add a comment on why. Also look into a simple heuristic first like don't do this if inside a loop until late. Since the heurstics are easier to change later on we can improve on that as time goes by. Oh most likely a simple heuristics can be enough for most cases; for others we can add on.