#include "chdecl.h"
void CH_chainedsysrm(current, sched, cop)
#define ARGUMENTS 12
#include "chhead.h"
select: switch (SELECTOR) {
    case 0: goto c0;
    case 1: goto cb6;
    case 2: goto c7;
    case 3: goto c18;
    case 4: goto cb18;
    case 5: goto c19;
    case 6: goto cb20;
    case 7: goto c21;
    case 8: goto cb23;
    case 9: goto c24;
    case 10: goto c27;
    case 11: goto cb29;
    case 12: goto c30;
    case 13: goto c35;
    case 14: goto c38;
    case 15: goto c40;
    case 16: goto c44;
    case 17: goto cb50;
    case 18: goto c51;
    case 19: goto c54;
    case 20: goto cb56;
    case 21: goto c57;
    case 22: goto c62;
    case 23: goto c65;
    case 24: goto c67;
    case 25: goto c71;
    case 26: goto cb77;
    case 27: goto c78;
    case 28: goto cb80;
    case 29: goto c81;
    case 30: goto c84;
    case 31: goto c86;  }
c0:
/* block , 0 */
  if((ch_returncode = che_block(QUAL(0),sched)) != Normal)
     goto ch_raise_exception;
/* new_inport 3 */
  if ((ch_val.inport = make_inport()) == nil) goto ch_depletion;
  (*(REF(3).tsdr)->finalize)(REF(3).value,F_DISCARD,sched);
  REF(3).value = ch_val; REF(3).tsdr = & dr_inport;
/* new_inport 4 */
  if ((ch_val.inport = make_inport()) == nil) goto ch_depletion;
  (*(REF(4).tsdr)->finalize)(REF(4).value,F_DISCARD,sched);
  REF(4).value = ch_val; REF(4).tsdr = & dr_inport;
/* new_inport 5 */
  if ((ch_val.inport = make_inport()) == nil) goto ch_depletion;
  (*(REF(5).tsdr)->finalize)(REF(5).value,F_DISCARD,sched);
  REF(5).value = ch_val; REF(5).tsdr = & dr_inport;
/* new_inport 6 */
  if ((ch_val.inport = make_inport()) == nil) goto ch_depletion;
  (*(REF(6).tsdr)->finalize)(REF(6).value,F_DISCARD,sched);
  REF(6).value = ch_val; REF(6).tsdr = & dr_inport;
/* 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;
  current->ip = 1;
cb6:
/* receive 8 0 */
  if ((ch_returncode = che_receive(DEF(8),DEF(0),sched)) != Normal)
     goto ch_raise_exception;
  return;
c7:
/* new_record 8.2 , 5 */
  if ((ch_val.record = new_record(5)) == nil) goto ch_depletion;
  (*(REF(8)DOT(2).tsdr)->finalize)(REF(8)DOT(2).value,F_DISCARD,sched);
  REF(8)DOT(2).value = ch_val; REF(8)DOT(2).tsdr = & dr_record;
/* connect 8.2.0 3 */
  if (REF(3).value.inport->refcount == MAXCOUNTER) goto ch_depletion;
  (*(REF(8)DOT(2)DOT(0).tsdr)->finalize)(REF(8)DOT(2)DOT(0).value
    ,F_DISCARD,sched);
  REF(3).value.inport->refcount++;
  REF(8)DOT(2)DOT(0).value.outport = REF(3).value.inport;
  REF(8)DOT(2)DOT(0).tsdr = & dr_outport;
/* connect 8.2.1 4 */
  if (REF(4).value.inport->refcount == MAXCOUNTER) goto ch_depletion;
  (*(REF(8)DOT(2)DOT(1).tsdr)->finalize)(REF(8)DOT(2)DOT(1).value
    ,F_DISCARD,sched);
  REF(4).value.inport->refcount++;
  REF(8)DOT(2)DOT(1).value.outport = REF(4).value.inport;
  REF(8)DOT(2)DOT(1).tsdr = & dr_outport;
/* connect 8.2.2 5 */
  if (REF(5).value.inport->refcount == MAXCOUNTER) goto ch_depletion;
  (*(REF(8)DOT(2)DOT(2).tsdr)->finalize)(REF(8)DOT(2)DOT(2).value
    ,F_DISCARD,sched);
  REF(5).value.inport->refcount++;
  REF(8)DOT(2)DOT(2).value.outport = REF(5).value.inport;
  REF(8)DOT(2)DOT(2).tsdr = & dr_outport;
/* connect 8.2.3 6 */
  if (REF(6).value.inport->refcount == MAXCOUNTER) goto ch_depletion;
  (*(REF(8)DOT(2)DOT(3).tsdr)->finalize)(REF(8)DOT(2)DOT(3).value
    ,F_DISCARD,sched);
  REF(6).value.inport->refcount++;
  REF(8)DOT(2)DOT(3).value.outport = REF(6).value.inport;
  REF(8)DOT(2)DOT(3).tsdr = & dr_outport;
/* connect 8.2.4 7 */
  if (REF(7).value.inport->refcount == MAXCOUNTER) goto ch_depletion;
  (*(REF(8)DOT(2)DOT(4).tsdr)->finalize)(REF(8)DOT(2)DOT(4).value
    ,F_DISCARD,sched);
  REF(7).value.inport->refcount++;
  REF(8)DOT(2)DOT(4).value.outport = REF(7).value.inport;
  REF(8)DOT(2)DOT(4).tsdr = & dr_outport;
/* copy 9 8.0 */
  if((ch_returncode = cp_table(& ch_val, REF(8)DOT(0).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(9).tsdr)->finalize)(REF(9).value,F_DISCARD,sched);
  REF(9).value = ch_val;
  REF(9).tsdr = & dr_table;
/* copy 10 8.1 */
  if((ch_returncode = (REF(8)DOT(1).tsdr->copy)(& ch_val, REF(8)DOT(1).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(10).tsdr)->finalize)(REF(10).value,F_DISCARD,sched);
  REF(10).value = ch_val;
  REF(10).tsdr = datarepmap[REF(8)DOT(1).tsdr->number];
/* return 8 */
  if (ch_caller = do_return(REF(8).value)) {
    if (ch_caller->type < CProcess) ch_caller->ip++;
      sched->wakeup_proc(sched, ch_caller);}
  else rem_return(REF(8).value);
  REF(8).tsdr = & dr_bottom;
c16:
c18:
  current->ip = 4;
cb18:
/* select 7 * 6 * 5 * 4 * 3 * , 1 */
  if ((ch_returncode = che_select((
          arguments[0] = DEF(7),
          arguments[1] = NO_OBJECT,
          arguments[2] = DEF(6),
          arguments[3] = NO_OBJECT,
          arguments[4] = DEF(5),
          arguments[5] = NO_OBJECT,
          arguments[6] = DEF(4),
          arguments[7] = NO_OBJECT,
          arguments[8] = DEF(3),
          arguments[9] = NO_OBJECT,
          arguments[9+1] = nil,& arguments[0]),QUAL(1),sched)) != Normal)
     goto ch_raise_exception;
  if (current->ip == 4) return; else COMPUTE_TARGET;
c19:
/* branch , 16 */
   goto c16;
c20:
  current->ip = 6;
cb20:
/* receive 11 7 */
  if ((ch_returncode = che_receive(DEF(11),DEF(7),sched)) != Normal)
     goto ch_raise_exception;
  return;
c21:
/* send 10.4 11 */
  if ((ch_returncode = che_send(DEF(10)DOT(4),DEF(11),sched)) != Normal)
     goto ch_raise_exception;
/* branch , 16 */
   goto c16;
c23:
  current->ip = 8;
cb23:
/* receive 12 6 */
  if ((ch_returncode = che_receive(DEF(12),DEF(6),sched)) != Normal)
     goto ch_raise_exception;
  return;
c24:
/* block , 2 */
  if((ch_returncode = che_block(QUAL(2),sched)) != Normal)
     goto ch_raise_exception;
/* copy 13 9 */
  if((ch_returncode = cp_table(& ch_val, REF(9).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(13).tsdr)->finalize)(REF(13).value,F_DISCARD,sched);
  REF(13).value = ch_val;
  REF(13).tsdr = & dr_table;
/* initget 14 13 , 0,0 */
  (*(REF(14).tsdr)->finalize)(REF(14).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(14),DEF(13),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
c27:
/* get_or_goto 14 13 , 44 */
  if ((ch_returncode = get_selected_object(DEF(14),DEF(13),sched)) != Normal)
     goto c44;
/* block , 3 */
  if((ch_returncode = che_block(QUAL(3),sched)) != Normal)
     goto ch_raise_exception;
  current->ip = 11;
cb29:
/* call 14.3 12.0 12.1 12.2 12.3 , 4 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(14)DOT(3),
          arguments[1] = DEF(12)DOT(0),
          arguments[2] = DEF(12)DOT(1),
          arguments[3] = DEF(12)DOT(2),
          arguments[4] = DEF(12)DOT(3),
          arguments[4+1] = nil,& arguments[0]),QUAL(4),sched)) != Normal)
     goto ch_raise_exception;
  return;
c30:
/* return 12 */
  if (ch_caller = do_return(REF(12).value)) {
    if (ch_caller->type < CProcess) ch_caller->ip++;
      sched->wakeup_proc(sched, ch_caller);}
  else rem_return(REF(12).value);
  REF(12).tsdr = & dr_bottom;
/* exit , 5 */
  ch_e = handler_type__exit; ch_val = QUAL(5); goto ch_exception;
/* endblock */
  che_endblock(sched);
/* branch , 27 */
   goto c27;
c35:
/* return_exception 12 , 6 */
  if (ch_caller = do_return(REF(12).value)) {
    raise_user(QUAL(6),ch_caller); 
    sched->wakeup_proc(sched,ch_caller);}
  else rem_return_exception(DEF(12),QUAL(6));
  REF(12).tsdr = & dr_bottom;
/* exit , 5 */
  ch_e = handler_type__exit; ch_val = QUAL(5); goto ch_exception;
c38:
/* exit , 5 */
  ch_e = handler_type__exit; ch_val = QUAL(5); goto ch_exception;
c40:
/* discard 12.3 */
  (*(REF(12)DOT(3).tsdr)->finalize)(REF(12)DOT(3).value,F_DISCARD,sched);
  REF(12)DOT(3).tsdr = & dr_bottom;
/* discard 12 */
  (*(REF(12).tsdr)->finalize)(REF(12).value,F_DISCARD,sched);
  REF(12).tsdr = & dr_bottom;
/* exit , 5 */
  ch_e = handler_type__exit; ch_val = QUAL(5); goto ch_exception;
c44:
/* endget 14 13 */
  end_selector(DEF(14),DEF(13),sched,GET);
/* discard 13 */
  (*(REF(13).tsdr)->finalize)(REF(13).value,F_DISCARD,sched);
  REF(13).tsdr = & dr_bottom;
/* return_exception 12 , 7 */
  if (ch_caller = do_return(REF(12).value)) {
    raise_user(QUAL(7),ch_caller); 
    sched->wakeup_proc(sched,ch_caller);}
  else rem_return_exception(DEF(12),QUAL(7));
  REF(12).tsdr = & dr_bottom;
/* endblock */
  che_endblock(sched);
/* branch , 16 */
   goto c16;
c50:
  current->ip = 17;
cb50:
/* receive 15 5 */
  if ((ch_returncode = che_receive(DEF(15),DEF(5),sched)) != Normal)
     goto ch_raise_exception;
  return;
c51:
/* block , 8 */
  if((ch_returncode = che_block(QUAL(8),sched)) != Normal)
     goto ch_raise_exception;
/* copy 16 9 */
  if((ch_returncode = cp_table(& ch_val, REF(9).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(16).tsdr)->finalize)(REF(16).value,F_DISCARD,sched);
  REF(16).value = ch_val;
  REF(16).tsdr = & dr_table;
/* initget 17 16 , 0,0 */
  (*(REF(17).tsdr)->finalize)(REF(17).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(17),DEF(16),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
c54:
/* get_or_goto 17 16 , 71 */
  if ((ch_returncode = get_selected_object(DEF(17),DEF(16),sched)) != Normal)
     goto c71;
/* block , 9 */
  if((ch_returncode = che_block(QUAL(9),sched)) != Normal)
     goto ch_raise_exception;
  current->ip = 20;
cb56:
/* call 17.2 15.0 15.1 15.2 15.3 , 4 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(17)DOT(2),
          arguments[1] = DEF(15)DOT(0),
          arguments[2] = DEF(15)DOT(1),
          arguments[3] = DEF(15)DOT(2),
          arguments[4] = DEF(15)DOT(3),
          arguments[4+1] = nil,& arguments[0]),QUAL(4),sched)) != Normal)
     goto ch_raise_exception;
  return;
c57:
/* return 15 */
  if (ch_caller = do_return(REF(15).value)) {
    if (ch_caller->type < CProcess) ch_caller->ip++;
      sched->wakeup_proc(sched, ch_caller);}
  else rem_return(REF(15).value);
  REF(15).tsdr = & dr_bottom;
/* exit , 10 */
  ch_e = handler_type__exit; ch_val = QUAL(10); goto ch_exception;
/* endblock */
  che_endblock(sched);
/* branch , 54 */
   goto c54;
c62:
/* return_exception 15 , 6 */
  if (ch_caller = do_return(REF(15).value)) {
    raise_user(QUAL(6),ch_caller); 
    sched->wakeup_proc(sched,ch_caller);}
  else rem_return_exception(DEF(15),QUAL(6));
  REF(15).tsdr = & dr_bottom;
/* exit , 10 */
  ch_e = handler_type__exit; ch_val = QUAL(10); goto ch_exception;
c65:
/* exit , 10 */
  ch_e = handler_type__exit; ch_val = QUAL(10); goto ch_exception;
c67:
/* discard 15.3 */
  (*(REF(15)DOT(3).tsdr)->finalize)(REF(15)DOT(3).value,F_DISCARD,sched);
  REF(15)DOT(3).tsdr = & dr_bottom;
/* discard 15 */
  (*(REF(15).tsdr)->finalize)(REF(15).value,F_DISCARD,sched);
  REF(15).tsdr = & dr_bottom;
/* exit , 10 */
  ch_e = handler_type__exit; ch_val = QUAL(10); goto ch_exception;
c71:
/* endget 17 16 */
  end_selector(DEF(17),DEF(16),sched,GET);
/* discard 16 */
  (*(REF(16).tsdr)->finalize)(REF(16).value,F_DISCARD,sched);
  REF(16).tsdr = & dr_bottom;
/* return_exception 15 , 7 */
  if (ch_caller = do_return(REF(15).value)) {
    raise_user(QUAL(7),ch_caller); 
    sched->wakeup_proc(sched,ch_caller);}
  else rem_return_exception(DEF(15),QUAL(7));
  REF(15).tsdr = & dr_bottom;
/* endblock */
  che_endblock(sched);
/* branch , 16 */
   goto c16;
c77:
  current->ip = 26;
cb77:
/* receive 18 4 */
  if ((ch_returncode = che_receive(DEF(18),DEF(4),sched)) != Normal)
     goto ch_raise_exception;
  return;
c78:
/* send 10.1 18 */
  if ((ch_returncode = che_send(DEF(10)DOT(1),DEF(18),sched)) != Normal)
     goto ch_raise_exception;
/* branch , 16 */
   goto c16;
c80:
  current->ip = 28;
cb80:
/* receive 19 3 */
  if ((ch_returncode = che_receive(DEF(19),DEF(3),sched)) != Normal)
     goto ch_raise_exception;
  return;
c81:
/* send 10.0 19 */
  if ((ch_returncode = che_send(DEF(10)DOT(0),DEF(19),sched)) != Normal)
     goto ch_raise_exception;
/* branch , 16 */
   goto c16;
c84:
/* endblock */
  che_endblock(sched);
c86:
/* endprocess */
  che_endprocess(sched); return;
#include "chtail.h"
