CS220 Homework 7 Due Apr ??, 2016 Name: For this week's homework, you will be given C code for a function, and the X86 assembler code associated with that C code. Your job is to identify the lines of X86 assembler associated with each line of C code. Each line of the C code is labeled with a letter, and each line of X86 code is labeled with a number. For each line of C code (letter), specify the lines of X86 code associated with that line of C code. For example, here is the C code for the main function: A int main(int argc, char **argv) { enum colors color; int i; B for(i=1; i=0); C if (color==uv) return 1000000; D assert(colormaxw[0]) return uv; C int j=0; D while(maxw[j]>freq) { j++; } E if (j>uv) return uv; F return (enum colors)(j-1); } X86 assembler: 1 getColor: pushl %ebp 2 movl %esp, %ebp 3 subl $16, %esp 4 movl maxw, %eax 5 cmpl 8(%ebp), %eax 6 jge .L14 7 movl $6, %eax 8 jmp .L15 9 .L14: movl $0, -4(%ebp) 10 jmp .L16 11 .L17: addl $1, -4(%ebp) 12 .L16: movl -4(%ebp), %eax 13 movl maxw(,%eax,4), %eax 14 cmpl 8(%ebp), %eax 15 jg .L17 16 cmpl $6, -4(%ebp) 17 jle .L18 18 movl $6, %eax 19 jmp .L15 20 .L18: movl -4(%ebp), %eax 21 subl $1, %eax 22 .L15: leave 23 ret Correlation: A : B : C : D : E : F : 3. Figure out the correlation for the "colorName" function... C code: A char * colorName(enum colors color) { B switch(color) { C case red: return "red"; D case orange: return "orange"; E case yellow: return "yellow"; F case green: return "green"; G case blue: return "blue"; H case violet: return "violet"; I default: return "invisible"; } } X86 assembler: 1 .LC4: .string "red" 2 .LC5: .string "orange" 3 .LC6: .string "yellow" 4 .LC7: .string "green" 5 .LC8: .string "blue" 6 .LC9: .string "violet" 7 .LC10: .string "invisible" 8 colorName: pushl %ebp 9 movl %esp, %ebp 10 cmpl $5, 8(%ebp) 11 ja .L20 12 movl 8(%ebp), %eax 13 sall $2, %eax 14 addl $.L27, %eax 15 movl (%eax), %eax 16 jmp *%eax .align 4 17 .L27: .long .L21 18 .long .L22 19 .long .L23 20 .long .L24 21 .long .L25 22 .long .L26 23 .L21: movl $.LC4, %eax 24 jmp .L28 25 .L22: movl $.LC5, %eax 26 jmp .L28 27 .L23: movl $.LC6, %eax 28 jmp .L28 29 .L24: movl $.LC7, %eax 30 jmp .L28 31 .L25: movl $.LC8, %eax 32 jmp .L28 33 .L26: movl $.LC9, %eax 34 jmp .L28 35 .L20: movl $.LC10, %eax 36 .L28: popl %ebp 37 ret Note... include the data associated with each line as well as the instructions in your correlation. For instance, the jump table is generated by the switch statement. Correlation: A : B : C : D : E : F : G : H : I :