#include "chdecl.h"
void CH_sortprocerrors(current, sched, cop)
#define ARGUMENTS 6
#include "chhead.h"
select: switch (SELECTOR) {
    case 0: goto c0;
    case 1: goto cb5;
    case 2: goto c6;
    case 3: goto c8;
    case 4: goto c30;
    case 5: goto c33;
    case 6: goto c37;
    case 7: goto c47;
    case 8: goto c69;
    case 9: goto c78;
    case 10: goto c80;
    case 11: goto c82;
    case 12: goto c84;
    case 13: goto c91;
    case 14: goto cb99;
    case 15: goto c100;
    case 16: goto c111;
    case 17: goto c115;
    case 18: goto c118;  }
c0:
/* block , 0 */
  if((ch_returncode = che_block(QUAL(0),sched)) != Normal)
     goto ch_raise_exception;
/* prog_lit 3 , 1 */
  if ((ch_returncode = che_prog_lit(DEF(3),QUAL(1),sched)) != Normal) 
     goto ch_raise_exception;
/* procedure 4 3 , 2 */
  if ((ch_returncode = che_procedure(DEF(4),DEF(3),QUAL(2),sched)) != Normal)
     goto ch_raise_exception;
/* discard 3 */
  (*(REF(3).tsdr)->finalize)(REF(3).value,F_DISCARD,sched);
  REF(3).tsdr = & dr_bottom;
/* move 5 4 */
  (*(REF(5).tsdr)->finalize)(REF(5).value,F_DISCARD,sched);
  REF(5) = REF(4);
  REF(4).tsdr = & dr_bottom;
  current->ip = 1;
cb5:
/* receive 6 0 */
  if ((ch_returncode = che_receive(DEF(6),DEF(0),sched)) != Normal)
     goto ch_raise_exception;
  return;
c6:
/* copy 7 6.0 */
  if((ch_returncode = cp_table(& ch_val, REF(6)DOT(0).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(7).tsdr)->finalize)(REF(7).value,F_DISCARD,sched);
  REF(7).value = ch_val;
  REF(7).tsdr = & dr_table;
/* initget 8 7 , 0,0 */
  (*(REF(8).tsdr)->finalize)(REF(8).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(8),DEF(7),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
c8:
/* get_or_goto 8 7 , 33 */
  if ((ch_returncode = get_selected_object(DEF(8),DEF(7),sched)) != Normal)
     goto c33;
/* case 9 8.1.0 */
  REF(9).value.enumeration = REF(8)DOT(1)DOT(0).value.variant
    ->info.variant_case;
  REF(9).tsdr = & dr_enumeration;
/* notequal . 9 =(0) , 30 */
  if ( REF(9).value.enumeration != 0 ) goto c30;
/* block , 3 */
  if((ch_returncode = che_block(QUAL(3),sched)) != Normal)
     goto ch_raise_exception;
/* copy 10 8.0 */
  if((ch_returncode = (REF(8)DOT(0).tsdr->copy)(& ch_val, REF(8)DOT(0).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(10).tsdr)->finalize)(REF(10).value,F_DISCARD,sched);
  REF(10).value = ch_val;
  REF(10).tsdr = datarepmap[REF(8)DOT(0).tsdr->number];
/* unite 11 10 , 0 */
  if ((ch_returncode = che_unite(DEF(11),DEF(10),sched,0)) != Normal)
     goto ch_raise_exception;
/* reveal 8.1.0 , 0 */
  if (0 != REF(8)DOT(1)DOT(0).value.variant->info.variant_case)
     goto ch_case_error;
/* find 12 6.1 11 , 0 */
  if (findfunc(DEF(12),DEF(6)DOT(1),(
          arguments[0] = DEF(11),& arguments[0]),sched,0) == FAILURE)
             goto ch_notfound;
/* find 13 12.1 8.1.0.0 , 0 */
  if (findfunc(DEF(13),DEF(12)DOT(1),(
          arguments[0] = DEF(8)DOT(1)DOT(0)DOT(0),& arguments[0]),sched,0
            ) == FAILURE) goto ch_notfound;
/* privatize 6.0 */
  if (REF(6)DOT(0).value.table->refcount != 1)
    if ((ch_returncode = doCopyOnWrite(DEF(6)DOT(0))) != Normal)
       goto ch_raise_exception;
/* position 14 8 */
  ch_frame = get_selector_frame(DEF(8),sched);
  ch_t = ch_frame->inspectee->value.table;
  REF(14).value.integer = ch_frame->rmvcount +
    (*(ch_t->tbls[ORDER_TBL].des->position_of))(ch_t,ORDER_TBL,ch_frame->pos);
  REF(14).tsdr = &dr_integer;
/* lookup_at 15 6.0 14 */
  if((ch_i = REF(14).value.integer) < 0 || ch_i >= (ch_t = REF(6)DOT(0).value
    .table)->size) goto ch_notfound;
  (*(REF(15).tsdr)->finalize)(REF(15).value,F_DISCARD,sched);
  (*(ch_t->tbls[ORDER_TBL].des->lookup_at))
    (ch_t, ORDER_TBL, & REF(15).value,ch_i);
  REF(15).tsdr = qdatarepmap[ch_t->tsdr->number];
/* remove_at 16 6.0 14 */
  if ((ch_returncode = remove_at_func(DEF(16),DEF(6)DOT(0),
    REF(14).value.integer)) != Normal) goto ch_raise_exception;
/* copy 17 13.1 */
  if((ch_returncode = (REF(13)DOT(1).tsdr->copy)(& ch_val, REF(13)DOT(1).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(17).tsdr)->finalize)(REF(17).value,F_DISCARD,sched);
  REF(17).value = ch_val;
  REF(17).tsdr = datarepmap[REF(13)DOT(1).tsdr->number];
/* unite 16.1.0 17 , 1 */
  if ((ch_returncode = che_unite(DEF(16)DOT(1)DOT(0),DEF(17),sched,1
    )) != Normal) goto ch_raise_exception;
/* position 18 8 */
  ch_frame = get_selector_frame(DEF(8),sched);
  ch_t = ch_frame->inspectee->value.table;
  REF(18).value.integer = ch_frame->rmvcount +
    (*(ch_t->tbls[ORDER_TBL].des->position_of))(ch_t,ORDER_TBL,ch_frame->pos);
  REF(18).tsdr = &dr_integer;
/* insert_at 6.0 16 18 */
  ch_i = REF(18).value.integer;
  if (ch_i < 0 || REF(6)DOT(0).value.table->size < ch_i) goto ch_range_error;
  if ((ch_returncode = insertfunc(DEF(6)DOT(0),DEF(16),TRUE, ch_i)) != Normal)
     goto ch_raise_exception;
/* endblock */
  che_endblock(sched);
c30:
/* discard 11 */
  (*(REF(11).tsdr)->finalize)(REF(11).value,F_DISCARD,sched);
  REF(11).tsdr = & dr_bottom;
/* branch , 8 */
   goto c8;
c33:
/* endget 8 7 */
  end_selector(DEF(8),DEF(7),sched,GET);
/* discard 7 */
  (*(REF(7).tsdr)->finalize)(REF(7).value,F_DISCARD,sched);
  REF(7).tsdr = & dr_bottom;
/* block , 4 */
  if((ch_returncode = che_block(QUAL(4),sched)) != Normal)
     goto ch_raise_exception;
/* initget 19 6.0 , 0,0 */
  (*(REF(19).tsdr)->finalize)(REF(19).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(19),DEF(6)DOT(0),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
c37:
/* get_or_err 19 6.0 */
  if ((ch_returncode = get_selected_object(DEF(19),DEF(6)DOT(0)
    ,sched)) != Normal) goto ch_raise_exception;
/* case 20 19.1.0 */
  REF(20).value.enumeration = REF(19)DOT(1)DOT(0).value.variant
    ->info.variant_case;
  REF(20).tsdr = & dr_enumeration;
/* notequal . 20 =(0) , 37 */
  if ( REF(20).value.enumeration != 0 ) goto c37;
/* position 21 19 */
  ch_frame = get_selector_frame(DEF(19),sched);
  ch_t = ch_frame->inspectee->value.table;
  REF(21).value.integer = ch_frame->rmvcount +
    (*(ch_t->tbls[ORDER_TBL].des->position_of))(ch_t,ORDER_TBL,ch_frame->pos);
  REF(21).tsdr = &dr_integer;
/* endget 19 6.0 */
  end_selector(DEF(19),DEF(6)DOT(0),sched,GET);
/* move 22 21 */
  REF(22) = REF(21);
  REF(21).tsdr = & dr_bottom;
/* size 23 6.0 */
  REF(23).value.integer = REF(6)DOT(0).value.table->size;
  REF(23).tsdr = & dr_integer;
c47:
/* noop */
  
/* isubtract 24 23 =(1) */
  if (!chf_isubtract(DEF(24),REF(23).value.integer,1)) goto ch_depletion;
/* ige . 22 24 , 78 */
  if ( REF(22).value.integer >= REF(24).value.integer ) goto c78;
/* isubtract 23 23 =(1) */
  if (!chf_isubtract(DEF(23),REF(23).value.integer,1)) goto ch_depletion;
/* privatize 6.0 */
  if (REF(6)DOT(0).value.table->refcount != 1)
    if ((ch_returncode = doCopyOnWrite(DEF(6)DOT(0))) != Normal)
       goto ch_raise_exception;
/* lookup_at 25 6.0 23 */
  if((ch_i = REF(23).value.integer) < 0 || ch_i >= (ch_t = REF(6)DOT(0).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];
/* remove_at 16 6.0 23 */
  if ((ch_returncode = remove_at_func(DEF(16),DEF(6)DOT(0),
    REF(23).value.integer)) != Normal) goto ch_raise_exception;
/* insert_at 6.0 16 22 */
  ch_i = REF(22).value.integer;
  if (ch_i < 0 || REF(6)DOT(0).value.table->size < ch_i) goto ch_range_error;
  if ((ch_returncode = insertfunc(DEF(6)DOT(0),DEF(16),TRUE, ch_i)) != Normal)
     goto ch_raise_exception;
/* iadd 26 22 =(1) */
  if (!chf_iadd(DEF(26),REF(22).value.integer,1)) goto ch_depletion;
/* ige . 26 23 , 68 */
  if ( REF(26).value.integer >= REF(23).value.integer ) goto c68;
/* privatize 6.0 */
  if (REF(6)DOT(0).value.table->refcount != 1)
    if ((ch_returncode = doCopyOnWrite(DEF(6)DOT(0))) != Normal)
       goto ch_raise_exception;
/* iadd 27 22 =(1) */
  if (!chf_iadd(DEF(27),REF(22).value.integer,1)) goto ch_depletion;
/* lookup_at 28 6.0 27 */
  if((ch_i = REF(27).value.integer) < 0 || ch_i >= (ch_t = REF(6)DOT(0).value
    .table)->size) goto ch_notfound;
  (*(REF(28).tsdr)->finalize)(REF(28).value,F_DISCARD,sched);
  (*(ch_t->tbls[ORDER_TBL].des->lookup_at))
    (ch_t, ORDER_TBL, & REF(28).value,ch_i);
  REF(28).tsdr = qdatarepmap[ch_t->tsdr->number];
/* remove_at 16 6.0 27 */
  if ((ch_returncode = remove_at_func(DEF(16),DEF(6)DOT(0),
    REF(27).value.integer)) != Normal) goto ch_raise_exception;
/* insert 6.0 16 */
  if ((ch_returncode = insertfunc(DEF(6)DOT(0),DEF(16),FALSE,0)) != Normal)
     goto ch_raise_exception;
c68:
/* initget 29 6.0 , 0,0 */
  (*(REF(29).tsdr)->finalize)(REF(29).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(29),DEF(6)DOT(0),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
c69:
/* get_or_err 29 6.0 */
  if ((ch_returncode = get_selected_object(DEF(29),DEF(6)DOT(0)
    ,sched)) != Normal) goto ch_raise_exception;
/* case 30 29.1.0 */
  REF(30).value.enumeration = REF(29)DOT(1)DOT(0).value.variant
    ->info.variant_case;
  REF(30).tsdr = & dr_enumeration;
/* notequal . 30 =(0) , 69 */
  if ( REF(30).value.enumeration != 0 ) goto c69;
/* position 31 29 */
  ch_frame = get_selector_frame(DEF(29),sched);
  ch_t = ch_frame->inspectee->value.table;
  REF(31).value.integer = ch_frame->rmvcount +
    (*(ch_t->tbls[ORDER_TBL].des->position_of))(ch_t,ORDER_TBL,ch_frame->pos);
  REF(31).tsdr = &dr_integer;
/* endget 29 6.0 */
  end_selector(DEF(29),DEF(6)DOT(0),sched,GET);
/* move 22 31 */
  REF(22) = REF(31);
  REF(31).tsdr = & dr_bottom;
/* branch , 47 */
   goto c47;
c78:
/* endblock */
  che_endblock(sched);
/* branch , 82 */
   goto c82;
c80:
/* size 23 6.0 */
  REF(23).value.integer = REF(6)DOT(0).value.table->size;
  REF(23).tsdr = & dr_integer;
c82:
/* ilit 22 , 0 */
  REF(22).value.integer = 0;
  REF(22).tsdr = & dr_integer;
c84:
/* noop */
  
/* isubtract 32 23 =(1) */
  if (!chf_isubtract(DEF(32),REF(23).value.integer,1)) goto ch_depletion;
/* ige . 22 32 , 115 */
  if ( REF(22).value.integer >= REF(32).value.integer ) goto c115;
/* isubtract 33 23 =(1) */
  if (!chf_isubtract(DEF(33),REF(23).value.integer,1)) goto ch_depletion;
c91:
/* ile . 33 22 , 111 */
  if ( REF(33).value.integer <= REF(22).value.integer ) goto c111;
/* isubtract 34 33 =(1) */
  if (!chf_isubtract(DEF(34),REF(33).value.integer,1)) goto ch_depletion;
/* lookup_at 35 6.0 34 */
  if((ch_i = REF(34).value.integer) < 0 || ch_i >= (ch_t = REF(6)DOT(0).value
    .table)->size) goto ch_notfound;
  (*(REF(35).tsdr)->finalize)(REF(35).value,F_DISCARD,sched);
  (*(ch_t->tbls[ORDER_TBL].des->lookup_at))
    (ch_t, ORDER_TBL, & REF(35).value,ch_i);
  REF(35).tsdr = qdatarepmap[ch_t->tsdr->number];
/* reveal 35.1.0 , 1 */
  if (1 != REF(35)DOT(1)DOT(0).value.variant->info.variant_case)
     goto ch_case_error;
/* lookup_at 36 6.0 33 */
  if((ch_i = REF(33).value.integer) < 0 || ch_i >= (ch_t = REF(6)DOT(0).value
    .table)->size) goto ch_notfound;
  (*(REF(36).tsdr)->finalize)(REF(36).value,F_DISCARD,sched);
  (*(ch_t->tbls[ORDER_TBL].des->lookup_at))
    (ch_t, ORDER_TBL, & REF(36).value,ch_i);
  REF(36).tsdr = qdatarepmap[ch_t->tsdr->number];
/* reveal 36.1.0 , 1 */
  if (1 != REF(36)DOT(1)DOT(0).value.variant->info.variant_case)
     goto ch_case_error;
  current->ip = 14;
cb99:
/* call 5 35.1.0.0 36.1.0.0 37 , 5 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(5),
          arguments[1] = DEF(35)DOT(1)DOT(0)DOT(0),
          arguments[2] = DEF(36)DOT(1)DOT(0)DOT(0),
          arguments[3] = DEF(37),
          arguments[3+1] = nil,& arguments[0]),QUAL(5),sched)) != Normal)
     goto ch_raise_exception;
  return;
c100:
/* branch_false 37 , 107 */
  if ( !REF(37).value.boolean ) goto c107;
/* privatize 6.0 */
  if (REF(6)DOT(0).value.table->refcount != 1)
    if ((ch_returncode = doCopyOnWrite(DEF(6)DOT(0))) != Normal)
       goto ch_raise_exception;
/* lookup_at 38 6.0 33 */
  if((ch_i = REF(33).value.integer) < 0 || ch_i >= (ch_t = REF(6)DOT(0).value
    .table)->size) goto ch_notfound;
  (*(REF(38).tsdr)->finalize)(REF(38).value,F_DISCARD,sched);
  (*(ch_t->tbls[ORDER_TBL].des->lookup_at))
    (ch_t, ORDER_TBL, & REF(38).value,ch_i);
  REF(38).tsdr = qdatarepmap[ch_t->tsdr->number];
/* remove_at 16 6.0 33 */
  if ((ch_returncode = remove_at_func(DEF(16),DEF(6)DOT(0),
    REF(33).value.integer)) != Normal) goto ch_raise_exception;
/* isubtract 39 33 =(1) */
  if (!chf_isubtract(DEF(39),REF(33).value.integer,1)) goto ch_depletion;
/* insert_at 6.0 16 39 */
  ch_i = REF(39).value.integer;
  if (ch_i < 0 || REF(6)DOT(0).value.table->size < ch_i) goto ch_range_error;
  if ((ch_returncode = insertfunc(DEF(6)DOT(0),DEF(16),TRUE, ch_i)) != Normal)
     goto ch_raise_exception;
c107:
/* noop */
  
/* isubtract 33 33 =(1) */
  if (!chf_isubtract(DEF(33),REF(33).value.integer,1)) goto ch_depletion;
/* branch , 91 */
   goto c91;
c111:
/* noop */
  
/* iadd 22 22 =(1) */
  if (!chf_iadd(DEF(22),REF(22).value.integer,1)) goto ch_depletion;
/* branch , 84 */
   goto c84;
c115:
/* return 6 */
  if (ch_caller = do_return(REF(6).value)) {
    if (ch_caller->type < CProcess) ch_caller->ip++;
      sched->wakeup_proc(sched, ch_caller);}
  else rem_return(REF(6).value);
  REF(6).tsdr = & dr_bottom;
/* endblock */
  che_endblock(sched);
c118:
/* endprocess */
  che_endprocess(sched); return;
#include "chtail.h"
