#include "chdecl.h"
void CH_safewindow_openwindow(current, sched, cop)
#define ARGUMENTS 7
#include "chhead.h"
select: switch (SELECTOR) {
    case 0: goto c0;
    case 1: goto cb1;
    case 2: goto c2;
    case 3: goto cb5;
    case 4: goto c6;
    case 5: goto cb9;
    case 6: goto c10;
    case 7: goto cb11;
    case 8: goto c12;
    case 9: goto cb14;
    case 10: goto c15;
    case 11: goto cb17;
    case 12: goto c18;
    case 13: goto cb20;
    case 14: goto c21;
    case 15: goto cb23;
    case 16: goto c24;
    case 17: goto cb26;
    case 18: goto c27;
    case 19: goto c31;  }
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:
/* copy 4 3.1 */
  if((ch_returncode = (REF(3)DOT(1).tsdr->copy)(& ch_val, REF(3)DOT(1).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(4).tsdr)->finalize)(REF(4).value,F_DISCARD,sched);
  REF(4).value = ch_val;
  REF(4).tsdr = datarepmap[REF(3)DOT(1).tsdr->number];
/* copy 5 3.2 */
  if((ch_returncode = (REF(3)DOT(2).tsdr->copy)(& ch_val, REF(3)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(3)DOT(2).tsdr->number];
/* chs_lit 6 , "Window" */
  if( !chs_lit(DEF(6),"Window") ) goto ch_depletion;
  current->ip = 3;
cb5:
/* call 3.0 6 7 , 1 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(0),
          arguments[1] = DEF(6),
          arguments[2] = DEF(7),
          arguments[2+1] = nil,& arguments[0]),QUAL(1),sched)) != Normal)
     goto ch_raise_exception;
  return;
c6:
/* move 8 7 */
  (*(REF(8).tsdr)->finalize)(REF(8).value,F_DISCARD,sched);
  REF(8) = REF(7);
  REF(7).tsdr = & dr_bottom;
/* unwrap 9 8 , 2 */
  if ((ch_returncode = che_unwrap(DEF(9),DEF(8),QUAL(2),sched)) != Normal)
     goto ch_raise_exception;
/* discard 5 */
  (*(REF(5).tsdr)->finalize)(REF(5).value,F_DISCARD,sched);
  REF(5).tsdr = & dr_bottom;
  current->ip = 5;
cb9:
/* call 9 4 5 10 11 , 3 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(9),
          arguments[1] = DEF(4),
          arguments[2] = DEF(5),
          arguments[3] = DEF(10),
          arguments[4] = DEF(11),
          arguments[4+1] = nil,& arguments[0]),QUAL(3),sched)) != Normal)
     goto ch_raise_exception;
  return;
c10:
/* chs_lit 12 , "FD Close" */
  if( !chs_lit(DEF(12),"FD Close") ) goto ch_depletion;
  current->ip = 7;
cb11:
/* call 3.0 12 13 , 1 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(0),
          arguments[1] = DEF(12),
          arguments[2] = DEF(13),
          arguments[2+1] = nil,& arguments[0]),QUAL(1),sched)) != Normal)
     goto ch_raise_exception;
  return;
c12:
/* move 8 13 */
  (*(REF(8).tsdr)->finalize)(REF(8).value,F_DISCARD,sched);
  REF(8) = REF(13);
  REF(13).tsdr = & dr_bottom;
/* unwrap 14 8 , 4 */
  if ((ch_returncode = che_unwrap(DEF(14),DEF(8),QUAL(4),sched)) != Normal)
     goto ch_raise_exception;
  current->ip = 9;
cb14:
/* call 14 10 11 15 , 5 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(14),
          arguments[1] = DEF(10),
          arguments[2] = DEF(11),
          arguments[3] = DEF(15),
          arguments[3+1] = nil,& arguments[0]),QUAL(5),sched)) != Normal)
     goto ch_raise_exception;
  return;
c15:
/* move 3.5 15 */
  (*(REF(3)DOT(5).tsdr)->finalize)(REF(3)DOT(5).value,F_DISCARD,sched);
  REF(3)DOT(5) = REF(15);
  REF(15).tsdr = & dr_bottom;
/* chs_lit 16 , "FD Read" */
  if( !chs_lit(DEF(16),"FD Read") ) goto ch_depletion;
  current->ip = 11;
cb17:
/* call 3.0 16 17 , 1 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(0),
          arguments[1] = DEF(16),
          arguments[2] = DEF(17),
          arguments[2+1] = nil,& arguments[0]),QUAL(1),sched)) != Normal)
     goto ch_raise_exception;
  return;
c18:
/* move 8 17 */
  (*(REF(8).tsdr)->finalize)(REF(8).value,F_DISCARD,sched);
  REF(8) = REF(17);
  REF(17).tsdr = & dr_bottom;
/* unwrap 18 8 , 6 */
  if ((ch_returncode = che_unwrap(DEF(18),DEF(8),QUAL(6),sched)) != Normal)
     goto ch_raise_exception;
  current->ip = 13;
cb20:
/* call 18 10 19 , 7 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(18),
          arguments[1] = DEF(10),
          arguments[2] = DEF(19),
          arguments[2+1] = nil,& arguments[0]),QUAL(7),sched)) != Normal)
     goto ch_raise_exception;
  return;
c21:
/* move 3.3 19 */
  (*(REF(3)DOT(3).tsdr)->finalize)(REF(3)DOT(3).value,F_DISCARD,sched);
  REF(3)DOT(3) = REF(19);
  REF(19).tsdr = & dr_bottom;
/* chs_lit 20 , "FD Write" */
  if( !chs_lit(DEF(20),"FD Write") ) goto ch_depletion;
  current->ip = 15;
cb23:
/* call 3.0 20 21 , 1 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(0),
          arguments[1] = DEF(20),
          arguments[2] = DEF(21),
          arguments[2+1] = nil,& arguments[0]),QUAL(1),sched)) != Normal)
     goto ch_raise_exception;
  return;
c24:
/* move 8 21 */
  (*(REF(8).tsdr)->finalize)(REF(8).value,F_DISCARD,sched);
  REF(8) = REF(21);
  REF(21).tsdr = & dr_bottom;
/* unwrap 22 8 , 8 */
  if ((ch_returncode = che_unwrap(DEF(22),DEF(8),QUAL(8),sched)) != Normal)
     goto ch_raise_exception;
  current->ip = 17;
cb26:
/* call 22 11 23 , 9 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(22),
          arguments[1] = DEF(11),
          arguments[2] = DEF(23),
          arguments[2+1] = nil,& arguments[0]),QUAL(9),sched)) != Normal)
     goto ch_raise_exception;
  return;
c27:
/* move 3.4 23 */
  (*(REF(3)DOT(4).tsdr)->finalize)(REF(3)DOT(4).value,F_DISCARD,sched);
  REF(3)DOT(4) = REF(23);
  REF(23).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);
c31:
/* endprocess */
  che_endprocess(sched); return;
#include "chtail.h"
