#include "chdecl.h"
void CH_typestate_softglb(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 c17;
    case 4: goto c26;
    case 5: goto c29;
    case 6: goto c38;
    case 7: goto c41;
    case 8: goto c44;
    case 9: goto c47;
    case 10: goto c54;
    case 11: goto c60;
    case 12: goto c63;
    case 13: goto c65;
    case 14: goto c67;
    case 15: goto c71;
    case 16: goto c84;
    case 17: goto c92;
    case 18: goto c95;
    case 19: goto c105;
    case 20: goto c113;
    case 21: goto c115;
    case 22: goto c122;
    case 23: goto c125;
    case 24: goto c128;
    case 25: goto c131;  }
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:
/* case 4 3.6 */
  REF(4).value.enumeration = REF(3)DOT(6).value.variant->info.variant_case;
  REF(4).tsdr = & dr_enumeration;
/* notequal . 4 =(1) , 67 */
  if ( REF(4).value.enumeration != 1 ) goto c67;
/* new_record 5 , 2 */
  if ((ch_val.record = new_record(2)) == nil) goto ch_depletion;
  (*(REF(5).tsdr)->finalize)(REF(5).value,F_DISCARD,sched);
  REF(5).value = ch_val; REF(5).tsdr = & dr_record;
/* copy 5.0 3.4 */
  if((ch_returncode = cp_table(& ch_val, REF(3)DOT(4).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(5)DOT(0).tsdr)->finalize)(REF(5)DOT(0).value,F_DISCARD,sched);
  REF(5)DOT(0).value = ch_val;
  REF(5)DOT(0).tsdr = & dr_table;
/* new_table 5.1 , 1 */
  if ((ch_returncode = che_new_table(DEF(5)DOT(1),QUAL(1),sched)) != Normal) 
     goto ch_raise_exception;
/* size 6 3.2.0 */
  REF(6).value.integer = REF(3)DOT(2)DOT(0).value.table->size;
  REF(6).tsdr = & dr_integer;
/* copy 7 6 */
  REF(7) = REF(6);
/* isubtract 8 7 =(1) */
  if (!chf_isubtract(DEF(8),REF(7).value.integer,1)) goto ch_depletion;
/* ige . 3.5 8 , 65 */
  if ( REF(3)DOT(5).value.integer >= REF(8).value.integer ) goto c65;
/* copy 9 3.2.0 */
  if((ch_returncode = cp_table(& ch_val, REF(3)DOT(2)DOT(0).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_table;
/* initget 10 9 , 0,0 */
  (*(REF(10).tsdr)->finalize)(REF(10).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(10),DEF(9),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
c17:
/* get_or_goto 10 9 , 63 */
  if ((ch_returncode = get_selected_object(DEF(10),DEF(9),sched)) != Normal)
     goto c63;
/* position 11 10 */
  ch_frame = get_selector_frame(DEF(10),sched);
  ch_t = ch_frame->inspectee->value.table;
  REF(11).value.integer = ch_frame->rmvcount +
    (*(ch_t->tbls[ORDER_TBL].des->position_of))(ch_t,ORDER_TBL,ch_frame->pos);
  REF(11).tsdr = &dr_integer;
/* copy 12 11 */
  REF(12) = REF(11);
/* ile . 12 3.5 , 17 */
  if ( REF(12).value.integer <= REF(3)DOT(5).value.integer ) goto c17;
/* discard 13 */
  (*(REF(13).tsdr)->finalize)(REF(13).value,F_DISCARD,sched);
  REF(13).tsdr = & dr_bottom;
/* new_table 13 , 1 */
  if ((ch_returncode = che_new_table(DEF(13),QUAL(1),sched)) != Normal) 
     goto ch_raise_exception;
/* privatize 5.0 */
  if (REF(5)DOT(0).value.table->refcount != 1)
    if ((ch_returncode = doCopyOnWrite(DEF(5)DOT(0))) != Normal)
       goto ch_raise_exception;
/* initget 14 5.0 , 0,0 */
  (*(REF(14).tsdr)->finalize)(REF(14).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(14),DEF(5)DOT(0),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
c26:
/* get_or_goto 14 5.0 , 38 */
  if ((ch_returncode = get_selected_object(DEF(14),DEF(5)DOT(0)
    ,sched)) != Normal) goto c38;
/* boolean 15 , FALSE */
  REF(15).value.boolean = FALSE;
  REF(15).tsdr = & dr_boolean;
/* initget 16 14.1 , 0,0 */
  (*(REF(16).tsdr)->finalize)(REF(16).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(16),DEF(14)DOT(1),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
c29:
/* get_or_goto 16 14.1 , 33 */
  if ((ch_returncode = get_selected_object(DEF(16),DEF(14)DOT(1)
    ,sched)) != Normal) goto c33;
/* notequal . 16.0.0 10 , 29 */
  if ( !(REF(16)DOT(0)DOT(0).tsdr->equal)(REF(16)DOT(0)DOT(0).value,
    REF(10).value) ) goto c29;
/* boolean 15 , TRUE */
  REF(15).value.boolean = TRUE;
  REF(15).tsdr = & dr_boolean;
c33:
/* endget 16 14.1 */
  end_selector(DEF(16),DEF(14)DOT(1),sched,GET);
/* branch_false 15 , 26 */
  if ( !REF(15).value.boolean ) goto c26;
/* remove 17 14 5.0 */
  if ((ch_returncode = che_remove(DEF(17),DEF(14),DEF(5)DOT(0)
    ,sched)) != Normal) goto ch_raise_exception;
/* insert 13 17 */
  if ((ch_returncode = insertfunc(DEF(13),DEF(17),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* branch , 26 */
   goto c26;
c38:
/* endget 14 5.0 */
  end_selector(DEF(14),DEF(5)DOT(0),sched,GET);
/* new_table 18 , 1 */
  if ((ch_returncode = che_new_table(DEF(18),QUAL(1),sched)) != Normal) 
     goto ch_raise_exception;
/* initget 19 13 , 0,0 */
  (*(REF(19).tsdr)->finalize)(REF(19).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(19),DEF(13),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
c41:
/* get_or_goto 19 13 , 60 */
  if ((ch_returncode = get_selected_object(DEF(19),DEF(13),sched)) != Normal)
     goto c60;
/* boolean 20 , FALSE */
  REF(20).value.boolean = FALSE;
  REF(20).tsdr = & dr_boolean;
/* initget 21 3.2.4 , 0,0 */
  (*(REF(21).tsdr)->finalize)(REF(21).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(21),DEF(3)DOT(2)DOT(4),nil,sched,GET,
    0,0)) != Normal) goto ch_raise_exception;
c44:
/* get_or_goto 21 3.2.4 , 54 */
  if ((ch_returncode = get_selected_object(DEF(21),DEF(3)DOT(2)DOT(4)
    ,sched)) != Normal) goto c54;
/* boolean 22 , FALSE */
  REF(22).value.boolean = FALSE;
  REF(22).tsdr = & dr_boolean;
/* initget 23 19.1 , 0,0 */
  (*(REF(23).tsdr)->finalize)(REF(23).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(23),DEF(19)DOT(1),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
c47:
/* get_or_goto 23 19.1 , 51 */
  if ((ch_returncode = get_selected_object(DEF(23),DEF(19)DOT(1)
    ,sched)) != Normal) goto c51;
/* notequal . 23.0 21 , 47 */
  if ( !(REF(23)DOT(0).tsdr->equal)(REF(23)DOT(0).value,REF(21).value) )
     goto c47;
/* boolean 22 , TRUE */
  REF(22).value.boolean = TRUE;
  REF(22).tsdr = & dr_boolean;
c51:
/* endget 23 19.1 */
  end_selector(DEF(23),DEF(19)DOT(1),sched,GET);
/* branch_false 22 , 44 */
  if ( !REF(22).value.boolean ) goto c44;
/* boolean 20 , TRUE */
  REF(20).value.boolean = TRUE;
  REF(20).tsdr = & dr_boolean;
c54:
/* endget 21 3.2.4 */
  end_selector(DEF(21),DEF(3)DOT(2)DOT(4),sched,GET);
/* not 24 20 */
  REF(24).value.boolean = !REF(20).value.boolean;
  REF(24).tsdr = & dr_boolean;
/* branch_false 24 , 41 */
  if ( !REF(24).value.boolean ) goto c41;
/* copy 25 19 */
  if((ch_returncode = (REF(19).tsdr->copy)(& ch_val, REF(19).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(19).tsdr->number];
/* insert 18 25 */
  if ((ch_returncode = insertfunc(DEF(18),DEF(25),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* branch , 41 */
   goto c41;
c60:
/* endget 19 13 */
  end_selector(DEF(19),DEF(13),sched,GET);
/* merge 5.1 18 */
  if ((ch_returncode = mergefunc(DEF(5)DOT(1),DEF(18),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* branch , 17 */
   goto c17;
c63:
/* endget 10 9 */
  end_selector(DEF(10),DEF(9),sched,GET);
/* discard 9 */
  (*(REF(9).tsdr)->finalize)(REF(9).value,F_DISCARD,sched);
  REF(9).tsdr = & dr_bottom;
c65:
/* unite 3.6 5 , 0 */
  if ((ch_returncode = che_unite(DEF(3)DOT(6),DEF(5),sched,0)) != Normal)
     goto ch_raise_exception;
/* branch , 128 */
   goto c128;
c67:
/* reveal 3.6 , 0 */
  if (0 != REF(3)DOT(6).value.variant->info.variant_case) goto ch_case_error;
/* new_table 26 , 1 */
  if ((ch_returncode = che_new_table(DEF(26),QUAL(1),sched)) != Normal) 
     goto ch_raise_exception;
/* privatize 3.6.0.0 */
  if (REF(3)DOT(6)DOT(0)DOT(0).value.table->refcount != 1)
    if ((ch_returncode = doCopyOnWrite(DEF(3)DOT(6)DOT(0)DOT(0))) != Normal)
       goto ch_raise_exception;
/* initget 27 3.6.0.0 , 0,0 */
  (*(REF(27).tsdr)->finalize)(REF(27).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(27),DEF(3)DOT(6)DOT(0)DOT(0)
    ,nil,sched,GET,0,0)) != Normal) goto ch_raise_exception;
c71:
/* get_or_goto 27 3.6.0.0 , 80 */
  if ((ch_returncode = get_selected_object(DEF(27),DEF(3)DOT(6)DOT(0)DOT(0)
    ,sched)) != Normal) goto c80;
/* boolean 28 , FALSE */
  REF(28).value.boolean = FALSE;
  REF(28).tsdr = & dr_boolean;
/* find_or_goto 29 3.4 27 , 0,75 */
  if (findfunc(DEF(29),DEF(3)DOT(4),(
          arguments[0] = DEF(27),& arguments[0]),sched,0) == FAILURE) goto c75;
/* boolean 28 , TRUE */
  REF(28).value.boolean = TRUE;
  REF(28).tsdr = & dr_boolean;
c75:
/* not 30 28 */
  REF(30).value.boolean = !REF(28).value.boolean;
  REF(30).tsdr = & dr_boolean;
/* branch_false 30 , 71 */
  if ( !REF(30).value.boolean ) goto c71;
/* remove 31 27 3.6.0.0 */
  if ((ch_returncode = che_remove(DEF(31),DEF(27),DEF(3)DOT(6)DOT(0)DOT(0)
    ,sched)) != Normal) goto ch_raise_exception;
/* insert 26 31 */
  if ((ch_returncode = insertfunc(DEF(26),DEF(31),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* branch , 71 */
   goto c71;
c80:
/* endget 27 3.6.0.0 */
  end_selector(DEF(27),DEF(3)DOT(6)DOT(0)DOT(0),sched,GET);
/* merge 3.6.0.1 26 */
  if ((ch_returncode = mergefunc(DEF(3)DOT(6)DOT(0)DOT(1),DEF(26)
    ,FALSE,0)) != Normal) goto ch_raise_exception;
/* copy 32 3.4 */
  if((ch_returncode = cp_table(& ch_val, REF(3)DOT(4).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(32).tsdr)->finalize)(REF(32).value,F_DISCARD,sched);
  REF(32).value = ch_val;
  REF(32).tsdr = & dr_table;
/* initget 33 32 , 0,0 */
  (*(REF(33).tsdr)->finalize)(REF(33).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(33),DEF(32),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
c84:
/* get_or_goto 33 32 , 125 */
  if ((ch_returncode = get_selected_object(DEF(33),DEF(32),sched)) != Normal)
     goto c125;
/* boolean 34 , FALSE */
  REF(34).value.boolean = FALSE;
  REF(34).tsdr = & dr_boolean;
/* find_or_goto 35 3.6.0.0 33 , 0,88 */
  if (findfunc(DEF(35),DEF(3)DOT(6)DOT(0)DOT(0),(
          arguments[0] = DEF(33),& arguments[0]),sched,0) == FAILURE) goto c88;
/* boolean 34 , TRUE */
  REF(34).value.boolean = TRUE;
  REF(34).tsdr = & dr_boolean;
c88:
/* not 36 34 */
  REF(36).value.boolean = !REF(34).value.boolean;
  REF(36).tsdr = & dr_boolean;
/* branch_false 36 , 84 */
  if ( !REF(36).value.boolean ) goto c84;
/* boolean 37 , TRUE */
  REF(37).value.boolean = TRUE;
  REF(37).tsdr = & dr_boolean;
/* initget 38 33.1 , 0,0 */
  (*(REF(38).tsdr)->finalize)(REF(38).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(38),DEF(33)DOT(1),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
c92:
/* get_or_goto 38 33.1 , 115 */
  if ((ch_returncode = get_selected_object(DEF(38),DEF(33)DOT(1)
    ,sched)) != Normal) goto c115;
/* boolean 39 , FALSE */
  REF(39).value.boolean = FALSE;
  REF(39).tsdr = & dr_boolean;
/* initget 40 3.2.4 , 0,0 */
  (*(REF(40).tsdr)->finalize)(REF(40).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(40),DEF(3)DOT(2)DOT(4),nil,sched,GET,
    0,0)) != Normal) goto ch_raise_exception;
c95:
/* get_or_goto 40 3.2.4 , 99 */
  if ((ch_returncode = get_selected_object(DEF(40),DEF(3)DOT(2)DOT(4)
    ,sched)) != Normal) goto c99;
/* notequal . 40 38.0 , 95 */
  if ( !(REF(40).tsdr->equal)(REF(40).value,REF(38)DOT(0).value) ) goto c95;
/* boolean 39 , TRUE */
  REF(39).value.boolean = TRUE;
  REF(39).tsdr = & dr_boolean;
c99:
/* endget 40 3.2.4 */
  end_selector(DEF(40),DEF(3)DOT(2)DOT(4),sched,GET);
/* not 41 39 */
  REF(41).value.boolean = !REF(39).value.boolean;
  REF(41).tsdr = & dr_boolean;
/* branch_false 41 , 104 */
  if ( !REF(41).value.boolean ) goto c104;
/* branch , 113 */
   goto c113;
c104:
/* initget 42 3.2.0 , 0,0 */
  (*(REF(42).tsdr)->finalize)(REF(42).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(42),DEF(3)DOT(2)DOT(0),nil,sched,GET,
    0,0)) != Normal) goto ch_raise_exception;
c105:
/* get_or_err 42 3.2.0 */
  if ((ch_returncode = get_selected_object(DEF(42),DEF(3)DOT(2)DOT(0)
    ,sched)) != Normal) goto ch_raise_exception;
/* notequal . 42 38.0.0 , 105 */
  if ( !(REF(42).tsdr->equal)(REF(42).value,REF(38)DOT(0)DOT(0).value) )
     goto c105;
/* position 43 42 */
  ch_frame = get_selector_frame(DEF(42),sched);
  ch_t = ch_frame->inspectee->value.table;
  REF(43).value.integer = ch_frame->rmvcount +
    (*(ch_t->tbls[ORDER_TBL].des->position_of))(ch_t,ORDER_TBL,ch_frame->pos);
  REF(43).tsdr = &dr_integer;
/* endget 42 3.2.0 */
  end_selector(DEF(42),DEF(3)DOT(2)DOT(0),sched,GET);
/* copy 44 43 */
  REF(44) = REF(43);
/* ile 41 44 3.5 */
  REF(41).value.boolean = (REF(44).value.integer <= REF(3)DOT(5).value.integer
    );
c113:
/* branch_true 41 , 92 */
  if ( REF(41).value.boolean ) goto c92;
/* boolean 37 , FALSE */
  REF(37).value.boolean = FALSE;
  REF(37).tsdr = & dr_boolean;
c115:
/* endget 38 33.1 */
  end_selector(DEF(38),DEF(33)DOT(1),sched,GET);
/* branch_false 37 , 84 */
  if ( !REF(37).value.boolean ) goto c84;
/* block , 2 */
  if((ch_returncode = che_block(QUAL(2),sched)) != Normal)
     goto ch_raise_exception;
/* copy 45 33 */
  if((ch_returncode = (REF(33).tsdr->copy)(& ch_val, REF(33).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(45).tsdr)->finalize)(REF(45).value,F_DISCARD,sched);
  REF(45).value = ch_val;
  REF(45).tsdr = datarepmap[REF(33).tsdr->number];
/* insert 3.6.0.1 45 */
  if ((ch_returncode = insertfunc(DEF(3)DOT(6)DOT(0)DOT(1),DEF(45)
    ,FALSE,0)) != Normal) goto ch_raise_exception;
/* endblock */
  che_endblock(sched);
c122:
/* discard 45 */
  (*(REF(45).tsdr)->finalize)(REF(45).value,F_DISCARD,sched);
  REF(45).tsdr = & dr_bottom;
/* branch , 84 */
   goto c84;
c125:
/* endget 33 32 */
  end_selector(DEF(33),DEF(32),sched,GET);
/* discard 32 */
  (*(REF(32).tsdr)->finalize)(REF(32).value,F_DISCARD,sched);
  REF(32).tsdr = & dr_bottom;
c128:
/* 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);
c131:
/* endprocess */
  che_endprocess(sched); return;
#include "chtail.h"
