#include "chdecl.h"
void CH_checkconstraints_proglit(current, sched, cop)
#define ARGUMENTS 7
#include "chhead.h"
select: switch (SELECTOR) {
    case 0: goto c0;
    case 1: goto cb2;
    case 2: goto c3;
    case 3: goto c5;
    case 4: goto cb22;
    case 5: goto c23;
    case 6: goto c27;
    case 7: goto c29;
    case 8: goto c32;
    case 9: goto c37;
    case 10: goto c42;
    case 11: goto c48;
    case 12: goto c54;
    case 13: goto c63;
    case 14: goto c65;  }
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 */
  if((ch_returncode = cp_table(& ch_val, REF(3)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 = & dr_table;
/* initget 5 4 , 0,0 */
  (*(REF(5).tsdr)->finalize)(REF(5).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(5),DEF(4),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
c5:
/* get_or_goto 5 4 , 32 */
  if ((ch_returncode = get_selected_object(DEF(5),DEF(4),sched)) != Normal)
     goto c32;
/* block , 2 */
  if((ch_returncode = che_block(QUAL(2),sched)) != Normal)
     goto ch_raise_exception;
/* case 6 5.0 */
  REF(6).value.enumeration = REF(5)DOT(0).value.variant->info.variant_case;
  REF(6).tsdr = & dr_enumeration;
/* notequal . 6 =(4) , 27 */
  if ( REF(6).value.enumeration != 4 ) goto c27;
/* reveal 5.0 , 4 */
  if (4 != REF(5)DOT(0).value.variant->info.variant_case) goto ch_case_error;
/* notequal . 5.0.0.0 3.1 , 23 */
  if ( !(REF(5)DOT(0)DOT(0)DOT(0).tsdr->equal)(REF(5)DOT(0)DOT(0)DOT(0).value,
    REF(3)DOT(1).value) ) goto c23;
/* currentprogram 7 */
  if ((ch_val.program = make_pgm_copy(sched->ready->prog)) == nil)
     goto ch_depletion;
  (*(REF(7).tsdr)->finalize)(REF(7).value,F_DISCARD,sched);
  REF(7).value = ch_val; REF(7).tsdr = & dr_program;
/* create 8 7 , 3 */
  if ((ch_returncode = che_create(DEF(8),DEF(7),QUAL(3),sched)) != Normal)
     goto ch_raise_exception;
/* discard 7 */
  (*(REF(7).tsdr)->finalize)(REF(7).value,F_DISCARD,sched);
  REF(7).tsdr = & dr_bottom;
/* find 9 3.2.2 5.0.0.1 , 0 */
  if (findfunc(DEF(9),DEF(3)DOT(2)DOT(2),(
          arguments[0] = DEF(5)DOT(0)DOT(0)DOT(1),& arguments[0]),sched,0
            ) == FAILURE) goto ch_notfound;
/* copy 10 9.4 */
  if((ch_returncode = (REF(9)DOT(4).tsdr->copy)(& ch_val, REF(9)DOT(4).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(9)DOT(4).tsdr->number];
/* copy 11 3.3 */
  if((ch_returncode = cp_table(& ch_val, REF(3)DOT(3).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(11).tsdr)->finalize)(REF(11).value,F_DISCARD,sched);
  REF(11).value = ch_val;
  REF(11).tsdr = & dr_table;
/* copy 12 5.0.0.1 */
  if((ch_returncode = (REF(5)DOT(0)DOT(0)DOT(1).tsdr->copy)(& ch_val, 
    REF(5)DOT(0)DOT(0)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(5)DOT(0)DOT(0)DOT(1).tsdr->number];
/* insert 11 12 */
  if ((ch_returncode = insertfunc(DEF(11),DEF(12),FALSE,0)) != Normal)
     goto ch_raise_exception;
  current->ip = 4;
cb22:
/* call 8 10 3.1 3.2 11 , 4 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(8),
          arguments[1] = DEF(10),
          arguments[2] = DEF(3)DOT(1),
          arguments[3] = DEF(3)DOT(2),
          arguments[4] = DEF(11),
          arguments[4+1] = nil,& arguments[0]),QUAL(4),sched)) != Normal)
     goto ch_raise_exception;
  return;
c23:
/* discard 8 */
  (*(REF(8).tsdr)->finalize)(REF(8).value,F_DISCARD,sched);
  REF(8).tsdr = & dr_bottom;
/* discard 10 */
  (*(REF(10).tsdr)->finalize)(REF(10).value,F_DISCARD,sched);
  REF(10).tsdr = & dr_bottom;
/* discard 11 */
  (*(REF(11).tsdr)->finalize)(REF(11).value,F_DISCARD,sched);
  REF(11).tsdr = & dr_bottom;
c27:
/* endblock */
  che_endblock(sched);
c29:
/* discard 8 */
  (*(REF(8).tsdr)->finalize)(REF(8).value,F_DISCARD,sched);
  REF(8).tsdr = & dr_bottom;
/* branch , 5 */
   goto c5;
c32:
/* endget 5 4 */
  end_selector(DEF(5),DEF(4),sched,GET);
/* discard 4 */
  (*(REF(4).tsdr)->finalize)(REF(4).value,F_DISCARD,sched);
  REF(4).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);
/* branch , 63 */
   goto c63;
c37:
/* discard 3 */
  (*(REF(3).tsdr)->finalize)(REF(3).value,F_DISCARD,sched);
  REF(3).tsdr = & dr_bottom;
/* discard 8 */
  (*(REF(8).tsdr)->finalize)(REF(8).value,F_DISCARD,sched);
  REF(8).tsdr = & dr_bottom;
/* discard 10 */
  (*(REF(10).tsdr)->finalize)(REF(10).value,F_DISCARD,sched);
  REF(10).tsdr = & dr_bottom;
/* discard 11 */
  (*(REF(11).tsdr)->finalize)(REF(11).value,F_DISCARD,sched);
  REF(11).tsdr = & dr_bottom;
/* branch , 63 */
   goto c63;
c42:
/* discard 8 */
  (*(REF(8).tsdr)->finalize)(REF(8).value,F_DISCARD,sched);
  REF(8).tsdr = & dr_bottom;
/* discard 10 */
  (*(REF(10).tsdr)->finalize)(REF(10).value,F_DISCARD,sched);
  REF(10).tsdr = & dr_bottom;
/* discard 11 */
  (*(REF(11).tsdr)->finalize)(REF(11).value,F_DISCARD,sched);
  REF(11).tsdr = & dr_bottom;
/* discard 12 */
  (*(REF(12).tsdr)->finalize)(REF(12).value,F_DISCARD,sched);
  REF(12).tsdr = & dr_bottom;
/* return_exception 3 , 5 */
  if (ch_caller = do_return(REF(3).value)) {
    raise_user(QUAL(5),ch_caller); 
    sched->wakeup_proc(sched,ch_caller);}
  else rem_return_exception(DEF(3),QUAL(5));
  REF(3).tsdr = & dr_bottom;
/* branch , 63 */
   goto c63;
c48:
/* discard 8 */
  (*(REF(8).tsdr)->finalize)(REF(8).value,F_DISCARD,sched);
  REF(8).tsdr = & dr_bottom;
/* discard 10 */
  (*(REF(10).tsdr)->finalize)(REF(10).value,F_DISCARD,sched);
  REF(10).tsdr = & dr_bottom;
/* discard 11 */
  (*(REF(11).tsdr)->finalize)(REF(11).value,F_DISCARD,sched);
  REF(11).tsdr = & dr_bottom;
/* discard 12 */
  (*(REF(12).tsdr)->finalize)(REF(12).value,F_DISCARD,sched);
  REF(12).tsdr = & dr_bottom;
/* return_exception 3 , 5 */
  if (ch_caller = do_return(REF(3).value)) {
    raise_user(QUAL(5),ch_caller); 
    sched->wakeup_proc(sched,ch_caller);}
  else rem_return_exception(DEF(3),QUAL(5));
  REF(3).tsdr = & dr_bottom;
/* branch , 63 */
   goto c63;
c54:
/* discard 3 */
  (*(REF(3).tsdr)->finalize)(REF(3).value,F_DISCARD,sched);
  REF(3).tsdr = & dr_bottom;
/* discard 7 */
  (*(REF(7).tsdr)->finalize)(REF(7).value,F_DISCARD,sched);
  REF(7).tsdr = & dr_bottom;
/* discard 8 */
  (*(REF(8).tsdr)->finalize)(REF(8).value,F_DISCARD,sched);
  REF(8).tsdr = & dr_bottom;
/* discard 10 */
  (*(REF(10).tsdr)->finalize)(REF(10).value,F_DISCARD,sched);
  REF(10).tsdr = & dr_bottom;
/* discard 11 */
  (*(REF(11).tsdr)->finalize)(REF(11).value,F_DISCARD,sched);
  REF(11).tsdr = & dr_bottom;
/* discard 12 */
  (*(REF(12).tsdr)->finalize)(REF(12).value,F_DISCARD,sched);
  REF(12).tsdr = & dr_bottom;
/* chs_lit 13 , "Whoa! unexpected others in checkcirc" */
  if( !chs_lit(DEF(13),"Whoa! unexpected others in checkcirc") )
     goto ch_depletion;
/* print 13 */
  re_print(stderr, 0, DEF(13)); fflush(stderr);
/* discard 13 */
  (*(REF(13).tsdr)->finalize)(REF(13).value,F_DISCARD,sched);
  REF(13).tsdr = & dr_bottom;
c63:
/* endblock */
  che_endblock(sched);
c65:
/* endprocess */
  che_endprocess(sched); return;
#include "chtail.h"
