#include "chdecl.h"
void CH_typestate_tsapre_proglit(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 c4;
    case 4: goto cb9;
    case 5: goto c10;
    case 6: goto cb14;
    case 7: goto c15;
    case 8: goto c18;
    case 9: goto c20;
    case 10: goto cb48;
    case 11: goto c50;
    case 12: goto c57;
    case 13: goto c60;
    case 14: goto c65;
    case 15: goto c74;
    case 16: goto c78;
    case 17: goto c83;  }
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:
/* copy 4 3.6 */
  if((ch_returncode = cp_table(& ch_val, REF(3)DOT(6).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(4).tsdr)->finalize)(REF(4).value,F_DISCARD,sched);
  REF(4).value = ch_val;
  REF(4).tsdr = & dr_table;
/* initget 5 4 , 0,0 */
  (*(REF(5).tsdr)->finalize)(REF(5).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(5),DEF(4),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
c4:
/* get_or_goto 5 4 , 78 */
  if ((ch_returncode = get_selected_object(DEF(5),DEF(4),sched)) != Normal)
     goto c78;
/* boolean 6 , FALSE */
  REF(6).value.boolean = FALSE;
  REF(6).tsdr = & dr_boolean;
/* find_or_goto 7 3.7 5 , 0,8 */
  if (findfunc(DEF(7),DEF(3)DOT(7),(
          arguments[0] = DEF(5),& arguments[0]),sched,0) == FAILURE) goto c8;
/* boolean 6 , TRUE */
  REF(6).value.boolean = TRUE;
  REF(6).tsdr = & dr_boolean;
c8:
/* branch_false 6 , 4 */
  if ( !REF(6).value.boolean ) goto c4;
  current->ip = 4;
cb9:
/* call 3.0.10 3.0 3.1 3.2 3.4 5 3.7 8 , 1 */
  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(5),
          arguments[6] = DEF(3)DOT(7),
          arguments[7] = DEF(8),
          arguments[7+1] = nil,& arguments[0]),QUAL(1),sched)) != Normal)
     goto ch_raise_exception;
  return;
c10:
/* branch_false 8 , 12 */
  if ( !REF(8).value.boolean ) goto c12;
/* branch , 74 */
   goto c74;
c12:
/* new_table 9 , 2 */
  if ((ch_returncode = che_new_table(DEF(9),QUAL(2),sched)) != Normal) 
     goto ch_raise_exception;
/* block , 3 */
  if((ch_returncode = che_block(QUAL(3),sched)) != Normal)
     goto ch_raise_exception;
  current->ip = 6;
cb14:
/* call 3.0.3 3.0 3.1 3.4 3.2 5 3.7 10 11 12 , 4 */
  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(5),
          arguments[6] = DEF(3)DOT(7),
          arguments[7] = DEF(10),
          arguments[8] = DEF(11),
          arguments[9] = DEF(12),
          arguments[9+1] = nil,& arguments[0]),QUAL(4),sched)) != Normal)
     goto ch_raise_exception;
  return;
c15:
/* insert 9 10 */
  if ((ch_returncode = insertfunc(DEF(9),DEF(10),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* endblock */
  che_endblock(sched);
c18:
/* copy 13 12 */
  if((ch_returncode = cp_table(& ch_val, REF(12).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(13).tsdr)->finalize)(REF(13).value,F_DISCARD,sched);
  REF(13).value = ch_val;
  REF(13).tsdr = & dr_table;
/* initget 14 13 , 0,0 */
  (*(REF(14).tsdr)->finalize)(REF(14).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(14),DEF(13),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
c20:
/* get_or_goto 14 13 , 38 */
  if ((ch_returncode = get_selected_object(DEF(14),DEF(13),sched)) != Normal)
     goto c38;
/* boolean 15 , FALSE */
  REF(15).value.boolean = FALSE;
  REF(15).tsdr = & dr_boolean;
/* find_or_goto 16 3.5 14 , 0,24 */
  if (findfunc(DEF(16),DEF(3)DOT(5),(
          arguments[0] = DEF(14),& arguments[0]),sched,0) == FAILURE) goto c24;
/* boolean 15 , TRUE */
  REF(15).value.boolean = TRUE;
  REF(15).tsdr = & dr_boolean;
c24:
/* branch_false 15 , 20 */
  if ( !REF(15).value.boolean ) goto c20;
/* new_record 17 , 3 */
  if ((ch_val.record = new_record(3)) == nil) goto ch_depletion;
  (*(REF(17).tsdr)->finalize)(REF(17).value,F_DISCARD,sched);
  REF(17).value = ch_val; REF(17).tsdr = & dr_record;
/* copy 18 3.3 */
  if((ch_returncode = (REF(3)DOT(3).tsdr->copy)(& ch_val, REF(3)DOT(3).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(18).tsdr)->finalize)(REF(18).value,F_DISCARD,sched);
  REF(18).value = ch_val;
  REF(18).tsdr = datarepmap[REF(3)DOT(3).tsdr->number];
/* unite 17.0 18 , 0 */
  if ((ch_returncode = che_unite(DEF(17)DOT(0),DEF(18),sched,0)) != Normal)
     goto ch_raise_exception;
/* ordenum_lit 17.1 , 17 */
  REF(17)DOT(1).value.ord_enum = 17;
  REF(17)DOT(1).tsdr = & dr_ord_enumeration;
/* new_table 17.2 , 5 */
  if ((ch_returncode = che_new_table(DEF(17)DOT(2),QUAL(5),sched)) != Normal) 
     goto ch_raise_exception;
/* copy 19 14 */
  if((ch_returncode = (REF(14).tsdr->copy)(& ch_val, REF(14).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(19).tsdr)->finalize)(REF(19).value,F_DISCARD,sched);
  REF(19).value = ch_val;
  REF(19).tsdr = datarepmap[REF(14).tsdr->number];
/* unite 20 19 , 1 */
  if ((ch_returncode = che_unite(DEF(20),DEF(19),sched,1)) != Normal)
     goto ch_raise_exception;
/* insert 17.2 20 */
  if ((ch_returncode = insertfunc(DEF(17)DOT(2),DEF(20),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* insert 3.4.11 17 */
  if ((ch_returncode = insertfunc(DEF(3)DOT(4)DOT(11),DEF(17)
    ,FALSE,0)) != Normal) goto ch_raise_exception;
/* branch , 20 */
   goto c20;
c38:
/* endget 14 13 */
  end_selector(DEF(14),DEF(13),sched,GET);
/* discard 13 */
  (*(REF(13).tsdr)->finalize)(REF(13).value,F_DISCARD,sched);
  REF(13).tsdr = & dr_bottom;
/* size 21 11 */
  REF(21).value.integer = REF(11).value.table->size;
  REF(21).tsdr = & dr_integer;
/* ile . 21 =(0) , 50 */
  if ( REF(21).value.integer <= 0 ) goto c50;
/* currentprogram 22 */
  if ((ch_val.program = make_pgm_copy(sched->ready->prog)) == nil)
     goto ch_depletion;
  (*(REF(22).tsdr)->finalize)(REF(22).value,F_DISCARD,sched);
  REF(22).value = ch_val; REF(22).tsdr = & dr_program;
/* procedure 23 22 , 6 */
  if ((ch_returncode = che_procedure(DEF(23),DEF(22),QUAL(6)
    ,sched)) != Normal) goto ch_raise_exception;
/* discard 22 */
  (*(REF(22).tsdr)->finalize)(REF(22).value,F_DISCARD,sched);
  REF(22).tsdr = & dr_bottom;
/* move 24 23 */
  (*(REF(24).tsdr)->finalize)(REF(24).value,F_DISCARD,sched);
  REF(24) = REF(23);
  REF(23).tsdr = & dr_bottom;
  current->ip = 10;
cb48:
/* call 24 3.0 3.1 3.2 3.3 3.4 3.5 11 3.7 , 7 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(24),
          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(11),
          arguments[8] = DEF(3)DOT(7),
          arguments[8+1] = nil,& arguments[0]),QUAL(7),sched)) != Normal)
     goto ch_raise_exception;
  return;
c50:
/* discard 24 */
  (*(REF(24).tsdr)->finalize)(REF(24).value,F_DISCARD,sched);
  REF(24).tsdr = & dr_bottom;
/* block , 8 */
  if((ch_returncode = che_block(QUAL(8),sched)) != Normal)
     goto ch_raise_exception;
/* privatize 3.4.7 */
  if (REF(3)DOT(4)DOT(7).value.table->refcount != 1)
    if ((ch_returncode = doCopyOnWrite(DEF(3)DOT(4)DOT(7))) != Normal)
       goto ch_raise_exception;
/* find 25 3.4.7 3.3 , 0 */
  if (findfunc(DEF(25),DEF(3)DOT(4)DOT(7),(
          arguments[0] = DEF(3)DOT(3),& arguments[0]),sched,0) == FAILURE)
             goto ch_notfound;
/* fremove 26 25 3.4.7 , 0 */
  if ((ch_returncode = removefunc(DEF(26),DEF(25),DEF(3)DOT(4)DOT(7),sched,0
    ,NO_TBL,(position *) nil)) != Normal) goto ch_raise_exception;
/* endblock */
  che_endblock(sched);
/* branch , 60 */
   goto c60;
c57:
/* new_record 26 , 2 */
  if ((ch_val.record = new_record(2)) == nil) goto ch_depletion;
  (*(REF(26).tsdr)->finalize)(REF(26).value,F_DISCARD,sched);
  REF(26).value = ch_val; REF(26).tsdr = & dr_record;
/* copy 26.0 3.3 */
  if((ch_returncode = (REF(3)DOT(3).tsdr->copy)(& ch_val, REF(3)DOT(3).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(26)DOT(0).tsdr)->finalize)(REF(26)DOT(0).value,F_DISCARD,sched);
  REF(26)DOT(0).value = ch_val;
  REF(26)DOT(0).tsdr = datarepmap[REF(3)DOT(3).tsdr->number];
/* new_table 26.1 , 2 */
  if ((ch_returncode = che_new_table(DEF(26)DOT(1),QUAL(2),sched)) != Normal) 
     goto ch_raise_exception;
c60:
/* merge 26.1 9 */
  if ((ch_returncode = mergefunc(DEF(26)DOT(1),DEF(9),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* insert 3.4.7 26 */
  if ((ch_returncode = insertfunc(DEF(3)DOT(4)DOT(7),DEF(26)
    ,FALSE,0)) != Normal) goto ch_raise_exception;
/* new_table 27 , 9 */
  if ((ch_returncode = che_new_table(DEF(27),QUAL(9),sched)) != Normal) 
     goto ch_raise_exception;
/* privatize 3.7 */
  if (REF(3)DOT(7).value.table->refcount != 1)
    if ((ch_returncode = doCopyOnWrite(DEF(3)DOT(7))) != Normal)
       goto ch_raise_exception;
/* initget 28 3.7 , 0,0 */
  (*(REF(28).tsdr)->finalize)(REF(28).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(28),DEF(3)DOT(7),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
c65:
/* get_or_goto 28 3.7 , 73 */
  if ((ch_returncode = get_selected_object(DEF(28),DEF(3)DOT(7)
    ,sched)) != Normal) goto c73;
/* boolean 29 , FALSE */
  REF(29).value.boolean = FALSE;
  REF(29).tsdr = & dr_boolean;
/* find_or_goto 30 12 28 , 0,69 */
  if (findfunc(DEF(30),DEF(12),(
          arguments[0] = DEF(28),& arguments[0]),sched,0) == FAILURE) goto c69;
/* boolean 29 , TRUE */
  REF(29).value.boolean = TRUE;
  REF(29).tsdr = & dr_boolean;
c69:
/* branch_false 29 , 65 */
  if ( !REF(29).value.boolean ) goto c65;
/* remove 31 28 3.7 */
  if ((ch_returncode = che_remove(DEF(31),DEF(28),DEF(3)DOT(7)
    ,sched)) != Normal) goto ch_raise_exception;
/* insert 27 31 */
  if ((ch_returncode = insertfunc(DEF(27),DEF(31),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* branch , 65 */
   goto c65;
c73:
/* endget 28 3.7 */
  end_selector(DEF(28),DEF(3)DOT(7),sched,GET);
c74:
/* discard 11 */
  (*(REF(11).tsdr)->finalize)(REF(11).value,F_DISCARD,sched);
  REF(11).tsdr = & dr_bottom;
/* discard 12 */
  (*(REF(12).tsdr)->finalize)(REF(12).value,F_DISCARD,sched);
  REF(12).tsdr = & dr_bottom;
/* discard 27 */
  (*(REF(27).tsdr)->finalize)(REF(27).value,F_DISCARD,sched);
  REF(27).tsdr = & dr_bottom;
/* branch , 4 */
   goto c4;
c78:
/* endget 5 4 */
  end_selector(DEF(5),DEF(4),sched,GET);
/* discard 4 */
  (*(REF(4).tsdr)->finalize)(REF(4).value,F_DISCARD,sched);
  REF(4).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);
c83:
/* endprocess */
  che_endprocess(sched); return;
#include "chtail.h"
