#include "chdecl.h"
void CH_window_readwin(current, sched, cop)
#define ARGUMENTS 8
#include "chhead.h"
select: switch (SELECTOR) {
    case 0: goto c0;
    case 1: goto cb2;
    case 2: goto c3;
    case 5: goto c12;
    case 3: goto c14;
    case 4: goto cb14;
    case 6: goto cb16;
    case 7: goto c17;
    case 8: goto cb19;
    case 9: goto c20;
    case 10: goto c22;
    case 11: goto cb31;
    case 12: goto c32;
    case 13: goto c39;
    case 14: goto c42;
    case 15: goto c45;
    case 16: goto c46;
    case 17: goto c55;
    case 18: goto c70;
    case 19: goto cb84;
    case 20: goto c85;
    case 21: goto cb97;
    case 22: goto c98;
    case 23: goto c110;
    case 24: goto c113;
    case 25: goto c117;
    case 26: goto c119;
    case 27: goto c125;
    case 28: goto cb128;
    case 29: goto c129;
    case 30: goto c131;
    case 31: goto c132;
    case 32: goto cb135;
    case 33: goto c136;
    case 34: goto c138;
    case 35: goto c139;
    case 36: goto c143;  }
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:
/* move 4 3.0 */
  (*(REF(4).tsdr)->finalize)(REF(4).value,F_DISCARD,sched);
  REF(4) = REF(3)DOT(0);
  REF(3)DOT(0).tsdr = & dr_bottom;
/* move 5 3.1 */
  (*(REF(5).tsdr)->finalize)(REF(5).value,F_DISCARD,sched);
  REF(5) = REF(3)DOT(1);
  REF(3)DOT(1).tsdr = & dr_bottom;
/* move 6 3.2 */
  (*(REF(6).tsdr)->finalize)(REF(6).value,F_DISCARD,sched);
  REF(6) = REF(3)DOT(2);
  REF(3)DOT(2).tsdr = & dr_bottom;
/* new_inport 7 */
  if ((ch_val.inport = make_inport()) == nil) goto ch_depletion;
  (*(REF(7).tsdr)->finalize)(REF(7).value,F_DISCARD,sched);
  REF(7).value = ch_val; REF(7).tsdr = & dr_inport;
/* connect 3.3 7 */
  if (REF(7).value.inport->refcount == MAXCOUNTER) goto ch_depletion;
  (*(REF(3)DOT(3).tsdr)->finalize)(REF(3)DOT(3).value,F_DISCARD,sched);
  REF(7).value.inport->refcount++;
  REF(3)DOT(3).value.outport = REF(7).value.inport;
  REF(3)DOT(3).tsdr = & dr_outport;
/* new_inport 8 */
  if ((ch_val.inport = make_inport()) == nil) goto ch_depletion;
  (*(REF(8).tsdr)->finalize)(REF(8).value,F_DISCARD,sched);
  REF(8).value = ch_val; REF(8).tsdr = & dr_inport;
/* connect 3.4 8 */
  if (REF(8).value.inport->refcount == MAXCOUNTER) goto ch_depletion;
  (*(REF(3)DOT(4).tsdr)->finalize)(REF(3)DOT(4).value,F_DISCARD,sched);
  REF(8).value.inport->refcount++;
  REF(3)DOT(4).value.outport = REF(8).value.inport;
  REF(3)DOT(4).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;
/* new_table 9 , 2 */
  if ((ch_returncode = che_new_table(DEF(9),QUAL(2),sched)) != Normal) 
     goto ch_raise_exception;
c15:
c12:
/* noop */
  
c14:
  current->ip = 4;
cb14:
/* select 6 * 8 * 7 * , 3 */
  if ((ch_returncode = che_select((
          arguments[0] = DEF(6),
          arguments[1] = NO_OBJECT,
          arguments[2] = DEF(8),
          arguments[3] = NO_OBJECT,
          arguments[4] = DEF(7),
          arguments[5] = NO_OBJECT,
          arguments[5+1] = nil,& arguments[0]),QUAL(3),sched)) != Normal)
     goto ch_raise_exception;
  if (current->ip == 4) return; else COMPUTE_TARGET;
c16:
  current->ip = 6;
cb16:
/* receive 10 6 */
  if ((ch_returncode = che_receive(DEF(10),DEF(6),sched)) != Normal)
     goto ch_raise_exception;
  return;
c17:
/* exit , 4 */
  ch_e = handler_type__exit; ch_val = QUAL(4); goto ch_exception;
c19:
  current->ip = 8;
cb19:
/* receive 11 8 */
  if ((ch_returncode = che_receive(DEF(11),DEF(8),sched)) != Normal)
     goto ch_raise_exception;
  return;
c20:
/* boolean 12 , FALSE */
  REF(12).value.boolean = FALSE;
  REF(12).tsdr = & dr_boolean;
/* initget 13 9 , 0,0 */
  (*(REF(13).tsdr)->finalize)(REF(13).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(13),DEF(9),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
c22:
/* get_or_goto 13 9 , 27 */
  if ((ch_returncode = get_selected_object(DEF(13),DEF(9),sched)) != Normal)
     goto c27;
/* notequal . 13 =(10) , 22 */
  if ( REF(13).value.ord_enum != 10 ) goto c22;
/* boolean 12 , TRUE */
  REF(12).value.boolean = TRUE;
  REF(12).tsdr = & dr_boolean;
c27:
/* endget 13 9 */
  end_selector(DEF(13),DEF(9),sched,GET);
/* not 14 12 */
  REF(14).value.boolean = !REF(12).value.boolean;
  REF(14).tsdr = & dr_boolean;
/* branch_false 14 , 45 */
  if ( !REF(14).value.boolean ) goto c45;
/* block , 5 */
  if((ch_returncode = che_block(QUAL(5),sched)) != Normal)
     goto ch_raise_exception;
  current->ip = 11;
cb31:
/* call 4 15 16 , 6 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(4),
          arguments[1] = DEF(15),
          arguments[2] = DEF(16),
          arguments[2+1] = nil,& arguments[0]),QUAL(6),sched)) != Normal)
     goto ch_raise_exception;
  return;
c32:
/* branch_false 16 , 35 */
  if ( !REF(16).value.boolean ) goto c35;
/* merge 9 15 */
  if ((ch_returncode = mergefunc(DEF(9),DEF(15),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* branch , 37 */
   goto c37;
c35:
/* return_exception 11 , 7 */
  if (ch_caller = do_return(REF(11).value)) {
    raise_user(QUAL(7),ch_caller); 
    sched->wakeup_proc(sched,ch_caller);}
  else rem_return_exception(DEF(11),QUAL(7));
  REF(11).tsdr = & dr_bottom;
/* exit , 4 */
  ch_e = handler_type__exit; ch_val = QUAL(4); goto ch_exception;
c37:
/* endblock */
  che_endblock(sched);
/* branch , 20 */
   goto c20;
c39:
/* return_exception 11 , 7 */
  if (ch_caller = do_return(REF(11).value)) {
    raise_user(QUAL(7),ch_caller); 
    sched->wakeup_proc(sched,ch_caller);}
  else rem_return_exception(DEF(11),QUAL(7));
  REF(11).tsdr = & dr_bottom;
/* exit , 4 */
  ch_e = handler_type__exit; ch_val = QUAL(4); goto ch_exception;
c42:
/* return_exception 11 , 7 */
  if (ch_caller = do_return(REF(11).value)) {
    raise_user(QUAL(7),ch_caller); 
    sched->wakeup_proc(sched,ch_caller);}
  else rem_return_exception(DEF(11),QUAL(7));
  REF(11).tsdr = & dr_bottom;
/* exit , 4 */
  ch_e = handler_type__exit; ch_val = QUAL(4); goto ch_exception;
c45:
/* initget 17 9 , 0,0 */
  (*(REF(17).tsdr)->finalize)(REF(17).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(17),DEF(9),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
c46:
/* get_or_err 17 9 */
  if ((ch_returncode = get_selected_object(DEF(17),DEF(9),sched)) != Normal)
     goto ch_raise_exception;
/* notequal . 17 =(10) , 46 */
  if ( REF(17).value.ord_enum != 10 ) goto c46;
/* position 18 17 */
  ch_frame = get_selector_frame(DEF(17),sched);
  ch_t = ch_frame->inspectee->value.table;
  REF(18).value.integer = ch_frame->rmvcount +
    (*(ch_t->tbls[ORDER_TBL].des->position_of))(ch_t,ORDER_TBL,ch_frame->pos);
  REF(18).tsdr = &dr_integer;
/* endget 17 9 */
  end_selector(DEF(17),DEF(9),sched,GET);
/* copy 19 9 */
  if((ch_returncode = cp_table(& ch_val, REF(9).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(19).tsdr)->finalize)(REF(19).value,F_DISCARD,sched);
  REF(19).value = ch_val;
  REF(19).tsdr = & dr_table;
/* initget 20 19 , 0,0 */
  (*(REF(20).tsdr)->finalize)(REF(20).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(20),DEF(19),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
c55:
/* get_or_goto 20 19 , 65 */
  if ((ch_returncode = get_selected_object(DEF(20),DEF(19),sched)) != Normal)
     goto c65;
/* notequal . 20 =(10) , 55 */
  if ( REF(20).value.ord_enum != 10 ) goto c55;
/* position 21 20 */
  ch_frame = get_selector_frame(DEF(20),sched);
  ch_t = ch_frame->inspectee->value.table;
  REF(21).value.integer = ch_frame->rmvcount +
    (*(ch_t->tbls[ORDER_TBL].des->position_of))(ch_t,ORDER_TBL,ch_frame->pos);
  REF(21).tsdr = &dr_integer;
/* ige . 21 18 , 55 */
  if ( REF(21).value.integer >= REF(18).value.integer ) goto c55;
/* position 18 20 */
  ch_frame = get_selector_frame(DEF(20),sched);
  ch_t = ch_frame->inspectee->value.table;
  REF(18).value.integer = ch_frame->rmvcount +
    (*(ch_t->tbls[ORDER_TBL].des->position_of))(ch_t,ORDER_TBL,ch_frame->pos);
  REF(18).tsdr = &dr_integer;
/* branch , 55 */
   goto c55;
c65:
/* endget 20 19 */
  end_selector(DEF(20),DEF(19),sched,GET);
/* discard 19 */
  (*(REF(19).tsdr)->finalize)(REF(19).value,F_DISCARD,sched);
  REF(19).tsdr = & dr_bottom;
/* new_table 11.0 , 2 */
  if ((ch_returncode = che_new_table(DEF(11)DOT(0),QUAL(2),sched)) != Normal) 
     goto ch_raise_exception;
/* privatize 9 */
  if (REF(9).value.table->refcount != 1)
    if ((ch_returncode = doCopyOnWrite(DEF(9))) != Normal)
       goto ch_raise_exception;
/* initget 22 9 , 0,0 */
  (*(REF(22).tsdr)->finalize)(REF(22).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(22),DEF(9),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
c70:
/* get_or_goto 22 9 , 77 */
  if ((ch_returncode = get_selected_object(DEF(22),DEF(9),sched)) != Normal)
     goto c77;
/* position 23 22 */
  ch_frame = get_selector_frame(DEF(22),sched);
  ch_t = ch_frame->inspectee->value.table;
  REF(23).value.integer = ch_frame->rmvcount +
    (*(ch_t->tbls[ORDER_TBL].des->position_of))(ch_t,ORDER_TBL,ch_frame->pos);
  REF(23).tsdr = &dr_integer;
/* ige . 23 18 , 70 */
  if ( REF(23).value.integer >= REF(18).value.integer ) goto c70;
/* remove 24 22 9 */
  if ((ch_returncode = che_remove(DEF(24),DEF(22),DEF(9),sched)) != Normal)
     goto ch_raise_exception;
/* insert 11.0 24 */
  if ((ch_returncode = insertfunc(DEF(11)DOT(0),DEF(24),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* branch , 70 */
   goto c70;
c77:
/* endget 22 9 */
  end_selector(DEF(22),DEF(9),sched,GET);
/* privatize 9 */
  if (REF(9).value.table->refcount != 1)
    if ((ch_returncode = doCopyOnWrite(DEF(9))) != Normal)
       goto ch_raise_exception;
/* lookup_at 25 9 =(0) */
  if ( !((ch_t = REF(9).value.table)->size) ) goto ch_notfound;
  (*(REF(25).tsdr)->finalize)(REF(25).value,F_DISCARD,sched);
  (*(ch_t->tbls[ORDER_TBL].des->lookup_at))
    (ch_t, ORDER_TBL, & REF(25).value,0);
  REF(25).tsdr = qdatarepmap[ch_t->tsdr->number];
/* remove_at 26 9 =(0) */
  if ((ch_returncode = remove_at_func(DEF(26),DEF(9),0)) != Normal)
     goto ch_raise_exception;
/* return 11 */
  if (ch_caller = do_return(REF(11).value)) {
    if (ch_caller->type < CProcess) ch_caller->ip++;
      sched->wakeup_proc(sched, ch_caller);}
  else rem_return(REF(11).value);
  REF(11).tsdr = & dr_bottom;
/* branch , 12 */
   goto c12;
c84:
  current->ip = 19;
cb84:
/* receive 27 7 */
  if ((ch_returncode = che_receive(DEF(27),DEF(7),sched)) != Normal)
     goto ch_raise_exception;
  return;
c85:
/* boolean 28 , FALSE */
  REF(28).value.boolean = FALSE;
  REF(28).tsdr = & dr_boolean;
/* lookup_at_or_goto 29 9 =(0) , 89 */
  if ( !((ch_t = REF(9).value.table)->size) ) goto c89;
  (*(REF(29).tsdr)->finalize)(REF(29).value,F_DISCARD,sched);
  (*(ch_t->tbls[ORDER_TBL].des->lookup_at))
    (ch_t, ORDER_TBL, & REF(29).value,0);
  REF(29).tsdr = qdatarepmap[ch_t->tsdr->number];
/* boolean 28 , TRUE */
  REF(28).value.boolean = TRUE;
  REF(28).tsdr = & dr_boolean;
c89:
/* branch_false 28 , 96 */
  if ( !REF(28).value.boolean ) goto c96;
/* privatize 9 */
  if (REF(9).value.table->refcount != 1)
    if ((ch_returncode = doCopyOnWrite(DEF(9))) != Normal)
       goto ch_raise_exception;
/* lookup_at 30 9 =(0) */
  if ( !((ch_t = REF(9).value.table)->size) ) goto ch_notfound;
  (*(REF(30).tsdr)->finalize)(REF(30).value,F_DISCARD,sched);
  (*(ch_t->tbls[ORDER_TBL].des->lookup_at))
    (ch_t, ORDER_TBL, & REF(30).value,0);
  REF(30).tsdr = qdatarepmap[ch_t->tsdr->number];
/* remove_at 27.0 9 =(0) */
  if ((ch_returncode = remove_at_func(DEF(27)DOT(0),DEF(9),0)) != Normal)
     goto ch_raise_exception;
/* return 27 */
  if (ch_caller = do_return(REF(27).value)) {
    if (ch_caller->type < CProcess) ch_caller->ip++;
      sched->wakeup_proc(sched, ch_caller);}
  else rem_return(REF(27).value);
  REF(27).tsdr = & dr_bottom;
/* branch , 12 */
   goto c12;
c96:
/* block , 8 */
  if((ch_returncode = che_block(QUAL(8),sched)) != Normal)
     goto ch_raise_exception;
  current->ip = 21;
cb97:
/* call 4 31 32 , 6 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(4),
          arguments[1] = DEF(31),
          arguments[2] = DEF(32),
          arguments[2+1] = nil,& arguments[0]),QUAL(6),sched)) != Normal)
     goto ch_raise_exception;
  return;
c98:
/* branch_false 32 , 106 */
  if ( !REF(32).value.boolean ) goto c106;
/* merge 9 31 */
  if ((ch_returncode = mergefunc(DEF(9),DEF(31),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* privatize 9 */
  if (REF(9).value.table->refcount != 1)
    if ((ch_returncode = doCopyOnWrite(DEF(9))) != Normal)
       goto ch_raise_exception;
/* lookup_at 33 9 =(0) */
  if ( !((ch_t = REF(9).value.table)->size) ) goto ch_notfound;
  (*(REF(33).tsdr)->finalize)(REF(33).value,F_DISCARD,sched);
  (*(ch_t->tbls[ORDER_TBL].des->lookup_at))
    (ch_t, ORDER_TBL, & REF(33).value,0);
  REF(33).tsdr = qdatarepmap[ch_t->tsdr->number];
/* remove_at 27.0 9 =(0) */
  if ((ch_returncode = remove_at_func(DEF(27)DOT(0),DEF(9),0)) != Normal)
     goto ch_raise_exception;
/* return 27 */
  if (ch_caller = do_return(REF(27).value)) {
    if (ch_caller->type < CProcess) ch_caller->ip++;
      sched->wakeup_proc(sched, ch_caller);}
  else rem_return(REF(27).value);
  REF(27).tsdr = & dr_bottom;
/* branch , 108 */
   goto c108;
c106:
/* return_exception 27 , 9 */
  if (ch_caller = do_return(REF(27).value)) {
    raise_user(QUAL(9),ch_caller); 
    sched->wakeup_proc(sched,ch_caller);}
  else rem_return_exception(DEF(27),QUAL(9));
  REF(27).tsdr = & dr_bottom;
/* exit , 4 */
  ch_e = handler_type__exit; ch_val = QUAL(4); goto ch_exception;
c108:
/* endblock */
  che_endblock(sched);
/* branch , 12 */
   goto c12;
c110:
/* return_exception 27 , 9 */
  if (ch_caller = do_return(REF(27).value)) {
    raise_user(QUAL(9),ch_caller); 
    sched->wakeup_proc(sched,ch_caller);}
  else rem_return_exception(DEF(27),QUAL(9));
  REF(27).tsdr = & dr_bottom;
/* exit , 4 */
  ch_e = handler_type__exit; ch_val = QUAL(4); goto ch_exception;
c113:
/* return_exception 27 , 9 */
  if (ch_caller = do_return(REF(27).value)) {
    raise_user(QUAL(9),ch_caller); 
    sched->wakeup_proc(sched,ch_caller);}
  else rem_return_exception(DEF(27),QUAL(9));
  REF(27).tsdr = & dr_bottom;
/* exit , 4 */
  ch_e = handler_type__exit; ch_val = QUAL(4); goto ch_exception;
c117:
/* endblock */
  che_endblock(sched);
/* branch , 139 */
   goto c139;
c119:
/* discard 31 */
  (*(REF(31).tsdr)->finalize)(REF(31).value,F_DISCARD,sched);
  REF(31).tsdr = & dr_bottom;
/* discard 15 */
  (*(REF(15).tsdr)->finalize)(REF(15).value,F_DISCARD,sched);
  REF(15).tsdr = & dr_bottom;
/* block , 10 */
  if((ch_returncode = che_block(QUAL(10),sched)) != Normal)
     goto ch_raise_exception;
/* send 5 10 */
  if ((ch_returncode = che_send(DEF(5),DEF(10),sched)) != Normal)
     goto ch_raise_exception;
/* endblock */
  che_endblock(sched);
c125:
/* empty 34 7 */
  REF(34).value.boolean = (REF(7).value.inport->info.inport.queue == nil);
  REF(34).tsdr = & dr_boolean;
/* not 35 34 */
  REF(35).value.boolean = !REF(34).value.boolean;
  REF(35).tsdr = & dr_boolean;
/* branch_false 35 , 131 */
  if ( !REF(35).value.boolean ) goto c131;
  current->ip = 28;
cb128:
/* receive 36 7 */
  if ((ch_returncode = che_receive(DEF(36),DEF(7),sched)) != Normal)
     goto ch_raise_exception;
  return;
c129:
/* return_exception 36 , 9 */
  if (ch_caller = do_return(REF(36).value)) {
    raise_user(QUAL(9),ch_caller); 
    sched->wakeup_proc(sched,ch_caller);}
  else rem_return_exception(DEF(36),QUAL(9));
  REF(36).tsdr = & dr_bottom;
/* branch , 125 */
   goto c125;
c131:
/* discard 7 */
  (*(REF(7).tsdr)->finalize)(REF(7).value,F_DISCARD,sched);
  REF(7).tsdr = & dr_bottom;
c132:
/* empty 37 8 */
  REF(37).value.boolean = (REF(8).value.inport->info.inport.queue == nil);
  REF(37).tsdr = & dr_boolean;
/* not 38 37 */
  REF(38).value.boolean = !REF(37).value.boolean;
  REF(38).tsdr = & dr_boolean;
/* branch_false 38 , 138 */
  if ( !REF(38).value.boolean ) goto c138;
  current->ip = 32;
cb135:
/* receive 39 8 */
  if ((ch_returncode = che_receive(DEF(39),DEF(8),sched)) != Normal)
     goto ch_raise_exception;
  return;
c136:
/* return_exception 39 , 7 */
  if (ch_caller = do_return(REF(39).value)) {
    raise_user(QUAL(7),ch_caller); 
    sched->wakeup_proc(sched,ch_caller);}
  else rem_return_exception(DEF(39),QUAL(7));
  REF(39).tsdr = & dr_bottom;
/* branch , 132 */
   goto c132;
c138:
/* discard 8 */
  (*(REF(8).tsdr)->finalize)(REF(8).value,F_DISCARD,sched);
  REF(8).tsdr = & dr_bottom;
c139:
/* 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;
/* endblock */
  che_endblock(sched);
c143:
/* endprocess */
  che_endprocess(sched); return;
#include "chtail.h"
