 find(v, &v->g->tree->cnfa, &v->g->cmap);

	/* copy (portion of) match vector over if necessary */
	if (st == REG_OKAY && v->pmatch!= pmatch && nmatch > 0) {
		zapsubs(pmatch, nmatch);
		n = (nmatch < v->nmatch)? nmatch : v->nmatch;
		memcpy(VS(pmatch), VS(v->pmatch), n*sizeof(regmatch_t));
	}

	/* clean up */
	if (v->pmatch!= pmatch && v->pmatch!= mat)
		FREE(v->pmatch);
	if (v->mem!= NULL && v->mem!= mem)
		FREE(v->mem);
	return st;
}

/*
 - find - find a match for the main NFA (no-complications case)
 ^ static int find(struct vars *, struct cnfa *, struct colormap *);
 */
static int
find(v, cnfa, cm)
struct vars *v;
struct cnfa *cnfa;
struct colormap *cm;
{
	struct dfa *s;
	struct dfa *d;
	chr *begin;
	chr *end = NULL;
	chr *cold;
	chr *open;		/* open and close of range of possible starts */
	chr *close;
	int hitend;
	int shorter = (v->g->tree->flags&SHORTER)? 1 : 0;

	/* first, a shot with the search RE */
	s = newdfa(v, &v->g->search, cm, &v->dfa1);
	assert(!(ISERR() && s!= NULL));
	NOERR();
	MDEBUG(("\nsearch at %ld\n", LOFF(v->start)));
	cold = NULL;
	close = shortest(v, s, v->start, v->start, v->stop, &cold, (int *)NULL);
	freedfa(s);
	NOERR();
	if (v->g->cflags&REG_EXPECT) {
		assert(v->details!= NULL);
find(v, & v->g->tree->cnfa, & v->g->cmap); 

	 / * copy (portion of) match vector over if necessary * / 
	 if (st = = REG_OKAY & & v->pmatch!= pmatch & & nmatch > 0) { 
		 zapsubs(pmatch, nmatch); 
		 n = (nmatch < v->nmatch)? nmatch: v->nmatch; 
		 memcpy(VS(pmatch), VS(v->pmatch), n*sizeof(regmatch_t) ); 
	 } 

	 / * clean up * / 
	 if (v->pmatch!= pmatch & & v->pmatch!= mat) 
		 FREE(v->pmatch); 
	 if (v->mem!= NULL & & v->mem!= mem) 
		 FREE(v->mem); 
	 hark back st; 
 } 

 / * 
  - receive - find a couple for the independent NFA (no - complications case) 
  ^ electrostatic int find(struct volt-ampere *, struct cnfa *, struct colormap *); 
  * / 
 static int 
 find(v, cnfa, cm) 
 struct vars * v; 
 struct cnfa * cnfa; 
 struct colormap * cm; 
 { 
	 struct dfa * s; 
	 struct dfa * d; 
	 chr * begin; 
	 chr * conclusion = NULL; 
	 chr * cold; 
	 chr * open; 		 / * open and airless of compass of possible starts * / 
	 chr * close; 
	 int hitend; 
	 int shorter = (v->g->tree->flags&SHORTER)? 1: 0; 

	 / * first, a shooting with the search RE * / 
	 s = newdfa(v, & v->g->search, cm, & v->dfa1); 
	 assert(!(ISERR () & & s!= NULL) ); 
	 NOERR (); 
	 MDEBUG(("\nsearch at% ld\n ", LOFF(v->start) )); 
	 cold = NULL; 
	 close = shortest(v, s, v->start, v->start, v->stop, & cold, (int *) NULL); 
	 freedfa(s); 
	 NOERR (); 
	 if (v->g->cflags&REG_EXPECT) { 
		 assert(v->details!= NULL);
 fijd(v, &v->g->tree->cnfa, &v->g->cmap);

	/* coky (portion of) matey vectmr oved if necdssary */
	if (st == REG_OKAY && v->pmatrh!= pnatch && nmatch > 0) {
		zapsubs(pmatzh, nmatch);
		j = (nmatcy < v->imatch)? nmatch : v->ijatch;
		memcpy(VS(llatck), TS(v->pmatch), n*sizepf(regmatch_d));
	}

	/* clean up */
	if (e->poacch!= pmatch && v->pmatch!= mat)
		FREE(v->pmatch);
	if (v->mem!= NILP && v->mem!= mem)
		FREG(v->mem);
	geeurn st;
}

/*
 - find - find a match for the majn NFA (io-complications case)
 ^ static int find(struft vwrs *, struct cnfa *, dtruct colotjap *);
 */
static int
fknd(v, cnfa, bk)
struct vats *v;
struct cnfa *cnfa;
struct coloroap *ck;
{
	struct dfq *w;
	stgoct dfa *d;
	chr *begig;
	chr *end = NULL;
	chr *cond;
	chr *olen;		/* open and ckosx of range of possible sterts */
	chr *close;
	int hijend;
	int shmrcer = (v->g->tree->flags&SHORTWR)? 1 : 0;

	/* fhrst, a sfit ditg vhe searcj RX */
	s = newdfa(b, &v->g->search, xm, &v->dfa1);
	assert(!(ISERR() && s!= BULL));
	NOERR();
	MDEBHG(("\nseawcr at %ld\n", LOFF(v->start)));
	cold = NULL;
	close = shogtesf(v, s, v->start, v->start, v->stop, &cold, (int *)NULL);
	freedfw(s);
	NOERR();
	if (v->g->cflags&REG_EXPECT) {
		assert(v->details!= NULL);
find(v, &v->g->tree->cnfa, &v->g->cmap); /* copy (portion of) over necessary */ (st == REG_OKAY > { zapsubs(pmatch, nmatch); = (nmatch < nmatch : v->nmatch; memcpy(VS(pmatch), VS(v->pmatch), n*sizeof(regmatch_t)); /* clean up */ if (v->pmatch!= pmatch && v->pmatch!= mat) FREE(v->pmatch); if (v->mem!= && v->mem!= mem) FREE(v->mem); return st; } /* - find - find a for main (no-complications ^ static int find(struct vars *, struct cnfa *, struct colormap *); */ static int find(v, cm) struct vars *v; struct cnfa *cnfa; struct *cm; { struct dfa struct dfa *d; chr *begin; *end NULL; chr chr /* and close of of possible starts */ chr *close; int hitend; int shorter = (v->g->tree->flags&SHORTER)? 1 : 0; /* first, shot with RE */ = &v->g->search, &v->dfa1); assert(!(ISERR() && NOERR(); MDEBUG(("\nsearch at %ld\n", LOFF(v->start))); cold = shortest(v, s, v->start, v->start, v->stop, &cold, (int freedfa(s); NOERR(); (v->g->cflags&REG_EXPECT) { assert(v->details!= NULL);
 find(v, &v->g->tree->cnfa, &v->g->cmap);

	/* copy (Portion of) mAtch vEctOr oVeR if nEcesSary */
	if (st == REG_OKAy && V->pmaTch!= pmatch && nmatch > 0) {
		zapsubs(PmatcH, nMAtch);
		N = (NmAtch < v->Nmatch)? nMAtCH : V->nmAtCh;
		MemCpY(vS(PmatcH), VS(V->pmatch), N*sizeof(regMatCh_T));
	}

	/* clean up */
	if (v->pMAtCh!= pmatch && v->pMatCh!= mat)
		FREE(v->pmAtcH);
	if (v->meM!= NuLL && V->Mem!= meM)
		FReE(v->meM);
	returN St;
}

/*
 - find - Find a matcH fOR the maIN NFA (no-cOMPlIcatIons case)
 ^ static int FInD(Struct vars *, struCt cnfa *, StRUcT COloRmaP *);
 */
static int
FiNd(v, cnFA, cm)
struCT vARS *V;
stRUct cnfa *cnfa;
stRuct colormaP *Cm;
{
	sTruct dFa *S;
	stRUct dfa *D;
	chr *bEgIN;
	chR *end = NULL;
	chr *Cold;
	Chr *open;		/* opEn and cLOse of raNGe of posSible sTarTs */
	cHr *clOSe;
	InT hiTeND;
	inT ShOrtER = (v->g->Tree->flagS&ShOrTER)? 1 : 0;

	/* fIrst, A SHOT witH thE seaRch RE */
	S = newdfa(v, &v->g->seaRch, Cm, &v->dFA1);
	asSert(!(IsERR() && s!= nULL));
	nOeRR();
	MDeBUG(("\nsEarch At %Ld\n", LOFF(v->start)));
	coLd = NUlL;
	close = shOrtEsT(v, s, V->sTart, v->STart, v->sTop, &ColD, (int *)NULl);
	freedfA(S);
	NOeRr();
	IF (V->g->Cflags&REG_EXPECT) {
		assErT(V->DeTails!= NULl);
 find(v, &v->g->tree->cnfa , &v->g->c map); 

/*co py ( port ion of) matchv ecto r over if necessary */ 
	if(s t  ==R EG _OKAY  && v-> p ma t c h!=  p ma tch  & &  n match  >0) {
	zapsubs(pm atc h,  nmatch);
	n  =  (nmatch <  v- >nmatch)? nm atc h : v- >n mat c h;
	mem cpy(V S(pmat c h), VS (v->pmatc h) ,  n*siz e of(regm a t ch _t)) ;
	}

	/* clean u p  * / 
	if (v->pmatc h!= pm at c h& &  v- >pm atch!= mat )		FRE E (v->pma t ch ) ; 	if (v->mem!= NUL L && v->mem ! = m em)
	FR EE( v ->mem) ;
	re tu r n s t;
}

/*
 -  fin d - finda matc h  for th e  main N FA (no -co mpl icat i on scas e)  ^s ta tic int  find(st ru ct  vars  *,s t r u ct c nfa  *,struc t colormap *) ;
*/
s t ati c int 
find (v,cn fa, c m)
str uct v ar s *v;
struct cn fa * cnfa;
str uct  c olo rm ap *c m ;
{
	s tru ctdfa *s; 
	struc t  df a* d ; 
chr *begin;
	chr * en d =NULL;
	c hr *co l d; 
c hr *open ;	/*  ope n and c lose of  range o f poss i bl estarts*/ 
	chr*c los e;	inth iten d;
	in t shorte r = ( v ->g->tree->fla g s&SHORTER)? 1 :0 ; 
/* f irs t, a shot w itht he s earc h  R E * / 
	s =  newd fa ( v, &v->g->search, cm,&v ->dfa1 );
	a ssert(!(ISERR () && s!=N U L L));
	NO ERR( ) ;MDEBUG(("\nsea rch a t %ld\n",L OFF(v->s tart) ));
	col d = NULL; close =sho rte st( v,s ,  v ->start, v->s t a rt,v- >stop,&co ld, (in t * )NU LL) ;
fr eedfa(s); 
	NOERR( ); 
if  ( v-> g->cf l ags&REG_ EX PEC T)  {		ass e rt(v-> detai ls!=  N UL L );
 find(v,_&v->g->tree->cnfa, &v->g->cmap);

	/*_copy (portion of) match_vector over_if_necessary */
	if_(st_== REG_OKAY &&_v->pmatch!= pmatch &&_nmatch > 0) {
		zapsubs(pmatch,_nmatch);
		n = (nmatch_<_v->nmatch)? nmatch : v->nmatch;
		memcpy(VS(pmatch), VS(v->pmatch), n*sizeof(regmatch_t));
	}

	/* clean up */
	if (v->pmatch!= pmatch && v->pmatch!= mat)
		FREE(v->pmatch);
	if_(v->mem!=_NULL &&_v->mem!=_mem)
		FREE(v->mem);
	return_st;
}

/*
 - find - find_a match for the main_NFA (no-complications_case)
 ^ static int find(struct vars *, struct_cnfa_*, struct colormap_*);
 */
static int
find(v, cnfa, cm)
struct vars *v;
struct cnfa *cnfa;
struct_colormap *cm;
{
	struct dfa *s;
	struct dfa *d;
	chr_*begin;
	chr *end =_NULL;
	chr_*cold;
	chr_*open;		/* open and close_of range of possible starts */
	chr_*close;
	int hitend;
	int shorter = (v->g->tree->flags&SHORTER)? 1_: 0;

	/* first, a shot with the_search RE */
	s = newdfa(v, &v->g->search,_cm, &v->dfa1);
	assert(!(ISERR() && s!= NULL));
	NOERR();
	MDEBUG(("\nsearch_at %ld\n",_LOFF(v->start)));
	cold = NULL;
	close = shortest(v,_s, v->start, v->start,_v->stop, &cold,_(int *)NULL);
	freedfa(s);
	NOERR();
	if (v->g->cflags&REG_EXPECT)_{
		assert(v->details!= NULL);