#define EXTERN extern
#include "mpd.h"

void zprintspec ( curspec , curpen , s ) 
halfword curspec ; 
halfword curpen ; 
strnumber s ; 
{halfword p, q  ; 
  halfword w  ; 
  printdiagnostic ( 592 , s , true ) ; 
  p = curspec ; 
  w = penwalk ( curpen , specoffset ) ; 
  println () ; 
  printtwo ( mem [ curspec + 1 ] .cint , mem [ curspec + 2 ] .cint ) ; 
  print ( 593 ) ; 
  printtwo ( mem [ w + 1 ] .cint , mem [ w + 2 ] .cint ) ; 
  do {
      do { q = mem [ p ] .hhfield .v.RH ; 
      {
	printnl ( 598 ) ; 
	printtwo ( mem [ p + 5 ] .cint , mem [ p + 6 ] .cint ) ; 
	print ( 537 ) ; 
	printtwo ( mem [ q + 3 ] .cint , mem [ q + 4 ] .cint ) ; 
	printnl ( 534 ) ; 
	printtwo ( mem [ q + 1 ] .cint , mem [ q + 2 ] .cint ) ; 
      } 
      p = q ; 
    } while ( ! ( ( p == curspec ) || ( mem [ p ] .hhfield .lhfield != 16384 ) 
    ) ) ; 
    if ( mem [ p ] .hhfield .lhfield != 16384 ) 
    {
      w = penwalk ( w , mem [ p ] .hhfield .lhfield - 16384 ) ; 
      print ( 595 ) ; 
      if ( mem [ p ] .hhfield .lhfield > 16384 ) 
      print ( 596 ) ; 
      print ( 597 ) ; 
      printtwo ( mem [ w + 1 ] .cint , mem [ w + 2 ] .cint ) ; 
    } 
  } while ( ! ( p == curspec ) ) ; 
  printnl ( 594 ) ; 
  enddiagnostic ( true ) ; 
} 
halfword zinsertknot ( q , x , y ) 
halfword q ; 
scaled x ; 
scaled y ; 
{register halfword Result; halfword r  ; 
  r = getnode ( 7 ) ; 
  mem [ r ] .hhfield .v.RH = mem [ q ] .hhfield .v.RH ; 
  mem [ q ] .hhfield .v.RH = r ; 
  mem [ r + 5 ] .cint = mem [ q + 5 ] .cint ; 
  mem [ r + 6 ] .cint = mem [ q + 6 ] .cint ; 
  mem [ r + 1 ] .cint = x ; 
  mem [ r + 2 ] .cint = y ; 
  mem [ q + 5 ] .cint = mem [ q + 1 ] .cint ; 
  mem [ q + 6 ] .cint = mem [ q + 2 ] .cint ; 
  mem [ r + 3 ] .cint = mem [ r + 1 ] .cint ; 
  mem [ r + 4 ] .cint = mem [ r + 2 ] .cint ; 
  mem [ r ] .hhfield .b0 = 1 ; 
  mem [ r ] .hhfield .b1 = 1 ; 
  Result = r ; 
  return(Result) ; 
} 
halfword zmakeenvelope ( c , h , ljoin , lcap , miterlim ) 
halfword c ; 
halfword h ; 
smallnumber ljoin ; 
smallnumber lcap ; 
scaled miterlim ; 
{/* 30 */ register halfword Result; halfword p, q, r, q0  ; 
  char jointype  ; 
  halfword w, w0  ; 
  scaled qx, qy  ; 
  halfword k, k0  ; 
  fraction dxin, dyin, dxout, dyout  ; 
  scaled tmp  ; 
  fraction det  ; 
  fraction htx, hty  ; 
  scaled maxht  ; 
  halfword kk  ; 
  halfword ww  ; 
  specp1 = 0 ; 
  specp2 = 0 ; 
  if ( mem [ c ] .hhfield .b0 == 0 ) 
  {
    specp1 = htapypoc ( c ) ; 
    specp2 = pathtail ; 
    mem [ specp2 ] .hhfield .v.RH = mem [ specp1 ] .hhfield .v.RH ; 
    mem [ specp1 ] .hhfield .v.RH = c ; 
    removecubic ( specp1 ) ; 
    c = specp1 ; 
    if ( c != mem [ c ] .hhfield .v.RH ) 
    removecubic ( specp2 ) ; 
    else {
	
      mem [ c ] .hhfield .b0 = 1 ; 
      mem [ c ] .hhfield .b1 = 1 ; 
      mem [ c + 3 ] .cint = mem [ c + 1 ] .cint ; 
      mem [ c + 4 ] .cint = mem [ c + 2 ] .cint ; 
      mem [ c + 5 ] .cint = mem [ c + 1 ] .cint ; 
      mem [ c + 6 ] .cint = mem [ c + 2 ] .cint ; 
    } 
  } 
  c = offsetprep ( c , h ) ; 
  if ( internal [ 5 ] > 0 ) 
  printspec ( c , h , 285 ) ; 
  h = penwalk ( h , specoffset ) ; 
  w = h ; 
  p = c ; 
  do {
      q = mem [ p ] .hhfield .v.RH ; 
    q0 = q ; 
    qx = mem [ q + 1 ] .cint ; 
    qy = mem [ q + 2 ] .cint ; 
    k = mem [ q ] .hhfield .lhfield ; 
    k0 = k ; 
    w0 = w ; 
    if ( k != 16384 ) 
    if ( k < 16384 ) 
    jointype = 2 ; 
    else {
	
      if ( ( q != specp1 ) && ( q != specp2 ) ) 
      jointype = ljoin ; 
      else if ( lcap == 2 ) 
      jointype = 3 ; 
      else jointype = 2 - lcap ; 
      if ( ( jointype == 0 ) || ( jointype == 3 ) ) 
      {
	dxin = mem [ q + 1 ] .cint - mem [ q + 3 ] .cint ; 
	dyin = mem [ q + 2 ] .cint - mem [ q + 4 ] .cint ; 
	if ( ( dxin == 0 ) && ( dyin == 0 ) ) 
	{
	  dxin = mem [ q + 1 ] .cint - mem [ p + 5 ] .cint ; 
	  dyin = mem [ q + 2 ] .cint - mem [ p + 6 ] .cint ; 
	  if ( ( dxin == 0 ) && ( dyin == 0 ) ) 
	  {
	    dxin = mem [ q + 1 ] .cint - mem [ p + 1 ] .cint ; 
	    dyin = mem [ q + 2 ] .cint - mem [ p + 2 ] .cint ; 
	    if ( p != c ) 
	    {
	      dxin = dxin + mem [ w + 1 ] .cint ; 
	      dyin = dyin + mem [ w + 2 ] .cint ; 
	    } 
	  } 
	} 
	tmp = pythadd ( dxin , dyin ) ; 
	if ( tmp == 0 ) 
	jointype = 2 ; 
	else {
	    
	  dxin = makefraction ( dxin , tmp ) ; 
	  dyin = makefraction ( dyin , tmp ) ; 
	  dxout = mem [ q + 5 ] .cint - mem [ q + 1 ] .cint ; 
	  dyout = mem [ q + 6 ] .cint - mem [ q + 2 ] .cint ; 
	  if ( ( dxout == 0 ) && ( dyout == 0 ) ) 
	  {
	    r = mem [ q ] .hhfield .v.RH ; 
	    dxout = mem [ r + 3 ] .cint - mem [ q + 1 ] .cint ; 
	    dyout = mem [ r + 4 ] .cint - mem [ q + 2 ] .cint ; 
	    if ( ( dxout == 0 ) && ( dyout == 0 ) ) 
	    {
	      dxout = mem [ r + 1 ] .cint - mem [ q + 1 ] .cint ; 
	      dyout = mem [ r + 2 ] .cint - mem [ q + 2 ] .cint ; 
	    } 
	  } 
	  if ( q == c ) 
	  {
	    dxout = dxout - mem [ h + 1 ] .cint ; 
	    dyout = dyout - mem [ h + 2 ] .cint ; 
	  } 
	  tmp = pythadd ( dxout , dyout ) ; 
	  if ( tmp == 0 ) 
	  confusion ( 599 ) ; 
	  dxout = makefraction ( dxout , tmp ) ; 
	  dyout = makefraction ( dyout , tmp ) ; 
	} 
	if ( jointype == 0 ) 
	{
	  tmp = takefraction ( miterlim , 134217728L + ( takefraction ( dxin ,	  dxout ) + takefraction ( dyin , dyout ) ) / 2 ) ; 
	  if ( tmp < 65536L ) 
	  if ( takescaled ( miterlim , tmp ) < 65536L ) 
	  jointype = 2 ; 
	} 
      } 
    } 
    mem [ p + 5 ] .cint = mem [ p + 5 ] .cint + mem [ w + 1 ] .cint ; 
    mem [ p + 6 ] .cint = mem [ p + 6 ] .cint + mem [ w + 2 ] .cint ; 
    mem [ q + 3 ] .cint = mem [ q + 3 ] .cint + mem [ w + 1 ] .cint ; 
    mem [ q + 4 ] .cint = mem [ q + 4 ] .cint + mem [ w + 2 ] .cint ; 
    mem [ q + 1 ] .cint = mem [ q + 1 ] .cint + mem [ w + 1 ] .cint ; 
    mem [ q + 2 ] .cint = mem [ q + 2 ] .cint + mem [ w + 2 ] .cint ; 
    mem [ q ] .hhfield .b0 = 1 ; 
    mem [ q ] .hhfield .b1 = 1 ; 
    while ( k != 16384 ) {
	
      if ( k > 16384 ) 
      {
	w = mem [ w ] .hhfield .v.RH ; 
	decr ( k ) ; 
      } 
      else {
	  
	w = mem [ w ] .hhfield .lhfield ; 
	incr ( k ) ; 
      } 
      if ( ( jointype == 1 ) || ( k == 16384 ) ) 
      q = insertknot ( q , qx + mem [ w + 1 ] .cint , qy + mem [ w + 2 ] .cint 
      ) ; 
    } 
    if ( q != mem [ p ] .hhfield .v.RH ) 
    {
      p = mem [ p ] .hhfield .v.RH ; 
      if ( ( jointype == 0 ) || ( jointype == 3 ) ) 
      {
	if ( jointype == 0 ) 
	{
	  det = takefraction ( dyout , dxin ) - takefraction ( dxout , dyin ) 
	  ; 
	  if ( abs ( det ) < 26844 ) 
	  r = 0 ; 
	  else {
	      
	    tmp = takefraction ( mem [ q + 1 ] .cint - mem [ p + 1 ] .cint ,	    dyout ) - takefraction ( mem [ q + 2 ] .cint - mem [ p + 2 ] .cint 
	    , dxout ) ; 
	    tmp = makefraction ( tmp , det ) ; 
	    r = insertknot ( p , mem [ p + 1 ] .cint + takefraction ( tmp ,	    dxin ) , mem [ p + 2 ] .cint + takefraction ( tmp , dyin ) ) ; 
	  } 
	} 
	else {
	    
	  htx = mem [ w + 2 ] .cint - mem [ w0 + 2 ] .cint ; 
	  hty = mem [ w0 + 1 ] .cint - mem [ w + 1 ] .cint ; 
	  while ( ( abs ( htx ) < 134217728L ) && ( abs ( hty ) < 134217728L ) 
	  ) {
	      
	    htx = htx + htx ; 
	    hty = hty + hty ; 
	  } 
	  maxht = 0 ; 
	  kk = 16384 ; 
	  ww = w ; 
	  while ( true ) {
	      
	    if ( kk > k0 ) 
	    {
	      ww = mem [ ww ] .hhfield .v.RH ; 
	      decr ( kk ) ; 
	    } 
	    else {
		
	      ww = mem [ ww ] .hhfield .lhfield ; 
	      incr ( kk ) ; 
	    } 
	    if ( kk == k0 ) 
	    goto lab30 ; 
	    tmp = takefraction ( mem [ ww + 1 ] .cint - mem [ w0 + 1 ] .cint ,	    htx ) + takefraction ( mem [ ww + 2 ] .cint - mem [ w0 + 2 ] .cint 
	    , hty ) ; 
	    if ( tmp > maxht ) 
	    maxht = tmp ; 
	  } 
	  lab30: ; 
	  tmp = makefraction ( maxht , takefraction ( dxin , htx ) + 
	  takefraction ( dyin , hty ) ) ; 
	  r = insertknot ( p , mem [ p + 1 ] .cint + takefraction ( tmp , dxin 
	  ) , mem [ p + 2 ] .cint + takefraction ( tmp , dyin ) ) ; 
	  tmp = makefraction ( maxht , takefraction ( dxout , htx ) + 
	  takefraction ( dyout , hty ) ) ; 
	  r = insertknot ( r , mem [ q + 1 ] .cint + takefraction ( tmp ,	  dxout ) , mem [ q + 2 ] .cint + takefraction ( tmp , dyout ) ) ; 
	} 
	if ( r != 0 ) 
	{
	  mem [ r + 5 ] .cint = mem [ r + 1 ] .cint ; 
	  mem [ r + 6 ] .cint = mem [ r + 2 ] .cint ; 
	} 
      } 
    } 
    p = q ; 
  } while ( ! ( q0 == c ) ) ; 
  Result = c ; 
  return(Result) ; 
} 
scaled zfinddirectiontime ( x , y , h ) 
scaled x ; 
scaled y ; 
halfword h ; 
{/* 10 40 45 30 */ register scaled Result; scaled max  ; 
  halfword p, q  ; 
  scaled n  ; 
  scaled tt  ; 
  scaled x1, x2, x3, y1, y2, y3  ; 
  angle theta, phi  ; 
  fraction t  ; 
  if ( abs ( x ) < abs ( y ) ) 
  {
    x = makefraction ( x , abs ( y ) ) ; 
    if ( y > 0 ) 
    y = 268435456L ; 
    else y = -268435456L ; 
  } 
  else if ( x == 0 ) 
  {
    Result = 0 ; 
    goto lab10 ; 
  } 
  else {
      
    y = makefraction ( y , abs ( x ) ) ; 
    if ( x > 0 ) 
    x = 268435456L ; 
    else x = -268435456L ; 
  } 
  n = 0 ; 
  p = h ; 
  while ( true ) {
      
    if ( mem [ p ] .hhfield .b1 == 0 ) 
    goto lab45 ; 
    q = mem [ p ] .hhfield .v.RH ; 
    tt = 0 ; 
    x1 = mem [ p + 5 ] .cint - mem [ p + 1 ] .cint ; 
    x2 = mem [ q + 3 ] .cint - mem [ p + 5 ] .cint ; 
    x3 = mem [ q + 1 ] .cint - mem [ q + 3 ] .cint ; 
    y1 = mem [ p + 6 ] .cint - mem [ p + 2 ] .cint ; 
    y2 = mem [ q + 4 ] .cint - mem [ p + 6 ] .cint ; 
    y3 = mem [ q + 2 ] .cint - mem [ q + 4 ] .cint ; 
    max = abs ( x1 ) ; 
    if ( abs ( x2 ) > max ) 
    max = abs ( x2 ) ; 
    if ( abs ( x3 ) > max ) 
    max = abs ( x3 ) ; 
    if ( abs ( y1 ) > max ) 
    max = abs ( y1 ) ; 
    if ( abs ( y2 ) > max ) 
    max = abs ( y2 ) ; 
    if ( abs ( y3 ) > max ) 
    max = abs ( y3 ) ; 
    if ( max == 0 ) 
    goto lab40 ; 
    while ( max < 134217728L ) {
	
      max = max + max ; 
      x1 = x1 + x1 ; 
      x2 = x2 + x2 ; 
      x3 = x3 + x3 ; 
      y1 = y1 + y1 ; 
      y2 = y2 + y2 ; 
      y3 = y3 + y3 ; 
    } 
    t = x1 ; 
    x1 = takefraction ( x1 , x ) + takefraction ( y1 , y ) ; 
    y1 = takefraction ( y1 , x ) - takefraction ( t , y ) ; 
    t = x2 ; 
    x2 = takefraction ( x2 , x ) + takefraction ( y2 , y ) ; 
    y2 = takefraction ( y2 , x ) - takefraction ( t , y ) ; 
    t = x3 ; 
    x3 = takefraction ( x3 , x ) + takefraction ( y3 , y ) ; 
    y3 = takefraction ( y3 , x ) - takefraction ( t , y ) ; 
    if ( y1 == 0 ) 
    if ( x1 >= 0 ) 
    goto lab40 ; 
    if ( n > 0 ) 
    {
      theta = narg ( x1 , y1 ) ; 
      if ( theta >= 0 ) 
      if ( phi <= 0 ) 
      if ( phi >= theta - 188743680L ) 
      goto lab40 ; 
      if ( theta <= 0 ) 
      if ( phi >= 0 ) 
      if ( phi <= theta + 188743680L ) 
      goto lab40 ; 
      if ( p == h ) 
      goto lab45 ; 
    } 
    if ( ( x3 != 0 ) || ( y3 != 0 ) ) 
    phi = narg ( x3 , y3 ) ; 
    if ( x1 < 0 ) 
    if ( x2 < 0 ) 
    if ( x3 < 0 ) 
    goto lab30 ; 
    if ( abvscd ( y1 , y3 , y2 , y2 ) == 0 ) 
    {
      if ( abvscd ( y1 , y2 , 0 , 0 ) < 0 ) 
      {
	t = makefraction ( y1 , y1 - y2 ) ; 
	x1 = x1 - takefraction ( x1 - x2 , t ) ; 
	x2 = x2 - takefraction ( x2 - x3 , t ) ; 
	if ( x1 - takefraction ( x1 - x2 , t ) >= 0 ) 
	{
	  tt = ( t + 2048 ) / 4096 ; 
	  goto lab40 ; 
	} 
      } 
      else if ( y3 == 0 ) 
      if ( y1 == 0 ) 
      {
	t = crossingpoint ( - (integer) x1 , - (integer) x2 , - (integer) x3 ) 
	; 
	if ( t <= 268435456L ) 
	{
	  tt = ( t + 2048 ) / 4096 ; 
	  goto lab40 ; 
	} 
	if ( abvscd ( x1 , x3 , x2 , x2 ) <= 0 ) 
	{
	  t = makefraction ( x1 , x1 - x2 ) ; 
	  {
	    tt = ( t + 2048 ) / 4096 ; 
	    goto lab40 ; 
	  } 
	} 
      } 
      else if ( x3 >= 0 ) 
      {
	tt = 65536L ; 
	goto lab40 ; 
      } 
      goto lab30 ; 
    } 
    if ( y1 <= 0 ) 
    if ( y1 < 0 ) 
    {
      y1 = - (integer) y1 ; 
      y2 = - (integer) y2 ; 
      y3 = - (integer) y3 ; 
    } 
    else if ( y2 > 0 ) 
    {
      y2 = - (integer) y2 ; 
      y3 = - (integer) y3 ; 
    } 
    t = crossingpoint ( y1 , y2 , y3 ) ; 
    if ( t > 268435456L ) 
    goto lab30 ; 
    y2 = y2 - takefraction ( y2 - y3 , t ) ; 
    x1 = x1 - takefraction ( x1 - x2 , t ) ; 
    x2 = x2 - takefraction ( x2 - x3 , t ) ; 
    x1 = x1 - takefraction ( x1 - x2 , t ) ; 
    if ( x1 >= 0 ) 
    {
      tt = ( t + 2048 ) / 4096 ; 
      goto lab40 ; 
    } 
    if ( y2 > 0 ) 
    y2 = 0 ; 
    tt = t ; 
    t = crossingpoint ( 0 , - (integer) y2 , - (integer) y3 ) ; 
    if ( t > 268435456L ) 
    goto lab30 ; 
    x1 = x1 - takefraction ( x1 - x2 , t ) ; 
    x2 = x2 - takefraction ( x2 - x3 , t ) ; 
    if ( x1 - takefraction ( x1 - x2 , t ) >= 0 ) 
    {
      t = tt - takefraction ( tt - 268435456L , t ) ; 
      {
	tt = ( t + 2048 ) / 4096 ; 
	goto lab40 ; 
      } 
    } 
    lab30: ; 
    p = q ; 
    n = n + 65536L ; 
  } 
  lab45: Result = -65536L ; 
  goto lab10 ; 
  lab40: Result = n + tt ; 
  lab10: ; 
  return(Result) ; 
} 
void zcubicintersection ( p , pp ) 
halfword p ; 
halfword pp ; 
{/* 22 45 10 */ halfword q, qq  ; 
  timetogo = 5000 ; 
  maxt = 2 ; 
  q = mem [ p ] .hhfield .v.RH ; 
  qq = mem [ pp ] .hhfield .v.RH ; 
  bisectptr = 20 ; 
  bisectstack [ bisectptr - 5 ] = mem [ p + 5 ] .cint - mem [ p + 1 ] .cint ; 
  bisectstack [ bisectptr - 4 ] = mem [ q + 3 ] .cint - mem [ p + 5 ] .cint ; 
  bisectstack [ bisectptr - 3 ] = mem [ q + 1 ] .cint - mem [ q + 3 ] .cint ; 
  if ( bisectstack [ bisectptr - 5 ] < 0 ) 
  if ( bisectstack [ bisectptr - 3 ] >= 0 ) 
  {
    if ( bisectstack [ bisectptr - 4 ] < 0 ) 
    bisectstack [ bisectptr - 2 ] = bisectstack [ bisectptr - 5 ] + 
    bisectstack [ bisectptr - 4 ] ; 
    else bisectstack [ bisectptr - 2 ] = bisectstack [ bisectptr - 5 ] ; 
    bisectstack [ bisectptr - 1 ] = bisectstack [ bisectptr - 5 ] + 
    bisectstack [ bisectptr - 4 ] + bisectstack [ bisectptr - 3 ] ; 
    if ( bisectstack [ bisectptr - 1 ] < 0 ) 
    bisectstack [ bisectptr - 1 ] = 0 ; 
  } 
  else {
      
    bisectstack [ bisectptr - 2 ] = bisectstack [ bisectptr - 5 ] + 
    bisectstack [ bisectptr - 4 ] + bisectstack [ bisectptr - 3 ] ; 
    if ( bisectstack [ bisectptr - 2 ] > bisectstack [ bisectptr - 5 ] ) 
    bisectstack [ bisectptr - 2 ] = bisectstack [ bisectptr - 5 ] ; 
    bisectstack [ bisectptr - 1 ] = bisectstack [ bisectptr - 5 ] + 
    bisectstack [ bisectptr - 4 ] ; 
    if ( bisectstack [ bisectptr - 1 ] < 0 ) 
    bisectstack [ bisectptr - 1 ] = 0 ; 
  } 
  else if ( bisectstack [ bisectptr - 3 ] <= 0 ) 
  {
    if ( bisectstack [ bisectptr - 4 ] > 0 ) 
    bisectstack [ bisectptr - 1 ] = bisectstack [ bisectptr - 5 ] + 
    bisectstack [ bisectptr - 4 ] ; 
    else bisectstack [ bisectptr - 1 ] = bisectstack [ bisectptr - 5 ] ; 
    bisectstack [ bisectptr - 2 ] = bisectstack [ bisectptr - 5 ] + 
    bisectstack [ bisectptr - 4 ] + bisectstack [ bisectptr - 3 ] ; 
    if ( bisectstack [ bisectptr - 2 ] > 0 ) 
    bisectstack [ bisectptr - 2 ] = 0 ; 
  } 
  else {
      
    bisectstack [ bisectptr - 1 ] = bisectstack [ bisectptr - 5 ] + 
    bisectstack [ bisectptr - 4 ] + bisectstack [ bisectptr - 3 ] ; 
    if ( bisectstack [ bisectptr - 1 ] < bisectstack [ bisectptr - 5 ] ) 
    bisectstack [ bisectptr - 1 ] = bisectstack [ bisectptr - 5 ] ; 
    bisectstack [ bisectptr - 2 ] = bisectstack [ bisectptr - 5 ] + 
    bisectstack [ bisectptr - 4 ] ; 
    if ( bisectstack [ bisectptr - 2 ] > 0 ) 
    bisectstack [ bisectptr - 2 ] = 0 ; 
  } 
  bisectstack [ bisectptr - 10 ] = mem [ p + 6 ] .cint - mem [ p + 2 ] .cint ; 
  bisectstack [ bisectptr - 9 ] = mem [ q + 4 ] .cint - mem [ p + 6 ] .cint ; 
  bisectstack [ bisectptr - 8 ] = mem [ q + 2 ] .cint - mem [ q + 4 ] .cint ; 
  if ( bisectstack [ bisectptr - 10 ] < 0 ) 
  if ( bisectstack [ bisectptr - 8 ] >= 0 ) 
  {
    if ( bisectstack [ bisectptr - 9 ] < 0 ) 
    bisectstack [ bisectptr - 7 ] = bisectstack [ bisectptr - 10 ] + 
    bisectstack [ bisectptr - 9 ] ; 
    else bisectstack [ bisectptr - 7 ] = bisectstack [ bisectptr - 10 ] ; 
    bisectstack [ bisectptr - 6 ] = bisectstack [ bisectptr - 10 ] + 
    bisectstack [ bisectptr - 9 ] + bisectstack [ bisectptr - 8 ] ; 
    if ( bisectstack [ bisectptr - 6 ] < 0 ) 
    bisectstack [ bisectptr - 6 ] = 0 ; 
  } 
  else {
      
    bisectstack [ bisectptr - 7 ] = bisectstack [ bisectptr - 10 ] + 
    bisectstack [ bisectptr - 9 ] + bisectstack [ bisectptr - 8 ] ; 
    if ( bisectstack [ bisectptr - 7 ] > bisectstack [ bisectptr - 10 ] ) 
    bisectstack [ bisectptr - 7 ] = bisectstack [ bisectptr - 10 ] ; 
    bisectstack [ bisectptr - 6 ] = bisectstack [ bisectptr - 10 ] + 
    bisectstack [ bisectptr - 9 ] ; 
    if ( bisectstack [ bisectptr - 6 ] < 0 ) 
    bisectstack [ bisectptr - 6 ] = 0 ; 
  } 
  else if ( bisectstack [ bisectptr - 8 ] <= 0 ) 
  {
    if ( bisectstack [ bisectptr - 9 ] > 0 ) 
    bisectstack [ bisectptr - 6 ] = bisectstack [ bisectptr - 10 ] + 
    bisectstack [ bisectptr - 9 ] ; 
    else bisectstack [ bisectptr - 6 ] = bisectstack [ bisectptr - 10 ] ; 
    bisectstack [ bisectptr - 7 ] = bisectstack [ bisectptr - 10 ] + 
    bisectstack [ bisectptr - 9 ] + bisectstack [ bisectptr - 8 ] ; 
    if ( bisectstack [ bisectptr - 7 ] > 0 ) 
    bisectstack [ bisectptr - 7 ] = 0 ; 
  } 
  else {
      
    bisectstack [ bisectptr - 6 ] = bisectstack [ bisectptr - 10 ] + 
    bisectstack [ bisectptr - 9 ] + bisectstack [ bisectptr - 8 ] ; 
    if ( bisectstack [ bisectptr - 6 ] < bisectstack [ bisectptr - 10 ] ) 
    bisectstack [ bisectptr - 6 ] = bisectstack [ bisectptr - 10 ] ; 
    bisectstack [ bisectptr - 7 ] = bisectstack [ bisectptr - 10 ] + 
    bisectstack [ bisectptr - 9 ] ; 
    if ( bisectstack [ bisectptr - 7 ] > 0 ) 
    bisectstack [ bisectptr - 7 ] = 0 ; 
  } 
  bisectstack [ bisectptr - 15 ] = mem [ pp + 5 ] .cint - mem [ pp + 1 ] .cint 
  ; 
  bisectstack [ bisectptr - 14 ] = mem [ qq + 3 ] .cint - mem [ pp + 5 ] .cint 
  ; 
  bisectstack [ bisectptr - 13 ] = mem [ qq + 1 ] .cint - mem [ qq + 3 ] .cint 
  ; 
  if ( bisectstack [ bisectptr - 15 ] < 0 ) 
  if ( bisectstack [ bisectptr - 13 ] >= 0 ) 
  {
    if ( bisectstack [ bisectptr - 14 ] < 0 ) 
    bisectstack [ bisectptr - 12 ] = bisectstack [ bisectptr - 15 ] + 
    bisectstack [ bisectptr - 14 ] ; 
    else bisectstack [ bisectptr - 12 ] = bisectstack [ bisectptr - 15 ] ; 
    bisectstack [ bisectptr - 11 ] = bisectstack [ bisectptr - 15 ] + 
    bisectstack [ bisectptr - 14 ] + bisectstack [ bisectptr - 13 ] ; 
    if ( bisectstack [ bisectptr - 11 ] < 0 ) 
    bisectstack [ bisectptr - 11 ] = 0 ; 
  } 
  else {
      
    bisectstack [ bisectptr - 12 ] = bisectstack [ bisectptr - 15 ] + 
    bisectstack [ bisectptr - 14 ] + bisectstack [ bisectptr - 13 ] ; 
    if ( bisectstack [ bisectptr - 12 ] > bisectstack [ bisectptr - 15 ] ) 
    bisectstack [ bisectptr - 12 ] = bisectstack [ bisectptr - 15 ] ; 
    bisectstack [ bisectptr - 11 ] = bisectstack [ bisectptr - 15 ] + 
    bisectstack [ bisectptr - 14 ] ; 
    if ( bisectstack [ bisectptr - 11 ] < 0 ) 
    bisectstack [ bisectptr - 11 ] = 0 ; 
  } 
  else if ( bisectstack [ bisectptr - 13 ] <= 0 ) 
  {
    if ( bisectstack [ bisectptr - 14 ] > 0 ) 
    bisectstack [ bisectptr - 11 ] = bisectstack [ bisectptr - 15 ] + 
    bisectstack [ bisectptr - 14 ] ; 
    else bisectstack [ bisectptr - 11 ] = bisectstack [ bisectptr - 15 ] ; 
    bisectstack [ bisectptr - 12 ] = bisectstack [ bisectptr - 15 ] + 
    bisectstack [ bisectptr - 14 ] + bisectstack [ bisectptr - 13 ] ; 
    if ( bisectstack [ bisectptr - 12 ] > 0 ) 
    bisectstack [ bisectptr - 12 ] = 0 ; 
  } 
  else {
      
    bisectstack [ bisectptr - 11 ] = bisectstack [ bisectptr - 15 ] + 
    bisectstack [ bisectptr - 14 ] + bisectstack [ bisectptr - 13 ] ; 
    if ( bisectstack [ bisectptr - 11 ] < bisectstack [ bisectptr - 15 ] ) 
    bisectstack [ bisectptr - 11 ] = bisectstack [ bisectptr - 15 ] ; 
    bisectstack [ bisectptr - 12 ] = bisectstack [ bisectptr - 15 ] + 
    bisectstack [ bisectptr - 14 ] ; 
    if ( bisectstack [ bisectptr - 12 ] > 0 ) 
    bisectstack [ bisectptr - 12 ] = 0 ; 
  } 
  bisectstack [ bisectptr - 20 ] = mem [ pp + 6 ] .cint - mem [ pp + 2 ] .cint 
  ; 
  bisectstack [ bisectptr - 19 ] = mem [ qq + 4 ] .cint - mem [ pp + 6 ] .cint 
  ; 
  bisectstack [ bisectptr - 18 ] = mem [ qq + 2 ] .cint - mem [ qq + 4 ] .cint 
  ; 
  if ( bisectstack [ bisectptr - 20 ] < 0 ) 
  if ( bisectstack [ bisectptr - 18 ] >= 0 ) 
  {
    if ( bisectstack [ bisectptr - 19 ] < 0 ) 
    bisectstack [ bisectptr - 17 ] = bisectstack [ bisectptr - 20 ] + 
    bisectstack [ bisectptr - 19 ] ; 
    else bisectstack [ bisectptr - 17 ] = bisectstack [ bisectptr - 20 ] ; 
    bisectstack [ bisectptr - 16 ] = bisectstack [ bisectptr - 20 ] + 
    bisectstack [ bisectptr - 19 ] + bisectstack [ bisectptr - 18 ] ; 
    if ( bisectstack [ bisectptr - 16 ] < 0 ) 
    bisectstack [ bisectptr - 16 ] = 0 ; 
  } 
  else {
      
    bisectstack [ bisectptr - 17 ] = bisectstack [ bisectptr - 20 ] + 
    bisectstack [ bisectptr - 19 ] + bisectstack [ bisectptr - 18 ] ; 
    if ( bisectstack [ bisectptr - 17 ] > bisectstack [ bisectptr - 20 ] ) 
    bisectstack [ bisectptr - 17 ] = bisectstack [ bisectptr - 20 ] ; 
    bisectstack [ bisectptr - 16 ] = bisectstack [ bisectptr - 20 ] + 
    bisectstack [ bisectptr - 19 ] ; 
    if ( bisectstack [ bisectptr - 16 ] < 0 ) 
    bisectstack [ bisectptr - 16 ] = 0 ; 
  } 
  else if ( bisectstack [ bisectptr - 18 ] <= 0 ) 
  {
    if ( bisectstack [ bisectptr - 19 ] > 0 ) 
    bisectstack [ bisectptr - 16 ] = bisectstack [ bisectptr - 20 ] + 
    bisectstack [ bisectptr - 19 ] ; 
    else bisectstack [ bisectptr - 16 ] = bisectstack [ bisectptr - 20 ] ; 
    bisectstack [ bisectptr - 17 ] = bisectstack [ bisectptr - 20 ] + 
    bisectstack [ bisectptr - 19 ] + bisectstack [ bisectptr - 18 ] ; 
    if ( bisectstack [ bisectptr - 17 ] > 0 ) 
    bisectstack [ bisectptr - 17 ] = 0 ; 
  } 
  else {
      
    bisectstack [ bisectptr - 16 ] = bisectstack [ bisectptr - 20 ] + 
    bisectstack [ bisectptr - 19 ] + bisectstack [ bisectptr - 18 ] ; 
    if ( bisectstack [ bisectptr - 16 ] < bisectstack [ bisectptr - 20 ] ) 
    bisectstack [ bisectptr - 16 ] = bisectstack [ bisectptr - 20 ] ; 
    bisectstack [ bisectptr - 17 ] = bisectstack [ bisectptr - 20 ] + 
    bisectstack [ bisectptr - 19 ] ; 
    if ( bisectstack [ bisectptr - 17 ] > 0 ) 
    bisectstack [ bisectptr - 17 ] = 0 ; 
  } 
  delx = mem [ p + 1 ] .cint - mem [ pp + 1 ] .cint ; 
  dely = mem [ p + 2 ] .cint - mem [ pp + 2 ] .cint ; 
  tol = 0 ; 
  uv = bisectptr ; 
  xy = bisectptr ; 
  threel = 0 ; 
  curt = 1 ; 
  curtt = 1 ; 
  while ( true ) {
      
    lab22: if ( delx - tol <= bisectstack [ xy - 11 ] - bisectstack [ uv - 2 ] 
    ) 
    if ( delx + tol >= bisectstack [ xy - 12 ] - bisectstack [ uv - 1 ] ) 
    if ( dely - tol <= bisectstack [ xy - 16 ] - bisectstack [ uv - 7 ] ) 
    if ( dely + tol >= bisectstack [ xy - 17 ] - bisectstack [ uv - 6 ] ) 
    {
      if ( curt >= maxt ) 
      {
	if ( maxt == 131072L ) 
	{
	  curt = halfp ( curt + 1 ) ; 
	  curtt = halfp ( curtt + 1 ) ; 
	  goto lab10 ; 
	} 
	maxt = maxt + maxt ; 
	apprt = curt ; 
	apprtt = curtt ; 
      } 
      bisectstack [ bisectptr ] = delx ; 
      bisectstack [ bisectptr + 1 ] = dely ; 
      bisectstack [ bisectptr + 2 ] = tol ; 
      bisectstack [ bisectptr + 3 ] = uv ; 
      bisectstack [ bisectptr + 4 ] = xy ; 
      bisectptr = bisectptr + 45 ; 
      curt = curt + curt ; 
      curtt = curtt + curtt ; 
      bisectstack [ bisectptr - 25 ] = bisectstack [ uv - 5 ] ; 
      bisectstack [ bisectptr - 3 ] = bisectstack [ uv - 3 ] ; 
      bisectstack [ bisectptr - 24 ] = ( bisectstack [ bisectptr - 25 ] + 
      bisectstack [ uv - 4 ] ) / 2 ; 
      bisectstack [ bisectptr - 4 ] = ( bisectstack [ bisectptr - 3 ] + 
      bisectstack [ uv - 4 ] ) / 2 ; 
      bisectstack [ bisectptr - 23 ] = ( bisectstack [ bisectptr - 24 ] + 
      bisectstack [ bisectptr - 4 ] ) / 2 ; 
      bisectstack [ bisectptr - 5 ] = bisectstack [ bisectptr - 23 ] ; 
      if ( bisectstack [ bisectptr - 25 ] < 0 ) 
      if ( bisectstack [ bisectptr - 23 ] >= 0 ) 
      {
	if ( bisectstack [ bisectptr - 24 ] < 0 ) 
	bisectstack [ bisectptr - 22 ] = bisectstack [ bisectptr - 25 ] + 
	bisectstack [ bisectptr - 24 ] ; 
	else bisectstack [ bisectptr - 22 ] = bisectstack [ bisectptr - 25 ] ; 
	bisectstack [ bisectptr - 21 ] = bisectstack [ bisectptr - 25 ] + 
	bisectstack [ bisectptr - 24 ] + bisectstack [ bisectptr - 23 ] ; 
	if ( bisectstack [ bisectptr - 21 ] < 0 ) 
	bisectstack [ bisectptr - 21 ] = 0 ; 
      } 
      else {
	  
	bisectstack [ bisectptr - 22 ] = bisectstack [ bisectptr - 25 ] + 
	bisectstack [ bisectptr - 24 ] + bisectstack [ bisectptr - 23 ] ; 
	if ( bisectstack [ bisectptr - 22 ] > bisectstack [ bisectptr - 25 ] ) 
	bisectstack [ bisectptr - 22 ] = bisectstack [ bisectptr - 25 ] ; 
	bisectstack [ bisectptr - 21 ] = bisectstack [ bisectptr - 25 ] + 
	bisectstack [ bisectptr - 24 ] ; 
	if ( bisectstack [ bisectptr - 21 ] < 0 ) 
	bisectstack [ bisectptr - 21 ] = 0 ; 
      } 
      else if ( bisectstack [ bisectptr - 23 ] <= 0 ) 
      {
	if ( bisectstack [ bisectptr - 24 ] > 0 ) 
	bisectstack [ bisectptr - 21 ] = bisectstack [ bisectptr - 25 ] + 
	bisectstack [ bisectptr - 24 ] ; 
	else bisectstack [ bisectptr - 21 ] = bisectstack [ bisectptr - 25 ] ; 
	bisectstack [ bisectptr - 22 ] = bisectstack [ bisectptr - 25 ] + 
	bisectstack [ bisectptr - 24 ] + bisectstack [ bisectptr - 23 ] ; 
	if ( bisectstack [ bisectptr - 22 ] > 0 ) 
	bisectstack [ bisectptr - 22 ] = 0 ; 
      } 
      else {
	  
	bisectstack [ bisectptr - 21 ] = bisectstack [ bisectptr - 25 ] + 
	bisectstack [ bisectptr - 24 ] + bisectstack [ bisectptr - 23 ] ; 
	if ( bisectstack [ bisectptr - 21 ] < bisectstack [ bisectptr - 25 ] ) 
	bisectstack [ bisectptr - 21 ] = bisectstack [ bisectptr - 25 ] ; 
	bisectstack [ bisectptr - 22 ] = bisectstack [ bisectptr - 25 ] + 
	bisectstack [ bisectptr - 24 ] ; 
	if ( bisectstack [ bisectptr - 22 ] > 0 ) 
	bisectstack [ bisectptr - 22 ] = 0 ; 
      } 
      if ( bisectstack [ bisectptr - 5 ] < 0 ) 
      if ( bisectstack [ bisectptr - 3 ] >= 0 ) 
      {
	if ( bisectstack [ bisectptr - 4 ] < 0 ) 
	bisectstack [ bisectptr - 2 ] = bisectstack [ bisectptr - 5 ] + 
	bisectstack [ bisectptr - 4 ] ; 
	else bisectstack [ bisectptr - 2 ] = bisectstack [ bisectptr - 5 ] ; 
	bisectstack [ bisectptr - 1 ] = bisectstack [ bisectptr - 5 ] + 
	bisectstack [ bisectptr - 4 ] + bisectstack [ bisectptr - 3 ] ; 
	if ( bisectstack [ bisectptr - 1 ] < 0 ) 
	bisectstack [ bisectptr - 1 ] = 0 ; 
      } 
      else {
	  
	bisectstack [ bisectptr - 2 ] = bisectstack [ bisectptr - 5 ] + 
	bisectstack [ bisectptr - 4 ] + bisectstack [ bisectptr - 3 ] ; 
	if ( bisectstack [ bisectptr - 2 ] > bisectstack [ bisectptr - 5 ] ) 
	bisectstack [ bisectptr - 2 ] = bisectstack [ bisectptr - 5 ] ; 
	bisectstack [ bisectptr - 1 ] = bisectstack [ bisectptr - 5 ] + 
	bisectstack [ bisectptr - 4 ] ; 
	if ( bisectstack [ bisectptr - 1 ] < 0 ) 
	bisectstack [ bisectptr - 1 ] = 0 ; 
      } 
      else if ( bisectstack [ bisectptr - 3 ] <= 0 ) 
      {
	if ( bisectstack [ bisectptr - 4 ] > 0 ) 
	bisectstack [ bisectptr - 1 ] = bisectstack [ bisectptr - 5 ] + 
	bisectstack [ bisectptr - 4 ] ; 
	else bisectstack [ bisectptr - 1 ] = bisectstack [ bisectptr - 5 ] ; 
	bisectstack [ bisectptr - 2 ] = bisectstack [ bisectptr - 5 ] + 
	bisectstack [ bisectptr - 4 ] + bisectstack [ bisectptr - 3 ] ; 
	if ( bisectstack [ bisectptr - 2 ] > 0 ) 
	bisectstack [ bisectptr - 2 ] = 0 ; 
      } 
      else {
	  
	bisectstack [ bisectptr - 1 ] = bisectstack [ bisectptr - 5 ] + 
	bisectstack [ bisectptr - 4 ] + bisectstack [ bisectptr - 3 ] ; 
	if ( bisectstack [ bisectptr - 1 ] < bisectstack [ bisectptr - 5 ] ) 
	bisectstack [ bisectptr - 1 ] = bisectstack [ bisectptr - 5 ] ; 
	bisectstack [ bisectptr - 2 ] = bisectstack [ bisectptr - 5 ] + 
	bisectstack [ bisectptr - 4 ] ; 
	if ( bisectstack [ bisectptr - 2 ] > 0 ) 
	bisectstack [ bisectptr - 2 ] = 0 ; 
      } 
      bisectstack [ bisectptr - 30 ] = bisectstack [ uv - 10 ] ; 
      bisectstack [ bisectptr - 8 ] = bisectstack [ uv - 8 ] ; 
      bisectstack [ bisectptr - 29 ] = ( bisectstack [ bisectptr - 30 ] + 
      bisectstack [ uv - 9 ] ) / 2 ; 
      bisectstack [ bisectptr - 9 ] = ( bisectstack [ bisectptr - 8 ] + 
      bisectstack [ uv - 9 ] ) / 2 ; 
      bisectstack [ bisectptr - 28 ] = ( bisectstack [ bisectptr - 29 ] + 
      bisectstack [ bisectptr - 9 ] ) / 2 ; 
      bisectstack [ bisectptr - 10 ] = bisectstack [ bisectptr - 28 ] ; 
      if ( bisectstack [ bisectptr - 30 ] < 0 ) 
      if ( bisectstack [ bisectptr - 28 ] >= 0 ) 
      {
	if ( bisectstack [ bisectptr - 29 ] < 0 ) 
	bisectstack [ bisectptr - 27 ] = bisectstack [ bisectptr - 30 ] + 
	bisectstack [ bisectptr - 29 ] ; 
	else bisectstack [ bisectptr - 27 ] = bisectstack [ bisectptr - 30 ] ; 
	bisectstack [ bisectptr - 26 ] = bisectstack [ bisectptr - 30 ] + 
	bisectstack [ bisectptr - 29 ] + bisectstack [ bisectptr - 28 ] ; 
	if ( bisectstack [ bisectptr - 26 ] < 0 ) 
	bisectstack [ bisectptr - 26 ] = 0 ; 
      } 
      else {
	  
	bisectstack [ bisectptr - 27 ] = bisectstack [ bisectptr - 30 ] + 
	bisectstack [ bisectptr - 29 ] + bisectstack [ bisectptr - 28 ] ; 
	if ( bisectstack [ bisectptr - 27 ] > bisectstack [ bisectptr - 30 ] ) 
	bisectstack [ bisectptr - 27 ] = bisectstack [ bisectptr - 30 ] ; 
	bisectstack [ bisectptr - 26 ] = bisectstack [ bisectptr - 30 ] + 
	bisectstack [ bisectptr - 29 ] ; 
	if ( bisectstack [ bisectptr - 26 ] < 0 ) 
	bisectstack [ bisectptr - 26 ] = 0 ; 
      } 
      else if ( bisectstack [ bisectptr - 28 ] <= 0 ) 
      {
	if ( bisectstack [ bisectptr - 29 ] > 0 ) 
	bisectstack [ bisectptr - 26 ] = bisectstack [ bisectptr - 30 ] + 
	bisectstack [ bisectptr - 29 ] ; 
	else bisectstack [ bisectptr - 26 ] = bisectstack [ bisectptr - 30 ] ; 
	bisectstack [ bisectptr - 27 ] = bisectstack [ bisectptr - 30 ] + 
	bisectstack [ bisectptr - 29 ] + bisectstack [ bisectptr - 28 ] ; 
	if ( bisectstack [ bisectptr - 27 ] > 0 ) 
	bisectstack [ bisectptr - 27 ] = 0 ; 
      } 
      else {
	  
	bisectstack [ bisectptr - 26 ] = bisectstack [ bisectptr - 30 ] + 
	bisectstack [ bisectptr - 29 ] + bisectstack [ bisectptr - 28 ] ; 
	if ( bisectstack [ bisectptr - 26 ] < bisectstack [ bisectptr - 30 ] ) 
	bisectstack [ bisectptr - 26 ] = bisectstack [ bisectptr - 30 ] ; 
	bisectstack [ bisectptr - 27 ] = bisectstack [ bisectptr - 30 ] + 
	bisectstack [ bisectptr - 29 ] ; 
	if ( bisectstack [ bisectptr - 27 ] > 0 ) 
	bisectstack [ bisectptr - 27 ] = 0 ; 
      } 
      if ( bisectstack [ bisectptr - 10 ] < 0 ) 
      if ( bisectstack [ bisectptr - 8 ] >= 0 ) 
      {
	if ( bisectstack [ bisectptr - 9 ] < 0 ) 
	bisectstack [ bisectptr - 7 ] = bisectstack [ bisectptr - 10 ] + 
	bisectstack [ bisectptr - 9 ] ; 
	else bisectstack [ bisectptr - 7 ] = bisectstack [ bisectptr - 10 ] ; 
	bisectstack [ bisectptr - 6 ] = bisectstack [ bisectptr - 10 ] + 
	bisectstack [ bisectptr - 9 ] + bisectstack [ bisectptr - 8 ] ; 
	if ( bisectstack [ bisectptr - 6 ] < 0 ) 
	bisectstack [ bisectptr - 6 ] = 0 ; 
      } 
      else {
	  
	bisectstack [ bisectptr - 7 ] = bisectstack [ bisectptr - 10 ] + 
	bisectstack [ bisectptr - 9 ] + bisectstack [ bisectptr - 8 ] ; 
	if ( bisectstack [ bisectptr - 7 ] > bisectstack [ bisectptr - 10 ] ) 
	bisectstack [ bisectptr - 7 ] = bisectstack [ bisectptr - 10 ] ; 
	bisectstack [ bisectptr - 6 ] = bisectstack [ bisectptr - 10 ] + 
	bisectstack [ bisectptr - 9 ] ; 
	if ( bisectstack [ bisectptr - 6 ] < 0 ) 
	bisectstack [ bisectptr - 6 ] = 0 ; 
      } 
      else if ( bisectstack [ bisectptr - 8 ] <= 0 ) 
      {
	if ( bisectstack [ bisectptr - 9 ] > 0 ) 
	bisectstack [ bisectptr - 6 ] = bisectstack [ bisectptr - 10 ] + 
	bisectstack [ bisectptr - 9 ] ; 
	else bisectstack [ bisectptr - 6 ] = bisectstack [ bisectptr - 10 ] ; 
	bisectstack [ bisectptr - 7 ] = bisectstack [ bisectptr - 10 ] + 
	bisectstack [ bisectptr - 9 ] + bisectstack [ bisectptr - 8 ] ; 
	if ( bisectstack [ bisectptr - 7 ] > 0 ) 
	bisectstack [ bisectptr - 7 ] = 0 ; 
      } 
      else {
	  
	bisectstack [ bisectptr - 6 ] = bisectstack [ bisectptr - 10 ] + 
	bisectstack [ bisectptr - 9 ] + bisectstack [ bisectptr - 8 ] ; 
	if ( bisectstack [ bisectptr - 6 ] < bisectstack [ bisectptr - 10 ] ) 
	bisectstack [ bisectptr - 6 ] = bisectstack [ bisectptr - 10 ] ; 
	bisectstack [ bisectptr - 7 ] = bisectstack [ bisectptr - 10 ] + 
	bisectstack [ bisectptr - 9 ] ; 
	if ( bisectstack [ bisectptr - 7 ] > 0 ) 
	bisectstack [ bisectptr - 7 ] = 0 ; 
      } 
      bisectstack [ bisectptr - 35 ] = bisectstack [ xy - 15 ] ; 
      bisectstack [ bisectptr - 13 ] = bisectstack [ xy - 13 ] ; 
      bisectstack [ bisectptr - 34 ] = ( bisectstack [ bisectptr - 35 ] + 
      bisectstack [ xy - 14 ] ) / 2 ; 
      bisectstack [ bisectptr - 14 ] = ( bisectstack [ bisectptr - 13 ] + 
      bisectstack [ xy - 14 ] ) / 2 ; 
      bisectstack [ bisectptr - 33 ] = ( bisectstack [ bisectptr - 34 ] + 
      bisectstack [ bisectptr - 14 ] ) / 2 ; 
      bisectstack [ bisectptr - 15 ] = bisectstack [ bisectptr - 33 ] ; 
      if ( bisectstack [ bisectptr - 35 ] < 0 ) 
      if ( bisectstack [ bisectptr - 33 ] >= 0 ) 
      {
	if ( bisectstack [ bisectptr - 34 ] < 0 ) 
	bisectstack [ bisectptr - 32 ] = bisectstack [ bisectptr - 35 ] + 
	bisectstack [ bisectptr - 34 ] ; 
	else bisectstack [ bisectptr - 32 ] = bisectstack [ bisectptr - 35 ] ; 
	bisectstack [ bisectptr - 31 ] = bisectstack [ bisectptr - 35 ] + 
	bisectstack [ bisectptr - 34 ] + bisectstack [ bisectptr - 33 ] ; 
	if ( bisectstack [ bisectptr - 31 ] < 0 ) 
	bisectstack [ bisectptr - 31 ] = 0 ; 
      } 
      else {
	  
	bisectstack [ bisectptr - 32 ] = bisectstack [ bisectptr - 35 ] + 
	bisectstack [ bisectptr - 34 ] + bisectstack [ bisectptr - 33 ] ; 
	if ( bisectstack [ bisectptr - 32 ] > bisectstack [ bisectptr - 35 ] ) 
	bisectstack [ bisectptr - 32 ] = bisectstack [ bisectptr - 35 ] ; 
	bisectstack [ bisectptr - 31 ] = bisectstack [ bisectptr - 35 ] + 
	bisectstack [ bisectptr - 34 ] ; 
	if ( bisectstack [ bisectptr - 31 ] < 0 ) 
	bisectstack [ bisectptr - 31 ] = 0 ; 
      } 
      else if ( bisectstack [ bisectptr - 33 ] <= 0 ) 
      {
	if ( bisectstack [ bisectptr - 34 ] > 0 ) 
	bisectstack [ bisectptr - 31 ] = bisectstack [ bisectptr - 35 ] + 
	bisectstack [ bisectptr - 34 ] ; 
	else bisectstack [ bisectptr - 31 ] = bisectstack [ bisectptr - 35 ] ; 
	bisectstack [ bisectptr - 32 ] = bisectstack [ bisectptr - 35 ] + 
	bisectstack [ bisectptr - 34 ] + bisectstack [ bisectptr - 33 ] ; 
	if ( bisectstack [ bisectptr - 32 ] > 0 ) 
	bisectstack [ bisectptr - 32 ] = 0 ; 
      } 
      else {
	  
	bisectstack [ bisectptr - 31 ] = bisectstack [ bisectptr - 35 ] + 
	bisectstack [ bisectptr - 34 ] + bisectstack [ bisectptr - 33 ] ; 
	if ( bisectstack [ bisectptr - 31 ] < bisectstack [ bisectptr - 35 ] ) 
	bisectstack [ bisectptr - 31 ] = bisectstack [ bisectptr - 35 ] ; 
	bisectstack [ bisectptr - 32 ] = bisectstack [ bisectptr - 35 ] + 
	bisectstack [ bisectptr - 34 ] ; 
	if ( bisectstack [ bisectptr - 32 ] > 0 ) 
	bisectstack [ bisectptr - 32 ] = 0 ; 
      } 
      if ( bisectstack [ bisectptr - 15 ] < 0 ) 
      if ( bisectstack [ bisectptr - 13 ] >= 0 ) 
      {
	if ( bisectstack [ bisectptr - 14 ] < 0 ) 
	bisectstack [ bisectptr - 12 ] = bisectstack [ bisectptr - 15 ] + 
	bisectstack [ bisectptr - 14 ] ; 
	else bisectstack [ bisectptr - 12 ] = bisectstack [ bisectptr - 15 ] ; 
	bisectstack [ bisectptr - 11 ] = bisectstack [ bisectptr - 15 ] + 
	bisectstack [ bisectptr - 14 ] + bisectstack [ bisectptr - 13 ] ; 
	if ( bisectstack [ bisectptr - 11 ] < 0 ) 
	bisectstack [ bisectptr - 11 ] = 0 ; 
      } 
      else {
	  
	bisectstack [ bisectptr - 12 ] = bisectstack [ bisectptr - 15 ] + 
	bisectstack [ bisectptr - 14 ] + bisectstack [ bisectptr - 13 ] ; 
	if ( bisectstack [ bisectptr - 12 ] > bisectstack [ bisectptr - 15 ] ) 
	bisectstack [ bisectptr - 12 ] = bisectstack [ bisectptr - 15 ] ; 
	bisectstack [ bisectptr - 11 ] = bisectstack [ bisectptr - 15 ] + 
	bisectstack [ bisectptr - 14 ] ; 
	if ( bisectstack [ bisectptr - 11 ] < 0 ) 
	bisectstack [ bisectptr - 11 ] = 0 ; 
      } 
      else if ( bisectstack [ bisectptr - 13 ] <= 0 ) 
      {
	if ( bisectstack [ bisectptr - 14 ] > 0 ) 
	bisectstack [ bisectptr - 11 ] = bisectstack [ bisectptr - 15 ] + 
	bisectstack [ bisectptr - 14 ] ; 
	else bisectstack [ bisectptr - 11 ] = bisectstack [ bisectptr - 15 ] ; 
	bisectstack [ bisectptr - 12 ] = bisectstack [ bisectptr - 15 ] + 
	bisectstack [ bisectptr - 14 ] + bisectstack [ bisectptr - 13 ] ; 
	if ( bisectstack [ bisectptr - 12 ] > 0 ) 
	bisectstack [ bisectptr - 12 ] = 0 ; 
      } 
      else {
	  
	bisectstack [ bisectptr - 11 ] = bisectstack [ bisectptr - 15 ] + 
	bisectstack [ bisectptr - 14 ] + bisectstack [ bisectptr - 13 ] ; 
	if ( bisectstack [ bisectptr - 11 ] < bisectstack [ bisectptr - 15 ] ) 
	bisectstack [ bisectptr - 11 ] = bisectstack [ bisectptr - 15 ] ; 
	bisectstack [ bisectptr - 12 ] = bisectstack [ bisectptr - 15 ] + 
	bisectstack [ bisectptr - 14 ] ; 
	if ( bisectstack [ bisectptr - 12 ] > 0 ) 
	bisectstack [ bisectptr - 12 ] = 0 ; 
      } 
      bisectstack [ bisectptr - 40 ] = bisectstack [ xy - 20 ] ; 
      bisectstack [ bisectptr - 18 ] = bisectstack [ xy - 18 ] ; 
      bisectstack [ bisectptr - 39 ] = ( bisectstack [ bisectptr - 40 ] + 
      bisectstack [ xy - 19 ] ) / 2 ; 
      bisectstack [ bisectptr - 19 ] = ( bisectstack [ bisectptr - 18 ] + 
      bisectstack [ xy - 19 ] ) / 2 ; 
      bisectstack [ bisectptr - 38 ] = ( bisectstack [ bisectptr - 39 ] + 
      bisectstack [ bisectptr - 19 ] ) / 2 ; 
      bisectstack [ bisectptr - 20 ] = bisectstack [ bisectptr - 38 ] ; 
      if ( bisectstack [ bisectptr - 40 ] < 0 ) 
      if ( bisectstack [ bisectptr - 38 ] >= 0 ) 
      {
	if ( bisectstack [ bisectptr - 39 ] < 0 ) 
	bisectstack [ bisectptr - 37 ] = bisectstack [ bisectptr - 40 ] + 
	bisectstack [ bisectptr - 39 ] ; 
	else bisectstack [ bisectptr - 37 ] = bisectstack [ bisectptr - 40 ] ; 
	bisectstack [ bisectptr - 36 ] = bisectstack [ bisectptr - 40 ] + 
	bisectstack [ bisectptr - 39 ] + bisectstack [ bisectptr - 38 ] ; 
	if ( bisectstack [ bisectptr - 36 ] < 0 ) 
	bisectstack [ bisectptr - 36 ] = 0 ; 
      } 
      else {
	  
	bisectstack [ bisectptr - 37 ] = bisectstack [ bisectptr - 40 ] + 
	bisectstack [ bisectptr - 39 ] + bisectstack [ bisectptr - 38 ] ; 
	if ( bisectstack [ bisectptr - 37 ] > bisectstack [ bisectptr - 40 ] ) 
	bisectstack [ bisectptr - 37 ] = bisectstack [ bisectptr - 40 ] ; 
	bisectstack [ bisectptr - 36 ] = bisectstack [ bisectptr - 40 ] + 
	bisectstack [ bisectptr - 39 ] ; 
	if ( bisectstack [ bisectptr - 36 ] < 0 ) 
	bisectstack [ bisectptr - 36 ] = 0 ; 
      } 
      else if ( bisectstack [ bisectptr - 38 ] <= 0 ) 
      {
	if ( bisectstack [ bisectptr - 39 ] > 0 ) 
	bisectstack [ bisectptr - 36 ] = bisectstack [ bisectptr - 40 ] + 
	bisectstack [ bisectptr - 39 ] ; 
	else bisectstack [ bisectptr - 36 ] = bisectstack [ bisectptr - 40 ] ; 
	bisectstack [ bisectptr - 37 ] = bisectstack [ bisectptr - 40 ] + 
	bisectstack [ bisectptr - 39 ] + bisectstack [ bisectptr - 38 ] ; 
	if ( bisectstack [ bisectptr - 37 ] > 0 ) 
	bisectstack [ bisectptr - 37 ] = 0 ; 
      } 
      else {
	  
	bisectstack [ bisectptr - 36 ] = bisectstack [ bisectptr - 40 ] + 
	bisectstack [ bisectptr - 39 ] + bisectstack [ bisectptr - 38 ] ; 
	if ( bisectstack [ bisectptr - 36 ] < bisectstack [ bisectptr - 40 ] ) 
	bisectstack [ bisectptr - 36 ] = bisectstack [ bisectptr - 40 ] ; 
	bisectstack [ bisectptr - 37 ] = bisectstack [ bisectptr - 40 ] + 
	bisectstack [ bisectptr - 39 ] ; 
	if ( bisectstack [ bisectptr - 37 ] > 0 ) 
	bisectstack [ bisectptr - 37 ] = 0 ; 
      } 
      if ( bisectstack [ bisectptr - 20 ] < 0 ) 
      if ( bisectstack [ bisectptr - 18 ] >= 0 ) 
      {
	if ( bisectstack [ bisectptr - 19 ] < 0 ) 
	bisectstack [ bisectptr - 17 ] = bisectstack [ bisectptr - 20 ] + 
	bisectstack [ bisectptr - 19 ] ; 
	else bisectstack [ bisectptr - 17 ] = bisectstack [ bisectptr - 20 ] ; 
	bisectstack [ bisectptr - 16 ] = bisectstack [ bisectptr - 20 ] + 
	bisectstack [ bisectptr - 19 ] + bisectstack [ bisectptr - 18 ] ; 
	if ( bisectstack [ bisectptr - 16 ] < 0 ) 
	bisectstack [ bisectptr - 16 ] = 0 ; 
      } 
      else {
	  
	bisectstack [ bisectptr - 17 ] = bisectstack [ bisectptr - 20 ] + 
	bisectstack [ bisectptr - 19 ] + bisectstack [ bisectptr - 18 ] ; 
	if ( bisectstack [ bisectptr - 17 ] > bisectstack [ bisectptr - 20 ] ) 
	bisectstack [ bisectptr - 17 ] = bisectstack [ bisectptr - 20 ] ; 
	bisectstack [ bisectptr - 16 ] = bisectstack [ bisectptr - 20 ] + 
	bisectstack [ bisectptr - 19 ] ; 
	if ( bisectstack [ bisectptr - 16 ] < 0 ) 
	bisectstack [ bisectptr - 16 ] = 0 ; 
      } 
      else if ( bisectstack [ bisectptr - 18 ] <= 0 ) 
      {
	if ( bisectstack [ bisectptr - 19 ] > 0 ) 
	bisectstack [ bisectptr - 16 ] = bisectstack [ bisectptr - 20 ] + 
	bisectstack [ bisectptr - 19 ] ; 
	else bisectstack [ bisectptr - 16 ] = bisectstack [ bisectptr - 20 ] ; 
	bisectstack [ bisectptr - 17 ] = bisectstack [ bisectptr - 20 ] + 
	bisectstack [ bisectptr - 19 ] + bisectstack [ bisectptr - 18 ] ; 
	if ( bisectstack [ bisectptr - 17 ] > 0 ) 
	bisectstack [ bisectptr - 17 ] = 0 ; 
      } 
      else {
	  
	bisectstack [ bisectptr - 16 ] = bisectstack [ bisectptr - 20 ] + 
	bisectstack [ bisectptr - 19 ] + bisectstack [ bisectptr - 18 ] ; 
	if ( bisectstack [ bisectptr - 16 ] < bisectstack [ bisectptr - 20 ] ) 
	bisectstack [ bisectptr - 16 ] = bisectstack [ bisectptr - 20 ] ; 
	bisectstack [ bisectptr - 17 ] = bisectstack [ bisectptr - 20 ] + 
	bisectstack [ bisectptr - 19 ] ; 
	if ( bisectstack [ bisectptr - 17 ] > 0 ) 
	bisectstack [ bisectptr - 17 ] = 0 ; 
      } 
      uv = bisectptr - 20 ; 
      xy = bisectptr - 20 ; 
      delx = delx + delx ; 
      dely = dely + dely ; 
      tol = tol - threel + tolstep ; 
      tol = tol + tol ; 
      threel = threel + tolstep ; 
      goto lab22 ; 
    } 
    if ( timetogo > 0 ) 
    decr ( timetogo ) ; 
    else {
	
      while ( apprt < 65536L ) {
	  
	apprt = apprt + apprt ; 
	apprtt = apprtt + apprtt ; 
      } 
      curt = apprt ; 
      curtt = apprtt ; 
      goto lab10 ; 
    } 
    lab45: if ( odd ( curtt ) ) 
    if ( odd ( curt ) ) 
    {
      curt = halfp ( curt ) ; 
      curtt = halfp ( curtt ) ; 
      if ( curt == 0 ) 
      goto lab10 ; 
      bisectptr = bisectptr - 45 ; 
      threel = threel - tolstep ; 
      delx = bisectstack [ bisectptr ] ; 
      dely = bisectstack [ bisectptr + 1 ] ; 
      tol = bisectstack [ bisectptr + 2 ] ; 
      uv = bisectstack [ bisectptr + 3 ] ; 
      xy = bisectstack [ bisectptr + 4 ] ; 
      goto lab45 ; 
    } 
    else {
	
      incr ( curt ) ; 
      delx = delx + bisectstack [ uv - 5 ] + bisectstack [ uv - 4 ] + 
      bisectstack [ uv - 3 ] ; 
      dely = dely + bisectstack [ uv - 10 ] + bisectstack [ uv - 9 ] + 
      bisectstack [ uv - 8 ] ; 
      uv = uv + 20 ; 
      decr ( curtt ) ; 
      xy = xy - 20 ; 
      delx = delx + bisectstack [ xy - 15 ] + bisectstack [ xy - 14 ] + 
      bisectstack [ xy - 13 ] ; 
      dely = dely + bisectstack [ xy - 20 ] + bisectstack [ xy - 19 ] + 
      bisectstack [ xy - 18 ] ; 
    } 
    else {
	
      incr ( curtt ) ; 
      tol = tol + threel ; 
      delx = delx - bisectstack [ xy - 15 ] - bisectstack [ xy - 14 ] - 
      bisectstack [ xy - 13 ] ; 
      dely = dely - bisectstack [ xy - 20 ] - bisectstack [ xy - 19 ] - 
      bisectstack [ xy - 18 ] ; 
      xy = xy + 20 ; 
    } 
  } 
  lab10: ; 
} 
void zpathintersection ( h , hh ) 
halfword h ; 
halfword hh ; 
{/* 10 */ halfword p, pp  ; 
  integer n, nn  ; 
  if ( mem [ h ] .hhfield .b1 == 0 ) 
  {
    mem [ h + 5 ] .cint = mem [ h + 1 ] .cint ; 
    mem [ h + 3 ] .cint = mem [ h + 1 ] .cint ; 
    mem [ h + 6 ] .cint = mem [ h + 2 ] .cint ; 
    mem [ h + 4 ] .cint = mem [ h + 2 ] .cint ; 
    mem [ h ] .hhfield .b1 = 1 ; 
  } 
  if ( mem [ hh ] .hhfield .b1 == 0 ) 
  {
    mem [ hh + 5 ] .cint = mem [ hh + 1 ] .cint ; 
    mem [ hh + 3 ] .cint = mem [ hh + 1 ] .cint ; 
    mem [ hh + 6 ] .cint = mem [ hh + 2 ] .cint ; 
    mem [ hh + 4 ] .cint = mem [ hh + 2 ] .cint ; 
    mem [ hh ] .hhfield .b1 = 1 ; 
  } 
  tolstep = 0 ; 
  do {
      n = -65536L ; 
    p = h ; 
    do {
	if ( mem [ p ] .hhfield .b1 != 0 ) 
      {
	nn = -65536L ; 
	pp = hh ; 
	do {
	    if ( mem [ pp ] .hhfield .b1 != 0 ) 
	  {
	    cubicintersection ( p , pp ) ; 
	    if ( curt > 0 ) 
	    {
	      curt = curt + n ; 
	      curtt = curtt + nn ; 
	      goto lab10 ; 
	    } 
	  } 
	  nn = nn + 65536L ; 
	  pp = mem [ pp ] .hhfield .v.RH ; 
	} while ( ! ( pp == hh ) ) ; 
      } 
      n = n + 65536L ; 
      p = mem [ p ] .hhfield .v.RH ; 
    } while ( ! ( p == h ) ) ; 
    tolstep = tolstep + 3 ; 
  } while ( ! ( tolstep > 3 ) ) ; 
  curt = -65536L ; 
  curtt = -65536L ; 
  lab10: ; 
} 
fraction zmaxcoef ( p ) 
halfword p ; 
{register fraction Result; fraction x  ; 
  x = 0 ; 
  while ( mem [ p ] .hhfield .lhfield != 0 ) {
      
    if ( abs ( mem [ p + 1 ] .cint ) > x ) 
    x = abs ( mem [ p + 1 ] .cint ) ; 
    p = mem [ p ] .hhfield .v.RH ; 
  } 
  Result = x ; 
  return(Result) ; 
} 
halfword zpplusq ( p , q , t ) 
halfword p ; 
halfword q ; 
smallnumber t ; 
{/* 30 */ register halfword Result; halfword pp, qq  ; 
  halfword r, s  ; 
  integer threshold  ; 
  integer v  ; 
  if ( t == 17 ) 
  threshold = 2685 ; 
  else threshold = 8 ; 
  r = memtop - 1 ; 
  pp = mem [ p ] .hhfield .lhfield ; 
  qq = mem [ q ] .hhfield .lhfield ; 
  while ( true ) if ( pp == qq ) 
  if ( pp == 0 ) 
  goto lab30 ; 
  else {
      
    v = mem [ p + 1 ] .cint + mem [ q + 1 ] .cint ; 
    mem [ p + 1 ] .cint = v ; 
    s = p ; 
    p = mem [ p ] .hhfield .v.RH ; 
    pp = mem [ p ] .hhfield .lhfield ; 
    if ( abs ( v ) < threshold ) 
    freenode ( s , 2 ) ; 
    else {
	
      if ( abs ( v ) >= 626349397L ) 
      if ( watchcoefs ) 
      {
	mem [ qq ] .hhfield .b0 = 0 ; 
	fixneeded = true ; 
      } 
      mem [ r ] .hhfield .v.RH = s ; 
      r = s ; 
    } 
    q = mem [ q ] .hhfield .v.RH ; 
    qq = mem [ q ] .hhfield .lhfield ; 
  } 
  else if ( mem [ pp + 1 ] .cint < mem [ qq + 1 ] .cint ) 
  {
    s = getnode ( 2 ) ; 
    mem [ s ] .hhfield .lhfield = qq ; 
    mem [ s + 1 ] .cint = mem [ q + 1 ] .cint ; 
    q = mem [ q ] .hhfield .v.RH ; 
    qq = mem [ q ] .hhfield .lhfield ; 
    mem [ r ] .hhfield .v.RH = s ; 
    r = s ; 
  } 
  else {
      
    mem [ r ] .hhfield .v.RH = p ; 
    r = p ; 
    p = mem [ p ] .hhfield .v.RH ; 
    pp = mem [ p ] .hhfield .lhfield ; 
  } 
  lab30: mem [ p + 1 ] .cint = slowadd ( mem [ p + 1 ] .cint , mem [ q + 1 ] .cint ) ; 
  mem [ r ] .hhfield .v.RH = p ; 
  depfinal = p ; 
  Result = mem [ memtop - 1 ] .hhfield .v.RH ; 
  return(Result) ; 
} 
halfword zptimesv ( p , v , t0 , t1 , visscaled ) 
halfword p ; 
integer v ; 
smallnumber t0 ; 
smallnumber t1 ; 
boolean visscaled ; 
{register halfword Result; halfword r, s  ; 
  integer w  ; 
  integer threshold  ; 
  boolean scalingdown  ; 
  if ( t0 != t1 ) 
  scalingdown = true ; 
  else scalingdown = ! visscaled ; 
  if ( t1 == 17 ) 
  threshold = 1342 ; 
  else threshold = 4 ; 
  r = memtop - 1 ; 
  while ( mem [ p ] .hhfield .lhfield != 0 ) {
      
    if ( scalingdown ) 
    w = takefraction ( v , mem [ p + 1 ] .cint ) ; 
    else w = takescaled ( v , mem [ p + 1 ] .cint ) ; 
    if ( abs ( w ) <= threshold ) 
    {
      s = mem [ p ] .hhfield .v.RH ; 
      freenode ( p , 2 ) ; 
      p = s ; 
    } 
    else {
	
      if ( abs ( w ) >= 626349397L ) 
      {
	fixneeded = true ; 
	mem [ mem [ p ] .hhfield .lhfield ] .hhfield .b0 = 0 ; 
      } 
      mem [ r ] .hhfield .v.RH = p ; 
      r = p ; 
      mem [ p + 1 ] .cint = w ; 
      p = mem [ p ] .hhfield .v.RH ; 
    } 
  } 
  mem [ r ] .hhfield .v.RH = p ; 
  if ( visscaled ) 
  mem [ p + 1 ] .cint = takescaled ( mem [ p + 1 ] .cint , v ) ; 
  else mem [ p + 1 ] .cint = takefraction ( mem [ p + 1 ] .cint , v ) ; 
  Result = mem [ memtop - 1 ] .hhfield .v.RH ; 
  return(Result) ; 
} 
halfword zpwithxbecomingq ( p , x , q , t ) 
halfword p ; 
halfword x ; 
halfword q ; 
smallnumber t ; 
{register halfword Result; halfword r, s  ; 
  integer v  ; 
  integer sx  ; 
  s = p ; 
  r = memtop - 1 ; 
  sx = mem [ x + 1 ] .cint ; 
  while ( mem [ mem [ s ] .hhfield .lhfield + 1 ] .cint > sx ) {
      
    r = s ; 
    s = mem [ s ] .hhfield .v.RH ; 
  } 
  if ( mem [ s ] .hhfield .lhfield != x ) 
  Result = p ; 
  else {
      
    mem [ memtop - 1 ] .hhfield .v.RH = p ; 
    mem [ r ] .hhfield .v.RH = mem [ s ] .hhfield .v.RH ; 
    v = mem [ s + 1 ] .cint ; 
    freenode ( s , 2 ) ; 
    Result = pplusfq ( mem [ memtop - 1 ] .hhfield .v.RH , v , q , t , 17 ) ; 
  } 
  return(Result) ; 
} 
void znewdep ( q , p ) 
halfword q ; 
halfword p ; 
{halfword r  ; 
  mem [ q + 1 ] .hhfield .v.RH = p ; 
  mem [ q + 1 ] .hhfield .lhfield = 5 ; 
  r = mem [ 5 ] .hhfield .v.RH ; 
  mem [ depfinal ] .hhfield .v.RH = r ; 
  mem [ r + 1 ] .hhfield .lhfield = depfinal ; 
  mem [ 5 ] .hhfield .v.RH = q ; 
} 
halfword zconstdependency ( v ) 
scaled v ; 
{register halfword Result; depfinal = getnode ( 2 ) ; 
  mem [ depfinal + 1 ] .cint = v ; 
  mem [ depfinal ] .hhfield .lhfield = 0 ; 
  Result = depfinal ; 
  return(Result) ; 
} 
halfword zsingledependency ( p ) 
halfword p ; 
{register halfword Result; halfword q  ; 
  integer m  ; 
  m = mem [ p + 1 ] .cint % 64 ; 
  if ( m > 28 ) 
  Result = constdependency ( 0 ) ; 
  else {
      
    q = getnode ( 2 ) ; 
    mem [ q + 1 ] .cint = twotothe [ 28 - m ] ; 
    mem [ q ] .hhfield .lhfield = p ; 
    mem [ q ] .hhfield .v.RH = constdependency ( 0 ) ; 
    Result = q ; 
  } 
  return(Result) ; 
} 
halfword zcopydeplist ( p ) 
halfword p ; 
{/* 30 */ register halfword Result; halfword q  ; 
  q = getnode ( 2 ) ; 
  depfinal = q ; 
  while ( true ) {
      
    mem [ depfinal ] .hhfield .lhfield = mem [ p ] .hhfield .lhfield ; 
    mem [ depfinal + 1 ] .cint = mem [ p + 1 ] .cint ; 
    if ( mem [ depfinal ] .hhfield .lhfield == 0 ) 
    goto lab30 ; 
    mem [ depfinal ] .hhfield .v.RH = getnode ( 2 ) ; 
    depfinal = mem [ depfinal ] .hhfield .v.RH ; 
    p = mem [ p ] .hhfield .v.RH ; 
  } 
  lab30: Result = q ; 
  return(Result) ; 
} 
void zlineareq ( p , t ) 
halfword p ; 
smallnumber t ; 
{halfword q, r, s  ; 
  halfword x  ; 
  integer n  ; 
  integer v  ; 
  halfword prevr  ; 
  halfword finalnode  ; 
  integer w  ; 
  q = p ; 
  r = mem [ p ] .hhfield .v.RH ; 
  v = mem [ q + 1 ] .cint ; 
  while ( mem [ r ] .hhfield .lhfield != 0 ) {
      
    if ( abs ( mem [ r + 1 ] .cint ) > abs ( v ) ) 
    {
      q = r ; 
      v = mem [ r + 1 ] .cint ; 
    } 
    r = mem [ r ] .hhfield .v.RH ; 
  } 
  x = mem [ q ] .hhfield .lhfield ; 
  n = mem [ x + 1 ] .cint % 64 ; 
  s = memtop - 1 ; 
  mem [ s ] .hhfield .v.RH = p ; 
  r = p ; 
  do {
      if ( r == q ) 
    {
      mem [ s ] .hhfield .v.RH = mem [ r ] .hhfield .v.RH ; 
      freenode ( r , 2 ) ; 
    } 
    else {
	
      w = makefraction ( mem [ r + 1 ] .cint , v ) ; 
      if ( abs ( w ) <= 1342 ) 
      {
	mem [ s ] .hhfield .v.RH = mem [ r ] .hhfield .v.RH ; 
	freenode ( r , 2 ) ; 
      } 
      else {
	  
	mem [ r + 1 ] .cint = - (integer) w ; 
	s = r ; 
      } 
    } 
    r = mem [ s ] .hhfield .v.RH ; 
  } while ( ! ( mem [ r ] .hhfield .lhfield == 0 ) ) ; 
  if ( t == 18 ) 
  mem [ r + 1 ] .cint = - (integer) makescaled ( mem [ r + 1 ] .cint , v ) ; 
  else if ( v != -268435456L ) 
  mem [ r + 1 ] .cint = - (integer) makefraction ( mem [ r + 1 ] .cint , v ) ; 
  finalnode = r ; 
  p = mem [ memtop - 1 ] .hhfield .v.RH ; 
  if ( internal [ 2 ] > 0 ) 
  if ( interesting ( x ) ) 
  {
    begindiagnostic () ; 
    printnl ( 608 ) ; 
    printvariablename ( x ) ; 
    w = n ; 
    while ( w > 0 ) {
	
      print ( 601 ) ; 
      w = w - 2 ; 
    } 
    printchar ( 61 ) ; 
    printdependency ( p , 17 ) ; 
    enddiagnostic ( false ) ; 
  } 
  prevr = 5 ; 
  r = mem [ 5 ] .hhfield .v.RH ; 
  while ( r != 5 ) {
      
    s = mem [ r + 1 ] .hhfield .v.RH ; 
    q = pwithxbecomingq ( s , x , p , mem [ r ] .hhfield .b0 ) ; 
    if ( mem [ q ] .hhfield .lhfield == 0 ) 
    makeknown ( r , q ) ; 
    else {
	
      mem [ r + 1 ] .hhfield .v.RH = q ; 
      do {
	  q = mem [ q ] .hhfield .v.RH ; 
      } while ( ! ( mem [ q ] .hhfield .lhfield == 0 ) ) ; 
      prevr = q ; 
    } 
    r = mem [ prevr ] .hhfield .v.RH ; 
  } 
  if ( n > 0 ) 
  {
    s = memtop - 1 ; 
    mem [ memtop - 1 ] .hhfield .v.RH = p ; 
    r = p ; 
    do {
	if ( n > 30 ) 
      w = 0 ; 
      else w = mem [ r + 1 ] .cint / twotothe [ n ] ; 
      if ( ( abs ( w ) <= 1342 ) && ( mem [ r ] .hhfield .lhfield != 0 ) ) 
      {
	mem [ s ] .hhfield .v.RH = mem [ r ] .hhfield .v.RH ; 
	freenode ( r , 2 ) ; 
      } 
      else {
	  
	mem [ r + 1 ] .cint = w ; 
	s = r ; 
      } 
      r = mem [ s ] .hhfield .v.RH ; 
    } while ( ! ( mem [ s ] .hhfield .lhfield == 0 ) ) ; 
    p = mem [ memtop - 1 ] .hhfield .v.RH ; 
  } 
  if ( mem [ p ] .hhfield .lhfield == 0 ) 
  {
    mem [ x ] .hhfield .b0 = 16 ; 
    mem [ x + 1 ] .cint = mem [ p + 1 ] .cint ; 
    if ( abs ( mem [ x + 1 ] .cint ) >= 268435456L ) 
    valtoobig ( mem [ x + 1 ] .cint ) ; 
    freenode ( p , 2 ) ; 
    if ( curexp == x ) 
    if ( curtype == 19 ) 
    {
      curexp = mem [ x + 1 ] .cint ; 
      curtype = 16 ; 
      freenode ( x , 2 ) ; 
    } 
  } 
  else {
      
    mem [ x ] .hhfield .b0 = 17 ; 
    depfinal = finalnode ; 
    newdep ( x , p ) ; 
    if ( curexp == x ) 
    if ( curtype == 19 ) 
    curtype = 17 ; 
  } 
  if ( fixneeded ) 
  fixdependencies () ; 
} 
halfword znewringentry ( p ) 
halfword p ; 
{register halfword Result; halfword q  ; 
  q = getnode ( 2 ) ; 
  mem [ q ] .hhfield .b1 = 14 ; 
  mem [ q ] .hhfield .b0 = mem [ p ] .hhfield .b0 ; 
  if ( mem [ p + 1 ] .cint == 0 ) 
  mem [ q + 1 ] .cint = p ; 
  else mem [ q + 1 ] .cint = mem [ p + 1 ] .cint ; 
  mem [ p + 1 ] .cint = q ; 
  Result = q ; 
  return(Result) ; 
} 
void znonlineareq ( v , p , flushp ) 
integer v ; 
halfword p ; 
boolean flushp ; 
{smallnumber t  ; 
  halfword q, r  ; 
  t = mem [ p ] .hhfield .b0 - 1 ; 
  q = mem [ p + 1 ] .cint ; 
  if ( flushp ) 
  mem [ p ] .hhfield .b0 = 1 ; 
  else p = q ; 
  do {
      r = mem [ q + 1 ] .cint ; 
    mem [ q ] .hhfield .b0 = t ; 
    switch ( t ) 
    {case 2 : 
      mem [ q + 1 ] .cint = v ; 
      break ; 
    case 4 : 
      {
	mem [ q + 1 ] .cint = v ; 
	{
	  if ( strref [ v ] < 127 ) 
	  incr ( strref [ v ] ) ; 
	} 
      } 
      break ; 
    case 6 : 
      mem [ q + 1 ] .cint = makepen ( copypath ( v ) , false ) ; 
      break ; 
    case 8 : 
      mem [ q + 1 ] .cint = copypath ( v ) ; 
      break ; 
    case 10 : 
      {
	mem [ q + 1 ] .cint = v ; 
	incr ( mem [ v ] .hhfield .lhfield ) ; 
      } 
      break ; 
    } 
    q = r ; 
  } while ( ! ( q == p ) ) ; 
} 
void zringmerge ( p , q ) 
halfword p ; 
halfword q ; 
{/* 10 */ halfword r  ; 
  r = mem [ p + 1 ] .cint ; 
  while ( r != p ) {
      
    if ( r == q ) 
    {
      {
	{
	  if ( interaction == 3 ) 
	  ; 
	  printnl ( 263 ) ; 
	  print ( 611 ) ; 
	} 
	{
	  helpptr = 2 ; 
	  helpline [ 1 ] = 612 ; 
	  helpline [ 0 ] = 613 ; 
	} 
	putgeterror () ; 
      } 
      goto lab10 ; 
    } 
    r = mem [ r + 1 ] .cint ; 
  } 
  r = mem [ p + 1 ] .cint ; 
  mem [ p + 1 ] .cint = mem [ q + 1 ] .cint ; 
  mem [ q + 1 ] .cint = r ; 
  lab10: ; 
} 
void zshowcmdmod ( c , m ) 
integer c ; 
integer m ; 
{begindiagnostic () ; 
  printnl ( 123 ) ; 
  printcmdmod ( c , m ) ; 
  printchar ( 125 ) ; 
  enddiagnostic ( false ) ; 
} 
void showcontext ( ) 
{/* 30 */ char oldsetting  ; 
  integer i  ; 
  integer l  ; 
  integer m  ; 
  integer n  ; 
  integer p  ; 
  integer q  ; 
  fileptr = inputptr ; 
  inputstack [ fileptr ] = curinput ; 
  while ( true ) {
      
    curinput = inputstack [ fileptr ] ; 
    if ( ( fileptr == inputptr ) || ( curinput .indexfield <= 15 ) || ( 
    curinput .indexfield != 19 ) || ( curinput .locfield != 0 ) ) 
    {
      tally = 0 ; 
      oldsetting = selector ; 
      if ( ( curinput .indexfield <= 15 ) ) 
      {
	if ( curinput .namefield > 2 ) 
	{
	  printnl ( 615 ) ; 
	  printint ( trueline () ) ; 
	} 
	else if ( ( curinput .namefield == 0 ) ) 
	if ( fileptr == 0 ) 
	printnl ( 616 ) ; 
	else printnl ( 617 ) ; 
	else if ( curinput .namefield == 2 ) 
	printnl ( 618 ) ; 
	else printnl ( 619 ) ; 
	printchar ( 32 ) ; 
	{
	  l = tally ; 
	  tally = 0 ; 
	  selector = 9 ; 
	  trickcount = 1000000L ; 
	} 
	if ( curinput .limitfield > 0 ) 
	{register integer for_end; i = curinput .startfield ; for_end = 
	curinput .limitfield - 1 ; if ( i <= for_end) do 
	  {
	    if ( i == curinput .locfield ) 
	    {
	      firstcount = tally ; 
	      trickcount = tally + 1 + errorline - halferrorline ; 
	      if ( trickcount < errorline ) 
	      trickcount = errorline ; 
	    } 
	    print ( buffer [ i ] ) ; 
	  } 
	while ( i++ < for_end ) ; } 
      } 
      else {
	  
	switch ( curinput .indexfield ) 
	{case 16 : 
	  printnl ( 620 ) ; 
	  break ; 
	case 17 : 
	  {
	    printnl ( 625 ) ; 
	    p = paramstack [ curinput .limitfield ] ; 
	    if ( p != 0 ) 
	    if ( mem [ p ] .hhfield .v.RH == 1 ) 
	    printexp ( p , 0 ) ; 
	    else showtokenlist ( p , 0 , 20 , tally ) ; 
	    print ( 626 ) ; 
	  } 
	  break ; 
	case 18 : 
	  printnl ( 621 ) ; 
	  break ; 
	case 19 : 
	  if ( curinput .locfield == 0 ) 
	  printnl ( 622 ) ; 
	  else printnl ( 623 ) ; 
	  break ; 
	case 20 : 
	  printnl ( 624 ) ; 
	  break ; 
	case 21 : 
	  {
	    println () ; 
	    if ( curinput .namefield != 0 ) 
	    print ( hash [ curinput .namefield ] .v.RH ) ; 
	    else {
		
	      p = paramstack [ curinput .limitfield ] ; 
	      if ( p == 0 ) 
	      showtokenlist ( paramstack [ curinput .limitfield + 1 ] , 0 , 20 
	      , tally ) ; 
	      else {
		  
		q = p ; 
		while ( mem [ q ] .hhfield .v.RH != 0 ) q = mem [ q ] .hhfield .v.RH ; 
		mem [ q ] .hhfield .v.RH = paramstack [ curinput .limitfield + 
		1 ] ; 
		showtokenlist ( p , 0 , 20 , tally ) ; 
		mem [ q ] .hhfield .v.RH = 0 ; 
	      } 
	    } 
	    print ( 513 ) ; 
	  } 
	  break ; 
	  default: 
	  printnl ( 63 ) ; 
	  break ; 
	} 
	{
	  l = tally ; 
	  tally = 0 ; 
	  selector = 9 ; 
	  trickcount = 1000000L ; 
	} 
	if ( curinput .indexfield != 21 ) 
	showtokenlist ( curinput .startfield , curinput .locfield , 100000L ,	0 ) ; 
	else showmacro ( curinput .startfield , curinput .locfield , 100000L ) 
	; 
      } 
      selector = oldsetting ; 
      if ( trickcount == 1000000L ) 
      {
	firstcount = tally ; 
	trickcount = tally + 1 + errorline - halferrorline ; 
	if ( trickcount < errorline ) 
	trickcount = errorline ; 
      } 
      if ( tally < trickcount ) 
      m = tally - firstcount ; 
      else m = trickcount - firstcount ; 
      if ( l + firstcount <= halferrorline ) 
      {
	p = 0 ; 
	n = l + firstcount ; 
      } 
      else {
	  
	print ( 276 ) ; 
	p = l + firstcount - halferrorline + 3 ; 
	n = halferrorline ; 
      } 
      {register integer for_end; q = p ; for_end = firstcount - 1 ; if ( q <= 
      for_end) do 
	printchar ( trickbuf [ q % errorline ] ) ; 
      while ( q++ < for_end ) ; } 
      println () ; 
      {register integer for_end; q = 1 ; for_end = n ; if ( q <= for_end) do 
	printchar ( 32 ) ; 
      while ( q++ < for_end ) ; } 
      if ( m + n <= errorline ) 
      p = firstcount + m ; 
      else p = firstcount + ( errorline - n - 3 ) ; 
      {register integer for_end; q = firstcount ; for_end = p - 1 ; if ( q <= 
      for_end) do 
	printchar ( trickbuf [ q % errorline ] ) ; 
      while ( q++ < for_end ) ; } 
      if ( m + n > errorline ) 
      print ( 276 ) ; 
    } 
    if ( ( curinput .indexfield <= 15 ) ) 
    if ( ( curinput .namefield > 2 ) || ( fileptr == 0 ) ) 
    goto lab30 ; 
    decr ( fileptr ) ; 
  } 
  lab30: curinput = inputstack [ inputptr ] ; 
} 
void zbegintokenlist ( p , t ) 
halfword p ; 
quarterword t ; 
{{
    
    if ( inputptr > maxinstack ) 
    {
      maxinstack = inputptr ; 
      if ( inputptr == stacksize ) 
      overflow ( 627 , stacksize ) ; 
    } 
    inputstack [ inputptr ] = curinput ; 
    incr ( inputptr ) ; 
  } 
  curinput .startfield = p ; 
  curinput .indexfield = t ; 
  curinput .limitfield = paramptr ; 
  curinput .locfield = p ; 
} 
void endtokenlist ( ) 
{/* 30 */ halfword p  ; 
  if ( curinput .indexfield >= 19 ) 
  if ( curinput .indexfield <= 20 ) 
  {
    flushtokenlist ( curinput .startfield ) ; 
    goto lab30 ; 
  } 
  else deletemacref ( curinput .startfield ) ; 
  while ( paramptr > curinput .limitfield ) {
      
    decr ( paramptr ) ; 
    p = paramstack [ paramptr ] ; 
    if ( p != 0 ) 
    if ( mem [ p ] .hhfield .v.RH == 1 ) 
    {
      recyclevalue ( p ) ; 
      freenode ( p , 2 ) ; 
    } 
    else flushtokenlist ( p ) ; 
  } 
  lab30: {
      
    decr ( inputptr ) ; 
    curinput = inputstack [ inputptr ] ; 
  } 
  {
    if ( interrupt != 0 ) 
    pauseforinstructions () ; 
  } 
} 
void zencapsulate ( p ) 
halfword p ; 
{curexp = getnode ( 2 ) ; 
  mem [ curexp ] .hhfield .b0 = curtype ; 
  mem [ curexp ] .hhfield .b1 = 14 ; 
  newdep ( curexp , p ) ; 
} 
void zinstall ( r , q ) 
halfword r ; 
halfword q ; 
{halfword p  ; 
  if ( mem [ q ] .hhfield .b0 == 16 ) 
  {
    mem [ r + 1 ] .cint = mem [ q + 1 ] .cint ; 
    mem [ r ] .hhfield .b0 = 16 ; 
  } 
  else if ( mem [ q ] .hhfield .b0 == 19 ) 
  {
    p = singledependency ( q ) ; 
    if ( p == depfinal ) 
    {
      mem [ r ] .hhfield .b0 = 16 ; 
      mem [ r + 1 ] .cint = 0 ; 
      freenode ( p , 2 ) ; 
    } 
    else {
	
      mem [ r ] .hhfield .b0 = 17 ; 
      newdep ( r , p ) ; 
    } 
  } 
  else {
      
    mem [ r ] .hhfield .b0 = mem [ q ] .hhfield .b0 ; 
    newdep ( r , copydeplist ( mem [ q + 1 ] .hhfield .v.RH ) ) ; 
  } 
} 
void zmakeexpcopy ( p ) 
halfword p ; 
{/* 20 */ halfword q, r, t  ; 
  lab20: curtype = mem [ p ] .hhfield .b0 ; 
  switch ( curtype ) 
  {case 1 : 
  case 2 : 
  case 16 : 
    curexp = mem [ p + 1 ] .cint ; 
    break ; 
  case 3 : 
  case 5 : 
  case 7 : 
  case 11 : 
  case 9 : 
    curexp = newringentry ( p ) ; 
    break ; 
  case 4 : 
    {
      curexp = mem [ p + 1 ] .cint ; 
      {
	if ( strref [ curexp ] < 127 ) 
	incr ( strref [ curexp ] ) ; 
      } 
    } 
    break ; 
  case 10 : 
    {
      curexp = mem [ p + 1 ] .cint ; 
      incr ( mem [ curexp ] .hhfield .lhfield ) ; 
    } 
    break ; 
  case 6 : 
    curexp = makepen ( copypath ( mem [ p + 1 ] .cint ) , false ) ; 
    break ; 
  case 8 : 
    curexp = copypath ( mem [ p + 1 ] .cint ) ; 
    break ; 
  case 12 : 
  case 13 : 
  case 14 : 
    {
      if ( mem [ p + 1 ] .cint == 0 ) 
      initbignode ( p ) ; 
      t = getnode ( 2 ) ; 
      mem [ t ] .hhfield .b1 = 14 ; 
      mem [ t ] .hhfield .b0 = curtype ; 
      initbignode ( t ) ; 
      q = mem [ p + 1 ] .cint + bignodesize [ curtype ] ; 
      r = mem [ t + 1 ] .cint + bignodesize [ curtype ] ; 
      do {
	  q = q - 2 ; 
	r = r - 2 ; 
	install ( r , q ) ; 
      } while ( ! ( q == mem [ p + 1 ] .cint ) ) ; 
      curexp = t ; 
    } 
    break ; 
  case 17 : 
  case 18 : 
    encapsulate ( copydeplist ( mem [ p + 1 ] .hhfield .v.RH ) ) ; 
    break ; 
  case 15 : 
    {
      {
	mem [ p ] .hhfield .b0 = 19 ; 
	serialno = serialno + 64 ; 
	mem [ p + 1 ] .cint = serialno ; 
      } 
      goto lab20 ; 
    } 
    break ; 
  case 19 : 
    {
      q = singledependency ( p ) ; 
      if ( q == depfinal ) 
      {
	curtype = 16 ; 
	curexp = 0 ; 
	freenode ( q , 2 ) ; 
      } 
      else {
	  
	curtype = 17 ; 
	encapsulate ( q ) ; 
      } 
    } 
    break ; 
    default: 
    confusion ( 851 ) ; 
    break ; 
  } 
}