code: private int deshapeNormalize(char[] dest, int start, int length) {
          int lacount = 0;
          int yehHamzaComposeEnabled = 0;
          int seenComposeEnabled = 0;
  
          yehHamzaComposeEnabled = ((options&YEHHAMZA_MASK) == YEHHAMZA_TWOCELL_NEAR) ? 1 : 0;
          seenComposeEnabled = ((options&SEEN_MASK) == SEEN_TWOCELL_NEAR)? 1 : 0;
  
          for (int i = start, e = i + length; i < e; ++i) {
              char ch = dest[i];
  
          if( (yehHamzaComposeEnabled == 1) && ((ch == HAMZA06_CHAR) || (ch == HAMZAFE_CHAR))
                 && (i < (length - 1)) && isAlefMaksouraChar(dest[i+1] )) {
                  dest[i] = SPACE_CHAR;
                  dest[i+1] = YEH_HAMZA_CHAR;
         } else if ( (seenComposeEnabled == 1) && (isTailChar(ch)) && (i< (length - 1))
                         && (isSeenTailFamilyChar(dest[i+1])==1) ) {
                 dest[i] = SPACE_CHAR;
         }
         else if (ch >= '\uFE70' && ch <= '\uFEFC') {
                  if (isLamAlefChar(ch)) {
                      ++lacount;
                  }
                  dest[i] = (char)convertFEto06[ch - '\uFE70'];
              }
          }
          return lacount;
      }
docs: /*
  Name    : deshapeNormalize
  Function: Convert the input buffer from FExx Range into 06xx Range
  even the lamalef is converted to the special region in the 06xx range.
  According to the options the user enters, all seen family characters
  followed by a tail character are merged to seen tail family character and
  any yeh followed by a hamza character are merged to yehhamza character.
  Method returns the number of lamalef chars found.