switch (i) { case 0: actions_0; break; case 1: actions_1; break; case 2: actions_2; break; case 3: actions_3; break; case 4: actions_4; break; case 5: actions_5; break; case 6: actions_6; break; case 7: actions_7; break; default: actions_d; break; }where actions_i is an short sequence of C statements. Compile the program using the ECEn 425 tools and study the resulting .s file. Describe in detail the mechanism used to implement the flow of control through the switch statement.
Write another C program that includes the switch statement again but this time have it match an integer variable against eight randomly chosen integer values (that you choose) between 0 and 1000. Compile the program and study the resulting .s file. Describe in detail the mechanism used to implement the flow of control through the switch statement.
Compare and contrast the two implementations of switch statements that you discovered above. How are they different, and why are they different? On the basis of what you've seen can there be significant differences in overhead between switch statements that appear similar at the source code level? What lesson should a programmer learn from this?