const char *cp = end - 1;
const STRING_TYPE *cp = end - 1;
correctly_grouped_prefix (const char *begin, const char *end,			  wchar_t thousands, const char *grouping){  if (! grouping)    return end;  while (end > begin)    {      const char *cp = end - 1;      const char *gp = grouping;      /* Check first group.  */      while (cp >= begin && (wchar_t) *cp != thousands)	--cp;      if (end - cp == (int) *gp + 1)	{	  /* This group matches the specification.  */	  const char *new_end;	  if (cp < begin)	    /* There is just one complete group.  We are done.  */	    return end;	  /* CP points to a thousands separator character.  The preceding	     remainder of the string from BEGIN to NEW_END is the part we	     will consider if there is a grouping error in this trailing	     portion from CP to END.  */	  new_end = cp - 1;	  /* Loop while the grouping is correct.  */	  while (1)	    {	      /* Get the next grouping rule.  */	      ++gp;	      if (*gp == 0)		/* If end is reached use last rule.  */ 	        --gp;	      /* Skip the thousands separator.  */	      --cp;	      if (*gp == CHAR_MAX || *gp < 0)	        {	          /* No more thousands separators are allowed to follow.  */	          while (cp >= begin && (wchar_t) *cp != thousands)		    --cp;	          if (cp < begin)		    /* OK, only digits followed.  */		    return end;	        }	      else	        {		  /* Check the next group.  */	          const char *group_end = cp;		  while (cp >= begin && (wchar_t) *cp != thousands)		    --cp;		  if (cp < begin && group_end - cp <= (int) *gp)		    /* Final group is correct.  */		    return end;		  if (cp < begin || group_end - cp != (int) *gp)		    /* Incorrect group.  Punt.  */		    break;		}	    }	  /* The trailing portion of the string starting at NEW_END	     contains a grouping error.  So we will look for a correctly	     gouped number in the preceding portion instead.  */	  end = new_end;	}      else	{	  /* Even the first group was wrong; determine maximum shift.  */	  if (end - cp > (int) *gp + 1)	    end = cp + (int) *gp + 1;	  else if (cp < begin)	    /* This number does not fill the first group, but is correct.  */	    return end;	  else	    /* CP points to a thousands seperator character.  */	    end = cp;	}    }  return MAX (begin, end);} 