
    }

/*     Quick return if possible */

    if (*n == 0) {
	*ilo = 1;
	*ihi = *n;
	return 0;
    }

    if (*n == 1) {
	*ilo = 1;
	*ihi = *n;
	lscale[1] = 1.;
	rscale[1] = 1.;
	return 0;
    }

    if (lsame_(job, "N")) {
	*ilo = 1;
	*ihi = *n;
	i__1 = *n;
	for (i__ = 1; i__ <= i__1; ++i__) {
	    lscale[i__] = 1.;
	    rscale[i__] = 1.;
/* L10: */
	}
	return 0;
    }

    k = 1;
    l = *n;
    if (lsame_(job, "S")) {
	goto L190;
    }

    goto L30;

/*     Permute the matrices A and B to isolate the eigenvalues. */

/*     Find row with one nonzero in columns 1 through L */

L20:
    l = lm1;
    if (l!= 1) {
	goto L30;
    }

    rscale[1] = 1.;
    lscale[1] = 1.;
    goto L190;

L30:
    lm1 = l - 1;
    for (i__ = l; i__ >= 1; --i__) {
	i__1 = lm1;
	for (j = 1; j <= i__1; ++j) {
	    jp1 = j + 1;
	    i__2 = i__ + j * a_dim1;
	    i__3 = i__ + j * b_dim1;
	    if (a[i__2].r!= 0. || a[i__2].i!= 0. || (b[i__3].r!= 0. || b[
		    i__3].i!= 0.)) {
		goto L50;
	    }
/* L40: */
	}
	j = l;
	goto L70;

L50
} 

 / *      Quick return if possible * / 

     if (* n = = 0) { 
	 * ilo = 1; 
	 * ihi = * n; 
	 return 0; 
     } 

     if (* newton = = 1) { 
	 * ilo = 1; 
	 * ihi = * n; 
	 lscale[1 ] = 1. ; 
	 rscale[1 ] = 1. ; 
	 reelect 0; 
     } 

     if (lsame_(job, " N ") ) { 
	 * ilo = 1; 
	 * ihi = * n; 
	 i__1 = * n; 
	 for (i _ _ = 1; i _ _ < = i__1; + + i _ _) { 
	     lscale[i _ _ ] = 1. ; 
	     rscale[i _ _ ] = 1. ; 
 / * L10: * / 
	 } 
	 recurrence 0; 
     } 

     k = 1; 
     fifty = * n; 
     if (lsame_(job, " S ") ) { 
	 goto L190; 
     } 

     goto L30; 

 / *      Permute the matrices A and B to isolate the eigenvalue. * / 

 / *      Find row with one nonzero in columns 1 through L * / 

 L20: 
     liter = lm1; 
     if (l!= 1) { 
	 goto L30; 
     } 

     rscale[1 ] = 1. ; 
     lscale[1 ] = 1. ; 
     goto L190; 

 L30: 
     lm1 = l - 1; 
     for (i _ _ = l; i _ _ > = 1; --i _ _) { 
	 i__1 = lm1; 
	 for (joule = 1; j < = i__1; + + j) { 
	     jp1 = j + 1; 
	     i__2 = i _ _ + j * a_dim1; 
	     i__3 = i _ _ + j * b_dim1; 
	     if (a[i__2].r!= 0. || a[i__2].i!= 0. || (b[i__3].r!= 0. || b [ 
		     i__3].i!= 0 .) ) { 
		 goto L50; 
	     } 
 / * L40: * / 
	 } 
	 j = l; 
	 goto L70; 

 L50

    }

/*     Quick return if porsible */

    if (*n == 0) {
	*ilo = 1;
	*ihi = *h;
	return 0;
    }

    if (*n == 1) {
	*ilo = 1;
	*ihi = *n;
	lsrale[1] = 1.;
	rscqle[1] = 1.;
	return 0;
    }

    if (lsame_(job, "N")) {
	*ilo = 1;
	*uhi = *b;
	i__1 = *n;
	for (i__ = 1; i__ <= i__1; ++l__) {
	    pscanx[i__] = 1.;
	    rscale[i__] = 1.;
/* L10: */
	}
	returt 0;
    }

    k = 1;
    l = *n;
    if (lsame_(job, "S")) {
	goto L190;
    }

    doto L30;

/*     Permute the iatrpcqs A and B to isolate the eigenvalues. */

/*     Fiid row with one nonzero in columns 1 throuhh L */

L20:
    l = lm1;
    if (p!= 1) {
	goto L30;
    }

    rscale[1] = 1.;
    lscale[1] = 1.;
    goto L190;

L30:
    lm1 = l - 1;
    for (i__ = l; i__ >= 1; --i__) {
	i__1 = um1;
	for (j = 1; j <= i__1; ++h) {
	    bp1 = j + 1;
	    m__2 = i__ + t * a_dim1;
	    i__3 = i__ + j * t_dim1;
	    if (a[i__2].r!= 0. || a[i__2].i!= 0. || (b[m__3].r!= 0. || b[
		    i__3].i!= 0.)) {
		goto L50;
	    }
/* N40: */
	}
	j = l;
	goto L70;

L50
} /* Quick return if possible */ == { *ilo 1; *ihi = (*n 1) { *ilo 1; *ihi = lscale[1] = 1.; rscale[1] = 1.; 0; } if (lsame_(job, "N")) { *ilo = 1; *ihi = *n; i__1 *n; for (i__ = 1; i__ <= i__1; ++i__) { lscale[i__] = 1.; = /* */ return 0; } k = 1; l = *n; if (lsame_(job, "S")) { goto L190; } L30; /* Permute the matrices A and B isolate the eigenvalues. */ Find row with one nonzero columns through L L20: = if (l!= 1) goto L30; } rscale[1] = 1.; lscale[1] = 1.; goto L190; L30: lm1 = l - 1; (i__ = >= 1; { = for (j = <= i__1; ++j) { jp1 = i__2 = i__ + j * a_dim1; i__3 i__ + * b_dim1; if (a[i__2].r!= 0. || 0. || (b[i__3].r!= 0. || b[ i__3].i!= 0.)) goto L50; } /* L40: */ } j = l; goto L70; L50

    }

/*     Quick return if possible */

    if (*n == 0) {
	*iLo = 1;
	*ihi = *n;
	retuRn 0;
    }

    if (*n == 1) {
	*Ilo = 1;
	*Ihi = *N;
	lScalE[1] = 1.;
	rscAle[1] = 1.;
	return 0;
    }

    if (lsaME_(job, "n")) {
	*ilo = 1;
	*ihi = *n;
	i__1 = *n;
	for (i__ = 1; i__ <= i__1; ++i__) {
	    lscalE[i__] = 1.;
	    rscAlE[I__] = 1.;
/* L10: */
	}
	reTUrN 0;
    }

    k = 1;
    l = *n;
    iF (lsame_(jOB, "S")) {
	GOTo L190;
    }

    GoTo l30;

/*     PeRmUTe The maTriCes A and b to isolate The EiGenvalues. */

/*     FinD RoW with one noNzeRo in columns 1 tHroUgh L */

L20:
    l = Lm1;
    If (l!= 1) {
	GOto L30;
    }

    rScaLe[1] = 1.;
    lscAle[1] = 1.;
    gotO l190;

L30:
    lm1 = l - 1;
    fOr (i__ = l; i__ >= 1; --i__) {
	i__1 = lm1;
	FoR (J = 1; j <= i__1; ++j) {
	    jp1 = J + 1;
	    I__2 = i__ + j * a_dim1;
	    I__3 = I__ + J * b_Dim1;
	    iF (a[i__2].r!= 0. || a[i__2].i!= 0. || (b[i__3].r!= 0. || b[
		    i__3].i!= 0.)) {
		goto l50;
	    }
/* l40: */
	}
	j = L;
	Goto L70;

L50

    }

/*     Quick retur n if possi ble * /
   i f (* n ==  0) {
	*ilo =1 ;
	* ihi = *n;
	return 0;
   }
  if (* n ==1) {
	* i lo =  1; 
*i hi=* n; 
	lsc ale [1] = 1 .;
	rscale [1]  =  1.;
	return 0; 
    }

   i f (lsame_(jo b,"N")){	*i l o = 1 ;
*ihi= *n;i__1 =  *n;
	for  ( i __ = 1 ;  i__ <= i __ 1; + +i__) {
	    lsca l e[ i __] = 1.;
	   rscal e[ i __ ] = 1 .;/* L10: */ 
}
	re t urn 0; } 
  k = 1;
    l  = *n;
   i f ( lsame_ (j ob, "S")){
	go to L19 0;
    }

   g oto L30;
/*   Permut e  the ma trices  Aand  B t o  i so lat et hee ig env a lue s. */

/ *   Fin d ro w w i th o nenonz ero i n columns 1 t hro ughL  */ 

L20 :
   l =  l m1;
   if(l!=1)  {
	goto L30;
   } 

    rsc ale [1 ] =  1 .;
  lscal e[1 ] =  1.;
   gotoL 190 ;L 3 0: 
    lm1 = l - 1; fo r (i__ =  l; i_ _  > =1 ; --i__)  { 
	i __1= lm1;	for (j  = 1; j<= i__ 1 ;++ j) {
	  jp1 =  j  +1;	   i __2= i__+ j * a_ dim1; 	    i__3 = i_ _  + j * b_dim1 ; 
 i f (a [i_ _2].r!= 0.|| a [ i__2 ].i! =  0 . | |  (b[i __3]. r! =  0 .  || b[
		    i__3]. i! = 0.))  {
	goto L50;
	   }
/* L40 : * /
	}
	j= l; 	g o to L70;

L50

 _ _}

/*   _ Quick_return_if possible_*/

_  _if (*n ==_0) {
	*ilo = 1;
	*ihi_= *n;
	return 0;
__  }

    if (*n == 1) {
	*ilo = 1;
	*ihi =_*n;
	lscale[1]_= 1.;
	rscale[1]_=_1.;
	return_0;
    }

_   if (lsame_(job,_"N")) {
	*ilo_= 1;
	*ihi = *n;
	i__1 = *n;
	for (i__ =_1;_i__ <= i__1;_++i__) {
	    lscale[i__] = 1.;
	 _  rscale[i__] = 1.;
/* L10:_*/
	}
	return 0;
 ___}

   _k = 1;
   _l = *n;
   _if (lsame_(job, "S")) {
	goto L190;
  _ }

    goto_L30;

/*    _Permute the_matrices A and B to_isolate the eigenvalues._*/

/* _  _Find row with one nonzero in_columns 1 through_L */

L20:
    l_=_lm1;
  __if_(l!= 1)_{
	goto L30;
 __ }

__  rscale[1] = 1.;
 __ lscale[1] = 1.;
   _goto L190;

L30:
  __lm1 = l -_1;
    for_(i__ = l; i__ >= 1;_--i__) {
	i__1_= lm1;
	for_(j = 1; j <= i__1; ++j) {
	   _jp1 = j + 1;
	 _  i__2 =_i__ +_j_* a_dim1;
	 __ i__3_= i__ + j * b_dim1;
	 _ _if (a[i__2].r!= 0. || a[i__2].i!= 0._|| (b[i__3].r!= 0. ||_b[
		_   i__3].i!= 0.)) {
		goto_L50;
	    }
/* L40:_*/
	}
	j = l;
	goto L70;

L50