Complete the code to represent a simple if statement translation.
if (condition) goto [1];
The label L2 is used here as the target for the jump when the condition is true, representing the start of the if block.
Complete the code to translate a while loop control flow.
[1]: if (!condition) goto L3;
The label L1 marks the start of the loop condition check in the while loop translation.
Fix the error in the translation of an if-else statement by completing the blank.
if (condition) goto L1; goto [1]; L1: // if block code
The jump after the if condition false should go to L2, which marks the else block or code after if.
Fill both blanks to correctly translate a for loop control flow.
[1]: if (i >= n) goto [2];
Lstart marks the loop condition check start, and Lend marks the loop exit point when the condition fails.
Fill all three blanks to translate an if-else statement with jumps.
[3]: if (!condition) goto [1]; // if block code goto [2]; [1]: // else block code [2]: // code after if-else
Lelse is the label for the else block, Lend is the label after the if-else, and Lstart is the start label for the condition check.
