#include "chdecl.h"
void CH_getlink(current, sched, cop)
#define ARGUMENTS 7
#include "chhead.h"
select: switch (SELECTOR) {
    case 0: goto c0;
    case 1: goto cb1;
    case 2: goto c2;
    case 3: goto cb5;
    case 4: goto c6;
    case 5: goto cb8;
    case 6: goto c9;
    case 7: goto c19;
    case 8: goto c28;
    case 9: goto c37;
    case 10: goto c48;
    case 11: goto cb56;
    case 12: goto c57;
    case 13: goto c60;
    case 14: goto c63;
    case 15: goto cb64;
    case 16: goto c65;
    case 17: goto cb67;
    case 18: goto c68;
    case 19: goto c71;
    case 20: goto cb76;
    case 21: goto c77;
    case 22: goto c81;  }
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:
/* chs_lit 4 , "system" */
  if( !chs_lit(DEF(4),"system") ) goto ch_depletion;
/* chs_lit 5 , "CLoader" */
  if( !chs_lit(DEF(5),"CLoader") ) goto ch_depletion;
/* chs_lit 6 , "" */
  if( !chs_lit(DEF(6),"") ) goto ch_depletion;
  current->ip = 3;
cb5:
/* call 3.2.2 4 5 6 7 , 1 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(2)DOT(2),
          arguments[1] = DEF(4),
          arguments[2] = DEF(5),
          arguments[3] = DEF(6),
          arguments[4] = DEF(7),
          arguments[4+1] = nil,& arguments[0]),QUAL(1),sched)) != Normal)
     goto ch_raise_exception;
  return;
c6:
/* unwrap 8 7 , 2 */
  if ((ch_returncode = che_unwrap(DEF(8),DEF(7),QUAL(2),sched)) != Normal)
     goto ch_raise_exception;
/* chs_lit 9 , "get link" */
  if( !chs_lit(DEF(9),"get link") ) goto ch_depletion;
  current->ip = 5;
cb8:
/* call 8 9 10 , 3 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(8),
          arguments[1] = DEF(9),
          arguments[2] = DEF(10),
          arguments[2+1] = nil,& arguments[0]),QUAL(3),sched)) != Normal)
     goto ch_raise_exception;
  return;
c9:
/* unwrap 11 10 , 4 */
  if ((ch_returncode = che_unwrap(DEF(11),DEF(10),QUAL(4),sched)) != Normal)
     goto ch_raise_exception;
/* prog_lit 12 , 5 */
  if ((ch_returncode = che_prog_lit(DEF(12),QUAL(5),sched)) != Normal) 
     goto ch_raise_exception;
/* procedure 13 12 , 6 */
  if ((ch_returncode = che_procedure(DEF(13),DEF(12),QUAL(6)
    ,sched)) != Normal) goto ch_raise_exception;
/* discard 12 */
  (*(REF(12).tsdr)->finalize)(REF(12).value,F_DISCARD,sched);
  REF(12).tsdr = & dr_bottom;
/* move 14 13 */
  (*(REF(14).tsdr)->finalize)(REF(14).value,F_DISCARD,sched);
  REF(14) = REF(13);
  REF(13).tsdr = & dr_bottom;
/* new_table 15 , 7 */
  if ((ch_returncode = che_new_table(DEF(15),QUAL(7),sched)) != Normal) 
     goto ch_raise_exception;
/* copy 16 3.2 */
  if((ch_returncode = (REF(3)DOT(2).tsdr->copy)(& ch_val, REF(3)DOT(2).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(16).tsdr)->finalize)(REF(16).value,F_DISCARD,sched);
  REF(16).value = ch_val;
  REF(16).tsdr = datarepmap[REF(3)DOT(2).tsdr->number];
/* insert 15 16 */
  if ((ch_returncode = insertfunc(DEF(15),DEF(16),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* copy 17 3.0 */
  if((ch_returncode = cp_table(& ch_val, REF(3)DOT(0).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(17).tsdr)->finalize)(REF(17).value,F_DISCARD,sched);
  REF(17).value = ch_val;
  REF(17).tsdr = & dr_table;
/* initget 18 17 , 0,0 */
  (*(REF(18).tsdr)->finalize)(REF(18).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(18),DEF(17),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
c19:
/* get_or_goto 18 17 , 71 */
  if ((ch_returncode = get_selected_object(DEF(18),DEF(17),sched)) != Normal)
     goto c71;
/* position 19 18 */
  ch_frame = get_selector_frame(DEF(18),sched);
  ch_t = ch_frame->inspectee->value.table;
  REF(19).value.integer = ch_frame->rmvcount +
    (*(ch_t->tbls[ORDER_TBL].des->position_of))(ch_t,ORDER_TBL,ch_frame->pos);
  REF(19).tsdr = &dr_integer;
/* ilt . 19 =(2) , 19 */
  if ( REF(19).value.integer < 2 ) goto c19;
/* discard 20 */
  (*(REF(20).tsdr)->finalize)(REF(20).value,F_DISCARD,sched);
  REF(20).tsdr = & dr_bottom;
/* discard 21 */
  (*(REF(21).tsdr)->finalize)(REF(21).value,F_DISCARD,sched);
  REF(21).tsdr = & dr_bottom;
/* block , 8 */
  if((ch_returncode = che_block(QUAL(8),sched)) != Normal)
     goto ch_raise_exception;
/* initget 22 18 , 0,0 */
  (*(REF(22).tsdr)->finalize)(REF(22).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(22),DEF(18),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
c28:
/* get_or_err 22 18 */
  if ((ch_returncode = get_selected_object(DEF(22),DEF(18),sched)) != Normal)
     goto ch_raise_exception;
/* notequal . 22 =(58) , 28 */
  if ( REF(22).value.ord_enum != 58 ) goto c28;
/* position 23 22 */
  ch_frame = get_selector_frame(DEF(22),sched);
  ch_t = ch_frame->inspectee->value.table;
  REF(23).value.integer = ch_frame->rmvcount +
    (*(ch_t->tbls[ORDER_TBL].des->position_of))(ch_t,ORDER_TBL,ch_frame->pos);
  REF(23).tsdr = &dr_integer;
/* endget 22 18 */
  end_selector(DEF(22),DEF(18),sched,GET);
/* move 24 23 */
  REF(24) = REF(23);
  REF(23).tsdr = & dr_bottom;
/* new_table 25 , 9 */
  if ((ch_returncode = che_new_table(DEF(25),QUAL(9),sched)) != Normal) 
     goto ch_raise_exception;
/* initget 26 18 , 0,0 */
  (*(REF(26).tsdr)->finalize)(REF(26).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(26),DEF(18),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
c37:
/* get_or_goto 26 18 , 44 */
  if ((ch_returncode = get_selected_object(DEF(26),DEF(18),sched)) != Normal)
     goto c44;
/* position 27 26 */
  ch_frame = get_selector_frame(DEF(26),sched);
  ch_t = ch_frame->inspectee->value.table;
  REF(27).value.integer = ch_frame->rmvcount +
    (*(ch_t->tbls[ORDER_TBL].des->position_of))(ch_t,ORDER_TBL,ch_frame->pos);
  REF(27).tsdr = &dr_integer;
/* ige . 27 24 , 37 */
  if ( REF(27).value.integer >= REF(24).value.integer ) goto c37;
/* copy 28 26 */
  if((ch_returncode = (REF(26).tsdr->copy)(& ch_val, REF(26).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(28).tsdr)->finalize)(REF(28).value,F_DISCARD,sched);
  REF(28).value = ch_val;
  REF(28).tsdr = datarepmap[REF(26).tsdr->number];
/* insert 25 28 */
  if ((ch_returncode = insertfunc(DEF(25),DEF(28),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* branch , 37 */
   goto c37;
c44:
/* endget 26 18 */
  end_selector(DEF(26),DEF(18),sched,GET);
/* move 20 25 */
  (*(REF(20).tsdr)->finalize)(REF(20).value,F_DISCARD,sched);
  REF(20) = REF(25);
  REF(25).tsdr = & dr_bottom;
/* new_table 29 , 9 */
  if ((ch_returncode = che_new_table(DEF(29),QUAL(9),sched)) != Normal) 
     goto ch_raise_exception;
/* initget 30 18 , 0,0 */
  (*(REF(30).tsdr)->finalize)(REF(30).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(30),DEF(18),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
c48:
/* get_or_goto 30 18 , 55 */
  if ((ch_returncode = get_selected_object(DEF(30),DEF(18),sched)) != Normal)
     goto c55;
/* position 31 30 */
  ch_frame = get_selector_frame(DEF(30),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;
/* ile . 31 24 , 48 */
  if ( REF(31).value.integer <= REF(24).value.integer ) goto c48;
/* copy 32 30 */
  if((ch_returncode = (REF(30).tsdr->copy)(& ch_val, REF(30).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(32).tsdr)->finalize)(REF(32).value,F_DISCARD,sched);
  REF(32).value = ch_val;
  REF(32).tsdr = datarepmap[REF(30).tsdr->number];
/* insert 29 32 */
  if ((ch_returncode = insertfunc(DEF(29),DEF(32),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* branch , 48 */
   goto c48;
c55:
/* endget 30 18 */
  end_selector(DEF(30),DEF(18),sched,GET);
  current->ip = 11;
cb56:
/* call 14 29 33 , 10 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(14),
          arguments[1] = DEF(29),
          arguments[2] = DEF(33),
          arguments[2+1] = nil,& arguments[0]),QUAL(10),sched)) != Normal)
     goto ch_raise_exception;
  return;
c57:
/* move 34 33 */
  REF(34) = REF(33);
  REF(33).tsdr = & dr_bottom;
/* endblock */
  che_endblock(sched);
/* branch , 63 */
   goto c63;
c60:
/* copy 20 18 */
  if((ch_returncode = cp_table(& ch_val, REF(18).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(20).tsdr)->finalize)(REF(20).value,F_DISCARD,sched);
  REF(20).value = ch_val;
  REF(20).tsdr = & dr_table;
/* ilit 34 , 1 */
  REF(34).value.integer = 1;
  REF(34).tsdr = & dr_integer;
c63:
/* discard 29 */
  (*(REF(29).tsdr)->finalize)(REF(29).value,F_DISCARD,sched);
  REF(29).tsdr = & dr_bottom;
  current->ip = 15;
cb64:
/* call 11 20 34 21 , 11 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(11),
          arguments[1] = DEF(20),
          arguments[2] = DEF(34),
          arguments[3] = DEF(21),
          arguments[3+1] = nil,& arguments[0]),QUAL(11),sched)) != Normal)
     goto ch_raise_exception;
  return;
c65:
/* noop */
  
/* wrap 35 36 , 12 */
  if ((ch_returncode = che_wrap(DEF(35),DEF(36),QUAL(12),sched)) != Normal)
     goto ch_raise_exception;
  current->ip = 17;
cb67:
/* call 21 35 , 13 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(21),
          arguments[1] = DEF(35),
          arguments[1+1] = nil,& arguments[0]),QUAL(13),sched)) != Normal)
     goto ch_raise_exception;
  return;
c68:
/* unwrap 37 35 , 14 */
  if ((ch_returncode = che_unwrap(DEF(37),DEF(35),QUAL(14),sched)) != Normal)
     goto ch_raise_exception;
/* insert 15 37 */
  if ((ch_returncode = insertfunc(DEF(15),DEF(37),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* branch , 19 */
   goto c19;
c71:
/* endget 18 17 */
  end_selector(DEF(18),DEF(17),sched,GET);
/* discard 17 */
  (*(REF(17).tsdr)->finalize)(REF(17).value,F_DISCARD,sched);
  REF(17).tsdr = & dr_bottom;
/* prog_lit 38 , 15 */
  if ((ch_returncode = che_prog_lit(DEF(38),QUAL(15),sched)) != Normal) 
     goto ch_raise_exception;
/* create 39 38 , 16 */
  if ((ch_returncode = che_create(DEF(39),DEF(38),QUAL(16),sched)) != Normal)
     goto ch_raise_exception;
/* discard 38 */
  (*(REF(38).tsdr)->finalize)(REF(38).value,F_DISCARD,sched);
  REF(38).tsdr = & dr_bottom;
  current->ip = 20;
cb76:
/* call 39 15 3.2 40 , 17 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(39),
          arguments[1] = DEF(15),
          arguments[2] = DEF(3)DOT(2),
          arguments[3] = DEF(40),
          arguments[3+1] = nil,& arguments[0]),QUAL(17),sched)) != Normal)
     goto ch_raise_exception;
  return;
c77:
/* move 3.2 40 */
  (*(REF(3)DOT(2).tsdr)->finalize)(REF(3)DOT(2).value,F_DISCARD,sched);
  REF(3)DOT(2) = REF(40);
  REF(40).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);
c81:
/* endprocess */
  che_endprocess(sched); return;
#include "chtail.h"
