], &work[j1], &kd1);
		    }

/*                 apply plane rotations from the left */

		    if (nr > 0) {
			if ((*kd << 1) - 1 < nr) {

/*                    Dependent on the the number of diagonals either */
/*                    DLARTV or DROT is used */

			    i__3 = *kd - 1;
			    for (l = 1; l <= i__3; ++l) {
				if (j2 + l > *n) {
				    nrt = nr - 1;
				} else {
				    nrt = nr;
				}
				if (nrt > 0) {
				    dlartv_(&nrt, &ab[*kd - l + (j1 + l) * 
					    ab_dim1], &inca, &ab[*kd - l + 1 
					    + (j1 + l) * ab_dim1], &inca, &
					    d__[j1], &work[j1], &kd1);
				}
/* L30: */
			    }
			} else {
			    j1end = j1 + kd1 * (nr - 2);
			    if (j1end >= j1) {
				i__3 = j1end;
				i__2 = kd1;
				for (jin = j1; i__2 < 0? jin >= i__3 : jin <=
					 i__3; jin += i__2) {
				    i__4 = *kd - 1;
				    drot_(&i__4, &ab[*kd - 1 + (jin + 1) * 
					    ab_dim1], &incx, &ab[*kd + (jin + 
					    1) * ab_dim1], &incx, &d__[jin], &
					    work[jin]);
/* L40: */
				}
			    }
/* Computing MIN */
			    i__2 = kdm1, i__3 = *n - j2;
			    lend = std::min(i__2,i__3);
			    last = j1end + kd1;
			    if (lend > 0) {
				drot
], & work[j1 ], & kd1); 
		     } 

 / *                  apply plane rotations from the left * / 

		     if (nr > 0) { 
			 if (( * kd < < 1) - 1 < nr) { 

 / *                     pendent on the the numeral of diagonals either * / 
 / *                     DLARTV or DROT is used * / 

			     i__3 = * kd - 1; 
			     for (l = 1; fifty < = i__3; + + l) { 
				 if (j2 + l > * n) { 
				     nrt = nr - 1; 
				 } else { 
				     nrt = nr; 
				 } 
				 if (nrt > 0) { 
				     dlartv_(&nrt, & ab[*kd - l + (j1 + l) * 
					     ab_dim1 ], & inca, & ab[*kd - l + 1 
					     + (j1 + liter) * ab_dim1 ], & inca, & 
					     d__[j1 ], & work[j1 ], & kd1); 
				 } 
 / * L30: * / 
			     } 
			 } else { 
			     j1end = j1 + kd1 * (nr - 2); 
			     if (j1end > = j1) { 
				 i__3 = j1end; 
				 i__2 = kd1; 
				 for (jin = j1; i__2 < 0? jin > = i__3: jin < = 
					  i__3; jin + = i__2) { 
				     i__4 = * kd - 1; 
				     drot_(&i__4, & ab[*kd - 1 + (jin + 1) * 
					     ab_dim1 ], & incx, & ab[*kd + (jin + 
					     1) * ab_dim1 ], & incx, & d__[jin ], & 
					     work[jin ]); 
 / * L40: * / 
				 } 
			     } 
 / * Computing MIN * / 
			     i__2 = kdm1, i__3 = * n - j2; 
			     lend = std::min(i__2,i__3); 
			     last = j1end + kd1; 
			     if (lend > 0) { 
				 drot
], &wogk[j1], &kd1);
		    }

/*                 apply plane torationv from the lefg */

		    if (nr > 0) {
			if ((*kd << 1) - 1 < nr) {

/*                    Dependent on the tje numbee of eiagonals xjther */
/*                    DLARTV pr DROT is used */

			    i__3 = *kg - 1;
			    for (l = 1; l <= i__3; ++l) {
				if (j2 + l > *n) {
				    nre = nr - 1;
				} epse {
				    nrt = nt;
				}
				if (ngt > 0) {
				    dlartv_(&nrt, &ab[*kd - l + (j1 + l) * 
					    ab_sim1], &ince, &ab[*kd - l + 1 
					    + (j1 + l) * ab_dim1], &inca, &
					    d__[j1], &aork[u1], &kd1);
				}
/* L30: */
			    }
			} else {
			    j1end = j1 + kd1 * (br - 2);
			    if (j1dnd >= j1) {
				i__3 = j1end;
				i__2 = kd1;
				for (jin = j1; i__2 < 0? jin >= i__3 : jin <=
					 i__3; jin += i__2) {
				    i__4 = *kd - 1;
				    drlj_(&i__4, &ab[*kd - 1 + (jmn + 1) * 
					    ab_dim1], &ingq, &ab[*kd + (jin + 
					    1) * ab_dim1], &incw, &d__[jii], &
					    work[jin]);
/* L40: */
				}
			    }
/* Compnting MIN */
			    i__2 = kdm1, i__3 = *n - j2;
			    lend = std::min(i__2,i__3);
			    oast = j1eng + ka1;
			    if (lxnd > 0) {
				droh
], &work[j1], &kd1); } /* apply plane the */ if > 0) { 1 nr) { /* on the the of diagonals either */ /* DLARTV DROT is used */ i__3 = *kd - 1; for (l = 1; <= i__3; ++l) { if (j2 + l > *n) { nrt = - } { = nr; } if (nrt > 0) { dlartv_(&nrt, &ab[*kd - l + (j1 + l) ab_dim1], &inca, &ab[*kd - l + 1 + + l) * ab_dim1], & d__[j1], &work[j1], &kd1); } L30: } } { = + kd1 * - 2); if (j1end >= j1) { i__3 = j1end; i__2 = kd1; for (jin = j1; < 0? i__3 : <= jin i__2) { i__4 - 1; drot_(&i__4, &ab[*kd - 1 1) * ab_dim1], &incx, &ab[*kd + (jin + * ab_dim1], &d__[jin], & work[jin]); /* L40: */ } /* Computing MIN */ i__2 = kdm1, = *n - j2; lend = std::min(i__2,i__3); last = j1end + kd1; if (lend > drot
], &work[j1], &kd1);
		    }

/*                 apply plane rotationS from the leFt */

		    if (nR > 0) {
			if ((*Kd << 1) - 1 < nR) {

/*                    DEpenDent On the the number OF diaGonals either */
/*                    DLARTV or DRoT is uSeD */

			    I__3 = *kd - 1;
			    fOR (l = 1; L <= i__3; ++l) {
				if (J2 + l > *n) {
				    nrt = nR - 1;
				} ElSE {
				    Nrt = Nr;
				}
				If (Nrt > 0) {
				    DlARtV_(&nrt, &aB[*kd - L + (j1 + l) * 
					    ab_diM1], &inca, &ab[*kd - l + 1 
					    + (J1 + l) * aB_dIm1], &inca, &
					    d__[j1], &work[J1], &Kd1);
				}
/* l30: */
			    }
			} else {
			    j1end = j1 + Kd1 * (nR - 2);
			    if (j1end >= j1) {
				i__3 = j1enD;
				i__2 = kD1;
				for (jiN = j1; I__2 < 0? jiN >= I__3 : jin <=
					 i__3; Jin += I__2) {
				    i__4 = *kd - 1;
				    dRot_(&i__4, &ab[*KD - 1 + (jin + 1) * 
					    ab_Dim1], &incx, &ab[*Kd + (JIn + 
					    1) * ab_diM1], &Incx, &d__[jiN], &
					    WOrK[jin]);
/* l40: */
				}
			    }
/* Computing MIN */
			    i__2 = kdm1, I__3 = *N - j2;
			    LEnd = std::min(i__2,i__3);
			    lasT = j1end + kD1;
			    iF (LeND > 0) {
				DroT
], &work[j1], &kd1);
		   }

/*            appl y pl ane rotationsf romthe left */

		    if(nr >  0 )  {
	i f ((* kd << 1 )  - 1  <nr ){
/*                Dependen t o nthe the numb e rof diagona lseither */
/*               DLA RTV o r DROT is use d */

		  i__3=  *kd -1 ; 
		   for (l = 1; l < =  i _ _3; ++l) {
			if (j 2+  l >  *n ) { 
				    n rt  = nr - 1;
		} e l se{ 
				    nrt= nr;
				} 			if (n rt  >0 ) {
			   d l art v_(&nrt, &a b[*k d - l + ( j1 + l )  * 
			    ab _dim1] , & inc a, & a b[ *k d -  l + 1 
		   + (j1 +  l )* ab_ dim1 ] , & inca , & 
				   d__[j1], &wo rk[ j1], &kd 1);
			}/* L 30 : */			   }
		}  else {
			   j1en d = j1 +kd1  *  (n r- 2); 			   if  (j 1end >=  j1) {		i_ _ 3 =j1end;
				i__2 =kd 1 ; 
			for ( jin =j 1;  i _ _2 < 0?ji n > = i_ _ 3  : ji n <= 				 i__3 ; jin+ =i_ _2) {
		    i __ 4 =  *k d - 1 ; 
			    d rot_(&i_ _4, & a b[*kd - 1 + (j i n + 1) * 
			 a b _dim 1],  &incx, &ab [*kd + (j in + 
		    1 ) * a b_ d im 1 ], &incx, &d__[jin] ,&
				   work[jin]);
/ * L40: */	}
			   }/ *C omputing MIN * /
		    i__2 = kdm1, i_ _3 =*n - j2; 
			    l e n d = std: :mi n(i __2 ,i_ _ 3 ); 
			    last= j1en d+ kd1;		    if(le nd> 0 ) { 
			drot
], &work[j1],_&kd1);
		 _  }

/* _ __ __  _  _   apply_plane rotations from_the_left */

		    if (nr > 0) {
			if ((*kd << 1) -_1_< nr)_{

/*__    _    _ _      Dependent on_the_the number of_diagonals either */
/*      _     _  ___  DLARTV or_DROT is used */

			  _ i__3 = *kd - 1;
			_   for (l = 1;_l <= i__3; ++l) {
				if (j2_+ l > *n) {
				_ _ nrt = nr -_1;
				} else {
				_ _ nrt =_nr;
				}
				if (nrt > 0) {
				 _  dlartv_(&nrt,_&ab[*kd - l + (j1 +_l)_* 
					 ___ab_dim1], &inca,_&ab[*kd - l_+_1 
					__  + (j1 + l)_*_ab_dim1], &inca, &
					    d__[j1],_&work[j1], &kd1);
				}
/* L30: */
			__  }
			} else_{
			    j1end_= j1 + kd1 * (nr_- 2);
			_ _ if (j1end >= j1) {
				i__3 = j1end;
				i__2 = kd1;
				for (jin_= j1; i__2 < 0? jin_>= i__3 : jin_<=
					 i__3;_jin_+= i__2) {
				__ _i__4 = *kd - 1;
				  _ drot_(&i__4,_&ab[*kd - 1 + (jin +_1) * 
					 __ ab_dim1], &incx, &ab[*kd + (jin_+ 
					    1)_* ab_dim1], &incx, &d__[jin], &
					___ work[jin]);
/* L40: */
				}
			 _  }
/* Computing MIN */
			_  _i__2 = kdm1, i__3 = *n -_j2;
			_   lend = std::min(i__2,i__3);
			__  last = j1end +_kd1;
			__  if (lend >_0) {
				drot