#include "chdecl.h"
void CH_codegen_cgposofelt(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 cb12;
    case 4: goto c13;
    case 5: goto cb14;
    case 6: goto c15;
    case 7: goto c32;  }
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:
/* noop */
  
/* lookup_at 4 3.0.2 =(1) */
  if (1 >= (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,1);
  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];
/* find 6 3.2.6.0 5.0 , 0 */
  if (findfunc(DEF(6),DEF(3)DOT(2)DOT(6)DOT(0),(
          arguments[0] = DEF(5)DOT(0),& arguments[0]),sched,0) == FAILURE)
             goto ch_notfound;
/* new_record 7 , 3 */
  if ((ch_val.record = new_record(3)) == nil) goto ch_depletion;
  (*(REF(7).tsdr)->finalize)(REF(7).value,F_DISCARD,sched);
  REF(7).value = ch_val; REF(7).tsdr = & dr_record;
/* new_table 7.1 , 1 */
  if ((ch_returncode = che_new_table(DEF(7)DOT(1),QUAL(1),sched)) != Normal) 
     goto ch_raise_exception;
/* lookup_at 8 3.0.2 =(0) */
  if ( !((ch_t = REF(3)DOT(0)DOT(2).value.table)->size) ) goto ch_notfound;
  (*(REF(8).tsdr)->finalize)(REF(8).value,F_DISCARD,sched);
  (*(ch_t->tbls[ORDER_TBL].des->lookup_at))
    (ch_t, ORDER_TBL, & REF(8).value,0);
  REF(8).tsdr = qdatarepmap[ch_t->tsdr->number];
/* copy 9 8 */
  if((ch_returncode = (REF(8).tsdr->copy)(& ch_val, REF(8).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(9).tsdr)->finalize)(REF(9).value,F_DISCARD,sched);
  REF(9).value = ch_val;
  REF(9).tsdr = datarepmap[REF(8).tsdr->number];
  current->ip = 3;
cb12:
/* call 3.2.4.4 9 10 , 2 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(2)DOT(4)DOT(4),
          arguments[1] = DEF(9),
          arguments[2] = DEF(10),
          arguments[2+1] = nil,& arguments[0]),QUAL(2),sched)) != Normal)
     goto ch_raise_exception;
  return;
c13:
/* insert 7.1 10 */
  if ((ch_returncode = insertfunc(DEF(7)DOT(1),DEF(10),FALSE,0)) != Normal)
     goto ch_raise_exception;
  current->ip = 5;
cb14:
/* call 3.2.4.4 5 11 , 2 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(2)DOT(4)DOT(4),
          arguments[1] = DEF(5),
          arguments[2] = DEF(11),
          arguments[2+1] = nil,& arguments[0]),QUAL(2),sched)) != Normal)
     goto ch_raise_exception;
  return;
c15:
/* insert 7.1 11 */
  if ((ch_returncode = insertfunc(DEF(7)DOT(1),DEF(11),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* notequal . 6.2 =(0) , 22 */
  if ( REF(6)DOT(2).value.enumeration != 0 ) goto c22;
/* enum_lit 7.0 , 66 */
  REF(7)DOT(0).value.enumeration = 66;
  REF(7)DOT(0).tsdr = & dr_enumeration;
/* branch , 26 */
   goto c26;
c22:
/* enum_lit 7.0 , 67 */
  REF(7)DOT(0).value.enumeration = 67;
  REF(7)DOT(0).tsdr = & dr_enumeration;
/* copy 12 6.1 */
  if((ch_returncode = (REF(6)DOT(1).tsdr->copy)(& ch_val, REF(6)DOT(1).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(12).tsdr)->finalize)(REF(12).value,F_DISCARD,sched);
  REF(12).value = ch_val;
  REF(12).tsdr = datarepmap[REF(6)DOT(1).tsdr->number];
/* insert 7.1 12 */
  if ((ch_returncode = insertfunc(DEF(7)DOT(1),DEF(12),FALSE,0)) != Normal)
     goto ch_raise_exception;
c26:
/* unite 7.2 13 , 0 */
  if ((ch_returncode = che_unite(DEF(7)DOT(2),DEF(13),sched,0)) != Normal)
     goto ch_raise_exception;
/* insert 3.2.4.3.1 7 */
  if ((ch_returncode = insertfunc(DEF(3)DOT(2)DOT(4)DOT(3)DOT(1),DEF(7)
    ,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);
c32:
/* endprocess */
  che_endprocess(sched); return;
#include "chtail.h"
