#include "chdecl.h"
void CH_findfile(current, sched, cop)
#define ARGUMENTS 6
#include "chhead.h"
select: switch (SELECTOR) {
    case 0: goto c0;
    case 1: goto cb2;
    case 2: goto c3;
    case 3: goto c7;
    case 4: goto c12;
    case 5: goto c22;
    case 6: goto c46;
    case 7: goto c56;
    case 8: goto cb59;
    case 9: goto c60;
    case 10: goto cb73;
    case 11: goto c74;
    case 12: goto cb76;
    case 13: goto c77;
    case 14: goto c81;
    case 15: goto c84;
    case 16: goto cb86;
    case 17: goto c87;
    case 18: goto c92;
    case 19: goto cb106;
    case 20: goto c107;
    case 21: goto cb108;
    case 22: goto c109;
    case 23: goto c112;
    case 24: goto c115;
    case 25: goto c118;
    case 26: goto c120;
    case 27: goto c124;
    case 28: goto c128;
    case 29: goto c130;
    case 30: goto c141;
    case 31: goto c149;  }
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:
/* copy 4 3.2 */
  if((ch_returncode = cp_table(& ch_val, REF(3)DOT(2).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_table;
/* new_table 5 , 2 */
  if ((ch_returncode = che_new_table(DEF(5),QUAL(2),sched)) != Normal) 
     goto ch_raise_exception;
/* ordenum_lit 6 , 58 */
  REF(6).value.ord_enum = 58;
  REF(6).tsdr = & dr_ord_enumeration;
/* insert 4 6 */
  if ((ch_returncode = insertfunc(DEF(4),DEF(6),FALSE,0)) != Normal)
     goto ch_raise_exception;
c7:
/* size 7 4 */
  REF(7).value.integer = REF(4).value.table->size;
  REF(7).tsdr = & dr_integer;
/* ile . 7 =(0) , 46 */
  if ( REF(7).value.integer <= 0 ) goto c46;
/* initget 8 4 , 0,0 */
  (*(REF(8).tsdr)->finalize)(REF(8).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(8),DEF(4),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
c12:
/* get_or_err 8 4 */
  if ((ch_returncode = get_selected_object(DEF(8),DEF(4),sched)) != Normal)
     goto ch_raise_exception;
/* notequal . 8 =(58) , 12 */
  if ( REF(8).value.ord_enum != 58 ) goto c12;
/* position 9 8 */
  ch_frame = get_selector_frame(DEF(8),sched);
  ch_t = ch_frame->inspectee->value.table;
  REF(9).value.integer = ch_frame->rmvcount +
    (*(ch_t->tbls[ORDER_TBL].des->position_of))(ch_t,ORDER_TBL,ch_frame->pos);
  REF(9).tsdr = &dr_integer;
/* endget 8 4 */
  end_selector(DEF(8),DEF(4),sched,GET);
/* move 10 9 */
  REF(10) = REF(9);
  REF(9).tsdr = & dr_bottom;
/* new_table 11 , 3 */
  if ((ch_returncode = che_new_table(DEF(11),QUAL(3),sched)) != Normal) 
     goto ch_raise_exception;
/* privatize 4 */
  if (REF(4).value.table->refcount != 1)
    if ((ch_returncode = doCopyOnWrite(DEF(4))) != Normal)
       goto ch_raise_exception;
/* initget 12 4 , 0,0 */
  (*(REF(12).tsdr)->finalize)(REF(12).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(12),DEF(4),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
c22:
/* get_or_goto 12 4 , 29 */
  if ((ch_returncode = get_selected_object(DEF(12),DEF(4),sched)) != Normal)
     goto c29;
/* position 13 12 */
  ch_frame = get_selector_frame(DEF(12),sched);
  ch_t = ch_frame->inspectee->value.table;
  REF(13).value.integer = ch_frame->rmvcount +
    (*(ch_t->tbls[ORDER_TBL].des->position_of))(ch_t,ORDER_TBL,ch_frame->pos);
  REF(13).tsdr = &dr_integer;
/* ige . 13 10 , 22 */
  if ( REF(13).value.integer >= REF(10).value.integer ) goto c22;
/* remove 14 12 4 */
  if ((ch_returncode = che_remove(DEF(14),DEF(12),DEF(4),sched)) != Normal)
     goto ch_raise_exception;
/* insert 11 14 */
  if ((ch_returncode = insertfunc(DEF(11),DEF(14),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* branch , 22 */
   goto c22;
c29:
/* endget 12 4 */
  end_selector(DEF(12),DEF(4),sched,GET);
/* size 15 11 */
  REF(15).value.integer = REF(11).value.table->size;
  REF(15).tsdr = & dr_integer;
/* isubtract 16 15 =(1) */
  if (!chf_isubtract(DEF(16),REF(15).value.integer,1)) goto ch_depletion;
/* lookup_at 17 11 16 */
  if((ch_i = REF(16).value.integer) < 0 || ch_i >= (ch_t = REF(11).value
    .table)->size) goto ch_notfound;
  (*(REF(17).tsdr)->finalize)(REF(17).value,F_DISCARD,sched);
  (*(ch_t->tbls[ORDER_TBL].des->lookup_at))
    (ch_t, ORDER_TBL, & REF(17).value,ch_i);
  REF(17).tsdr = qdatarepmap[ch_t->tsdr->number];
/* copy 18 17 */
  REF(18) = REF(17);
/* equal . 18 =(47) , 40 */
  if ( REF(18).value.ord_enum == 47 ) goto c40;
/* ordenum_lit 19 , 47 */
  REF(19).value.ord_enum = 47;
  REF(19).tsdr = & dr_ord_enumeration;
/* insert 11 19 */
  if ((ch_returncode = insertfunc(DEF(11),DEF(19),FALSE,0)) != Normal)
     goto ch_raise_exception;
c40:
/* insert 5 11 */
  if ((ch_returncode = insertfunc(DEF(5),DEF(11),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* privatize 4 */
  if (REF(4).value.table->refcount != 1)
    if ((ch_returncode = doCopyOnWrite(DEF(4))) != Normal)
       goto ch_raise_exception;
/* lookup_at 20 4 =(0) */
  if ( !((ch_t = REF(4).value.table)->size) ) goto ch_notfound;
  (*(REF(20).tsdr)->finalize)(REF(20).value,F_DISCARD,sched);
  (*(ch_t->tbls[ORDER_TBL].des->lookup_at))
    (ch_t, ORDER_TBL, & REF(20).value,0);
  REF(20).tsdr = qdatarepmap[ch_t->tsdr->number];
/* remove_at 21 4 =(0) */
  if ((ch_returncode = remove_at_func(DEF(21),DEF(4),0)) != Normal)
     goto ch_raise_exception;
/* branch , 7 */
   goto c7;
c46:
/* copy 22 3.0 */
  if((ch_returncode = cp_outport(& ch_val, REF(3)DOT(0).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(22).tsdr)->finalize)(REF(22).value,F_DISCARD,sched);
  REF(22).value = ch_val;
  REF(22).tsdr = & dr_outport;
/* copy 23 3.1 */
  if((ch_returncode = cp_outport(& ch_val, REF(3)DOT(1).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(23).tsdr)->finalize)(REF(23).value,F_DISCARD,sched);
  REF(23).value = ch_val;
  REF(23).tsdr = & dr_outport;
/* new_inport 24 */
  if ((ch_val.inport = make_inport()) == nil) goto ch_depletion;
  (*(REF(24).tsdr)->finalize)(REF(24).value,F_DISCARD,sched);
  REF(24).value = ch_val; REF(24).tsdr = & dr_inport;
/* connect 3.3 24 */
  if (REF(24).value.inport->refcount == MAXCOUNTER) goto ch_depletion;
  (*(REF(3)DOT(3).tsdr)->finalize)(REF(3)DOT(3).value,F_DISCARD,sched);
  REF(24).value.inport->refcount++;
  REF(3)DOT(3).value.outport = REF(24).value.inport;
  REF(3)DOT(3).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;
/* prog_lit 25 , 4 */
  if ((ch_returncode = che_prog_lit(DEF(25),QUAL(4),sched)) != Normal) 
     goto ch_raise_exception;
/* procedure 26 25 , 5 */
  if ((ch_returncode = che_procedure(DEF(26),DEF(25),QUAL(5)
    ,sched)) != Normal) goto ch_raise_exception;
/* discard 25 */
  (*(REF(25).tsdr)->finalize)(REF(25).value,F_DISCARD,sched);
  REF(25).tsdr = & dr_bottom;
/* move 27 26 */
  (*(REF(27).tsdr)->finalize)(REF(27).value,F_DISCARD,sched);
  REF(27) = REF(26);
  REF(26).tsdr = & dr_bottom;
c56:
/* noop */
  
/* block , 6 */
  if((ch_returncode = che_block(QUAL(6),sched)) != Normal)
     goto ch_raise_exception;
  current->ip = 8;
cb59:
/* receive 28 24 */
  if ((ch_returncode = che_receive(DEF(28),DEF(24),sched)) != Normal)
     goto ch_raise_exception;
  return;
c60:
/* size 29 28.0 */
  REF(29).value.integer = REF(28)DOT(0).value.table->size;
  REF(29).tsdr = & dr_integer;
/* notequal . 29 =(0) , 65 */
  if ( REF(29).value.integer != 0 ) goto c65;
/* exit , 7 */
  ch_e = handler_type__exit; ch_val = QUAL(7); goto ch_exception;
c65:
/* initget 30 28.0 , 0,0 */
  (*(REF(30).tsdr)->finalize)(REF(30).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(30),DEF(28)DOT(0),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
/* get_or_err 30 28.0 */
  if ((ch_returncode = get_selected_object(DEF(30),DEF(28)DOT(0)
    ,sched)) != Normal) goto ch_raise_exception;
/* copy 31 30 */
  REF(31) = REF(30);
/* endget 30 28.0 */
  end_selector(DEF(30),DEF(28)DOT(0),sched,GET);
/* notequal . 31 =(47) , 86 */
  if ( REF(31).value.ord_enum != 47 ) goto c86;
/* block , 8 */
  if((ch_returncode = che_block(QUAL(8),sched)) != Normal)
     goto ch_raise_exception;
  current->ip = 10;
cb73:
/* call 22 28.0 28.1 32 , 9 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(22),
          arguments[1] = DEF(28)DOT(0),
          arguments[2] = DEF(28)DOT(1),
          arguments[3] = DEF(32),
          arguments[3+1] = nil,& arguments[0]),QUAL(9),sched)) != Normal)
     goto ch_raise_exception;
  return;
c74:
/* branch_false 32 , 81 */
  if ( !REF(32).value.boolean ) goto c81;
/* chs_lit 33 , "" */
  if( !chs_lit(DEF(33),"") ) goto ch_depletion;
  current->ip = 12;
cb76:
/* call 27 28.0 33 34 , 10 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(27),
          arguments[1] = DEF(28)DOT(0),
          arguments[2] = DEF(33),
          arguments[3] = DEF(34),
          arguments[3+1] = nil,& arguments[0]),QUAL(10),sched)) != Normal)
     goto ch_raise_exception;
  return;
c77:
/* move 28.2 34 */
  (*(REF(28)DOT(2).tsdr)->finalize)(REF(28)DOT(2).value,F_DISCARD,sched);
  REF(28)DOT(2) = REF(34);
  REF(34).tsdr = & dr_bottom;
/* return 28 */
  if (ch_caller = do_return(REF(28).value)) {
    if (ch_caller->type < CProcess) ch_caller->ip++;
      sched->wakeup_proc(sched, ch_caller);}
  else rem_return(REF(28).value);
  REF(28).tsdr = & dr_bottom;
/* exit , 11 */
  ch_e = handler_type__exit; ch_val = QUAL(11); goto ch_exception;
c81:
/* exit , 7 */
  ch_e = handler_type__exit; ch_val = QUAL(7); goto ch_exception;
/* endblock */
  che_endblock(sched);
/* branch , 118 */
   goto c118;
c84:
/* exit , 7 */
  ch_e = handler_type__exit; ch_val = QUAL(7); goto ch_exception;
c86:
  current->ip = 16;
cb86:
/* call 23 35 , 12 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(23),
          arguments[1] = DEF(35),
          arguments[1+1] = nil,& arguments[0]),QUAL(12),sched)) != Normal)
     goto ch_raise_exception;
  return;
c87:
/* move 36 35 */
  (*(REF(36).tsdr)->finalize)(REF(36).value,F_DISCARD,sched);
  REF(36) = REF(35);
  REF(35).tsdr = & dr_bottom;
/* ordenum_lit 37 , 47 */
  REF(37).value.ord_enum = 47;
  REF(37).tsdr = & dr_ord_enumeration;
/* insert 36 37 */
  if ((ch_returncode = insertfunc(DEF(36),DEF(37),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* copy 38 5 */
  if((ch_returncode = cp_table(& ch_val, REF(5).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(38).tsdr)->finalize)(REF(38).value,F_DISCARD,sched);
  REF(38).value = ch_val;
  REF(38).tsdr = & dr_table;
/* initget 39 38 , 0,0 */
  (*(REF(39).tsdr)->finalize)(REF(39).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(39),DEF(38),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
c92:
/* get_or_goto 39 38 , 115 */
  if ((ch_returncode = get_selected_object(DEF(39),DEF(38),sched)) != Normal)
     goto c115;
/* discard 40 */
  (*(REF(40).tsdr)->finalize)(REF(40).value,F_DISCARD,sched);
  REF(40).tsdr = & dr_bottom;
/* block , 13 */
  if((ch_returncode = che_block(QUAL(13),sched)) != Normal)
     goto ch_raise_exception;
/* concat 40 39 28.0 */
  if ((ch_returncode = che_concat(DEF(40),DEF(39),DEF(28)DOT(0)
    ,sched)) != Normal) goto ch_raise_exception;
/* initget 41 40 , 0,0 */
  (*(REF(41).tsdr)->finalize)(REF(41).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(41),DEF(40),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
/* get_or_err 41 40 */
  if ((ch_returncode = get_selected_object(DEF(41),DEF(40),sched)) != Normal)
     goto ch_raise_exception;
/* copy 42 41 */
  REF(42) = REF(41);
/* endget 41 40 */
  end_selector(DEF(41),DEF(40),sched,GET);
/* equal . 42 =(47) , 106 */
  if ( REF(42).value.ord_enum == 47 ) goto c106;
/* concat 40 36 40 */
  if ((ch_returncode = che_concat(DEF(40),DEF(36),DEF(40),sched)) != Normal)
     goto ch_raise_exception;
c106:
  current->ip = 19;
cb106:
/* call 22 40 28.1 43 , 9 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(22),
          arguments[1] = DEF(40),
          arguments[2] = DEF(28)DOT(1),
          arguments[3] = DEF(43),
          arguments[3+1] = nil,& arguments[0]),QUAL(9),sched)) != Normal)
     goto ch_raise_exception;
  return;
c107:
/* branch_false 43 , 112 */
  if ( !REF(43).value.boolean ) goto c112;
  current->ip = 21;
cb108:
/* call 27 40 36 44 , 10 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(27),
          arguments[1] = DEF(40),
          arguments[2] = DEF(36),
          arguments[3] = DEF(44),
          arguments[3+1] = nil,& arguments[0]),QUAL(10),sched)) != Normal)
     goto ch_raise_exception;
  return;
c109:
/* move 28.2 44 */
  (*(REF(28)DOT(2).tsdr)->finalize)(REF(28)DOT(2).value,F_DISCARD,sched);
  REF(28)DOT(2) = REF(44);
  REF(44).tsdr = & dr_bottom;
/* return 28 */
  if (ch_caller = do_return(REF(28).value)) {
    if (ch_caller->type < CProcess) ch_caller->ip++;
      sched->wakeup_proc(sched, ch_caller);}
  else rem_return(REF(28).value);
  REF(28).tsdr = & dr_bottom;
/* exit , 11 */
  ch_e = handler_type__exit; ch_val = QUAL(11); goto ch_exception;
c112:
/* endblock */
  che_endblock(sched);
/* branch , 92 */
   goto c92;
c115:
/* endget 39 38 */
  end_selector(DEF(39),DEF(38),sched,GET);
/* discard 38 */
  (*(REF(38).tsdr)->finalize)(REF(38).value,F_DISCARD,sched);
  REF(38).tsdr = & dr_bottom;
/* exit , 7 */
  ch_e = handler_type__exit; ch_val = QUAL(7); goto ch_exception;
c118:
/* endblock */
  che_endblock(sched);
/* branch , 56 */
   goto c56;
c120:
/* discard 36 */
  (*(REF(36).tsdr)->finalize)(REF(36).value,F_DISCARD,sched);
  REF(36).tsdr = & dr_bottom;
/* discard 33 */
  (*(REF(33).tsdr)->finalize)(REF(33).value,F_DISCARD,sched);
  REF(33).tsdr = & dr_bottom;
/* return_exception 28 , 14 */
  if (ch_caller = do_return(REF(28).value)) {
    raise_user(QUAL(14),ch_caller); 
    sched->wakeup_proc(sched,ch_caller);}
  else rem_return_exception(DEF(28),QUAL(14));
  REF(28).tsdr = & dr_bottom;
/* branch , 56 */
   goto c56;
c124:
/* discard 36 */
  (*(REF(36).tsdr)->finalize)(REF(36).value,F_DISCARD,sched);
  REF(36).tsdr = & dr_bottom;
/* discard 40 */
  (*(REF(40).tsdr)->finalize)(REF(40).value,F_DISCARD,sched);
  REF(40).tsdr = & dr_bottom;
/* discard 33 */
  (*(REF(33).tsdr)->finalize)(REF(33).value,F_DISCARD,sched);
  REF(33).tsdr = & dr_bottom;
/* branch , 56 */
   goto c56;
c128:
/* endblock */
  che_endblock(sched);
/* branch , 141 */
   goto c141;
c130:
/* discard 0 */
  (*(REF(0).tsdr)->finalize)(REF(0).value,F_DISCARD,sched);
  REF(0).tsdr = & dr_bottom;
/* discard 5 */
  (*(REF(5).tsdr)->finalize)(REF(5).value,F_DISCARD,sched);
  REF(5).tsdr = & dr_bottom;
/* discard 22 */
  (*(REF(22).tsdr)->finalize)(REF(22).value,F_DISCARD,sched);
  REF(22).tsdr = & dr_bottom;
/* discard 24 */
  (*(REF(24).tsdr)->finalize)(REF(24).value,F_DISCARD,sched);
  REF(24).tsdr = & dr_bottom;
/* discard 23 */
  (*(REF(23).tsdr)->finalize)(REF(23).value,F_DISCARD,sched);
  REF(23).tsdr = & dr_bottom;
/* discard 27 */
  (*(REF(27).tsdr)->finalize)(REF(27).value,F_DISCARD,sched);
  REF(27).tsdr = & dr_bottom;
/* discard 4 */
  (*(REF(4).tsdr)->finalize)(REF(4).value,F_DISCARD,sched);
  REF(4).tsdr = & dr_bottom;
/* discard 28 */
  (*(REF(28).tsdr)->finalize)(REF(28).value,F_DISCARD,sched);
  REF(28).tsdr = & dr_bottom;
/* discard 36 */
  (*(REF(36).tsdr)->finalize)(REF(36).value,F_DISCARD,sched);
  REF(36).tsdr = & dr_bottom;
/* discard 40 */
  (*(REF(40).tsdr)->finalize)(REF(40).value,F_DISCARD,sched);
  REF(40).tsdr = & dr_bottom;
/* discard 33 */
  (*(REF(33).tsdr)->finalize)(REF(33).value,F_DISCARD,sched);
  REF(33).tsdr = & dr_bottom;
c141:
/* discard 5 */
  (*(REF(5).tsdr)->finalize)(REF(5).value,F_DISCARD,sched);
  REF(5).tsdr = & dr_bottom;
/* discard 22 */
  (*(REF(22).tsdr)->finalize)(REF(22).value,F_DISCARD,sched);
  REF(22).tsdr = & dr_bottom;
/* discard 24 */
  (*(REF(24).tsdr)->finalize)(REF(24).value,F_DISCARD,sched);
  REF(24).tsdr = & dr_bottom;
/* discard 23 */
  (*(REF(23).tsdr)->finalize)(REF(23).value,F_DISCARD,sched);
  REF(23).tsdr = & dr_bottom;
/* discard 27 */
  (*(REF(27).tsdr)->finalize)(REF(27).value,F_DISCARD,sched);
  REF(27).tsdr = & dr_bottom;
/* discard 4 */
  (*(REF(4).tsdr)->finalize)(REF(4).value,F_DISCARD,sched);
  REF(4).tsdr = & dr_bottom;
/* endblock */
  che_endblock(sched);
c149:
/* endprocess */
  che_endprocess(sched); return;
#include "chtail.h"
