while ((aIn[start] & 0xff00) != aOffset)
while (start < origLen && (aIn[start] & 0xff00) != aOffset)
PRInt16 JamoSrchReplace (const JamoNormMap* aClusters,                          PRUint16 aClustersSize, PRUnichar* aIn,                          PRInt32* aLength, PRUint16 aOffset){  PRInt32 aLength0 = *aLength;   // non-zero third element => clusternLen = 3. otherwise, it's 2.  PRUint16 clusterLen = aClusters[0].seq[2] ? 3 : 2;   PRInt32 start = 0, end;  // identify the substring of aIn with values in [aOffset, aOffset + 0x100).  while ((aIn[start] & 0xff00) != aOffset)     ++start;  for (end=start; end < *aLength && (aIn[end] & 0xff00) == aOffset; ++end);  for (PRInt32 i = start; i <= end - clusterLen; i++)  {    const JamoNormMap *match;    JamoNormMap key;    // cluster array is made up of PRUint8's to save memory    // and we have to subtract aOffset from the input before looking it up.    key.seq[0] = aIn[i] - aOffset;    key.seq[1] = aIn[i + 1] - aOffset;    key.seq[2] = clusterLen == 3 ? (aIn[i + 2] - aOffset) : 0;    match = JamoClusterSearch (key, aClusters, aClustersSize);    if (match)     {      aIn[i] = match->liga + aOffset; // add back aOffset.       // move up the 'tail'      for (PRInt32 j = i + clusterLen ; j < *aLength; j++)        aIn[j - clusterLen + 1] = aIn[j];      end -= (clusterLen - 1);      *aLength -= (clusterLen - 1);    }  }  return *aLength - aLength0;}