Consider the C code below, where H and J are constants declared with #define. (2.5 Points) int array1[H] [J]; int array2
Posted: Fri Jun 10, 2022 11:58 am
Consider the C code below, where H and J are constants declared with #define. (2.5 Points) int array1[H] [J]; int array2[J] [H]; void copy_array(int x, int y) { array2 [x][y] = array1[y][x]; } Suppose the above C code generates the following x86-64 assembly code: # On entry: # %edi = x # %esi = y copy_array: movslq %esi, %rsi movslq %edi, %rdi movq %rdi, %rax salq $4, %rax subq %rdi, %rax addq %rsi, %rax leaq (%rsi,%rsi,4), %rsi leaq (%rdi, %rsi,2), %rsi movl array1(,%rsi,4), %edx movl %edx, array2(,%rax, 4) ret MacBook Pro