#include "chdecl.h"
void CH_typestate_pocall(current, sched, cop)
#define ARGUMENTS 12
#include "chhead.h"
select: switch (SELECTOR) {
    case 0: goto c0;
    case 1: goto cb5;
    case 2: goto c6;
    case 3: goto cb10;
    case 4: goto c11;
    case 5: goto cb21;
    case 6: goto c22;
    case 7: goto c26;
    case 8: goto cb42;
    case 9: goto c43;
    case 10: goto cb45;
    case 11: goto c46;
    case 12: goto c47;
    case 13: goto c51;
    case 14: goto c72;  }
c0:
/* block , 0 */
  if((ch_returncode = che_block(QUAL(0),sched)) != Normal)
     goto ch_raise_exception;
/* prog_lit 3 , 1 */
  if ((ch_returncode = che_prog_lit(DEF(3),QUAL(1),sched)) != Normal) 
     goto ch_raise_exception;
/* procedure 4 3 , 2 */
  if ((ch_returncode = che_procedure(DEF(4),DEF(3),QUAL(2),sched)) != Normal)
     goto ch_raise_exception;
/* discard 3 */
  (*(REF(3).tsdr)->finalize)(REF(3).value,F_DISCARD,sched);
  REF(3).tsdr = & dr_bottom;
/* move 5 4 */
  (*(REF(5).tsdr)->finalize)(REF(5).value,F_DISCARD,sched);
  REF(5) = REF(4);
  REF(4).tsdr = & dr_bottom;
  current->ip = 1;
cb5:
/* receive 6 0 */
  if ((ch_returncode = che_receive(DEF(6),DEF(0),sched)) != Normal)
     goto ch_raise_exception;
  return;
c6:
/* noop */
  
/* lookup_at 7 6.4.2 =(0) */
  if ( !((ch_t = REF(6)DOT(4)DOT(2).value.table)->size) ) goto ch_notfound;
  (*(REF(7).tsdr)->finalize)(REF(7).value,F_DISCARD,sched);
  (*(ch_t->tbls[ORDER_TBL].des->lookup_at))
    (ch_t, ORDER_TBL, & REF(7).value,0);
  REF(7).tsdr = qdatarepmap[ch_t->tsdr->number];
/* copy 8 7 */
  if((ch_returncode = (REF(7).tsdr->copy)(& ch_val, REF(7).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(8).tsdr)->finalize)(REF(8).value,F_DISCARD,sched);
  REF(8).value = ch_val;
  REF(8).tsdr = datarepmap[REF(7).tsdr->number];
  current->ip = 3;
cb10:
/* call 6.0.13 6.0 6.1 6.3 6.2 8 9 , 3 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(6)DOT(0)DOT(13),
          arguments[1] = DEF(6)DOT(0),
          arguments[2] = DEF(6)DOT(1),
          arguments[3] = DEF(6)DOT(3),
          arguments[4] = DEF(6)DOT(2),
          arguments[5] = DEF(8),
          arguments[6] = DEF(9),
          arguments[6+1] = nil,& arguments[0]),QUAL(3),sched)) != Normal)
     goto ch_raise_exception;
  return;
c11:
/* noop */
  
/* find 10 6.3 9.0 , 0 */
  if (findfunc(DEF(10),DEF(6)DOT(3),(
          arguments[0] = DEF(9)DOT(0),& arguments[0]),sched,0) == FAILURE)
             goto ch_notfound;
/* find 11 10.1 9.1 , 0 */
  if (findfunc(DEF(11),DEF(10)DOT(1),(
          arguments[0] = DEF(9)DOT(1),& arguments[0]),sched,0) == FAILURE)
             goto ch_notfound;
/* reveal 11.2 , 9 */
  if (9 != REF(11)DOT(2).value.variant->info.variant_case) goto ch_case_error;
/* find 12 6.3 11.2.0.0 , 0 */
  if (findfunc(DEF(12),DEF(6)DOT(3),(
          arguments[0] = DEF(11)DOT(2)DOT(0)DOT(0),& arguments[0]),sched,0
            ) == FAILURE) goto ch_notfound;
/* find 13 12.1 11.2.0.1 , 0 */
  if (findfunc(DEF(13),DEF(12)DOT(1),(
          arguments[0] = DEF(11)DOT(2)DOT(0)DOT(1),& arguments[0]),sched,0
            ) == FAILURE) goto ch_notfound;
/* reveal 13.2 , 8 */
  if (8 != REF(13)DOT(2).value.variant->info.variant_case) goto ch_case_error;
/* find 14 6.3 13.2.0.0.0 , 0 */
  if (findfunc(DEF(14),DEF(6)DOT(3),(
          arguments[0] = DEF(13)DOT(2)DOT(0)DOT(0)DOT(0),
            & arguments[0]),sched,0) == FAILURE) goto ch_notfound;
/* find 15 14.1 13.2.0.0.1 , 0 */
  if (findfunc(DEF(15),DEF(14)DOT(1),(
          arguments[0] = DEF(13)DOT(2)DOT(0)DOT(0)DOT(1),
            & arguments[0]),sched,0) == FAILURE) goto ch_notfound;
/* reveal 15.2 , 10 */
  if (10 != REF(15)DOT(2).value.variant->info.variant_case)
     goto ch_case_error;
  current->ip = 5;
cb21:
/* call 5 6.0 6.1 6.2.6 6.3 6.4.2 15.1 13.2.0.1 15.2.0.1 16 , 4 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(5),
          arguments[1] = DEF(6)DOT(0),
          arguments[2] = DEF(6)DOT(1),
          arguments[3] = DEF(6)DOT(2)DOT(6),
          arguments[4] = DEF(6)DOT(3),
          arguments[5] = DEF(6)DOT(4)DOT(2),
          arguments[6] = DEF(15)DOT(1),
          arguments[7] = DEF(13)DOT(2)DOT(0)DOT(1),
          arguments[8] = DEF(15)DOT(2)DOT(0)DOT(1),
          arguments[9] = DEF(16),
          arguments[9+1] = nil,& arguments[0]),QUAL(4),sched)) != Normal)
     goto ch_raise_exception;
  return;
c22:
/* move 6.6 16 */
  (*(REF(6)DOT(6).tsdr)->finalize)(REF(6)DOT(6).value,F_DISCARD,sched);
  REF(6)DOT(6) = REF(16);
  REF(16).tsdr = & dr_bottom;
/* new_table 6.7 , 5 */
  if ((ch_returncode = che_new_table(DEF(6)DOT(7),QUAL(5),sched)) != Normal) 
     goto ch_raise_exception;
/* copy 17 15.2.0.3 */
  if((ch_returncode = cp_table(& ch_val, REF(15)DOT(2)DOT(0)DOT(3).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(17).tsdr)->finalize)(REF(17).value,F_DISCARD,sched);
  REF(17).value = ch_val;
  REF(17).tsdr = & dr_table;
/* initget 18 17 , 0,0 */
  (*(REF(18).tsdr)->finalize)(REF(18).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(18),DEF(17),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
c26:
/* get_or_goto 18 17 , 51 */
  if ((ch_returncode = get_selected_object(DEF(18),DEF(17),sched)) != Normal)
     goto c51;
/* new_record 19 , 2 */
  if ((ch_val.record = new_record(2)) == nil) goto ch_depletion;
  (*(REF(19).tsdr)->finalize)(REF(19).value,F_DISCARD,sched);
  REF(19).value = ch_val; REF(19).tsdr = & dr_record;
/* new_record 20 , 2 */
  if ((ch_val.record = new_record(2)) == nil) goto ch_depletion;
  (*(REF(20).tsdr)->finalize)(REF(20).value,F_DISCARD,sched);
  REF(20).value = ch_val; REF(20).tsdr = & dr_record;
/* copy 20.0 13.2.0.0 */
  if((ch_returncode = (REF(13)DOT(2)DOT(0)DOT(0).tsdr->copy)(& ch_val, 
    REF(13)DOT(2)DOT(0)DOT(0).value)) != Normal) goto ch_raise_exception;
  (*(REF(20)DOT(0).tsdr)->finalize)(REF(20)DOT(0).value,F_DISCARD,sched);
  REF(20)DOT(0).value = ch_val;
  REF(20)DOT(0).tsdr = datarepmap[REF(13)DOT(2)DOT(0)DOT(0).tsdr->number];
/* copy 20.1 18.0 */
  if((ch_returncode = (REF(18)DOT(0).tsdr->copy)(& ch_val, REF(18)DOT(0).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(20)DOT(1).tsdr)->finalize)(REF(20)DOT(1).value,F_DISCARD,sched);
  REF(20)DOT(1).value = ch_val;
  REF(20)DOT(1).tsdr = datarepmap[REF(18)DOT(0).tsdr->number];
/* unite 19.0 20 , 1 */
  if ((ch_returncode = che_unite(DEF(19)DOT(0),DEF(20),sched,1)) != Normal)
     goto ch_raise_exception;
/* notequal . 18.0 15.2.0.2 , 45 */
  if ( !(REF(18)DOT(0).tsdr->equal)(REF(18)DOT(0).value,
    REF(15)DOT(2)DOT(0)DOT(2).value) ) goto c45;
/* new_table 21 , 6 */
  if ((ch_returncode = che_new_table(DEF(21),QUAL(6),sched)) != Normal) 
     goto ch_raise_exception;
/* new_record 22 , 2 */
  if ((ch_val.record = new_record(2)) == nil) goto ch_depletion;
  (*(REF(22).tsdr)->finalize)(REF(22).value,F_DISCARD,sched);
  REF(22).value = ch_val; REF(22).tsdr = & dr_record;
/* unite 22.0 23 , 0 */
  if ((ch_returncode = che_unite(DEF(22)DOT(0),DEF(23),sched,0)) != Normal)
     goto ch_raise_exception;
/* new_table 22.1 , 7 */
  if ((ch_returncode = che_new_table(DEF(22)DOT(1),QUAL(7),sched)) != Normal) 
     goto ch_raise_exception;
/* new_table 24 , 7 */
  if ((ch_returncode = che_new_table(DEF(24),QUAL(7),sched)) != Normal) 
     goto ch_raise_exception;
/* insert 22.1 24 */
  if ((ch_returncode = insertfunc(DEF(22)DOT(1),DEF(24),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* insert 21 22 */
  if ((ch_returncode = insertfunc(DEF(21),DEF(22),FALSE,0)) != Normal)
     goto ch_raise_exception;
  current->ip = 8;
cb42:
/* call 5 6.0 6.1 6.2.6 6.3 6.4.2 15.1 13.2.0.1 21 25 , 4 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(5),
          arguments[1] = DEF(6)DOT(0),
          arguments[2] = DEF(6)DOT(1),
          arguments[3] = DEF(6)DOT(2)DOT(6),
          arguments[4] = DEF(6)DOT(3),
          arguments[5] = DEF(6)DOT(4)DOT(2),
          arguments[6] = DEF(15)DOT(1),
          arguments[7] = DEF(13)DOT(2)DOT(0)DOT(1),
          arguments[8] = DEF(21),
          arguments[9] = DEF(25),
          arguments[9+1] = nil,& arguments[0]),QUAL(4),sched)) != Normal)
     goto ch_raise_exception;
  return;
c43:
/* move 19.1 25 */
  (*(REF(19)DOT(1).tsdr)->finalize)(REF(19)DOT(1).value,F_DISCARD,sched);
  REF(19)DOT(1) = REF(25);
  REF(25).tsdr = & dr_bottom;
/* branch , 47 */
   goto c47;
c45:
  current->ip = 10;
cb45:
/* call 5 6.0 6.1 6.2.6 6.3 6.4.2 15.1 13.2.0.1 18.1 26 , 4 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(5),
          arguments[1] = DEF(6)DOT(0),
          arguments[2] = DEF(6)DOT(1),
          arguments[3] = DEF(6)DOT(2)DOT(6),
          arguments[4] = DEF(6)DOT(3),
          arguments[5] = DEF(6)DOT(4)DOT(2),
          arguments[6] = DEF(15)DOT(1),
          arguments[7] = DEF(13)DOT(2)DOT(0)DOT(1),
          arguments[8] = DEF(18)DOT(1),
          arguments[9] = DEF(26),
          arguments[9+1] = nil,& arguments[0]),QUAL(4),sched)) != Normal)
     goto ch_raise_exception;
  return;
c46:
/* move 19.1 26 */
  (*(REF(19)DOT(1).tsdr)->finalize)(REF(19)DOT(1).value,F_DISCARD,sched);
  REF(19)DOT(1) = REF(26);
  REF(26).tsdr = & dr_bottom;
c47:
/* discard 21 */
  (*(REF(21).tsdr)->finalize)(REF(21).value,F_DISCARD,sched);
  REF(21).tsdr = & dr_bottom;
/* insert 6.7 19 */
  if ((ch_returncode = insertfunc(DEF(6)DOT(7),DEF(19),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* branch , 26 */
   goto c26;
c51:
/* endget 18 17 */
  end_selector(DEF(18),DEF(17),sched,GET);
/* discard 17 */
  (*(REF(17).tsdr)->finalize)(REF(17).value,F_DISCARD,sched);
  REF(17).tsdr = & dr_bottom;
/* new_record 27 , 2 */
  if ((ch_val.record = new_record(2)) == nil) goto ch_depletion;
  (*(REF(27).tsdr)->finalize)(REF(27).value,F_DISCARD,sched);
  REF(27).value = ch_val; REF(27).tsdr = & dr_record;
/* ordenum_lit 28 , 3 */
  REF(28).value.ord_enum = 3;
  REF(28).tsdr = & dr_ord_enumeration;
/* unite 27.0 28 , 0 */
  if ((ch_returncode = che_unite(DEF(27)DOT(0),DEF(28),sched,0)) != Normal)
     goto ch_raise_exception;
/* new_record 27.1 , 2 */
  if ((ch_val.record = new_record(2)) == nil) goto ch_depletion;
  (*(REF(27)DOT(1).tsdr)->finalize)(REF(27)DOT(1).value,F_DISCARD,sched);
  REF(27)DOT(1).value = ch_val; REF(27)DOT(1).tsdr = & dr_record;
/* new_table 27.1.0 , 6 */
  if ((ch_returncode = che_new_table(DEF(27)DOT(1)DOT(0),QUAL(6)
    ,sched)) != Normal)  goto ch_raise_exception;
/* new_table 27.1.1 , 6 */
  if ((ch_returncode = che_new_table(DEF(27)DOT(1)DOT(1),QUAL(6)
    ,sched)) != Normal)  goto ch_raise_exception;
/* insert 6.7 27 */
  if ((ch_returncode = insertfunc(DEF(6)DOT(7),DEF(27),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* new_record 29 , 2 */
  if ((ch_val.record = new_record(2)) == nil) goto ch_depletion;
  (*(REF(29).tsdr)->finalize)(REF(29).value,F_DISCARD,sched);
  REF(29).value = ch_val; REF(29).tsdr = & dr_record;
/* ordenum_lit 30 , 4 */
  REF(30).value.ord_enum = 4;
  REF(30).tsdr = & dr_ord_enumeration;
/* unite 29.0 30 , 0 */
  if ((ch_returncode = che_unite(DEF(29)DOT(0),DEF(30),sched,0)) != Normal)
     goto ch_raise_exception;
/* new_record 29.1 , 2 */
  if ((ch_val.record = new_record(2)) == nil) goto ch_depletion;
  (*(REF(29)DOT(1).tsdr)->finalize)(REF(29)DOT(1).value,F_DISCARD,sched);
  REF(29)DOT(1).value = ch_val; REF(29)DOT(1).tsdr = & dr_record;
/* new_table 29.1.0 , 6 */
  if ((ch_returncode = che_new_table(DEF(29)DOT(1)DOT(0),QUAL(6)
    ,sched)) != Normal)  goto ch_raise_exception;
/* new_table 29.1.1 , 6 */
  if ((ch_returncode = che_new_table(DEF(29)DOT(1)DOT(1),QUAL(6)
    ,sched)) != Normal)  goto ch_raise_exception;
/* insert 6.7 29 */
  if ((ch_returncode = insertfunc(DEF(6)DOT(7),DEF(29),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* return 6 */
  if (ch_caller = do_return(REF(6).value)) {
    if (ch_caller->type < CProcess) ch_caller->ip++;
      sched->wakeup_proc(sched, ch_caller);}
  else rem_return(REF(6).value);
  REF(6).tsdr = & dr_bottom;
/* endblock */
  che_endblock(sched);
c72:
/* endprocess */
  che_endprocess(sched); return;
#include "chtail.h"
