#include "chdecl.h"
void CH_codegen_cgforinsp(current, sched, cop)
#define ARGUMENTS 10
#include "chhead.h"
select: switch (SELECTOR) {
    case 0: goto c0;
    case 1: goto cb1;
    case 2: goto c2;
    case 3: goto cb7;
    case 4: goto c9;
    case 5: goto cb9;
    case 6: goto c10;
    case 7: goto cb22;
    case 8: goto c23;
    case 9: goto cb24;
    case 10: goto c26;
    case 11: goto cb26;
    case 12: goto c27;
    case 13: goto cb33;
    case 14: goto c34;
    case 15: goto cb43;
    case 16: goto c44;
    case 17: goto cb45;
    case 18: goto c46;
    case 19: goto cb49;
    case 20: goto c50;
    case 21: goto c58;  }
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:
/* reveal 3.0.3 , 9 */
  if (9 != REF(3)DOT(0)DOT(3).value.variant->info.variant_case)
     goto ch_case_error;
/* lookup_at 4 3.0.2 =(0) */
  if ( !((ch_t = REF(3)DOT(0)DOT(2).value.table)->size) ) goto ch_notfound;
  (*(REF(4).tsdr)->finalize)(REF(4).value,F_DISCARD,sched);
  (*(ch_t->tbls[ORDER_TBL].des->lookup_at))
    (ch_t, ORDER_TBL, & REF(4).value,0);
  REF(4).tsdr = qdatarepmap[ch_t->tsdr->number];
/* copy 5 4 */
  if((ch_returncode = (REF(4).tsdr->copy)(& ch_val, REF(4).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(5).tsdr)->finalize)(REF(5).value,F_DISCARD,sched);
  REF(5).value = ch_val;
  REF(5).tsdr = datarepmap[REF(4).tsdr->number];
  current->ip = 3;
cb7:
/* call 3.2.4.4 5 6 , 1 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(2)DOT(4)DOT(4),
          arguments[1] = DEF(5),
          arguments[2] = DEF(6),
          arguments[2+1] = nil,& arguments[0]),QUAL(1),sched)) != Normal)
     goto ch_raise_exception;
  return;
c8:
c9:
  current->ip = 5;
cb9:
/* call 3.2.4.7 7 , 2 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(2)DOT(4)DOT(7),
          arguments[1] = DEF(7),
          arguments[1+1] = nil,& arguments[0]),QUAL(2),sched)) != Normal)
     goto ch_raise_exception;
  return;
c10:
/* move 8 7 */
  (*(REF(8).tsdr)->finalize)(REF(8).value,F_DISCARD,sched);
  REF(8) = REF(7);
  REF(7).tsdr = & dr_bottom;
/* new_record 9 , 3 */
  if ((ch_val.record = new_record(3)) == nil) goto ch_depletion;
  (*(REF(9).tsdr)->finalize)(REF(9).value,F_DISCARD,sched);
  REF(9).value = ch_val; REF(9).tsdr = & dr_record;
/* enum_lit 9.0 , 1 */
  REF(9)DOT(0).value.enumeration = 1;
  REF(9)DOT(0).tsdr = & dr_enumeration;
/* new_table 9.1 , 3 */
  if ((ch_returncode = che_new_table(DEF(9)DOT(1),QUAL(3),sched)) != Normal) 
     goto ch_raise_exception;
/* copy 10 8 */
  if((ch_returncode = (REF(8).tsdr->copy)(& 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 = datarepmap[REF(8).tsdr->number];
/* insert 9.1 10 */
  if ((ch_returncode = insertfunc(DEF(9)DOT(1),DEF(10),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* copy 11 6 */
  if((ch_returncode = (REF(6).tsdr->copy)(& ch_val, REF(6).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(11).tsdr)->finalize)(REF(11).value,F_DISCARD,sched);
  REF(11).value = ch_val;
  REF(11).tsdr = datarepmap[REF(6).tsdr->number];
/* insert 9.1 11 */
  if ((ch_returncode = insertfunc(DEF(9)DOT(1),DEF(11),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* unite 9.2 12 , 0 */
  if ((ch_returncode = che_unite(DEF(9)DOT(2),DEF(12),sched,0)) != Normal)
     goto ch_raise_exception;
/* insert 3.2.4.3.1 9 */
  if ((ch_returncode = insertfunc(DEF(3)DOT(2)DOT(4)DOT(3)DOT(1),DEF(9)
    ,FALSE,0)) != Normal) goto ch_raise_exception;
  current->ip = 7;
cb22:
/* call 3.2.4.6 5 13 , 4 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(2)DOT(4)DOT(6),
          arguments[1] = DEF(5),
          arguments[2] = DEF(13),
          arguments[2+1] = nil,& arguments[0]),QUAL(4),sched)) != Normal)
     goto ch_raise_exception;
  return;
c23:
/* enum_lit 14 , 0 */
  REF(14).value.enumeration = 0;
  REF(14).tsdr = & dr_enumeration;
  current->ip = 9;
cb24:
/* call 3.2.3.10 3.0.3.0.2 3.2 13 14 15 8 16 , 5 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(2)DOT(3)DOT(10),
          arguments[1] = DEF(3)DOT(0)DOT(3)DOT(0)DOT(2),
          arguments[2] = DEF(3)DOT(2),
          arguments[3] = DEF(13),
          arguments[4] = DEF(14),
          arguments[5] = DEF(15),
          arguments[6] = DEF(8),
          arguments[7] = DEF(16),
          arguments[7+1] = nil,& arguments[0]),QUAL(5),sched)) != Normal)
     goto ch_raise_exception;
  return;
c25:
c26:
  current->ip = 11;
cb26:
/* call 3.2.4.5 3.0.3.0.2.1 3.0.3.0.2.0 17 , 6 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(2)DOT(4)DOT(5),
          arguments[1] = DEF(3)DOT(0)DOT(3)DOT(0)DOT(2)DOT(1),
          arguments[2] = DEF(3)DOT(0)DOT(3)DOT(0)DOT(2)DOT(0),
          arguments[3] = DEF(17),
          arguments[3+1] = nil,& arguments[0]),QUAL(6),sched)) != Normal)
     goto ch_raise_exception;
  return;
c27:
/* move 18 17 */
  (*(REF(18).tsdr)->finalize)(REF(18).value,F_DISCARD,sched);
  REF(18) = REF(17);
  REF(17).tsdr = & dr_bottom;
/* new_record 19 , 2 */
  if ((ch_val.record = new_record(2)) == nil) goto ch_depletion;
  (*(REF(19).tsdr)->finalize)(REF(19).value,F_DISCARD,sched);
  REF(19).value = ch_val; REF(19).tsdr = & dr_record;
/* new_record 19.0 , 2 */
  if ((ch_val.record = new_record(2)) == nil) goto ch_depletion;
  (*(REF(19)DOT(0).tsdr)->finalize)(REF(19)DOT(0).value,F_DISCARD,sched);
  REF(19)DOT(0).value = ch_val; REF(19)DOT(0).tsdr = & dr_record;
/* copy 19.0.1 3.0.3.0.1 */
  if((ch_returncode = (REF(3)DOT(0)DOT(3)DOT(0)DOT(1).tsdr->copy)(& ch_val, 
    REF(3)DOT(0)DOT(3)DOT(0)DOT(1).value)) != Normal) goto ch_raise_exception;
  (*(REF(19)DOT(0)DOT(1).tsdr)->finalize)(REF(19)DOT(0)DOT(1).value
    ,F_DISCARD,sched);
  REF(19)DOT(0)DOT(1).value = ch_val;
  REF(19)DOT(0)DOT(1).tsdr = datarepmap[REF(3)DOT(0)DOT(3)DOT(0)DOT(1).tsdr
    ->number];
/* copy 19.0.0 3.0.3.0.0 */
  if((ch_returncode = (REF(3)DOT(0)DOT(3)DOT(0)DOT(0).tsdr->copy)(& ch_val, 
    REF(3)DOT(0)DOT(3)DOT(0)DOT(0).value)) != Normal) goto ch_raise_exception;
  (*(REF(19)DOT(0)DOT(0).tsdr)->finalize)(REF(19)DOT(0)DOT(0).value
    ,F_DISCARD,sched);
  REF(19)DOT(0)DOT(0).value = ch_val;
  REF(19)DOT(0)DOT(0).tsdr = datarepmap[REF(3)DOT(0)DOT(3)DOT(0)DOT(0).tsdr
    ->number];
/* new_table 19.1 , 3 */
  if ((ch_returncode = che_new_table(DEF(19)DOT(1),QUAL(3),sched)) != Normal) 
     goto ch_raise_exception;
  current->ip = 13;
cb33:
/* call 3.2.4.8 19 18 , 7 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(2)DOT(4)DOT(8),
          arguments[1] = DEF(19),
          arguments[2] = DEF(18),
          arguments[2+1] = nil,& arguments[0]),QUAL(7),sched)) != Normal)
     goto ch_raise_exception;
  return;
c34:
/* 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.1 3.0.3.0.2.1 */
  if((ch_returncode = (REF(3)DOT(0)DOT(3)DOT(0)DOT(2)DOT(1).tsdr->copy)
    (& ch_val, REF(3)DOT(0)DOT(3)DOT(0)DOT(2)DOT(1).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(3)DOT(0)DOT(3)DOT(0)DOT(2)DOT(1).tsdr
    ->number];
/* copy 20.0 3.0.3.0.2.0 */
  if((ch_returncode = (REF(3)DOT(0)DOT(3)DOT(0)DOT(2)DOT(0).tsdr->copy)
    (& ch_val, REF(3)DOT(0)DOT(3)DOT(0)DOT(2)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(0)DOT(3)DOT(0)DOT(2)DOT(0).tsdr
    ->number];
/* find 21 3.2.6.0 20 , 0 */
  if (findfunc(DEF(21),DEF(3)DOT(2)DOT(6)DOT(0),(
          arguments[0] = DEF(20),& arguments[0]),sched,0) == FAILURE)
             goto ch_notfound;
/* copy 22 21 */
  if((ch_returncode = (REF(21).tsdr->copy)(& ch_val, REF(21).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(22).tsdr)->finalize)(REF(22).value,F_DISCARD,sched);
  REF(22).value = ch_val;
  REF(22).tsdr = datarepmap[REF(21).tsdr->number];
/* copy 22.0 19.0 */
  if((ch_returncode = cp_record(& ch_val, REF(19)DOT(0).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(22)DOT(0).tsdr)->finalize)(REF(22)DOT(0).value,F_DISCARD,sched);
  REF(22)DOT(0).value = ch_val;
  REF(22)DOT(0).tsdr = & dr_record;
/* insert 3.2.6.0 22 */
  if ((ch_returncode = insertfunc(DEF(3)DOT(2)DOT(6)DOT(0),DEF(22)
    ,FALSE,0)) != Normal) goto ch_raise_exception;
/* find 23 3.2.4.0.1.0 3.0.3.0.0 , 0 */
  if (findfunc(DEF(23),DEF(3)DOT(2)DOT(4)DOT(0)DOT(1)DOT(0),(
          arguments[0] = DEF(3)DOT(0)DOT(3)DOT(0)DOT(0),& arguments[0]),sched,0
            ) == FAILURE) goto ch_notfound;
  current->ip = 15;
cb43:
/* call 3.2.3.2 23.2 3.2 , 8 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(2)DOT(3)DOT(2),
          arguments[1] = DEF(23)DOT(2),
          arguments[2] = DEF(3)DOT(2),
          arguments[2+1] = nil,& arguments[0]),QUAL(8),sched)) != Normal)
     goto ch_raise_exception;
  return;
c44:
/* new_table 24 , 3 */
  if ((ch_returncode = che_new_table(DEF(24),QUAL(3),sched)) != Normal) 
     goto ch_raise_exception;
  current->ip = 17;
cb45:
/* call 3.2.4.8 19 24 , 7 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(2)DOT(4)DOT(8),
          arguments[1] = DEF(19),
          arguments[2] = DEF(24),
          arguments[2+1] = nil,& arguments[0]),QUAL(7),sched)) != Normal)
     goto ch_raise_exception;
  return;
c46:
/* privatize 3.2.6.0 */
  if (REF(3)DOT(2)DOT(6)DOT(0).value.table->refcount != 1)
    if ((ch_returncode = doCopyOnWrite(DEF(3)DOT(2)DOT(6)DOT(0))) != Normal)
       goto ch_raise_exception;
/* find 25 3.2.6.0 19.0 , 0 */
  if (findfunc(DEF(25),DEF(3)DOT(2)DOT(6)DOT(0),(
          arguments[0] = DEF(19)DOT(0),& arguments[0]),sched,0) == FAILURE)
             goto ch_notfound;
/* fremove 26 25 3.2.6.0 , 0 */
  if ((ch_returncode = removefunc(DEF(26),DEF(25),DEF(3)DOT(2)DOT(6)DOT(0)
    ,sched,0,NO_TBL,(position *) nil)) != Normal) goto ch_raise_exception;
  current->ip = 19;
cb49:
/* call 16 3.2 , 9 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(16),
          arguments[1] = DEF(3)DOT(2),
          arguments[1+1] = nil,& arguments[0]),QUAL(9),sched)) != Normal)
     goto ch_raise_exception;
  return;
c50:
/* copy 27 3.2.5.5 */
  if((ch_returncode = (REF(3)DOT(2)DOT(5)DOT(5).tsdr->copy)(& ch_val, 
    REF(3)DOT(2)DOT(5)DOT(5).value)) != Normal) goto ch_raise_exception;
  (*(REF(27).tsdr)->finalize)(REF(27).value,F_DISCARD,sched);
  REF(27).value = ch_val;
  REF(27).tsdr = datarepmap[REF(3)DOT(2)DOT(5)DOT(5).tsdr->number];
/* insert 27.1 8 */
  if ((ch_returncode = insertfunc(DEF(27)DOT(1),DEF(8),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* insert 3.2.4.3.1 27 */
  if ((ch_returncode = insertfunc(DEF(3)DOT(2)DOT(4)DOT(3)DOT(1),DEF(27)
    ,FALSE,0)) != Normal) goto ch_raise_exception;
/* 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);
c58:
/* endprocess */
  che_endprocess(sched); return;
#include "chtail.h"
