Consider the following Three Address code sample for solving the questions:
100: t1 = y+2
101: initial = x/t1
102: limit = 10
103: if i > j goto 105
104: goto 111
105: if num > b goto 107
106: goto 111
107: num = limit-1
108: b = y+2
109: i = i - num
110: goto 103
111: j = i - num
112: k= j+b
init = x/(y+2);
limit=10;
while(i>j && num>b)
{
num = limit-1;
b = y + 2;
i=i-num;
}
j = i - num;
k = k+b;
The problem presents a snippet of Three Address Code (TAC) and asks us to find the equivalent high-level code. TAC is an intermediate representation used in compilers. Let's break down the given TAC step-by-step to understand its logic.
The TAC snippet is:
100: t1 = y+2 101: initial = x/t1 102: limit = 10 103: if i > j goto 105 104: goto 111 105: if num > b goto 107 106: goto 111 107: num = limit-1 108: b = y+2 109: i = i - num 110: goto 103 111: j = i - num 112: k= j+b
We need to trace the execution flow and translate the assembly-like TAC instructions into a more readable high-level programming construct.
Based on this analysis, the block of code (lines 107-109) is executed repeatedly as long as the combined condition $(i > j) AND (num > b)$ holds true. This is the definition of a $while$ loop.
The loop condition is therefore $while(i > j && num > b)$.
The body of the loop consists of the statements:
num = limit-1; b = y + 2; i = i - num;
Lines 111-112: Post-Loop Execution
After the loop terminates (because either $i ≤ j$ or $num ≤ b$), execution continues at line 111.
These are the statements that execute after the loop completes.
Let's compare our derived logic with the given options:
The TAC logic clearly indicates a loop that continues as long as both $i > j$ and $num > b$ are true. Lines 104 and 106 provide exit paths to line 111 if either condition fails, and line 110 creates the loop by jumping back to line 103. This structure directly corresponds to a $while(i > j && num > b)$ loop in high-level code. Options 4 and 5 accurately represent this logic and are equivalent.
Consider the control flow graph shown in the figure.

Which one of the following options correctly lists the set of redundant expressions (common subexpressions) in the basic blocks B4 and B5?
Note: All the variables are integers.
Consider the control flow graph given below.
Which one of the following options is the set of live variables at the exit point of each basic block?