Steinar H. Gunderson: Decompiler patterns, part 8: Un-repetition of conditions
Today, for a slightly more complicated snippet, but still in the same general area; say you have code like this: x = (0x1000 - y) / 24; z = var_s5 = 0x81) { x = 0x80; z = var_s5 = 0x81) { x = 0x80; } var_s4 = 0; if ((var_s5 = 5) { For a small bonus (since I'm not going to have a separate post about it), you can choose to change the upper if to: if (x > 0x80) { x = 0x80; } which generates exactly the same code (on MIPS), but may in many cases be easier to understand.