#include "chdecl.h"
void CH_cache_programcache(current, sched, cop)
#define ARGUMENTS 6
#include "chhead.h"
select: switch (SELECTOR) {
    case 0: goto c0;
    case 1: goto cb1;
    case 2: goto c2;
    case 3: goto cb14;
    case 4: goto c15;
    case 7: goto c16;
    case 5: goto c18;
    case 6: goto cb18;
    case 8: goto c20;
    case 9: goto cb21;
    case 10: goto c22;
    case 11: goto c29;
    case 12: goto cb31;
    case 13: goto c32;
    case 14: goto c36;
    case 15: goto c39;
    case 16: goto c42;
    case 17: goto cb43;
    case 18: goto c44;
    case 19: goto cb47;
    case 20: goto c48;
    case 21: goto cb51;
    case 22: goto c52;
    case 23: goto c54;
    case 24: goto cb58;
    case 25: goto c59;
    case 26: goto cb60;
    case 27: goto c61;
    case 28: goto cb64;
    case 29: goto c65;
    case 30: goto c68;
    case 31: goto c70;
    case 32: goto c72;
    case 33: goto c73;
    case 34: goto c74;
    case 35: goto c77;
    case 36: goto cb81;
    case 37: goto c82;
    case 38: goto cb83;
    case 39: goto c84;
    case 40: goto cb87;
    case 41: goto c88;
    case 42: goto c91;
    case 43: goto c93;
    case 44: goto c95;
    case 45: goto c96;
    case 46: goto c99;
    case 47: goto c101;  }
c0:
/* block , 0 */
  if((ch_returncode = che_block(QUAL(0),sched)) != Normal)
     goto ch_raise_exception;
  current->ip = 1;
cb1:
/* receive 3 0 */
  if ((ch_returncode = che_receive(DEF(3),DEF(0),sched)) != Normal)
     goto ch_raise_exception;
  return;
c2:
/* copy 4 3.0 */
  if((ch_returncode = cp_outport(& ch_val, REF(3)DOT(0).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(4).tsdr)->finalize)(REF(4).value,F_DISCARD,sched);
  REF(4).value = ch_val;
  REF(4).tsdr = & dr_outport;
/* copy 5 3.1 */
  if((ch_returncode = cp_outport(& ch_val, REF(3)DOT(1).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(5).tsdr)->finalize)(REF(5).value,F_DISCARD,sched);
  REF(5).value = ch_val;
  REF(5).tsdr = & dr_outport;
/* copy 6 3.2 */
  if((ch_returncode = cp_outport(& ch_val, REF(3)DOT(2).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(6).tsdr)->finalize)(REF(6).value,F_DISCARD,sched);
  REF(6).value = ch_val;
  REF(6).tsdr = & dr_outport;
/* new_inport 7 */
  if ((ch_val.inport = make_inport()) == nil) goto ch_depletion;
  (*(REF(7).tsdr)->finalize)(REF(7).value,F_DISCARD,sched);
  REF(7).value = ch_val; REF(7).tsdr = & dr_inport;
/* connect 3.0 7 */
  if (REF(7).value.inport->refcount == MAXCOUNTER) goto ch_depletion;
  (*(REF(3)DOT(0).tsdr)->finalize)(REF(3)DOT(0).value,F_DISCARD,sched);
  REF(7).value.inport->refcount++;
  REF(3)DOT(0).value.outport = REF(7).value.inport;
  REF(3)DOT(0).tsdr = & dr_outport;
/* new_inport 8 */
  if ((ch_val.inport = make_inport()) == nil) goto ch_depletion;
  (*(REF(8).tsdr)->finalize)(REF(8).value,F_DISCARD,sched);
  REF(8).value = ch_val; REF(8).tsdr = & dr_inport;
/* connect 3.1 8 */
  if (REF(8).value.inport->refcount == MAXCOUNTER) goto ch_depletion;
  (*(REF(3)DOT(1).tsdr)->finalize)(REF(3)DOT(1).value,F_DISCARD,sched);
  REF(8).value.inport->refcount++;
  REF(3)DOT(1).value.outport = REF(8).value.inport;
  REF(3)DOT(1).tsdr = & dr_outport;
/* return 3 */
  if (ch_caller = do_return(REF(3).value)) {
    if (ch_caller->type < CProcess) ch_caller->ip++;
      sched->wakeup_proc(sched, ch_caller);}
  else rem_return(REF(3).value);
  REF(3).tsdr = & dr_bottom;
/* prog_lit 9 , 1 */
  if ((ch_returncode = che_prog_lit(DEF(9),QUAL(1),sched)) != Normal) 
     goto ch_raise_exception;
/* create 10 9 , 2 */
  if ((ch_returncode = che_create(DEF(10),DEF(9),QUAL(2),sched)) != Normal)
     goto ch_raise_exception;
/* discard 9 */
  (*(REF(9).tsdr)->finalize)(REF(9).value,F_DISCARD,sched);
  REF(9).tsdr = & dr_bottom;
/* move 11 10 */
  (*(REF(11).tsdr)->finalize)(REF(11).value,F_DISCARD,sched);
  REF(11) = REF(10);
  REF(10).tsdr = & dr_bottom;
  current->ip = 3;
cb14:
/* call 11 12 , 3 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(11),
          arguments[1] = DEF(12),
          arguments[1+1] = nil,& arguments[0]),QUAL(3),sched)) != Normal)
     goto ch_raise_exception;
  return;
c15:
/* new_table 13 , 4 */
  if ((ch_returncode = che_new_table(DEF(13),QUAL(4),sched)) != Normal) 
     goto ch_raise_exception;
c19:
c16:
/* noop */
  
c18:
  current->ip = 6;
cb18:
/* select 8 * 7 * , 5 */
  if ((ch_returncode = che_select((
          arguments[0] = DEF(8),
          arguments[1] = NO_OBJECT,
          arguments[2] = DEF(7),
          arguments[3] = NO_OBJECT,
          arguments[3+1] = nil,& arguments[0]),QUAL(5),sched)) != Normal)
     goto ch_raise_exception;
  if (current->ip == 6) return; else COMPUTE_TARGET;
c20:
/* block , 6 */
  if((ch_returncode = che_block(QUAL(6),sched)) != Normal)
     goto ch_raise_exception;
  current->ip = 9;
cb21:
/* receive 14 8 */
  if ((ch_returncode = che_receive(DEF(14),DEF(8),sched)) != Normal)
     goto ch_raise_exception;
  return;
c22:
/* block , 7 */
  if((ch_returncode = che_block(QUAL(7),sched)) != Normal)
     goto ch_raise_exception;
/* privatize 13 */
  if (REF(13).value.table->refcount != 1)
    if ((ch_returncode = doCopyOnWrite(DEF(13))) != Normal)
       goto ch_raise_exception;
/* find 15 13 14.0 , 0 */
  if (findfunc(DEF(15),DEF(13),(
          arguments[0] = DEF(14)DOT(0),& arguments[0]),sched,0) == FAILURE)
             goto ch_notfound;
/* fremove 16 15 13 , 0 */
  if ((ch_returncode = removefunc(DEF(16),DEF(15),DEF(13),sched,0
    ,NO_TBL,(position *) nil)) != Normal) goto ch_raise_exception;
/* discard 16.2 */
  (*(REF(16)DOT(2).tsdr)->finalize)(REF(16)DOT(2).value,F_DISCARD,sched);
  REF(16)DOT(2).tsdr = & dr_bottom;
/* endblock */
  che_endblock(sched);
/* branch , 31 */
   goto c31;
c29:
/* new_record 16 , 3 */
  if ((ch_val.record = new_record(3)) == nil) goto ch_depletion;
  (*(REF(16).tsdr)->finalize)(REF(16).value,F_DISCARD,sched);
  REF(16).value = ch_val; REF(16).tsdr = & dr_record;
/* copy 16.0 14.0 */
  if((ch_returncode = (REF(14)DOT(0).tsdr->copy)(& ch_val, REF(14)DOT(0).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(16)DOT(0).tsdr)->finalize)(REF(16)DOT(0).value,F_DISCARD,sched);
  REF(16)DOT(0).value = ch_val;
  REF(16)DOT(0).tsdr = datarepmap[REF(14)DOT(0).tsdr->number];
c31:
  current->ip = 12;
cb31:
/* call 5 16.0 14.1 , 8 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(5),
          arguments[1] = DEF(16)DOT(0),
          arguments[2] = DEF(14)DOT(1),
          arguments[2+1] = nil,& arguments[0]),QUAL(8),sched)) != Normal)
     goto ch_raise_exception;
  return;
c32:
/* discard 16 */
  (*(REF(16).tsdr)->finalize)(REF(16).value,F_DISCARD,sched);
  REF(16).tsdr = & dr_bottom;
/* return 14 */
  if (ch_caller = do_return(REF(14).value)) {
    if (ch_caller->type < CProcess) ch_caller->ip++;
      sched->wakeup_proc(sched, ch_caller);}
  else rem_return(REF(14).value);
  REF(14).tsdr = & dr_bottom;
/* endblock */
  che_endblock(sched);
/* branch , 16 */
   goto c16;
c36:
/* discard 16 */
  (*(REF(16).tsdr)->finalize)(REF(16).value,F_DISCARD,sched);
  REF(16).tsdr = & dr_bottom;
/* return_exception 14 , 9 */
  if (ch_caller = do_return(REF(14).value)) {
    raise_user(QUAL(9),ch_caller); 
    sched->wakeup_proc(sched,ch_caller);}
  else rem_return_exception(DEF(14),QUAL(9));
  REF(14).tsdr = & dr_bottom;
/* branch , 16 */
   goto c16;
c39:
/* discard 16 */
  (*(REF(16).tsdr)->finalize)(REF(16).value,F_DISCARD,sched);
  REF(16).tsdr = & dr_bottom;
/* return_exception 14 , 9 */
  if (ch_caller = do_return(REF(14).value)) {
    raise_user(QUAL(9),ch_caller); 
    sched->wakeup_proc(sched,ch_caller);}
  else rem_return_exception(DEF(14),QUAL(9));
  REF(14).tsdr = & dr_bottom;
/* branch , 16 */
   goto c16;
c42:
/* block , 10 */
  if((ch_returncode = che_block(QUAL(10),sched)) != Normal)
     goto ch_raise_exception;
  current->ip = 17;
cb43:
/* receive 17 7 */
  if ((ch_returncode = che_receive(DEF(17),DEF(7),sched)) != Normal)
     goto ch_raise_exception;
  return;
c44:
/* find 18 13 17.0 , 0 */
  if (findfunc(DEF(18),DEF(13),(
          arguments[0] = DEF(17)DOT(0),& arguments[0]),sched,0) == FAILURE)
             goto ch_notfound;
/* copy 19 18 */
  if((ch_returncode = cp_record(& ch_val, REF(18).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(19).tsdr)->finalize)(REF(19).value,F_DISCARD,sched);
  REF(19).value = ch_val;
  REF(19).tsdr = & dr_record;
  current->ip = 19;
cb47:
/* call 6 19.0 20 , 11 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(6),
          arguments[1] = DEF(19)DOT(0),
          arguments[2] = DEF(20),
          arguments[2+1] = nil,& arguments[0]),QUAL(11),sched)) != Normal)
     goto ch_raise_exception;
  return;
c48:
/* notequal . 19.1 20 , 54 */
  if ( !(REF(19)DOT(1).tsdr->equal)(REF(19)DOT(1).value,REF(20).value) )
     goto c54;
/* move 17.1 19.2 */
  (*(REF(17)DOT(1).tsdr)->finalize)(REF(17)DOT(1).value,F_DISCARD,sched);
  REF(17)DOT(1) = REF(19)DOT(2);
  REF(19)DOT(2).tsdr = & dr_bottom;
  current->ip = 21;
cb51:
/* call 12 17.1 , 12 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(12),
          arguments[1] = DEF(17)DOT(1),
          arguments[1+1] = nil,& arguments[0]),QUAL(12),sched)) != Normal)
     goto ch_raise_exception;
  return;
c52:
/* return 17 */
  if (ch_caller = do_return(REF(17).value)) {
    if (ch_caller->type < CProcess) ch_caller->ip++;
      sched->wakeup_proc(sched, ch_caller);}
  else rem_return(REF(17).value);
  REF(17).tsdr = & dr_bottom;
/* branch , 74 */
   goto c74;
c54:
/* block , 13 */
  if((ch_returncode = che_block(QUAL(13),sched)) != Normal)
     goto ch_raise_exception;
/* privatize 13 */
  if (REF(13).value.table->refcount != 1)
    if ((ch_returncode = doCopyOnWrite(DEF(13))) != Normal)
       goto ch_raise_exception;
/* find 21 13 17.0 , 0 */
  if (findfunc(DEF(21),DEF(13),(
          arguments[0] = DEF(17)DOT(0),& arguments[0]),sched,0) == FAILURE)
             goto ch_notfound;
/* fremove 19 21 13 , 0 */
  if ((ch_returncode = removefunc(DEF(19),DEF(21),DEF(13),sched,0
    ,NO_TBL,(position *) nil)) != Normal) goto ch_raise_exception;
  current->ip = 24;
cb58:
/* call 6 19.0 22 , 11 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(6),
          arguments[1] = DEF(19)DOT(0),
          arguments[2] = DEF(22),
          arguments[2+1] = nil,& arguments[0]),QUAL(11),sched)) != Normal)
     goto ch_raise_exception;
  return;
c59:
/* move 19.1 22 */
  (*(REF(19)DOT(1).tsdr)->finalize)(REF(19)DOT(1).value,F_DISCARD,sched);
  REF(19)DOT(1) = REF(22);
  REF(22).tsdr = & dr_bottom;
  current->ip = 26;
cb60:
/* call 4 19.0 23 , 14 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(4),
          arguments[1] = DEF(19)DOT(0),
          arguments[2] = DEF(23),
          arguments[2+1] = nil,& arguments[0]),QUAL(14),sched)) != Normal)
     goto ch_raise_exception;
  return;
c61:
/* move 19.2 23 */
  (*(REF(19)DOT(2).tsdr)->finalize)(REF(19)DOT(2).value,F_DISCARD,sched);
  REF(19)DOT(2) = REF(23);
  REF(23).tsdr = & dr_bottom;
/* copy 17.1 19.2 */
  if((ch_returncode = (REF(19)DOT(2).tsdr->copy)(& ch_val, REF(19)DOT(2).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(17)DOT(1).tsdr)->finalize)(REF(17)DOT(1).value,F_DISCARD,sched);
  REF(17)DOT(1).value = ch_val;
  REF(17)DOT(1).tsdr = datarepmap[REF(19)DOT(2).tsdr->number];
/* insert 13 19 */
  if ((ch_returncode = insertfunc(DEF(13),DEF(19),FALSE,0)) != Normal)
     goto ch_raise_exception;
  current->ip = 28;
cb64:
/* call 12 17.1 , 12 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(12),
          arguments[1] = DEF(17)DOT(1),
          arguments[1+1] = nil,& arguments[0]),QUAL(12),sched)) != Normal)
     goto ch_raise_exception;
  return;
c65:
/* return 17 */
  if (ch_caller = do_return(REF(17).value)) {
    if (ch_caller->type < CProcess) ch_caller->ip++;
      sched->wakeup_proc(sched, ch_caller);}
  else rem_return(REF(17).value);
  REF(17).tsdr = & dr_bottom;
/* endblock */
  che_endblock(sched);
/* branch , 73 */
   goto c73;
c68:
/* return_exception 17 , 15 */
  if (ch_caller = do_return(REF(17).value)) {
    raise_user(QUAL(15),ch_caller); 
    sched->wakeup_proc(sched,ch_caller);}
  else rem_return_exception(DEF(17),QUAL(15));
  REF(17).tsdr = & dr_bottom;
/* branch , 73 */
   goto c73;
c70:
/* return_exception 17 , 16 */
  if (ch_caller = do_return(REF(17).value)) {
    raise_user(QUAL(16),ch_caller); 
    sched->wakeup_proc(sched,ch_caller);}
  else rem_return_exception(DEF(17),QUAL(16));
  REF(17).tsdr = & dr_bottom;
/* branch , 73 */
   goto c73;
c72:
/* return_exception 17 , 15 */
  if (ch_caller = do_return(REF(17).value)) {
    raise_user(QUAL(15),ch_caller); 
    sched->wakeup_proc(sched,ch_caller);}
  else rem_return_exception(DEF(17),QUAL(15));
  REF(17).tsdr = & dr_bottom;
c73:
/* discard 19 */
  (*(REF(19).tsdr)->finalize)(REF(19).value,F_DISCARD,sched);
  REF(19).tsdr = & dr_bottom;
c74:
/* discard 19 */
  (*(REF(19).tsdr)->finalize)(REF(19).value,F_DISCARD,sched);
  REF(19).tsdr = & dr_bottom;
/* endblock */
  che_endblock(sched);
/* branch , 16 */
   goto c16;
c77:
/* discard 19 */
  (*(REF(19).tsdr)->finalize)(REF(19).value,F_DISCARD,sched);
  REF(19).tsdr = & dr_bottom;
/* block , 17 */
  if((ch_returncode = che_block(QUAL(17),sched)) != Normal)
     goto ch_raise_exception;
/* new_record 19 , 3 */
  if ((ch_val.record = new_record(3)) == nil) goto ch_depletion;
  (*(REF(19).tsdr)->finalize)(REF(19).value,F_DISCARD,sched);
  REF(19).value = ch_val; REF(19).tsdr = & dr_record;
/* copy 19.0 17.0 */
  if((ch_returncode = (REF(17)DOT(0).tsdr->copy)(& ch_val, REF(17)DOT(0).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(19)DOT(0).tsdr)->finalize)(REF(19)DOT(0).value,F_DISCARD,sched);
  REF(19)DOT(0).value = ch_val;
  REF(19)DOT(0).tsdr = datarepmap[REF(17)DOT(0).tsdr->number];
  current->ip = 36;
cb81:
/* call 4 19.0 24 , 14 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(4),
          arguments[1] = DEF(19)DOT(0),
          arguments[2] = DEF(24),
          arguments[2+1] = nil,& arguments[0]),QUAL(14),sched)) != Normal)
     goto ch_raise_exception;
  return;
c82:
/* move 19.2 24 */
  (*(REF(19)DOT(2).tsdr)->finalize)(REF(19)DOT(2).value,F_DISCARD,sched);
  REF(19)DOT(2) = REF(24);
  REF(24).tsdr = & dr_bottom;
  current->ip = 38;
cb83:
/* call 6 19.0 25 , 11 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(6),
          arguments[1] = DEF(19)DOT(0),
          arguments[2] = DEF(25),
          arguments[2+1] = nil,& arguments[0]),QUAL(11),sched)) != Normal)
     goto ch_raise_exception;
  return;
c84:
/* move 19.1 25 */
  (*(REF(19)DOT(1).tsdr)->finalize)(REF(19)DOT(1).value,F_DISCARD,sched);
  REF(19)DOT(1) = REF(25);
  REF(25).tsdr = & dr_bottom;
/* copy 17.1 19.2 */
  if((ch_returncode = (REF(19)DOT(2).tsdr->copy)(& ch_val, REF(19)DOT(2).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(17)DOT(1).tsdr)->finalize)(REF(17)DOT(1).value,F_DISCARD,sched);
  REF(17)DOT(1).value = ch_val;
  REF(17)DOT(1).tsdr = datarepmap[REF(19)DOT(2).tsdr->number];
/* insert 13 19 */
  if ((ch_returncode = insertfunc(DEF(13),DEF(19),FALSE,0)) != Normal)
     goto ch_raise_exception;
  current->ip = 40;
cb87:
/* call 12 17.1 , 12 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(12),
          arguments[1] = DEF(17)DOT(1),
          arguments[1+1] = nil,& arguments[0]),QUAL(12),sched)) != Normal)
     goto ch_raise_exception;
  return;
c88:
/* return 17 */
  if (ch_caller = do_return(REF(17).value)) {
    if (ch_caller->type < CProcess) ch_caller->ip++;
      sched->wakeup_proc(sched, ch_caller);}
  else rem_return(REF(17).value);
  REF(17).tsdr = & dr_bottom;
/* endblock */
  che_endblock(sched);
/* branch , 96 */
   goto c96;
c91:
/* return_exception 17 , 15 */
  if (ch_caller = do_return(REF(17).value)) {
    raise_user(QUAL(15),ch_caller); 
    sched->wakeup_proc(sched,ch_caller);}
  else rem_return_exception(DEF(17),QUAL(15));
  REF(17).tsdr = & dr_bottom;
/* branch , 96 */
   goto c96;
c93:
/* return_exception 17 , 16 */
  if (ch_caller = do_return(REF(17).value)) {
    raise_user(QUAL(16),ch_caller); 
    sched->wakeup_proc(sched,ch_caller);}
  else rem_return_exception(DEF(17),QUAL(16));
  REF(17).tsdr = & dr_bottom;
/* branch , 96 */
   goto c96;
c95:
/* return_exception 17 , 15 */
  if (ch_caller = do_return(REF(17).value)) {
    raise_user(QUAL(15),ch_caller); 
    sched->wakeup_proc(sched,ch_caller);}
  else rem_return_exception(DEF(17),QUAL(15));
  REF(17).tsdr = & dr_bottom;
c96:
/* discard 19 */
  (*(REF(19).tsdr)->finalize)(REF(19).value,F_DISCARD,sched);
  REF(19).tsdr = & dr_bottom;
/* branch , 16 */
   goto c16;
c99:
/* endblock */
  che_endblock(sched);
c101:
/* endprocess */
  che_endprocess(sched); return;
#include "chtail.h"
