#include "chdecl.h"
void CH_chcode_chimprove_eliminate1(current, sched, cop)
#define ARGUMENTS 6
#include "chhead.h"
select: switch (SELECTOR) {
    case 0: goto c0;
    case 1: goto cb2;
    case 2: goto c3;
    case 3: goto c5;
    case 4: goto c51;
    case 5: goto c52;
    case 6: goto c54;  }
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:
/* lookup_at 4 3.1 3.3 */
  if((ch_i = REF(3)DOT(3).value.integer) < 0 || ch_i >= (ch_t = 
    REF(3)DOT(1).value.table)->size) goto ch_notfound;
  (*(REF(4).tsdr)->finalize)(REF(4).value,F_DISCARD,sched);
  (*(ch_t->tbls[ORDER_TBL].des->lookup_at))
    (ch_t, ORDER_TBL, & REF(4).value,ch_i);
  REF(4).tsdr = qdatarepmap[ch_t->tsdr->number];
/* initget 5 3.2 , 0,0 */
  (*(REF(5).tsdr)->finalize)(REF(5).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(5),DEF(3)DOT(2),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
c5:
/* get_or_err 5 3.2 */
  if ((ch_returncode = get_selected_object(DEF(5),DEF(3)DOT(2)
    ,sched)) != Normal) goto ch_raise_exception;
/* lookup_at 6 4.1 =(1) */
  if (1 >= (ch_t = REF(4)DOT(1).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,1);
  REF(6).tsdr = qdatarepmap[ch_t->tsdr->number];
/* copy 7 6 */
  REF(7) = REF(6);
/* position 8 5 */
  ch_frame = get_selector_frame(DEF(5),sched);
  ch_t = ch_frame->inspectee->value.table;
  REF(8).value.integer = ch_frame->rmvcount +
    (*(ch_t->tbls[ORDER_TBL].des->position_of))(ch_t,ORDER_TBL,ch_frame->pos);
  REF(8).tsdr = &dr_integer;
/* notequal . 7 8 , 5 */
  if ( REF(7).value.integer != REF(8).value.integer ) goto c5;
/* ord_case 9 5.4 */
  REF(9).value.ord_enum = REF(5)DOT(4).value.variant->info.variant_case;
  REF(9).tsdr = & dr_ord_enumeration;
/* oelt . 9 =(4) , 18 */
  if ( REF(9).value.ord_enum < 4 ) goto c18;
/* exit , 2 */
  ch_e = handler_type__exit; ch_val = QUAL(2); goto ch_exception;
c18:
/* noop */
  
/* equal . 4.0 =(33) , 26 */
  if ( REF(4)DOT(0).value.enumeration == 33 ) goto c26;
/* equal . 4.0 =(21) , 32 */
  if ( REF(4)DOT(0).value.enumeration == 21 ) goto c32;
/* equal . 4.0 =(9) , 38 */
  if ( REF(4)DOT(0).value.enumeration == 9 ) goto c38;
/* branch , 44 */
   goto c44;
c26:
/* reveal 5.4 , 2 */
  if (2 != REF(5)DOT(4).value.variant->info.variant_case) goto ch_case_error;
/* enum_lit 3.4 , 24 */
  REF(3)DOT(4).value.enumeration = 24;
  REF(3)DOT(4).tsdr = & dr_enumeration;
/* rnegate 10 5.4.0 */
  if ((ch_real = (dfd_real *) new(dfd_real)) == nil) goto ch_depletion;
  REF(10).value.real = ch_real;
  REF(10).tsdr = & dr_real;*ch_real = - *REF(5)DOT(4)DOT(0).value.real;
/* unite 3.5 10 , 3 */
  if ((ch_returncode = che_unite(DEF(3)DOT(5),DEF(10),sched,3)) != Normal)
     goto ch_raise_exception;
/* branch , 47 */
   goto c47;
c32:
/* reveal 5.4 , 1 */
  if (1 != REF(5)DOT(4).value.variant->info.variant_case) goto ch_case_error;
/* enum_lit 3.4 , 10 */
  REF(3)DOT(4).value.enumeration = 10;
  REF(3)DOT(4).tsdr = & dr_enumeration;
/* inegate 11 5.4.0 */
  REF(11).value.integer = -REF(5)DOT(4)DOT(0).value.integer;
  REF(11).tsdr = & dr_integer;
/* unite 3.5 11 , 2 */
  if ((ch_returncode = che_unite(DEF(3)DOT(5),DEF(11),sched,2)) != Normal)
     goto ch_raise_exception;
/* branch , 47 */
   goto c47;
c38:
/* reveal 5.4 , 0 */
  if (0 != REF(5)DOT(4).value.variant->info.variant_case) goto ch_case_error;
/* enum_lit 3.4 , 6 */
  REF(3)DOT(4).value.enumeration = 6;
  REF(3)DOT(4).tsdr = & dr_enumeration;
/* not 12 5.4.0 */
  REF(12).value.boolean = !REF(5)DOT(4)DOT(0).value.boolean;
  REF(12).tsdr = & dr_boolean;
/* unite 3.5 12 , 1 */
  if ((ch_returncode = che_unite(DEF(3)DOT(5),DEF(12),sched,1)) != Normal)
     goto ch_raise_exception;
/* branch , 47 */
   goto c47;
c44:
/* exit , 2 */
  ch_e = handler_type__exit; ch_val = QUAL(2); goto ch_exception;
c47:
/* return_exception 3 , 3 */
  if (ch_caller = do_return(REF(3).value)) {
    raise_user(QUAL(3),ch_caller); 
    sched->wakeup_proc(sched,ch_caller);}
  else rem_return_exception(DEF(3),QUAL(3));
  REF(3).tsdr = & dr_bottom;
/* endget 5 3.2 */
  end_selector(DEF(5),DEF(3)DOT(2),sched,GET);
/* endblock */
  che_endblock(sched);
/* branch , 52 */
   goto c52;
c51:
/* 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;
c52:
/* endblock */
  che_endblock(sched);
c54:
/* endprocess */
  che_endprocess(sched); return;
#include "chtail.h"
