Simplify compound conditionals involving `cmp`
(Issue for @cookiemon) Version and Platform (required):
- Binary Ninja Version: 3.1.3618-dev
Bug Description:
Transcript from public slack (from @null_ptr)
When I have a function like this in hlil, is there a way to have the conditional simplified by substituting
rbxwithrbx_1? The conditional comes out of asubfollowed by acmpand it seems binja uses the operand of thesubinstead of the result.For reference the disassembly
Merging doesn't really solve the issue and just introduces a temporary.
Expected Behavior:
What I'm looking for is more like how other decompilers decompile it.
Additional Information:
I can share a test binary I used to check the different compiler outputs in dogbolt that shows the behavior. main.zip The function at
0x140001000is the one with the condition.
For reference the disassembly


