Where can I learn more about mx files?  

In particular, in the following code, it looks like @2 is derived from the type expands this into a multitude of type specific functions.  I can't figure out what @3 is.  Is there a list of these?

SORTfndlast_@2(BAT *b, ptr v)
{
BUN diff, end = BUNlast(b), cur = end;
BUN lo = BUNfirst(b), hi = end;
int cmp = 1;
BATiter bi = bat_iterator(b);

        if (lo >= hi || @3_CMP(BUNt@1(bi, cur - 1), v, @4)<=0) {
/* shortcut: if BAT is empty or last (and hence all) tail
* value is <= v, we're done. */
return cur;
}
while (lo < hi) {
BUN mid = (lo + hi) >> 1;
cur = mid;
cmp = @3_CMP(BUNt@1(bi, cur), v, @4);
if (cmp < 0) {
lo = ++mid;
cur++;
} else if (cmp > 0) {
hi = mid;
} else {
break;
}
}
if (cmp == 0 && b->tkey == 0) {  /* shift over multiple equals */
                for(diff = (end-cur)>>1; diff; diff >>= 1) {
   while ((cur+diff) < end && @3_EQ(BUNt@1(bi, cur+diff), v, @4)) cur += diff;
}
}
if (cmp == 0) cur++;
return cur;
}