#include "chdecl.h"
void CH_rshelld_rshellexec(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 cb7;
    case 4: goto c8;
    case 5: goto cb10;
    case 6: goto c11;
    case 7: goto cb13;
    case 8: goto c14;
    case 9: goto cb23;
    case 10: goto c24;
    case 11: goto cb30;
    case 12: goto c31;
    case 13: goto cb38;
    case 14: goto c39;
    case 15: goto c42;  }
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 = (REF(3)DOT(0).tsdr->copy)(& 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 = datarepmap[REF(3)DOT(0).tsdr->number];
/* 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;
/* connect 3.1 5 */
  if (REF(5).value.inport->refcount == MAXCOUNTER) goto ch_depletion;
  (*(REF(3)DOT(1).tsdr)->finalize)(REF(3)DOT(1).value,F_DISCARD,sched);
  REF(5).value.inport->refcount++;
  REF(3)DOT(1).value.outport = REF(5).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;
/* discard 0 */
  (*(REF(0).tsdr)->finalize)(REF(0).value,F_DISCARD,sched);
  REF(0).tsdr = & dr_bottom;
  current->ip = 3;
cb7:
/* receive 6 5 */
  if ((ch_returncode = che_receive(DEF(6),DEF(5),sched)) != Normal)
     goto ch_raise_exception;
  return;
c8:
/* chs_lit 7 , "pathLoad" */
  if( !chs_lit(DEF(7),"pathLoad") ) goto ch_depletion;
/* chs_lit 8 , "" */
  if( !chs_lit(DEF(8),"") ) goto ch_depletion;
  current->ip = 5;
cb10:
/* call 4.2 7 8 9 , 1 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(4)DOT(2),
          arguments[1] = DEF(7),
          arguments[2] = DEF(8),
          arguments[3] = DEF(9),
          arguments[3+1] = nil,& arguments[0]),QUAL(1),sched)) != Normal)
     goto ch_raise_exception;
  return;
c11:
/* unwrap 10 9 , 2 */
  if ((ch_returncode = che_unwrap(DEF(10),DEF(9),QUAL(2),sched)) != Normal)
     goto ch_raise_exception;
/* chs_lit 11 , "pshell" */
  if( !chs_lit(DEF(11),"pshell") ) goto ch_depletion;
  current->ip = 7;
cb13:
/* call 10 11 12 , 3 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(10),
          arguments[1] = DEF(11),
          arguments[2] = DEF(12),
          arguments[2+1] = nil,& arguments[0]),QUAL(3),sched)) != Normal)
     goto ch_raise_exception;
  return;
c14:
/* create 13 12 , 4 */
  if ((ch_returncode = che_create(DEF(13),DEF(12),QUAL(4),sched)) != Normal)
     goto ch_raise_exception;
/* discard 12 */
  (*(REF(12).tsdr)->finalize)(REF(12).value,F_DISCARD,sched);
  REF(12).tsdr = & dr_bottom;
/* move 14 13 */
  (*(REF(14).tsdr)->finalize)(REF(14).value,F_DISCARD,sched);
  REF(14) = REF(13);
  REF(13).tsdr = & dr_bottom;
/* copy 15 6.1 */
  if((ch_returncode = (REF(6)DOT(1).tsdr->copy)(& ch_val, REF(6)DOT(1).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(15).tsdr)->finalize)(REF(15).value,F_DISCARD,sched);
  REF(15).value = ch_val;
  REF(15).tsdr = datarepmap[REF(6)DOT(1).tsdr->number];
/* wrap 16 15 , 5 */
  if ((ch_returncode = che_wrap(DEF(16),DEF(15),QUAL(5),sched)) != Normal)
     goto ch_raise_exception;
/* chs_lit 17 , "stdin" */
  if( !chs_lit(DEF(17),"stdin") ) goto ch_depletion;
/* prog_lit 18 , 6 */
  if ((ch_returncode = che_prog_lit(DEF(18),QUAL(6),sched)) != Normal) 
     goto ch_raise_exception;
/* create 19 18 , 7 */
  if ((ch_returncode = che_create(DEF(19),DEF(18),QUAL(7),sched)) != Normal)
     goto ch_raise_exception;
/* discard 18 */
  (*(REF(18).tsdr)->finalize)(REF(18).value,F_DISCARD,sched);
  REF(18).tsdr = & dr_bottom;
  current->ip = 9;
cb23:
/* call 4.0 17 16 19 , 8 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(4)DOT(0),
          arguments[1] = DEF(17),
          arguments[2] = DEF(16),
          arguments[3] = DEF(19),
          arguments[3+1] = nil,& arguments[0]),QUAL(8),sched)) != Normal)
     goto ch_raise_exception;
  return;
c24:
/* copy 20 6.2 */
  if((ch_returncode = (REF(6)DOT(2).tsdr->copy)(& ch_val, REF(6)DOT(2).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(20).tsdr)->finalize)(REF(20).value,F_DISCARD,sched);
  REF(20).value = ch_val;
  REF(20).tsdr = datarepmap[REF(6)DOT(2).tsdr->number];
/* wrap 16 20 , 9 */
  if ((ch_returncode = che_wrap(DEF(16),DEF(20),QUAL(9),sched)) != Normal)
     goto ch_raise_exception;
/* chs_lit 21 , "stdout" */
  if( !chs_lit(DEF(21),"stdout") ) goto ch_depletion;
/* prog_lit 22 , 6 */
  if ((ch_returncode = che_prog_lit(DEF(22),QUAL(6),sched)) != Normal) 
     goto ch_raise_exception;
/* create 23 22 , 7 */
  if ((ch_returncode = che_create(DEF(23),DEF(22),QUAL(7),sched)) != Normal)
     goto ch_raise_exception;
/* discard 22 */
  (*(REF(22).tsdr)->finalize)(REF(22).value,F_DISCARD,sched);
  REF(22).tsdr = & dr_bottom;
  current->ip = 11;
cb30:
/* call 4.0 21 16 23 , 8 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(4)DOT(0),
          arguments[1] = DEF(21),
          arguments[2] = DEF(16),
          arguments[3] = DEF(23),
          arguments[3+1] = nil,& arguments[0]),QUAL(8),sched)) != Normal)
     goto ch_raise_exception;
  return;
c31:
/* new_table 24 , 10 */
  if ((ch_returncode = che_new_table(DEF(24),QUAL(10),sched)) != Normal) 
     goto ch_raise_exception;
/* chs_lit 25 , "rshell" */
  if( !chs_lit(DEF(25),"rshell") ) goto ch_depletion;
/* insert 24 25 */
  if ((ch_returncode = insertfunc(DEF(24),DEF(25),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* chs_lit 26 , "pshell" */
  if( !chs_lit(DEF(26),"pshell") ) goto ch_depletion;
/* insert 24 26 */
  if ((ch_returncode = insertfunc(DEF(24),DEF(26),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* copy 27 6.0 */
  if((ch_returncode = (REF(6)DOT(0).tsdr->copy)(& ch_val, REF(6)DOT(0).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(27).tsdr)->finalize)(REF(27).value,F_DISCARD,sched);
  REF(27).value = ch_val;
  REF(27).tsdr = datarepmap[REF(6)DOT(0).tsdr->number];
/* insert 24 27 */
  if ((ch_returncode = insertfunc(DEF(24),DEF(27),FALSE,0)) != Normal)
     goto ch_raise_exception;
  current->ip = 13;
cb38:
/* call 14 24 6.3 4 , 11 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(14),
          arguments[1] = DEF(24),
          arguments[2] = DEF(6)DOT(3),
          arguments[3] = DEF(4),
          arguments[3+1] = nil,& arguments[0]),QUAL(11),sched)) != Normal)
     goto ch_raise_exception;
  return;
c39:
/* return 6 */
  if (ch_caller = do_return(REF(6).value)) {
    if (ch_caller->type < CProcess) ch_caller->ip++;
      sched->wakeup_proc(sched, ch_caller);}
  else rem_return(REF(6).value);
  REF(6).tsdr = & dr_bottom;
/* endblock */
  che_endblock(sched);
c42:
/* endprocess */
  che_endprocess(sched); return;
#include "chtail.h"
