#include "chdecl.h"
void CH_shorten(current, sched, cop)
#define ARGUMENTS 5
#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 c15;
    case 5: goto c33;
    case 6: goto c53;
    case 7: goto c62;
    case 8: goto c64;
    case 9: goto c67;
    case 10: goto c68;
    case 11: goto c70;
    case 12: goto c75;
    case 13: goto c88;  }
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:
/* new_table 4 , 1 */
  if ((ch_returncode = che_new_table(DEF(4),QUAL(1),sched)) != Normal) 
     goto ch_raise_exception;
/* copy 5 3.1 */
  if((ch_returncode = cp_table(& ch_val, REF(3)DOT(1).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(5).tsdr)->finalize)(REF(5).value,F_DISCARD,sched);
  REF(5).value = ch_val;
  REF(5).tsdr = & dr_table;
/* initget 6 5 , 0,0 */
  (*(REF(6).tsdr)->finalize)(REF(6).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(6),DEF(5),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
c5:
/* get_or_goto 6 5 , 70 */
  if ((ch_returncode = get_selected_object(DEF(6),DEF(5),sched)) != Normal)
     goto c70;
/* case 7 6.0 */
  REF(7).value.enumeration = REF(6)DOT(0).value.variant->info.variant_case;
  REF(7).tsdr = & dr_enumeration;
/* notequal . 7 =(0) , 68 */
  if ( REF(7).value.enumeration != 0 ) goto c68;
/* initget 8 6.1 , 0,0 */
  (*(REF(8).tsdr)->finalize)(REF(8).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(8),DEF(6)DOT(1),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
/* get_or_err 8 6.1 */
  if ((ch_returncode = get_selected_object(DEF(8),DEF(6)DOT(1)
    ,sched)) != Normal) goto ch_raise_exception;
/* copy 9 3.2 */
  if((ch_returncode = (REF(3)DOT(2).tsdr->copy)(& ch_val, REF(3)DOT(2).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(9).tsdr)->finalize)(REF(9).value,F_DISCARD,sched);
  REF(9).value = ch_val;
  REF(9).tsdr = datarepmap[REF(3)DOT(2).tsdr->number];
/* copy 10 8 */
  if((ch_returncode = cp_table(& ch_val, REF(8).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;
c15:
/* get_or_goto 11 10 , 21 */
  if ((ch_returncode = get_selected_object(DEF(11),DEF(10),sched)) != Normal)
     goto c21;
/* find 12 3.0 9.0 , 0 */
  if (findfunc(DEF(12),DEF(3)DOT(0),(
          arguments[0] = DEF(9)DOT(0),& arguments[0]),sched,0) == FAILURE)
             goto ch_notfound;
/* find 13 12.1 9.1 , 0 */
  if (findfunc(DEF(13),DEF(12)DOT(1),(
          arguments[0] = DEF(9)DOT(1),& arguments[0]),sched,0) == FAILURE)
             goto ch_notfound;
/* find 14 13.1 11 , 0 */
  if (findfunc(DEF(14),DEF(13)DOT(1),(
          arguments[0] = DEF(11),& arguments[0]),sched,0) == FAILURE)
             goto ch_notfound;
/* copy 9 14.1 */
  if((ch_returncode = (REF(14)DOT(1).tsdr->copy)(& ch_val, REF(14)DOT(1).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(9).tsdr)->finalize)(REF(9).value,F_DISCARD,sched);
  REF(9).value = ch_val;
  REF(9).tsdr = datarepmap[REF(14)DOT(1).tsdr->number];
/* branch , 15 */
   goto c15;
c21:
/* 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;
/* find 15 3.0 9.0 , 0 */
  if (findfunc(DEF(15),DEF(3)DOT(0),(
          arguments[0] = DEF(9)DOT(0),& arguments[0]),sched,0) == FAILURE)
             goto ch_notfound;
/* find 16 15.1 9.1 , 0 */
  if (findfunc(DEF(16),DEF(15)DOT(1),(
          arguments[0] = DEF(9)DOT(1),& arguments[0]),sched,0) == FAILURE)
             goto ch_notfound;
/* ord_case 17 16.2 */
  REF(17).value.ord_enum = REF(16)DOT(2).value.variant->info.variant_case;
  REF(17).tsdr = & dr_ord_enumeration;
/* notequal . 17 =(10) , 67 */
  if ( REF(17).value.ord_enum != 10 ) goto c67;
/* reveal 16.2 , 10 */
  if (10 != REF(16)DOT(2).value.variant->info.variant_case)
     goto ch_case_error;
/* find 18 16.2.0.3 16.2.0.2 , 0 */
  if (findfunc(DEF(18),DEF(16)DOT(2)DOT(0)DOT(3),(
          arguments[0] = DEF(16)DOT(2)DOT(0)DOT(2),& arguments[0]),sched,0
            ) == FAILURE) goto ch_notfound;
/* copy 19 18.1 */
  if((ch_returncode = cp_table(& ch_val, REF(18)DOT(1).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(19).tsdr)->finalize)(REF(19).value,F_DISCARD,sched);
  REF(19).value = ch_val;
  REF(19).tsdr = & dr_table;
/* initget 20 19 , 0,0 */
  (*(REF(20).tsdr)->finalize)(REF(20).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(20),DEF(19),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
c33:
/* get_or_goto 20 19 , 64 */
  if ((ch_returncode = get_selected_object(DEF(20),DEF(19),sched)) != Normal)
     goto c64;
/* case 21 20.0 */
  REF(21).value.enumeration = REF(20)DOT(0).value.variant->info.variant_case;
  REF(21).tsdr = & dr_enumeration;
/* equal 22 21 =(0) */
  REF(22).value.boolean = (REF(21).value.enumeration == 0);
  REF(22).tsdr = & dr_boolean;
/* lookup_at 23 20.1 =(0) */
  if ( !((ch_t = REF(20)DOT(1).value.table)->size) ) goto ch_notfound;
  (*(REF(23).tsdr)->finalize)(REF(23).value,F_DISCARD,sched);
  (*(ch_t->tbls[ORDER_TBL].des->lookup_at))
    (ch_t, ORDER_TBL, & REF(23).value,0);
  REF(23).tsdr = qdatarepmap[ch_t->tsdr->number];
/* copy 24 23 */
  if((ch_returncode = cp_table(& ch_val, REF(23).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(24).tsdr)->finalize)(REF(24).value,F_DISCARD,sched);
  REF(24).value = ch_val;
  REF(24).tsdr = & dr_table;
/* size 25 24 */
  REF(25).value.integer = REF(24).value.table->size;
  REF(25).tsdr = & dr_integer;
/* discard 24 */
  (*(REF(24).tsdr)->finalize)(REF(24).value,F_DISCARD,sched);
  REF(24).tsdr = & dr_bottom;
/* equal 26 25 =(0) */
  REF(26).value.boolean = (REF(25).value.integer == 0);
  REF(26).tsdr = & dr_boolean;
/* and 27 22 26 */
  REF(27).value.boolean = REF(22).value.boolean&REF(26).value.boolean;
  REF(27).tsdr = & dr_boolean;
/* branch_false 27 , 47 */
  if ( !REF(27).value.boolean ) goto c47;
/* branch , 33 */
   goto c33;
c47:
/* block , 2 */
  if((ch_returncode = che_block(QUAL(2),sched)) != Normal)
     goto ch_raise_exception;
/* new_record 28 , 2 */
  if ((ch_val.record = new_record(2)) == nil) goto ch_depletion;
  (*(REF(28).tsdr)->finalize)(REF(28).value,F_DISCARD,sched);
  REF(28).value = ch_val; REF(28).tsdr = & dr_record;
/* copy 28.0 20.0 */
  if((ch_returncode = cp_variant(& ch_val, REF(20)DOT(0).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(28)DOT(0).tsdr)->finalize)(REF(28)DOT(0).value,F_DISCARD,sched);
  REF(28)DOT(0).value = ch_val;
  REF(28)DOT(0).tsdr = & dr_variant;
/* new_table 28.1 , 3 */
  if ((ch_returncode = che_new_table(DEF(28)DOT(1),QUAL(3),sched)) != Normal) 
     goto ch_raise_exception;
/* copy 29 20.1 */
  if((ch_returncode = cp_table(& ch_val, REF(20)DOT(1).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(29).tsdr)->finalize)(REF(29).value,F_DISCARD,sched);
  REF(29).value = ch_val;
  REF(29).tsdr = & dr_table;
/* initget 30 29 , 0,0 */
  (*(REF(30).tsdr)->finalize)(REF(30).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(30),DEF(29),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
c53:
/* get_or_goto 30 29 , 57 */
  if ((ch_returncode = get_selected_object(DEF(30),DEF(29),sched)) != Normal)
     goto c57;
/* concat 31 8 30 */
  if ((ch_returncode = che_concat(DEF(31),DEF(8),DEF(30),sched)) != Normal)
     goto ch_raise_exception;
/* insert 28.1 31 */
  if ((ch_returncode = insertfunc(DEF(28)DOT(1),DEF(31),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* branch , 53 */
   goto c53;
c57:
/* endget 30 29 */
  end_selector(DEF(30),DEF(29),sched,GET);
/* discard 29 */
  (*(REF(29).tsdr)->finalize)(REF(29).value,F_DISCARD,sched);
  REF(29).tsdr = & dr_bottom;
/* insert 4 28 */
  if ((ch_returncode = insertfunc(DEF(4),DEF(28),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* endblock */
  che_endblock(sched);
c62:
/* discard 28 */
  (*(REF(28).tsdr)->finalize)(REF(28).value,F_DISCARD,sched);
  REF(28).tsdr = & dr_bottom;
/* branch , 33 */
   goto c33;
c64:
/* endget 20 19 */
  end_selector(DEF(20),DEF(19),sched,GET);
/* discard 19 */
  (*(REF(19).tsdr)->finalize)(REF(19).value,F_DISCARD,sched);
  REF(19).tsdr = & dr_bottom;
c67:
/* endget 8 6.1 */
  end_selector(DEF(8),DEF(6)DOT(1),sched,GET);
c68:
/* discard 9 */
  (*(REF(9).tsdr)->finalize)(REF(9).value,F_DISCARD,sched);
  REF(9).tsdr = & dr_bottom;
/* branch , 5 */
   goto c5;
c70:
/* endget 6 5 */
  end_selector(DEF(6),DEF(5),sched,GET);
/* discard 5 */
  (*(REF(5).tsdr)->finalize)(REF(5).value,F_DISCARD,sched);
  REF(5).tsdr = & dr_bottom;
/* new_table 32 , 1 */
  if ((ch_returncode = che_new_table(DEF(32),QUAL(1),sched)) != Normal) 
     goto ch_raise_exception;
/* 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;
/* initget 33 3.1 , 0,0 */
  (*(REF(33).tsdr)->finalize)(REF(33).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(33),DEF(3)DOT(1),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
c75:
/* get_or_goto 33 3.1 , 83 */
  if ((ch_returncode = get_selected_object(DEF(33),DEF(3)DOT(1)
    ,sched)) != Normal) goto c83;
/* boolean 34 , FALSE */
  REF(34).value.boolean = FALSE;
  REF(34).tsdr = & dr_boolean;
/* find_or_goto 35 4 33 , 0,79 */
  if (findfunc(DEF(35),DEF(4),(
          arguments[0] = DEF(33),& arguments[0]),sched,0) == FAILURE) goto c79;
/* boolean 34 , TRUE */
  REF(34).value.boolean = TRUE;
  REF(34).tsdr = & dr_boolean;
c79:
/* branch_false 34 , 75 */
  if ( !REF(34).value.boolean ) goto c75;
/* remove 36 33 3.1 */
  if ((ch_returncode = che_remove(DEF(36),DEF(33),DEF(3)DOT(1)
    ,sched)) != Normal) goto ch_raise_exception;
/* insert 32 36 */
  if ((ch_returncode = insertfunc(DEF(32),DEF(36),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* branch , 75 */
   goto c75;
c83:
/* endget 33 3.1 */
  end_selector(DEF(33),DEF(3)DOT(1),sched,GET);
/* discard 32 */
  (*(REF(32).tsdr)->finalize)(REF(32).value,F_DISCARD,sched);
  REF(32).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);
c88:
/* endprocess */
  che_endprocess(sched); return;
#include "chtail.h"
