#include "chdecl.h"
void CH_codegen_cgprocinit(current, sched, cop)
#define ARGUMENTS 15
#include "chhead.h"
select: switch (SELECTOR) {
    case 0: goto c0;
    case 1: goto cb2;
    case 2: goto c3;
    case 3: goto c15;
    case 4: goto c21;
    case 5: goto cb38;
    case 6: goto c39;
    case 7: goto cb43;
    case 9: goto c45;
    case 8: goto c47;
    case 10: goto c47;
    case 11: goto c48;
    case 12: goto c50;
    case 13: goto c53;
    case 14: goto c55;  }
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:
/* new_record 3.1.4 , 10 */
  if ((ch_val.record = new_record(10)) == nil) goto ch_depletion;
  (*(REF(3)DOT(1)DOT(4).tsdr)->finalize)(REF(3)DOT(1)DOT(4).value
    ,F_DISCARD,sched);
  REF(3)DOT(1)DOT(4).value = ch_val; REF(3)DOT(1)DOT(4).tsdr = & dr_record;
/* copy 3.1.4.0 3.0 */
  if((ch_returncode = (REF(3)DOT(0).tsdr->copy)(& ch_val, REF(3)DOT(0).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(3)DOT(1)DOT(4)DOT(0).tsdr)->finalize)(REF(3)DOT(1)DOT(4)DOT(0).value
    ,F_DISCARD,sched);
  REF(3)DOT(1)DOT(4)DOT(0).value = ch_val;
  REF(3)DOT(1)DOT(4)DOT(0).tsdr = datarepmap[REF(3)DOT(0).tsdr->number];
/* block , 2 */
  if((ch_returncode = che_block(QUAL(2),sched)) != Normal)
     goto ch_raise_exception;
/* chs_lit 4 , "Coercions" */
  if( !chs_lit(DEF(4),"Coercions") ) goto ch_depletion;
/* find 5 3.1.0.2 4 , 0 */
  if (findfunc(DEF(5),DEF(3)DOT(1)DOT(0)DOT(2),(
          arguments[0] = DEF(4),& arguments[0]),sched,0) == FAILURE)
             goto ch_notfound;
/* copy 6 5.1 */
  if((ch_returncode = cp_polymorph(& ch_val, REF(5)DOT(1).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(6).tsdr)->finalize)(REF(6).value,F_DISCARD,sched);
  REF(6).value = ch_val;
  REF(6).tsdr = & dr_polymorph;
/* unwrap 7 6 , 3 */
  if ((ch_returncode = che_unwrap(DEF(7),DEF(6),QUAL(3),sched)) != Normal)
     goto ch_raise_exception;
/* find 8 7 3.0.0 , 0 */
  if (findfunc(DEF(8),DEF(7),(
          arguments[0] = DEF(3)DOT(0)DOT(0),& arguments[0]),sched,0
            ) == FAILURE) goto ch_notfound;
/* copy 3.1.4.1 8 */
  if((ch_returncode = cp_record(& ch_val, REF(8).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(3)DOT(1)DOT(4)DOT(1).tsdr)->finalize)(REF(3)DOT(1)DOT(4)DOT(1).value
    ,F_DISCARD,sched);
  REF(3)DOT(1)DOT(4)DOT(1).value = ch_val;
  REF(3)DOT(1)DOT(4)DOT(1).tsdr = & dr_record;
/* endblock */
  che_endblock(sched);
/* branch , 21 */
   goto c21;
c15:
/* discard 7 */
  (*(REF(7).tsdr)->finalize)(REF(7).value,F_DISCARD,sched);
  REF(7).tsdr = & dr_bottom;
/* new_record 3.1.4.1 , 4 */
  if ((ch_val.record = new_record(4)) == nil) goto ch_depletion;
  (*(REF(3)DOT(1)DOT(4)DOT(1).tsdr)->finalize)(REF(3)DOT(1)DOT(4)DOT(1).value
    ,F_DISCARD,sched);
  REF(3)DOT(1)DOT(4)DOT(1).value = ch_val; REF(3)DOT(1)DOT(4)DOT(1).tsdr
     = & dr_record;
/* copy 3.1.4.1.0 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(3)DOT(1)DOT(4)DOT(1)DOT(0).tsdr)->finalize)(
    REF(3)DOT(1)DOT(4)DOT(1)DOT(0).value,F_DISCARD,sched);
  REF(3)DOT(1)DOT(4)DOT(1)DOT(0).value = ch_val;
  REF(3)DOT(1)DOT(4)DOT(1)DOT(0).tsdr = datarepmap[REF(3)DOT(0)DOT(0).tsdr
    ->number];
/* new_table 3.1.4.1.1 , 4 */
  if ((ch_returncode = che_new_table(DEF(3)DOT(1)DOT(4)DOT(1)DOT(1),QUAL(4)
    ,sched)) != Normal)  goto ch_raise_exception;
/* new_table 3.1.4.1.2 , 4 */
  if ((ch_returncode = che_new_table(DEF(3)DOT(1)DOT(4)DOT(1)DOT(2),QUAL(4)
    ,sched)) != Normal)  goto ch_raise_exception;
/* new_table 3.1.4.1.3 , 4 */
  if ((ch_returncode = che_new_table(DEF(3)DOT(1)DOT(4)DOT(1)DOT(3),QUAL(4)
    ,sched)) != Normal)  goto ch_raise_exception;
c21:
/* discard 7 */
  (*(REF(7).tsdr)->finalize)(REF(7).value,F_DISCARD,sched);
  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;
/* unique 9.0 */
  if ((ch_returncode = che_unique(DEF(9)DOT(0),sched)) != Normal)
     goto ch_raise_exception;
/* new_table 9.1 , 5 */
  if ((ch_returncode = che_new_table(DEF(9)DOT(1),QUAL(5),sched)) != Normal) 
     goto ch_raise_exception;
/* unite 9.2 10 , 6 */
  if ((ch_returncode = che_unite(DEF(9)DOT(2),DEF(10),sched,6)) != Normal)
     goto ch_raise_exception;
/* new_record 11 , 4 */
  if ((ch_val.record = new_record(4)) == nil) goto ch_depletion;
  (*(REF(11).tsdr)->finalize)(REF(11).value,F_DISCARD,sched);
  REF(11).value = ch_val; REF(11).tsdr = & dr_record;
/* new_table 11.0 , 4 */
  if ((ch_returncode = che_new_table(DEF(11)DOT(0),QUAL(4),sched)) != Normal) 
     goto ch_raise_exception;
/* copy 11.1 9.0 */
  if((ch_returncode = cp_nominal(& ch_val, REF(9)DOT(0).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(11)DOT(1).tsdr)->finalize)(REF(11)DOT(1).value,F_DISCARD,sched);
  REF(11)DOT(1).value = ch_val;
  REF(11)DOT(1).tsdr = & dr_nominal;
/* new_table 11.2 , 5 */
  if ((ch_returncode = che_new_table(DEF(11)DOT(2),QUAL(5),sched)) != Normal) 
     goto ch_raise_exception;
/* ilit 11.3 , 0 */
  REF(11)DOT(3).value.integer = 0;
  REF(11)DOT(3).tsdr = & dr_integer;
/* move 3.1.4.2 11 */
  (*(REF(3)DOT(1)DOT(4)DOT(2).tsdr)->finalize)(REF(3)DOT(1)DOT(4)DOT(2).value
    ,F_DISCARD,sched);
  REF(3)DOT(1)DOT(4)DOT(2) = REF(11);
  REF(11).tsdr = & dr_bottom;
/* move 3.1.4.3 9 */
  (*(REF(3)DOT(1)DOT(4)DOT(3).tsdr)->finalize)(REF(3)DOT(1)DOT(4)DOT(3).value
    ,F_DISCARD,sched);
  REF(3)DOT(1)DOT(4)DOT(3) = REF(9);
  REF(9).tsdr = & dr_bottom;
/* prog_lit 12 , 6 */
  if ((ch_returncode = che_prog_lit(DEF(12),QUAL(6),sched)) != Normal) 
     goto ch_raise_exception;
/* create 13 12 , 7 */
  if ((ch_returncode = che_create(DEF(13),DEF(12),QUAL(7),sched)) != Normal)
     goto ch_raise_exception;
/* discard 12 */
  (*(REF(12).tsdr)->finalize)(REF(12).value,F_DISCARD,sched);
  REF(12).tsdr = & dr_bottom;
  current->ip = 5;
cb38:
/* call 13 3.1.0 3.0 3.1.3.15 3.1.3.8 3.1.3.6 3.1.4.4 3.1.4.5 3.1.4.6 3.1.4.7 3.1.4.8 3.1.4.9 14 , 8 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(13),
          arguments[1] = DEF(3)DOT(1)DOT(0),
          arguments[2] = DEF(3)DOT(0),
          arguments[3] = DEF(3)DOT(1)DOT(3)DOT(15),
          arguments[4] = DEF(3)DOT(1)DOT(3)DOT(8),
          arguments[5] = DEF(3)DOT(1)DOT(3)DOT(6),
          arguments[6] = DEF(3)DOT(1)DOT(4)DOT(4),
          arguments[7] = DEF(3)DOT(1)DOT(4)DOT(5),
          arguments[8] = DEF(3)DOT(1)DOT(4)DOT(6),
          arguments[9] = DEF(3)DOT(1)DOT(4)DOT(7),
          arguments[10] = DEF(3)DOT(1)DOT(4)DOT(8),
          arguments[11] = DEF(3)DOT(1)DOT(4)DOT(9),
          arguments[12] = DEF(14),
          arguments[12+1] = nil,& arguments[0]),QUAL(8),sched)) != Normal)
     goto ch_raise_exception;
  return;
c39:
/* new_inport 15 */
  if ((ch_val.inport = make_inport()) == nil) goto ch_depletion;
  (*(REF(15).tsdr)->finalize)(REF(15).value,F_DISCARD,sched);
  REF(15).value = ch_val; REF(15).tsdr = & dr_inport;
/* connect 3.2 15 */
  if (REF(15).value.inport->refcount == MAXCOUNTER) goto ch_depletion;
  (*(REF(3)DOT(2).tsdr)->finalize)(REF(3)DOT(2).value,F_DISCARD,sched);
  REF(15).value.inport->refcount++;
  REF(3)DOT(2).value.outport = REF(15).value.inport;
  REF(3)DOT(2).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;
  current->ip = 7;
cb43:
/* select 15 * , 9 */
  if ((ch_returncode = che_select((
          arguments[0] = DEF(15),
          arguments[1] = NO_OBJECT,
          arguments[1+1] = nil,& arguments[0]),QUAL(9),sched)) != Normal)
     goto ch_raise_exception;
  if (current->ip == 7) return; else COMPUTE_TARGET;
c45:
/* send 14 10 */
  if ((ch_returncode = che_send(DEF(14),DEF(10),sched)) != Normal)
     goto ch_raise_exception;
/* branch , 48 */
   goto c48;
c44:
c47:
/* exit , 10 */
  ch_e = handler_type__exit; ch_val = QUAL(10); goto ch_exception;
c48:
/* endblock */
  che_endblock(sched);
/* branch , 53 */
   goto c53;
c50:
/* chs_lit 16 , "CantHappen exit taken in cgprocinit" */
  if( !chs_lit(DEF(16),"CantHappen exit taken in cgprocinit") )
     goto ch_depletion;
/* print 16 */
  re_print(stderr, 0, DEF(16)); fflush(stderr);
/* discard 16 */
  (*(REF(16).tsdr)->finalize)(REF(16).value,F_DISCARD,sched);
  REF(16).tsdr = & dr_bottom;
c53:
/* endblock */
  che_endblock(sched);
c55:
/* endprocess */
  che_endprocess(sched); return;
#include "chtail.h"
