#include "chdecl.h"
void CH_chcode_chimprove_cbranch(current, sched, cop)
#define ARGUMENTS 28
#include "chhead.h"
select: switch (SELECTOR) {
    case 0: goto c0;
    case 1: goto cb2;
    case 2: goto c3;
    case 3: goto cb29;
    case 4: goto c30;
    case 5: goto c40;
    case 6: goto cb157;
    case 7: goto c158;
    case 8: goto c159;
    case 9: goto c163;
    case 10: goto c166;
    case 11: goto c167;
    case 12: goto c170;  }
c0:
/* block , 0 */
  if((ch_returncode = che_block(QUAL(0),sched)) != Normal)
     goto ch_raise_exception;
/* block , 1 */
  if((ch_returncode = che_block(QUAL(1),sched)) != Normal)
     goto ch_raise_exception;
  current->ip = 1;
cb2:
/* receive 3 0 */
  if ((ch_returncode = che_receive(DEF(3),DEF(0),sched)) != Normal)
     goto ch_raise_exception;
  return;
c3:
/* size 4 3.3 */
  REF(4).value.integer = REF(3)DOT(3).value.table->size;
  REF(4).tsdr = & dr_integer;
/* isubtract 5 4 =(1) */
  if (!chf_isubtract(DEF(5),REF(4).value.integer,1)) goto ch_depletion;
/* lookup_at 6 3.3 5 */
  if((ch_i = REF(5).value.integer) < 0 || ch_i >= (ch_t = REF(3)DOT(3).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,ch_i);
  REF(6).tsdr = qdatarepmap[ch_t->tsdr->number];
/* copy 7 6 */
  REF(7) = REF(6);
/* lookup_at 8 3.1 7 */
  if((ch_i = REF(7).value.integer) < 0 || ch_i >= (ch_t = REF(3)DOT(1).value
    .table)->size) goto ch_notfound;
  (*(REF(8).tsdr)->finalize)(REF(8).value,F_DISCARD,sched);
  (*(ch_t->tbls[ORDER_TBL].des->lookup_at))
    (ch_t, ORDER_TBL, & REF(8).value,ch_i);
  REF(8).tsdr = qdatarepmap[ch_t->tsdr->number];
/* lookup_at 9 8.1 =(0) */
  if ( !((ch_t = REF(8)DOT(1).value.table)->size) ) goto ch_notfound;
  (*(REF(9).tsdr)->finalize)(REF(9).value,F_DISCARD,sched);
  (*(ch_t->tbls[ORDER_TBL].des->lookup_at))
    (ch_t, ORDER_TBL, & REF(9).value,0);
  REF(9).tsdr = qdatarepmap[ch_t->tsdr->number];
/* copy 10 9 */
  REF(10) = REF(9);
/* lookup_at 11 3.2 10 */
  if((ch_i = REF(10).value.integer) < 0 || ch_i >= (ch_t = REF(3)DOT(2).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,ch_i);
  REF(11).tsdr = qdatarepmap[ch_t->tsdr->number];
/* ord_case 12 11.4 */
  REF(12).value.ord_enum = REF(11)DOT(4).value.variant->info.variant_case;
  REF(12).tsdr = & dr_ord_enumeration;
/* notequal . 12 =(0) , 40 */
  if ( REF(12).value.ord_enum != 0 ) goto c40;
/* copy 13 11.4 */
  if((ch_returncode = cp_variant(& ch_val, REF(11)DOT(4).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(13).tsdr)->finalize)(REF(13).value,F_DISCARD,sched);
  REF(13).value = ch_val;
  REF(13).tsdr = & dr_variant;
/* reveal 13 , 0 */
  if (0 != REF(13).value.variant->info.variant_case) goto ch_case_error;
/* equal 14 8.0 =(111) */
  REF(14).value.boolean = (REF(8)DOT(0).value.enumeration == 111);
  REF(14).tsdr = & dr_boolean;
/* equal . 14 13.0 , 28 */
  if ( REF(14).value.boolean ? REF(13)DOT(0).value.boolean : ! 
    REF(13)DOT(0).value.boolean ) goto c28;
/* exit , 2 */
  ch_e = handler_type__exit; ch_val = QUAL(2); goto ch_exception;
c28:
/* enum_lit 15 , 0 */
  REF(15).value.enumeration = 0;
  REF(15).tsdr = & dr_enumeration;
  current->ip = 3;
cb29:
/* call 3.4 15 10 3.2 , 3 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(4),
          arguments[1] = DEF(15),
          arguments[2] = DEF(10),
          arguments[3] = DEF(3)DOT(2),
          arguments[3+1] = nil,& arguments[0]),QUAL(3),sched)) != Normal)
     goto ch_raise_exception;
  return;
c30:
/* privatize 3.1 */
  if (REF(3)DOT(1).value.table->refcount != 1)
    if ((ch_returncode = doCopyOnWrite(DEF(3)DOT(1))) != Normal)
       goto ch_raise_exception;
/* lookup_at 16 3.1 7 */
  if((ch_i = REF(7).value.integer) < 0 || ch_i >= (ch_t = REF(3)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,ch_i);
  REF(16).tsdr = qdatarepmap[ch_t->tsdr->number];
/* remove_at 17 3.1 7 */
  if ((ch_returncode = remove_at_func(DEF(17),DEF(3)DOT(1),
    REF(7).value.integer)) != Normal) goto ch_raise_exception;
/* enum_lit 17.0 , 109 */
  REF(17)DOT(0).value.enumeration = 109;
  REF(17)DOT(0).tsdr = & dr_enumeration;
/* new_table 17.1 , 4 */
  if ((ch_returncode = che_new_table(DEF(17)DOT(1),QUAL(4),sched)) != Normal) 
     goto ch_raise_exception;
/* insert_at 3.1 17 7 */
  ch_i = REF(7).value.integer;
  if (ch_i < 0 || REF(3)DOT(1).value.table->size < ch_i) goto ch_range_error;
  if ((ch_returncode = insertfunc(DEF(3)DOT(1),DEF(17),TRUE, ch_i)) != Normal)
     goto ch_raise_exception;
/* boolean 3.5 , TRUE */
  REF(3)DOT(5).value.boolean = TRUE;
  REF(3)DOT(5).tsdr = & dr_boolean;
/* branch , 159 */
   goto c159;
c40:
/* noop */
  
/* equal 18 8.6 =(0) */
  REF(18).value.boolean = (REF(8)DOT(6).value.integer == 0);
  REF(18).tsdr = & dr_boolean;
/* igt 19 5 =(0) */
  REF(19).value.boolean = (REF(5).value.integer > 0);
/* and 20 18 19 */
  REF(20).value.boolean = REF(18).value.boolean&REF(19).value.boolean;
  REF(20).tsdr = & dr_boolean;
/* branch_false 20 , 159 */
  if ( !REF(20).value.boolean ) goto c159;
/* equal 21 11.2 =(1) */
  REF(21).value.boolean = (REF(11)DOT(2).value.integer == 1);
  REF(21).tsdr = & dr_boolean;
/* equal 22 11.3 =(2) */
  REF(22).value.boolean = (REF(11)DOT(3).value.integer == 2);
  REF(22).tsdr = & dr_boolean;
/* and 23 21 22 */
  REF(23).value.boolean = REF(21).value.boolean&REF(22).value.boolean;
  REF(23).tsdr = & dr_boolean;
/* branch_false 23 , 159 */
  if ( !REF(23).value.boolean ) goto c159;
/* isubtract 24 5 =(1) */
  if (!chf_isubtract(DEF(24),REF(5).value.integer,1)) goto ch_depletion;
/* lookup_at 25 3.3 24 */
  if((ch_i = REF(24).value.integer) < 0 || ch_i >= (ch_t = REF(3)DOT(3).value
    .table)->size) goto ch_notfound;
  (*(REF(25).tsdr)->finalize)(REF(25).value,F_DISCARD,sched);
  (*(ch_t->tbls[ORDER_TBL].des->lookup_at))
    (ch_t, ORDER_TBL, & REF(25).value,ch_i);
  REF(25).tsdr = qdatarepmap[ch_t->tsdr->number];
/* copy 26 25 */
  REF(26) = REF(25);
/* lookup_at 27 3.1 26 */
  if((ch_i = REF(26).value.integer) < 0 || ch_i >= (ch_t = REF(3)DOT(1).value
    .table)->size) goto ch_notfound;
  (*(REF(27).tsdr)->finalize)(REF(27).value,F_DISCARD,sched);
  (*(ch_t->tbls[ORDER_TBL].des->lookup_at))
    (ch_t, ORDER_TBL, & REF(27).value,ch_i);
  REF(27).tsdr = qdatarepmap[ch_t->tsdr->number];
/* find 28 3.0.11 27.0 , 0 */
  if (findfunc(DEF(28),DEF(3)DOT(0)DOT(11),(
          arguments[0] = DEF(27)DOT(0),& arguments[0]),sched,0) == FAILURE)
             goto ch_notfound;
/* notequal . 28.6 =(2) , 159 */
  if ( REF(28)DOT(6).value.enumeration != 2 ) goto c159;
/* lookup_at 29 27.1 =(0) */
  if ( !((ch_t = REF(27)DOT(1).value.table)->size) ) goto ch_notfound;
  (*(REF(29).tsdr)->finalize)(REF(29).value,F_DISCARD,sched);
  (*(ch_t->tbls[ORDER_TBL].des->lookup_at))
    (ch_t, ORDER_TBL, & REF(29).value,0);
  REF(29).tsdr = qdatarepmap[ch_t->tsdr->number];
/* copy 30 29 */
  REF(30) = REF(29);
/* equal 31 30 10 */
  REF(31).value.boolean = (REF(30).value.integer == REF(10).value.integer);
  REF(31).tsdr = & dr_boolean;
/* case 32 27.2 */
  REF(32).value.enumeration = REF(27)DOT(2).value.variant->info.variant_case;
  REF(32).tsdr = & dr_enumeration;
/* equal 33 32 =(0) */
  REF(33).value.boolean = (REF(32).value.enumeration == 0);
  REF(33).tsdr = & dr_boolean;
/* and 34 31 33 */
  REF(34).value.boolean = REF(31).value.boolean&REF(33).value.boolean;
  REF(34).tsdr = & dr_boolean;
/* branch_false 34 , 159 */
  if ( !REF(34).value.boolean ) goto c159;
/* copy 35 8.2 */
  if((ch_returncode = (REF(8)DOT(2).tsdr->copy)(& ch_val, REF(8)DOT(2).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(35).tsdr)->finalize)(REF(35).value,F_DISCARD,sched);
  REF(35).value = ch_val;
  REF(35).tsdr = datarepmap[REF(8)DOT(2).tsdr->number];
/* notequal . 8.0 =(111) , 77 */
  if ( REF(8)DOT(0).value.enumeration != 111 ) goto c77;
/* copy 36 27.0 */
  REF(36) = REF(27)DOT(0);
/* branch , 150 */
   goto c150;
c77:
/* noop */
  
/* equal . 27.0 =(31) , 107 */
  if ( REF(27)DOT(0).value.enumeration == 31 ) goto c107;
/* equal . 27.0 =(32) , 110 */
  if ( REF(27)DOT(0).value.enumeration == 32 ) goto c110;
/* equal . 27.0 =(29) , 113 */
  if ( REF(27)DOT(0).value.enumeration == 29 ) goto c113;
/* equal . 27.0 =(30) , 116 */
  if ( REF(27)DOT(0).value.enumeration == 30 ) goto c116;
/* equal . 27.0 =(40) , 119 */
  if ( REF(27)DOT(0).value.enumeration == 40 ) goto c119;
/* equal . 27.0 =(41) , 122 */
  if ( REF(27)DOT(0).value.enumeration == 41 ) goto c122;
/* equal . 27.0 =(38) , 125 */
  if ( REF(27)DOT(0).value.enumeration == 38 ) goto c125;
/* equal . 27.0 =(39) , 128 */
  if ( REF(27)DOT(0).value.enumeration == 39 ) goto c128;
/* equal . 27.0 =(19) , 131 */
  if ( REF(27)DOT(0).value.enumeration == 19 ) goto c131;
/* equal . 27.0 =(20) , 134 */
  if ( REF(27)DOT(0).value.enumeration == 20 ) goto c134;
/* equal . 27.0 =(17) , 137 */
  if ( REF(27)DOT(0).value.enumeration == 17 ) goto c137;
/* equal . 27.0 =(18) , 140 */
  if ( REF(27)DOT(0).value.enumeration == 18 ) goto c140;
/* equal . 27.0 =(4) , 143 */
  if ( REF(27)DOT(0).value.enumeration == 4 ) goto c143;
/* equal . 27.0 =(3) , 146 */
  if ( REF(27)DOT(0).value.enumeration == 3 ) goto c146;
/* branch , 149 */
   goto c149;
c107:
/* enum_lit 36 , 30 */
  REF(36).value.enumeration = 30;
  REF(36).tsdr = & dr_enumeration;
/* branch , 150 */
   goto c150;
c110:
/* enum_lit 36 , 29 */
  REF(36).value.enumeration = 29;
  REF(36).tsdr = & dr_enumeration;
/* branch , 150 */
   goto c150;
c113:
/* enum_lit 36 , 32 */
  REF(36).value.enumeration = 32;
  REF(36).tsdr = & dr_enumeration;
/* branch , 150 */
   goto c150;
c116:
/* enum_lit 36 , 31 */
  REF(36).value.enumeration = 31;
  REF(36).tsdr = & dr_enumeration;
/* branch , 150 */
   goto c150;
c119:
/* enum_lit 36 , 39 */
  REF(36).value.enumeration = 39;
  REF(36).tsdr = & dr_enumeration;
/* branch , 150 */
   goto c150;
c122:
/* enum_lit 36 , 38 */
  REF(36).value.enumeration = 38;
  REF(36).tsdr = & dr_enumeration;
/* branch , 150 */
   goto c150;
c125:
/* enum_lit 36 , 41 */
  REF(36).value.enumeration = 41;
  REF(36).tsdr = & dr_enumeration;
/* branch , 150 */
   goto c150;
c128:
/* enum_lit 36 , 40 */
  REF(36).value.enumeration = 40;
  REF(36).tsdr = & dr_enumeration;
/* branch , 150 */
   goto c150;
c131:
/* enum_lit 36 , 18 */
  REF(36).value.enumeration = 18;
  REF(36).tsdr = & dr_enumeration;
/* branch , 150 */
   goto c150;
c134:
/* enum_lit 36 , 17 */
  REF(36).value.enumeration = 17;
  REF(36).tsdr = & dr_enumeration;
/* branch , 150 */
   goto c150;
c137:
/* enum_lit 36 , 20 */
  REF(36).value.enumeration = 20;
  REF(36).tsdr = & dr_enumeration;
/* branch , 150 */
   goto c150;
c140:
/* enum_lit 36 , 19 */
  REF(36).value.enumeration = 19;
  REF(36).tsdr = & dr_enumeration;
/* branch , 150 */
   goto c150;
c143:
/* enum_lit 36 , 3 */
  REF(36).value.enumeration = 3;
  REF(36).tsdr = & dr_enumeration;
/* branch , 150 */
   goto c150;
c146:
/* enum_lit 36 , 4 */
  REF(36).value.enumeration = 4;
  REF(36).tsdr = & dr_enumeration;
/* branch , 150 */
   goto c150;
c149:
/* exit , 5 */
  ch_e = handler_type__exit; ch_val = QUAL(5); goto ch_exception;
c150:
/* privatize 3.1 */
  if (REF(3)DOT(1).value.table->refcount != 1)
    if ((ch_returncode = doCopyOnWrite(DEF(3)DOT(1))) != Normal)
       goto ch_raise_exception;
/* lookup_at 37 3.1 26 */
  if((ch_i = REF(26).value.integer) < 0 || ch_i >= (ch_t = REF(3)DOT(1).value
    .table)->size) goto ch_notfound;
  (*(REF(37).tsdr)->finalize)(REF(37).value,F_DISCARD,sched);
  (*(ch_t->tbls[ORDER_TBL].des->lookup_at))
    (ch_t, ORDER_TBL, & REF(37).value,ch_i);
  REF(37).tsdr = qdatarepmap[ch_t->tsdr->number];
/* remove_at 17 3.1 26 */
  if ((ch_returncode = remove_at_func(DEF(17),DEF(3)DOT(1),
    REF(26).value.integer)) != Normal) goto ch_raise_exception;
/* move 17.0 36 */
  REF(17)DOT(0) = REF(36);
  REF(36).tsdr = & dr_bottom;
/* move 17.2 35 */
  (*(REF(17)DOT(2).tsdr)->finalize)(REF(17)DOT(2).value,F_DISCARD,sched);
  REF(17)DOT(2) = REF(35);
  REF(35).tsdr = & dr_bottom;
/* insert_at 3.1 17 26 */
  ch_i = REF(26).value.integer;
  if (ch_i < 0 || REF(3)DOT(1).value.table->size < ch_i) goto ch_range_error;
  if ((ch_returncode = insertfunc(DEF(3)DOT(1),DEF(17),TRUE, ch_i)) != Normal)
     goto ch_raise_exception;
/* enum_lit 38 , 2 */
  REF(38).value.enumeration = 2;
  REF(38).tsdr = & dr_enumeration;
  current->ip = 6;
cb157:
/* call 3.4 38 10 3.2 , 3 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(4),
          arguments[1] = DEF(38),
          arguments[2] = DEF(10),
          arguments[3] = DEF(3)DOT(2),
          arguments[3+1] = nil,& arguments[0]),QUAL(3),sched)) != Normal)
     goto ch_raise_exception;
  return;
c158:
/* exit , 2 */
  ch_e = handler_type__exit; ch_val = QUAL(2); goto ch_exception;
c159:
/* discard 13 */
  (*(REF(13).tsdr)->finalize)(REF(13).value,F_DISCARD,sched);
  REF(13).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);
/* branch , 167 */
   goto c167;
c163:
/* discard 13 */
  (*(REF(13).tsdr)->finalize)(REF(13).value,F_DISCARD,sched);
  REF(13).tsdr = & dr_bottom;
/* return_exception 3 , 6 */
  if (ch_caller = do_return(REF(3).value)) {
    raise_user(QUAL(6),ch_caller); 
    sched->wakeup_proc(sched,ch_caller);}
  else rem_return_exception(DEF(3),QUAL(6));
  REF(3).tsdr = & dr_bottom;
/* branch , 167 */
   goto c167;
c166:
/* 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;
c167:
/* discard 35 */
  (*(REF(35).tsdr)->finalize)(REF(35).value,F_DISCARD,sched);
  REF(35).tsdr = & dr_bottom;
/* endblock */
  che_endblock(sched);
c170:
/* endprocess */
  che_endprocess(sched); return;
#include "chtail.h"
