Constant value not leveraged in simplication if it comes from path constraint
In the following code, the value of export_dir_rva is known to be constant 0x0, but it is not optimized away in HLIL:
I do not know the exact cause of us not removing export_dir_rva, I guess it is because the constantness of the value is coming from a path constraint, but I could be wrong
P.S.: the original binary is obfuscated and the user had to patch the code to simplify it. While doing so, he accidentally inverted the condition, making the value of export_dir_rva to become 0x0 in the true branch (it should be the opposite, i.e., not 0x0 in the true branch). That said, in case of the wrong patching, we should optimize away export_dir_rva since it is known to be 0x0
See binary and more info at https://github.com/Vector35/binaryninja-api/discussions/5629, database is attached:
This is likely due to the difference in the two different dataflow systems.
Another case here:
We should be able to know from the branch at 0x14171f47e that r8 will be 0x1 at 0x14171f480, add then simplify the expression to 0x10 altogether