#include "chdecl.h"
void CH_typestate_tsapost_proglit_0(current, sched, cop)
#define ARGUMENTS 12
#include "chhead.h"
select: switch (SELECTOR) {
    case 0: goto c0;
    case 1: goto cb1;
    case 2: goto c2;
    case 3: goto cb3;
    case 4: goto c4;
    case 5: goto c6;
    case 6: goto c13;
    case 7: goto c23;
    case 8: goto cb29;
    case 9: goto c30;
    case 10: goto c32;
    case 11: goto c35;
    case 12: goto c40;
    case 13: goto c53;
    case 14: goto c63;
    case 15: goto c77;
    case 16: goto c79;
    case 17: goto c91;
    case 18: goto c94;
    case 19: goto c109;  }
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;
  current->ip = 3;
cb3:
/* call 3.0.3 3.0 3.1 3.4 3.2 3.7 3.6 4 5 6 , 2 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(0)DOT(3),
          arguments[1] = DEF(3)DOT(0),
          arguments[2] = DEF(3)DOT(1),
          arguments[3] = DEF(3)DOT(4),
          arguments[4] = DEF(3)DOT(2),
          arguments[5] = DEF(3)DOT(7),
          arguments[6] = DEF(3)DOT(6),
          arguments[7] = DEF(4),
          arguments[8] = DEF(5),
          arguments[9] = DEF(6),
          arguments[9+1] = nil,& arguments[0]),QUAL(2),sched)) != Normal)
     goto ch_raise_exception;
  return;
c4:
/* endblock */
  che_endblock(sched);
c6:
/* discard 4 */
  (*(REF(4).tsdr)->finalize)(REF(4).value,F_DISCARD,sched);
  REF(4).tsdr = & dr_bottom;
/* currentprogram 7 */
  if ((ch_val.program = make_pgm_copy(sched->ready->prog)) == nil)
     goto ch_depletion;
  (*(REF(7).tsdr)->finalize)(REF(7).value,F_DISCARD,sched);
  REF(7).value = ch_val; REF(7).tsdr = & dr_program;
/* procedure 8 7 , 3 */
  if ((ch_returncode = che_procedure(DEF(8),DEF(7),QUAL(3),sched)) != Normal)
     goto ch_raise_exception;
/* discard 7 */
  (*(REF(7).tsdr)->finalize)(REF(7).value,F_DISCARD,sched);
  REF(7).tsdr = & dr_bottom;
/* move 9 8 */
  (*(REF(9).tsdr)->finalize)(REF(9).value,F_DISCARD,sched);
  REF(9) = REF(8);
  REF(8).tsdr = & dr_bottom;
/* boolean 10 , TRUE */
  REF(10).value.boolean = TRUE;
  REF(10).tsdr = & dr_boolean;
/* initget 11 5 , 0,0 */
  (*(REF(11).tsdr)->finalize)(REF(11).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(11),DEF(5),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
c13:
/* get_or_goto 11 5 , 19 */
  if ((ch_returncode = get_selected_object(DEF(11),DEF(5),sched)) != Normal)
     goto c19;
/* boolean 12 , FALSE */
  REF(12).value.boolean = FALSE;
  REF(12).tsdr = & dr_boolean;
/* find_or_goto 13 3.5.1 11 , 0,17 */
  if (findfunc(DEF(13),DEF(3)DOT(5)DOT(1),(
          arguments[0] = DEF(11),& arguments[0]),sched,0) == FAILURE) goto c17;
/* boolean 12 , TRUE */
  REF(12).value.boolean = TRUE;
  REF(12).tsdr = & dr_boolean;
c17:
/* branch_true 12 , 13 */
  if ( REF(12).value.boolean ) goto c13;
/* boolean 10 , FALSE */
  REF(10).value.boolean = FALSE;
  REF(10).tsdr = & dr_boolean;
c19:
/* endget 11 5 */
  end_selector(DEF(11),DEF(5),sched,GET);
/* move 14 10 */
  REF(14) = REF(10);
  REF(10).tsdr = & dr_bottom;
/* copy 15 5 */
  if((ch_returncode = cp_table(& ch_val, REF(5).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(15).tsdr)->finalize)(REF(15).value,F_DISCARD,sched);
  REF(15).value = ch_val;
  REF(15).tsdr = & dr_table;
/* initget 16 15 , 0,0 */
  (*(REF(16).tsdr)->finalize)(REF(16).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(16),DEF(15),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
c23:
/* get_or_goto 16 15 , 35 */
  if ((ch_returncode = get_selected_object(DEF(16),DEF(15),sched)) != Normal)
     goto c35;
/* boolean 17 , FALSE */
  REF(17).value.boolean = FALSE;
  REF(17).tsdr = & dr_boolean;
/* find_or_goto 18 3.5.1 16 , 0,27 */
  if (findfunc(DEF(18),DEF(3)DOT(5)DOT(1),(
          arguments[0] = DEF(16),& arguments[0]),sched,0) == FAILURE) goto c27;
/* boolean 17 , TRUE */
  REF(17).value.boolean = TRUE;
  REF(17).tsdr = & dr_boolean;
c27:
/* branch_false 17 , 23 */
  if ( !REF(17).value.boolean ) goto c23;
/* block , 4 */
  if((ch_returncode = che_block(QUAL(4),sched)) != Normal)
     goto ch_raise_exception;
  current->ip = 8;
cb29:
/* call 9 3.0 3.1 3.2 3.3 3.4 3.5 3.6 16 , 5 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(9),
          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(16),
          arguments[8+1] = nil,& arguments[0]),QUAL(5),sched)) != Normal)
     goto ch_raise_exception;
  return;
c30:
/* endblock */
  che_endblock(sched);
/* branch , 23 */
   goto c23;
c32:
/* boolean 14 , FALSE */
  REF(14).value.boolean = FALSE;
  REF(14).tsdr = & dr_boolean;
/* branch , 23 */
   goto c23;
c35:
/* endget 16 15 */
  end_selector(DEF(16),DEF(15),sched,GET);
/* discard 15 */
  (*(REF(15).tsdr)->finalize)(REF(15).value,F_DISCARD,sched);
  REF(15).tsdr = & dr_bottom;
/* branch_false 14 , 79 */
  if ( !REF(14).value.boolean ) goto c79;
/* boolean 19 , TRUE */
  REF(19).value.boolean = TRUE;
  REF(19).tsdr = & dr_boolean;
/* initget 20 6 , 0,0 */
  (*(REF(20).tsdr)->finalize)(REF(20).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(20),DEF(6),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
c40:
/* get_or_goto 20 6 , 48 */
  if ((ch_returncode = get_selected_object(DEF(20),DEF(6),sched)) != Normal)
     goto c48;
/* equal 21 20 3.7 */
  REF(21).value.boolean = ((REF(20).tsdr->equal)(REF(20).value,
    REF(3)DOT(7).value));
  REF(21).tsdr = & dr_boolean;
/* boolean 22 , FALSE */
  REF(22).value.boolean = FALSE;
  REF(22).tsdr = & dr_boolean;
/* find_or_goto 23 3.5.1 20 , 0,45 */
  if (findfunc(DEF(23),DEF(3)DOT(5)DOT(1),(
          arguments[0] = DEF(20),& arguments[0]),sched,0) == FAILURE) goto c45;
/* boolean 22 , TRUE */
  REF(22).value.boolean = TRUE;
  REF(22).tsdr = & dr_boolean;
c45:
/* or 24 21 22 */
  REF(24).value.boolean = REF(21).value.boolean|REF(22).value.boolean;
  REF(24).tsdr = & dr_boolean;
/* branch_true 24 , 40 */
  if ( REF(24).value.boolean ) goto c40;
/* boolean 19 , FALSE */
  REF(19).value.boolean = FALSE;
  REF(19).tsdr = & dr_boolean;
c48:
/* endget 20 6 */
  end_selector(DEF(20),DEF(6),sched,GET);
/* branch_false 19 , 63 */
  if ( !REF(19).value.boolean ) goto c63;
/* new_table 25 , 6 */
  if ((ch_returncode = che_new_table(DEF(25),QUAL(6),sched)) != Normal) 
     goto ch_raise_exception;
/* privatize 3.6 */
  if (REF(3)DOT(6).value.table->refcount != 1)
    if ((ch_returncode = doCopyOnWrite(DEF(3)DOT(6))) != Normal)
       goto ch_raise_exception;
/* initget 26 3.6 , 0,0 */
  (*(REF(26).tsdr)->finalize)(REF(26).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(26),DEF(3)DOT(6),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
c53:
/* get_or_goto 26 3.6 , 61 */
  if ((ch_returncode = get_selected_object(DEF(26),DEF(3)DOT(6)
    ,sched)) != Normal) goto c61;
/* boolean 27 , FALSE */
  REF(27).value.boolean = FALSE;
  REF(27).tsdr = & dr_boolean;
/* find_or_goto 28 6 26 , 0,57 */
  if (findfunc(DEF(28),DEF(6),(
          arguments[0] = DEF(26),& arguments[0]),sched,0) == FAILURE) goto c57;
/* boolean 27 , TRUE */
  REF(27).value.boolean = TRUE;
  REF(27).tsdr = & dr_boolean;
c57:
/* branch_false 27 , 53 */
  if ( !REF(27).value.boolean ) goto c53;
/* remove 29 26 3.6 */
  if ((ch_returncode = che_remove(DEF(29),DEF(26),DEF(3)DOT(6)
    ,sched)) != Normal) goto ch_raise_exception;
/* insert 25 29 */
  if ((ch_returncode = insertfunc(DEF(25),DEF(29),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* branch , 53 */
   goto c53;
c61:
/* endget 26 3.6 */
  end_selector(DEF(26),DEF(3)DOT(6),sched,GET);
/* branch , 77 */
   goto c77;
c63:
/* boolean 14 , FALSE */
  REF(14).value.boolean = FALSE;
  REF(14).tsdr = & dr_boolean;
/* new_record 30 , 3 */
  if ((ch_val.record = new_record(3)) == nil) goto ch_depletion;
  (*(REF(30).tsdr)->finalize)(REF(30).value,F_DISCARD,sched);
  REF(30).value = ch_val; REF(30).tsdr = & dr_record;
/* copy 31 3.3 */
  if((ch_returncode = (REF(3)DOT(3).tsdr->copy)(& ch_val, REF(3)DOT(3).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(3).tsdr->number];
/* unite 30.0 31 , 0 */
  if ((ch_returncode = che_unite(DEF(30)DOT(0),DEF(31),sched,0)) != Normal)
     goto ch_raise_exception;
/* ordenum_lit 30.1 , 19 */
  REF(30)DOT(1).value.ord_enum = 19;
  REF(30)DOT(1).tsdr = & dr_ord_enumeration;
/* new_table 30.2 , 7 */
  if ((ch_returncode = che_new_table(DEF(30)DOT(2),QUAL(7),sched)) != Normal) 
     goto ch_raise_exception;
/* copy 32 3.7 */
  if((ch_returncode = (REF(3)DOT(7).tsdr->copy)(& ch_val, REF(3)DOT(7).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(32).tsdr)->finalize)(REF(32).value,F_DISCARD,sched);
  REF(32).value = ch_val;
  REF(32).tsdr = datarepmap[REF(3)DOT(7).tsdr->number];
/* unite 33 32 , 1 */
  if ((ch_returncode = che_unite(DEF(33),DEF(32),sched,1)) != Normal)
     goto ch_raise_exception;
/* insert 30.2 33 */
  if ((ch_returncode = insertfunc(DEF(30)DOT(2),DEF(33),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* insert 3.4.11 30 */
  if ((ch_returncode = insertfunc(DEF(3)DOT(4)DOT(11),DEF(30)
    ,FALSE,0)) != Normal) goto ch_raise_exception;
c77:
/* discard 25 */
  (*(REF(25).tsdr)->finalize)(REF(25).value,F_DISCARD,sched);
  REF(25).tsdr = & dr_bottom;
/* branch , 91 */
   goto c91;
c79:
/* new_record 34 , 3 */
  if ((ch_val.record = new_record(3)) == nil) goto ch_depletion;
  (*(REF(34).tsdr)->finalize)(REF(34).value,F_DISCARD,sched);
  REF(34).value = ch_val; REF(34).tsdr = & dr_record;
/* copy 35 3.3 */
  if((ch_returncode = (REF(3)DOT(3).tsdr->copy)(& ch_val, REF(3)DOT(3).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(3).tsdr->number];
/* unite 34.0 35 , 0 */
  if ((ch_returncode = che_unite(DEF(34)DOT(0),DEF(35),sched,0)) != Normal)
     goto ch_raise_exception;
/* ordenum_lit 34.1 , 19 */
  REF(34)DOT(1).value.ord_enum = 19;
  REF(34)DOT(1).tsdr = & dr_ord_enumeration;
/* new_table 34.2 , 7 */
  if ((ch_returncode = che_new_table(DEF(34)DOT(2),QUAL(7),sched)) != Normal) 
     goto ch_raise_exception;
/* copy 36 3.7 */
  if((ch_returncode = (REF(3)DOT(7).tsdr->copy)(& ch_val, REF(3)DOT(7).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(36).tsdr)->finalize)(REF(36).value,F_DISCARD,sched);
  REF(36).value = ch_val;
  REF(36).tsdr = datarepmap[REF(3)DOT(7).tsdr->number];
/* unite 37 36 , 1 */
  if ((ch_returncode = che_unite(DEF(37),DEF(36),sched,1)) != Normal)
     goto ch_raise_exception;
/* insert 34.2 37 */
  if ((ch_returncode = insertfunc(DEF(34)DOT(2),DEF(37),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* insert 3.4.11 34 */
  if ((ch_returncode = insertfunc(DEF(3)DOT(4)DOT(11),DEF(34)
    ,FALSE,0)) != Normal) goto ch_raise_exception;
c91:
/* new_table 25 , 6 */
  if ((ch_returncode = che_new_table(DEF(25),QUAL(6),sched)) != Normal) 
     goto ch_raise_exception;
/* privatize 3.5.1 */
  if (REF(3)DOT(5)DOT(1).value.table->refcount != 1)
    if ((ch_returncode = doCopyOnWrite(DEF(3)DOT(5)DOT(1))) != Normal)
       goto ch_raise_exception;
/* initget 38 3.5.1 , 0,0 */
  (*(REF(38).tsdr)->finalize)(REF(38).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(38),DEF(3)DOT(5)DOT(1),nil,sched,GET,
    0,0)) != Normal) goto ch_raise_exception;
c94:
/* get_or_goto 38 3.5.1 , 102 */
  if ((ch_returncode = get_selected_object(DEF(38),DEF(3)DOT(5)DOT(1)
    ,sched)) != Normal) goto c102;
/* boolean 39 , FALSE */
  REF(39).value.boolean = FALSE;
  REF(39).tsdr = & dr_boolean;
/* find_or_goto 40 6 38 , 0,98 */
  if (findfunc(DEF(40),DEF(6),(
          arguments[0] = DEF(38),& arguments[0]),sched,0) == FAILURE) goto c98;
/* boolean 39 , TRUE */
  REF(39).value.boolean = TRUE;
  REF(39).tsdr = & dr_boolean;
c98:
/* branch_false 39 , 94 */
  if ( !REF(39).value.boolean ) goto c94;
/* remove 41 38 3.5.1 */
  if ((ch_returncode = che_remove(DEF(41),DEF(38),DEF(3)DOT(5)DOT(1)
    ,sched)) != Normal) goto ch_raise_exception;
/* insert 25 41 */
  if ((ch_returncode = insertfunc(DEF(25),DEF(41),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* branch , 94 */
   goto c94;
c102:
/* endget 38 3.5.1 */
  end_selector(DEF(38),DEF(3)DOT(5)DOT(1),sched,GET);
/* branch_false 14 , 106 */
  if ( !REF(14).value.boolean ) goto c106;
/* 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 , 107 */
   goto c107;
c106:
/* return_exception 3 , 8 */
  if (ch_caller = do_return(REF(3).value)) {
    raise_user(QUAL(8),ch_caller); 
    sched->wakeup_proc(sched,ch_caller);}
  else rem_return_exception(DEF(3),QUAL(8));
  REF(3).tsdr = & dr_bottom;
c107:
/* endblock */
  che_endblock(sched);
c109:
/* endprocess */
  che_endprocess(sched); return;
#include "chtail.h"
