= Solution
The shifts multiply the original <array> indices by four, and the following additions form <byte> <memory addresses>. The load into `$s0` changes the variable $x$ itself, but the address of the next element of A has already been saved. The complete effect is
``
i = x
x = A[i]
B[y] = x + A[i + 1]
``
Here `i` is a fresh temporary. \b[Both the assignment to $x$ and the assignment to $B[y]$ matter.] Writing only $B[y]=A[x]+A[x+1]$ would omit the observable change to $x$. The interpretation assumes four-<byte> <array> elements, valid aligned addresses, and arithmetic within range; the source uses trapping signed additions. The address of $B[y]$ is computed before $x$ changes.
Back to article page