The computation on the slide is correct as far as I can see. Having split arrays "a" and "b" into M blocks of size M, we first compare the M first entries of the blocks of "a" with the M first entries of the blocks of "b" which yields the boolean array c[i][j]. In the example, we got

Then, we compute a boolean array firstC such that firstC[i] is the least index j where c[i][j], i.e., a[i*M]<b[j*M] holds. In the example, array firstC is then [|0;1;1;2|].

After this, the positive entries are decremented so that we finally get firstC=[|0;0;0;1|]. For every block i of array "a", we now have the greatest j=firstC[i] such that a[i*M]>=b[j*M] holds. The elements of block a[i*M] must therefore be merged somewhere inside block b[j*M] where j=firstC[i].

It remains to find the index inside block b[j*M] with j=firstC[i] where a[i*M] must be put in between. To this end, the same procedure is repeated, i.e., we compute a boolean array d as d[i][j] := a[i*M]<b[firstC[i]*M+j] for i,j=0..M-1 which is as follows:

We then compute for each row the first index >0, which yields firstD=[|0;2;4;2|] (note that we return M=4 if there is no index >0).

The ranks are determined such that rank[i] is the least index j where a[i*M]<b[j] holds, i.e., we then have a[i*M]<b[rank[i]]. We obtain the ranks from arrays firstC and firstD as follows: rank[i] = firstC[i]*M+firstD[i] where firstD[i]=M must be treated as zero since there is no j=0..M-1 with a[i*M]<b[firstC[i]*M+j].