#include "chdecl.h"
void CH_window(current, sched, cop)
#define ARGUMENTS 9
#include "chhead.h"
select: switch (SELECTOR) {
    case 0: goto c0;
    case 1: goto cb1;
    case 2: goto c2;
    case 3: goto cb18;
    case 4: goto c19;
    case 5: goto cb25;
    case 6: goto c26;
    case 7: goto cb28;
    case 8: goto c29;
    case 9: goto cb30;
    case 10: goto c31;
    case 11: goto c36;  }
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:
/* prog_lit 4 , 1 */
  if ((ch_returncode = che_prog_lit(DEF(4),QUAL(1),sched)) != Normal) 
     goto ch_raise_exception;
/* procedure 5 4 , 2 */
  if ((ch_returncode = che_procedure(DEF(5),DEF(4),QUAL(2),sched)) != Normal)
     goto ch_raise_exception;
/* discard 4 */
  (*(REF(4).tsdr)->finalize)(REF(4).value,F_DISCARD,sched);
  REF(4).tsdr = & dr_bottom;
/* move 6 5 */
  (*(REF(6).tsdr)->finalize)(REF(6).value,F_DISCARD,sched);
  REF(6) = REF(5);
  REF(5).tsdr = & dr_bottom;
/* prog_lit 7 , 3 */
  if ((ch_returncode = che_prog_lit(DEF(7),QUAL(3),sched)) != Normal) 
     goto ch_raise_exception;
/* procedure 8 7 , 4 */
  if ((ch_returncode = che_procedure(DEF(8),DEF(7),QUAL(4),sched)) != Normal)
     goto ch_raise_exception;
/* discard 7 */
  (*(REF(7).tsdr)->finalize)(REF(7).value,F_DISCARD,sched);
  REF(7).tsdr = & dr_bottom;
/* move 9 8 */
  (*(REF(9).tsdr)->finalize)(REF(9).value,F_DISCARD,sched);
  REF(9) = REF(8);
  REF(8).tsdr = & dr_bottom;
/* prog_lit 10 , 5 */
  if ((ch_returncode = che_prog_lit(DEF(10),QUAL(5),sched)) != Normal) 
     goto ch_raise_exception;
/* procedure 11 10 , 6 */
  if ((ch_returncode = che_procedure(DEF(11),DEF(10),QUAL(6)
    ,sched)) != Normal) goto ch_raise_exception;
/* discard 10 */
  (*(REF(10).tsdr)->finalize)(REF(10).value,F_DISCARD,sched);
  REF(10).tsdr = & dr_bottom;
/* move 12 11 */
  (*(REF(12).tsdr)->finalize)(REF(12).value,F_DISCARD,sched);
  REF(12) = REF(11);
  REF(11).tsdr = & dr_bottom;
/* prog_lit 13 , 7 */
  if ((ch_returncode = che_prog_lit(DEF(13),QUAL(7),sched)) != Normal) 
     goto ch_raise_exception;
/* procedure 14 13 , 8 */
  if ((ch_returncode = che_procedure(DEF(14),DEF(13),QUAL(8)
    ,sched)) != Normal) goto ch_raise_exception;
/* discard 13 */
  (*(REF(13).tsdr)->finalize)(REF(13).value,F_DISCARD,sched);
  REF(13).tsdr = & dr_bottom;
/* move 15 14 */
  (*(REF(15).tsdr)->finalize)(REF(15).value,F_DISCARD,sched);
  REF(15) = REF(14);
  REF(14).tsdr = & dr_bottom;
  current->ip = 3;
cb18:
/* call 6 3.0 3.1 3.2 16 17 18 , 9 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(6),
          arguments[1] = DEF(3)DOT(0),
          arguments[2] = DEF(3)DOT(1),
          arguments[3] = DEF(3)DOT(2),
          arguments[4] = DEF(16),
          arguments[5] = DEF(17),
          arguments[6] = DEF(18),
          arguments[6+1] = nil,& arguments[0]),QUAL(9),sched)) != Normal)
     goto ch_raise_exception;
  return;
c19:
/* new_inport 19 */
  if ((ch_val.inport = make_inport()) == nil) goto ch_depletion;
  (*(REF(19).tsdr)->finalize)(REF(19).value,F_DISCARD,sched);
  REF(19).value = ch_val; REF(19).tsdr = & dr_inport;
/* connect 20 19 */
  if (REF(19).value.inport->refcount == MAXCOUNTER) goto ch_depletion;
  (*(REF(20).tsdr)->finalize)(REF(20).value,F_DISCARD,sched);
  REF(19).value.inport->refcount++;
  REF(20).value.outport = REF(19).value.inport;
  REF(20).tsdr = & dr_outport;
/* new_inport 21 */
  if ((ch_val.inport = make_inport()) == nil) goto ch_depletion;
  (*(REF(21).tsdr)->finalize)(REF(21).value,F_DISCARD,sched);
  REF(21).value = ch_val; REF(21).tsdr = & dr_inport;
/* connect 22 21 */
  if (REF(21).value.inport->refcount == MAXCOUNTER) goto ch_depletion;
  (*(REF(22).tsdr)->finalize)(REF(22).value,F_DISCARD,sched);
  REF(21).value.inport->refcount++;
  REF(22).value.outport = REF(21).value.inport;
  REF(22).tsdr = & dr_outport;
/* copy 23 16 */
  if((ch_returncode = (REF(16).tsdr->copy)(& ch_val, REF(16).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(23).tsdr)->finalize)(REF(23).value,F_DISCARD,sched);
  REF(23).value = ch_val;
  REF(23).tsdr = datarepmap[REF(16).tsdr->number];
/* copy 24 17 */
  if((ch_returncode = (REF(17).tsdr->copy)(& ch_val, REF(17).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(24).tsdr)->finalize)(REF(24).value,F_DISCARD,sched);
  REF(24).value = ch_val;
  REF(24).tsdr = datarepmap[REF(17).tsdr->number];
  current->ip = 5;
cb25:
/* call 15 18 23 24 20 22 25 , 10 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(15),
          arguments[1] = DEF(18),
          arguments[2] = DEF(23),
          arguments[3] = DEF(24),
          arguments[4] = DEF(20),
          arguments[5] = DEF(22),
          arguments[6] = DEF(25),
          arguments[6+1] = nil,& arguments[0]),QUAL(10),sched)) != Normal)
     goto ch_raise_exception;
  return;
c26:
/* new_record 26 , 5 */
  if ((ch_val.record = new_record(5)) == nil) goto ch_depletion;
  (*(REF(26).tsdr)->finalize)(REF(26).value,F_DISCARD,sched);
  REF(26).value = ch_val; REF(26).tsdr = & dr_record;
/* copy 27 25 */
  if((ch_returncode = (REF(25).tsdr->copy)(& ch_val, REF(25).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(25).tsdr->number];
  current->ip = 7;
cb28:
/* call 9 16 27 19 26.4 26.2 , 11 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(9),
          arguments[1] = DEF(16),
          arguments[2] = DEF(27),
          arguments[3] = DEF(19),
          arguments[4] = DEF(26)DOT(4),
          arguments[5] = DEF(26)DOT(2),
          arguments[5+1] = nil,& arguments[0]),QUAL(11),sched)) != Normal)
     goto ch_raise_exception;
  return;
c29:
/* copy 28 25 */
  if((ch_returncode = (REF(25).tsdr->copy)(& ch_val, REF(25).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(25).tsdr->number];
  current->ip = 9;
cb30:
/* call 12 17 28 21 26.3 26.0 26.1 , 12 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(12),
          arguments[1] = DEF(17),
          arguments[2] = DEF(28),
          arguments[3] = DEF(21),
          arguments[4] = DEF(26)DOT(3),
          arguments[5] = DEF(26)DOT(0),
          arguments[6] = DEF(26)DOT(1),
          arguments[6+1] = nil,& arguments[0]),QUAL(12),sched)) != Normal)
     goto ch_raise_exception;
  return;
c31:
/* move 3.3 26 */
  (*(REF(3)DOT(3).tsdr)->finalize)(REF(3)DOT(3).value,F_DISCARD,sched);
  REF(3)DOT(3) = REF(26);
  REF(26).tsdr = & dr_bottom;
/* move 3.4 25 */
  (*(REF(3)DOT(4).tsdr)->finalize)(REF(3)DOT(4).value,F_DISCARD,sched);
  REF(3)DOT(4) = REF(25);
  REF(25).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);
c36:
/* endprocess */
  che_endprocess(sched); return;
#include "chtail.h"
