#include "chdecl.h"
void CH_sh(current, sched, cop)
#define ARGUMENTS 7
#include "chhead.h"
select: switch (SELECTOR) {
    case 0: goto c0;
    case 1: goto cb2;
    case 2: goto c3;
    case 3: goto cb5;
    case 4: goto c6;
    case 5: goto cb9;
    case 6: goto c10;
    case 7: goto c14;
    case 8: goto cb31;
    case 9: goto c32;
    case 10: goto cb35;
    case 11: goto c36;
    case 12: goto c39;
    case 13: goto cb40;
    case 14: goto c41;
    case 15: goto c43;
    case 16: goto cb44;
    case 17: goto c45;
    case 18: goto c46;
    case 19: goto cb47;
    case 20: goto c48;
    case 21: goto c49;
    case 22: goto c54;  }
c0:
/* block , 0 */
  if((ch_returncode = che_block(QUAL(0),sched)) != Normal)
     goto ch_raise_exception;
/* block , 1 */
  if((ch_returncode = che_block(QUAL(1),sched)) != Normal)
     goto ch_raise_exception;
  current->ip = 1;
cb2:
/* receive 3 0 */
  if ((ch_returncode = che_receive(DEF(3),DEF(0),sched)) != Normal)
     goto ch_raise_exception;
  return;
c3:
/* chs_lit 4 , "pathLoad" */
  if( !chs_lit(DEF(4),"pathLoad") ) goto ch_depletion;
/* chs_lit 5 , "" */
  if( !chs_lit(DEF(5),"") ) goto ch_depletion;
  current->ip = 3;
cb5:
/* call 3.2.2 4 5 6 , 2 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(2)DOT(2),
          arguments[1] = DEF(4),
          arguments[2] = DEF(5),
          arguments[3] = DEF(6),
          arguments[3+1] = nil,& arguments[0]),QUAL(2),sched)) != Normal)
     goto ch_raise_exception;
  return;
c6:
/* unwrap 7 6 , 3 */
  if ((ch_returncode = che_unwrap(DEF(7),DEF(6),QUAL(3),sched)) != Normal)
     goto ch_raise_exception;
/* chs_lit 8 , "stdio" */
  if( !chs_lit(DEF(8),"stdio") ) goto ch_depletion;
/* chs_lit 9 , "" */
  if( !chs_lit(DEF(9),"") ) goto ch_depletion;
  current->ip = 5;
cb9:
/* call 3.2.2 8 9 10 , 2 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(2)DOT(2),
          arguments[1] = DEF(8),
          arguments[2] = DEF(9),
          arguments[3] = DEF(10),
          arguments[3+1] = nil,& arguments[0]),QUAL(2),sched)) != Normal)
     goto ch_raise_exception;
  return;
c10:
/* unwrap 11 10 , 4 */
  if ((ch_returncode = che_unwrap(DEF(11),DEF(10),QUAL(4),sched)) != Normal)
     goto ch_raise_exception;
/* new_table 12 , 5 */
  if ((ch_returncode = che_new_table(DEF(12),QUAL(5),sched)) != Normal) 
     goto ch_raise_exception;
/* copy 13 3.0 */
  if((ch_returncode = cp_table(& ch_val, REF(3)DOT(0).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;
c14:
/* get_or_goto 14 13 , 28 */
  if ((ch_returncode = get_selected_object(DEF(14),DEF(13),sched)) != Normal)
     goto c28;
/* position 15 14 */
  ch_frame = get_selector_frame(DEF(14),sched);
  ch_t = ch_frame->inspectee->value.table;
  REF(15).value.integer = ch_frame->rmvcount +
    (*(ch_t->tbls[ORDER_TBL].des->position_of))(ch_t,ORDER_TBL,ch_frame->pos);
  REF(15).tsdr = &dr_integer;
/* ilt . 15 =(3) , 21 */
  if ( REF(15).value.integer < 3 ) goto c21;
/* ordenum_lit 16 , 32 */
  REF(16).value.ord_enum = 32;
  REF(16).tsdr = & dr_ord_enumeration;
/* insert 12 16 */
  if ((ch_returncode = insertfunc(DEF(12),DEF(16),FALSE,0)) != Normal)
     goto ch_raise_exception;
c21:
/* position 17 14 */
  ch_frame = get_selector_frame(DEF(14),sched);
  ch_t = ch_frame->inspectee->value.table;
  REF(17).value.integer = ch_frame->rmvcount +
    (*(ch_t->tbls[ORDER_TBL].des->position_of))(ch_t,ORDER_TBL,ch_frame->pos);
  REF(17).tsdr = &dr_integer;
/* ilt . 17 =(2) , 14 */
  if ( REF(17).value.integer < 2 ) goto c14;
/* copy 18 14 */
  if((ch_returncode = cp_table(& ch_val, REF(14).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(18).tsdr)->finalize)(REF(18).value,F_DISCARD,sched);
  REF(18).value = ch_val;
  REF(18).tsdr = & dr_table;
/* merge 12 18 */
  if ((ch_returncode = mergefunc(DEF(12),DEF(18),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* branch , 14 */
   goto c14;
c28:
/* 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;
/* chs_lit 19 , "unixcmd" */
  if( !chs_lit(DEF(19),"unixcmd") ) goto ch_depletion;
  current->ip = 8;
cb31:
/* call 7 19 20 , 6 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(7),
          arguments[1] = DEF(19),
          arguments[2] = DEF(20),
          arguments[2+1] = nil,& arguments[0]),QUAL(6),sched)) != Normal)
     goto ch_raise_exception;
  return;
c32:
/* create 21 20 , 7 */
  if ((ch_returncode = che_create(DEF(21),DEF(20),QUAL(7),sched)) != Normal)
     goto ch_raise_exception;
/* discard 20 */
  (*(REF(20).tsdr)->finalize)(REF(20).value,F_DISCARD,sched);
  REF(20).tsdr = & dr_bottom;
/* move 22 21 */
  (*(REF(22).tsdr)->finalize)(REF(22).value,F_DISCARD,sched);
  REF(22) = REF(21);
  REF(21).tsdr = & dr_bottom;
  current->ip = 10;
cb35:
/* call 22 12 11.5 3.1.0 23 , 8 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(22),
          arguments[1] = DEF(12),
          arguments[2] = DEF(11)DOT(5),
          arguments[3] = DEF(3)DOT(1)DOT(0),
          arguments[4] = DEF(23),
          arguments[4+1] = nil,& arguments[0]),QUAL(8),sched)) != Normal)
     goto ch_raise_exception;
  return;
c36:
/* 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;
/* endblock */
  che_endblock(sched);
/* branch , 49 */
   goto c49;
c39:
/* chs_lit 24 , "sh: non-zero return code." */
  if( !chs_lit(DEF(24),"sh: non-zero return code.") ) goto ch_depletion;
  current->ip = 13;
cb40:
/* call 3.1.1 24 , 9 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(1)DOT(1),
          arguments[1] = DEF(24),
          arguments[1+1] = nil,& arguments[0]),QUAL(9),sched)) != Normal)
     goto ch_raise_exception;
  return;
c41:
/* 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;
/* branch , 49 */
   goto c49;
c43:
/* chs_lit 25 , "sh: couldn't exec \"" */
  if( !chs_lit(DEF(25),"sh: couldn't exec \"") ) goto ch_depletion;
  current->ip = 16;
cb44:
/* call 3.1.0 25 , 9 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(1)DOT(0),
          arguments[1] = DEF(25),
          arguments[1+1] = nil,& arguments[0]),QUAL(9),sched)) != Normal)
     goto ch_raise_exception;
  return;
c45:
/* call 3.1.0 12 , 9 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(1)DOT(0),
          arguments[1] = DEF(12),
          arguments[1+1] = nil,& arguments[0]),QUAL(9),sched)) != Normal)
     goto ch_raise_exception;
  return;
c46:
/* chs_lit 26 , "\"." */
  if( !chs_lit(DEF(26),"\".") ) goto ch_depletion;
  current->ip = 19;
cb47:
/* call 3.1.1 26 , 9 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(1)DOT(1),
          arguments[1] = DEF(26),
          arguments[1+1] = nil,& arguments[0]),QUAL(9),sched)) != Normal)
     goto ch_raise_exception;
  return;
c48:
/* 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;
c49:
/* discard 25 */
  (*(REF(25).tsdr)->finalize)(REF(25).value,F_DISCARD,sched);
  REF(25).tsdr = & dr_bottom;
/* discard 26 */
  (*(REF(26).tsdr)->finalize)(REF(26).value,F_DISCARD,sched);
  REF(26).tsdr = & dr_bottom;
/* discard 24 */
  (*(REF(24).tsdr)->finalize)(REF(24).value,F_DISCARD,sched);
  REF(24).tsdr = & dr_bottom;
/* endblock */
  che_endblock(sched);
c54:
/* endprocess */
  che_endprocess(sched); return;
#include "chtail.h"
