#include "chdecl.h"
void CH_typestate_involving(current, sched, cop)
#define ARGUMENTS 5
#include "chhead.h"
select: switch (SELECTOR) {
    case 0: goto c0;
    case 1: goto cb1;
    case 2: goto c2;
    case 3: goto c6;
    case 4: goto c9;
    case 5: goto c24;
    case 6: goto c33;
    case 7: goto c43;
    case 8: goto c54;
    case 9: goto c68;
    case 10: goto c77;
    case 11: goto c87;
    case 12: goto c90;
    case 13: goto c109;
    case 14: goto c111;
    case 15: goto c115;
    case 16: goto c120;  }
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:
/* size 4 3.1.1 */
  REF(4).value.integer = REF(3)DOT(1)DOT(1).value.table->size;
  REF(4).tsdr = & dr_integer;
/* new_table 5 , 1 */
  if ((ch_returncode = che_new_table(DEF(5),QUAL(1),sched)) != Normal) 
     goto ch_raise_exception;
/* initget 6 3.0 , 0,0 */
  (*(REF(6).tsdr)->finalize)(REF(6).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(6),DEF(3)DOT(0),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
c6:
/* get_or_goto 6 3.0 , 115 */
  if ((ch_returncode = get_selected_object(DEF(6),DEF(3)DOT(0)
    ,sched)) != Normal) goto c115;
/* boolean 7 , FALSE */
  REF(7).value.boolean = FALSE;
  REF(7).tsdr = & dr_boolean;
/* initget 8 6.1 , 0,0 */
  (*(REF(8).tsdr)->finalize)(REF(8).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(8),DEF(6)DOT(1),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
c9:
/* get_or_goto 8 6.1 , 13 */
  if ((ch_returncode = get_selected_object(DEF(8),DEF(6)DOT(1)
    ,sched)) != Normal) goto c13;
/* notequal . 8.0 3.1.0 , 9 */
  if ( !(REF(8)DOT(0).tsdr->equal)(REF(8)DOT(0).value,REF(3)DOT(1)DOT(0).value)
     ) goto c9;
/* boolean 7 , TRUE */
  REF(7).value.boolean = TRUE;
  REF(7).tsdr = & dr_boolean;
c13:
/* endget 8 6.1 */
  end_selector(DEF(8),DEF(6)DOT(1),sched,GET);
/* branch_false 7 , 109 */
  if ( !REF(7).value.boolean ) goto c109;
/* boolean 9 , FALSE */
  REF(9).value.boolean = FALSE;
  REF(9).tsdr = & dr_boolean;
/* find_or_goto 10 3.2 6 , 0,18 */
  if (findfunc(DEF(10),DEF(3)DOT(2),(
          arguments[0] = DEF(6),& arguments[0]),sched,0) == FAILURE) goto c18;
/* boolean 9 , TRUE */
  REF(9).value.boolean = TRUE;
  REF(9).tsdr = & dr_boolean;
c18:
/* branch_false 9 , 22 */
  if ( !REF(9).value.boolean ) goto c22;
/* boolean 11 , FALSE */
  REF(11).value.boolean = FALSE;
  REF(11).tsdr = & dr_boolean;
/* branch , 111 */
   goto c111;
c22:
/* boolean 12 , FALSE */
  REF(12).value.boolean = FALSE;
  REF(12).tsdr = & dr_boolean;
/* initget 13 6.1 , 0,0 */
  (*(REF(13).tsdr)->finalize)(REF(13).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(13),DEF(6)DOT(1),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
c24:
/* get_or_goto 13 6.1 , 54 */
  if ((ch_returncode = get_selected_object(DEF(13),DEF(6)DOT(1)
    ,sched)) != Normal) goto c54;
/* equal 14 3.1.0 13.0 */
  REF(14).value.boolean = ((REF(3)DOT(1)DOT(0).tsdr->equal)(
    REF(3)DOT(1)DOT(0).value,REF(13)DOT(0).value));
  REF(14).tsdr = & dr_boolean;
/* size 15 13.1 */
  REF(15).value.integer = REF(13)DOT(1).value.table->size;
  REF(15).tsdr = & dr_integer;
/* ile 16 4 15 */
  REF(16).value.boolean = (REF(4).value.integer <= REF(15).value.integer);
/* and 17 14 16 */
  REF(17).value.boolean = REF(14).value.boolean&REF(16).value.boolean;
  REF(17).tsdr = & dr_boolean;
/* branch_false 17 , 43 */
  if ( !REF(17).value.boolean ) goto c43;
/* boolean 18 , TRUE */
  REF(18).value.boolean = TRUE;
  REF(18).tsdr = & dr_boolean;
/* initget 19 3.1.1 , 0,0 */
  (*(REF(19).tsdr)->finalize)(REF(19).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(19),DEF(3)DOT(1)DOT(1),nil,sched,GET,
    0,0)) != Normal) goto ch_raise_exception;
c33:
/* get_or_goto 19 3.1.1 , 41 */
  if ((ch_returncode = get_selected_object(DEF(19),DEF(3)DOT(1)DOT(1)
    ,sched)) != Normal) goto c41;
/* position 20 19 */
  ch_frame = get_selector_frame(DEF(19),sched);
  ch_t = ch_frame->inspectee->value.table;
  REF(20).value.integer = ch_frame->rmvcount +
    (*(ch_t->tbls[ORDER_TBL].des->position_of))(ch_t,ORDER_TBL,ch_frame->pos);
  REF(20).tsdr = &dr_integer;
/* lookup_at 21 13.1 20 */
  if((ch_i = REF(20).value.integer) < 0 || ch_i >= (ch_t = REF(13)DOT(1).value
    .table)->size) goto ch_notfound;
  (*(REF(21).tsdr)->finalize)(REF(21).value,F_DISCARD,sched);
  (*(ch_t->tbls[ORDER_TBL].des->lookup_at))
    (ch_t, ORDER_TBL, & REF(21).value,ch_i);
  REF(21).tsdr = qdatarepmap[ch_t->tsdr->number];
/* copy 22 21 */
  if((ch_returncode = (REF(21).tsdr->copy)(& ch_val, REF(21).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(22).tsdr)->finalize)(REF(22).value,F_DISCARD,sched);
  REF(22).value = ch_val;
  REF(22).tsdr = datarepmap[REF(21).tsdr->number];
/* equal 23 19 22 */
  REF(23).value.boolean = ((REF(19).tsdr->equal)(REF(19).value,REF(22).value)
    );
  REF(23).tsdr = & dr_boolean;
/* discard 22 */
  (*(REF(22).tsdr)->finalize)(REF(22).value,F_DISCARD,sched);
  REF(22).tsdr = & dr_bottom;
/* branch_true 23 , 33 */
  if ( REF(23).value.boolean ) goto c33;
/* boolean 18 , FALSE */
  REF(18).value.boolean = FALSE;
  REF(18).tsdr = & dr_boolean;
c41:
/* endget 19 3.1.1 */
  end_selector(DEF(19),DEF(3)DOT(1)DOT(1),sched,GET);
/* move 17 18 */
  REF(17) = REF(18);
  REF(18).tsdr = & dr_bottom;
c43:
/* position 24 13 */
  ch_frame = get_selector_frame(DEF(13),sched);
  ch_t = ch_frame->inspectee->value.table;
  REF(24).value.integer = ch_frame->rmvcount +
    (*(ch_t->tbls[ORDER_TBL].des->position_of))(ch_t,ORDER_TBL,ch_frame->pos);
  REF(24).tsdr = &dr_integer;
/* equal 25 24 =(1) */
  REF(25).value.boolean = (REF(24).value.integer == 1);
  REF(25).tsdr = & dr_boolean;
/* and 26 17 25 */
  REF(26).value.boolean = REF(17).value.boolean&REF(25).value.boolean;
  REF(26).tsdr = & dr_boolean;
/* branch_false 26 , 52 */
  if ( !REF(26).value.boolean ) goto c52;
/* case 27 6.0 */
  REF(27).value.enumeration = REF(6)DOT(0).value.variant->info.variant_case;
  REF(27).tsdr = & dr_enumeration;
/* notequal 17 27 =(1) */
  REF(17).value.boolean = (REF(27).value.enumeration != 1);
  REF(17).tsdr = & dr_boolean;
c52:
/* branch_false 17 , 24 */
  if ( !REF(17).value.boolean ) goto c24;
/* boolean 12 , TRUE */
  REF(12).value.boolean = TRUE;
  REF(12).tsdr = & dr_boolean;
c54:
/* endget 13 6.1 */
  end_selector(DEF(13),DEF(6)DOT(1),sched,GET);
/* move 11 12 */
  REF(11) = REF(12);
  REF(12).tsdr = & dr_bottom;
/* branch_false 11 , 58 */
  if ( !REF(11).value.boolean ) goto c58;
/* branch , 111 */
   goto c111;
c58:
/* case 28 6.0 */
  REF(28).value.enumeration = REF(6)DOT(0).value.variant->info.variant_case;
  REF(28).tsdr = & dr_enumeration;
/* equal 29 28 =(2) */
  REF(29).value.boolean = (REF(28).value.enumeration == 2);
  REF(29).tsdr = & dr_boolean;
/* case 30 6.0 */
  REF(30).value.enumeration = REF(6)DOT(0).value.variant->info.variant_case;
  REF(30).tsdr = & dr_enumeration;
/* equal 31 30 =(3) */
  REF(31).value.boolean = (REF(30).value.enumeration == 3);
  REF(31).tsdr = & dr_boolean;
/* or 32 29 31 */
  REF(32).value.boolean = REF(29).value.boolean|REF(31).value.boolean;
  REF(32).tsdr = & dr_boolean;
/* branch_false 32 , 111 */
  if ( !REF(32).value.boolean ) goto c111;
/* block , 2 */
  if((ch_returncode = che_block(QUAL(2),sched)) != Normal)
     goto ch_raise_exception;
/* initget 33 6.1 , 0,0 */
  (*(REF(33).tsdr)->finalize)(REF(33).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(33),DEF(6)DOT(1),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
c68:
/* get_or_err 33 6.1 */
  if ((ch_returncode = get_selected_object(DEF(33),DEF(6)DOT(1)
    ,sched)) != Normal) goto ch_raise_exception;
/* equal 34 3.1.0 33.0 */
  REF(34).value.boolean = ((REF(3)DOT(1)DOT(0).tsdr->equal)(
    REF(3)DOT(1)DOT(0).value,REF(33)DOT(0).value));
  REF(34).tsdr = & dr_boolean;
/* size 35 33.1 */
  REF(35).value.integer = REF(33)DOT(1).value.table->size;
  REF(35).tsdr = & dr_integer;
/* ilt 36 35 4 */
  REF(36).value.boolean = (REF(35).value.integer < REF(4).value.integer);
/* and 37 34 36 */
  REF(37).value.boolean = REF(34).value.boolean&REF(36).value.boolean;
  REF(37).tsdr = & dr_boolean;
/* branch_false 37 , 87 */
  if ( !REF(37).value.boolean ) goto c87;
/* boolean 38 , TRUE */
  REF(38).value.boolean = TRUE;
  REF(38).tsdr = & dr_boolean;
/* initget 39 33.1 , 0,0 */
  (*(REF(39).tsdr)->finalize)(REF(39).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(39),DEF(33)DOT(1),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
c77:
/* get_or_goto 39 33.1 , 85 */
  if ((ch_returncode = get_selected_object(DEF(39),DEF(33)DOT(1)
    ,sched)) != Normal) goto c85;
/* position 40 39 */
  ch_frame = get_selector_frame(DEF(39),sched);
  ch_t = ch_frame->inspectee->value.table;
  REF(40).value.integer = ch_frame->rmvcount +
    (*(ch_t->tbls[ORDER_TBL].des->position_of))(ch_t,ORDER_TBL,ch_frame->pos);
  REF(40).tsdr = &dr_integer;
/* lookup_at 41 3.1.1 40 */
  if((ch_i = REF(40).value.integer) < 0 || ch_i >= (ch_t = 
    REF(3)DOT(1)DOT(1).value.table)->size) goto ch_notfound;
  (*(REF(41).tsdr)->finalize)(REF(41).value,F_DISCARD,sched);
  (*(ch_t->tbls[ORDER_TBL].des->lookup_at))
    (ch_t, ORDER_TBL, & REF(41).value,ch_i);
  REF(41).tsdr = qdatarepmap[ch_t->tsdr->number];
/* copy 42 41 */
  if((ch_returncode = (REF(41).tsdr->copy)(& ch_val, REF(41).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(42).tsdr)->finalize)(REF(42).value,F_DISCARD,sched);
  REF(42).value = ch_val;
  REF(42).tsdr = datarepmap[REF(41).tsdr->number];
/* equal 43 39 42 */
  REF(43).value.boolean = ((REF(39).tsdr->equal)(REF(39).value,REF(42).value)
    );
  REF(43).tsdr = & dr_boolean;
/* discard 42 */
  (*(REF(42).tsdr)->finalize)(REF(42).value,F_DISCARD,sched);
  REF(42).tsdr = & dr_bottom;
/* branch_true 43 , 77 */
  if ( REF(43).value.boolean ) goto c77;
/* boolean 38 , FALSE */
  REF(38).value.boolean = FALSE;
  REF(38).tsdr = & dr_boolean;
c85:
/* endget 39 33.1 */
  end_selector(DEF(39),DEF(33)DOT(1),sched,GET);
/* move 37 38 */
  REF(37) = REF(38);
  REF(38).tsdr = & dr_bottom;
c87:
/* branch_false 37 , 68 */
  if ( !REF(37).value.boolean ) goto c68;
/* boolean 44 , FALSE */
  REF(44).value.boolean = FALSE;
  REF(44).tsdr = & dr_boolean;
/* initget 45 3.2 , 0,0 */
  (*(REF(45).tsdr)->finalize)(REF(45).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(45),DEF(3)DOT(2),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
c90:
/* get_or_goto 45 3.2 , 101 */
  if ((ch_returncode = get_selected_object(DEF(45),DEF(3)DOT(2)
    ,sched)) != Normal) goto c101;
/* case 46 45.0 */
  REF(46).value.enumeration = REF(45)DOT(0).value.variant->info.variant_case;
  REF(46).tsdr = & dr_enumeration;
/* equal 47 46 =(0) */
  REF(47).value.boolean = (REF(46).value.enumeration == 0);
  REF(47).tsdr = & dr_boolean;
/* lookup_at 48 45.1 =(0) */
  if ( !((ch_t = REF(45)DOT(1).value.table)->size) ) goto ch_notfound;
  (*(REF(48).tsdr)->finalize)(REF(48).value,F_DISCARD,sched);
  (*(ch_t->tbls[ORDER_TBL].des->lookup_at))
    (ch_t, ORDER_TBL, & REF(48).value,0);
  REF(48).tsdr = qdatarepmap[ch_t->tsdr->number];
/* copy 49 48 */
  if((ch_returncode = (REF(48).tsdr->copy)(& ch_val, REF(48).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(49).tsdr)->finalize)(REF(49).value,F_DISCARD,sched);
  REF(49).value = ch_val;
  REF(49).tsdr = datarepmap[REF(48).tsdr->number];
/* equal 50 49 3.1 */
  REF(50).value.boolean = ((REF(49).tsdr->equal)(REF(49).value,
    REF(3)DOT(1).value));
  REF(50).tsdr = & dr_boolean;
/* and 51 47 50 */
  REF(51).value.boolean = REF(47).value.boolean&REF(50).value.boolean;
  REF(51).tsdr = & dr_boolean;
/* branch_false 51 , 90 */
  if ( !REF(51).value.boolean ) goto c90;
/* boolean 44 , TRUE */
  REF(44).value.boolean = TRUE;
  REF(44).tsdr = & dr_boolean;
c101:
/* endget 45 3.2 */
  end_selector(DEF(45),DEF(3)DOT(2),sched,GET);
/* not 11 44 */
  REF(11).value.boolean = !REF(44).value.boolean;
  REF(11).tsdr = & dr_boolean;
/* endget 33 6.1 */
  end_selector(DEF(33),DEF(6)DOT(1),sched,GET);
/* endblock */
  che_endblock(sched);
/* branch , 111 */
   goto c111;
c109:
/* boolean 11 , FALSE */
  REF(11).value.boolean = FALSE;
  REF(11).tsdr = & dr_boolean;
c111:
/* branch_false 11 , 6 */
  if ( !REF(11).value.boolean ) goto c6;
/* copy 52 6 */
  if((ch_returncode = (REF(6).tsdr->copy)(& ch_val, REF(6).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(52).tsdr)->finalize)(REF(52).value,F_DISCARD,sched);
  REF(52).value = ch_val;
  REF(52).tsdr = datarepmap[REF(6).tsdr->number];
/* insert 5 52 */
  if ((ch_returncode = insertfunc(DEF(5),DEF(52),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* branch , 6 */
   goto c6;
c115:
/* endget 6 3.0 */
  end_selector(DEF(6),DEF(3)DOT(0),sched,GET);
/* move 3.3 5 */
  (*(REF(3)DOT(3).tsdr)->finalize)(REF(3)DOT(3).value,F_DISCARD,sched);
  REF(3)DOT(3) = REF(5);
  REF(5).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;
/* endblock */
  che_endblock(sched);
c120:
/* endprocess */
  che_endprocess(sched); return;
#include "chtail.h"
