#include "chdecl.h"
void CH_codegen_cgblock(current, sched, cop)
#define ARGUMENTS 5
#include "chhead.h"
select: switch (SELECTOR) {
    case 0: goto c0;
    case 1: goto cb1;
    case 2: goto c2;
    case 3: goto cb9;
    case 5: goto c11;
    case 6: goto c21;
    case 7: goto c39;
    case 8: goto c48;
    case 9: goto cb62;
    case 10: goto c63;
    case 11: goto c70;
    case 4: goto c80;
    case 12: goto c80;
    case 13: goto c87;  }
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 , 2 */
  if (2 != REF(3)DOT(0)DOT(3).value.variant->info.variant_case)
     goto ch_case_error;
/* find 4 3.2.4.0.1.0 3.0.3.0.0 , 0 */
  if (findfunc(DEF(4),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;
/* copy 5 4.2 */
  if((ch_returncode = (REF(4)DOT(2).tsdr->copy)(& ch_val, REF(4)DOT(2).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)DOT(2).tsdr->number];
/* size 6 3.0.3.0.2 */
  REF(6).value.integer = REF(3)DOT(0)DOT(3)DOT(0)DOT(2).value.table->size;
  REF(6).tsdr = & dr_integer;
/* notequal . 6 =(0) , 11 */
  if ( REF(6).value.integer != 0 ) goto c11;
  current->ip = 3;
cb9:
/* call 3.2.3.2 5 3.2 , 1 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(2)DOT(3)DOT(2),
          arguments[1] = DEF(5),
          arguments[2] = DEF(3)DOT(2),
          arguments[2+1] = nil,& arguments[0]),QUAL(1),sched)) != Normal)
     goto ch_raise_exception;
  return;
c11:
/* unique 7 */
  if ((ch_returncode = che_unique(DEF(7),sched)) != Normal)
     goto ch_raise_exception;
/* new_table 8 , 2 */
  if ((ch_returncode = che_new_table(DEF(8),QUAL(2),sched)) != Normal) 
     goto ch_raise_exception;
/* new_table 9 , 2 */
  if ((ch_returncode = che_new_table(DEF(9),QUAL(2),sched)) != Normal) 
     goto ch_raise_exception;
/* copy 10 5 */
  if((ch_returncode = (REF(5).tsdr->copy)(& ch_val, REF(5).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(5).tsdr->number];
/* insert 8 10 */
  if ((ch_returncode = insertfunc(DEF(8),DEF(10),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* unique 11 */
  if ((ch_returncode = che_unique(DEF(11),sched)) != Normal)
     goto ch_raise_exception;
/* insert 9 11 */
  if ((ch_returncode = insertfunc(DEF(9),DEF(11),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* copy 12 3.0.3.0.2 */
  if((ch_returncode = cp_table(& ch_val, REF(3)DOT(0)DOT(3)DOT(0)DOT(2).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(12).tsdr)->finalize)(REF(12).value,F_DISCARD,sched);
  REF(12).value = ch_val;
  REF(12).tsdr = & dr_table;
/* initget 13 12 , 0,0 */
  (*(REF(13).tsdr)->finalize)(REF(13).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(13),DEF(12),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
c21:
/* get_or_goto 13 12 , 27 */
  if ((ch_returncode = get_selected_object(DEF(13),DEF(12),sched)) != Normal)
     goto c27;
/* copy 14 13.1 */
  if((ch_returncode = (REF(13)DOT(1).tsdr->copy)(& ch_val, REF(13)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(13)DOT(1).tsdr->number];
/* insert 8 14 */
  if ((ch_returncode = insertfunc(DEF(8),DEF(14),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* unique 15 */
  if ((ch_returncode = che_unique(DEF(15),sched)) != Normal)
     goto ch_raise_exception;
/* insert 9 15 */
  if ((ch_returncode = insertfunc(DEF(9),DEF(15),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* branch , 21 */
   goto c21;
c27:
/* endget 13 12 */
  end_selector(DEF(13),DEF(12),sched,GET);
/* discard 12 */
  (*(REF(12).tsdr)->finalize)(REF(12).value,F_DISCARD,sched);
  REF(12).tsdr = & dr_bottom;
/* new_record 16 , 3 */
  if ((ch_val.record = new_record(3)) == nil) goto ch_depletion;
  (*(REF(16).tsdr)->finalize)(REF(16).value,F_DISCARD,sched);
  REF(16).value = ch_val; REF(16).tsdr = & dr_record;
/* copy 17 9 */
  if((ch_returncode = cp_table(& ch_val, REF(9).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;
/* privatize 17 */
  if (REF(17).value.table->refcount != 1)
    if ((ch_returncode = doCopyOnWrite(DEF(17))) != Normal)
       goto ch_raise_exception;
/* lookup_at 18 17 =(0) */
  if ( !((ch_t = REF(17).value.table)->size) ) goto ch_notfound;
  (*(REF(18).tsdr)->finalize)(REF(18).value,F_DISCARD,sched);
  (*(ch_t->tbls[ORDER_TBL].des->lookup_at))
    (ch_t, ORDER_TBL, & REF(18).value,0);
  REF(18).tsdr = qdatarepmap[ch_t->tsdr->number];
/* remove_at 16.2 17 =(0) */
  if ((ch_returncode = remove_at_func(DEF(16)DOT(2),DEF(17),0)) != Normal)
     goto ch_raise_exception;
/* move 16.1 17 */
  (*(REF(16)DOT(1).tsdr)->finalize)(REF(16)DOT(1).value,F_DISCARD,sched);
  REF(16)DOT(1) = REF(17);
  REF(17).tsdr = & dr_bottom;
/* new_table 16.0 , 2 */
  if ((ch_returncode = che_new_table(DEF(16)DOT(0),QUAL(2),sched)) != Normal) 
     goto ch_raise_exception;
/* copy 19 3.0.3.0.2 */
  if((ch_returncode = cp_table(& ch_val, REF(3)DOT(0)DOT(3)DOT(0)DOT(2).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(19).tsdr)->finalize)(REF(19).value,F_DISCARD,sched);
  REF(19).value = ch_val;
  REF(19).tsdr = & dr_table;
/* initget 20 19 , 0,0 */
  (*(REF(20).tsdr)->finalize)(REF(20).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(20),DEF(19),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
c39:
/* get_or_goto 20 19 , 43 */
  if ((ch_returncode = get_selected_object(DEF(20),DEF(19),sched)) != Normal)
     goto c43;
/* copy 21 20.0 */
  if((ch_returncode = (REF(20)DOT(0).tsdr->copy)(& ch_val, REF(20)DOT(0).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(21).tsdr)->finalize)(REF(21).value,F_DISCARD,sched);
  REF(21).value = ch_val;
  REF(21).tsdr = datarepmap[REF(20)DOT(0).tsdr->number];
/* insert 16.0 21 */
  if ((ch_returncode = insertfunc(DEF(16)DOT(0),DEF(21),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* branch , 39 */
   goto c39;
c43:
/* endget 20 19 */
  end_selector(DEF(20),DEF(19),sched,GET);
/* discard 19 */
  (*(REF(19).tsdr)->finalize)(REF(19).value,F_DISCARD,sched);
  REF(19).tsdr = & dr_bottom;
/* unite 3.2.4.3.2 16 , 4 */
  if ((ch_returncode = che_unite(DEF(3)DOT(2)DOT(4)DOT(3)DOT(2),DEF(16),sched,
    4)) != Normal) goto ch_raise_exception;
/* copy 22 8 */
  if((ch_returncode = cp_table(& ch_val, REF(8).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(22).tsdr)->finalize)(REF(22).value,F_DISCARD,sched);
  REF(22).value = ch_val;
  REF(22).tsdr = & dr_table;
/* initget 23 22 , 0,0 */
  (*(REF(23).tsdr)->finalize)(REF(23).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(23),DEF(22),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
c48:
/* get_or_goto 23 22 , 70 */
  if ((ch_returncode = get_selected_object(DEF(23),DEF(22),sched)) != Normal)
     goto c70;
/* privatize 9 */
  if (REF(9).value.table->refcount != 1)
    if ((ch_returncode = doCopyOnWrite(DEF(9))) != Normal)
       goto ch_raise_exception;
/* lookup_at 24 9 =(0) */
  if ( !((ch_t = REF(9).value.table)->size) ) goto ch_notfound;
  (*(REF(24).tsdr)->finalize)(REF(24).value,F_DISCARD,sched);
  (*(ch_t->tbls[ORDER_TBL].des->lookup_at))
    (ch_t, ORDER_TBL, & REF(24).value,0);
  REF(24).tsdr = qdatarepmap[ch_t->tsdr->number];
/* remove_at 25 9 =(0) */
  if ((ch_returncode = remove_at_func(DEF(25),DEF(9),0)) != Normal)
     goto ch_raise_exception;
/* copy 26 3.2.4.3.0 */
  if((ch_returncode = cp_nominal(& ch_val, 
    REF(3)DOT(2)DOT(4)DOT(3)DOT(0).value)) != Normal) goto ch_raise_exception;
  (*(REF(26).tsdr)->finalize)(REF(26).value,F_DISCARD,sched);
  REF(26).value = ch_val;
  REF(26).tsdr = & dr_nominal;
/* insert 3.2.4.2.2 26 */
  if ((ch_returncode = insertfunc(DEF(3)DOT(2)DOT(4)DOT(2)DOT(2),DEF(26)
    ,FALSE,0)) != Normal) goto ch_raise_exception;
/* insert 3.2.4.2.0 3.2.4.3 */
  if ((ch_returncode = insertfunc(DEF(3)DOT(2)DOT(4)DOT(2)DOT(0),
    DEF(3)DOT(2)DOT(4)DOT(3),FALSE,0)) != Normal) goto ch_raise_exception;
/* new_record 3.2.4.3 , 3 */
  if ((ch_val.record = new_record(3)) == nil) goto ch_depletion;
  (*(REF(3)DOT(2)DOT(4)DOT(3).tsdr)->finalize)(REF(3)DOT(2)DOT(4)DOT(3).value
    ,F_DISCARD,sched);
  REF(3)DOT(2)DOT(4)DOT(3).value = ch_val; REF(3)DOT(2)DOT(4)DOT(3).tsdr
     = & dr_record;
/* move 3.2.4.3.0 25 */
  (*(REF(3)DOT(2)DOT(4)DOT(3)DOT(0).tsdr)->finalize)(
    REF(3)DOT(2)DOT(4)DOT(3)DOT(0).value,F_DISCARD,sched);
  REF(3)DOT(2)DOT(4)DOT(3)DOT(0) = REF(25);
  REF(25).tsdr = & dr_bottom;
/* new_table 3.2.4.3.1 , 2 */
  if ((ch_returncode = che_new_table(DEF(3)DOT(2)DOT(4)DOT(3)DOT(1),QUAL(2)
    ,sched)) != Normal)  goto ch_raise_exception;
/* unite 3.2.4.3.2 27 , 6 */
  if ((ch_returncode = che_unite(DEF(3)DOT(2)DOT(4)DOT(3)DOT(2),DEF(27),sched,
    6)) != Normal) goto ch_raise_exception;
  current->ip = 9;
cb62:
/* call 3.2.3.2 23 3.2 , 1 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(2)DOT(3)DOT(2),
          arguments[1] = DEF(23),
          arguments[2] = DEF(3)DOT(2),
          arguments[2+1] = nil,& arguments[0]),QUAL(1),sched)) != Normal)
     goto ch_raise_exception;
  return;
c63:
/* notequal . 5 23 , 67 */
  if ( !(REF(5).tsdr->equal)(REF(5).value,REF(23).value) ) goto c67;
/* copy 28 3.2.5.3 */
  if((ch_returncode = (REF(3)DOT(2)DOT(5)DOT(3).tsdr->copy)(& ch_val, 
    REF(3)DOT(2)DOT(5)DOT(3).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(3)DOT(2)DOT(5)DOT(3).tsdr->number];
/* insert 3.2.4.3.1 28 */
  if ((ch_returncode = insertfunc(DEF(3)DOT(2)DOT(4)DOT(3)DOT(1),DEF(28)
    ,FALSE,0)) != Normal) goto ch_raise_exception;
c67:
/* copy 29 7 */
  if((ch_returncode = cp_nominal(& ch_val, REF(7).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(29).tsdr)->finalize)(REF(29).value,F_DISCARD,sched);
  REF(29).value = ch_val;
  REF(29).tsdr = & dr_nominal;
/* unite 3.2.4.3.2 29 , 0 */
  if ((ch_returncode = che_unite(DEF(3)DOT(2)DOT(4)DOT(3)DOT(2),DEF(29),sched,
    0)) != Normal) goto ch_raise_exception;
/* branch , 48 */
   goto c48;
c70:
/* endget 23 22 */
  end_selector(DEF(23),DEF(22),sched,GET);
/* discard 22 */
  (*(REF(22).tsdr)->finalize)(REF(22).value,F_DISCARD,sched);
  REF(22).tsdr = & dr_bottom;
/* copy 30 3.2.4.3.0 */
  if((ch_returncode = cp_nominal(& ch_val, 
    REF(3)DOT(2)DOT(4)DOT(3)DOT(0).value)) != Normal) goto ch_raise_exception;
  (*(REF(30).tsdr)->finalize)(REF(30).value,F_DISCARD,sched);
  REF(30).value = ch_val;
  REF(30).tsdr = & dr_nominal;
/* insert 3.2.4.2.2 30 */
  if ((ch_returncode = insertfunc(DEF(3)DOT(2)DOT(4)DOT(2)DOT(2),DEF(30)
    ,FALSE,0)) != Normal) goto ch_raise_exception;
/* insert 3.2.4.2.0 3.2.4.3 */
  if ((ch_returncode = insertfunc(DEF(3)DOT(2)DOT(4)DOT(2)DOT(0),
    DEF(3)DOT(2)DOT(4)DOT(3),FALSE,0)) != Normal) goto ch_raise_exception;
/* new_record 3.2.4.3 , 3 */
  if ((ch_val.record = new_record(3)) == nil) goto ch_depletion;
  (*(REF(3)DOT(2)DOT(4)DOT(3).tsdr)->finalize)(REF(3)DOT(2)DOT(4)DOT(3).value
    ,F_DISCARD,sched);
  REF(3)DOT(2)DOT(4)DOT(3).value = ch_val; REF(3)DOT(2)DOT(4)DOT(3).tsdr
     = & dr_record;
/* move 3.2.4.3.0 7 */
  (*(REF(3)DOT(2)DOT(4)DOT(3)DOT(0).tsdr)->finalize)(
    REF(3)DOT(2)DOT(4)DOT(3)DOT(0).value,F_DISCARD,sched);
  REF(3)DOT(2)DOT(4)DOT(3)DOT(0) = REF(7);
  REF(7).tsdr = & dr_bottom;
/* new_table 3.2.4.3.1 , 2 */
  if ((ch_returncode = che_new_table(DEF(3)DOT(2)DOT(4)DOT(3)DOT(1),QUAL(2)
    ,sched)) != Normal)  goto ch_raise_exception;
/* unite 3.2.4.3.2 27 , 6 */
  if ((ch_returncode = che_unite(DEF(3)DOT(2)DOT(4)DOT(3)DOT(2),DEF(27),sched,
    6)) != Normal) goto ch_raise_exception;
c10:
c80:
/* discard 8 */
  (*(REF(8).tsdr)->finalize)(REF(8).value,F_DISCARD,sched);
  REF(8).tsdr = & dr_bottom;
/* discard 9 */
  (*(REF(9).tsdr)->finalize)(REF(9).value,F_DISCARD,sched);
  REF(9).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);
c87:
/* endprocess */
  che_endprocess(sched); return;
#include "chtail.h"
