Question: In the C function that follows, we have omitted the body of the switch statement. In the C code, the case labels did not span
In the C function that follows, we have omitted the body of the switch statement. In the C code, the case labels did not span a contiguous range, and some cases had multiple labels.

In compiling the function, gcc generates the assembly code that follows for the initial part of the procedure, with variable x in %rdi:


Based on this information, answer the following questions:
A. What were the values of the case labels in the switch statement?
B. What cases had multiple labels in the C code?
void switch2(short x, short *dest) { short val = 0; switch (x) { } Body of switch statement omitted } *dest = val;
Step by Step Solution
3.52 Rating (179 Votes )
There are 3 Steps involved in it
This problem gives you a chance to reason about the control flow of a switch statement Answering the ... View full answer
Get step-by-step solutions from verified subject matter experts
