#include "chdecl.h"
void CH_typestate_tscc_proglit(current, sched, cop)
#define ARGUMENTS 10
#include "chhead.h"
select: switch (SELECTOR) {
    case 0: goto c0;
    case 1: goto cb1;
    case 2: goto c2;
    case 3: goto cb6;
    case 4: goto c7;
    case 5: goto cb26;
    case 6: goto c27;
    case 7: goto cb30;
    case 8: goto c31;
    case 9: goto c56;
    case 10: goto c68;
    case 11: goto c91;  }
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:
/* new_record 4 , 2 */
  if ((ch_val.record = new_record(2)) == nil) goto ch_depletion;
  (*(REF(4).tsdr)->finalize)(REF(4).value,F_DISCARD,sched);
  REF(4).value = ch_val; REF(4).tsdr = & dr_record;
/* copy 4.0 3.4.0 */
  if((ch_returncode = (REF(3)DOT(4)DOT(0).tsdr->copy)(& ch_val, 
    REF(3)DOT(4)DOT(0).value)) != Normal) goto ch_raise_exception;
  (*(REF(4)DOT(0).tsdr)->finalize)(REF(4)DOT(0).value,F_DISCARD,sched);
  REF(4)DOT(0).value = ch_val;
  REF(4)DOT(0).tsdr = datarepmap[REF(3)DOT(4)DOT(0).tsdr->number];
/* copy 4.1 3.4.1 */
  if((ch_returncode = (REF(3)DOT(4)DOT(1).tsdr->copy)(& ch_val, 
    REF(3)DOT(4)DOT(1).value)) != Normal) goto ch_raise_exception;
  (*(REF(4)DOT(1).tsdr)->finalize)(REF(4)DOT(1).value,F_DISCARD,sched);
  REF(4)DOT(1).value = ch_val;
  REF(4)DOT(1).tsdr = datarepmap[REF(3)DOT(4)DOT(1).tsdr->number];
/* copy 5 3.6 */
  if((ch_returncode = cp_table(& ch_val, REF(3)DOT(6).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(5).tsdr)->finalize)(REF(5).value,F_DISCARD,sched);
  REF(5).value = ch_val;
  REF(5).tsdr = & dr_table;
  current->ip = 3;
cb6:
/* call 3.0.13 3.0 3.1.0 3.2 3.7 3.5 6 , 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(1)DOT(0),
          arguments[3] = DEF(3)DOT(2),
          arguments[4] = DEF(3)DOT(7),
          arguments[5] = DEF(3)DOT(5),
          arguments[6] = DEF(6),
          arguments[6+1] = nil,& arguments[0]),QUAL(1),sched)) != Normal)
     goto ch_raise_exception;
  return;
c7:
/* noop */
  
/* find 7 3.2 6.0 , 0 */
  if (findfunc(DEF(7),DEF(3)DOT(2),(
          arguments[0] = DEF(6)DOT(0),& arguments[0]),sched,0) == FAILURE)
             goto ch_notfound;
/* find 8 7.1 6.1 , 0 */
  if (findfunc(DEF(8),DEF(7)DOT(1),(
          arguments[0] = DEF(6)DOT(1),& arguments[0]),sched,0) == FAILURE)
             goto ch_notfound;
/* reveal 8.2 , 7 */
  if (7 != REF(8)DOT(2).value.variant->info.variant_case) goto ch_case_error;
/* copy 9 4 */
  if((ch_returncode = cp_record(& ch_val, REF(4).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(9).tsdr)->finalize)(REF(9).value,F_DISCARD,sched);
  REF(9).value = ch_val;
  REF(9).tsdr = & dr_record;
/* insert_at 3.7.3 9 =(0) */
  if ((ch_returncode = insertfunc(DEF(3)DOT(7)DOT(3),DEF(9),TRUE, 0
    )) != Normal) goto ch_raise_exception;
/* copy 10 4 */
  if((ch_returncode = cp_record(& ch_val, REF(4).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(10).tsdr)->finalize)(REF(10).value,F_DISCARD,sched);
  REF(10).value = ch_val;
  REF(10).tsdr = & dr_record;
/* insert_at 3.7.4 10 =(0) */
  if ((ch_returncode = insertfunc(DEF(3)DOT(7)DOT(4),DEF(10),TRUE, 0
    )) != Normal) goto ch_raise_exception;
/* copy 11 3.4.0 */
  if((ch_returncode = (REF(3)DOT(4)DOT(0).tsdr->copy)(& ch_val, 
    REF(3)DOT(4)DOT(0).value)) != Normal) goto ch_raise_exception;
  (*(REF(11).tsdr)->finalize)(REF(11).value,F_DISCARD,sched);
  REF(11).value = ch_val;
  REF(11).tsdr = datarepmap[REF(3)DOT(4)DOT(0).tsdr->number];
/* insert 3.7.0 11 */
  if ((ch_returncode = insertfunc(DEF(3)DOT(7)DOT(0),DEF(11)
    ,FALSE,0)) != Normal) goto ch_raise_exception;
/* branch_false 8.2.0.0 , 23 */
  if ( !REF(8)DOT(2)DOT(0)DOT(0).value.boolean ) goto c23;
/* copy 12 4 */
  if((ch_returncode = cp_record(& ch_val, REF(4).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(12).tsdr)->finalize)(REF(12).value,F_DISCARD,sched);
  REF(12).value = ch_val;
  REF(12).tsdr = & dr_record;
/* insert_at 3.7.5 12 =(0) */
  if ((ch_returncode = insertfunc(DEF(3)DOT(7)DOT(5),DEF(12),TRUE, 0
    )) != Normal) goto ch_raise_exception;
c23:
/* new_record 13 , 2 */
  if ((ch_val.record = new_record(2)) == nil) goto ch_depletion;
  (*(REF(13).tsdr)->finalize)(REF(13).value,F_DISCARD,sched);
  REF(13).value = ch_val; REF(13).tsdr = & dr_record;
/* copy 13.0 4 */
  if((ch_returncode = cp_record(& ch_val, REF(4).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(13)DOT(0).tsdr)->finalize)(REF(13)DOT(0).value,F_DISCARD,sched);
  REF(13)DOT(0).value = ch_val;
  REF(13)DOT(0).tsdr = & dr_record;
/* new_table 13.1 , 2 */
  if ((ch_returncode = che_new_table(DEF(13)DOT(1),QUAL(2),sched)) != Normal) 
     goto ch_raise_exception;
  current->ip = 5;
cb26:
/* call 3.0.14 3.0 13 8.2.0.3 14 , 3 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(0)DOT(14),
          arguments[1] = DEF(3)DOT(0),
          arguments[2] = DEF(13),
          arguments[3] = DEF(8)DOT(2)DOT(0)DOT(3),
          arguments[4] = DEF(14),
          arguments[4+1] = nil,& arguments[0]),QUAL(3),sched)) != Normal)
     goto ch_raise_exception;
  return;
c27:
/* merge 5 14 */
  if ((ch_returncode = mergefunc(DEF(5),DEF(14),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* find 15 3.1.0 3.4.0 , 0 */
  if (findfunc(DEF(15),DEF(3)DOT(1)DOT(0),(
          arguments[0] = DEF(3)DOT(4)DOT(0),& arguments[0]),sched,0
            ) == FAILURE) goto ch_notfound;
/* block , 4 */
  if((ch_returncode = che_block(QUAL(4),sched)) != Normal)
     goto ch_raise_exception;
  current->ip = 7;
cb30:
/* call 3.0.0 3.0 3.1 3.2 15.2 5 16 3.7 , 5 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(0)DOT(0),
          arguments[1] = DEF(3)DOT(0),
          arguments[2] = DEF(3)DOT(1),
          arguments[3] = DEF(3)DOT(2),
          arguments[4] = DEF(15)DOT(2),
          arguments[5] = DEF(5),
          arguments[6] = DEF(16),
          arguments[7] = DEF(3)DOT(7),
          arguments[7+1] = nil,& arguments[0]),QUAL(5),sched)) != Normal)
     goto ch_raise_exception;
  return;
c31:
/* new_record 17 , 2 */
  if ((ch_val.record = new_record(2)) == nil) goto ch_depletion;
  (*(REF(17).tsdr)->finalize)(REF(17).value,F_DISCARD,sched);
  REF(17).value = ch_val; REF(17).tsdr = & dr_record;
/* unite 17.0 18 , 0 */
  if ((ch_returncode = che_unite(DEF(17)DOT(0),DEF(18),sched,0)) != Normal)
     goto ch_raise_exception;
/* new_table 17.1 , 2 */
  if ((ch_returncode = che_new_table(DEF(17)DOT(1),QUAL(2),sched)) != Normal) 
     goto ch_raise_exception;
/* copy 19 3.4.2 */
  if((ch_returncode = (REF(3)DOT(4)DOT(2).tsdr->copy)(& ch_val, 
    REF(3)DOT(4)DOT(2).value)) != Normal) goto ch_raise_exception;
  (*(REF(19).tsdr)->finalize)(REF(19).value,F_DISCARD,sched);
  REF(19).value = ch_val;
  REF(19).tsdr = datarepmap[REF(3)DOT(4)DOT(2).tsdr->number];
/* insert 17.1 19 */
  if ((ch_returncode = insertfunc(DEF(17)DOT(1),DEF(19),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* boolean 20 , FALSE */
  REF(20).value.boolean = FALSE;
  REF(20).tsdr = & dr_boolean;
/* find_or_goto 21 16 17 , 0,39 */
  if (findfunc(DEF(21),DEF(16),(
          arguments[0] = DEF(17),& arguments[0]),sched,0) == FAILURE) goto c39;
/* boolean 20 , TRUE */
  REF(20).value.boolean = TRUE;
  REF(20).tsdr = & dr_boolean;
c39:
/* branch_false 20 , 41 */
  if ( !REF(20).value.boolean ) goto c41;
/* branch , 53 */
   goto c53;
c41:
/* new_record 22 , 3 */
  if ((ch_val.record = new_record(3)) == nil) goto ch_depletion;
  (*(REF(22).tsdr)->finalize)(REF(22).value,F_DISCARD,sched);
  REF(22).value = ch_val; REF(22).tsdr = & dr_record;
/* copy 23 3.3 */
  if((ch_returncode = (REF(3)DOT(3).tsdr->copy)(& ch_val, REF(3)DOT(3).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(23).tsdr)->finalize)(REF(23).value,F_DISCARD,sched);
  REF(23).value = ch_val;
  REF(23).tsdr = datarepmap[REF(3)DOT(3).tsdr->number];
/* unite 22.0 23 , 0 */
  if ((ch_returncode = che_unite(DEF(22)DOT(0),DEF(23),sched,0)) != Normal)
     goto ch_raise_exception;
/* ordenum_lit 22.1 , 16 */
  REF(22)DOT(1).value.ord_enum = 16;
  REF(22)DOT(1).tsdr = & dr_ord_enumeration;
/* new_table 22.2 , 2 */
  if ((ch_returncode = che_new_table(DEF(22)DOT(2),QUAL(2),sched)) != Normal) 
     goto ch_raise_exception;
/* unite 24 17 , 1 */
  if ((ch_returncode = che_unite(DEF(24),DEF(17),sched,1)) != Normal)
     goto ch_raise_exception;
/* insert 22.2 24 */
  if ((ch_returncode = insertfunc(DEF(22)DOT(2),DEF(24),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* insert 3.7.11 22 */
  if ((ch_returncode = insertfunc(DEF(3)DOT(7)DOT(11),DEF(22)
    ,FALSE,0)) != Normal) goto ch_raise_exception;
c53:
/* discard 17 */
  (*(REF(17).tsdr)->finalize)(REF(17).value,F_DISCARD,sched);
  REF(17).tsdr = & dr_bottom;
/* endblock */
  che_endblock(sched);
/* branch , 68 */
   goto c68;
c56:
/* new_record 22 , 3 */
  if ((ch_val.record = new_record(3)) == nil) goto ch_depletion;
  (*(REF(22).tsdr)->finalize)(REF(22).value,F_DISCARD,sched);
  REF(22).value = ch_val; REF(22).tsdr = & dr_record;
/* copy 25 3.3 */
  if((ch_returncode = (REF(3)DOT(3).tsdr->copy)(& ch_val, REF(3)DOT(3).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(25).tsdr)->finalize)(REF(25).value,F_DISCARD,sched);
  REF(25).value = ch_val;
  REF(25).tsdr = datarepmap[REF(3)DOT(3).tsdr->number];
/* unite 22.0 25 , 0 */
  if ((ch_returncode = che_unite(DEF(22)DOT(0),DEF(25),sched,0)) != Normal)
     goto ch_raise_exception;
/* ordenum_lit 22.1 , 12 */
  REF(22)DOT(1).value.ord_enum = 12;
  REF(22)DOT(1).tsdr = & dr_ord_enumeration;
/* new_table 22.2 , 2 */
  if ((ch_returncode = che_new_table(DEF(22)DOT(2),QUAL(2),sched)) != Normal) 
     goto ch_raise_exception;
/* chs_lit 26 , "Selector guard expression does not terminate" */
  if( !chs_lit(DEF(26),"Selector guard expression does not terminate") )
     goto ch_depletion;
/* unite 24 26 , 3 */
  if ((ch_returncode = che_unite(DEF(24),DEF(26),sched,3)) != Normal)
     goto ch_raise_exception;
/* insert 22.2 24 */
  if ((ch_returncode = insertfunc(DEF(22)DOT(2),DEF(24),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* insert 3.7.11 22 */
  if ((ch_returncode = insertfunc(DEF(3)DOT(7)DOT(11),DEF(22)
    ,FALSE,0)) != Normal) goto ch_raise_exception;
c68:
/* discard 16 */
  (*(REF(16).tsdr)->finalize)(REF(16).value,F_DISCARD,sched);
  REF(16).tsdr = & dr_bottom;
/* privatize 3.7.0 */
  if (REF(3)DOT(7)DOT(0).value.table->refcount != 1)
    if ((ch_returncode = doCopyOnWrite(DEF(3)DOT(7)DOT(0))) != Normal)
       goto ch_raise_exception;
/* size 27 3.7.0 */
  REF(27).value.integer = REF(3)DOT(7)DOT(0).value.table->size;
  REF(27).tsdr = & dr_integer;
/* isubtract 28 27 =(1) */
  if (!chf_isubtract(DEF(28),REF(27).value.integer,1)) goto ch_depletion;
/* lookup_at 29 3.7.0 28 */
  if((ch_i = REF(28).value.integer) < 0 || ch_i >= (ch_t = 
    REF(3)DOT(7)DOT(0).value.table)->size) goto ch_notfound;
  (*(REF(29).tsdr)->finalize)(REF(29).value,F_DISCARD,sched);
  (*(ch_t->tbls[ORDER_TBL].des->lookup_at))
    (ch_t, ORDER_TBL, & REF(29).value,ch_i);
  REF(29).tsdr = qdatarepmap[ch_t->tsdr->number];
/* remove_at 30 3.7.0 28 */
  if ((ch_returncode = remove_at_func(DEF(30),DEF(3)DOT(7)DOT(0),
    REF(28).value.integer)) != Normal) goto ch_raise_exception;
/* privatize 3.7.4 */
  if (REF(3)DOT(7)DOT(4).value.table->refcount != 1)
    if ((ch_returncode = doCopyOnWrite(DEF(3)DOT(7)DOT(4))) != Normal)
       goto ch_raise_exception;
/* lookup_at 31 3.7.4 =(0) */
  if ( !((ch_t = REF(3)DOT(7)DOT(4).value.table)->size) ) goto ch_notfound;
  (*(REF(31).tsdr)->finalize)(REF(31).value,F_DISCARD,sched);
  (*(ch_t->tbls[ORDER_TBL].des->lookup_at))
    (ch_t, ORDER_TBL, & REF(31).value,0);
  REF(31).tsdr = qdatarepmap[ch_t->tsdr->number];
/* remove_at 4 3.7.4 =(0) */
  if ((ch_returncode = remove_at_func(DEF(4),DEF(3)DOT(7)DOT(4),0)) != Normal)
     goto ch_raise_exception;
/* privatize 3.7.3 */
  if (REF(3)DOT(7)DOT(3).value.table->refcount != 1)
    if ((ch_returncode = doCopyOnWrite(DEF(3)DOT(7)DOT(3))) != Normal)
       goto ch_raise_exception;
/* lookup_at 32 3.7.3 =(0) */
  if ( !((ch_t = REF(3)DOT(7)DOT(3).value.table)->size) ) goto ch_notfound;
  (*(REF(32).tsdr)->finalize)(REF(32).value,F_DISCARD,sched);
  (*(ch_t->tbls[ORDER_TBL].des->lookup_at))
    (ch_t, ORDER_TBL, & REF(32).value,0);
  REF(32).tsdr = qdatarepmap[ch_t->tsdr->number];
/* remove_at 4 3.7.3 =(0) */
  if ((ch_returncode = remove_at_func(DEF(4),DEF(3)DOT(7)DOT(3),0)) != Normal)
     goto ch_raise_exception;
/* branch_false 8.2.0.0 , 88 */
  if ( !REF(8)DOT(2)DOT(0)DOT(0).value.boolean ) goto c88;
/* privatize 3.7.5 */
  if (REF(3)DOT(7)DOT(5).value.table->refcount != 1)
    if ((ch_returncode = doCopyOnWrite(DEF(3)DOT(7)DOT(5))) != Normal)
       goto ch_raise_exception;
/* lookup_at 33 3.7.5 =(0) */
  if ( !((ch_t = REF(3)DOT(7)DOT(5).value.table)->size) ) goto ch_notfound;
  (*(REF(33).tsdr)->finalize)(REF(33).value,F_DISCARD,sched);
  (*(ch_t->tbls[ORDER_TBL].des->lookup_at))
    (ch_t, ORDER_TBL, & REF(33).value,0);
  REF(33).tsdr = qdatarepmap[ch_t->tsdr->number];
/* remove_at 4 3.7.5 =(0) */
  if ((ch_returncode = remove_at_func(DEF(4),DEF(3)DOT(7)DOT(5),0)) != Normal)
     goto ch_raise_exception;
c88:
/* 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);
c91:
/* endprocess */
  che_endprocess(sched); return;
#include "chtail.h"
