#include "chdecl.h"
void CH_typestate_pohide(current, sched, cop)
#define ARGUMENTS 7
#include "chhead.h"
select: switch (SELECTOR) {
    case 0: goto c0;
    case 1: goto cb1;
    case 2: goto c2;
    case 3: goto c3;
    case 4: goto c12;
    case 5: goto cb31;
    case 6: goto c32;
    case 7: goto c43;
    case 8: goto c45;
    case 9: goto c48;
    case 10: goto c51;
    case 11: goto c58;  }
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:
/* initget 4 3.5.2 , 0,0 */
  (*(REF(4).tsdr)->finalize)(REF(4).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(4),DEF(3)DOT(5)DOT(2),nil,sched,GET,
    0,0)) != Normal) goto ch_raise_exception;
c3:
/* get_or_err 4 3.5.2 */
  if ((ch_returncode = get_selected_object(DEF(4),DEF(3)DOT(5)DOT(2)
    ,sched)) != Normal) goto ch_raise_exception;
/* position 5 4 */
  ch_frame = get_selector_frame(DEF(4),sched);
  ch_t = ch_frame->inspectee->value.table;
  REF(5).value.integer = ch_frame->rmvcount +
    (*(ch_t->tbls[ORDER_TBL].des->position_of))(ch_t,ORDER_TBL,ch_frame->pos);
  REF(5).tsdr = &dr_integer;
/* lookup_at 6 3.7 =(0) */
  if ( !((ch_t = REF(3)DOT(7).value.table)->size) ) goto ch_notfound;
  (*(REF(6).tsdr)->finalize)(REF(6).value,F_DISCARD,sched);
  (*(ch_t->tbls[ORDER_TBL].des->lookup_at))
    (ch_t, ORDER_TBL, & REF(6).value,0);
  REF(6).tsdr = qdatarepmap[ch_t->tsdr->number];
/* copy 7 6 */
  REF(7) = REF(6);
/* notequal . 5 7 , 3 */
  if ( REF(5).value.integer != REF(7).value.integer ) goto c3;
/* block , 1 */
  if((ch_returncode = che_block(QUAL(1),sched)) != Normal)
     goto ch_raise_exception;
/* initget 8 3.6 , 0,0 */
  (*(REF(8).tsdr)->finalize)(REF(8).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(8),DEF(3)DOT(6),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
c12:
/* get_or_err 8 3.6 */
  if ((ch_returncode = get_selected_object(DEF(8),DEF(3)DOT(6)
    ,sched)) != Normal) goto ch_raise_exception;
/* case 9 8.0 */
  REF(9).value.enumeration = REF(8)DOT(0).value.variant->info.variant_case;
  REF(9).tsdr = & dr_enumeration;
/* equal 10 9 =(1) */
  REF(10).value.boolean = (REF(9).value.enumeration == 1);
  REF(10).tsdr = & dr_boolean;
/* branch_false 10 , 24 */
  if ( !REF(10).value.boolean ) goto c24;
/* lookup_at 11 8.1 =(0) */
  if ( !((ch_t = REF(8)DOT(1).value.table)->size) ) goto ch_notfound;
  (*(REF(11).tsdr)->finalize)(REF(11).value,F_DISCARD,sched);
  (*(ch_t->tbls[ORDER_TBL].des->lookup_at))
    (ch_t, ORDER_TBL, & REF(11).value,0);
  REF(11).tsdr = qdatarepmap[ch_t->tsdr->number];
/* copy 12 11 */
  if((ch_returncode = (REF(11).tsdr->copy)(& ch_val, REF(11).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(12).tsdr)->finalize)(REF(12).value,F_DISCARD,sched);
  REF(12).value = ch_val;
  REF(12).tsdr = datarepmap[REF(11).tsdr->number];
/* equal 13 12 4 */
  REF(13).value.boolean = ((REF(12).tsdr->equal)(REF(12).value,REF(4).value));
  REF(13).tsdr = & dr_boolean;
/* discard 12 */
  (*(REF(12).tsdr)->finalize)(REF(12).value,F_DISCARD,sched);
  REF(12).tsdr = & dr_bottom;
/* move 10 13 */
  REF(10) = REF(13);
  REF(13).tsdr = & dr_bottom;
c24:
/* branch_false 10 , 12 */
  if ( !REF(10).value.boolean ) goto c12;
/* copy 14 8 */
  if((ch_returncode = (REF(8).tsdr->copy)(& ch_val, REF(8).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(8).tsdr->number];
/* insert 3.8.1 14 */
  if ((ch_returncode = insertfunc(DEF(3)DOT(8)DOT(1),DEF(14)
    ,FALSE,0)) != Normal) goto ch_raise_exception;
/* new_table 15 , 2 */
  if ((ch_returncode = che_new_table(DEF(15),QUAL(2),sched)) != Normal) 
     goto ch_raise_exception;
/* lookup_at 16 8.1 =(1) */
  if (1 >= (ch_t = REF(8)DOT(1).value.table)->size) goto ch_notfound;
  (*(REF(16).tsdr)->finalize)(REF(16).value,F_DISCARD,sched);
  (*(ch_t->tbls[ORDER_TBL].des->lookup_at))
    (ch_t, ORDER_TBL, & REF(16).value,1);
  REF(16).tsdr = qdatarepmap[ch_t->tsdr->number];
/* 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];
  current->ip = 5;
cb31:
/* call 3.0.4 3.6 17 15 18 , 3 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(0)DOT(4),
          arguments[1] = DEF(3)DOT(6),
          arguments[2] = DEF(17),
          arguments[3] = DEF(15),
          arguments[4] = DEF(18),
          arguments[4+1] = nil,& arguments[0]),QUAL(3),sched)) != Normal)
     goto ch_raise_exception;
  return;
c32:
/* noop */
  
/* privatize 18 */
  if (REF(18).value.table->refcount != 1)
    if ((ch_returncode = doCopyOnWrite(DEF(18))) != Normal)
       goto ch_raise_exception;
/* initget 19 18 , 0,0 */
  (*(REF(19).tsdr)->finalize)(REF(19).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(19),DEF(18),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
/* get_or_err 19 18 */
  if ((ch_returncode = get_selected_object(DEF(19),DEF(18),sched)) != Normal)
     goto ch_raise_exception;
/* remove 20 19 18 */
  if ((ch_returncode = che_remove(DEF(20),DEF(19),DEF(18),sched)) != Normal)
     goto ch_raise_exception;
/* endget 19 18 */
  end_selector(DEF(19),DEF(18),sched,GET);
/* block , 4 */
  if((ch_returncode = che_block(QUAL(4),sched)) != Normal)
     goto ch_raise_exception;
/* insert 3.8.1 20 */
  if ((ch_returncode = insertfunc(DEF(3)DOT(8)DOT(1),DEF(20)
    ,FALSE,0)) != Normal) goto ch_raise_exception;
/* endblock */
  che_endblock(sched);
c43:
/* discard 20 */
  (*(REF(20).tsdr)->finalize)(REF(20).value,F_DISCARD,sched);
  REF(20).tsdr = & dr_bottom;
/* branch , 32 */
   goto c32;
c45:
/* endget 8 3.6 */
  end_selector(DEF(8),DEF(3)DOT(6),sched,GET);
/* endblock */
  che_endblock(sched);
/* branch , 51 */
   goto c51;
c48:
/* discard 18 */
  (*(REF(18).tsdr)->finalize)(REF(18).value,F_DISCARD,sched);
  REF(18).tsdr = & dr_bottom;
/* discard 15 */
  (*(REF(15).tsdr)->finalize)(REF(15).value,F_DISCARD,sched);
  REF(15).tsdr = & dr_bottom;
/* discard 17 */
  (*(REF(17).tsdr)->finalize)(REF(17).value,F_DISCARD,sched);
  REF(17).tsdr = & dr_bottom;
c51:
/* discard 18 */
  (*(REF(18).tsdr)->finalize)(REF(18).value,F_DISCARD,sched);
  REF(18).tsdr = & dr_bottom;
/* discard 15 */
  (*(REF(15).tsdr)->finalize)(REF(15).value,F_DISCARD,sched);
  REF(15).tsdr = & dr_bottom;
/* discard 17 */
  (*(REF(17).tsdr)->finalize)(REF(17).value,F_DISCARD,sched);
  REF(17).tsdr = & dr_bottom;
/* endget 4 3.5.2 */
  end_selector(DEF(4),DEF(3)DOT(5)DOT(2),sched,GET);
/* 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);
c58:
/* endprocess */
  che_endprocess(sched); return;
#include "chtail.h"
