#include "chdecl.h"
void CH_typestate_tsapost(current, sched, cop)
#define ARGUMENTS 11
#include "chhead.h"
select: switch (SELECTOR) {
    case 0: goto c0;
    case 1: goto cb9;
    case 2: goto c10;
    case 3: goto cb21;
    case 4: goto c22;
    case 5: goto c26;
    case 6: goto cb37;
    case 7: goto c38;
    case 8: goto c42;
    case 9: goto c45;  }
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;
/* prog_lit 6 , 3 */
  if ((ch_returncode = che_prog_lit(DEF(6),QUAL(3),sched)) != Normal) 
     goto ch_raise_exception;
/* procedure 7 6 , 2 */
  if ((ch_returncode = che_procedure(DEF(7),DEF(6),QUAL(2),sched)) != Normal)
     goto ch_raise_exception;
/* discard 6 */
  (*(REF(6).tsdr)->finalize)(REF(6).value,F_DISCARD,sched);
  REF(6).tsdr = & dr_bottom;
/* move 8 7 */
  (*(REF(8).tsdr)->finalize)(REF(8).value,F_DISCARD,sched);
  REF(8) = REF(7);
  REF(7).tsdr = & dr_bottom;
  current->ip = 1;
cb9:
/* receive 9 0 */
  if ((ch_returncode = che_receive(DEF(9),DEF(0),sched)) != Normal)
     goto ch_raise_exception;
  return;
c10:
/* discard 10 */
  (*(REF(10).tsdr)->finalize)(REF(10).value,F_DISCARD,sched);
  REF(10).tsdr = & dr_bottom;
/* size 11 9.5.0 */
  REF(11).value.integer = REF(9)DOT(5)DOT(0).value.table->size;
  REF(11).tsdr = & dr_integer;
/* ile . 11 =(0) , 26 */
  if ( REF(11).value.integer <= 0 ) goto c26;
/* privatize 9.5.0 */
  if (REF(9)DOT(5)DOT(0).value.table->refcount != 1)
    if ((ch_returncode = doCopyOnWrite(DEF(9)DOT(5)DOT(0))) != Normal)
       goto ch_raise_exception;
/* initget 12 9.5.0 , 0,0 */
  (*(REF(12).tsdr)->finalize)(REF(12).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(12),DEF(9)DOT(5)DOT(0),nil,sched,GET,
    0,0)) != Normal) goto ch_raise_exception;
/* get_or_err 12 9.5.0 */
  if ((ch_returncode = get_selected_object(DEF(12),DEF(9)DOT(5)DOT(0)
    ,sched)) != Normal) goto ch_raise_exception;
/* remove 10 12 9.5.0 */
  if ((ch_returncode = che_remove(DEF(10),DEF(12),DEF(9)DOT(5)DOT(0)
    ,sched)) != Normal) goto ch_raise_exception;
/* endget 12 9.5.0 */
  end_selector(DEF(12),DEF(9)DOT(5)DOT(0),sched,GET);
/* block , 4 */
  if((ch_returncode = che_block(QUAL(4),sched)) != Normal)
     goto ch_raise_exception;
  current->ip = 3;
cb21:
/* call 5 9.0 9.1 9.2 9.3 9.4 9.5 9.6 10 , 5 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(5),
          arguments[1] = DEF(9)DOT(0),
          arguments[2] = DEF(9)DOT(1),
          arguments[3] = DEF(9)DOT(2),
          arguments[4] = DEF(9)DOT(3),
          arguments[5] = DEF(9)DOT(4),
          arguments[6] = DEF(9)DOT(5),
          arguments[7] = DEF(9)DOT(6),
          arguments[8] = DEF(10),
          arguments[8+1] = nil,& arguments[0]),QUAL(5),sched)) != Normal)
     goto ch_raise_exception;
  return;
c22:
/* endblock */
  che_endblock(sched);
/* branch , 10 */
   goto c10;
c26:
/* discard 13 */
  (*(REF(13).tsdr)->finalize)(REF(13).value,F_DISCARD,sched);
  REF(13).tsdr = & dr_bottom;
/* size 14 9.5.1 */
  REF(14).value.integer = REF(9)DOT(5)DOT(1).value.table->size;
  REF(14).tsdr = & dr_integer;
/* ile . 14 =(0) , 42 */
  if ( REF(14).value.integer <= 0 ) goto c42;
/* privatize 9.5.1 */
  if (REF(9)DOT(5)DOT(1).value.table->refcount != 1)
    if ((ch_returncode = doCopyOnWrite(DEF(9)DOT(5)DOT(1))) != Normal)
       goto ch_raise_exception;
/* initget 15 9.5.1 , 0,0 */
  (*(REF(15).tsdr)->finalize)(REF(15).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(15),DEF(9)DOT(5)DOT(1),nil,sched,GET,
    0,0)) != Normal) goto ch_raise_exception;
/* get_or_err 15 9.5.1 */
  if ((ch_returncode = get_selected_object(DEF(15),DEF(9)DOT(5)DOT(1)
    ,sched)) != Normal) goto ch_raise_exception;
/* remove 13 15 9.5.1 */
  if ((ch_returncode = che_remove(DEF(13),DEF(15),DEF(9)DOT(5)DOT(1)
    ,sched)) != Normal) goto ch_raise_exception;
/* endget 15 9.5.1 */
  end_selector(DEF(15),DEF(9)DOT(5)DOT(1),sched,GET);
/* block , 6 */
  if((ch_returncode = che_block(QUAL(6),sched)) != Normal)
     goto ch_raise_exception;
  current->ip = 6;
cb37:
/* call 8 9.0 9.1 9.2 9.3 9.4 9.5 9.6 13 , 5 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(8),
          arguments[1] = DEF(9)DOT(0),
          arguments[2] = DEF(9)DOT(1),
          arguments[3] = DEF(9)DOT(2),
          arguments[4] = DEF(9)DOT(3),
          arguments[5] = DEF(9)DOT(4),
          arguments[6] = DEF(9)DOT(5),
          arguments[7] = DEF(9)DOT(6),
          arguments[8] = DEF(13),
          arguments[8+1] = nil,& arguments[0]),QUAL(5),sched)) != Normal)
     goto ch_raise_exception;
  return;
c38:
/* endblock */
  che_endblock(sched);
/* branch , 26 */
   goto c26;
c42:
/* return 9 */
  if (ch_caller = do_return(REF(9).value)) {
    if (ch_caller->type < CProcess) ch_caller->ip++;
      sched->wakeup_proc(sched, ch_caller);}
  else rem_return(REF(9).value);
  REF(9).tsdr = & dr_bottom;
/* endblock */
  che_endblock(sched);
c45:
/* endprocess */
  che_endprocess(sched); return;
#include "chtail.h"
