#include "chdecl.h"
void CH_typestate_pomvelts(current, sched, cop)
#define ARGUMENTS 9
#include "chhead.h"
select: switch (SELECTOR) {
    case 0: goto c0;
    case 1: goto cb1;
    case 2: goto c2;
    case 3: goto c3;
    case 4: goto c11;
    case 5: goto cb19;
    case 6: goto c20;
    case 7: goto cb24;
    case 8: goto c25;
    case 9: goto cb26;
    case 10: goto c27;
    case 11: goto c49;  }
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:
/* initget 4 3.5.2 , 0,0 */
  (*(REF(4).tsdr)->finalize)(REF(4).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(4),DEF(3)DOT(5)DOT(2),nil,sched,GET,
    0,0)) != Normal) goto ch_raise_exception;
c3:
/* get_or_err 4 3.5.2 */
  if ((ch_returncode = get_selected_object(DEF(4),DEF(3)DOT(5)DOT(2)
    ,sched)) != Normal) goto ch_raise_exception;
/* position 5 4 */
  ch_frame = get_selector_frame(DEF(4),sched);
  ch_t = ch_frame->inspectee->value.table;
  REF(5).value.integer = ch_frame->rmvcount +
    (*(ch_t->tbls[ORDER_TBL].des->position_of))(ch_t,ORDER_TBL,ch_frame->pos);
  REF(5).tsdr = &dr_integer;
/* lookup_at 6 3.7 =(0) */
  if ( !((ch_t = REF(3)DOT(7).value.table)->size) ) goto ch_notfound;
  (*(REF(6).tsdr)->finalize)(REF(6).value,F_DISCARD,sched);
  (*(ch_t->tbls[ORDER_TBL].des->lookup_at))
    (ch_t, ORDER_TBL, & REF(6).value,0);
  REF(6).tsdr = qdatarepmap[ch_t->tsdr->number];
/* copy 7 6 */
  REF(7) = REF(6);
/* notequal . 5 7 , 3 */
  if ( REF(5).value.integer != REF(7).value.integer ) goto c3;
/* initget 8 3.5.2 , 0,0 */
  (*(REF(8).tsdr)->finalize)(REF(8).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(8),DEF(3)DOT(5)DOT(2),nil,sched,GET,
    0,0)) != Normal) goto ch_raise_exception;
c11:
/* get_or_err 8 3.5.2 */
  if ((ch_returncode = get_selected_object(DEF(8),DEF(3)DOT(5)DOT(2)
    ,sched)) != Normal) goto ch_raise_exception;
/* 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;
/* lookup_at 10 3.7 =(1) */
  if (1 >= (ch_t = REF(3)DOT(7).value.table)->size) goto ch_notfound;
  (*(REF(10).tsdr)->finalize)(REF(10).value,F_DISCARD,sched);
  (*(ch_t->tbls[ORDER_TBL].des->lookup_at))
    (ch_t, ORDER_TBL, & REF(10).value,1);
  REF(10).tsdr = qdatarepmap[ch_t->tsdr->number];
/* copy 11 10 */
  REF(11) = REF(10);
/* notequal . 9 11 , 11 */
  if ( REF(9).value.integer != REF(11).value.integer ) goto c11;
/* new_table 12 , 1 */
  if ((ch_returncode = che_new_table(DEF(12),QUAL(1),sched)) != Normal) 
     goto ch_raise_exception;
  current->ip = 5;
cb19:
/* call 3.0.13 3.0 3.1 3.3 3.2 4 13 , 2 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(0)DOT(13),
          arguments[1] = DEF(3)DOT(0),
          arguments[2] = DEF(3)DOT(1),
          arguments[3] = DEF(3)DOT(3),
          arguments[4] = DEF(3)DOT(2),
          arguments[5] = DEF(4),
          arguments[6] = DEF(13),
          arguments[6+1] = nil,& arguments[0]),QUAL(2),sched)) != Normal)
     goto ch_raise_exception;
  return;
c20:
/* noop */
  
/* find 14 3.3 13.0 , 0 */
  if (findfunc(DEF(14),DEF(3)DOT(3),(
          arguments[0] = DEF(13)DOT(0),& arguments[0]),sched,0) == FAILURE)
             goto ch_notfound;
/* find 15 14.1 13.1 , 0 */
  if (findfunc(DEF(15),DEF(14)DOT(1),(
          arguments[0] = DEF(13)DOT(1),& arguments[0]),sched,0) == FAILURE)
             goto ch_notfound;
/* reveal 15.2 , 7 */
  if (7 != REF(15)DOT(2).value.variant->info.variant_case) goto ch_case_error;
  current->ip = 7;
cb24:
/* call 3.0.14 3.0 8 15.2.0.3 16 , 3 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(0)DOT(14),
          arguments[1] = DEF(3)DOT(0),
          arguments[2] = DEF(8),
          arguments[3] = DEF(15)DOT(2)DOT(0)DOT(3),
          arguments[4] = DEF(16),
          arguments[4+1] = nil,& arguments[0]),QUAL(3),sched)) != Normal)
     goto ch_raise_exception;
  return;
c25:
/* merge 3.8.0 16 */
  if ((ch_returncode = mergefunc(DEF(3)DOT(8)DOT(0),DEF(16)
    ,FALSE,0)) != Normal) goto ch_raise_exception;
  current->ip = 9;
cb26:
/* call 3.0.4 3.6 8 12 17 , 4 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(0)DOT(4),
          arguments[1] = DEF(3)DOT(6),
          arguments[2] = DEF(8),
          arguments[3] = DEF(12),
          arguments[4] = DEF(17),
          arguments[4+1] = nil,& arguments[0]),QUAL(4),sched)) != Normal)
     goto ch_raise_exception;
  return;
c27:
/* size 18 17 */
  REF(18).value.integer = REF(17).value.table->size;
  REF(18).tsdr = & dr_integer;
/* ile . 18 =(0) , 44 */
  if ( REF(18).value.integer <= 0 ) goto c44;
/* privatize 17 */
  if (REF(17).value.table->refcount != 1)
    if ((ch_returncode = doCopyOnWrite(DEF(17))) != Normal)
       goto ch_raise_exception;
/* initget 19 17 , 0,0 */
  (*(REF(19).tsdr)->finalize)(REF(19).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(19),DEF(17),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
/* get_or_err 19 17 */
  if ((ch_returncode = get_selected_object(DEF(19),DEF(17),sched)) != Normal)
     goto ch_raise_exception;
/* remove 20 19 17 */
  if ((ch_returncode = che_remove(DEF(20),DEF(19),DEF(17),sched)) != Normal)
     goto ch_raise_exception;
/* endget 19 17 */
  end_selector(DEF(19),DEF(17),sched,GET);
/* boolean 21 , FALSE */
  REF(21).value.boolean = FALSE;
  REF(21).tsdr = & dr_boolean;
/* find_or_goto 22 3.8.0 20 , 0,39 */
  if (findfunc(DEF(22),DEF(3)DOT(8)DOT(0),(
          arguments[0] = DEF(20),& arguments[0]),sched,0) == FAILURE) goto c39;
/* boolean 21 , TRUE */
  REF(21).value.boolean = TRUE;
  REF(21).tsdr = & dr_boolean;
c39:
/* branch_false 21 , 42 */
  if ( !REF(21).value.boolean ) goto c42;
/* discard 20 */
  (*(REF(20).tsdr)->finalize)(REF(20).value,F_DISCARD,sched);
  REF(20).tsdr = & dr_bottom;
/* branch , 27 */
   goto c27;
c42:
/* insert 3.8.1 20 */
  if ((ch_returncode = insertfunc(DEF(3)DOT(8)DOT(1),DEF(20)
    ,FALSE,0)) != Normal) goto ch_raise_exception;
/* branch , 27 */
   goto c27;
c44:
/* endget 8 3.5.2 */
  end_selector(DEF(8),DEF(3)DOT(5)DOT(2),sched,GET);
/* endget 4 3.5.2 */
  end_selector(DEF(4),DEF(3)DOT(5)DOT(2),sched,GET);
/* 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);
c49:
/* endprocess */
  che_endprocess(sched); return;
#include "chtail.h"
