#include "chdecl.h"
void CH_typestate_tsapre(current, sched, cop)
#define ARGUMENTS 11
#include "chhead.h"
select: switch (SELECTOR) {
    case 0: goto c0;
    case 1: goto cb5;
    case 2: goto c6;
    case 3: goto c8;
    case 4: goto cb15;
    case 5: goto c16;
    case 6: goto c17;
    case 7: goto c32;
    case 8: goto cb34;
    case 9: goto c35;
    case 10: goto c38;  }
c0:
/* block , 0 */
  if((ch_returncode = che_block(QUAL(0),sched)) != Normal)
     goto ch_raise_exception;
/* prog_lit 3 , 1 */
  if ((ch_returncode = che_prog_lit(DEF(3),QUAL(1),sched)) != Normal) 
     goto ch_raise_exception;
/* procedure 4 3 , 2 */
  if ((ch_returncode = che_procedure(DEF(4),DEF(3),QUAL(2),sched)) != Normal)
     goto ch_raise_exception;
/* discard 3 */
  (*(REF(3).tsdr)->finalize)(REF(3).value,F_DISCARD,sched);
  REF(3).tsdr = & dr_bottom;
/* move 5 4 */
  (*(REF(5).tsdr)->finalize)(REF(5).value,F_DISCARD,sched);
  REF(5) = REF(4);
  REF(4).tsdr = & dr_bottom;
  current->ip = 1;
cb5:
/* receive 6 0 */
  if ((ch_returncode = che_receive(DEF(6),DEF(0),sched)) != Normal)
     goto ch_raise_exception;
  return;
c6:
/* copy 7 6.5 */
  if((ch_returncode = cp_table(& ch_val, REF(6)DOT(5).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(7).tsdr)->finalize)(REF(7).value,F_DISCARD,sched);
  REF(7).value = ch_val;
  REF(7).tsdr = & dr_table;
/* initget 8 7 , 0,0 */
  (*(REF(8).tsdr)->finalize)(REF(8).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(8),DEF(7),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
c8:
/* get_or_goto 8 7 , 32 */
  if ((ch_returncode = get_selected_object(DEF(8),DEF(7),sched)) != Normal)
     goto c32;
/* boolean 9 , FALSE */
  REF(9).value.boolean = FALSE;
  REF(9).tsdr = & dr_boolean;
/* find_or_goto 10 6.7 8 , 0,12 */
  if (findfunc(DEF(10),DEF(6)DOT(7),(
          arguments[0] = DEF(8),& arguments[0]),sched,0) == FAILURE) goto c12;
/* boolean 9 , TRUE */
  REF(9).value.boolean = TRUE;
  REF(9).tsdr = & dr_boolean;
c12:
/* move 11 9 */
  REF(11) = REF(9);
  REF(9).tsdr = & dr_bottom;
/* branch_false 11 , 15 */
  if ( !REF(11).value.boolean ) goto c15;
/* branch , 17 */
   goto c17;
c15:
  current->ip = 4;
cb15:
/* call 6.0.10 6.0 6.1 6.2 6.4 8 6.7 12 , 3 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(6)DOT(0)DOT(10),
          arguments[1] = DEF(6)DOT(0),
          arguments[2] = DEF(6)DOT(1),
          arguments[3] = DEF(6)DOT(2),
          arguments[4] = DEF(6)DOT(4),
          arguments[5] = DEF(8),
          arguments[6] = DEF(6)DOT(7),
          arguments[7] = DEF(12),
          arguments[7+1] = nil,& arguments[0]),QUAL(3),sched)) != Normal)
     goto ch_raise_exception;
  return;
c16:
/* move 11 12 */
  REF(11) = REF(12);
  REF(12).tsdr = & dr_bottom;
c17:
/* branch_false 11 , 19 */
  if ( !REF(11).value.boolean ) goto c19;
/* branch , 8 */
   goto c8;
c19:
/* new_record 13 , 3 */
  if ((ch_val.record = new_record(3)) == nil) goto ch_depletion;
  (*(REF(13).tsdr)->finalize)(REF(13).value,F_DISCARD,sched);
  REF(13).value = ch_val; REF(13).tsdr = & dr_record;
/* copy 14 6.3 */
  if((ch_returncode = (REF(6)DOT(3).tsdr->copy)(& ch_val, REF(6)DOT(3).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(14).tsdr)->finalize)(REF(14).value,F_DISCARD,sched);
  REF(14).value = ch_val;
  REF(14).tsdr = datarepmap[REF(6)DOT(3).tsdr->number];
/* unite 13.0 14 , 0 */
  if ((ch_returncode = che_unite(DEF(13)DOT(0),DEF(14),sched,0)) != Normal)
     goto ch_raise_exception;
/* ordenum_lit 13.1 , 16 */
  REF(13)DOT(1).value.ord_enum = 16;
  REF(13)DOT(1).tsdr = & dr_ord_enumeration;
/* new_table 13.2 , 4 */
  if ((ch_returncode = che_new_table(DEF(13)DOT(2),QUAL(4),sched)) != Normal) 
     goto ch_raise_exception;
/* copy 15 8 */
  if((ch_returncode = (REF(8).tsdr->copy)(& ch_val, REF(8).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(15).tsdr)->finalize)(REF(15).value,F_DISCARD,sched);
  REF(15).value = ch_val;
  REF(15).tsdr = datarepmap[REF(8).tsdr->number];
/* unite 16 15 , 1 */
  if ((ch_returncode = che_unite(DEF(16),DEF(15),sched,1)) != Normal)
     goto ch_raise_exception;
/* insert 13.2 16 */
  if ((ch_returncode = insertfunc(DEF(13)DOT(2),DEF(16),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* insert 6.4.11 13 */
  if ((ch_returncode = insertfunc(DEF(6)DOT(4)DOT(11),DEF(13)
    ,FALSE,0)) != Normal) goto ch_raise_exception;
/* branch , 8 */
   goto c8;
c32:
/* endget 8 7 */
  end_selector(DEF(8),DEF(7),sched,GET);
/* discard 7 */
  (*(REF(7).tsdr)->finalize)(REF(7).value,F_DISCARD,sched);
  REF(7).tsdr = & dr_bottom;
  current->ip = 8;
cb34:
/* call 5 6.0 6.1 6.2 6.3 6.4 6.5 6.6 6.7 , 5 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(5),
          arguments[1] = DEF(6)DOT(0),
          arguments[2] = DEF(6)DOT(1),
          arguments[3] = DEF(6)DOT(2),
          arguments[4] = DEF(6)DOT(3),
          arguments[5] = DEF(6)DOT(4),
          arguments[6] = DEF(6)DOT(5),
          arguments[7] = DEF(6)DOT(6),
          arguments[8] = DEF(6)DOT(7),
          arguments[8+1] = nil,& arguments[0]),QUAL(5),sched)) != Normal)
     goto ch_raise_exception;
  return;
c35:
/* return 6 */
  if (ch_caller = do_return(REF(6).value)) {
    if (ch_caller->type < CProcess) ch_caller->ip++;
      sched->wakeup_proc(sched, ch_caller);}
  else rem_return(REF(6).value);
  REF(6).tsdr = & dr_bottom;
/* endblock */
  che_endblock(sched);
c38:
/* endprocess */
  che_endprocess(sched); return;
#include "chtail.h"
