Consider the following C-style code segment:
while (a < b) {
if (c < d) x = y + z;
else x = y - z;
}
Assume this code is translated into Three-Address Code (TAC) using the minimum number of labels required to ensure:
- The $\verb|while|$ condition is evaluated at the start of every iteration.
- The $\verb|if-else|$ control flow correctly branches to either the $\verb|if|$ block or the $\verb|else|$ block.
- Control returns to the $\verb|while|$ condition check after the $\verb|if-else|$ statement finishes.
- There is a single exit label immediately following the loop.
What is the minimum number of labels required to represent this control flow?