#include "chdecl.h"
void CH_typestate_predupkey(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 cb10;
    case 5: goto c11;
    case 6: goto cb21;
    case 7: goto c22;
    case 8: 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:
/* initget 4 3.4.2 , 0,0 */
  (*(REF(4).tsdr)->finalize)(REF(4).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(4),DEF(3)DOT(4)DOT(2),nil,sched,GET,
    0,0)) != Normal) goto ch_raise_exception;
c3:
/* get_or_err 4 3.4.2 */
  if ((ch_returncode = get_selected_object(DEF(4),DEF(3)DOT(4)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;
  current->ip = 4;
cb10:
/* call 3.0.13 3.0 3.2 3.1 3.3 4 8 , 1 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(0)DOT(13),
          arguments[1] = DEF(3)DOT(0),
          arguments[2] = DEF(3)DOT(2),
          arguments[3] = DEF(3)DOT(1),
          arguments[4] = DEF(3)DOT(3),
          arguments[5] = DEF(4),
          arguments[6] = DEF(8),
          arguments[6+1] = nil,& arguments[0]),QUAL(1),sched)) != Normal)
     goto ch_raise_exception;
  return;
c11:
/* noop */
  
/* find 9 3.1 8.0 , 0 */
  if (findfunc(DEF(9),DEF(3)DOT(1),(
          arguments[0] = DEF(8)DOT(0),& arguments[0]),sched,0) == FAILURE)
             goto ch_notfound;
/* find 10 9.1 8.1 , 0 */
  if (findfunc(DEF(10),DEF(9)DOT(1),(
          arguments[0] = DEF(8)DOT(1),& arguments[0]),sched,0) == FAILURE)
             goto ch_notfound;
/* reveal 10.2 , 7 */
  if (7 != REF(10)DOT(2).value.variant->info.variant_case) goto ch_case_error;
/* size 11 10.2.0.1 */
  REF(11).value.integer = REF(10)DOT(2)DOT(0)DOT(1).value.table->size;
  REF(11).tsdr = & dr_integer;
/* ile . 11 =(0) , 22 */
  if ( REF(11).value.integer <= 0 ) goto c22;
/* ordenum_lit 12 , 6 */
  REF(12).value.ord_enum = 6;
  REF(12).tsdr = & dr_ord_enumeration;
/* unite 13 12 , 0 */
  if ((ch_returncode = che_unite(DEF(13),DEF(12),sched,0)) != Normal)
     goto ch_raise_exception;
  current->ip = 6;
cb21:
/* call 3.0.5 3.0 3.2 3.1 3.3 13 3.6 , 2 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(0)DOT(5),
          arguments[1] = DEF(3)DOT(0),
          arguments[2] = DEF(3)DOT(2),
          arguments[3] = DEF(3)DOT(1),
          arguments[4] = DEF(3)DOT(3),
          arguments[5] = DEF(13),
          arguments[6] = DEF(3)DOT(6),
          arguments[6+1] = nil,& arguments[0]),QUAL(2),sched)) != Normal)
     goto ch_raise_exception;
  return;
c22:
/* discard 13 */
  (*(REF(13).tsdr)->finalize)(REF(13).value,F_DISCARD,sched);
  REF(13).tsdr = & dr_bottom;
/* endget 4 3.4.2 */
  end_selector(DEF(4),DEF(3)DOT(4)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);
c27:
/* endprocess */
  che_endprocess(sched); return;
#include "chtail.h"
