#include "chdecl.h"
void CH_do_shorten(current, sched, cop)
#define ARGUMENTS 8
#include "chhead.h"
select: switch (SELECTOR) {
    case 0: goto c0;
    case 1: goto cb1;
    case 2: goto c2;
    case 3: goto cb14;
    case 4: goto c15;
    case 5: goto c21;
    case 6: goto c30;
    case 7: goto cb54;
    case 8: goto c55;
    case 9: goto c56;
    case 10: goto cb68;
    case 11: goto c69;
    case 12: goto c71;
    case 13: goto c73;
    case 14: goto cb74;
    case 16: goto c76;
    case 17: goto cb77;
    case 19: goto c79;
    case 20: goto c81;
    case 21: goto cb91;
    case 22: goto c92;
    case 23: goto c94;
    case 18: goto c96;
    case 15: goto c96;
    case 24: goto c96;
    case 25: goto c100;
    case 26: goto c104;  }
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 3.3 , 1 */
  if ((ch_returncode = che_new_table(DEF(3)DOT(3),QUAL(1),sched)) != Normal) 
     goto ch_raise_exception;
/* new_record 4 , 3 */
  if ((ch_val.record = new_record(3)) == nil) goto ch_depletion;
  (*(REF(4).tsdr)->finalize)(REF(4).value,F_DISCARD,sched);
  REF(4).value = ch_val; REF(4).tsdr = & dr_record;
/* ordenum_lit 4.1 , 1 */
  REF(4)DOT(1).value.ord_enum = 1;
  REF(4)DOT(1).tsdr = & dr_ord_enumeration;
/* new_record 5 , 2 */
  if ((ch_val.record = new_record(2)) == nil) goto ch_depletion;
  (*(REF(5).tsdr)->finalize)(REF(5).value,F_DISCARD,sched);
  REF(5).value = ch_val; REF(5).tsdr = & dr_record;
/* unique 5.0 */
  if ((ch_returncode = che_unique(DEF(5)DOT(0),sched)) != Normal)
     goto ch_raise_exception;
/* unique 5.1 */
  if ((ch_returncode = che_unique(DEF(5)DOT(1),sched)) != Normal)
     goto ch_raise_exception;
/* unite 4.0 5 , 0 */
  if ((ch_returncode = che_unite(DEF(4)DOT(0),DEF(5),sched,0)) != Normal)
     goto ch_raise_exception;
/* new_table 4.2 , 1 */
  if ((ch_returncode = che_new_table(DEF(4)DOT(2),QUAL(1),sched)) != Normal) 
     goto ch_raise_exception;
/* chs_lit 6 , "shorten" */
  if( !chs_lit(DEF(6),"shorten") ) goto ch_depletion;
  current->ip = 3;
cb14:
/* call 3.0.1 6 7 , 2 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(0)DOT(1),
          arguments[1] = DEF(6),
          arguments[2] = DEF(7),
          arguments[2+1] = nil,& arguments[0]),QUAL(2),sched)) != Normal)
     goto ch_raise_exception;
  return;
c15:
/* procedure 8 7 , 3 */
  if ((ch_returncode = che_procedure(DEF(8),DEF(7),QUAL(3),sched)) != Normal)
     goto ch_raise_exception;
/* discard 7 */
  (*(REF(7).tsdr)->finalize)(REF(7).value,F_DISCARD,sched);
  REF(7).tsdr = & dr_bottom;
/* move 9 8 */
  (*(REF(9).tsdr)->finalize)(REF(9).value,F_DISCARD,sched);
  REF(9) = REF(8);
  REF(8).tsdr = & dr_bottom;
/* new_table 10 , 4 */
  if ((ch_returncode = che_new_table(DEF(10),QUAL(4),sched)) != Normal) 
     goto ch_raise_exception;
/* copy 11 3.2 */
  if((ch_returncode = cp_table(& ch_val, REF(3)DOT(2).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(11).tsdr)->finalize)(REF(11).value,F_DISCARD,sched);
  REF(11).value = ch_val;
  REF(11).tsdr = & dr_table;
/* initget 12 11 , 0,0 */
  (*(REF(12).tsdr)->finalize)(REF(12).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(12),DEF(11),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
c21:
/* get_or_goto 12 11 , 25 */
  if ((ch_returncode = get_selected_object(DEF(12),DEF(11),sched)) != Normal)
     goto c25;
/* copy 13 12 */
  if((ch_returncode = (REF(12).tsdr->copy)(& ch_val, REF(12).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(13).tsdr)->finalize)(REF(13).value,F_DISCARD,sched);
  REF(13).value = ch_val;
  REF(13).tsdr = datarepmap[REF(12).tsdr->number];
/* insert 10 13 */
  if ((ch_returncode = insertfunc(DEF(10),DEF(13),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* branch , 21 */
   goto c21;
c25:
/* endget 12 11 */
  end_selector(DEF(12),DEF(11),sched,GET);
/* discard 11 */
  (*(REF(11).tsdr)->finalize)(REF(11).value,F_DISCARD,sched);
  REF(11).tsdr = & dr_bottom;
/* copy 14 3.1 */
  if((ch_returncode = (REF(3)DOT(1).tsdr->copy)(& ch_val, REF(3)DOT(1).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(14).tsdr)->finalize)(REF(14).value,F_DISCARD,sched);
  REF(14).value = ch_val;
  REF(14).tsdr = datarepmap[REF(3)DOT(1).tsdr->number];
/* insert 10 14 */
  if ((ch_returncode = insertfunc(DEF(10),DEF(14),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* new_table 15 , 4 */
  if ((ch_returncode = che_new_table(DEF(15),QUAL(4),sched)) != Normal) 
     goto ch_raise_exception;
c30:
/* size 16 3.1.1 */
  REF(16).value.integer = REF(3)DOT(1)DOT(1).value.table->size;
  REF(16).tsdr = & dr_integer;
/* ile . 16 =(0) , 100 */
  if ( REF(16).value.integer <= 0 ) goto c100;
/* privatize 3.1.1 */
  if (REF(3)DOT(1)DOT(1).value.table->refcount != 1)
    if ((ch_returncode = doCopyOnWrite(DEF(3)DOT(1)DOT(1))) != Normal)
       goto ch_raise_exception;
/* initget 17 3.1.1 , 0,0 */
  (*(REF(17).tsdr)->finalize)(REF(17).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(17),DEF(3)DOT(1)DOT(1),nil,sched,GET,
    0,0)) != Normal) goto ch_raise_exception;
/* get_or_err 17 3.1.1 */
  if ((ch_returncode = get_selected_object(DEF(17),DEF(3)DOT(1)DOT(1)
    ,sched)) != Normal) goto ch_raise_exception;
/* remove 18 17 3.1.1 */
  if ((ch_returncode = che_remove(DEF(18),DEF(17),DEF(3)DOT(1)DOT(1)
    ,sched)) != Normal) goto ch_raise_exception;
/* endget 17 3.1.1 */
  end_selector(DEF(17),DEF(3)DOT(1)DOT(1),sched,GET);
/* ord_case 19 18.2 */
  REF(19).value.ord_enum = REF(18)DOT(2).value.variant->info.variant_case;
  REF(19).tsdr = & dr_ord_enumeration;
/* equal . 19 =(10) , 50 */
  if ( REF(19).value.ord_enum == 10 ) goto c50;
/* equal . 19 =(7) , 73 */
  if ( REF(19).value.ord_enum == 7 ) goto c73;
/* equal . 19 =(8) , 76 */
  if ( REF(19).value.ord_enum == 8 ) goto c76;
/* equal . 19 =(6) , 79 */
  if ( REF(19).value.ord_enum == 6 ) goto c79;
/* branch , 96 */
   goto c96;
c50:
/* reveal 18.2 , 10 */
  if (10 != REF(18)DOT(2).value.variant->info.variant_case)
     goto ch_case_error;
/* new_record 20 , 2 */
  if ((ch_val.record = new_record(2)) == nil) goto ch_depletion;
  (*(REF(20).tsdr)->finalize)(REF(20).value,F_DISCARD,sched);
  REF(20).value = ch_val; REF(20).tsdr = & dr_record;
/* copy 20.0 3.1.0 */
  if((ch_returncode = (REF(3)DOT(1)DOT(0).tsdr->copy)(& ch_val, 
    REF(3)DOT(1)DOT(0).value)) != Normal) goto ch_raise_exception;
  (*(REF(20)DOT(0).tsdr)->finalize)(REF(20)DOT(0).value,F_DISCARD,sched);
  REF(20)DOT(0).value = ch_val;
  REF(20)DOT(0).tsdr = datarepmap[REF(3)DOT(1)DOT(0).tsdr->number];
/* copy 20.1 18.0 */
  if((ch_returncode = (REF(18)DOT(0).tsdr->copy)(& ch_val, REF(18)DOT(0).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(20)DOT(1).tsdr)->finalize)(REF(20)DOT(1).value,F_DISCARD,sched);
  REF(20)DOT(1).value = ch_val;
  REF(20)DOT(1).tsdr = datarepmap[REF(18)DOT(0).tsdr->number];
  current->ip = 7;
cb54:
/* call 9 10 18.2.0.1 20 4 3.3 , 5 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(9),
          arguments[1] = DEF(10),
          arguments[2] = DEF(18)DOT(2)DOT(0)DOT(1),
          arguments[3] = DEF(20),
          arguments[4] = DEF(4),
          arguments[5] = DEF(3)DOT(3),
          arguments[5+1] = nil,& arguments[0]),QUAL(5),sched)) != Normal)
     goto ch_raise_exception;
  return;
c55:
/* new_table 21 , 4 */
  if ((ch_returncode = che_new_table(DEF(21),QUAL(4),sched)) != Normal) 
     goto ch_raise_exception;
c56:
/* size 22 18.2.0.3 */
  REF(22).value.integer = REF(18)DOT(2)DOT(0)DOT(3).value.table->size;
  REF(22).tsdr = & dr_integer;
/* ile . 22 =(0) , 71 */
  if ( REF(22).value.integer <= 0 ) goto c71;
/* privatize 18.2.0.3 */
  if (REF(18)DOT(2)DOT(0)DOT(3).value.table->refcount != 1)
    if ((ch_returncode = doCopyOnWrite(DEF(18)DOT(2)DOT(0)DOT(3))) != Normal)
       goto ch_raise_exception;
/* initget 23 18.2.0.3 , 0,0 */
  (*(REF(23).tsdr)->finalize)(REF(23).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(23),DEF(18)DOT(2)DOT(0)DOT(3)
    ,nil,sched,GET,0,0)) != Normal) goto ch_raise_exception;
/* get_or_err 23 18.2.0.3 */
  if ((ch_returncode = get_selected_object(DEF(23),DEF(18)DOT(2)DOT(0)DOT(3)
    ,sched)) != Normal) goto ch_raise_exception;
/* remove 24 23 18.2.0.3 */
  if ((ch_returncode = che_remove(DEF(24),DEF(23),DEF(18)DOT(2)DOT(0)DOT(3)
    ,sched)) != Normal) goto ch_raise_exception;
/* endget 23 18.2.0.3 */
  end_selector(DEF(23),DEF(18)DOT(2)DOT(0)DOT(3),sched,GET);
/* equal 25 24.0 18.2.0.2 */
  REF(25).value.boolean = ((REF(24)DOT(0).tsdr->equal)(REF(24)DOT(0).value,
    REF(18)DOT(2)DOT(0)DOT(2).value));
  REF(25).tsdr = & dr_boolean;
/* not 26 25 */
  REF(26).value.boolean = !REF(25).value.boolean;
  REF(26).tsdr = & dr_boolean;
/* branch_false 26 , 69 */
  if ( !REF(26).value.boolean ) goto c69;
  current->ip = 10;
cb68:
/* call 9 10 24.1 20 4 3.3 , 5 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(9),
          arguments[1] = DEF(10),
          arguments[2] = DEF(24)DOT(1),
          arguments[3] = DEF(20),
          arguments[4] = DEF(4),
          arguments[5] = DEF(3)DOT(3),
          arguments[5+1] = nil,& arguments[0]),QUAL(5),sched)) != Normal)
     goto ch_raise_exception;
  return;
c69:
/* insert 21 24 */
  if ((ch_returncode = insertfunc(DEF(21),DEF(24),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* branch , 56 */
   goto c56;
c71:
/* move 18.2.0.3 21 */
  (*(REF(18)DOT(2)DOT(0)DOT(3).tsdr)->finalize)(
    REF(18)DOT(2)DOT(0)DOT(3).value,F_DISCARD,sched);
  REF(18)DOT(2)DOT(0)DOT(3) = REF(21);
  REF(21).tsdr = & dr_bottom;
/* branch , 96 */
   goto c96;
c73:
/* reveal 18.2 , 7 */
  if (7 != REF(18)DOT(2).value.variant->info.variant_case) goto ch_case_error;
  current->ip = 14;
cb74:
/* call 9 10 18.2.0.3 18.2.0.2 4 3.3 , 5 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(9),
          arguments[1] = DEF(10),
          arguments[2] = DEF(18)DOT(2)DOT(0)DOT(3),
          arguments[3] = DEF(18)DOT(2)DOT(0)DOT(2),
          arguments[4] = DEF(4),
          arguments[5] = DEF(3)DOT(3),
          arguments[5+1] = nil,& arguments[0]),QUAL(5),sched)) != Normal)
     goto ch_raise_exception;
  return;
c76:
/* reveal 18.2 , 8 */
  if (8 != REF(18)DOT(2).value.variant->info.variant_case) goto ch_case_error;
  current->ip = 17;
cb77:
/* call 9 10 18.2.0.1 18.2.0.0 4 3.3 , 5 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(9),
          arguments[1] = DEF(10),
          arguments[2] = DEF(18)DOT(2)DOT(0)DOT(1),
          arguments[3] = DEF(18)DOT(2)DOT(0)DOT(0),
          arguments[4] = DEF(4),
          arguments[5] = DEF(3)DOT(3),
          arguments[5+1] = nil,& arguments[0]),QUAL(5),sched)) != Normal)
     goto ch_raise_exception;
  return;
c79:
/* reveal 18.2 , 6 */
  if (6 != REF(18)DOT(2).value.variant->info.variant_case) goto ch_case_error;
/* new_table 27 , 6 */
  if ((ch_returncode = che_new_table(DEF(27),QUAL(6),sched)) != Normal) 
     goto ch_raise_exception;
c81:
/* size 28 18.2.0.1 */
  REF(28).value.integer = REF(18)DOT(2)DOT(0)DOT(1).value.table->size;
  REF(28).tsdr = & dr_integer;
/* ile . 28 =(0) , 94 */
  if ( REF(28).value.integer <= 0 ) goto c94;
/* privatize 18.2.0.1 */
  if (REF(18)DOT(2)DOT(0)DOT(1).value.table->refcount != 1)
    if ((ch_returncode = doCopyOnWrite(DEF(18)DOT(2)DOT(0)DOT(1))) != Normal)
       goto ch_raise_exception;
/* initget 29 18.2.0.1 , 0,0 */
  (*(REF(29).tsdr)->finalize)(REF(29).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(29),DEF(18)DOT(2)DOT(0)DOT(1)
    ,nil,sched,GET,0,0)) != Normal) goto ch_raise_exception;
/* get_or_err 29 18.2.0.1 */
  if ((ch_returncode = get_selected_object(DEF(29),DEF(18)DOT(2)DOT(0)DOT(1)
    ,sched)) != Normal) goto ch_raise_exception;
/* remove 30 29 18.2.0.1 */
  if ((ch_returncode = che_remove(DEF(30),DEF(29),DEF(18)DOT(2)DOT(0)DOT(1)
    ,sched)) != Normal) goto ch_raise_exception;
/* endget 29 18.2.0.1 */
  end_selector(DEF(29),DEF(18)DOT(2)DOT(0)DOT(1),sched,GET);
/* find 31 18.1 30.0 , 0 */
  if (findfunc(DEF(31),DEF(18)DOT(1),(
          arguments[0] = DEF(30)DOT(0),& arguments[0]),sched,0) == FAILURE)
             goto ch_notfound;
  current->ip = 21;
cb91:
/* call 9 10 30.2 31.1 4 3.3 , 5 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(9),
          arguments[1] = DEF(10),
          arguments[2] = DEF(30)DOT(2),
          arguments[3] = DEF(31)DOT(1),
          arguments[4] = DEF(4),
          arguments[5] = DEF(3)DOT(3),
          arguments[5+1] = nil,& arguments[0]),QUAL(5),sched)) != Normal)
     goto ch_raise_exception;
  return;
c92:
/* insert 27 30 */
  if ((ch_returncode = insertfunc(DEF(27),DEF(30),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* branch , 81 */
   goto c81;
c94:
/* move 18.2.0.1 27 */
  (*(REF(18)DOT(2)DOT(0)DOT(1).tsdr)->finalize)(
    REF(18)DOT(2)DOT(0)DOT(1).value,F_DISCARD,sched);
  REF(18)DOT(2)DOT(0)DOT(1) = REF(27);
  REF(27).tsdr = & dr_bottom;
c78:
c75:
c96:
/* discard 20 */
  (*(REF(20).tsdr)->finalize)(REF(20).value,F_DISCARD,sched);
  REF(20).tsdr = & dr_bottom;
/* insert 15 18 */
  if ((ch_returncode = insertfunc(DEF(15),DEF(18),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* branch , 30 */
   goto c30;
c100:
/* move 3.1.1 15 */
  (*(REF(3)DOT(1)DOT(1).tsdr)->finalize)(REF(3)DOT(1)DOT(1).value
    ,F_DISCARD,sched);
  REF(3)DOT(1)DOT(1) = REF(15);
  REF(15).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);
c104:
/* endprocess */
  che_endprocess(sched); return;
#include "chtail.h"
