Answer:
Check the explanation
Step-by-step explanation:
The first, second and third instruction together set %rdx = 3*%rdi + %rsi. The fourth and fifth instruction set %rdi = %rdi+9*%rsi.
Now %rdi is used to address Q, while %rdx is used to address P. Note that P is addressed by column and then by row. Hence M = 3 . Also Q is addressed by row and then column, hence N = 9 .