#include "chdecl.h"
void CH_typestate_pocall_proglit(current, sched, cop)
#define ARGUMENTS 8
#include "chhead.h"
select: switch (SELECTOR) {
    case 0: goto c0;
    case 1: goto cb1;
    case 2: goto c2;
    case 3: goto c6;
    case 4: goto c14;
    case 5: goto c17;
    case 6: goto cb20;
    case 7: goto c21;
    case 8: goto cb22;
    case 9: goto c23;
    case 10: goto c27;  }
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.7 */
  if((ch_returncode = cp_table(& ch_val, REF(3)DOT(7).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 , 1 */
  if ((ch_returncode = che_new_table(DEF(5),QUAL(1),sched)) != Normal) 
     goto ch_raise_exception;
/* copy 6 3.6 */
  if((ch_returncode = cp_table(& ch_val, REF(3)DOT(6).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(6).tsdr)->finalize)(REF(6).value,F_DISCARD,sched);
  REF(6).value = ch_val;
  REF(6).tsdr = & dr_table;
/* initget 7 6 , 0,0 */
  (*(REF(7).tsdr)->finalize)(REF(7).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(7),DEF(6),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
c6:
/* get_or_goto 7 6 , 17 */
  if ((ch_returncode = get_selected_object(DEF(7),DEF(6),sched)) != Normal)
     goto c17;
/* block , 2 */
  if((ch_returncode = che_block(QUAL(2),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;
/* find 8 4 7 , 0 */
  if (findfunc(DEF(8),DEF(4),(
          arguments[0] = DEF(7),& arguments[0]),sched,0) == FAILURE)
             goto ch_notfound;
/* fremove 9 8 4 , 0 */
  if ((ch_returncode = removefunc(DEF(9),DEF(8),DEF(4),sched,0
    ,NO_TBL,(position *) nil)) != Normal) goto ch_raise_exception;
/* discard 9 */
  (*(REF(9).tsdr)->finalize)(REF(9).value,F_DISCARD,sched);
  REF(9).tsdr = & dr_bottom;
/* endblock */
  che_endblock(sched);
/* branch , 6 */
   goto c6;
c14:
/* copy 10 7 */
  if((ch_returncode = (REF(7).tsdr->copy)(& ch_val, REF(7).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(7).tsdr->number];
/* insert 5 10 */
  if ((ch_returncode = insertfunc(DEF(5),DEF(10),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* branch , 6 */
   goto c6;
c17:
/* endget 7 6 */
  end_selector(DEF(7),DEF(6),sched,GET);
/* discard 6 */
  (*(REF(6).tsdr)->finalize)(REF(6).value,F_DISCARD,sched);
  REF(6).tsdr = & dr_bottom;
/* new_record 3.8 , 2 */
  if ((ch_val.record = new_record(2)) == nil) goto ch_depletion;
  (*(REF(3)DOT(8).tsdr)->finalize)(REF(3)DOT(8).value,F_DISCARD,sched);
  REF(3)DOT(8).value = ch_val; REF(3)DOT(8).tsdr = & dr_record;
  current->ip = 6;
cb20:
/* call 3.0.15 3.0 3.4 3.5 4 11 , 3 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(0)DOT(15),
          arguments[1] = DEF(3)DOT(0),
          arguments[2] = DEF(3)DOT(4),
          arguments[3] = DEF(3)DOT(5),
          arguments[4] = DEF(4),
          arguments[5] = DEF(11),
          arguments[5+1] = nil,& arguments[0]),QUAL(3),sched)) != Normal)
     goto ch_raise_exception;
  return;
c21:
/* move 3.8.0 11 */
  (*(REF(3)DOT(8)DOT(0).tsdr)->finalize)(REF(3)DOT(8)DOT(0).value
    ,F_DISCARD,sched);
  REF(3)DOT(8)DOT(0) = REF(11);
  REF(11).tsdr = & dr_bottom;
  current->ip = 8;
cb22:
/* call 3.0.15 3.0 3.4 3.5 5 12 , 3 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(0)DOT(15),
          arguments[1] = DEF(3)DOT(0),
          arguments[2] = DEF(3)DOT(4),
          arguments[3] = DEF(3)DOT(5),
          arguments[4] = DEF(5),
          arguments[5] = DEF(12),
          arguments[5+1] = nil,& arguments[0]),QUAL(3),sched)) != Normal)
     goto ch_raise_exception;
  return;
c23:
/* move 3.8.1 12 */
  (*(REF(3)DOT(8)DOT(1).tsdr)->finalize)(REF(3)DOT(8)DOT(1).value
    ,F_DISCARD,sched);
  REF(3)DOT(8)DOT(1) = REF(12);
  REF(12).tsdr = & dr_bottom;
/* 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);
c27:
/* endprocess */
  che_endprocess(sched); return;
#include "chtail.h"
