while (pc >= pb && (r = cmp(a[pc], a[pv])) >= 0)
while (pc >= pb && (r = a[pc] - a[pv]) >= 0)
  private static void qsort(byte[]a, int start, int n)  {    // use an insertion sort on small arrays    if (n < 7)      {	for (int i = start + 1; i < start + n; i++)	  for (int j = i; j > 0 && cmp(a[j - 1], a[j]) > 0; j--)	    swap(j, j - 1, a);	return;      }    int pm = n / 2;		// small arrays, middle element    if (n > 7)      {	int pl = start;	int pn = start + n - 1;	if (n > 40)	  {			// big arrays, pseudomedian of 9	    int s = n / 8;	    pl = med3(pl, pl + s, pl + 2 * s, a);	    pm = med3(pm - s, pm, pm + s, a);	    pn = med3(pn - 2 * s, pn - s, pn, a);	  }	pm = med3(pl, pm, pn, a);	// mid-size, med of 3      }    int pa, pb, pc, pd, pv;    short r;    pv = start;    swap(pv, pm, a);    pa = pb = start;    pc = pd = start + n - 1;    for (;;)      {	while (pb <= pc && (r = cmp(a[pb], a[pv])) <= 0)	  {	    if (r == 0)	      {		swap(pa, pb, a);		pa++;	      }	    pb++;	  }	while (pc >= pb && (r = cmp(a[pc], a[pv])) >= 0)	  {	    if (r == 0)	      {		swap(pc, pd, a);		pd--;	      }	    pc--;	  }	if (pb > pc)	  break;	swap(pb, pc, a);	pb++;	pc--;      }    int pn = start + n;    int s;    s = Math.min(pa - start, pb - pa);    vecswap(start, pb - s, s, a);    s = Math.min(pd - pc, pn - pd - 1);    vecswap(pb, pn - s, s, a);    if ((s = pb - pa) > 1)      qsort(a, start, s);    if ((s = pd - pc) > 1)      qsort(a, pn - s, s);  }