#include "chdecl.h"
void CH_getfile(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 cb11;
    case 5: goto c12;
    case 6: goto c14;
    case 7: goto c15;
    case 8: goto cb17;
    case 9: goto c18;
    case 10: goto c21;
    case 11: goto cb22;
    case 12: goto c24;
    case 13: goto cb24;
    case 14: goto c25;
    case 15: goto cb26;
    case 16: goto c27;
    case 17: goto c30;
    case 18: goto c32;
    case 19: goto c34;
    case 20: goto c41;
    case 21: goto c44;
    case 22: goto c46;
    case 23: goto c48;  }
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.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;
/* 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;
c7:
/* noop */
  
/* block , 2 */
  if((ch_returncode = che_block(QUAL(2),sched)) != Normal)
     goto ch_raise_exception;
/* block , 3 */
  if((ch_returncode = che_block(QUAL(3),sched)) != Normal)
     goto ch_raise_exception;
  current->ip = 4;
cb11:
/* receive 6 5 */
  if ((ch_returncode = che_receive(DEF(6),DEF(5),sched)) != Normal)
     goto ch_raise_exception;
  return;
c12:
/* endblock */
  che_endblock(sched);
/* branch , 15 */
   goto c15;
c14:
/* exit , 4 */
  ch_e = handler_type__exit; ch_val = QUAL(4); goto ch_exception;
c15:
/* block , 5 */
  if((ch_returncode = che_block(QUAL(5),sched)) != Normal)
     goto ch_raise_exception;
/* enum_lit 7 , 0 */
  REF(7).value.enumeration = 0;
  REF(7).tsdr = & dr_enumeration;
  current->ip = 8;
cb17:
/* call 4 6.0 7 8 , 6 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(4),
          arguments[1] = DEF(6)DOT(0),
          arguments[2] = DEF(7),
          arguments[3] = DEF(8),
          arguments[3+1] = nil,& arguments[0]),QUAL(6),sched)) != Normal)
     goto ch_raise_exception;
  return;
c18:
/* noop */
  
/* endblock */
  che_endblock(sched);
/* branch , 22 */
   goto c22;
c21:
/* exit , 7 */
  ch_e = handler_type__exit; ch_val = QUAL(7); goto ch_exception;
c22:
  current->ip = 11;
cb22:
/* call 8.22 9 , 8 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(8)DOT(22),
          arguments[1] = DEF(9),
          arguments[1+1] = nil,& arguments[0]),QUAL(8),sched)) != Normal)
     goto ch_raise_exception;
  return;
c23:
c24:
  current->ip = 13;
cb24:
/* call 8.3 9.7 10 , 9 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(8)DOT(3),
          arguments[1] = DEF(9)DOT(7),
          arguments[2] = DEF(10),
          arguments[2+1] = nil,& arguments[0]),QUAL(9),sched)) != Normal)
     goto ch_raise_exception;
  return;
c25:
/* move 6.1 10 */
  (*(REF(6)DOT(1).tsdr)->finalize)(REF(6)DOT(1).value,F_DISCARD,sched);
  REF(6)DOT(1) = REF(10);
  REF(10).tsdr = & dr_bottom;
  current->ip = 15;
cb26:
/* call 8.10 , 10 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(8)DOT(10),
          arguments[0+1] = nil,& arguments[0]),QUAL(10),sched)) != Normal)
     goto ch_raise_exception;
  return;
c27:
/* 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);
/* branch , 41 */
   goto c41;
c30:
/* exit , 4 */
  ch_e = handler_type__exit; ch_val = QUAL(4); goto ch_exception;
c32:
/* return_exception 6 , 11 */
  if (ch_caller = do_return(REF(6).value)) {
    raise_user(QUAL(11),ch_caller); 
    sched->wakeup_proc(sched,ch_caller);}
  else rem_return_exception(DEF(6),QUAL(11));
  REF(6).tsdr = & dr_bottom;
/* branch , 41 */
   goto c41;
c34:
/* discard 6 */
  (*(REF(6).tsdr)->finalize)(REF(6).value,F_DISCARD,sched);
  REF(6).tsdr = & dr_bottom;
/* discard 8 */
  (*(REF(8).tsdr)->finalize)(REF(8).value,F_DISCARD,sched);
  REF(8).tsdr = & dr_bottom;
/* discard 9 */
  (*(REF(9).tsdr)->finalize)(REF(9).value,F_DISCARD,sched);
  REF(9).tsdr = & dr_bottom;
/* discard 10 */
  (*(REF(10).tsdr)->finalize)(REF(10).value,F_DISCARD,sched);
  REF(10).tsdr = & dr_bottom;
/* discard 6 */
  (*(REF(6).tsdr)->finalize)(REF(6).value,F_DISCARD,sched);
  REF(6).tsdr = & dr_bottom;
c41:
/* discard 8 */
  (*(REF(8).tsdr)->finalize)(REF(8).value,F_DISCARD,sched);
  REF(8).tsdr = & dr_bottom;
/* discard 9 */
  (*(REF(9).tsdr)->finalize)(REF(9).value,F_DISCARD,sched);
  REF(9).tsdr = & dr_bottom;
/* branch , 7 */
   goto c7;
c44:
/* endblock */
  che_endblock(sched);
c46:
/* endblock */
  che_endblock(sched);
c48:
/* endprocess */
  che_endprocess(sched); return;
#include "chtail.h"
