#include "chdecl.h"
void CH_codegen_compoffsets(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 c13;
    case 4: goto cb13;
    case 6: goto cb15;
    case 7: goto c16;
    case 8: goto c19;
    case 9: goto cb27;
    case 10: goto c28;
    case 11: goto c35;
    case 12: goto c49;
    case 13: goto c53;
    case 14: goto c70;
    case 15: goto c72;
    case 16: goto c74;
    case 17: goto c78;
    case 5: goto c80;
    case 18: goto c80;
    case 19: goto c82;
    case 20: goto c85;
    case 21: goto c88;
    case 22: goto c90;  }
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:
/* copy 4 3.0.0 */
  if((ch_returncode = (REF(3)DOT(0)DOT(0).tsdr->copy)(& ch_val, 
    REF(3)DOT(0)DOT(0).value)) != Normal) goto ch_raise_exception;
  (*(REF(4).tsdr)->finalize)(REF(4).value,F_DISCARD,sched);
  REF(4).value = ch_val;
  REF(4).tsdr = datarepmap[REF(3)DOT(0)DOT(0).tsdr->number];
/* copy 5 3.1 */
  if((ch_returncode = cp_outport(& 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_outport;
/* new_inport 6 */
  if ((ch_val.inport = make_inport()) == nil) goto ch_depletion;
  (*(REF(6).tsdr)->finalize)(REF(6).value,F_DISCARD,sched);
  REF(6).value = ch_val; REF(6).tsdr = & dr_inport;
/* connect 3.2 6 */
  if (REF(6).value.inport->refcount == MAXCOUNTER) goto ch_depletion;
  (*(REF(3)DOT(2).tsdr)->finalize)(REF(3)DOT(2).value,F_DISCARD,sched);
  REF(6).value.inport->refcount++;
  REF(3)DOT(2).value.outport = REF(6).value.inport;
  REF(3)DOT(2).tsdr = & dr_outport;
/* new_inport 7 */
  if ((ch_val.inport = make_inport()) == nil) goto ch_depletion;
  (*(REF(7).tsdr)->finalize)(REF(7).value,F_DISCARD,sched);
  REF(7).value = ch_val; REF(7).tsdr = & dr_inport;
/* connect 3.3 7 */
  if (REF(7).value.inport->refcount == MAXCOUNTER) goto ch_depletion;
  (*(REF(3)DOT(3).tsdr)->finalize)(REF(3)DOT(3).value,F_DISCARD,sched);
  REF(7).value.inport->refcount++;
  REF(3)DOT(3).value.outport = REF(7).value.inport;
  REF(3)DOT(3).tsdr = & dr_outport;
/* 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;
/* new_table 8 , 2 */
  if ((ch_returncode = che_new_table(DEF(8),QUAL(2),sched)) != Normal) 
     goto ch_raise_exception;
c11:
/* noop */
  
c13:
  current->ip = 4;
cb13:
/* select 6 * 7 * , 3 */
  if ((ch_returncode = che_select((
          arguments[0] = DEF(6),
          arguments[1] = NO_OBJECT,
          arguments[2] = DEF(7),
          arguments[3] = NO_OBJECT,
          arguments[3+1] = nil,& arguments[0]),QUAL(3),sched)) != Normal)
     goto ch_raise_exception;
  if (current->ip == 4) return; else COMPUTE_TARGET;
c15:
  current->ip = 6;
cb15:
/* receive 9 6 */
  if ((ch_returncode = che_receive(DEF(9),DEF(6),sched)) != Normal)
     goto ch_raise_exception;
  return;
c16:
/* new_table 9.2 , 4 */
  if ((ch_returncode = che_new_table(DEF(9)DOT(2),QUAL(4),sched)) != Normal) 
     goto ch_raise_exception;
/* copy 10 9.1 */
  if((ch_returncode = cp_table(& ch_val, REF(9)DOT(1).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;
c19:
/* get_or_goto 11 10 , 74 */
  if ((ch_returncode = get_selected_object(DEF(11),DEF(10),sched)) != Normal)
     goto c74;
/* block , 5 */
  if((ch_returncode = che_block(QUAL(5),sched)) != Normal)
     goto ch_raise_exception;
/* find 12 8 9.0 11 , 0 */
  if (findfunc(DEF(12),DEF(8),(
          arguments[0] = DEF(9)DOT(0),
          arguments[1] = DEF(11),& arguments[0]),sched,0) == FAILURE)
             goto ch_notfound;
/* copy 9.0 12.3 */
  if((ch_returncode = (REF(12)DOT(3).tsdr->copy)(& ch_val, REF(12)DOT(3).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(9)DOT(0).tsdr)->finalize)(REF(9)DOT(0).value,F_DISCARD,sched);
  REF(9)DOT(0).value = ch_val;
  REF(9)DOT(0).tsdr = datarepmap[REF(12)DOT(3).tsdr->number];
/* copy 13 12.2 */
  if((ch_returncode = (REF(12)DOT(2).tsdr->copy)(& ch_val, REF(12)DOT(2).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)DOT(2).tsdr->number];
/* insert 9.2 13 */
  if ((ch_returncode = insertfunc(DEF(9)DOT(2),DEF(13),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* endblock */
  che_endblock(sched);
/* branch , 72 */
   goto c72;
c27:
  current->ip = 9;
cb27:
/* call 5 9.0 14 , 6 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(5),
          arguments[1] = DEF(9)DOT(0),
          arguments[2] = DEF(14),
          arguments[2+1] = nil,& arguments[0]),QUAL(6),sched)) != Normal)
     goto ch_raise_exception;
  return;
c28:
/* noop */
  
/* ord_case 15 14.2 */
  REF(15).value.ord_enum = REF(14)DOT(2).value.variant->info.variant_case;
  REF(15).tsdr = & dr_ord_enumeration;
/* notequal . 15 =(6) , 49 */
  if ( REF(15).value.ord_enum != 6 ) goto c49;
/* copy 16 14.1 */
  if((ch_returncode = cp_table(& ch_val, REF(14)DOT(1).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(16).tsdr)->finalize)(REF(16).value,F_DISCARD,sched);
  REF(16).value = ch_val;
  REF(16).tsdr = & dr_table;
/* initget 17 16 , 0,0 */
  (*(REF(17).tsdr)->finalize)(REF(17).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(17),DEF(16),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
c35:
/* get_or_goto 17 16 , 44 */
  if ((ch_returncode = get_selected_object(DEF(17),DEF(16),sched)) != Normal)
     goto c44;
/* new_record 18 , 4 */
  if ((ch_val.record = new_record(4)) == nil) goto ch_depletion;
  (*(REF(18).tsdr)->finalize)(REF(18).value,F_DISCARD,sched);
  REF(18).value = ch_val; REF(18).tsdr = & dr_record;
/* copy 18.0 9.0 */
  if((ch_returncode = (REF(9)DOT(0).tsdr->copy)(& ch_val, REF(9)DOT(0).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(18)DOT(0).tsdr)->finalize)(REF(18)DOT(0).value,F_DISCARD,sched);
  REF(18)DOT(0).value = ch_val;
  REF(18)DOT(0).tsdr = datarepmap[REF(9)DOT(0).tsdr->number];
/* copy 18.1 17.0 */
  if((ch_returncode = (REF(17)DOT(0).tsdr->copy)(& ch_val, REF(17)DOT(0).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(18)DOT(1).tsdr)->finalize)(REF(18)DOT(1).value,F_DISCARD,sched);
  REF(18)DOT(1).value = ch_val;
  REF(18)DOT(1).tsdr = datarepmap[REF(17)DOT(0).tsdr->number];
/* ilit 18.2 , 0 */
  REF(18)DOT(2).value.integer = 0;
  REF(18)DOT(2).tsdr = & dr_integer;
/* copy 18.3 17.1 */
  if((ch_returncode = (REF(17)DOT(1).tsdr->copy)(& ch_val, REF(17)DOT(1).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(18)DOT(3).tsdr)->finalize)(REF(18)DOT(3).value,F_DISCARD,sched);
  REF(18)DOT(3).value = ch_val;
  REF(18)DOT(3).tsdr = datarepmap[REF(17)DOT(1).tsdr->number];
/* insert 8 18 */
  if ((ch_returncode = insertfunc(DEF(8),DEF(18),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* branch , 35 */
   goto c35;
c44:
/* endget 17 16 */
  end_selector(DEF(17),DEF(16),sched,GET);
/* discard 16 */
  (*(REF(16).tsdr)->finalize)(REF(16).value,F_DISCARD,sched);
  REF(16).tsdr = & dr_bottom;
/* ilit 19 , 0 */
  REF(19).value.integer = 0;
  REF(19).tsdr = & dr_integer;
/* insert 9.2 19 */
  if ((ch_returncode = insertfunc(DEF(9)DOT(2),DEF(19),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* branch , 70 */
   goto c70;
c49:
/* ilit 20 , 0 */
  REF(20).value.integer = 0;
  REF(20).tsdr = & dr_integer;
/* copy 21 14.1 */
  if((ch_returncode = cp_table(& ch_val, REF(14)DOT(1).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(21).tsdr)->finalize)(REF(21).value,F_DISCARD,sched);
  REF(21).value = ch_val;
  REF(21).tsdr = & dr_table;
/* initget 22 21 , 0,0 */
  (*(REF(22).tsdr)->finalize)(REF(22).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(22),DEF(21),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
c53:
/* get_or_goto 22 21 , 68 */
  if ((ch_returncode = get_selected_object(DEF(22),DEF(21),sched)) != Normal)
     goto c68;
/* new_record 18 , 4 */
  if ((ch_val.record = new_record(4)) == nil) goto ch_depletion;
  (*(REF(18).tsdr)->finalize)(REF(18).value,F_DISCARD,sched);
  REF(18).value = ch_val; REF(18).tsdr = & dr_record;
/* copy 18.0 9.0 */
  if((ch_returncode = (REF(9)DOT(0).tsdr->copy)(& ch_val, REF(9)DOT(0).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(18)DOT(0).tsdr)->finalize)(REF(18)DOT(0).value,F_DISCARD,sched);
  REF(18)DOT(0).value = ch_val;
  REF(18)DOT(0).tsdr = datarepmap[REF(9)DOT(0).tsdr->number];
/* copy 18.1 22.0 */
  if((ch_returncode = (REF(22)DOT(0).tsdr->copy)(& ch_val, REF(22)DOT(0).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(18)DOT(1).tsdr)->finalize)(REF(18)DOT(1).value,F_DISCARD,sched);
  REF(18)DOT(1).value = ch_val;
  REF(18)DOT(1).tsdr = datarepmap[REF(22)DOT(0).tsdr->number];
/* copy 18.2 20 */
  REF(18)DOT(2) = REF(20);
/* copy 18.3 22.1 */
  if((ch_returncode = (REF(22)DOT(1).tsdr->copy)(& ch_val, REF(22)DOT(1).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(18)DOT(3).tsdr)->finalize)(REF(18)DOT(3).value,F_DISCARD,sched);
  REF(18)DOT(3).value = ch_val;
  REF(18)DOT(3).tsdr = datarepmap[REF(22)DOT(1).tsdr->number];
/* insert 8 18 */
  if ((ch_returncode = insertfunc(DEF(8),DEF(18),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* notequal . 11 22.0 , 64 */
  if ( !(REF(11).tsdr->equal)(REF(11).value,REF(22)DOT(0).value) ) goto c64;
/* copy 23 20 */
  REF(23) = REF(20);
/* insert 9.2 23 */
  if ((ch_returncode = insertfunc(DEF(9)DOT(2),DEF(23),FALSE,0)) != Normal)
     goto ch_raise_exception;
c64:
/* noop */
  
/* iadd 20 20 =(1) */
  if (!chf_iadd(DEF(20),REF(20).value.integer,1)) goto ch_depletion;
/* branch , 53 */
   goto c53;
c68:
/* endget 22 21 */
  end_selector(DEF(22),DEF(21),sched,GET);
/* discard 21 */
  (*(REF(21).tsdr)->finalize)(REF(21).value,F_DISCARD,sched);
  REF(21).tsdr = & dr_bottom;
c70:
/* find 24 14.1 11 , 0 */
  if (findfunc(DEF(24),DEF(14)DOT(1),(
          arguments[0] = DEF(11),& arguments[0]),sched,0) == FAILURE)
             goto ch_notfound;
/* copy 9.0 24.1 */
  if((ch_returncode = (REF(24)DOT(1).tsdr->copy)(& ch_val, REF(24)DOT(1).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(9)DOT(0).tsdr)->finalize)(REF(9)DOT(0).value,F_DISCARD,sched);
  REF(9)DOT(0).value = ch_val;
  REF(9)DOT(0).tsdr = datarepmap[REF(24)DOT(1).tsdr->number];
c72:
/* discard 14 */
  (*(REF(14).tsdr)->finalize)(REF(14).value,F_DISCARD,sched);
  REF(14).tsdr = & dr_bottom;
/* branch , 19 */
   goto c19;
c74:
/* 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;
/* return 9 */
  if (ch_caller = do_return(REF(9).value)) {
    if (ch_caller->type < CProcess) ch_caller->ip++;
      sched->wakeup_proc(sched, ch_caller);}
  else rem_return(REF(9).value);
  REF(9).tsdr = & dr_bottom;
/* branch , 11 */
   goto c11;
c78:
/* exit , 7 */
  ch_e = handler_type__exit; ch_val = QUAL(7); goto ch_exception;
c14:
c80:
/* exit , 8 */
  ch_e = handler_type__exit; ch_val = QUAL(8); goto ch_exception;
c82:
/* endblock */
  che_endblock(sched);
/* branch , 88 */
   goto c88;
c85:
/* chs_lit 25 , "CantHappen exit taken in compoffsets" */
  if( !chs_lit(DEF(25),"CantHappen exit taken in compoffsets") )
     goto ch_depletion;
/* print 25 */
  re_print(stderr, 0, DEF(25)); fflush(stderr);
/* discard 25 */
  (*(REF(25).tsdr)->finalize)(REF(25).value,F_DISCARD,sched);
  REF(25).tsdr = & dr_bottom;
c88:
/* endblock */
  che_endblock(sched);
c90:
/* endprocess */
  che_endprocess(sched); return;
#include "chtail.h"
