#include "chdecl.h"
void CH_chcode_chimprove_operations(current, sched, cop)
#define ARGUMENTS 6
#include "chhead.h"
select: switch (SELECTOR) {
    case 0: goto c0;
    case 1: goto cb1;
    case 2: goto c2;
    case 3: goto c4;
    case 4: goto c7;
    case 5: goto c27;
    case 6: goto cb39;
    case 7: goto c40;
    case 8: goto c42;
    case 9: goto c47;
    case 10: goto c50;
    case 11: goto c55;  }
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:
/* copy 4 3.1 */
  if((ch_returncode = cp_table(& ch_val, REF(3)DOT(1).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;
c4:
/* get_or_goto 5 4 , 50 */
  if ((ch_returncode = get_selected_object(DEF(5),DEF(4),sched)) != Normal)
     goto c50;
/* copy 6 5.3 */
  if((ch_returncode = cp_table(& ch_val, REF(5)DOT(3).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(6).tsdr)->finalize)(REF(6).value,F_DISCARD,sched);
  REF(6).value = ch_val;
  REF(6).tsdr = & dr_table;
/* initget 7 6 , 0,0 */
  (*(REF(7).tsdr)->finalize)(REF(7).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(7),DEF(6),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
c7:
/* get_or_goto 7 6 , 47 */
  if ((ch_returncode = get_selected_object(DEF(7),DEF(6),sched)) != Normal)
     goto c47;
/* lookup_at 8 3.2 7 */
  if((ch_i = REF(7).value.integer) < 0 || ch_i >= (ch_t = REF(3)DOT(2).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];
/* find 9 3.0.11 8.0 , 0 */
  if (findfunc(DEF(9),DEF(3)DOT(0)DOT(11),(
          arguments[0] = DEF(8)DOT(0),& arguments[0]),sched,0) == FAILURE)
             goto ch_notfound;
/* notequal . 9.5 =(4) , 7 */
  if ( REF(9)DOT(5).value.enumeration != 4 ) goto c7;
/* ilit 10 , 1 */
  REF(10).value.integer = 1;
  REF(10).tsdr = & dr_integer;
/* size 11 9.4 */
  REF(11).value.integer = REF(9)DOT(4).value.table->size;
  REF(11).tsdr = & dr_integer;
/* ile . 11 =(1) , 27 */
  if ( REF(11).value.integer <= 1 ) goto c27;
/* lookup_at 12 9.4 =(1) */
  if (1 >= (ch_t = REF(9)DOT(4).value.table)->size) goto ch_notfound;
  (*(REF(12).tsdr)->finalize)(REF(12).value,F_DISCARD,sched);
  (*(ch_t->tbls[ORDER_TBL].des->lookup_at))
    (ch_t, ORDER_TBL, & REF(12).value,1);
  REF(12).tsdr = qdatarepmap[ch_t->tsdr->number];
/* copy 13 12 */
  REF(13) = REF(12);
/* oele . 13 =(4) , 27 */
  if ( REF(13).value.ord_enum <= 4 ) goto c27;
/* ilit 10 , 2 */
  REF(10).value.integer = 2;
  REF(10).tsdr = & dr_integer;
c27:
/* noop */
  
/* ige . 10 =(3) , 7 */
  if ( REF(10).value.integer >= 3 ) goto c7;
/* lookup_at 14 8.1 10 */
  if((ch_i = REF(10).value.integer) < 0 || ch_i >= (ch_t = REF(8)DOT(1).value
    .table)->size) goto ch_notfound;
  (*(REF(14).tsdr)->finalize)(REF(14).value,F_DISCARD,sched);
  (*(ch_t->tbls[ORDER_TBL].des->lookup_at))
    (ch_t, ORDER_TBL, & REF(14).value,ch_i);
  REF(14).tsdr = qdatarepmap[ch_t->tsdr->number];
/* copy 15 14 */
  REF(15) = REF(14);
/* lookup_at 16 3.3 15 */
  if((ch_i = REF(15).value.integer) < 0 || ch_i >= (ch_t = REF(3)DOT(3).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];
/* ord_case 17 16.4 */
  REF(17).value.ord_enum = REF(16)DOT(4).value.variant->info.variant_case;
  REF(17).tsdr = & dr_ord_enumeration;
/* oege . 17 =(4) , 42 */
  if ( REF(17).value.ord_enum >= 4 ) goto c42;
/* enum_lit 18 , 0 */
  REF(18).value.enumeration = 0;
  REF(18).tsdr = & dr_enumeration;
  current->ip = 6;
cb39:
/* call 3.4 18 15 3.3 , 1 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(4),
          arguments[1] = DEF(18),
          arguments[2] = DEF(15),
          arguments[3] = DEF(3)DOT(3),
          arguments[3+1] = nil,& arguments[0]),QUAL(1),sched)) != Normal)
     goto ch_raise_exception;
  return;
c40:
/* boolean 3.5 , TRUE */
  REF(3)DOT(5).value.boolean = TRUE;
  REF(3)DOT(5).tsdr = & dr_boolean;
c42:
/* noop */
  
/* iadd 10 10 =(1) */
  if (!chf_iadd(DEF(10),REF(10).value.integer,1)) goto ch_depletion;
/* branch , 27 */
   goto c27;
c47:
/* endget 7 6 */
  end_selector(DEF(7),DEF(6),sched,GET);
/* discard 6 */
  (*(REF(6).tsdr)->finalize)(REF(6).value,F_DISCARD,sched);
  REF(6).tsdr = & dr_bottom;
/* branch , 4 */
   goto c4;
c50:
/* 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;
/* 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);
c55:
/* endprocess */
  che_endprocess(sched); return;
#include "chtail.h"
