#include "chdecl.h"
void CH_typestate_precall(current, sched, cop)
#define ARGUMENTS 9
#include "chhead.h"
select: switch (SELECTOR) {
    case 0: goto c0;
    case 1: goto cb2;
    case 2: goto c3;
    case 3: goto cb7;
    case 4: goto c8;
    case 5: goto c22;
    case 6: goto c28;
    case 7: goto c30;
    case 8: goto cb32;
    case 9: goto c33;
    case 16: goto c36;
    case 10: goto c36;
    case 11: goto c51;
    case 12: goto c53;
    case 13: goto cb62;
    case 14: goto c63;
    case 15: goto cb64;
    case 17: goto c66;
    case 18: goto c70;
    case 19: goto c76;
    case 20: goto c78;
    case 21: goto c83;
    case 22: goto c99;
    case 23: goto c105;  }
c0:
/* block , 0 */
  if((ch_returncode = che_block(QUAL(0),sched)) != Normal)
     goto ch_raise_exception;
/* block , 1 */
  if((ch_returncode = che_block(QUAL(1),sched)) != Normal)
     goto ch_raise_exception;
  current->ip = 1;
cb2:
/* receive 3 0 */
  if ((ch_returncode = che_receive(DEF(3),DEF(0),sched)) != Normal)
     goto ch_raise_exception;
  return;
c3:
/* noop */
  
/* lookup_at 4 3.4.2 =(0) */
  if ( !((ch_t = REF(3)DOT(4)DOT(2).value.table)->size) ) goto ch_notfound;
  (*(REF(4).tsdr)->finalize)(REF(4).value,F_DISCARD,sched);
  (*(ch_t->tbls[ORDER_TBL].des->lookup_at))
    (ch_t, ORDER_TBL, & REF(4).value,0);
  REF(4).tsdr = qdatarepmap[ch_t->tsdr->number];
/* copy 5 4 */
  if((ch_returncode = (REF(4).tsdr->copy)(& ch_val, REF(4).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(5).tsdr)->finalize)(REF(5).value,F_DISCARD,sched);
  REF(5).value = ch_val;
  REF(5).tsdr = datarepmap[REF(4).tsdr->number];
  current->ip = 3;
cb7:
/* call 3.0.13 3.0 3.2 3.1 3.3 5 6 , 2 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(0)DOT(13),
          arguments[1] = DEF(3)DOT(0),
          arguments[2] = DEF(3)DOT(2),
          arguments[3] = DEF(3)DOT(1),
          arguments[4] = DEF(3)DOT(3),
          arguments[5] = DEF(5),
          arguments[6] = DEF(6),
          arguments[6+1] = nil,& arguments[0]),QUAL(2),sched)) != Normal)
     goto ch_raise_exception;
  return;
c8:
/* noop */
  
/* find 7 3.1 6.0 , 0 */
  if (findfunc(DEF(7),DEF(3)DOT(1),(
          arguments[0] = DEF(6)DOT(0),& arguments[0]),sched,0) == FAILURE)
             goto ch_notfound;
/* find 8 7.1 6.1 , 0 */
  if (findfunc(DEF(8),DEF(7)DOT(1),(
          arguments[0] = DEF(6)DOT(1),& arguments[0]),sched,0) == FAILURE)
             goto ch_notfound;
/* reveal 8.2 , 9 */
  if (9 != REF(8)DOT(2).value.variant->info.variant_case) goto ch_case_error;
/* find 9 3.1 8.2.0.0 , 0 */
  if (findfunc(DEF(9),DEF(3)DOT(1),(
          arguments[0] = DEF(8)DOT(2)DOT(0)DOT(0),& arguments[0]),sched,0
            ) == FAILURE) goto ch_notfound;
/* find 10 9.1 8.2.0.1 , 0 */
  if (findfunc(DEF(10),DEF(9)DOT(1),(
          arguments[0] = DEF(8)DOT(2)DOT(0)DOT(1),& arguments[0]),sched,0
            ) == FAILURE) goto ch_notfound;
/* reveal 10.2 , 8 */
  if (8 != REF(10)DOT(2).value.variant->info.variant_case) goto ch_case_error;
/* find 11 3.1 10.2.0.0.0 , 0 */
  if (findfunc(DEF(11),DEF(3)DOT(1),(
          arguments[0] = DEF(10)DOT(2)DOT(0)DOT(0)DOT(0),
            & arguments[0]),sched,0) == FAILURE) goto ch_notfound;
/* find 12 11.1 10.2.0.0.1 , 0 */
  if (findfunc(DEF(12),DEF(11)DOT(1),(
          arguments[0] = DEF(10)DOT(2)DOT(0)DOT(0)DOT(1),
            & arguments[0]),sched,0) == FAILURE) goto ch_notfound;
/* reveal 12.2 , 10 */
  if (10 != REF(12)DOT(2).value.variant->info.variant_case)
     goto ch_case_error;
/* find 13 12.2.0.3 12.2.0.2 , 0 */
  if (findfunc(DEF(13),DEF(12)DOT(2)DOT(0)DOT(3),(
          arguments[0] = DEF(12)DOT(2)DOT(0)DOT(2),& arguments[0]),sched,0
            ) == FAILURE) goto ch_notfound;
/* copy 14 13.1 */
  if((ch_returncode = cp_table(& ch_val, REF(13)DOT(1).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(14).tsdr)->finalize)(REF(14).value,F_DISCARD,sched);
  REF(14).value = ch_val;
  REF(14).tsdr = & dr_table;
/* copy 15 10.2.0.1 */
  if((ch_returncode = cp_table(& ch_val, REF(10)DOT(2)DOT(0)DOT(1).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;
c22:
/* get_or_goto 16 15 , 30 */
  if ((ch_returncode = get_selected_object(DEF(16),DEF(15),sched)) != Normal)
     goto c30;
/* block , 3 */
  if((ch_returncode = che_block(QUAL(3),sched)) != Normal)
     goto ch_raise_exception;
/* copy 17 16 */
  if((ch_returncode = (REF(16).tsdr->copy)(& ch_val, REF(16).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(17).tsdr)->finalize)(REF(17).value,F_DISCARD,sched);
  REF(17).value = ch_val;
  REF(17).tsdr = datarepmap[REF(16).tsdr->number];
/* insert 14 17 */
  if ((ch_returncode = insertfunc(DEF(14),DEF(17),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* endblock */
  che_endblock(sched);
c28:
/* discard 17 */
  (*(REF(17).tsdr)->finalize)(REF(17).value,F_DISCARD,sched);
  REF(17).tsdr = & dr_bottom;
/* branch , 22 */
   goto c22;
c30:
/* 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;
  current->ip = 8;
cb32:
/* call 3.0.15 3.0 3.4.2 12.1 14 18 , 4 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(0)DOT(15),
          arguments[1] = DEF(3)DOT(0),
          arguments[2] = DEF(3)DOT(4)DOT(2),
          arguments[3] = DEF(12)DOT(1),
          arguments[4] = DEF(14),
          arguments[5] = DEF(18),
          arguments[5+1] = nil,& arguments[0]),QUAL(4),sched)) != Normal)
     goto ch_raise_exception;
  return;
c33:
/* move 19 18 */
  (*(REF(19).tsdr)->finalize)(REF(19).value,F_DISCARD,sched);
  REF(19) = REF(18);
  REF(18).tsdr = & dr_bottom;
/* copy 20 3.4.2 */
  if((ch_returncode = cp_table(& ch_val, REF(3)DOT(4)DOT(2).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(20).tsdr)->finalize)(REF(20).value,F_DISCARD,sched);
  REF(20).value = ch_val;
  REF(20).tsdr = & dr_table;
/* initget 21 20 , 0,0 */
  (*(REF(21).tsdr)->finalize)(REF(21).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(21),DEF(20),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
c65:
c36:
/* get_or_goto 21 20 , 66 */
  if ((ch_returncode = get_selected_object(DEF(21),DEF(20),sched)) != Normal)
     goto c66;
/* position 22 21 */
  ch_frame = get_selector_frame(DEF(21),sched);
  ch_t = ch_frame->inspectee->value.table;
  REF(22).value.integer = ch_frame->rmvcount +
    (*(ch_t->tbls[ORDER_TBL].des->position_of))(ch_t,ORDER_TBL,ch_frame->pos);
  REF(22).tsdr = &dr_integer;
/* notequal . 22 =(0) , 53 */
  if ( REF(22).value.integer != 0 ) goto c53;
/* block , 5 */
  if((ch_returncode = che_block(QUAL(5),sched)) != Normal)
     goto ch_raise_exception;
/* new_record 23 , 2 */
  if ((ch_val.record = new_record(2)) == nil) goto ch_depletion;
  (*(REF(23).tsdr)->finalize)(REF(23).value,F_DISCARD,sched);
  REF(23).value = ch_val; REF(23).tsdr = & dr_record;
/* new_table 23.1 , 6 */
  if ((ch_returncode = che_new_table(DEF(23)DOT(1),QUAL(6),sched)) != Normal) 
     goto ch_raise_exception;
/* unite 23.0 24 , 0 */
  if ((ch_returncode = che_unite(DEF(23)DOT(0),DEF(24),sched,0)) != Normal)
     goto ch_raise_exception;
/* copy 25 21 */
  if((ch_returncode = (REF(21).tsdr->copy)(& ch_val, REF(21).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(21).tsdr->number];
/* insert 23.1 25 */
  if ((ch_returncode = insertfunc(DEF(23)DOT(1),DEF(25),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* insert 3.8 23 */
  if ((ch_returncode = insertfunc(DEF(3)DOT(8),DEF(23),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* endblock */
  che_endblock(sched);
c51:
/* discard 23 */
  (*(REF(23).tsdr)->finalize)(REF(23).value,F_DISCARD,sched);
  REF(23).tsdr = & dr_bottom;
/* branch , 36 */
   goto c36;
c53:
/* position 26 21 */
  ch_frame = get_selector_frame(DEF(21),sched);
  ch_t = ch_frame->inspectee->value.table;
  REF(26).value.integer = ch_frame->rmvcount +
    (*(ch_t->tbls[ORDER_TBL].des->position_of))(ch_t,ORDER_TBL,ch_frame->pos);
  REF(26).tsdr = &dr_integer;
/* isubtract 27 26 =(1) */
  if (!chf_isubtract(DEF(27),REF(26).value.integer,1)) goto ch_depletion;
/* lookup_at 28 12.1 27 */
  if((ch_i = REF(27).value.integer) < 0 || ch_i >= (ch_t = REF(12)DOT(1).value
    .table)->size) goto ch_notfound;
  (*(REF(28).tsdr)->finalize)(REF(28).value,F_DISCARD,sched);
  (*(ch_t->tbls[ORDER_TBL].des->lookup_at))
    (ch_t, ORDER_TBL, & REF(28).value,ch_i);
  REF(28).tsdr = qdatarepmap[ch_t->tsdr->number];
/* boolean 29 , FALSE */
  REF(29).value.boolean = FALSE;
  REF(29).tsdr = & dr_boolean;
/* find_or_goto 30 12.2.0.0 28.0 , 0,60 */
  if (findfunc(DEF(30),DEF(12)DOT(2)DOT(0)DOT(0),(
          arguments[0] = DEF(28)DOT(0),& arguments[0]),sched,0) == FAILURE)
             goto c60;
/* boolean 29 , TRUE */
  REF(29).value.boolean = TRUE;
  REF(29).tsdr = & dr_boolean;
c60:
/* branch_false 29 , 62 */
  if ( !REF(29).value.boolean ) goto c62;
/* branch , 36 */
   goto c36;
c62:
  current->ip = 13;
cb62:
/* call 3.0.4 3.6 21 19 31 , 7 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(0)DOT(4),
          arguments[1] = DEF(3)DOT(6),
          arguments[2] = DEF(21),
          arguments[3] = DEF(19),
          arguments[4] = DEF(31),
          arguments[4+1] = nil,& arguments[0]),QUAL(7),sched)) != Normal)
     goto ch_raise_exception;
  return;
c63:
/* merge 3.9 31 */
  if ((ch_returncode = mergefunc(DEF(3)DOT(9),DEF(31),FALSE,0)) != Normal)
     goto ch_raise_exception;
  current->ip = 15;
cb64:
/* call 3.0.11 3.0 3.1 3.2 3.3 21 3.5 , 8 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(0)DOT(11),
          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(21),
          arguments[6] = DEF(3)DOT(5),
          arguments[6+1] = nil,& arguments[0]),QUAL(8),sched)) != Normal)
     goto ch_raise_exception;
  return;
c66:
/* endget 21 20 */
  end_selector(DEF(21),DEF(20),sched,GET);
/* discard 20 */
  (*(REF(20).tsdr)->finalize)(REF(20).value,F_DISCARD,sched);
  REF(20).tsdr = & dr_bottom;
/* copy 32 19 */
  if((ch_returncode = cp_table(& ch_val, REF(19).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;
c70:
/* get_or_goto 33 32 , 78 */
  if ((ch_returncode = get_selected_object(DEF(33),DEF(32),sched)) != Normal)
     goto c78;
/* block , 9 */
  if((ch_returncode = che_block(QUAL(9),sched)) != Normal)
     goto ch_raise_exception;
/* copy 34 33 */
  if((ch_returncode = (REF(33).tsdr->copy)(& ch_val, REF(33).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(34).tsdr)->finalize)(REF(34).value,F_DISCARD,sched);
  REF(34).value = ch_val;
  REF(34).tsdr = datarepmap[REF(33).tsdr->number];
/* insert 3.8 34 */
  if ((ch_returncode = insertfunc(DEF(3)DOT(8),DEF(34),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* endblock */
  che_endblock(sched);
c76:
/* discard 34 */
  (*(REF(34).tsdr)->finalize)(REF(34).value,F_DISCARD,sched);
  REF(34).tsdr = & dr_bottom;
/* branch , 70 */
   goto c70;
c78:
/* 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;
/* 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);
/* branch , 99 */
   goto c99;
c83:
/* discard 3 */
  (*(REF(3).tsdr)->finalize)(REF(3).value,F_DISCARD,sched);
  REF(3).tsdr = & dr_bottom;
/* discard 5 */
  (*(REF(5).tsdr)->finalize)(REF(5).value,F_DISCARD,sched);
  REF(5).tsdr = & dr_bottom;
/* discard 6 */
  (*(REF(6).tsdr)->finalize)(REF(6).value,F_DISCARD,sched);
  REF(6).tsdr = & dr_bottom;
/* discard 19 */
  (*(REF(19).tsdr)->finalize)(REF(19).value,F_DISCARD,sched);
  REF(19).tsdr = & dr_bottom;
/* discard 14 */
  (*(REF(14).tsdr)->finalize)(REF(14).value,F_DISCARD,sched);
  REF(14).tsdr = & dr_bottom;
/* discard 18 */
  (*(REF(18).tsdr)->finalize)(REF(18).value,F_DISCARD,sched);
  REF(18).tsdr = & dr_bottom;
/* discard 17 */
  (*(REF(17).tsdr)->finalize)(REF(17).value,F_DISCARD,sched);
  REF(17).tsdr = & dr_bottom;
/* discard 23 */
  (*(REF(23).tsdr)->finalize)(REF(23).value,F_DISCARD,sched);
  REF(23).tsdr = & dr_bottom;
/* discard 25 */
  (*(REF(25).tsdr)->finalize)(REF(25).value,F_DISCARD,sched);
  REF(25).tsdr = & dr_bottom;
/* discard 31 */
  (*(REF(31).tsdr)->finalize)(REF(31).value,F_DISCARD,sched);
  REF(31).tsdr = & dr_bottom;
/* discard 34 */
  (*(REF(34).tsdr)->finalize)(REF(34).value,F_DISCARD,sched);
  REF(34).tsdr = & dr_bottom;
/* chs_lit 35 , "trouble in precall" */
  if( !chs_lit(DEF(35),"trouble in precall") ) goto ch_depletion;
/* print 35 */
  re_print(stderr, 0, DEF(35)); fflush(stderr);
/* discard 35 */
  (*(REF(35).tsdr)->finalize)(REF(35).value,F_DISCARD,sched);
  REF(35).tsdr = & dr_bottom;
c99:
/* discard 5 */
  (*(REF(5).tsdr)->finalize)(REF(5).value,F_DISCARD,sched);
  REF(5).tsdr = & dr_bottom;
/* discard 6 */
  (*(REF(6).tsdr)->finalize)(REF(6).value,F_DISCARD,sched);
  REF(6).tsdr = & dr_bottom;
/* discard 19 */
  (*(REF(19).tsdr)->finalize)(REF(19).value,F_DISCARD,sched);
  REF(19).tsdr = & dr_bottom;
/* discard 14 */
  (*(REF(14).tsdr)->finalize)(REF(14).value,F_DISCARD,sched);
  REF(14).tsdr = & dr_bottom;
/* endblock */
  che_endblock(sched);
c105:
/* endprocess */
  che_endprocess(sched); return;
#include "chtail.h"
