#include "chdecl.h"
void CH_typestate_tsapost_proglit(current, sched, cop)
#define ARGUMENTS 11
#include "chhead.h"
select: switch (SELECTOR) {
    case 0: goto c0;
    case 1: goto cb1;
    case 2: goto c2;
    case 3: goto cb13;
    case 4: goto c14;
    case 5: goto cb52;
    case 6: goto c53;
    case 7: goto c55;
    case 8: goto cb57;
    case 9: goto c58;
    case 10: goto c73;
    case 11: goto cb74;
    case 12: goto c75;
    case 13: goto c82;
    case 14: goto c83;
    case 15: goto c86;
    case 16: goto c94;
    case 17: goto c97;
    case 18: goto c101;
    case 19: goto c105;  }
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:
/* block , 1 */
  if((ch_returncode = che_block(QUAL(1),sched)) != Normal)
     goto ch_raise_exception;
/* lookup_at 4 3.7.1 =(0) */
  if ( !((ch_t = REF(3)DOT(7)DOT(1).value.table)->size) ) goto ch_notfound;
  (*(REF(4).tsdr)->finalize)(REF(4).value,F_DISCARD,sched);
  (*(ch_t->tbls[ORDER_TBL].des->lookup_at))
    (ch_t, ORDER_TBL, & REF(4).value,0);
  REF(4).tsdr = qdatarepmap[ch_t->tsdr->number];
/* copy 5 4 */
  if((ch_returncode = (REF(4).tsdr->copy)(& ch_val, REF(4).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(5).tsdr)->finalize)(REF(5).value,F_DISCARD,sched);
  REF(5).value = ch_val;
  REF(5).tsdr = datarepmap[REF(4).tsdr->number];
/* privatize 5.1 */
  if (REF(5)DOT(1).value.table->refcount != 1)
    if ((ch_returncode = doCopyOnWrite(DEF(5)DOT(1))) != Normal)
       goto ch_raise_exception;
/* size 6 5.1 */
  REF(6).value.integer = REF(5)DOT(1).value.table->size;
  REF(6).tsdr = & dr_integer;
/* isubtract 7 6 =(1) */
  if (!chf_isubtract(DEF(7),REF(6).value.integer,1)) goto ch_depletion;
/* lookup_at 8 5.1 7 */
  if((ch_i = REF(7).value.integer) < 0 || ch_i >= (ch_t = REF(5)DOT(1).value
    .table)->size) goto ch_notfound;
  (*(REF(8).tsdr)->finalize)(REF(8).value,F_DISCARD,sched);
  (*(ch_t->tbls[ORDER_TBL].des->lookup_at))
    (ch_t, ORDER_TBL, & REF(8).value,ch_i);
  REF(8).tsdr = qdatarepmap[ch_t->tsdr->number];
/* remove_at 9 5.1 7 */
  if ((ch_returncode = remove_at_func(DEF(9),DEF(5)DOT(1),REF(7).value.integer
    )) != Normal) goto ch_raise_exception;
  current->ip = 3;
cb13:
/* call 3.0.13 3.0 3.1 3.2 3.4 5 10 , 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(2),
          arguments[4] = DEF(3)DOT(4),
          arguments[5] = DEF(5),
          arguments[6] = DEF(10),
          arguments[6+1] = nil,& arguments[0]),QUAL(2),sched)) != Normal)
     goto ch_raise_exception;
  return;
c14:
/* noop */
  
/* find 11 3.2 10.0 , 0 */
  if (findfunc(DEF(11),DEF(3)DOT(2),(
          arguments[0] = DEF(10)DOT(0),& arguments[0]),sched,0) == FAILURE)
             goto ch_notfound;
/* find 12 11.1 10.1 , 0 */
  if (findfunc(DEF(12),DEF(11)DOT(1),(
          arguments[0] = DEF(10)DOT(1),& arguments[0]),sched,0) == FAILURE)
             goto ch_notfound;
/* 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;
/* new_table 13.1 , 3 */
  if ((ch_returncode = che_new_table(DEF(13)DOT(1),QUAL(3),sched)) != Normal) 
     goto ch_raise_exception;
/* ord_case 14 12.2 */
  REF(14).value.ord_enum = REF(12)DOT(2).value.variant->info.variant_case;
  REF(14).tsdr = & dr_ord_enumeration;
/* equal 15 14 =(5) */
  REF(15).value.boolean = (REF(14).value.ord_enum == 5);
  REF(15).tsdr = & dr_boolean;
/* ord_case 16 12.2 */
  REF(16).value.ord_enum = REF(12)DOT(2).value.variant->info.variant_case;
  REF(16).tsdr = & dr_ord_enumeration;
/* equal 17 16 =(10) */
  REF(17).value.boolean = (REF(16).value.ord_enum == 10);
  REF(17).tsdr = & dr_boolean;
/* or 18 15 17 */
  REF(18).value.boolean = REF(15).value.boolean|REF(17).value.boolean;
  REF(18).tsdr = & dr_boolean;
/* select * 18 , {28} */
  if ( REF(18).value.boolean ) goto c28;
/* branch , 31 */
   goto c31;
c28:
/* unite 13.0 19 , 0 */
  if ((ch_returncode = che_unite(DEF(13)DOT(0),DEF(19),sched,0)) != Normal)
     goto ch_raise_exception;
/* insert 13.1 5 */
  if ((ch_returncode = insertfunc(DEF(13)DOT(1),DEF(5),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* branch , 36 */
   goto c36;
c31:
/* unite 13.0 19 , 1 */
  if ((ch_returncode = che_unite(DEF(13)DOT(0),DEF(19),sched,1)) != Normal)
     goto ch_raise_exception;
/* copy 20 5 */
  if((ch_returncode = (REF(5).tsdr->copy)(& ch_val, REF(5).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(20).tsdr)->finalize)(REF(20).value,F_DISCARD,sched);
  REF(20).value = ch_val;
  REF(20).tsdr = datarepmap[REF(5).tsdr->number];
/* insert 13.1 20 */
  if ((ch_returncode = insertfunc(DEF(13)DOT(1),DEF(20),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* insert 5.1 9 */
  if ((ch_returncode = insertfunc(DEF(5)DOT(1),DEF(9),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* insert 13.1 5 */
  if ((ch_returncode = insertfunc(DEF(13)DOT(1),DEF(5),FALSE,0)) != Normal)
     goto ch_raise_exception;
c36:
/* discard 9 */
  (*(REF(9).tsdr)->finalize)(REF(9).value,F_DISCARD,sched);
  REF(9).tsdr = & dr_bottom;
/* boolean 21 , FALSE */
  REF(21).value.boolean = FALSE;
  REF(21).tsdr = & dr_boolean;
/* find_or_goto 22 3.6 13 , 0,41 */
  if (findfunc(DEF(22),DEF(3)DOT(6),(
          arguments[0] = DEF(13),& arguments[0]),sched,0) == FAILURE) goto c41;
/* boolean 21 , TRUE */
  REF(21).value.boolean = TRUE;
  REF(21).tsdr = & dr_boolean;
c41:
/* branch_false 21 , 43 */
  if ( !REF(21).value.boolean ) goto c43;
/* branch , 74 */
   goto c74;
c43:
/* boolean 23 , FALSE */
  REF(23).value.boolean = FALSE;
  REF(23).tsdr = & dr_boolean;
/* find_or_goto 24 3.5.0 13 , 0,46 */
  if (findfunc(DEF(24),DEF(3)DOT(5)DOT(0),(
          arguments[0] = DEF(13),& arguments[0]),sched,0) == FAILURE) goto c46;
/* boolean 23 , TRUE */
  REF(23).value.boolean = TRUE;
  REF(23).tsdr = & dr_boolean;
c46:
/* branch_false 23 , 57 */
  if ( !REF(23).value.boolean ) goto c57;
/* block , 4 */
  if((ch_returncode = che_block(QUAL(4),sched)) != Normal)
     goto ch_raise_exception;
/* currentprogram 25 */
  if ((ch_val.program = make_pgm_copy(sched->ready->prog)) == nil)
     goto ch_depletion;
  (*(REF(25).tsdr)->finalize)(REF(25).value,F_DISCARD,sched);
  REF(25).value = ch_val; REF(25).tsdr = & dr_program;
/* procedure 26 25 , 5 */
  if ((ch_returncode = che_procedure(DEF(26),DEF(25),QUAL(5)
    ,sched)) != Normal) goto ch_raise_exception;
/* discard 25 */
  (*(REF(25).tsdr)->finalize)(REF(25).value,F_DISCARD,sched);
  REF(25).tsdr = & dr_bottom;
/* move 27 26 */
  (*(REF(27).tsdr)->finalize)(REF(27).value,F_DISCARD,sched);
  REF(27) = REF(26);
  REF(26).tsdr = & dr_bottom;
  current->ip = 5;
cb52:
/* call 27 3.0 3.1 3.2 3.3 3.4 3.5 3.6 13 , 6 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(27),
          arguments[1] = DEF(3)DOT(0),
          arguments[2] = DEF(3)DOT(1),
          arguments[3] = DEF(3)DOT(2),
          arguments[4] = DEF(3)DOT(3),
          arguments[5] = DEF(3)DOT(4),
          arguments[6] = DEF(3)DOT(5),
          arguments[7] = DEF(3)DOT(6),
          arguments[8] = DEF(13),
          arguments[8+1] = nil,& arguments[0]),QUAL(6),sched)) != Normal)
     goto ch_raise_exception;
  return;
c53:
/* endblock */
  che_endblock(sched);
/* branch , 73 */
   goto c73;
c55:
/* exit , 7 */
  ch_e = handler_type__exit; ch_val = QUAL(7); goto ch_exception;
c57:
  current->ip = 8;
cb57:
/* call 3.0.10 3.0 3.1 3.2 3.4 13 3.6 28 , 8 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(0)DOT(10),
          arguments[1] = DEF(3)DOT(0),
          arguments[2] = DEF(3)DOT(1),
          arguments[3] = DEF(3)DOT(2),
          arguments[4] = DEF(3)DOT(4),
          arguments[5] = DEF(13),
          arguments[6] = DEF(3)DOT(6),
          arguments[7] = DEF(28),
          arguments[7+1] = nil,& arguments[0]),QUAL(8),sched)) != Normal)
     goto ch_raise_exception;
  return;
c58:
/* branch_false 28 , 60 */
  if ( !REF(28).value.boolean ) goto c60;
/* branch , 73 */
   goto c73;
c60:
/* new_record 29 , 3 */
  if ((ch_val.record = new_record(3)) == nil) goto ch_depletion;
  (*(REF(29).tsdr)->finalize)(REF(29).value,F_DISCARD,sched);
  REF(29).value = ch_val; REF(29).tsdr = & dr_record;
/* copy 30 3.3 */
  if((ch_returncode = (REF(3)DOT(3).tsdr->copy)(& ch_val, REF(3)DOT(3).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(30).tsdr)->finalize)(REF(30).value,F_DISCARD,sched);
  REF(30).value = ch_val;
  REF(30).tsdr = datarepmap[REF(3)DOT(3).tsdr->number];
/* unite 29.0 30 , 0 */
  if ((ch_returncode = che_unite(DEF(29)DOT(0),DEF(30),sched,0)) != Normal)
     goto ch_raise_exception;
/* ordenum_lit 29.1 , 18 */
  REF(29)DOT(1).value.ord_enum = 18;
  REF(29)DOT(1).tsdr = & dr_ord_enumeration;
/* new_table 29.2 , 3 */
  if ((ch_returncode = che_new_table(DEF(29)DOT(2),QUAL(3),sched)) != Normal) 
     goto ch_raise_exception;
/* copy 31 3.7 */
  if((ch_returncode = (REF(3)DOT(7).tsdr->copy)(& ch_val, REF(3)DOT(7).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(31).tsdr)->finalize)(REF(31).value,F_DISCARD,sched);
  REF(31).value = ch_val;
  REF(31).tsdr = datarepmap[REF(3)DOT(7).tsdr->number];
/* unite 32 31 , 1 */
  if ((ch_returncode = che_unite(DEF(32),DEF(31),sched,1)) != Normal)
     goto ch_raise_exception;
/* insert 29.2 32 */
  if ((ch_returncode = insertfunc(DEF(29)DOT(2),DEF(32),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* insert 3.4.11 29 */
  if ((ch_returncode = insertfunc(DEF(3)DOT(4)DOT(11),DEF(29)
    ,FALSE,0)) != Normal) goto ch_raise_exception;
/* exit , 7 */
  ch_e = handler_type__exit; ch_val = QUAL(7); goto ch_exception;
c73:
/* discard 27 */
  (*(REF(27).tsdr)->finalize)(REF(27).value,F_DISCARD,sched);
  REF(27).tsdr = & dr_bottom;
c74:
  current->ip = 11;
cb74:
/* call 3.0.10 3.0 3.1 3.2 3.4 3.7 3.6 33 , 8 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(0)DOT(10),
          arguments[1] = DEF(3)DOT(0),
          arguments[2] = DEF(3)DOT(1),
          arguments[3] = DEF(3)DOT(2),
          arguments[4] = DEF(3)DOT(4),
          arguments[5] = DEF(3)DOT(7),
          arguments[6] = DEF(3)DOT(6),
          arguments[7] = DEF(33),
          arguments[7+1] = nil,& arguments[0]),QUAL(8),sched)) != Normal)
     goto ch_raise_exception;
  return;
c75:
/* branch_false 33 , 77 */
  if ( !REF(33).value.boolean ) goto c77;
/* branch , 83 */
   goto c83;
c77:
/* block , 9 */
  if((ch_returncode = che_block(QUAL(9),sched)) != Normal)
     goto ch_raise_exception;
/* copy 34 3.7 */
  if((ch_returncode = (REF(3)DOT(7).tsdr->copy)(& ch_val, REF(3)DOT(7).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(34).tsdr)->finalize)(REF(34).value,F_DISCARD,sched);
  REF(34).value = ch_val;
  REF(34).tsdr = datarepmap[REF(3)DOT(7).tsdr->number];
/* insert 3.6 34 */
  if ((ch_returncode = insertfunc(DEF(3)DOT(6),DEF(34),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* endblock */
  che_endblock(sched);
c82:
/* discard 34 */
  (*(REF(34).tsdr)->finalize)(REF(34).value,F_DISCARD,sched);
  REF(34).tsdr = & dr_bottom;
c83:
/* 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);
/* branch , 101 */
   goto c101;
c86:
/* discard 5 */
  (*(REF(5).tsdr)->finalize)(REF(5).value,F_DISCARD,sched);
  REF(5).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;
/* block , 10 */
  if((ch_returncode = che_block(QUAL(10),sched)) != Normal)
     goto ch_raise_exception;
/* copy 35 3.7 */
  if((ch_returncode = (REF(3)DOT(7).tsdr->copy)(& ch_val, REF(3)DOT(7).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(35).tsdr)->finalize)(REF(35).value,F_DISCARD,sched);
  REF(35).value = ch_val;
  REF(35).tsdr = datarepmap[REF(3)DOT(7).tsdr->number];
/* insert 3.6 35 */
  if ((ch_returncode = insertfunc(DEF(3)DOT(6),DEF(35),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* endblock */
  che_endblock(sched);
c94:
/* discard 35 */
  (*(REF(35).tsdr)->finalize)(REF(35).value,F_DISCARD,sched);
  REF(35).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;
/* branch , 101 */
   goto c101;
c97:
/* discard 13 */
  (*(REF(13).tsdr)->finalize)(REF(13).value,F_DISCARD,sched);
  REF(13).tsdr = & dr_bottom;
/* discard 10 */
  (*(REF(10).tsdr)->finalize)(REF(10).value,F_DISCARD,sched);
  REF(10).tsdr = & dr_bottom;
/* discard 27 */
  (*(REF(27).tsdr)->finalize)(REF(27).value,F_DISCARD,sched);
  REF(27).tsdr = & dr_bottom;
/* return_exception 3 , 11 */
  if (ch_caller = do_return(REF(3).value)) {
    raise_user(QUAL(11),ch_caller); 
    sched->wakeup_proc(sched,ch_caller);}
  else rem_return_exception(DEF(3),QUAL(11));
  REF(3).tsdr = & dr_bottom;
c101:
/* discard 13 */
  (*(REF(13).tsdr)->finalize)(REF(13).value,F_DISCARD,sched);
  REF(13).tsdr = & dr_bottom;
/* discard 10 */
  (*(REF(10).tsdr)->finalize)(REF(10).value,F_DISCARD,sched);
  REF(10).tsdr = & dr_bottom;
/* endblock */
  che_endblock(sched);
c105:
/* endprocess */
  che_endprocess(sched); return;
#include "chtail.h"
