#include "chdecl.h"
void CH_chcode_chbranches(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 cb6;
    case 4: goto c7;
    case 5: goto cb9;
    case 6: goto c10;
    case 7: goto c14;
    case 8: goto c35;
    case 9: goto c42;
    case 10: goto c47;
    case 11: goto cb53;
    case 12: goto c54;
    case 13: 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:
/* prog_lit 4 , 1 */
  if ((ch_returncode = che_prog_lit(DEF(4),QUAL(1),sched)) != Normal) 
     goto ch_raise_exception;
/* procedure 5 4 , 2 */
  if ((ch_returncode = che_procedure(DEF(5),DEF(4),QUAL(2),sched)) != Normal)
     goto ch_raise_exception;
/* discard 4 */
  (*(REF(4).tsdr)->finalize)(REF(4).value,F_DISCARD,sched);
  REF(4).tsdr = & dr_bottom;
/* move 6 5 */
  (*(REF(6).tsdr)->finalize)(REF(6).value,F_DISCARD,sched);
  REF(6) = REF(5);
  REF(5).tsdr = & dr_bottom;
c6:
  current->ip = 3;
cb6:
/* call 3.3 3.0 3.1 6 7 , 3 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(3),
          arguments[1] = DEF(3)DOT(0),
          arguments[2] = DEF(3)DOT(1),
          arguments[3] = DEF(6),
          arguments[4] = DEF(7),
          arguments[4+1] = nil,& arguments[0]),QUAL(3),sched)) != Normal)
     goto ch_raise_exception;
  return;
c7:
/* branch_false 7 , 9 */
  if ( !REF(7).value.boolean ) goto c9;
/* branch , 6 */
   goto c6;
c9:
  current->ip = 5;
cb9:
/* call 3.3 3.0 3.2 6 8 , 3 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(3),
          arguments[1] = DEF(3)DOT(0),
          arguments[2] = DEF(3)DOT(2),
          arguments[3] = DEF(6),
          arguments[4] = DEF(8),
          arguments[4+1] = nil,& arguments[0]),QUAL(3),sched)) != Normal)
     goto ch_raise_exception;
  return;
c10:
/* boolean 9 , FALSE */
  REF(9).value.boolean = FALSE;
  REF(9).tsdr = & dr_boolean;
/* copy 10 3.0 */
  if((ch_returncode = cp_table(& ch_val, REF(3)DOT(0).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(10).tsdr)->finalize)(REF(10).value,F_DISCARD,sched);
  REF(10).value = ch_val;
  REF(10).tsdr = & dr_table;
/* initget 11 10 , 0,0 */
  (*(REF(11).tsdr)->finalize)(REF(11).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(11),DEF(10),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
c14:
/* get_or_goto 11 10 , 47 */
  if ((ch_returncode = get_selected_object(DEF(11),DEF(10),sched)) != Normal)
     goto c47;
/* equal . 11.4 =(4) , 14 */
  if ( REF(11)DOT(4).value.ord_enum == 4 ) goto c14;
/* notequal . 11.0 =(109) , 42 */
  if ( REF(11)DOT(0).value.enumeration != 109 ) goto c42;
/* block , 4 */
  if((ch_returncode = che_block(QUAL(4),sched)) != Normal)
     goto ch_raise_exception;
/* copy 12 11.5 */
  REF(12) = REF(11)DOT(5);
/* reveal 11.2 , 2 */
  if (2 != REF(11)DOT(2).value.variant->info.variant_case) goto ch_case_error;
/* iadd 13 12 =(1) */
  if (!chf_iadd(DEF(13),REF(12).value.integer,1)) goto ch_depletion;
/* equal 14 11.2.0 13 */
  REF(14).value.boolean = (REF(11)DOT(2)DOT(0).value.integer == 
    REF(13).value.integer);
  REF(14).tsdr = & dr_boolean;
/* or 15 9 14 */
  REF(15).value.boolean = REF(9).value.boolean|REF(14).value.boolean;
  REF(15).tsdr = & dr_boolean;
/* branch_false 15 , 30 */
  if ( !REF(15).value.boolean ) goto c30;
/* exit , 5 */
  ch_e = handler_type__exit; ch_val = QUAL(5); goto ch_exception;
c30:
/* boolean 9 , TRUE */
  REF(9).value.boolean = TRUE;
  REF(9).tsdr = & dr_boolean;
/* insert 3.2 12 */
  if ((ch_returncode = insertfunc(DEF(3)DOT(2),DEF(12),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* endblock */
  che_endblock(sched);
/* branch , 14 */
   goto c14;
c35:
/* privatize 3.0 */
  if (REF(3)DOT(0).value.table->refcount != 1)
    if ((ch_returncode = doCopyOnWrite(DEF(3)DOT(0))) != Normal)
       goto ch_raise_exception;
/* lookup_at 16 3.0 12 */
  if((ch_i = REF(12).value.integer) < 0 || ch_i >= (ch_t = REF(3)DOT(0).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,ch_i);
  REF(16).tsdr = qdatarepmap[ch_t->tsdr->number];
/* remove_at 17 3.0 12 */
  if ((ch_returncode = remove_at_func(DEF(17),DEF(3)DOT(0),
    REF(12).value.integer)) != Normal) goto ch_raise_exception;
/* ordenum_lit 17.4 , 4 */
  REF(17)DOT(4).value.ord_enum = 4;
  REF(17)DOT(4).tsdr = & dr_ord_enumeration;
/* insert_at 3.0 17 12 */
  ch_i = REF(12).value.integer;
  if (ch_i < 0 || REF(3)DOT(0).value.table->size < ch_i) goto ch_range_error;
  if ((ch_returncode = insertfunc(DEF(3)DOT(0),DEF(17),TRUE, ch_i)) != Normal)
     goto ch_raise_exception;
/* branch , 14 */
   goto c14;
c42:
/* noop */
  
/* equal 9 11.3 =(2) */
  REF(9).value.boolean = (REF(11)DOT(3).value.ord_enum == 2);
  REF(9).tsdr = & dr_boolean;
/* branch , 14 */
   goto c14;
c47:
/* endget 11 10 */
  end_selector(DEF(11),DEF(10),sched,GET);
/* discard 10 */
  (*(REF(10).tsdr)->finalize)(REF(10).value,F_DISCARD,sched);
  REF(10).tsdr = & dr_bottom;
/* prog_lit 18 , 6 */
  if ((ch_returncode = che_prog_lit(DEF(18),QUAL(6),sched)) != Normal) 
     goto ch_raise_exception;
/* procedure 19 18 , 2 */
  if ((ch_returncode = che_procedure(DEF(19),DEF(18),QUAL(2)
    ,sched)) != Normal) goto ch_raise_exception;
/* discard 18 */
  (*(REF(18).tsdr)->finalize)(REF(18).value,F_DISCARD,sched);
  REF(18).tsdr = & dr_bottom;
/* move 6 19 */
  (*(REF(6).tsdr)->finalize)(REF(6).value,F_DISCARD,sched);
  REF(6) = REF(19);
  REF(19).tsdr = & dr_bottom;
  current->ip = 11;
cb53:
/* call 3.3 3.0 3.2 6 8 , 3 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(3),
          arguments[1] = DEF(3)DOT(0),
          arguments[2] = DEF(3)DOT(2),
          arguments[3] = DEF(6),
          arguments[4] = DEF(8),
          arguments[4+1] = nil,& arguments[0]),QUAL(3),sched)) != Normal)
     goto ch_raise_exception;
  return;
c54:
/* discard 3.1 */
  (*(REF(3)DOT(1).tsdr)->finalize)(REF(3)DOT(1).value,F_DISCARD,sched);
  REF(3)DOT(1).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);
c58:
/* endprocess */
  che_endprocess(sched); return;
#include "chtail.h"
