#include "chdecl.h"
void CH_typestate_exceptionbr(current, sched, cop)
#define ARGUMENTS 10
#include "chhead.h"
select: switch (SELECTOR) {
    case 0: goto c0;
    case 1: goto cb1;
    case 2: goto c2;
    case 3: goto c5;
    case 4: goto c8;
    case 5: goto c42;
    case 6: goto cb46;
    case 7: goto c47;
    case 8: goto c48;
    case 9: goto c53;
    case 10: goto c57;
    case 11: goto c60;  }
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:
/* block , 1 */
  if((ch_returncode = che_block(QUAL(1),sched)) != Normal)
     goto ch_raise_exception;
/* copy 4 3.3.2 */
  if((ch_returncode = cp_table(& ch_val, REF(3)DOT(3)DOT(2).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;
c5:
/* get_or_goto 5 4 , 53 */
  if ((ch_returncode = get_selected_object(DEF(5),DEF(4),sched)) != Normal)
     goto c53;
/* block , 2 */
  if((ch_returncode = che_block(QUAL(2),sched)) != Normal)
     goto ch_raise_exception;
/* initget 6 5.0 , 0,0 */
  (*(REF(6).tsdr)->finalize)(REF(6).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(6),DEF(5)DOT(0),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
c8:
/* get_or_err 6 5.0 */
  if ((ch_returncode = get_selected_object(DEF(6),DEF(5)DOT(0)
    ,sched)) != Normal) goto ch_raise_exception;
/* equal 7 6.0 3.4 */
  REF(7).value.boolean = (eq_variant(REF(6)DOT(0).value,REF(3)DOT(4).value));
  REF(7).tsdr = & dr_boolean;
/* ord_case 8 6.0 */
  REF(8).value.ord_enum = REF(6)DOT(0).value.variant->info.variant_case;
  REF(8).tsdr = & dr_ord_enumeration;
/* equal 9 8 =(3) */
  REF(9).value.boolean = (REF(8).value.ord_enum == 3);
  REF(9).tsdr = & dr_boolean;
/* ord_case 10 3.4 */
  REF(10).value.ord_enum = REF(3)DOT(4).value.variant->info.variant_case;
  REF(10).tsdr = & dr_ord_enumeration;
/* notequal 11 10 =(2) */
  REF(11).value.boolean = (REF(10).value.ord_enum != 2);
  REF(11).tsdr = & dr_boolean;
/* and 12 9 11 */
  REF(12).value.boolean = REF(9).value.boolean&REF(11).value.boolean;
  REF(12).tsdr = & dr_boolean;
/* or 13 7 12 */
  REF(13).value.boolean = REF(7).value.boolean|REF(12).value.boolean;
  REF(13).tsdr = & dr_boolean;
/* branch_false 13 , 8 */
  if ( !REF(13).value.boolean ) goto c8;
/* igt . 5.1 =(1) , 36 */
  if ( REF(5)DOT(1).value.integer > 1 ) goto c36;
/* boolean 14 , FALSE */
  REF(14).value.boolean = FALSE;
  REF(14).tsdr = & dr_boolean;
/* find_or_goto 15 3.3.9 6.1 , 0,25 */
  if (findfunc(DEF(15),DEF(3)DOT(3)DOT(9),(
          arguments[0] = DEF(6)DOT(1),& arguments[0]),sched,0) == FAILURE)
             goto c25;
/* boolean 14 , TRUE */
  REF(14).value.boolean = TRUE;
  REF(14).tsdr = & dr_boolean;
c25:
/* branch_false 14 , 27 */
  if ( !REF(14).value.boolean ) goto c27;
/* branch , 48 */
   goto c48;
c27:
/* new_record 16 , 2 */
  if ((ch_val.record = new_record(2)) == nil) goto ch_depletion;
  (*(REF(16).tsdr)->finalize)(REF(16).value,F_DISCARD,sched);
  REF(16).value = ch_val; REF(16).tsdr = & dr_record;
/* copy 16.0 6.1 */
  if((ch_returncode = (REF(6)DOT(1).tsdr->copy)(& ch_val, REF(6)DOT(1).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(16)DOT(0).tsdr)->finalize)(REF(16)DOT(0).value,F_DISCARD,sched);
  REF(16)DOT(0).value = ch_val;
  REF(16)DOT(0).tsdr = datarepmap[REF(6)DOT(1).tsdr->number];
/* new_record 17 , 2 */
  if ((ch_val.record = new_record(2)) == nil) goto ch_depletion;
  (*(REF(17).tsdr)->finalize)(REF(17).value,F_DISCARD,sched);
  REF(17).value = ch_val; REF(17).tsdr = & dr_record;
/* new_table 17.0 , 3 */
  if ((ch_returncode = che_new_table(DEF(17)DOT(0),QUAL(3),sched)) != Normal) 
     goto ch_raise_exception;
/* new_table 17.1 , 3 */
  if ((ch_returncode = che_new_table(DEF(17)DOT(1),QUAL(3),sched)) != Normal) 
     goto ch_raise_exception;
/* unite 16.1 17 , 0 */
  if ((ch_returncode = che_unite(DEF(16)DOT(1),DEF(17),sched,0)) != Normal)
     goto ch_raise_exception;
/* insert 3.3.9 16 */
  if ((ch_returncode = insertfunc(DEF(3)DOT(3)DOT(9),DEF(16)
    ,FALSE,0)) != Normal) goto ch_raise_exception;
/* branch , 48 */
   goto c48;
c36:
/* block , 4 */
  if((ch_returncode = che_block(QUAL(4),sched)) != Normal)
     goto ch_raise_exception;
/* privatize 3.3.9 */
  if (REF(3)DOT(3)DOT(9).value.table->refcount != 1)
    if ((ch_returncode = doCopyOnWrite(DEF(3)DOT(3)DOT(9))) != Normal)
       goto ch_raise_exception;
/* find 18 3.3.9 6.1 , 0 */
  if (findfunc(DEF(18),DEF(3)DOT(3)DOT(9),(
          arguments[0] = DEF(6)DOT(1),& arguments[0]),sched,0) == FAILURE)
             goto ch_notfound;
/* fremove 16 18 3.3.9 , 0 */
  if ((ch_returncode = removefunc(DEF(16),DEF(18),DEF(3)DOT(3)DOT(9),sched,0
    ,NO_TBL,(position *) nil)) != Normal) goto ch_raise_exception;
/* endblock */
  che_endblock(sched);
/* branch , 46 */
   goto c46;
c42:
/* new_record 16 , 2 */
  if ((ch_val.record = new_record(2)) == nil) goto ch_depletion;
  (*(REF(16).tsdr)->finalize)(REF(16).value,F_DISCARD,sched);
  REF(16).value = ch_val; REF(16).tsdr = & dr_record;
/* copy 16.0 6.1 */
  if((ch_returncode = (REF(6)DOT(1).tsdr->copy)(& ch_val, REF(6)DOT(1).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(16)DOT(0).tsdr)->finalize)(REF(16)DOT(0).value,F_DISCARD,sched);
  REF(16)DOT(0).value = ch_val;
  REF(16)DOT(0).tsdr = datarepmap[REF(6)DOT(1).tsdr->number];
/* unite 16.1 19 , 1 */
  if ((ch_returncode = che_unite(DEF(16)DOT(1),DEF(19),sched,1)) != Normal)
     goto ch_raise_exception;
c46:
  current->ip = 6;
cb46:
/* call 3.0.8 3.0 3.1 3.3 3.2 3.5 5.1 16.1 , 5 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(0)DOT(8),
          arguments[1] = DEF(3)DOT(0),
          arguments[2] = DEF(3)DOT(1),
          arguments[3] = DEF(3)DOT(3),
          arguments[4] = DEF(3)DOT(2),
          arguments[5] = DEF(3)DOT(5),
          arguments[6] = DEF(5)DOT(1),
          arguments[7] = DEF(16)DOT(1),
          arguments[7+1] = nil,& arguments[0]),QUAL(5),sched)) != Normal)
     goto ch_raise_exception;
  return;
c47:
/* insert 3.3.9 16 */
  if ((ch_returncode = insertfunc(DEF(3)DOT(3)DOT(9),DEF(16)
    ,FALSE,0)) != Normal) goto ch_raise_exception;
c48:
/* endget 6 5.0 */
  end_selector(DEF(6),DEF(5)DOT(0),sched,GET);
/* exit , 6 */
  ch_e = handler_type__exit; ch_val = QUAL(6); goto ch_exception;
/* endblock */
  che_endblock(sched);
/* branch , 5 */
   goto c5;
c53:
/* 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;
/* endblock */
  che_endblock(sched);
c57:
/* 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);
c60:
/* endprocess */
  che_endprocess(sched); return;
#include "chtail.h"
