I know it's not a bug, but a feature. Hex Rays found that there's a variable which is set to specific value, thus there's no need to display the branches where the code will never be run, so it warns me about the optimizations:

conditional instruction was optimized away because of '%var_8.1==0'

Is there any way to make it show all the code branches and stop optimizing it?

2 Answers 2


Try marking the variable as volatile

  • I can't, it was also optimized :) Commented Jan 31, 2021 at 13:52
  • @AntonKukoba maybe try doing it on the stack frame variable (Ctrl-K)
    – Igor Skochinsky
    Commented Feb 1, 2021 at 8:09
  • I tried it too, it doesn't change anything Commented Feb 1, 2021 at 9:00

Hope this will help other people face with this problem in the future. The answer is: make all related-variables volatile. See the image bellow: hexrays optimization

Either code_compress_magic or Signature must be set as a volatile type. This will make Hexrays decompiler happy.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.