#include <perms.h>

                                                                //      1  %begin; !6-valued logic simulator
#line 1 "regression-bugs-tmp/SIM.imp"
int main(int argc, char **argv) {
  _imp_initialise(argc, argv);
                                                                //      2  
                                                                //      3  %constinteger low=-2,falling=-1,rising=1,high=2
                                                                //      4  %constinteger open=0,undef=((-1)>>1)!!(-1)
                                                                //      5  
                                                                //      6  %record(*)%name nil==record(0)
#line 6 "regression-bugs-tmp/SIM.imp"
 void /*name*/*NIL;
#line 6 "regression-bugs-tmp/SIM.imp"
NIL =  ( void /* BUG caused by a pooltostr(0) call? */  *) _imp_RECORD(0);
                                                                //      7  
                                                                //      8  %recordformat hfm(%record(hfm)%name next,%integer state,since)
#line 8 "regression-bugs-tmp/SIM.imp"
typedef struct HFM HFM;
struct HFM {
   HFM /*name*/*NEXT;
  int STATE;
  int SINCE;
};
                                                                //      9  %constinteger slotmax=11; !slots @ 2 lines each, leaves 2 for command etc
                                                                //     10  %constinteger eqmax=800;  !event queue cells
                                                                //     11  %constinteger hmax=5000;  !heap words
                                                                //     12  
                                                                //     13  %constinteger csize=5,psize=5,ssize=10; !size (in words) of heap records
                                                                //     14  %constinteger hsize=3
                                                                //     15  %recordformatspec pinf
                                                                //     16  %recordformatspec sigf
                                                                //     17  %recordformat compf(%record(compf)%name next,
#line 17 "regression-bugs-tmp/SIM.imp"
typedef struct COMPF COMPF;
struct COMPF {
   COMPF /*name*/*NEXT;
  int TYPE;
   void /*name*/*INS;
   void /*name*/*OUTS;
   void /*name*/*PRIVATE;
};
                                                                //     18                      %integer type {indexes into behaviour switch},
                                                                //     19                      %record(pinf)%name ins,outs,private)
                                                                //     20  %recordformat pinf(%record(pinf)%name next {pin in component},
#line 20 "regression-bugs-tmp/SIM.imp"
typedef struct PINF PINF;
struct PINF {
   PINF /*name*/*NEXT;
   PINF /*name*/*CHAIN;
   COMPF /*name*/*COMP;
   void /*name*/*SIGNAL;
  int STATE;
};
                                                                //     21                     chain {next pin in net},%record(compf)%name comp,
                                                                //     22                     %record(sigf)%name signal, %integer state)
                                                                //     23  %recordformat sigf(%record(sigf)%name next {for identification},
#line 23 "regression-bugs-tmp/SIM.imp"
typedef struct SIGF SIGF;
struct SIGF {
   SIGF /*name*/*NEXT;
  int STATE;
   PINF /*name*/*FROM;
   PINF /*name*/*TO;
  int SCREENSLOT;
   HFM /*name*/*HISTORY;
  _imp_string /*%string(15)*/ NAME;
};
                                                                //     24                     %integer state,%record(pinf)%name from,to,
                                                                //     25                     %integer screenslot,%record(hfm)%name history,
                                                                //     26                     %string(15)name)
                                                                //     27  %recordformat eqf(%record(eqf)%name next,%record(pinf)%name pin,
#line 27 "regression-bugs-tmp/SIM.imp"
typedef struct EQF EQF;
struct EQF {
   EQF /*name*/*NEXT;
   PINF /*name*/*PIN;
  int STATE;
  int WHEN;
};
                                                                //     28                    %integer state,when)
                                                                //     29  
                                                                //     30  %record(sigf)%namearray slot(1:slotmax)
#line 30 "regression-bugs-tmp/SIM.imp"
 SIGF /*name*/*SLOT[11];
                                                                //     31  %record(eqf)%name eventqueue,eclist
#line 31 "regression-bugs-tmp/SIM.imp"
 EQF /*name*/*EVENTQUEUE;
#line 31 "regression-bugs-tmp/SIM.imp"
 EQF /*name*/*ECLIST;
                                                                //     32  %record(eqf)%array ecell(1:eqmax)
#line 32 "regression-bugs-tmp/SIM.imp"
 EQF ECELL[800];
                                                                //     33  %integer now=0
#line 33 "regression-bugs-tmp/SIM.imp"
int NOW;
#line 33 "regression-bugs-tmp/SIM.imp"
NOW = 0;
                                                                //     34  
                                                                //     35  %integer heapspace=1
#line 35 "regression-bugs-tmp/SIM.imp"
int HEAPSPACE;
#line 35 "regression-bugs-tmp/SIM.imp"
HEAPSPACE = 1;
                                                                //     36  %integerarray heap(1:hmax)
#line 36 "regression-bugs-tmp/SIM.imp"
int HEAP[5000];
                                                                //     37  %record(sigf)%name nets==nil
#line 37 "regression-bugs-tmp/SIM.imp"
 SIGF /*name*/*NETS;
#line 37 "regression-bugs-tmp/SIM.imp"
NETS = NIL;
                                                                //     38  %record(compf)%name components==nil
#line 38 "regression-bugs-tmp/SIM.imp"
 COMPF /*name*/*COMPONENTS;
#line 38 "regression-bugs-tmp/SIM.imp"
COMPONENTS = NIL;
                                                                //     39  
                                                                //     40  %routine initialise arrays
#line 40 "regression-bugs-tmp/SIM.imp"
void INITIALISEARRAYS( void )
#line 40 "regression-bugs-tmp/SIM.imp"
{
                                                                //     41  %integer i
#line 41 "regression-bugs-tmp/SIM.imp"
int I;
                                                                //     42    slot(i)==nil %for i=1,1,slotmax
#line 42 "regression-bugs-tmp/SIM.imp"
I = 0;
if ((((11)-(1)) % (1)) != 0) _imp_signal(5,1,0,"Illegal cycle I = 1, 1, 11");
L_0002:;
if (I == 11) goto L_0003;
I += 1;
#line 42 "regression-bugs-tmp/SIM.imp"
SLOT[(((int)(I)) - (1))] = NIL;
#line 42 "regression-bugs-tmp/SIM.imp"
goto L_0002;
#line 42 "regression-bugs-tmp/SIM.imp"
L_0003:;
                                                                //     43    ecell(i)_next==ecell(i-1) %for i=2,1,eqmax
#line 43 "regression-bugs-tmp/SIM.imp"
I = 1;
if ((((800)-(2)) % (1)) != 0) _imp_signal(5,1,0,"Illegal cycle I = 2, 1, 800");
L_0005:;
if (I == 800) goto L_0006;
I += 1;
#line 43 "regression-bugs-tmp/SIM.imp"
ECELL[(((int)(I)) - (1))].NEXT = &ECELL[(((int)((((int)(I)) - (1)))) - (1))];
#line 43 "regression-bugs-tmp/SIM.imp"
goto L_0005;
#line 43 "regression-bugs-tmp/SIM.imp"
L_0006:;
                                                                //     44    eclist==ecell(eqmax)
#line 44 "regression-bugs-tmp/SIM.imp"
ECLIST = &ECELL[799];
                                                                //     45    ecell(1)_next==nil
#line 45 "regression-bugs-tmp/SIM.imp"
ECELL[0].NEXT = NIL;
                                                                //     46    eventqueue==nil
#line 46 "regression-bugs-tmp/SIM.imp"
EVENTQUEUE = NIL;
                                                                //     47  %end
#line 47 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block INITIALISEARRAYS at level 2
                                                                //     48  
                                                                //     49  %record(*)%map new(%integer size)
#line 49 "regression-bugs-tmp/SIM.imp"
 void /*map*/*NEW( int SIZE )
#line 49 "regression-bugs-tmp/SIM.imp"
{
                                                                //     50  !This assumes that array elements with increasing
                                                                //     51  !indices have increasing addresses
                                                                //     52    %signal 15 %if heapspace>hmax
#line 52 "regression-bugs-tmp/SIM.imp"
if (((HEAPSPACE) <= (5000))) goto L_0008;
#line 52 "regression-bugs-tmp/SIM.imp"
_imp_signal(15, 0, 0, "");
#line 52 "regression-bugs-tmp/SIM.imp"
L_0008:;
                                                                //     53    heap(heapspace)=size; heapspace=heapspace+size+1
#line 53 "regression-bugs-tmp/SIM.imp"
HEAP[(((int)(HEAPSPACE)) - (1))] = SIZE;
#line 53 "regression-bugs-tmp/SIM.imp"
HEAPSPACE = (((int)((((int)(HEAPSPACE)) + (SIZE)))) + (1));
                                                                //     54    %result==record(addr(heap(heapspace-size)))
#line 54 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return _imp_RECORD(_imp_ADDR(&HEAP[(((int)((((int)(HEAPSPACE)) - (SIZE)))) - (1))]));
                                                                //     55  %end
#line 55 "regression-bugs-tmp/SIM.imp"
} // End of block NEW at level 2
                                                                //     56  
                                                                //     57  %record(pinf)%map newpin
#line 57 "regression-bugs-tmp/SIM.imp"
 PINF /*map*/*NEWPIN( void )
#line 57 "regression-bugs-tmp/SIM.imp"
{
                                                                //     58  %record(pinf)%name x==new(psize)
#line 58 "regression-bugs-tmp/SIM.imp"
 PINF /*name*/*X;
#line 58 "regression-bugs-tmp/SIM.imp"
X = NEW(5);
                                                                //     59    x=0; %result==x
#line 59 "regression-bugs-tmp/SIM.imp"
*X = (PINF){ 0 } /* Assign 0's to all fields of record */;
#line 59 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return X;
                                                                //     60  %end
#line 60 "regression-bugs-tmp/SIM.imp"
} // End of block NEWPIN at level 2
                                                                //     61  
                                                                //     62  %record(compf)%map newcomp
#line 62 "regression-bugs-tmp/SIM.imp"
 COMPF /*map*/*NEWCOMP( void )
#line 62 "regression-bugs-tmp/SIM.imp"
{
                                                                //     63  %record(compf)%name x==new(csize)
#line 63 "regression-bugs-tmp/SIM.imp"
 COMPF /*name*/*X;
#line 63 "regression-bugs-tmp/SIM.imp"
X = NEW(5);
                                                                //     64    x=0; %result==x
#line 64 "regression-bugs-tmp/SIM.imp"
*X = (COMPF){ 0 } /* Assign 0's to all fields of record */;
#line 64 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return X;
                                                                //     65  %end
#line 65 "regression-bugs-tmp/SIM.imp"
} // End of block NEWCOMP at level 2
                                                                //     66  
                                                                //     67  %record(sigf)%map newsignal
#line 67 "regression-bugs-tmp/SIM.imp"
 SIGF /*map*/*NEWSIGNAL( void )
#line 67 "regression-bugs-tmp/SIM.imp"
{
                                                                //     68  %record(sigf)%name x==new(ssize)
#line 68 "regression-bugs-tmp/SIM.imp"
 SIGF /*name*/*X;
#line 68 "regression-bugs-tmp/SIM.imp"
X = NEW(10);
                                                                //     69    x=0; x_state=undef; %result==x
#line 69 "regression-bugs-tmp/SIM.imp"
*X = (SIGF){ 0 } /* Assign 0's to all fields of record */;
#line 69 "regression-bugs-tmp/SIM.imp"
X->STATE = (-2147483648);
#line 69 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return X;
                                                                //     70  %end
#line 70 "regression-bugs-tmp/SIM.imp"
} // End of block NEWSIGNAL at level 2
                                                                //     71  
                                                                //     72  %record(hfm)%name history archive==nil
#line 72 "regression-bugs-tmp/SIM.imp"
 HFM /*name*/*HISTORYARCHIVE;
#line 72 "regression-bugs-tmp/SIM.imp"
HISTORYARCHIVE = NIL;
                                                                //     73  
                                                                //     74  %record(hfm)%map get hist
#line 74 "regression-bugs-tmp/SIM.imp"
 HFM /*map*/*GETHIST( void )
#line 74 "regression-bugs-tmp/SIM.imp"
{
                                                                //     75  %record(hfm)%name h
#line 75 "regression-bugs-tmp/SIM.imp"
 HFM /*name*/*H;
                                                                //     76    h==history archive
#line 76 "regression-bugs-tmp/SIM.imp"
H = HISTORYARCHIVE;
                                                                //     77    %if h==nil %then h==new(hsize) %else history archive==h_next
#line 77 "regression-bugs-tmp/SIM.imp"
if (((H) != (NIL))) goto L_0009;
#line 77 "regression-bugs-tmp/SIM.imp"
H = NEW(3);
#line 77 "regression-bugs-tmp/SIM.imp"
goto L_000a;
#line 77 "regression-bugs-tmp/SIM.imp"
L_0009:;
#line 77 "regression-bugs-tmp/SIM.imp"
HISTORYARCHIVE = H->NEXT;
#line 77 "regression-bugs-tmp/SIM.imp"
L_000a:;
                                                                //     78    h=0; %result==h
#line 78 "regression-bugs-tmp/SIM.imp"
*H = (HFM){ 0 } /* Assign 0's to all fields of record */;
#line 78 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return H;
                                                                //     79  %end
#line 79 "regression-bugs-tmp/SIM.imp"
} // End of block GETHIST at level 2
                                                                //     80  
                                                                //     81  %routine put hist(%record(hfm)%name h)
#line 81 "regression-bugs-tmp/SIM.imp"
void PUTHIST(  HFM /*name*/*H )
#line 81 "regression-bugs-tmp/SIM.imp"
{
                                                                //     82    h_next==history archive
#line 82 "regression-bugs-tmp/SIM.imp"
H->NEXT = HISTORYARCHIVE;
                                                                //     83    history archive==h
#line 83 "regression-bugs-tmp/SIM.imp"
HISTORYARCHIVE = H;
                                                                //     84  %end
#line 84 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block PUTHIST at level 2
                                                                //     85  
                                                                //     86  %constinteger esc=27,cur='Y',graph='F',nograph='G',delete='O'
                                                                //     87  %constinteger up='A',home='H',clearscreen='v',clearline='K'
                                                                //     88  %constinteger insert='i',noinsert='j'
                                                                //     89  
                                                                //     90  %routine escape(%integer x)
#line 90 "regression-bugs-tmp/SIM.imp"
void ESCAPE( int X )
#line 90 "regression-bugs-tmp/SIM.imp"
{
                                                                //     91    printsymbol(esc); printsymbol(x)
#line 91 "regression-bugs-tmp/SIM.imp"
_imp_PRINTSYMBOL(27);
#line 91 "regression-bugs-tmp/SIM.imp"
_imp_PRINTSYMBOL(X);
                                                                //     92  %end
#line 92 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block ESCAPE at level 2
                                                                //     93  
                                                                //     94  %routine cursor(%integer x,y)
#line 94 "regression-bugs-tmp/SIM.imp"
void CURSOR( int X, int Y )
#line 94 "regression-bugs-tmp/SIM.imp"
{
                                                                //     95    escape(cur); printsymbol(y+' '); printsymbol(x+' ')
#line 95 "regression-bugs-tmp/SIM.imp"
ESCAPE(89);
#line 95 "regression-bugs-tmp/SIM.imp"
_imp_PRINTSYMBOL((((int)(Y)) + (32)));
#line 95 "regression-bugs-tmp/SIM.imp"
_imp_PRINTSYMBOL((((int)(X)) + (32)));
                                                                //     96  %end
#line 96 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block CURSOR at level 2
                                                                //     97  
                                                                //     98  %integerfn upper(%integer old,new)
#line 98 "regression-bugs-tmp/SIM.imp"
int UPPER( int OLD, int NEW )
#line 98 "regression-bugs-tmp/SIM.imp"
{
                                                                //     99    old=old+old %if |old|=rising
#line 99 "regression-bugs-tmp/SIM.imp"
if (((_imp_IMOD(OLD)) != (1))) goto L_000b;
#line 99 "regression-bugs-tmp/SIM.imp"
OLD = (((int)(OLD)) + (OLD));
#line 99 "regression-bugs-tmp/SIM.imp"
L_000b:;
                                                                //    100    new=new+new %if |new|=rising
#line 100 "regression-bugs-tmp/SIM.imp"
if (((_imp_IMOD(NEW)) != (1))) goto L_000c;
#line 100 "regression-bugs-tmp/SIM.imp"
NEW = (((int)(NEW)) + (NEW));
#line 100 "regression-bugs-tmp/SIM.imp"
L_000c:;
                                                                //    101    %if old=high %start
#line 101 "regression-bugs-tmp/SIM.imp"
if (((OLD) != (2))) goto L_000d;
                                                                //    102      %result='`' %if new=high
#line 102 "regression-bugs-tmp/SIM.imp"
if (((NEW) != (2))) goto L_000e;
#line 102 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return 96;
#line 102 "regression-bugs-tmp/SIM.imp"
L_000e:;
                                                                //    103      %result='l' %if new=low
#line 103 "regression-bugs-tmp/SIM.imp"
if (((NEW) != ((-2)))) goto L_000f;
#line 103 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return 108;
#line 103 "regression-bugs-tmp/SIM.imp"
L_000f:;
                                                                //    104      %result='d' %if new=open
#line 104 "regression-bugs-tmp/SIM.imp"
if (((NEW) != (0))) goto L_0010;
#line 104 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return 100;
#line 104 "regression-bugs-tmp/SIM.imp"
L_0010:;
                                                                //    105      %result='l'
#line 105 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return 108;
                                                                //    106    %finish
#line 106 "regression-bugs-tmp/SIM.imp"
L_000d:;
                                                                //    107    %if old=low %start
#line 107 "regression-bugs-tmp/SIM.imp"
if (((OLD) != ((-2)))) goto L_0011;
                                                                //    108      %result='s' %if new=high
#line 108 "regression-bugs-tmp/SIM.imp"
if (((NEW) != (2))) goto L_0012;
#line 108 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return 115;
#line 108 "regression-bugs-tmp/SIM.imp"
L_0012:;
                                                                //    109      %result=' ' %if new=low
#line 109 "regression-bugs-tmp/SIM.imp"
if (((NEW) != ((-2)))) goto L_0013;
#line 109 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return 32;
#line 109 "regression-bugs-tmp/SIM.imp"
L_0013:;
                                                                //    110      %result='s' %if new=open
#line 110 "regression-bugs-tmp/SIM.imp"
if (((NEW) != (0))) goto L_0014;
#line 110 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return 115;
#line 110 "regression-bugs-tmp/SIM.imp"
L_0014:;
                                                                //    111      %result=' '
#line 111 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return 32;
                                                                //    112    %finish
#line 112 "regression-bugs-tmp/SIM.imp"
L_0011:;
                                                                //    113    %if old=open %start
#line 113 "regression-bugs-tmp/SIM.imp"
if (((OLD) != (0))) goto L_0015;
                                                                //    114      %result='d' %if new=high
#line 114 "regression-bugs-tmp/SIM.imp"
if (((NEW) != (2))) goto L_0016;
#line 114 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return 100;
#line 114 "regression-bugs-tmp/SIM.imp"
L_0016:;
                                                                //    115      %result='l' %if new=low
#line 115 "regression-bugs-tmp/SIM.imp"
if (((NEW) != ((-2)))) goto L_0017;
#line 115 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return 108;
#line 115 "regression-bugs-tmp/SIM.imp"
L_0017:;
                                                                //    116      %result='d' %if new=open
#line 116 "regression-bugs-tmp/SIM.imp"
if (((NEW) != (0))) goto L_0018;
#line 116 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return 100;
#line 116 "regression-bugs-tmp/SIM.imp"
L_0018:;
                                                                //    117      %result='l'
#line 117 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return 108;
                                                                //    118    %finish
#line 118 "regression-bugs-tmp/SIM.imp"
L_0015:;
                                                                //    119    %result='s' %if new=high
#line 119 "regression-bugs-tmp/SIM.imp"
if (((NEW) != (2))) goto L_0019;
#line 119 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return 115;
#line 119 "regression-bugs-tmp/SIM.imp"
L_0019:;
                                                                //    120    %result=' ' %if new=low
#line 120 "regression-bugs-tmp/SIM.imp"
if (((NEW) != ((-2)))) goto L_001a;
#line 120 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return 32;
#line 120 "regression-bugs-tmp/SIM.imp"
L_001a:;
                                                                //    121    %result=' ' %if new=open
#line 121 "regression-bugs-tmp/SIM.imp"
if (((NEW) != (0))) goto L_001b;
#line 121 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return 32;
#line 121 "regression-bugs-tmp/SIM.imp"
L_001b:;
                                                                //    122    %result=' '
#line 122 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return 32;
                                                                //    123  %end
#line 123 "regression-bugs-tmp/SIM.imp"
} // End of block UPPER at level 2
                                                                //    124  
                                                                //    125  %integerfn lower(%integer old,new)
#line 125 "regression-bugs-tmp/SIM.imp"
int LOWER( int OLD, int NEW )
#line 125 "regression-bugs-tmp/SIM.imp"
{
                                                                //    126    old=old+old %if |old|=rising
#line 126 "regression-bugs-tmp/SIM.imp"
if (((_imp_IMOD(OLD)) != (1))) goto L_001c;
#line 126 "regression-bugs-tmp/SIM.imp"
OLD = (((int)(OLD)) + (OLD));
#line 126 "regression-bugs-tmp/SIM.imp"
L_001c:;
                                                                //    127    new=new+new %if |new|=rising
#line 127 "regression-bugs-tmp/SIM.imp"
if (((_imp_IMOD(NEW)) != (1))) goto L_001d;
#line 127 "regression-bugs-tmp/SIM.imp"
NEW = (((int)(NEW)) + (NEW));
#line 127 "regression-bugs-tmp/SIM.imp"
L_001d:;
                                                                //    128    %if old=high %start
#line 128 "regression-bugs-tmp/SIM.imp"
if (((OLD) != (2))) goto L_001e;
                                                                //    129      %result=' ' %if new=high
#line 129 "regression-bugs-tmp/SIM.imp"
if (((NEW) != (2))) goto L_001f;
#line 129 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return 32;
#line 129 "regression-bugs-tmp/SIM.imp"
L_001f:;
                                                                //    130      %result='e' %if new=low
#line 130 "regression-bugs-tmp/SIM.imp"
if (((NEW) != ((-2)))) goto L_0020;
#line 130 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return 101;
#line 130 "regression-bugs-tmp/SIM.imp"
L_0020:;
                                                                //    131      %result='e' %if new=open
#line 131 "regression-bugs-tmp/SIM.imp"
if (((NEW) != (0))) goto L_0021;
#line 131 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return 101;
#line 131 "regression-bugs-tmp/SIM.imp"
L_0021:;
                                                                //    132      %result=' '
#line 132 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return 32;
                                                                //    133    %finish
#line 133 "regression-bugs-tmp/SIM.imp"
L_001e:;
                                                                //    134    %if old=low %start
#line 134 "regression-bugs-tmp/SIM.imp"
if (((OLD) != ((-2)))) goto L_0022;
                                                                //    135      %result='m' %if new=high
#line 135 "regression-bugs-tmp/SIM.imp"
if (((NEW) != (2))) goto L_0023;
#line 135 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return 109;
#line 135 "regression-bugs-tmp/SIM.imp"
L_0023:;
                                                                //    136      %result='`' %if new=low
#line 136 "regression-bugs-tmp/SIM.imp"
if (((NEW) != ((-2)))) goto L_0024;
#line 136 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return 96;
#line 136 "regression-bugs-tmp/SIM.imp"
L_0024:;
                                                                //    137      %result='c' %if new=open
#line 137 "regression-bugs-tmp/SIM.imp"
if (((NEW) != (0))) goto L_0025;
#line 137 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return 99;
#line 137 "regression-bugs-tmp/SIM.imp"
L_0025:;
                                                                //    138      %result='m'
#line 138 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return 109;
                                                                //    139    %finish
#line 139 "regression-bugs-tmp/SIM.imp"
L_0022:;
                                                                //    140    %if old=open %start
#line 140 "regression-bugs-tmp/SIM.imp"
if (((OLD) != (0))) goto L_0026;
                                                                //    141      %result='m' %if new=high
#line 141 "regression-bugs-tmp/SIM.imp"
if (((NEW) != (2))) goto L_0027;
#line 141 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return 109;
#line 141 "regression-bugs-tmp/SIM.imp"
L_0027:;
                                                                //    142      %result='c' %if new=low
#line 142 "regression-bugs-tmp/SIM.imp"
if (((NEW) != ((-2)))) goto L_0028;
#line 142 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return 99;
#line 142 "regression-bugs-tmp/SIM.imp"
L_0028:;
                                                                //    143      %result='c' %if new=open
#line 143 "regression-bugs-tmp/SIM.imp"
if (((NEW) != (0))) goto L_0029;
#line 143 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return 99;
#line 143 "regression-bugs-tmp/SIM.imp"
L_0029:;
                                                                //    144      %result='m'
#line 144 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return 109;
                                                                //    145    %finish
#line 145 "regression-bugs-tmp/SIM.imp"
L_0026:;
                                                                //    146    %result='e' %if new=high
#line 146 "regression-bugs-tmp/SIM.imp"
if (((NEW) != (2))) goto L_002a;
#line 146 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return 101;
#line 146 "regression-bugs-tmp/SIM.imp"
L_002a:;
                                                                //    147    %result='e' %if new=low
#line 147 "regression-bugs-tmp/SIM.imp"
if (((NEW) != ((-2)))) goto L_002b;
#line 147 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return 101;
#line 147 "regression-bugs-tmp/SIM.imp"
L_002b:;
                                                                //    148    %result='%' %if new=open
#line 148 "regression-bugs-tmp/SIM.imp"
if (((NEW) != (0))) goto L_002c;
#line 148 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return 37;
#line 148 "regression-bugs-tmp/SIM.imp"
L_002c:;
                                                                //    149    %result=' '
#line 149 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return 32;
                                                                //    150  %end
#line 150 "regression-bugs-tmp/SIM.imp"
} // End of block LOWER at level 2
                                                                //    151  
                                                                //    152  %routine refresh(%integer i)
#line 152 "regression-bugs-tmp/SIM.imp"
void REFRESH( int I )
#line 152 "regression-bugs-tmp/SIM.imp"
{
                                                                //    153  %integer old,new
#line 153 "regression-bugs-tmp/SIM.imp"
int OLD;
#line 153 "regression-bugs-tmp/SIM.imp"
int NEW;
                                                                //    154  %record(sigf)%name s
#line 154 "regression-bugs-tmp/SIM.imp"
 SIGF /*name*/*S;
                                                                //    155  %record(hfm)%name h
#line 155 "regression-bugs-tmp/SIM.imp"
 HFM /*name*/*H;
                                                                //    156    s==slot(i); %returnif s==nil
#line 156 "regression-bugs-tmp/SIM.imp"
S = SLOT[(((int)(I)) - (1))];
#line 156 "regression-bugs-tmp/SIM.imp"
if (((S) != (NIL))) goto L_002d;
#line 156 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return;
#line 156 "regression-bugs-tmp/SIM.imp"
L_002d:;
                                                                //    157    cursor(0,i+i+1); escape(clearline)
#line 157 "regression-bugs-tmp/SIM.imp"
CURSOR(0, (((int)((((int)(I)) + (I)))) + (1)));
#line 157 "regression-bugs-tmp/SIM.imp"
ESCAPE(75);
                                                                //    158    cursor(0,i+i);   escape(clearline)
#line 158 "regression-bugs-tmp/SIM.imp"
CURSOR(0, (((int)(I)) + (I)));
#line 158 "regression-bugs-tmp/SIM.imp"
ESCAPE(75);
                                                                //    159    cursor(65,i+i+1); printstring(s_name)
#line 159 "regression-bugs-tmp/SIM.imp"
CURSOR(65, (((int)((((int)(I)) + (I)))) + (1)));
#line 159 "regression-bugs-tmp/SIM.imp"
_imp_PRINTSTRING(S->NAME);
                                                                //    160    cursor(65,i+i);   printstring(s_name); newline
#line 160 "regression-bugs-tmp/SIM.imp"
CURSOR(65, (((int)(I)) + (I)));
#line 160 "regression-bugs-tmp/SIM.imp"
_imp_PRINTSTRING(S->NAME);
#line 160 "regression-bugs-tmp/SIM.imp"
_imp_NEWLINE();
                                                                //    161  !rest not in yet
                                                                //    162  %end
#line 162 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block REFRESH at level 2
                                                                //    163  
                                                                //    164  %routine log(%record(sigf)%name s,%integer old)
#line 164 "regression-bugs-tmp/SIM.imp"
void LOG(  SIGF /*name*/*S, int OLD )
#line 164 "regression-bugs-tmp/SIM.imp"
{
                                                                //    165  %integer new,i
#line 165 "regression-bugs-tmp/SIM.imp"
int NEW;
#line 165 "regression-bugs-tmp/SIM.imp"
int I;
                                                                //    166  %record(hfm)%name h,hh
#line 166 "regression-bugs-tmp/SIM.imp"
 HFM /*name*/*H;
#line 166 "regression-bugs-tmp/SIM.imp"
 HFM /*name*/*HH;
                                                                //    167    escape(graph)
#line 167 "regression-bugs-tmp/SIM.imp"
ESCAPE(70);
                                                                //    168    %if s==nil %start; ! Time has passed: old=ticks
#line 168 "regression-bugs-tmp/SIM.imp"
if (((S) != (NIL))) goto L_002e;
                                                                //    169      %while old>0 %cycle
#line 169 "regression-bugs-tmp/SIM.imp"
L_002f:;
#line 169 "regression-bugs-tmp/SIM.imp"
if (((OLD) <= (0))) goto L_0030;
                                                                //    170        old=old-1
#line 170 "regression-bugs-tmp/SIM.imp"
OLD = (((int)(OLD)) - (1));
                                                                //    171        escape(insert)
#line 171 "regression-bugs-tmp/SIM.imp"
ESCAPE(105);
                                                                //    172        %for i=slotmax,-1,1 %cycle
#line 172 "regression-bugs-tmp/SIM.imp"
I = 12;
if ((((1)-(11)) % ((-1))) != 0) _imp_signal(5,1,0,"Illegal cycle I = 11, (-1), 1");
L_0032:;
if (I == 1) goto L_0033;
I += (-1);
                                                                //    173          %unless slot(i)==nil %start
#line 173 "regression-bugs-tmp/SIM.imp"
if (((SLOT[(((int)(I)) - (1))]) == (NIL))) goto L_0035;
                                                                //    174            new=slot(i)_state
#line 174 "regression-bugs-tmp/SIM.imp"
NEW = SLOT[(((int)(I)) - (1))]->STATE;
                                                                //    175            cursor(0,i+i+1); escape(delete); cursor(63,i+i+1)
#line 175 "regression-bugs-tmp/SIM.imp"
CURSOR(0, (((int)((((int)(I)) + (I)))) + (1)));
#line 175 "regression-bugs-tmp/SIM.imp"
ESCAPE(79);
#line 175 "regression-bugs-tmp/SIM.imp"
CURSOR(63, (((int)((((int)(I)) + (I)))) + (1)));
                                                                //    176            printsymbol(lower(new,new))
#line 176 "regression-bugs-tmp/SIM.imp"
_imp_PRINTSYMBOL(LOWER(NEW, NEW));
                                                                //    177            cursor(0,i+i); escape(delete);   cursor(63,i+i)
#line 177 "regression-bugs-tmp/SIM.imp"
CURSOR(0, (((int)(I)) + (I)));
#line 177 "regression-bugs-tmp/SIM.imp"
ESCAPE(79);
#line 177 "regression-bugs-tmp/SIM.imp"
CURSOR(63, (((int)(I)) + (I)));
                                                                //    178            printsymbol(upper(new,new))
#line 178 "regression-bugs-tmp/SIM.imp"
_imp_PRINTSYMBOL(UPPER(NEW, NEW));
                                                                //    179            newline; !??
#line 179 "regression-bugs-tmp/SIM.imp"
_imp_NEWLINE();
                                                                //    180          %finish
#line 180 "regression-bugs-tmp/SIM.imp"
L_0035:;
                                                                //    181        %repeat
#line 181 "regression-bugs-tmp/SIM.imp"
goto L_0032;
#line 181 "regression-bugs-tmp/SIM.imp"
L_0033:;
                                                                //    182        escape(noinsert)
#line 182 "regression-bugs-tmp/SIM.imp"
ESCAPE(106);
                                                                //    183      %repeat
#line 183 "regression-bugs-tmp/SIM.imp"
goto L_002f;
#line 183 "regression-bugs-tmp/SIM.imp"
L_0030:;
                                                                //    184    %finishelsestart; ! Signal has changed: old=previous state
#line 184 "regression-bugs-tmp/SIM.imp"
goto L_0036;
#line 184 "regression-bugs-tmp/SIM.imp"
L_002e:;
                                                                //    185      new=s_state
#line 185 "regression-bugs-tmp/SIM.imp"
NEW = S->STATE;
                                                                //    186      h==s_history
#line 186 "regression-bugs-tmp/SIM.imp"
H = S->HISTORY;
                                                                //    187      %if h==nil %start
#line 187 "regression-bugs-tmp/SIM.imp"
if (((H) != (NIL))) goto L_0037;
                                                                //    188        h==get hist; h_next==h; s_history==h
#line 188 "regression-bugs-tmp/SIM.imp"
H = GETHIST();
#line 188 "regression-bugs-tmp/SIM.imp"
H->NEXT = H;
#line 188 "regression-bugs-tmp/SIM.imp"
S->HISTORY = H;
                                                                //    189        h_since=now; h_state=new
#line 189 "regression-bugs-tmp/SIM.imp"
H->SINCE = NOW;
#line 189 "regression-bugs-tmp/SIM.imp"
H->STATE = NEW;
                                                                //    190      %finishelsestart
#line 190 "regression-bugs-tmp/SIM.imp"
goto L_0038;
#line 190 "regression-bugs-tmp/SIM.imp"
L_0037:;
                                                                //    191        old=h_state; ! overriding
#line 191 "regression-bugs-tmp/SIM.imp"
OLD = H->STATE;
                                                                //    192        hh==get hist; hh_next==h_next; h_next==hh; s_history==hh
#line 192 "regression-bugs-tmp/SIM.imp"
HH = GETHIST();
#line 192 "regression-bugs-tmp/SIM.imp"
HH->NEXT = H->NEXT;
#line 192 "regression-bugs-tmp/SIM.imp"
H->NEXT = HH;
#line 192 "regression-bugs-tmp/SIM.imp"
S->HISTORY = HH;
                                                                //    193        hh_since=now; hh_state=new
#line 193 "regression-bugs-tmp/SIM.imp"
HH->SINCE = NOW;
#line 193 "regression-bugs-tmp/SIM.imp"
HH->STATE = NEW;
                                                                //    194        h==hh
#line 194 "regression-bugs-tmp/SIM.imp"
H = HH;
                                                                //    195      %finish
#line 195 "regression-bugs-tmp/SIM.imp"
L_0038:;
                                                                //    196      %while h_next_next_since <= now-64 %cycle; !scavenge
#line 196 "regression-bugs-tmp/SIM.imp"
L_0039:;
#line 196 "regression-bugs-tmp/SIM.imp"
if (((H->NEXT->NEXT->SINCE) > ((((int)(NOW)) - (64))))) goto L_003a;
                                                                //    197        hh==h_next; h_next==hh_next; put hist(hh)
#line 197 "regression-bugs-tmp/SIM.imp"
HH = H->NEXT;
#line 197 "regression-bugs-tmp/SIM.imp"
H->NEXT = HH->NEXT;
#line 197 "regression-bugs-tmp/SIM.imp"
PUTHIST(HH);
                                                                //    198      %repeat
#line 198 "regression-bugs-tmp/SIM.imp"
goto L_0039;
#line 198 "regression-bugs-tmp/SIM.imp"
L_003a:;
                                                                //    199      i=s_screenslot
#line 199 "regression-bugs-tmp/SIM.imp"
I = S->SCREENSLOT;
                                                                //    200      %if i#0 %start
#line 200 "regression-bugs-tmp/SIM.imp"
if (((I) == (0))) goto L_003c;
                                                                //    201        cursor(63,i+i+1); printsymbol(lower(old,new))
#line 201 "regression-bugs-tmp/SIM.imp"
CURSOR(63, (((int)((((int)(I)) + (I)))) + (1)));
#line 201 "regression-bugs-tmp/SIM.imp"
_imp_PRINTSYMBOL(LOWER(OLD, NEW));
                                                                //    202        cursor(63,i+i);   printsymbol(upper(old,new))
#line 202 "regression-bugs-tmp/SIM.imp"
CURSOR(63, (((int)(I)) + (I)));
#line 202 "regression-bugs-tmp/SIM.imp"
_imp_PRINTSYMBOL(UPPER(OLD, NEW));
                                                                //    203        newline; !??
#line 203 "regression-bugs-tmp/SIM.imp"
_imp_NEWLINE();
                                                                //    204      %finish
#line 204 "regression-bugs-tmp/SIM.imp"
L_003c:;
                                                                //    205    %finish
#line 205 "regression-bugs-tmp/SIM.imp"
L_0036:;
                                                                //    206    escape(nograph); newline; !??
#line 206 "regression-bugs-tmp/SIM.imp"
ESCAPE(71);
#line 206 "regression-bugs-tmp/SIM.imp"
_imp_NEWLINE();
                                                                //    207  %end
#line 207 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block LOG at level 2
                                                                //    208  
                                                                //    209  %routine print(%integer state)
#line 209 "regression-bugs-tmp/SIM.imp"
void PRINT( int STATE )
#line 209 "regression-bugs-tmp/SIM.imp"
{
                                                                //    210    %if state=high    %then printstring("high")      %elsec
#line 210 "regression-bugs-tmp/SIM.imp"
if (((STATE) != (2))) goto L_003d;
#line 210 "regression-bugs-tmp/SIM.imp"
_imp_PRINTSTRING(_imp_str_literal("high"));
#line 210 "regression-bugs-tmp/SIM.imp"
goto L_003e;
#line 210 "regression-bugs-tmp/SIM.imp"
L_003d:;
#line 210 "regression-bugs-tmp/SIM.imp"
if (((STATE) != ((-2)))) goto L_003f;
#line 210 "regression-bugs-tmp/SIM.imp"
_imp_PRINTSTRING(_imp_str_literal("low"));
#line 210 "regression-bugs-tmp/SIM.imp"
goto L_003e;
#line 210 "regression-bugs-tmp/SIM.imp"
L_003f:;
#line 210 "regression-bugs-tmp/SIM.imp"
if (((STATE) != ((-2147483648)))) goto L_0040;
#line 210 "regression-bugs-tmp/SIM.imp"
_imp_PRINTSTRING(_imp_str_literal("undefined"));
#line 210 "regression-bugs-tmp/SIM.imp"
goto L_003e;
#line 210 "regression-bugs-tmp/SIM.imp"
L_0040:;
#line 210 "regression-bugs-tmp/SIM.imp"
if (((STATE) != (0))) goto L_0041;
#line 210 "regression-bugs-tmp/SIM.imp"
_imp_PRINTSTRING(_imp_str_literal("open"));
#line 210 "regression-bugs-tmp/SIM.imp"
goto L_003e;
#line 210 "regression-bugs-tmp/SIM.imp"
L_0041:;
#line 210 "regression-bugs-tmp/SIM.imp"
if (((STATE) != (1))) goto L_0042;
#line 210 "regression-bugs-tmp/SIM.imp"
_imp_PRINTSTRING(_imp_str_literal("rising"));
#line 210 "regression-bugs-tmp/SIM.imp"
goto L_003e;
#line 210 "regression-bugs-tmp/SIM.imp"
L_0042:;
#line 210 "regression-bugs-tmp/SIM.imp"
if (((STATE) != ((-1)))) goto L_0043;
#line 210 "regression-bugs-tmp/SIM.imp"
_imp_PRINTSTRING(_imp_str_literal("falling"));
#line 210 "regression-bugs-tmp/SIM.imp"
L_0043:;
#line 210 "regression-bugs-tmp/SIM.imp"
L_003e:;
                                                                //    211    %if state=low     %then printstring("low")       %elsec
                                                                //    212    %if state=undef   %then printstring("undefined") %elsec
                                                                //    213    %if state=open    %then printstring("open")      %elsec
                                                                //    214    %if state=rising  %then printstring("rising")    %elsec
                                                                //    215    %if state=falling %then printstring("falling")
                                                                //    216    newline
#line 216 "regression-bugs-tmp/SIM.imp"
_imp_NEWLINE();
                                                                //    217  %end
#line 217 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block PRINT at level 2
                                                                //    218  
                                                                //    219  
                                                                //    220  %routinespec excite(%record(compf)%name c)
#line 220 "regression-bugs-tmp/SIM.imp"
auto void EXCITE(  COMPF /*name*/*C );
                                                                //    221  
                                                                //    222  %routine propagate(%record(sigf)%name signal)
#line 222 "regression-bugs-tmp/SIM.imp"
void PROPAGATE(  SIGF /*name*/*SIGNAL )
#line 222 "regression-bugs-tmp/SIM.imp"
{
                                                                //    223  %integer new,y,old
#line 223 "regression-bugs-tmp/SIM.imp"
int NEW;
#line 223 "regression-bugs-tmp/SIM.imp"
int Y;
#line 223 "regression-bugs-tmp/SIM.imp"
int OLD;
                                                                //    224  %record(pinf)%name p
#line 224 "regression-bugs-tmp/SIM.imp"
 PINF /*name*/*P;
                                                                //    225  
                                                                //    226    old=signal_state
#line 226 "regression-bugs-tmp/SIM.imp"
OLD = SIGNAL->STATE;
                                                                //    227    p==signal_from
#line 227 "regression-bugs-tmp/SIM.imp"
P = SIGNAL->FROM;
                                                                //    228    %if p==nil %start;     ! External input
#line 228 "regression-bugs-tmp/SIM.imp"
if (((P) != (NIL))) goto L_0044;
                                                                //    229      new=old; old=undef
#line 229 "regression-bugs-tmp/SIM.imp"
NEW = OLD;
#line 229 "regression-bugs-tmp/SIM.imp"
OLD = (-2147483648);
                                                                //    230    %finishelsestart;      ! Establish agreement from all sources
#line 230 "regression-bugs-tmp/SIM.imp"
goto L_0045;
#line 230 "regression-bugs-tmp/SIM.imp"
L_0044:;
                                                                //    231      new=open
#line 231 "regression-bugs-tmp/SIM.imp"
NEW = 0;
                                                                //    232      %cycle
#line 232 "regression-bugs-tmp/SIM.imp"
L_0046:;
                                                                //    233        y=p_state; new=y %if new#y %and new=open
#line 233 "regression-bugs-tmp/SIM.imp"
Y = P->STATE;
#line 233 "regression-bugs-tmp/SIM.imp"
if (((NEW) == (Y))) goto L_0049;
#line 233 "regression-bugs-tmp/SIM.imp"
if (((NEW) != (0))) goto L_0049;
#line 233 "regression-bugs-tmp/SIM.imp"
NEW = Y;
#line 233 "regression-bugs-tmp/SIM.imp"
L_0049:;
                                                                //    234        new=undef %andexitif new#y %and y#open; !Conflict
#line 234 "regression-bugs-tmp/SIM.imp"
if (((NEW) == (Y))) goto L_004a;
#line 234 "regression-bugs-tmp/SIM.imp"
if (((Y) == (0))) goto L_004a;
#line 234 "regression-bugs-tmp/SIM.imp"
NEW = (-2147483648);
#line 234 "regression-bugs-tmp/SIM.imp"
goto L_0047;
#line 234 "regression-bugs-tmp/SIM.imp"
L_004a:;
                                                                //    235        p==p_chain
#line 235 "regression-bugs-tmp/SIM.imp"
P = P->CHAIN;
                                                                //    236      %repeatuntil p==nil
#line 236 "regression-bugs-tmp/SIM.imp"
if (((P) == (NIL))) goto L_0047;
#line 236 "regression-bugs-tmp/SIM.imp"
goto L_0046;
#line 236 "regression-bugs-tmp/SIM.imp"
L_0047:;
                                                                //    237      %returnif signal_state=new
#line 237 "regression-bugs-tmp/SIM.imp"
if (((SIGNAL->STATE) != (NEW))) goto L_004b;
#line 237 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return;
#line 237 "regression-bugs-tmp/SIM.imp"
L_004b:;
                                                                //    238      %if |old|=rising %start; !Forced: Set all sources
#line 238 "regression-bugs-tmp/SIM.imp"
if (((_imp_IMOD(OLD)) != (1))) goto L_004c;
                                                                //    239        new=old+old; p==signal_from
#line 239 "regression-bugs-tmp/SIM.imp"
NEW = (((int)(OLD)) + (OLD));
#line 239 "regression-bugs-tmp/SIM.imp"
P = SIGNAL->FROM;
                                                                //    240        %cycle
#line 240 "regression-bugs-tmp/SIM.imp"
L_004d:;
                                                                //    241          p_state=new; p==p_chain
#line 241 "regression-bugs-tmp/SIM.imp"
P->STATE = NEW;
#line 241 "regression-bugs-tmp/SIM.imp"
P = P->CHAIN;
                                                                //    242        %repeatuntil p==nil
#line 242 "regression-bugs-tmp/SIM.imp"
if (((P) == (NIL))) goto L_004e;
#line 242 "regression-bugs-tmp/SIM.imp"
goto L_004d;
#line 242 "regression-bugs-tmp/SIM.imp"
L_004e:;
                                                                //    243        newline
#line 243 "regression-bugs-tmp/SIM.imp"
_imp_NEWLINE();
                                                                //    244      %finish
#line 244 "regression-bugs-tmp/SIM.imp"
L_004c:;
                                                                //    245      signal_state=new
#line 245 "regression-bugs-tmp/SIM.imp"
SIGNAL->STATE = NEW;
                                                                //    246    %finish
#line 246 "regression-bugs-tmp/SIM.imp"
L_0045:;
                                                                //    247  
                                                                //    248    log(signal,old)
#line 248 "regression-bugs-tmp/SIM.imp"
LOG(SIGNAL, OLD);
                                                                //    249  
                                                                //    250  ! Excite all components with inputs connected to this signal
                                                                //    251  
                                                                //    252    p==signal_to
#line 252 "regression-bugs-tmp/SIM.imp"
P = SIGNAL->TO;
                                                                //    253    y=new; y=rising %if y=high; y=falling %if y=low
#line 253 "regression-bugs-tmp/SIM.imp"
Y = NEW;
#line 253 "regression-bugs-tmp/SIM.imp"
if (((Y) != (2))) goto L_0050;
#line 253 "regression-bugs-tmp/SIM.imp"
Y = 1;
#line 253 "regression-bugs-tmp/SIM.imp"
L_0050:;
#line 253 "regression-bugs-tmp/SIM.imp"
if (((Y) != ((-2)))) goto L_0051;
#line 253 "regression-bugs-tmp/SIM.imp"
Y = (-1);
#line 253 "regression-bugs-tmp/SIM.imp"
L_0051:;
                                                                //    254    %whilenot p==nil %cycle
#line 254 "regression-bugs-tmp/SIM.imp"
L_0052:;
#line 254 "regression-bugs-tmp/SIM.imp"
if (((P) == (NIL))) goto L_0053;
                                                                //    255      p_state=y; excite(p_comp)
#line 255 "regression-bugs-tmp/SIM.imp"
P->STATE = Y;
#line 255 "regression-bugs-tmp/SIM.imp"
EXCITE(P->COMP);
                                                                //    256      p_state=new; excite(p_comp); p==p_chain
#line 256 "regression-bugs-tmp/SIM.imp"
P->STATE = NEW;
#line 256 "regression-bugs-tmp/SIM.imp"
EXCITE(P->COMP);
#line 256 "regression-bugs-tmp/SIM.imp"
P = P->CHAIN;
                                                                //    257    %repeat
#line 257 "regression-bugs-tmp/SIM.imp"
goto L_0052;
#line 257 "regression-bugs-tmp/SIM.imp"
L_0053:;
                                                                //    258  %end
#line 258 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block PROPAGATE at level 2
                                                                //    259  
                                                                //    260  %routine make(%record(pinf)%name pin,%integer new,when)
#line 260 "regression-bugs-tmp/SIM.imp"
void MAKE(  PINF /*name*/*PIN, int NEW, int WHEN )
#line 260 "regression-bugs-tmp/SIM.imp"
{
                                                                //    261  %record(eqf)%name e,f
#line 261 "regression-bugs-tmp/SIM.imp"
 EQF /*name*/*E;
#line 261 "regression-bugs-tmp/SIM.imp"
 EQF /*name*/*F;
                                                                //    262  %integer old
#line 262 "regression-bugs-tmp/SIM.imp"
int OLD;
                                                                //    263    new=new+new %if |new|=rising
#line 263 "regression-bugs-tmp/SIM.imp"
if (((_imp_IMOD(NEW)) != (1))) goto L_0055;
#line 263 "regression-bugs-tmp/SIM.imp"
NEW = (((int)(NEW)) + (NEW));
#line 263 "regression-bugs-tmp/SIM.imp"
L_0055:;
                                                                //    264    %unless when=now %start;   ! Insert this event in event queue
#line 264 "regression-bugs-tmp/SIM.imp"
if (((WHEN) == (NOW))) goto L_0056;
                                                                //    265      e==eclist; %signal 15 %if e==nil
#line 265 "regression-bugs-tmp/SIM.imp"
E = ECLIST;
#line 265 "regression-bugs-tmp/SIM.imp"
if (((E) != (NIL))) goto L_0057;
#line 265 "regression-bugs-tmp/SIM.imp"
_imp_signal(15, 0, 0, "");
#line 265 "regression-bugs-tmp/SIM.imp"
L_0057:;
                                                                //    266      eclist==e_next; e_next==nil
#line 266 "regression-bugs-tmp/SIM.imp"
ECLIST = E->NEXT;
#line 266 "regression-bugs-tmp/SIM.imp"
E->NEXT = NIL;
                                                                //    267      e_pin==pin; e_state=new; e_when=when
#line 267 "regression-bugs-tmp/SIM.imp"
E->PIN = PIN;
#line 267 "regression-bugs-tmp/SIM.imp"
E->STATE = NEW;
#line 267 "regression-bugs-tmp/SIM.imp"
E->WHEN = WHEN;
                                                                //    268      f==eventqueue
#line 268 "regression-bugs-tmp/SIM.imp"
F = EVENTQUEUE;
                                                                //    269      %if f==nil %start
#line 269 "regression-bugs-tmp/SIM.imp"
if (((F) != (NIL))) goto L_0058;
                                                                //    270        eventqueue==e; %return
#line 270 "regression-bugs-tmp/SIM.imp"
EVENTQUEUE = E;
#line 270 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return;
                                                                //    271      %finish
#line 271 "regression-bugs-tmp/SIM.imp"
L_0058:;
                                                                //    272      %if when<f_when %start
#line 272 "regression-bugs-tmp/SIM.imp"
if (((WHEN) >= (F->WHEN))) goto L_0059;
                                                                //    273        e_next==f; eventqueue==e; %return
#line 273 "regression-bugs-tmp/SIM.imp"
E->NEXT = F;
#line 273 "regression-bugs-tmp/SIM.imp"
EVENTQUEUE = E;
#line 273 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return;
                                                                //    274      %finish
#line 274 "regression-bugs-tmp/SIM.imp"
L_0059:;
                                                                //    275      %cycle
#line 275 "regression-bugs-tmp/SIM.imp"
L_005a:;
                                                                //    276        %if f_next==nil %start
#line 276 "regression-bugs-tmp/SIM.imp"
if (((F->NEXT) != (NIL))) goto L_005d;
                                                                //    277          f_next==e; %return
#line 277 "regression-bugs-tmp/SIM.imp"
F->NEXT = E;
#line 277 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return;
                                                                //    278        %finish
#line 278 "regression-bugs-tmp/SIM.imp"
L_005d:;
                                                                //    279        %if when<f_next_when %start
#line 279 "regression-bugs-tmp/SIM.imp"
if (((WHEN) >= (F->NEXT->WHEN))) goto L_005e;
                                                                //    280          e_next==f_next; f_next==e; %return
#line 280 "regression-bugs-tmp/SIM.imp"
E->NEXT = F->NEXT;
#line 280 "regression-bugs-tmp/SIM.imp"
F->NEXT = E;
#line 280 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return;
                                                                //    281        %finish
#line 281 "regression-bugs-tmp/SIM.imp"
L_005e:;
                                                                //    282        f==f_next
#line 282 "regression-bugs-tmp/SIM.imp"
F = F->NEXT;
                                                                //    283      %repeat
#line 283 "regression-bugs-tmp/SIM.imp"
goto L_005a;
                                                                //    284    %finish
#line 284 "regression-bugs-tmp/SIM.imp"
L_0056:;
                                                                //    285    old=pin_state; %returnif old=new
#line 285 "regression-bugs-tmp/SIM.imp"
OLD = PIN->STATE;
#line 285 "regression-bugs-tmp/SIM.imp"
if (((OLD) != (NEW))) goto L_005f;
#line 285 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return;
#line 285 "regression-bugs-tmp/SIM.imp"
L_005f:;
                                                                //    286    pin_state=new; %returnif pin_signal==nil
#line 286 "regression-bugs-tmp/SIM.imp"
PIN->STATE = NEW;
#line 286 "regression-bugs-tmp/SIM.imp"
if (((PIN->SIGNAL) != (NIL))) goto L_0060;
#line 286 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return;
#line 286 "regression-bugs-tmp/SIM.imp"
L_0060:;
                                                                //    287    propagate(pin_signal)
#line 287 "regression-bugs-tmp/SIM.imp"
PROPAGATE(PIN->SIGNAL);
                                                                //    288  %end
#line 288 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block MAKE at level 2
                                                                //    289  
                                                                //    290  %routine aftermath;  ! Flush event queue
#line 290 "regression-bugs-tmp/SIM.imp"
void AFTERMATH( void )
#line 290 "regression-bugs-tmp/SIM.imp"
{
                                                                //    291  %record(eqf)%name e
#line 291 "regression-bugs-tmp/SIM.imp"
 EQF /*name*/*E;
                                                                //    292    %cycle
#line 292 "regression-bugs-tmp/SIM.imp"
L_0061:;
                                                                //    293      e==eventqueue; %returnif e==nil
#line 293 "regression-bugs-tmp/SIM.imp"
E = EVENTQUEUE;
#line 293 "regression-bugs-tmp/SIM.imp"
if (((E) != (NIL))) goto L_005b;
#line 293 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return;
#line 293 "regression-bugs-tmp/SIM.imp"
L_005b:;
                                                                //    294      eventqueue==e_next; e_next==eclist; eclist==e
#line 294 "regression-bugs-tmp/SIM.imp"
EVENTQUEUE = E->NEXT;
#line 294 "regression-bugs-tmp/SIM.imp"
E->NEXT = ECLIST;
#line 294 "regression-bugs-tmp/SIM.imp"
ECLIST = E;
                                                                //    295      log(nil,e_when-now)
#line 295 "regression-bugs-tmp/SIM.imp"
LOG(NIL, (((int)(E->WHEN)) - (NOW)));
                                                                //    296      now=e_when
#line 296 "regression-bugs-tmp/SIM.imp"
NOW = E->WHEN;
                                                                //    297      make(e_pin,e_state,now)
#line 297 "regression-bugs-tmp/SIM.imp"
MAKE(E->PIN, E->STATE, NOW);
                                                                //    298    %repeat
#line 298 "regression-bugs-tmp/SIM.imp"
goto L_0061;
                                                                //    299  %end
#line 299 "regression-bugs-tmp/SIM.imp"
return;
} // End of block AFTERMATH at level 2
                                                                //    300  
                                                                //    301  ! Basic logic primitives
                                                                //    302  ! Note that NOT is just minus
                                                                //    303  
                                                                //    304  %integerfn float(%integer x)
#line 304 "regression-bugs-tmp/SIM.imp"
int FLOAT( int X )
#line 304 "regression-bugs-tmp/SIM.imp"
{
                                                                //    305    x=high %if x=open
#line 305 "regression-bugs-tmp/SIM.imp"
if (((X) != (0))) goto L_0062;
#line 305 "regression-bugs-tmp/SIM.imp"
X = 2;
#line 305 "regression-bugs-tmp/SIM.imp"
L_0062:;
                                                                //    306    x=x+x %if |x|=rising
#line 306 "regression-bugs-tmp/SIM.imp"
if (((_imp_IMOD(X)) != (1))) goto L_0064;
#line 306 "regression-bugs-tmp/SIM.imp"
X = (((int)(X)) + (X));
#line 306 "regression-bugs-tmp/SIM.imp"
L_0064:;
                                                                //    307    %result=x
#line 307 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return X;
                                                                //    308  %end
#line 308 "regression-bugs-tmp/SIM.imp"
} // End of block FLOAT at level 2
                                                                //    309  
                                                                //    310  %integerfn edgefloat(%integer x)
#line 310 "regression-bugs-tmp/SIM.imp"
int EDGEFLOAT( int X )
#line 310 "regression-bugs-tmp/SIM.imp"
{
                                                                //    311    x=undef %if x=open
#line 311 "regression-bugs-tmp/SIM.imp"
if (((X) != (0))) goto L_0065;
#line 311 "regression-bugs-tmp/SIM.imp"
X = (-2147483648);
#line 311 "regression-bugs-tmp/SIM.imp"
L_0065:;
                                                                //    312    %result=x
#line 312 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return X;
                                                                //    313  %end
#line 313 "regression-bugs-tmp/SIM.imp"
} // End of block EDGEFLOAT at level 2
                                                                //    314  
                                                                //    315  %integerfn setupfloat(%integer x)
#line 315 "regression-bugs-tmp/SIM.imp"
int SETUPFLOAT( int X )
#line 315 "regression-bugs-tmp/SIM.imp"
{
                                                                //    316    x=high %if x=open %or x=falling
#line 316 "regression-bugs-tmp/SIM.imp"
if (((X) == (0))) goto L_0063;
#line 316 "regression-bugs-tmp/SIM.imp"
if (((X) != ((-1)))) goto L_0066;
#line 316 "regression-bugs-tmp/SIM.imp"
L_0063:;
#line 316 "regression-bugs-tmp/SIM.imp"
X = 2;
#line 316 "regression-bugs-tmp/SIM.imp"
L_0066:;
                                                                //    317    x=low %if x=rising
#line 317 "regression-bugs-tmp/SIM.imp"
if (((X) != (1))) goto L_0067;
#line 317 "regression-bugs-tmp/SIM.imp"
X = (-2);
#line 317 "regression-bugs-tmp/SIM.imp"
L_0067:;
                                                                //    318    %result=x
#line 318 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return X;
                                                                //    319  %end
#line 319 "regression-bugs-tmp/SIM.imp"
} // End of block SETUPFLOAT at level 2
                                                                //    320  
                                                                //    321  %integerfn and(%integer x,y)
#line 321 "regression-bugs-tmp/SIM.imp"
int AND( int X, int Y )
#line 321 "regression-bugs-tmp/SIM.imp"
{
                                                                //    322    %result=low %if x=low %or y=low
#line 322 "regression-bugs-tmp/SIM.imp"
if (((X) == ((-2)))) goto L_0068;
#line 322 "regression-bugs-tmp/SIM.imp"
if (((Y) != ((-2)))) goto L_0069;
#line 322 "regression-bugs-tmp/SIM.imp"
L_0068:;
#line 322 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return (-2);
#line 322 "regression-bugs-tmp/SIM.imp"
L_0069:;
                                                                //    323    %result=undef %if x=undef %or y=undef
#line 323 "regression-bugs-tmp/SIM.imp"
if (((X) == ((-2147483648)))) goto L_006a;
#line 323 "regression-bugs-tmp/SIM.imp"
if (((Y) != ((-2147483648)))) goto L_006b;
#line 323 "regression-bugs-tmp/SIM.imp"
L_006a:;
#line 323 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return (-2147483648);
#line 323 "regression-bugs-tmp/SIM.imp"
L_006b:;
                                                                //    324    %result=high
#line 324 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return 2;
                                                                //    325  %end
#line 325 "regression-bugs-tmp/SIM.imp"
} // End of block AND at level 2
                                                                //    326  
                                                                //    327  %integerfn or(%integer x,y)
#line 327 "regression-bugs-tmp/SIM.imp"
int OR( int X, int Y )
#line 327 "regression-bugs-tmp/SIM.imp"
{
                                                                //    328    %result=high %if x=high %or y=high
#line 328 "regression-bugs-tmp/SIM.imp"
if (((X) == (2))) goto L_006c;
#line 328 "regression-bugs-tmp/SIM.imp"
if (((Y) != (2))) goto L_006d;
#line 328 "regression-bugs-tmp/SIM.imp"
L_006c:;
#line 328 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return 2;
#line 328 "regression-bugs-tmp/SIM.imp"
L_006d:;
                                                                //    329    %result=undef %if x=undef %or y=undef
#line 329 "regression-bugs-tmp/SIM.imp"
if (((X) == ((-2147483648)))) goto L_006e;
#line 329 "regression-bugs-tmp/SIM.imp"
if (((Y) != ((-2147483648)))) goto L_006f;
#line 329 "regression-bugs-tmp/SIM.imp"
L_006e:;
#line 329 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return (-2147483648);
#line 329 "regression-bugs-tmp/SIM.imp"
L_006f:;
                                                                //    330    %result=low
#line 330 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return (-2);
                                                                //    331  %end
#line 331 "regression-bugs-tmp/SIM.imp"
} // End of block OR at level 2
                                                                //    332  
                                                                //    333  %integerfn xor(%integer x,y)
#line 333 "regression-bugs-tmp/SIM.imp"
int XOR( int X, int Y )
#line 333 "regression-bugs-tmp/SIM.imp"
{
                                                                //    334    %result=undef %if x=undef %or y=undef
#line 334 "regression-bugs-tmp/SIM.imp"
if (((X) == ((-2147483648)))) goto L_0070;
#line 334 "regression-bugs-tmp/SIM.imp"
if (((Y) != ((-2147483648)))) goto L_0071;
#line 334 "regression-bugs-tmp/SIM.imp"
L_0070:;
#line 334 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return (-2147483648);
#line 334 "regression-bugs-tmp/SIM.imp"
L_0071:;
                                                                //    335    %result=low %if x=y
#line 335 "regression-bugs-tmp/SIM.imp"
if (((X) != (Y))) goto L_0072;
#line 335 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return (-2);
#line 335 "regression-bugs-tmp/SIM.imp"
L_0072:;
                                                                //    336    %result=high
#line 336 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return 2;
                                                                //    337  %end
#line 337 "regression-bugs-tmp/SIM.imp"
} // End of block XOR at level 2
                                                                //    338  
                                                                //    339  %integerfn oc(%integer x); !open collector
#line 339 "regression-bugs-tmp/SIM.imp"
int OC( int X )
#line 339 "regression-bugs-tmp/SIM.imp"
{
                                                                //    340    %result=open %if x=high %or x=rising
#line 340 "regression-bugs-tmp/SIM.imp"
if (((X) == (2))) goto L_0073;
#line 340 "regression-bugs-tmp/SIM.imp"
if (((X) != (1))) goto L_0074;
#line 340 "regression-bugs-tmp/SIM.imp"
L_0073:;
#line 340 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return 0;
#line 340 "regression-bugs-tmp/SIM.imp"
L_0074:;
                                                                //    341    %result=x
#line 341 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return X;
                                                                //    342  %end
#line 342 "regression-bugs-tmp/SIM.imp"
} // End of block OC at level 2
                                                                //    343  
                                                                //    344  %constinteger known=13
                                                                //    345  %conststring(15)%array type(0:known)="???",
#line 345 "regression-bugs-tmp/SIM.imp"
const _imp_string /*%string(15)*/ TYPE[14] = { _imp_str_literal("???"), _imp_str_literal("INV"), _imp_str_literal("INVO"), _imp_str_literal("AND"), _imp_str_literal("NAND"), _imp_str_literal("NANDO"), _imp_str_literal("OR"), _imp_str_literal("NOR"), _imp_str_literal("NORO"), _imp_str_literal("XOR"), _imp_str_literal("U74"), _imp_str_literal("TSBUF"), _imp_str_literal("U374"), _imp_str_literal("U123"),  };
                                                                //    346  "INV",  "INVO",
                                                                //    347  "AND",  "NAND",
                                                                //    348  "NANDO","OR",
                                                                //    349  "NOR",  "NORO",
                                                                //    350  "XOR",  "U74",
                                                                //    351  "TSBUF","U374",
                                                                //    352  "U123"
                                                                //    353  
                                                                //    354  %routine fail(%record(compf)%name c,%record(sigf)%name s,%string(15)m)
#line 354 "regression-bugs-tmp/SIM.imp"
void FAIL(  COMPF /*name*/*C,  SIGF /*name*/*S, _imp_string /*%string(15)*/ M )
#line 354 "regression-bugs-tmp/SIM.imp"
{
                                                                //    355  %record(pinf)%name p
#line 355 "regression-bugs-tmp/SIM.imp"
 PINF /*name*/*P;
                                                                //    356  %integer n
#line 356 "regression-bugs-tmp/SIM.imp"
int N;
                                                                //    357    printstring(m)
#line 357 "regression-bugs-tmp/SIM.imp"
_imp_PRINTSTRING(M);
                                                                //    358    %unless s==nil %start
#line 358 "regression-bugs-tmp/SIM.imp"
if (((S) == (NIL))) goto L_0075;
                                                                //    359      printstring(" Net "); printstring(s_name)
#line 359 "regression-bugs-tmp/SIM.imp"
_imp_PRINTSTRING(_imp_str_literal(" Net "));
#line 359 "regression-bugs-tmp/SIM.imp"
_imp_PRINTSTRING(S->NAME);
                                                                //    360      p==s_from; n=0
#line 360 "regression-bugs-tmp/SIM.imp"
P = S->FROM;
#line 360 "regression-bugs-tmp/SIM.imp"
N = 0;
                                                                //    361      %whilenot p==nil %cycle
#line 361 "regression-bugs-tmp/SIM.imp"
L_0076:;
#line 361 "regression-bugs-tmp/SIM.imp"
if (((P) == (NIL))) goto L_0077;
                                                                //    362        n=n+1; p==p_chain
#line 362 "regression-bugs-tmp/SIM.imp"
N = (((int)(N)) + (1));
#line 362 "regression-bugs-tmp/SIM.imp"
P = P->CHAIN;
                                                                //    363      %repeat
#line 363 "regression-bugs-tmp/SIM.imp"
goto L_0076;
#line 363 "regression-bugs-tmp/SIM.imp"
L_0077:;
                                                                //    364      write(n,1)
#line 364 "regression-bugs-tmp/SIM.imp"
_imp_WRITE(N, 1);
                                                                //    365      p==s_to; n=0
#line 365 "regression-bugs-tmp/SIM.imp"
P = S->TO;
#line 365 "regression-bugs-tmp/SIM.imp"
N = 0;
                                                                //    366      %whilenot p==nil %cycle
#line 366 "regression-bugs-tmp/SIM.imp"
L_0079:;
#line 366 "regression-bugs-tmp/SIM.imp"
if (((P) == (NIL))) goto L_007a;
                                                                //    367        n=n+1; p==p_chain
#line 367 "regression-bugs-tmp/SIM.imp"
N = (((int)(N)) + (1));
#line 367 "regression-bugs-tmp/SIM.imp"
P = P->CHAIN;
                                                                //    368      %repeat
#line 368 "regression-bugs-tmp/SIM.imp"
goto L_0079;
#line 368 "regression-bugs-tmp/SIM.imp"
L_007a:;
                                                                //    369      write(n,1); newline
#line 369 "regression-bugs-tmp/SIM.imp"
_imp_WRITE(N, 1);
#line 369 "regression-bugs-tmp/SIM.imp"
_imp_NEWLINE();
                                                                //    370    %finish
#line 370 "regression-bugs-tmp/SIM.imp"
L_0075:;
                                                                //    371    %unless c==nil %start
#line 371 "regression-bugs-tmp/SIM.imp"
if (((C) == (NIL))) goto L_007c;
                                                                //    372      printstring(type(c_type)); printstring(" (")
#line 372 "regression-bugs-tmp/SIM.imp"
_imp_PRINTSTRING(TYPE[C->TYPE]);
#line 372 "regression-bugs-tmp/SIM.imp"
_imp_PRINTSTRING(_imp_str_literal(" ("));
                                                                //    373      p==c_ins
#line 373 "regression-bugs-tmp/SIM.imp"
P = C->INS;
                                                                //    374      %whilenot p==nil %cycle
#line 374 "regression-bugs-tmp/SIM.imp"
L_007d:;
#line 374 "regression-bugs-tmp/SIM.imp"
if (((P) == (NIL))) goto L_007e;
                                                                //    375        printstring(p_signal_name); p==p_next; printsymbol(',') %unless p==nil
#line 375 "regression-bugs-tmp/SIM.imp"
_imp_PRINTSTRING(P->SIGNAL-> void /* BUG caused by a pooltostr(0) call? */ );
#line 375 "regression-bugs-tmp/SIM.imp"
P = P->NEXT;
#line 375 "regression-bugs-tmp/SIM.imp"
if (((P) == (NIL))) goto L_0080;
#line 375 "regression-bugs-tmp/SIM.imp"
_imp_PRINTSYMBOL(44);
#line 375 "regression-bugs-tmp/SIM.imp"
L_0080:;
                                                                //    376      %repeat
#line 376 "regression-bugs-tmp/SIM.imp"
goto L_007d;
#line 376 "regression-bugs-tmp/SIM.imp"
L_007e:;
                                                                //    377      printsymbol('/')
#line 377 "regression-bugs-tmp/SIM.imp"
_imp_PRINTSYMBOL(47);
                                                                //    378      p==c_outs
#line 378 "regression-bugs-tmp/SIM.imp"
P = C->OUTS;
                                                                //    379      %whilenot p==nil %cycle
#line 379 "regression-bugs-tmp/SIM.imp"
L_0081:;
#line 379 "regression-bugs-tmp/SIM.imp"
if (((P) == (NIL))) goto L_0082;
                                                                //    380        printstring(p_signal_name); p==p_next; printsymbol(',') %unless p==nil
#line 380 "regression-bugs-tmp/SIM.imp"
_imp_PRINTSTRING(P->SIGNAL-> void /* BUG caused by a pooltostr(0) call? */ );
#line 380 "regression-bugs-tmp/SIM.imp"
P = P->NEXT;
#line 380 "regression-bugs-tmp/SIM.imp"
if (((P) == (NIL))) goto L_0084;
#line 380 "regression-bugs-tmp/SIM.imp"
_imp_PRINTSYMBOL(44);
#line 380 "regression-bugs-tmp/SIM.imp"
L_0084:;
                                                                //    381      %repeat
#line 381 "regression-bugs-tmp/SIM.imp"
goto L_0081;
#line 381 "regression-bugs-tmp/SIM.imp"
L_0082:;
                                                                //    382      printsymbol(')'); newline
#line 382 "regression-bugs-tmp/SIM.imp"
_imp_PRINTSYMBOL(41);
#line 382 "regression-bugs-tmp/SIM.imp"
_imp_NEWLINE();
                                                                //    383    %finish
#line 383 "regression-bugs-tmp/SIM.imp"
L_007c:;
                                                                //    384    %signal 15
#line 384 "regression-bugs-tmp/SIM.imp"
_imp_signal(15, 0, 0, "");
                                                                //    385  %end
#line 385 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block FAIL at level 2
                                                                //    386  
                                                                //    387  %routine excite(%record(compf)%name comp)
#line 387 "regression-bugs-tmp/SIM.imp"
void EXCITE(  COMPF /*name*/*COMP )
#line 387 "regression-bugs-tmp/SIM.imp"
{
                                                                //    388  %record(pinf)%name in1,in2,more,out
#line 388 "regression-bugs-tmp/SIM.imp"
 PINF /*name*/*IN1;
#line 388 "regression-bugs-tmp/SIM.imp"
 PINF /*name*/*IN2;
#line 388 "regression-bugs-tmp/SIM.imp"
 PINF /*name*/*MORE;
#line 388 "regression-bugs-tmp/SIM.imp"
 PINF /*name*/*OUT;
                                                                //    389  %integer i1,i2
#line 389 "regression-bugs-tmp/SIM.imp"
int I1;
#line 389 "regression-bugs-tmp/SIM.imp"
int I2;
                                                                //    390  %switch s(0:known)
#line 390 "regression-bugs-tmp/SIM.imp"
static int sw1_S_idx;
static const void * /*SWITCH*/ sw1_S[14] = { &&sw1_S_0, &&sw1_S_1, &&sw1_S_2, &&sw1_S_3, &&sw1_S_4, &&sw1_S_5, &&sw1_S_6, &&sw1_S_7, &&sw1_S_8, &&sw1_S_9, &&sw1_S_10, &&sw1_S_11, &&sw1_S_12, &&sw1_S_13,  };
                                                                //    391  %switch t(3:9)
#line 391 "regression-bugs-tmp/SIM.imp"
static int sw2_T_idx;
static const void * /*SWITCH*/ sw2_T[7] = { &&sw2_T_3, &&sw2_T_4, &&sw2_T_5, &&sw2_T_6, &&sw2_T_7, &&sw2_T_8, &&sw2_T_9,  };
                                                                //    392  
                                                                //    393    more==nil; in2==nil
#line 393 "regression-bugs-tmp/SIM.imp"
MORE = NIL;
#line 393 "regression-bugs-tmp/SIM.imp"
IN2 = NIL;
                                                                //    394    in1==comp_ins
#line 394 "regression-bugs-tmp/SIM.imp"
IN1 = COMP->INS;
                                                                //    395    %unless in1==nil %start
#line 395 "regression-bugs-tmp/SIM.imp"
if (((IN1) == (NIL))) goto L_0085;
                                                                //    396      i1=in1_state; in2==in1_next
#line 396 "regression-bugs-tmp/SIM.imp"
I1 = IN1->STATE;
#line 396 "regression-bugs-tmp/SIM.imp"
IN2 = IN1->NEXT;
                                                                //    397      %unless in2==nil %start
#line 397 "regression-bugs-tmp/SIM.imp"
if (((IN2) == (NIL))) goto L_0086;
                                                                //    398        more==in2_next; i2=in2_state
#line 398 "regression-bugs-tmp/SIM.imp"
MORE = IN2->NEXT;
#line 398 "regression-bugs-tmp/SIM.imp"
I2 = IN2->STATE;
                                                                //    399      %finish
#line 399 "regression-bugs-tmp/SIM.imp"
L_0086:;
                                                                //    400    %finish
#line 400 "regression-bugs-tmp/SIM.imp"
L_0085:;
                                                                //    401    out==comp_outs
#line 401 "regression-bugs-tmp/SIM.imp"
OUT = COMP->OUTS;
                                                                //    402    ->s(comp_type)
#line 402 "regression-bugs-tmp/SIM.imp"
sw1_S_idx = COMP->TYPE; if ((0 <= sw1_S_idx) && (sw1_S_idx <= 13)) goto *sw1_S[sw1_S_idx]; else {
   /*_imp_signal(8, 2, sw1_S_idx);*/
   fprintf(stderr, "%%SWITCH index S(%d) not in range 0:13 at %s:%d\n",
           sw1_S_idx, (_imp_current_file != 0 ? _imp_current_file : __FILE__),
           (_imp_current_line != 0 ? _imp_current_line : __LINE__));
           exit(1);
}
                                                                //    403  
                                                                //    404  s(9): {xor}    i1=xor(float(i1),float(i2)); ->generic
#line 404 "regression-bugs-tmp/SIM.imp"
sw1_S_9:;
#line 404 "regression-bugs-tmp/SIM.imp"
I1 = XOR(FLOAT(I1), FLOAT(I2));
#line 404 "regression-bugs-tmp/SIM.imp"
goto U_1000;
                                                                //    405  s(3): {and}
#line 405 "regression-bugs-tmp/SIM.imp"
sw1_S_3:;
                                                                //    406  s(4): {nand}
#line 406 "regression-bugs-tmp/SIM.imp"
sw1_S_4:;
                                                                //    407  s(5): {nando}  i1=and(float(i1),float(i2)); ->generic
#line 407 "regression-bugs-tmp/SIM.imp"
sw1_S_5:;
#line 407 "regression-bugs-tmp/SIM.imp"
I1 = AND(FLOAT(I1), FLOAT(I2));
#line 407 "regression-bugs-tmp/SIM.imp"
goto U_1000;
                                                                //    408  s(6): {or}
#line 408 "regression-bugs-tmp/SIM.imp"
sw1_S_6:;
                                                                //    409  s(7): {nor}
#line 409 "regression-bugs-tmp/SIM.imp"
sw1_S_7:;
                                                                //    410  s(8): {noro}   i1=or(float(i1),float(i2))
#line 410 "regression-bugs-tmp/SIM.imp"
sw1_S_8:;
#line 410 "regression-bugs-tmp/SIM.imp"
I1 = OR(FLOAT(I1), FLOAT(I2));
                                                                //    411  generic:
#line 411 "regression-bugs-tmp/SIM.imp"
U_1000:;
                                                                //    412    ->t(comp_type) %if more==nil
#line 412 "regression-bugs-tmp/SIM.imp"
if (((MORE) != (NIL))) goto L_0087;
#line 412 "regression-bugs-tmp/SIM.imp"
sw2_T_idx = COMP->TYPE; if ((3 <= sw2_T_idx) && (sw2_T_idx <= 9)) goto *(sw2_T-3)[sw2_T_idx];  /* Bounds=3:9 */ else {
   /*_imp_signal(8, 2, sw2_T_idx);*/
   fprintf(stderr, "%%SWITCH index T(%d) not in range 3:9 at %s:%d\n",
           sw2_T_idx, (_imp_current_file != 0 ? _imp_current_file : __FILE__),
           (_imp_current_line != 0 ? _imp_current_line : __LINE__));
           exit(1);
}
#line 412 "regression-bugs-tmp/SIM.imp"
L_0087:;
                                                                //    413    i2=more_state; more==more_next; ->s(comp_type)
#line 413 "regression-bugs-tmp/SIM.imp"
I2 = MORE->STATE;
#line 413 "regression-bugs-tmp/SIM.imp"
MORE = MORE->NEXT;
#line 413 "regression-bugs-tmp/SIM.imp"
sw1_S_idx = COMP->TYPE; if ((0 <= sw1_S_idx) && (sw1_S_idx <= 13)) goto *sw1_S[sw1_S_idx]; else {
   /*_imp_signal(8, 2, sw1_S_idx);*/
   fprintf(stderr, "%%SWITCH index S(%d) not in range 0:13 at %s:%d\n",
           sw1_S_idx, (_imp_current_file != 0 ? _imp_current_file : __FILE__),
           (_imp_current_line != 0 ? _imp_current_line : __LINE__));
           exit(1);
}
                                                                //    414  
                                                                //    415  t(9): {xor}
#line 415 "regression-bugs-tmp/SIM.imp"
sw2_T_9:;
                                                                //    416  t(6): {or}
#line 416 "regression-bugs-tmp/SIM.imp"
sw2_T_6:;
                                                                //    417  t(3): {and}    make(out,i1,now+1); %return
#line 417 "regression-bugs-tmp/SIM.imp"
sw2_T_3:;
#line 417 "regression-bugs-tmp/SIM.imp"
MAKE(OUT, I1, (((int)(NOW)) + (1)));
#line 417 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return;
                                                                //    418  s(1): {inv}
#line 418 "regression-bugs-tmp/SIM.imp"
sw1_S_1:;
                                                                //    419  t(7): {nor}
#line 419 "regression-bugs-tmp/SIM.imp"
sw2_T_7:;
                                                                //    420  t(4): {nand}   make(out,-float(i1),now+1); %return
#line 420 "regression-bugs-tmp/SIM.imp"
sw2_T_4:;
#line 420 "regression-bugs-tmp/SIM.imp"
MAKE(OUT, (-(FLOAT(I1))), (((int)(NOW)) + (1)));
#line 420 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return;
                                                                //    421  s(2): {invo}
#line 421 "regression-bugs-tmp/SIM.imp"
sw1_S_2:;
                                                                //    422  t(8): {noro}
#line 422 "regression-bugs-tmp/SIM.imp"
sw2_T_8:;
                                                                //    423  t(5): {nando}  make(out,oc(-float(i1)),now+1); %return
#line 423 "regression-bugs-tmp/SIM.imp"
sw2_T_5:;
#line 423 "regression-bugs-tmp/SIM.imp"
MAKE(OUT, OC((-(FLOAT(I1)))), (((int)(NOW)) + (1)));
#line 423 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return;
                                                                //    424  
                                                                //    425  s(10):{u74}
#line 425 "regression-bugs-tmp/SIM.imp"
sw1_S_10:;
                                                                //    426    %begin
#line 426 "regression-bugs-tmp/SIM.imp"
void _BLOCK_1_LEVEL_2_(void) {
                                                                //    427    %integer d,s0,r0,c
#line 427 "regression-bugs-tmp/SIM.imp"
int D;
#line 427 "regression-bugs-tmp/SIM.imp"
int S0;
#line 427 "regression-bugs-tmp/SIM.imp"
int R0;
#line 427 "regression-bugs-tmp/SIM.imp"
int C;
                                                                //    428    %record(pinf)%name out0
#line 428 "regression-bugs-tmp/SIM.imp"
 PINF /*name*/*OUT0;
                                                                //    429  
                                                                //    430      d=setupfloat(i1); s0=float(i2); r0=float(more_state)
#line 430 "regression-bugs-tmp/SIM.imp"
D = SETUPFLOAT(I1);
#line 430 "regression-bugs-tmp/SIM.imp"
S0 = FLOAT(I2);
#line 430 "regression-bugs-tmp/SIM.imp"
R0 = FLOAT(MORE->STATE);
                                                                //    431      c=edgefloat(more_next_state)
#line 431 "regression-bugs-tmp/SIM.imp"
C = EDGEFLOAT(MORE->NEXT->STATE);
                                                                //    432      out0==out_next
#line 432 "regression-bugs-tmp/SIM.imp"
OUT0 = OUT->NEXT;
                                                                //    433  
                                                                //    434      %if r0=undef %start
#line 434 "regression-bugs-tmp/SIM.imp"
if (((R0) != ((-2147483648)))) goto L_0088;
                                                                //    435        make(out,high,now+1) %if s0=low
#line 435 "regression-bugs-tmp/SIM.imp"
if (((S0) != ((-2)))) goto L_0089;
#line 435 "regression-bugs-tmp/SIM.imp"
MAKE(OUT, 2, (((int)(NOW)) + (1)));
#line 435 "regression-bugs-tmp/SIM.imp"
L_0089:;
                                                                //    436      %finishelseif s0=undef %start
#line 436 "regression-bugs-tmp/SIM.imp"
goto L_008a;
#line 436 "regression-bugs-tmp/SIM.imp"
L_0088:;
#line 436 "regression-bugs-tmp/SIM.imp"
if (((S0) != ((-2147483648)))) goto L_008b;
                                                                //    437        make(out0,high,now+1) %if r0=low
#line 437 "regression-bugs-tmp/SIM.imp"
if (((R0) != ((-2)))) goto L_008c;
#line 437 "regression-bugs-tmp/SIM.imp"
MAKE(OUT0, 2, (((int)(NOW)) + (1)));
#line 437 "regression-bugs-tmp/SIM.imp"
L_008c:;
                                                                //    438      %finishelseif r0=low %and s0=low %start
#line 438 "regression-bugs-tmp/SIM.imp"
goto L_008a;
#line 438 "regression-bugs-tmp/SIM.imp"
L_008b:;
#line 438 "regression-bugs-tmp/SIM.imp"
if (((R0) != ((-2)))) goto L_008d;
#line 438 "regression-bugs-tmp/SIM.imp"
if (((S0) != ((-2)))) goto L_008d;
                                                                //    439        make(out,high,now+1); make(out0,high,now+1)
#line 439 "regression-bugs-tmp/SIM.imp"
MAKE(OUT, 2, (((int)(NOW)) + (1)));
#line 439 "regression-bugs-tmp/SIM.imp"
MAKE(OUT0, 2, (((int)(NOW)) + (1)));
                                                                //    440      %finishelseif r0=low %start
#line 440 "regression-bugs-tmp/SIM.imp"
goto L_008a;
#line 440 "regression-bugs-tmp/SIM.imp"
L_008d:;
#line 440 "regression-bugs-tmp/SIM.imp"
if (((R0) != ((-2)))) goto L_008e;
                                                                //    441        make(out,low,now+1); make(out0,high,now+1)
#line 441 "regression-bugs-tmp/SIM.imp"
MAKE(OUT, (-2), (((int)(NOW)) + (1)));
#line 441 "regression-bugs-tmp/SIM.imp"
MAKE(OUT0, 2, (((int)(NOW)) + (1)));
                                                                //    442      %finishelseif s0=low %start
#line 442 "regression-bugs-tmp/SIM.imp"
goto L_008a;
#line 442 "regression-bugs-tmp/SIM.imp"
L_008e:;
#line 442 "regression-bugs-tmp/SIM.imp"
if (((S0) != ((-2)))) goto L_008f;
                                                                //    443        make(out,high,now+1); make(out0,low,now+1)
#line 443 "regression-bugs-tmp/SIM.imp"
MAKE(OUT, 2, (((int)(NOW)) + (1)));
#line 443 "regression-bugs-tmp/SIM.imp"
MAKE(OUT0, (-2), (((int)(NOW)) + (1)));
                                                                //    444        %if c=rising %and (d=low %or d=undef) %start
#line 444 "regression-bugs-tmp/SIM.imp"
if (((C) != (1))) goto L_0090;
#line 444 "regression-bugs-tmp/SIM.imp"
if (((D) == ((-2)))) goto L_0083;
#line 444 "regression-bugs-tmp/SIM.imp"
if (((D) != ((-2147483648)))) goto L_0090;
#line 444 "regression-bugs-tmp/SIM.imp"
L_0083:;
                                                                //    445          make(out0,-d,now+2); make(out0,low,now+3)
#line 445 "regression-bugs-tmp/SIM.imp"
MAKE(OUT0, (-(D)), (((int)(NOW)) + (2)));
#line 445 "regression-bugs-tmp/SIM.imp"
MAKE(OUT0, (-2), (((int)(NOW)) + (3)));
                                                                //    446        %finish
#line 446 "regression-bugs-tmp/SIM.imp"
L_0090:;
                                                                //    447      %finishelseif c=rising %start
#line 447 "regression-bugs-tmp/SIM.imp"
goto L_008a;
#line 447 "regression-bugs-tmp/SIM.imp"
L_008f:;
#line 447 "regression-bugs-tmp/SIM.imp"
if (((C) != (1))) goto L_0091;
                                                                //    448        make(out,d,now+2); make(out0,-d,now+2)
#line 448 "regression-bugs-tmp/SIM.imp"
MAKE(OUT, D, (((int)(NOW)) + (2)));
#line 448 "regression-bugs-tmp/SIM.imp"
MAKE(OUT0, (-(D)), (((int)(NOW)) + (2)));
                                                                //    449      %finish
#line 449 "regression-bugs-tmp/SIM.imp"
L_0091:;
#line 449 "regression-bugs-tmp/SIM.imp"
L_008a:;
                                                                //    450    %end
#line 450 "regression-bugs-tmp/SIM.imp"
return;
} // End of block _BLOCK_1_LEVEL_2_ at level 3
_BLOCK_1_LEVEL_2_();
                                                                //    451    %return
#line 451 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return;
                                                                //    452  
                                                                //    453  s(11): {tsbuf: non-inverting, low-active enable}
#line 453 "regression-bugs-tmp/SIM.imp"
sw1_S_11:;
                                                                //    454    i1=float(i1); i2=float(i2)
#line 454 "regression-bugs-tmp/SIM.imp"
I1 = FLOAT(I1);
#line 454 "regression-bugs-tmp/SIM.imp"
I2 = FLOAT(I2);
                                                                //    455    %if i2=low %then i2=i1 %elsec
#line 455 "regression-bugs-tmp/SIM.imp"
if (((I2) != ((-2)))) goto L_0092;
#line 455 "regression-bugs-tmp/SIM.imp"
I2 = I1;
#line 455 "regression-bugs-tmp/SIM.imp"
goto L_0093;
#line 455 "regression-bugs-tmp/SIM.imp"
L_0092:;
#line 455 "regression-bugs-tmp/SIM.imp"
if (((I2) != (2))) goto L_0094;
#line 455 "regression-bugs-tmp/SIM.imp"
I2 = 0;
#line 455 "regression-bugs-tmp/SIM.imp"
goto L_0093;
#line 455 "regression-bugs-tmp/SIM.imp"
L_0094:;
#line 455 "regression-bugs-tmp/SIM.imp"
I2 = (-2147483648);
#line 455 "regression-bugs-tmp/SIM.imp"
L_0093:;
                                                                //    456    %if i2=high %then i2=open %else i2=undef
                                                                //    457    make(out,i2,now+1)
#line 457 "regression-bugs-tmp/SIM.imp"
MAKE(OUT, I2, (((int)(NOW)) + (1)));
                                                                //    458    %return
#line 458 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return;
                                                                //    459  
                                                                //    460  s(12): {u374: clock, enable\ i(0:7) / o(0:7)}
#line 460 "regression-bugs-tmp/SIM.imp"
sw1_S_12:;
                                                                //    461  !%begin
                                                                //    462  !%record(pinf)%namearray in,state,out(0:7)
                                                                //    463  !%record(pinf)%name p
                                                                //    464  !%integer i
                                                                //    465  !  p==comp_private
                                                                //    466  !  %if p==nil %start
                                                                //    467  !    %for i=0,1,7 %cycle
                                                                //    468  !      p==newpin; state(i)==p; p_comp==comp
                                                                //    469  !    %repeat
                                                                //    470  !    comp_private==state(0)
                                                                //    471  !    %for i=0,1,6 %cycle
                                                                //    472  !      state(i)_next==state(i+1)
                                                                //    473  !    %repeat
                                                                //    474  !    state(7)_next==nil
                                                                //    475  !  %finishelsestart
                                                                //    476  !    %for i=0,1,7 %cycle
                                                                //    477  !      state(i)==p; p==p_next
                                                                //    478  !    %repeat
                                                                //    479  !  %finish
                                                                //    480  !  p==comp_outs
                                                                //    481  !  %for i=0,1,7 %cycle
                                                                //    482  !    out(i)==p; p==p_next
                                                                //    483  !  %repeat
                                                                //    484  !  p==more
                                                                //    485  !  %for i=0,1,7 %cycle
                                                                //    486  !    in(i)==p; p==p_next
                                                                //    487  !  %repeat
                                                                //    488  !  %if i1=rising %start
                                                                //    489  !    state(i)_state=setupfloat(in(i)_state) %for i=0,1,7
                                                                //    490  !  %finish
                                                                //    491  !  i2=float(i2)
                                                                //    492  !  %if i2=low %start
                                                                //    493  !    make(out(i),state(i)_state,now+1) %for i=0,1,7
                                                                //    494  !  %finishelsestart
                                                                //    495  !    %if i2=high %then i2=open %else i2=undef
                                                                //    496  !    make(out(i),i2,now+1) %for i=0,1,7
                                                                //    497  !  %finish
                                                                //    498  !%end
                                                                //    499    %return
#line 499 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return;
                                                                //    500  
                                                                //    501  s(13): {u123: a0, b, c0, timeout / q, q0}
#line 501 "regression-bugs-tmp/SIM.imp"
sw1_S_13:;
                                                                //    502    %begin
#line 502 "regression-bugs-tmp/SIM.imp"
void _BLOCK_2_LEVEL_2_(void) {
                                                                //    503   %integer a0,b,c0,timeout
#line 503 "regression-bugs-tmp/SIM.imp"
int A0;
#line 503 "regression-bugs-tmp/SIM.imp"
int B;
#line 503 "regression-bugs-tmp/SIM.imp"
int C0;
#line 503 "regression-bugs-tmp/SIM.imp"
int TIMEOUT;
                                                                //    504    %record(pinf)%name out0
#line 504 "regression-bugs-tmp/SIM.imp"
 PINF /*name*/*OUT0;
                                                                //    505    a0=float(i1); b=float(i2); c0=float(more_state)
#line 505 "regression-bugs-tmp/SIM.imp"
A0 = FLOAT(I1);
#line 505 "regression-bugs-tmp/SIM.imp"
B = FLOAT(I2);
#line 505 "regression-bugs-tmp/SIM.imp"
C0 = FLOAT(MORE->STATE);
                                                                //    506    timeout=more_next_state
#line 506 "regression-bugs-tmp/SIM.imp"
TIMEOUT = MORE->NEXT->STATE;
                                                                //    507    out0==out_next
#line 507 "regression-bugs-tmp/SIM.imp"
OUT0 = OUT->NEXT;
                                                                //    508    %if c0=low %start
#line 508 "regression-bugs-tmp/SIM.imp"
if (((C0) != ((-2)))) goto L_0095;
                                                                //    509      make(out,low,now+1); make(out0,high,now+1)
#line 509 "regression-bugs-tmp/SIM.imp"
MAKE(OUT, (-2), (((int)(NOW)) + (1)));
#line 509 "regression-bugs-tmp/SIM.imp"
MAKE(OUT0, 2, (((int)(NOW)) + (1)));
                                                                //    510    %finishelseif c0=undef %start
#line 510 "regression-bugs-tmp/SIM.imp"
goto L_0096;
#line 510 "regression-bugs-tmp/SIM.imp"
L_0095:;
#line 510 "regression-bugs-tmp/SIM.imp"
if (((C0) != ((-2147483648)))) goto L_0097;
                                                                //    511      make(out,undef,now+1); make(out0,undef,now+1)
#line 511 "regression-bugs-tmp/SIM.imp"
MAKE(OUT, (-2147483648), (((int)(NOW)) + (1)));
#line 511 "regression-bugs-tmp/SIM.imp"
MAKE(OUT0, (-2147483648), (((int)(NOW)) + (1)));
                                                                //    512    %finishelsestart
#line 512 "regression-bugs-tmp/SIM.imp"
goto L_0096;
#line 512 "regression-bugs-tmp/SIM.imp"
L_0097:;
                                                                //    513      b=and(-a0,b)
#line 513 "regression-bugs-tmp/SIM.imp"
B = AND((-(A0)), B);
                                                                //    514      %if b=high %and out_state=low %start
#line 514 "regression-bugs-tmp/SIM.imp"
if (((B) != (2))) goto L_0098;
#line 514 "regression-bugs-tmp/SIM.imp"
if (((OUT->STATE) != ((-2)))) goto L_0098;
                                                                //    515        make(out,high,now+1)
#line 515 "regression-bugs-tmp/SIM.imp"
MAKE(OUT, 2, (((int)(NOW)) + (1)));
                                                                //    516        make(out0,low,now+1)
#line 516 "regression-bugs-tmp/SIM.imp"
MAKE(OUT0, (-2), (((int)(NOW)) + (1)));
                                                                //    517      %finishelseif |timeout|=rising %start
#line 517 "regression-bugs-tmp/SIM.imp"
goto L_0099;
#line 517 "regression-bugs-tmp/SIM.imp"
L_0098:;
#line 517 "regression-bugs-tmp/SIM.imp"
if (((_imp_IMOD(TIMEOUT)) != (1))) goto L_009a;
                                                                //    518        make(out,low,now+1)
#line 518 "regression-bugs-tmp/SIM.imp"
MAKE(OUT, (-2), (((int)(NOW)) + (1)));
                                                                //    519        make(out0,high,now+1)
#line 519 "regression-bugs-tmp/SIM.imp"
MAKE(OUT0, 2, (((int)(NOW)) + (1)));
                                                                //    520      %finish
#line 520 "regression-bugs-tmp/SIM.imp"
L_009a:;
#line 520 "regression-bugs-tmp/SIM.imp"
L_0099:;
                                                                //    521    %finish
#line 521 "regression-bugs-tmp/SIM.imp"
L_0096:;
                                                                //    522    %end
#line 522 "regression-bugs-tmp/SIM.imp"
return;
} // End of block _BLOCK_2_LEVEL_2_ at level 3
_BLOCK_2_LEVEL_2_();
                                                                //    523    %return
#line 523 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return;
                                                                //    524  
                                                                //    525  s(0):
#line 525 "regression-bugs-tmp/SIM.imp"
sw1_S_0:;
                                                                //    526  %end
#line 526 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block EXCITE at level 2
                                                                //    527  
                                                                //    528  %string(15)atom,pend=""
#line 528 "regression-bugs-tmp/SIM.imp"
_imp_string /*%string(15)*/ ATOM;
#line 528 "regression-bugs-tmp/SIM.imp"
_imp_string /*%string(15)*/ PEND;
#line 528 "regression-bugs-tmp/SIM.imp"
PEND = _imp_str_literal("");
                                                                //    529  %integer sym=nl
#line 529 "regression-bugs-tmp/SIM.imp"
int SYM;
#line 529 "regression-bugs-tmp/SIM.imp"
SYM = 10;
                                                                //    530  %constbyteintegerarray symtype(0:127)=
#line 530 "regression-bugs-tmp/SIM.imp"
const unsigned char SYMTYPE[128] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 2, 0, 0, 0, 2, 2, 0, 0, 2, 2, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0,  };
                                                                //    531  1(33),0(3),2,0(3),2,2,0,0,2,2,0,2,0(16),0(33),3(26),0(5)
                                                                //    532  !          $      ( )     , -   /
                                                                //    533  ! 0 normal 1 separator 2 special 3 lower-case
                                                                //    534  
                                                                //    535  %routine readatom
#line 535 "regression-bugs-tmp/SIM.imp"
void READATOM( void )
#line 535 "regression-bugs-tmp/SIM.imp"
{
                                                                //    536  %integer st
#line 536 "regression-bugs-tmp/SIM.imp"
int ST;
                                                                //    537    %unless pend="" %start
#line 537 "regression-bugs-tmp/SIM.imp"
if ((_imp_strcmp(PEND, _imp_str_literal("")) == 0)) goto L_009b;
                                                                //    538      atom=pend; pend=""; %return
#line 538 "regression-bugs-tmp/SIM.imp"
ATOM = PEND;
#line 538 "regression-bugs-tmp/SIM.imp"
PEND = _imp_str_literal("");
#line 538 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return;
                                                                //    539    %finish
#line 539 "regression-bugs-tmp/SIM.imp"
L_009b:;
                                                                //    540    %cycle
#line 540 "regression-bugs-tmp/SIM.imp"
L_009c:;
                                                                //    541      %cycle
#line 541 "regression-bugs-tmp/SIM.imp"
L_009f:;
                                                                //    542        st=symtype(sym&127); %exitunless st=1
#line 542 "regression-bugs-tmp/SIM.imp"
ST = SYMTYPE[((SYM) & (127))];
#line 542 "regression-bugs-tmp/SIM.imp"
if (((ST) == (1))) goto L_00a2;
#line 542 "regression-bugs-tmp/SIM.imp"
goto L_00a0;
#line 542 "regression-bugs-tmp/SIM.imp"
L_00a2:;
                                                                //    543        readsymbol(sym)
#line 543 "regression-bugs-tmp/SIM.imp"
_imp_READSYMBOL(&SYM);
                                                                //    544      %repeat
#line 544 "regression-bugs-tmp/SIM.imp"
goto L_009f;
#line 544 "regression-bugs-tmp/SIM.imp"
L_00a0:;
                                                                //    545      %exitunless sym='$'
#line 545 "regression-bugs-tmp/SIM.imp"
if (((SYM) == (36))) goto L_00a3;
#line 545 "regression-bugs-tmp/SIM.imp"
goto L_009d;
#line 545 "regression-bugs-tmp/SIM.imp"
L_00a3:;
                                                                //    546      readsymbol(sym) %until sym='$' %or sym=nl
#line 546 "regression-bugs-tmp/SIM.imp"
L_00a4:;
#line 546 "regression-bugs-tmp/SIM.imp"
_imp_READSYMBOL(&SYM);
#line 546 "regression-bugs-tmp/SIM.imp"
if (((SYM) == (36))) goto L_00a5;
#line 546 "regression-bugs-tmp/SIM.imp"
if (((SYM) == (10))) goto L_00a5;
#line 546 "regression-bugs-tmp/SIM.imp"
goto L_00a4;
#line 546 "regression-bugs-tmp/SIM.imp"
L_00a5:;
                                                                //    547      readsymbol(sym)
#line 547 "regression-bugs-tmp/SIM.imp"
_imp_READSYMBOL(&SYM);
                                                                //    548    %repeat
#line 548 "regression-bugs-tmp/SIM.imp"
goto L_009c;
#line 548 "regression-bugs-tmp/SIM.imp"
L_009d:;
                                                                //    549    sym=sym-32 %if st=3
#line 549 "regression-bugs-tmp/SIM.imp"
if (((ST) != (3))) goto L_00a7;
#line 549 "regression-bugs-tmp/SIM.imp"
SYM = (((int)(SYM)) - (32));
#line 549 "regression-bugs-tmp/SIM.imp"
L_00a7:;
                                                                //    550    atom=tostring(sym)
#line 550 "regression-bugs-tmp/SIM.imp"
ATOM = _imp_TOSTRING(SYM);
                                                                //    551    %if st=2 %start; !Special on its own
#line 551 "regression-bugs-tmp/SIM.imp"
if (((ST) != (2))) goto L_00a8;
                                                                //    552      %if sym='-' %start; ! "->" or "/" or "-" equivalent
#line 552 "regression-bugs-tmp/SIM.imp"
if (((SYM) != (45))) goto L_00a9;
                                                                //    553        atom="/"
#line 553 "regression-bugs-tmp/SIM.imp"
ATOM = _imp_str_literal("/");
                                                                //    554        readsymbol(sym); %returnunless sym='>'
#line 554 "regression-bugs-tmp/SIM.imp"
_imp_READSYMBOL(&SYM);
#line 554 "regression-bugs-tmp/SIM.imp"
if (((SYM) == (62))) goto L_00aa;
#line 554 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return;
#line 554 "regression-bugs-tmp/SIM.imp"
L_00aa:;
                                                                //    555      %finish
#line 555 "regression-bugs-tmp/SIM.imp"
L_00a9:;
                                                                //    556      readsymbol(sym); %return
#line 556 "regression-bugs-tmp/SIM.imp"
_imp_READSYMBOL(&SYM);
#line 556 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return;
                                                                //    557    %finish
#line 557 "regression-bugs-tmp/SIM.imp"
L_00a8:;
                                                                //    558    readsymbol(sym)
#line 558 "regression-bugs-tmp/SIM.imp"
_imp_READSYMBOL(&SYM);
                                                                //    559    %cycle
#line 559 "regression-bugs-tmp/SIM.imp"
L_00ab:;
                                                                //    560      st=symtype(sym&127); sym=sym-32 %and st=0 %if st=3
#line 560 "regression-bugs-tmp/SIM.imp"
ST = SYMTYPE[((SYM) & (127))];
#line 560 "regression-bugs-tmp/SIM.imp"
if (((ST) != (3))) goto L_00ae;
#line 560 "regression-bugs-tmp/SIM.imp"
SYM = (((int)(SYM)) - (32));
#line 560 "regression-bugs-tmp/SIM.imp"
ST = 0;
#line 560 "regression-bugs-tmp/SIM.imp"
L_00ae:;
                                                                //    561      %exitunless st=0
#line 561 "regression-bugs-tmp/SIM.imp"
if (((ST) == (0))) goto L_00af;
#line 561 "regression-bugs-tmp/SIM.imp"
goto L_00ac;
#line 561 "regression-bugs-tmp/SIM.imp"
L_00af:;
                                                                //    562      atom=atom.tostring(sym) %unless length(atom)=15
#line 562 "regression-bugs-tmp/SIM.imp"
if (((*_imp_LENGTH(&ATOM)) == (15))) goto L_00b0;
#line 562 "regression-bugs-tmp/SIM.imp"
ATOM = _imp_join((_imp_string)ATOM,(_imp_string)_imp_TOSTRING(SYM));
#line 562 "regression-bugs-tmp/SIM.imp"
L_00b0:;
                                                                //    563      readsymbol(sym)
#line 563 "regression-bugs-tmp/SIM.imp"
_imp_READSYMBOL(&SYM);
                                                                //    564    %repeat
#line 564 "regression-bugs-tmp/SIM.imp"
goto L_00ab;
#line 564 "regression-bugs-tmp/SIM.imp"
L_00ac:;
                                                                //    565  %end
#line 565 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block READATOM at level 2
                                                                //    566  
                                                                //    567  %record(sigf)%map findsignal
#line 567 "regression-bugs-tmp/SIM.imp"
 SIGF /*map*/*FINDSIGNAL( void )
#line 567 "regression-bugs-tmp/SIM.imp"
{
                                                                //    568  %record(sigf)%name s
#line 568 "regression-bugs-tmp/SIM.imp"
 SIGF /*name*/*S;
                                                                //    569    s==nets
#line 569 "regression-bugs-tmp/SIM.imp"
S = NETS;
                                                                //    570    %whilenot s==nil %cycle
#line 570 "regression-bugs-tmp/SIM.imp"
L_00b1:;
#line 570 "regression-bugs-tmp/SIM.imp"
if (((S) == (NIL))) goto L_00b2;
                                                                //    571      %result==s %if s_name=atom
#line 571 "regression-bugs-tmp/SIM.imp"
if ((_imp_strcmp(S->NAME, ATOM) != 0)) goto L_00b4;
#line 571 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return S;
#line 571 "regression-bugs-tmp/SIM.imp"
L_00b4:;
                                                                //    572      s==s_next
#line 572 "regression-bugs-tmp/SIM.imp"
S = S->NEXT;
                                                                //    573    %repeat
#line 573 "regression-bugs-tmp/SIM.imp"
goto L_00b1;
#line 573 "regression-bugs-tmp/SIM.imp"
L_00b2:;
                                                                //    574    s==newsignal; s_next==nets; nets==s; s_name=atom
#line 574 "regression-bugs-tmp/SIM.imp"
S = NEWSIGNAL();
#line 574 "regression-bugs-tmp/SIM.imp"
S->NEXT = NETS;
#line 574 "regression-bugs-tmp/SIM.imp"
NETS = S;
#line 574 "regression-bugs-tmp/SIM.imp"
S->NAME = ATOM;
                                                                //    575    %result==s
#line 575 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return S;
                                                                //    576  %end
#line 576 "regression-bugs-tmp/SIM.imp"
} // End of block FINDSIGNAL at level 2
                                                                //    577  
                                                                //    578  %routine readcomponent
#line 578 "regression-bugs-tmp/SIM.imp"
void READCOMPONENT( void )
#line 578 "regression-bugs-tmp/SIM.imp"
{
                                                                //    579  %record(compf)%name c
#line 579 "regression-bugs-tmp/SIM.imp"
 COMPF /*name*/*C;
                                                                //    580  %record(pinf)%name p,plist
#line 580 "regression-bugs-tmp/SIM.imp"
 PINF /*name*/*P;
#line 580 "regression-bugs-tmp/SIM.imp"
 PINF /*name*/*PLIST;
                                                                //    581  %record(sigf)%name s
#line 581 "regression-bugs-tmp/SIM.imp"
 SIGF /*name*/*S;
                                                                //    582  %integer t,slashes
#line 582 "regression-bugs-tmp/SIM.imp"
int T;
#line 582 "regression-bugs-tmp/SIM.imp"
int SLASHES;
                                                                //    583  
                                                                //    584  %record(pinf)%map reverse(%record(pinf)%name this)
#line 584 "regression-bugs-tmp/SIM.imp"
 PINF /*map*/*REVERSE(  PINF /*name*/*THIS )
#line 584 "regression-bugs-tmp/SIM.imp"
{
                                                                //    585  %record(pinf)%name tail,next
#line 585 "regression-bugs-tmp/SIM.imp"
 PINF /*name*/*TAIL;
#line 585 "regression-bugs-tmp/SIM.imp"
 PINF /*name*/*NEXT;
                                                                //    586    tail==nil; %result==nil %if this==nil
#line 586 "regression-bugs-tmp/SIM.imp"
TAIL = NIL;
#line 586 "regression-bugs-tmp/SIM.imp"
if (((THIS) != (NIL))) goto L_00b5;
#line 586 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return NIL;
#line 586 "regression-bugs-tmp/SIM.imp"
L_00b5:;
                                                                //    587    %cycle
#line 587 "regression-bugs-tmp/SIM.imp"
L_00b6:;
                                                                //    588      next==this_next; this_next==tail; tail==this
#line 588 "regression-bugs-tmp/SIM.imp"
NEXT = THIS->NEXT;
#line 588 "regression-bugs-tmp/SIM.imp"
THIS->NEXT = TAIL;
#line 588 "regression-bugs-tmp/SIM.imp"
TAIL = THIS;
                                                                //    589      %result==this %if next==nil; this==next
#line 589 "regression-bugs-tmp/SIM.imp"
if (((NEXT) != (NIL))) goto L_00b9;
#line 589 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return THIS;
#line 589 "regression-bugs-tmp/SIM.imp"
L_00b9:;
#line 589 "regression-bugs-tmp/SIM.imp"
THIS = NEXT;
                                                                //    590    %repeat
#line 590 "regression-bugs-tmp/SIM.imp"
goto L_00b6;
                                                                //    591  %end
#line 591 "regression-bugs-tmp/SIM.imp"
} // End of block REVERSE at level 3
                                                                //    592  
                                                                //    593  !%record(pinf)%map reversecopy(%record(pinf)%name list)
                                                                //    594  !%record(pinf)%name x,y
                                                                //    595  !  x==nil
                                                                //    596  !  %cycle
                                                                //    597  !    %result==x %if list==nil
                                                                //    598  !    y==newpin; y_next==x; x==y
                                                                //    599  !    y_comp==c; y_signal==list_signal
                                                                //    600  !    list==list_next
                                                                //    601  !  %repeat
                                                                //    602  !%end
                                                                //    603  !
                                                                //    604  !%record(pinf)%map append(%record(pinf)%name tail,list)
                                                                //    605  !%record(pinf)%name p
                                                                //    606  !  %result==tail %if list==nil
                                                                //    607  !  p==list; p==p_next %whilenot p_next==nil; p_next==tail
                                                                //    608  !  %result==list
                                                                //    609  !%end
                                                                //    610  
                                                                //    611    readatom; %signal 9 %if atom="END"
#line 611 "regression-bugs-tmp/SIM.imp"
READATOM();
#line 611 "regression-bugs-tmp/SIM.imp"
if ((_imp_strcmp(ATOM, _imp_str_literal("END")) != 0)) goto L_00b7;
#line 611 "regression-bugs-tmp/SIM.imp"
_imp_signal(9, 0, 0, "");
#line 611 "regression-bugs-tmp/SIM.imp"
L_00b7:;
                                                                //    612    %for t=1,1,known %cycle
#line 612 "regression-bugs-tmp/SIM.imp"
T = 0;
if ((((13)-(1)) % (1)) != 0) _imp_signal(5,1,0,"Illegal cycle T = 1, 1, 13");
L_00ba:;
if (T == 13) goto L_00bb;
T += 1;
                                                                //    613      ->ok %if type(t)=atom
#line 613 "regression-bugs-tmp/SIM.imp"
if ((_imp_strcmp(TYPE[T], ATOM) != 0)) goto L_00bd;
#line 613 "regression-bugs-tmp/SIM.imp"
goto U_1001;
#line 613 "regression-bugs-tmp/SIM.imp"
L_00bd:;
                                                                //    614    %repeat
#line 614 "regression-bugs-tmp/SIM.imp"
goto L_00ba;
#line 614 "regression-bugs-tmp/SIM.imp"
L_00bb:;
                                                                //    615    printstring("Unknown component "); printstring(atom); newline
#line 615 "regression-bugs-tmp/SIM.imp"
_imp_PRINTSTRING(_imp_str_literal("Unknown component "));
#line 615 "regression-bugs-tmp/SIM.imp"
_imp_PRINTSTRING(ATOM);
#line 615 "regression-bugs-tmp/SIM.imp"
_imp_NEWLINE();
                                                                //    616    t=0
#line 616 "regression-bugs-tmp/SIM.imp"
T = 0;
                                                                //    617  ok: c==newcomp; c_type=t
#line 617 "regression-bugs-tmp/SIM.imp"
U_1001:;
#line 617 "regression-bugs-tmp/SIM.imp"
C = NEWCOMP();
#line 617 "regression-bugs-tmp/SIM.imp"
C->TYPE = T;
                                                                //    618    c_next==components; components==c
#line 618 "regression-bugs-tmp/SIM.imp"
C->NEXT = COMPONENTS;
#line 618 "regression-bugs-tmp/SIM.imp"
COMPONENTS = C;
                                                                //    619    slashes=0; plist==nil
#line 619 "regression-bugs-tmp/SIM.imp"
SLASHES = 0;
#line 619 "regression-bugs-tmp/SIM.imp"
PLIST = NIL;
                                                                //    620    readatom
#line 620 "regression-bugs-tmp/SIM.imp"
READATOM();
                                                                //    621    printstring("( expected") %and newline %unless atom="("
#line 621 "regression-bugs-tmp/SIM.imp"
if ((_imp_strcmp(ATOM, _imp_str_literal("(")) == 0)) goto L_00be;
#line 621 "regression-bugs-tmp/SIM.imp"
_imp_PRINTSTRING(_imp_str_literal("( expected"));
#line 621 "regression-bugs-tmp/SIM.imp"
_imp_NEWLINE();
#line 621 "regression-bugs-tmp/SIM.imp"
L_00be:;
                                                                //    622  !Non-ESDL-compatible notation:  comp(ins{{/inouts}/outs})
                                                                //    623  !  readatom
                                                                //    624  !  %cycle
                                                                //    625  !    %if atom="/" %or atom=")" %start
                                                                //    626  !      %if slashes=0 %start
                                                                //    627  !        c_ins==reverse(plist); %exitif atom=")"
                                                                //    628  !        slashes=1
                                                                //    629  !      %finishelsestart
                                                                //    630  !        %if atom=")" %start
                                                                //    631  !          c_outs==append(reverse(plist),c_outs); %exit
                                                                //    632  !        %finish
                                                                //    633  !        c_ins==append(reversecopy(plist),c_ins)
                                                                //    634  !        c_outs==reverse(plist)
                                                                //    635  !      %finish
                                                                //    636  !      plist==nil
                                                                //    637  !      readatom
                                                                //    638  !    %finishelsestart
                                                                //    639  !      printstring("Unexpected (") %and newline %if atom="("
                                                                //    640  !      printstring("Unexpected ,") %and newline %if atom=","
                                                                //    641  !      s==nil; s==findsignal %unless atom="?"
                                                                //    642  !      p==newpin; p_next==plist; plist==p
                                                                //    643  !      p_comp==c; p_signal==s; p_state=open %if s==nil
                                                                //    644  !      readatom
                                                                //    645  !      %if atom="," %then readatom %elsestart
                                                                //    646  !        printstring(", expected") %and newline %unless atom="/" %or atom=")"
                                                                //    647  !      %finish
                                                                //    648  !    %finish
                                                                //    649  !  %repeat
                                                                //    650  !ESDL-compatible notation: comp(ins)->outs
                                                                //    651  ! This requires pending atom and disallows inouts
                                                                //    652    %cycle
#line 652 "regression-bugs-tmp/SIM.imp"
L_00bf:;
                                                                //    653      readatom
#line 653 "regression-bugs-tmp/SIM.imp"
READATOM();
                                                                //    654      %if atom=")" %or atom="," %or atom="/" %start
#line 654 "regression-bugs-tmp/SIM.imp"
if ((_imp_strcmp(ATOM, _imp_str_literal(")")) == 0)) goto L_00a6;
#line 654 "regression-bugs-tmp/SIM.imp"
if ((_imp_strcmp(ATOM, _imp_str_literal(",")) == 0)) goto L_00a6;
#line 654 "regression-bugs-tmp/SIM.imp"
if ((_imp_strcmp(ATOM, _imp_str_literal("/")) != 0)) goto L_00c2;
#line 654 "regression-bugs-tmp/SIM.imp"
L_00a6:;
                                                                //    655        printstring(atom); printstring(" not expected"); newline
#line 655 "regression-bugs-tmp/SIM.imp"
_imp_PRINTSTRING(ATOM);
#line 655 "regression-bugs-tmp/SIM.imp"
_imp_PRINTSTRING(_imp_str_literal(" not expected"));
#line 655 "regression-bugs-tmp/SIM.imp"
_imp_NEWLINE();
                                                                //    656        %exit
#line 656 "regression-bugs-tmp/SIM.imp"
goto L_00c0;
                                                                //    657      %finish
#line 657 "regression-bugs-tmp/SIM.imp"
L_00c2:;
                                                                //    658      s==nil; s==findsignal %unless atom="?"
#line 658 "regression-bugs-tmp/SIM.imp"
S = NIL;
#line 658 "regression-bugs-tmp/SIM.imp"
if ((_imp_strcmp(ATOM, _imp_str_literal("?")) == 0)) goto L_00c3;
#line 658 "regression-bugs-tmp/SIM.imp"
S = FINDSIGNAL();
#line 658 "regression-bugs-tmp/SIM.imp"
L_00c3:;
                                                                //    659      p==newpin; p_next==plist; plist==p
#line 659 "regression-bugs-tmp/SIM.imp"
P = NEWPIN();
#line 659 "regression-bugs-tmp/SIM.imp"
P->NEXT = PLIST;
#line 659 "regression-bugs-tmp/SIM.imp"
PLIST = P;
                                                                //    660      p_comp==c; p_signal==s; p_state=open %if s==nil
#line 660 "regression-bugs-tmp/SIM.imp"
P->COMP = C;
#line 660 "regression-bugs-tmp/SIM.imp"
P->SIGNAL = S;
#line 660 "regression-bugs-tmp/SIM.imp"
if (((S) != (NIL))) goto L_00c4;
#line 660 "regression-bugs-tmp/SIM.imp"
P->STATE = 0;
#line 660 "regression-bugs-tmp/SIM.imp"
L_00c4:;
                                                                //    661      readatom
#line 661 "regression-bugs-tmp/SIM.imp"
READATOM();
                                                                //    662      %exitif atom=")" %or atom="/"
#line 662 "regression-bugs-tmp/SIM.imp"
if ((_imp_strcmp(ATOM, _imp_str_literal(")")) == 0)) goto L_00c5;
#line 662 "regression-bugs-tmp/SIM.imp"
if ((_imp_strcmp(ATOM, _imp_str_literal("/")) != 0)) goto L_00c6;
#line 662 "regression-bugs-tmp/SIM.imp"
L_00c5:;
#line 662 "regression-bugs-tmp/SIM.imp"
goto L_00c0;
#line 662 "regression-bugs-tmp/SIM.imp"
L_00c6:;
                                                                //    663      printstring(", expected") %and newline %unless atom=","
#line 663 "regression-bugs-tmp/SIM.imp"
if ((_imp_strcmp(ATOM, _imp_str_literal(",")) == 0)) goto L_00c7;
#line 663 "regression-bugs-tmp/SIM.imp"
_imp_PRINTSTRING(_imp_str_literal(", expected"));
#line 663 "regression-bugs-tmp/SIM.imp"
_imp_NEWLINE();
#line 663 "regression-bugs-tmp/SIM.imp"
L_00c7:;
                                                                //    664    %repeat
#line 664 "regression-bugs-tmp/SIM.imp"
goto L_00bf;
#line 664 "regression-bugs-tmp/SIM.imp"
L_00c0:;
                                                                //    665    readatom %if atom=")"
#line 665 "regression-bugs-tmp/SIM.imp"
if ((_imp_strcmp(ATOM, _imp_str_literal(")")) != 0)) goto L_00c8;
#line 665 "regression-bugs-tmp/SIM.imp"
READATOM();
#line 665 "regression-bugs-tmp/SIM.imp"
L_00c8:;
                                                                //    666    printstring("-> expected") %and newline %unless atom="/"
#line 666 "regression-bugs-tmp/SIM.imp"
if ((_imp_strcmp(ATOM, _imp_str_literal("/")) == 0)) goto L_00c9;
#line 666 "regression-bugs-tmp/SIM.imp"
_imp_PRINTSTRING(_imp_str_literal("-> expected"));
#line 666 "regression-bugs-tmp/SIM.imp"
_imp_NEWLINE();
#line 666 "regression-bugs-tmp/SIM.imp"
L_00c9:;
                                                                //    667    c_ins==reverse(plist); plist==nil
#line 667 "regression-bugs-tmp/SIM.imp"
C->INS = REVERSE(PLIST);
#line 667 "regression-bugs-tmp/SIM.imp"
PLIST = NIL;
                                                                //    668    %cycle
#line 668 "regression-bugs-tmp/SIM.imp"
L_00ca:;
                                                                //    669      readatom
#line 669 "regression-bugs-tmp/SIM.imp"
READATOM();
                                                                //    670      printstring(", not expected") %and newline %if atom=","
#line 670 "regression-bugs-tmp/SIM.imp"
if ((_imp_strcmp(ATOM, _imp_str_literal(",")) != 0)) goto L_00cd;
#line 670 "regression-bugs-tmp/SIM.imp"
_imp_PRINTSTRING(_imp_str_literal(", not expected"));
#line 670 "regression-bugs-tmp/SIM.imp"
_imp_NEWLINE();
#line 670 "regression-bugs-tmp/SIM.imp"
L_00cd:;
                                                                //    671      s==nil; s==findsignal %unless atom="?"
#line 671 "regression-bugs-tmp/SIM.imp"
S = NIL;
#line 671 "regression-bugs-tmp/SIM.imp"
if ((_imp_strcmp(ATOM, _imp_str_literal("?")) == 0)) goto L_00ce;
#line 671 "regression-bugs-tmp/SIM.imp"
S = FINDSIGNAL();
#line 671 "regression-bugs-tmp/SIM.imp"
L_00ce:;
                                                                //    672      p==newpin; p_next==plist; plist==p
#line 672 "regression-bugs-tmp/SIM.imp"
P = NEWPIN();
#line 672 "regression-bugs-tmp/SIM.imp"
P->NEXT = PLIST;
#line 672 "regression-bugs-tmp/SIM.imp"
PLIST = P;
                                                                //    673      p_comp==c; p_signal==s; p_state=open %if s==nil
#line 673 "regression-bugs-tmp/SIM.imp"
P->COMP = C;
#line 673 "regression-bugs-tmp/SIM.imp"
P->SIGNAL = S;
#line 673 "regression-bugs-tmp/SIM.imp"
if (((S) != (NIL))) goto L_00cf;
#line 673 "regression-bugs-tmp/SIM.imp"
P->STATE = 0;
#line 673 "regression-bugs-tmp/SIM.imp"
L_00cf:;
                                                                //    674      readatom; %exitunless atom=","
#line 674 "regression-bugs-tmp/SIM.imp"
READATOM();
#line 674 "regression-bugs-tmp/SIM.imp"
if ((_imp_strcmp(ATOM, _imp_str_literal(",")) == 0)) goto L_00d0;
#line 674 "regression-bugs-tmp/SIM.imp"
goto L_00cb;
#line 674 "regression-bugs-tmp/SIM.imp"
L_00d0:;
                                                                //    675    %repeat
#line 675 "regression-bugs-tmp/SIM.imp"
goto L_00ca;
#line 675 "regression-bugs-tmp/SIM.imp"
L_00cb:;
                                                                //    676    pend=atom %unless atom=")"
#line 676 "regression-bugs-tmp/SIM.imp"
if ((_imp_strcmp(ATOM, _imp_str_literal(")")) == 0)) goto L_00d1;
#line 676 "regression-bugs-tmp/SIM.imp"
PEND = ATOM;
#line 676 "regression-bugs-tmp/SIM.imp"
L_00d1:;
                                                                //    677    c_outs==reverse(plist); plist==nil
#line 677 "regression-bugs-tmp/SIM.imp"
C->OUTS = REVERSE(PLIST);
#line 677 "regression-bugs-tmp/SIM.imp"
PLIST = NIL;
                                                                //    678    p==c_ins
#line 678 "regression-bugs-tmp/SIM.imp"
P = C->INS;
                                                                //    679    %whilenot p==nil %cycle
#line 679 "regression-bugs-tmp/SIM.imp"
L_00d2:;
#line 679 "regression-bugs-tmp/SIM.imp"
if (((P) == (NIL))) goto L_00d3;
                                                                //    680      s==p_signal
#line 680 "regression-bugs-tmp/SIM.imp"
S = P->SIGNAL;
                                                                //    681      p_chain==s_to %and s_to==p %unless s==nil
#line 681 "regression-bugs-tmp/SIM.imp"
if (((S) == (NIL))) goto L_00d5;
#line 681 "regression-bugs-tmp/SIM.imp"
P->CHAIN = S->TO;
#line 681 "regression-bugs-tmp/SIM.imp"
S->TO = P;
#line 681 "regression-bugs-tmp/SIM.imp"
L_00d5:;
                                                                //    682      p==p_next
#line 682 "regression-bugs-tmp/SIM.imp"
P = P->NEXT;
                                                                //    683    %repeat
#line 683 "regression-bugs-tmp/SIM.imp"
goto L_00d2;
#line 683 "regression-bugs-tmp/SIM.imp"
L_00d3:;
                                                                //    684    p==c_outs
#line 684 "regression-bugs-tmp/SIM.imp"
P = C->OUTS;
                                                                //    685    %whilenot p==nil %cycle
#line 685 "regression-bugs-tmp/SIM.imp"
L_00d6:;
#line 685 "regression-bugs-tmp/SIM.imp"
if (((P) == (NIL))) goto L_00d7;
                                                                //    686      s==p_signal
#line 686 "regression-bugs-tmp/SIM.imp"
S = P->SIGNAL;
                                                                //    687      p_chain==s_from %and s_from==p %unless s==nil
#line 687 "regression-bugs-tmp/SIM.imp"
if (((S) == (NIL))) goto L_00d9;
#line 687 "regression-bugs-tmp/SIM.imp"
P->CHAIN = S->FROM;
#line 687 "regression-bugs-tmp/SIM.imp"
S->FROM = P;
#line 687 "regression-bugs-tmp/SIM.imp"
L_00d9:;
                                                                //    688      p==p_next
#line 688 "regression-bugs-tmp/SIM.imp"
P = P->NEXT;
                                                                //    689    %repeat
#line 689 "regression-bugs-tmp/SIM.imp"
goto L_00d6;
#line 689 "regression-bugs-tmp/SIM.imp"
L_00d7:;
                                                                //    690  %end
#line 690 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block READCOMPONENT at level 2
                                                                //    691  
                                                                //    692  %routine simulate
#line 692 "regression-bugs-tmp/SIM.imp"
void SIMULATE( void )
#line 692 "regression-bugs-tmp/SIM.imp"
{
                                                                //    693  %integer command,i
#line 693 "regression-bugs-tmp/SIM.imp"
int COMMAND;
#line 693 "regression-bugs-tmp/SIM.imp"
int I;
                                                                //    694  %record(compf)%name c
#line 694 "regression-bugs-tmp/SIM.imp"
 COMPF /*name*/*C;
                                                                //    695  %record(sigf)%name s
#line 695 "regression-bugs-tmp/SIM.imp"
 SIGF /*name*/*S;
                                                                //    696  
                                                                //    697  %routine identify
#line 697 "regression-bugs-tmp/SIM.imp"
void IDENTIFY( void )
#line 697 "regression-bugs-tmp/SIM.imp"
{
                                                                //    698    readatom
#line 698 "regression-bugs-tmp/SIM.imp"
READATOM();
                                                                //    699    s==findsignal
#line 699 "regression-bugs-tmp/SIM.imp"
S = FINDSIGNAL();
                                                                //    700    %if s_from==nil %and s_to==nil %start
#line 700 "regression-bugs-tmp/SIM.imp"
if (((S->FROM) != (NIL))) goto L_00da;
#line 700 "regression-bugs-tmp/SIM.imp"
if (((S->TO) != (NIL))) goto L_00da;
                                                                //    701      s==nil; printstring("Not connected"); newline
#line 701 "regression-bugs-tmp/SIM.imp"
S = NIL;
#line 701 "regression-bugs-tmp/SIM.imp"
_imp_PRINTSTRING(_imp_str_literal("Not connected"));
#line 701 "regression-bugs-tmp/SIM.imp"
_imp_NEWLINE();
                                                                //    702    %finish
#line 702 "regression-bugs-tmp/SIM.imp"
L_00da:;
                                                                //    703  %end
#line 703 "regression-bugs-tmp/SIM.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block IDENTIFY at level 3
                                                                //    704  
                                                                //    705    initialise arrays
#line 705 "regression-bugs-tmp/SIM.imp"
INITIALISEARRAYS();
                                                                //    706    escape(clearscreen); newline
#line 706 "regression-bugs-tmp/SIM.imp"
ESCAPE(118);
#line 706 "regression-bugs-tmp/SIM.imp"
_imp_NEWLINE();
                                                                //    707  
                                                                //    708  %cycle
#line 708 "regression-bugs-tmp/SIM.imp"
L_00db:;
                                                                //    709    escape(home); escape(clearline); newline
#line 709 "regression-bugs-tmp/SIM.imp"
ESCAPE(72);
#line 709 "regression-bugs-tmp/SIM.imp"
ESCAPE(75);
#line 709 "regression-bugs-tmp/SIM.imp"
_imp_NEWLINE();
                                                                //    710    prompt(tostring(esc).tostring(up)."scuovpdr+-?:")
#line 710 "regression-bugs-tmp/SIM.imp"
_imp_PROMPT(_imp_join((_imp_string)_imp_join((_imp_string)_imp_TOSTRING(27),(_imp_string)_imp_TOSTRING(65)),(_imp_string)_imp_str_literal("scuovpdr+-?:")));
                                                                //    711    escape(clearline); newline
#line 711 "regression-bugs-tmp/SIM.imp"
ESCAPE(75);
#line 711 "regression-bugs-tmp/SIM.imp"
_imp_NEWLINE();
                                                                //    712    readsymbol(command) %until command>' '
#line 712 "regression-bugs-tmp/SIM.imp"
L_00de:;
#line 712 "regression-bugs-tmp/SIM.imp"
_imp_READSYMBOL(&COMMAND);
#line 712 "regression-bugs-tmp/SIM.imp"
if (((COMMAND) > (32))) goto L_00df;
#line 712 "regression-bugs-tmp/SIM.imp"
goto L_00de;
#line 712 "regression-bugs-tmp/SIM.imp"
L_00df:;
                                                                //    713    command=command!32
#line 713 "regression-bugs-tmp/SIM.imp"
COMMAND = ((COMMAND) | (32));
                                                                //    714    %stopif command=':'
#line 714 "regression-bugs-tmp/SIM.imp"
if (((COMMAND) != (58))) goto L_00e1;
#line 714 "regression-bugs-tmp/SIM.imp"
exit(0);
#line 714 "regression-bugs-tmp/SIM.imp"
L_00e1:;
                                                                //    715    %if command='-' %start
#line 715 "regression-bugs-tmp/SIM.imp"
if (((COMMAND) != (45))) goto L_00e2;
                                                                //    716      identify
#line 716 "regression-bugs-tmp/SIM.imp"
IDENTIFY();
                                                                //    717      %unless s==nil %start
#line 717 "regression-bugs-tmp/SIM.imp"
if (((S) == (NIL))) goto L_00e3;
                                                                //    718        i=s_screenslot
#line 718 "regression-bugs-tmp/SIM.imp"
I = S->SCREENSLOT;
                                                                //    719        %unless i=0 %start
#line 719 "regression-bugs-tmp/SIM.imp"
if (((I) == (0))) goto L_00e4;
                                                                //    720          slot(i)==nil
#line 720 "regression-bugs-tmp/SIM.imp"
SLOT[(((int)(I)) - (1))] = NIL;
                                                                //    721          s_screenslot=0
#line 721 "regression-bugs-tmp/SIM.imp"
S->SCREENSLOT = 0;
                                                                //    722          cursor(0,i+i+1); escape(clearline)
#line 722 "regression-bugs-tmp/SIM.imp"
CURSOR(0, (((int)((((int)(I)) + (I)))) + (1)));
#line 722 "regression-bugs-tmp/SIM.imp"
ESCAPE(75);
                                                                //    723          cursor(0,i+i);   escape(clearline)
#line 723 "regression-bugs-tmp/SIM.imp"
CURSOR(0, (((int)(I)) + (I)));
#line 723 "regression-bugs-tmp/SIM.imp"
ESCAPE(75);
                                                                //    724          newline; !??
#line 724 "regression-bugs-tmp/SIM.imp"
_imp_NEWLINE();
                                                                //    725        %finish
#line 725 "regression-bugs-tmp/SIM.imp"
L_00e4:;
                                                                //    726      %finish
#line 726 "regression-bugs-tmp/SIM.imp"
L_00e3:;
                                                                //    727    %finishelseif command='+' %start
#line 727 "regression-bugs-tmp/SIM.imp"
goto L_00e5;
#line 727 "regression-bugs-tmp/SIM.imp"
L_00e2:;
#line 727 "regression-bugs-tmp/SIM.imp"
if (((COMMAND) != (43))) goto L_00e6;
                                                                //    728      identify
#line 728 "regression-bugs-tmp/SIM.imp"
IDENTIFY();
                                                                //    729      %unless s==nil %start
#line 729 "regression-bugs-tmp/SIM.imp"
if (((S) == (NIL))) goto L_00e7;
                                                                //    730        %if s_screenslot=0 %start
#line 730 "regression-bugs-tmp/SIM.imp"
if (((S->SCREENSLOT) != (0))) goto L_00e8;
                                                                //    731          %for i=1,1,slotmax %cycle
#line 731 "regression-bugs-tmp/SIM.imp"
I = 0;
if ((((11)-(1)) % (1)) != 0) _imp_signal(5,1,0,"Illegal cycle I = 1, 1, 11");
L_00e9:;
if (I == 11) goto L_00ea;
I += 1;
                                                                //    732            %if slot(i)==nil %start
#line 732 "regression-bugs-tmp/SIM.imp"
if (((SLOT[(((int)(I)) - (1))]) != (NIL))) goto L_00ec;
                                                                //    733              slot(i)==s; s_screenslot=i
#line 733 "regression-bugs-tmp/SIM.imp"
SLOT[(((int)(I)) - (1))] = S;
#line 733 "regression-bugs-tmp/SIM.imp"
S->SCREENSLOT = I;
                                                                //    734              refresh(i)
#line 734 "regression-bugs-tmp/SIM.imp"
REFRESH(I);
                                                                //    735              %exit
#line 735 "regression-bugs-tmp/SIM.imp"
goto L_00ea;
                                                                //    736            %finish
#line 736 "regression-bugs-tmp/SIM.imp"
L_00ec:;
                                                                //    737          %repeat
#line 737 "regression-bugs-tmp/SIM.imp"
goto L_00e9;
#line 737 "regression-bugs-tmp/SIM.imp"
L_00ea:;
                                                                //    738        %finish
#line 738 "regression-bugs-tmp/SIM.imp"
L_00e8:;
                                                                //    739      %finish
#line 739 "regression-bugs-tmp/SIM.imp"
L_00e7:;
                                                                //    740    %finishelseif command='r' %start
#line 740 "regression-bugs-tmp/SIM.imp"
goto L_00e5;
#line 740 "regression-bugs-tmp/SIM.imp"
L_00e6:;
#line 740 "regression-bugs-tmp/SIM.imp"
if (((COMMAND) != (114))) goto L_00ed;
                                                                //    741      refresh(i) %for i=1,1,slotmax
#line 741 "regression-bugs-tmp/SIM.imp"
I = 0;
if ((((11)-(1)) % (1)) != 0) _imp_signal(5,1,0,"Illegal cycle I = 1, 1, 11");
L_00ee:;
if (I == 11) goto L_00ef;
I += 1;
#line 741 "regression-bugs-tmp/SIM.imp"
REFRESH(I);
#line 741 "regression-bugs-tmp/SIM.imp"
goto L_00ee;
#line 741 "regression-bugs-tmp/SIM.imp"
L_00ef:;
                                                                //    742    %finishelseif command='?' %start
#line 742 "regression-bugs-tmp/SIM.imp"
goto L_00e5;
#line 742 "regression-bugs-tmp/SIM.imp"
L_00ed:;
#line 742 "regression-bugs-tmp/SIM.imp"
if (((COMMAND) != (63))) goto L_00f1;
                                                                //    743      identify
#line 743 "regression-bugs-tmp/SIM.imp"
IDENTIFY();
                                                                //    744      %unless s==nil %start
#line 744 "regression-bugs-tmp/SIM.imp"
if (((S) == (NIL))) goto L_00f2;
                                                                //    745        printstring(atom); printstring(" = "); print(s_state); newline
#line 745 "regression-bugs-tmp/SIM.imp"
_imp_PRINTSTRING(ATOM);
#line 745 "regression-bugs-tmp/SIM.imp"
_imp_PRINTSTRING(_imp_str_literal(" = "));
#line 745 "regression-bugs-tmp/SIM.imp"
PRINT(S->STATE);
#line 745 "regression-bugs-tmp/SIM.imp"
_imp_NEWLINE();
                                                                //    746      %finish
#line 746 "regression-bugs-tmp/SIM.imp"
L_00f2:;
                                                                //    747    %finishelseif command='s' %start
#line 747 "regression-bugs-tmp/SIM.imp"
goto L_00e5;
#line 747 "regression-bugs-tmp/SIM.imp"
L_00f1:;
#line 747 "regression-bugs-tmp/SIM.imp"
if (((COMMAND) != (115))) goto L_00f3;
                                                                //    748      identify
#line 748 "regression-bugs-tmp/SIM.imp"
IDENTIFY();
                                                                //    749      %unless s==nil %start
#line 749 "regression-bugs-tmp/SIM.imp"
if (((S) == (NIL))) goto L_00f4;
                                                                //    750        s_state=rising; propagate(s)
#line 750 "regression-bugs-tmp/SIM.imp"
S->STATE = 1;
#line 750 "regression-bugs-tmp/SIM.imp"
PROPAGATE(S);
                                                                //    751        s_state=high; propagate(s)
#line 751 "regression-bugs-tmp/SIM.imp"
S->STATE = 2;
#line 751 "regression-bugs-tmp/SIM.imp"
PROPAGATE(S);
                                                                //    752        aftermath
#line 752 "regression-bugs-tmp/SIM.imp"
AFTERMATH();
                                                                //    753      %finish
#line 753 "regression-bugs-tmp/SIM.imp"
L_00f4:;
                                                                //    754    %finishelseif command='c' %start
#line 754 "regression-bugs-tmp/SIM.imp"
goto L_00e5;
#line 754 "regression-bugs-tmp/SIM.imp"
L_00f3:;
#line 754 "regression-bugs-tmp/SIM.imp"
if (((COMMAND) != (99))) goto L_00f5;
                                                                //    755      identify
#line 755 "regression-bugs-tmp/SIM.imp"
IDENTIFY();
                                                                //    756      %unless s==nil %start
#line 756 "regression-bugs-tmp/SIM.imp"
if (((S) == (NIL))) goto L_00f6;
                                                                //    757        s_state=falling; propagate(s)
#line 757 "regression-bugs-tmp/SIM.imp"
S->STATE = (-1);
#line 757 "regression-bugs-tmp/SIM.imp"
PROPAGATE(S);
                                                                //    758        s_state=low; propagate(s)
#line 758 "regression-bugs-tmp/SIM.imp"
S->STATE = (-2);
#line 758 "regression-bugs-tmp/SIM.imp"
PROPAGATE(S);
                                                                //    759        aftermath
#line 759 "regression-bugs-tmp/SIM.imp"
AFTERMATH();
                                                                //    760      %finish
#line 760 "regression-bugs-tmp/SIM.imp"
L_00f6:;
                                                                //    761    %finishelseif command='u' %start
#line 761 "regression-bugs-tmp/SIM.imp"
goto L_00e5;
#line 761 "regression-bugs-tmp/SIM.imp"
L_00f5:;
#line 761 "regression-bugs-tmp/SIM.imp"
if (((COMMAND) != (117))) goto L_00f7;
                                                                //    762      identify
#line 762 "regression-bugs-tmp/SIM.imp"
IDENTIFY();
                                                                //    763      %unless s==nil %start
#line 763 "regression-bugs-tmp/SIM.imp"
if (((S) == (NIL))) goto L_00f8;
                                                                //    764        s_state=undef; propagate(s)
#line 764 "regression-bugs-tmp/SIM.imp"
S->STATE = (-2147483648);
#line 764 "regression-bugs-tmp/SIM.imp"
PROPAGATE(S);
                                                                //    765        aftermath
#line 765 "regression-bugs-tmp/SIM.imp"
AFTERMATH();
                                                                //    766      %finish
#line 766 "regression-bugs-tmp/SIM.imp"
L_00f8:;
                                                                //    767    %finishelseif command='o' %start
#line 767 "regression-bugs-tmp/SIM.imp"
goto L_00e5;
#line 767 "regression-bugs-tmp/SIM.imp"
L_00f7:;
#line 767 "regression-bugs-tmp/SIM.imp"
if (((COMMAND) != (111))) goto L_00f9;
                                                                //    768      identify
#line 768 "regression-bugs-tmp/SIM.imp"
IDENTIFY();
                                                                //    769      %unless s==nil %start
#line 769 "regression-bugs-tmp/SIM.imp"
if (((S) == (NIL))) goto L_00fa;
                                                                //    770        s_state=open; propagate(s)
#line 770 "regression-bugs-tmp/SIM.imp"
S->STATE = 0;
#line 770 "regression-bugs-tmp/SIM.imp"
PROPAGATE(S);
                                                                //    771        aftermath
#line 771 "regression-bugs-tmp/SIM.imp"
AFTERMATH();
                                                                //    772      %finish
#line 772 "regression-bugs-tmp/SIM.imp"
L_00fa:;
                                                                //    773    %finishelseif command='v' %start
#line 773 "regression-bugs-tmp/SIM.imp"
goto L_00e5;
#line 773 "regression-bugs-tmp/SIM.imp"
L_00f9:;
#line 773 "regression-bugs-tmp/SIM.imp"
if (((COMMAND) != (118))) goto L_00fb;
                                                                //    774      identify
#line 774 "regression-bugs-tmp/SIM.imp"
IDENTIFY();
                                                                //    775      %unless s==nil %start
#line 775 "regression-bugs-tmp/SIM.imp"
if (((S) == (NIL))) goto L_00fc;
                                                                //    776      %if |s_state|=high %start
#line 776 "regression-bugs-tmp/SIM.imp"
if (((_imp_IMOD(S->STATE)) != (2))) goto L_00fd;
                                                                //    777        s_state=-s_state//2; propagate(s)
#line 777 "regression-bugs-tmp/SIM.imp"
S->STATE = (-(((long)((long)((int)(S->STATE)) / (long)((int)(2))))));
#line 777 "regression-bugs-tmp/SIM.imp"
PROPAGATE(S);
                                                                //    778        s_state=s_state<<1; propagate(s)
#line 778 "regression-bugs-tmp/SIM.imp"
S->STATE = ((S->STATE) << (1));
#line 778 "regression-bugs-tmp/SIM.imp"
PROPAGATE(S);
                                                                //    779        aftermath
#line 779 "regression-bugs-tmp/SIM.imp"
AFTERMATH();
                                                                //    780      %finish
#line 780 "regression-bugs-tmp/SIM.imp"
L_00fd:;
                                                                //    781      %finish
#line 781 "regression-bugs-tmp/SIM.imp"
L_00fc:;
                                                                //    782    %finishelseif command='p' %start
#line 782 "regression-bugs-tmp/SIM.imp"
goto L_00e5;
#line 782 "regression-bugs-tmp/SIM.imp"
L_00fb:;
#line 782 "regression-bugs-tmp/SIM.imp"
if (((COMMAND) != (112))) goto L_00fe;
                                                                //    783      identify
#line 783 "regression-bugs-tmp/SIM.imp"
IDENTIFY();
                                                                //    784      %unless s==nil %start
#line 784 "regression-bugs-tmp/SIM.imp"
if (((S) == (NIL))) goto L_00ff;
                                                                //    785      %if |s_state|=high %start
#line 785 "regression-bugs-tmp/SIM.imp"
if (((_imp_IMOD(S->STATE)) != (2))) goto L_0100;
                                                                //    786        s_state=-s_state//2; propagate(s)
#line 786 "regression-bugs-tmp/SIM.imp"
S->STATE = (-(((long)((long)((int)(S->STATE)) / (long)((int)(2))))));
#line 786 "regression-bugs-tmp/SIM.imp"
PROPAGATE(S);
                                                                //    787        s_state=s_state<<1; propagate(s)
#line 787 "regression-bugs-tmp/SIM.imp"
S->STATE = ((S->STATE) << (1));
#line 787 "regression-bugs-tmp/SIM.imp"
PROPAGATE(S);
                                                                //    788        aftermath
#line 788 "regression-bugs-tmp/SIM.imp"
AFTERMATH();
                                                                //    789        s_state=-s_state//2; propagate(s)
#line 789 "regression-bugs-tmp/SIM.imp"
S->STATE = (-(((long)((long)((int)(S->STATE)) / (long)((int)(2))))));
#line 789 "regression-bugs-tmp/SIM.imp"
PROPAGATE(S);
                                                                //    790        s_state=s_state<<1; propagate(s)
#line 790 "regression-bugs-tmp/SIM.imp"
S->STATE = ((S->STATE) << (1));
#line 790 "regression-bugs-tmp/SIM.imp"
PROPAGATE(S);
                                                                //    791        aftermath
#line 791 "regression-bugs-tmp/SIM.imp"
AFTERMATH();
                                                                //    792      %finish
#line 792 "regression-bugs-tmp/SIM.imp"
L_0100:;
                                                                //    793      %finish
#line 793 "regression-bugs-tmp/SIM.imp"
L_00ff:;
                                                                //    794    %finishelseif command='d' %start
#line 794 "regression-bugs-tmp/SIM.imp"
goto L_00e5;
#line 794 "regression-bugs-tmp/SIM.imp"
L_00fe:;
#line 794 "regression-bugs-tmp/SIM.imp"
if (((COMMAND) != (100))) goto L_0101;
                                                                //    795      s==nets
#line 795 "regression-bugs-tmp/SIM.imp"
S = NETS;
                                                                //    796      %cycle
#line 796 "regression-bugs-tmp/SIM.imp"
L_0102:;
                                                                //    797        %if s_state=undef %start
#line 797 "regression-bugs-tmp/SIM.imp"
if (((S->STATE) != ((-2147483648)))) goto L_0105;
                                                                //    798          prompt(s_name." = "); readsymbol(sym)
#line 798 "regression-bugs-tmp/SIM.imp"
_imp_PROMPT(_imp_join((_imp_string)S->NAME,(_imp_string)_imp_str_literal(" = ")));
#line 798 "regression-bugs-tmp/SIM.imp"
_imp_READSYMBOL(&SYM);
                                                                //    799          %if sym#nl %start
#line 799 "regression-bugs-tmp/SIM.imp"
if (((SYM) == (10))) goto L_0106;
                                                                //    800            sym=sym!32
#line 800 "regression-bugs-tmp/SIM.imp"
SYM = ((SYM) | (32));
                                                                //    801            %if sym='h' %start
#line 801 "regression-bugs-tmp/SIM.imp"
if (((SYM) != (104))) goto L_0107;
                                                                //    802              s_state=rising; propagate(s)
#line 802 "regression-bugs-tmp/SIM.imp"
S->STATE = 1;
#line 802 "regression-bugs-tmp/SIM.imp"
PROPAGATE(S);
                                                                //    803              s_state=high; propagate(s)
#line 803 "regression-bugs-tmp/SIM.imp"
S->STATE = 2;
#line 803 "regression-bugs-tmp/SIM.imp"
PROPAGATE(S);
                                                                //    804            %finishelseif sym='l' %start
#line 804 "regression-bugs-tmp/SIM.imp"
goto L_0108;
#line 804 "regression-bugs-tmp/SIM.imp"
L_0107:;
#line 804 "regression-bugs-tmp/SIM.imp"
if (((SYM) != (108))) goto L_0109;
                                                                //    805              s_state=falling; propagate(s)
#line 805 "regression-bugs-tmp/SIM.imp"
S->STATE = (-1);
#line 805 "regression-bugs-tmp/SIM.imp"
PROPAGATE(S);
                                                                //    806              s_state=low; propagate(s)
#line 806 "regression-bugs-tmp/SIM.imp"
S->STATE = (-2);
#line 806 "regression-bugs-tmp/SIM.imp"
PROPAGATE(S);
                                                                //    807            %finishelseif sym='o' %start
#line 807 "regression-bugs-tmp/SIM.imp"
goto L_0108;
#line 807 "regression-bugs-tmp/SIM.imp"
L_0109:;
#line 807 "regression-bugs-tmp/SIM.imp"
if (((SYM) != (111))) goto L_010a;
                                                                //    808              s_state=open; propagate(s)
#line 808 "regression-bugs-tmp/SIM.imp"
S->STATE = 0;
#line 808 "regression-bugs-tmp/SIM.imp"
PROPAGATE(S);
                                                                //    809            %finishelse sym=0
#line 809 "regression-bugs-tmp/SIM.imp"
goto L_0108;
#line 809 "regression-bugs-tmp/SIM.imp"
L_010a:;
#line 809 "regression-bugs-tmp/SIM.imp"
SYM = 0;
#line 809 "regression-bugs-tmp/SIM.imp"
L_0108:;
                                                                //    810            aftermath %unless sym=0
#line 810 "regression-bugs-tmp/SIM.imp"
if (((SYM) == (0))) goto L_010b;
#line 810 "regression-bugs-tmp/SIM.imp"
AFTERMATH();
#line 810 "regression-bugs-tmp/SIM.imp"
L_010b:;
                                                                //    811            readsymbol(sym) %until sym=nl
#line 811 "regression-bugs-tmp/SIM.imp"
L_010c:;
#line 811 "regression-bugs-tmp/SIM.imp"
_imp_READSYMBOL(&SYM);
#line 811 "regression-bugs-tmp/SIM.imp"
if (((SYM) == (10))) goto L_010d;
#line 811 "regression-bugs-tmp/SIM.imp"
goto L_010c;
#line 811 "regression-bugs-tmp/SIM.imp"
L_010d:;
                                                                //    812          %finish
#line 812 "regression-bugs-tmp/SIM.imp"
L_0106:;
                                                                //    813        %finish
#line 813 "regression-bugs-tmp/SIM.imp"
L_0105:;
                                                                //    814        s==s_next
#line 814 "regression-bugs-tmp/SIM.imp"
S = S->NEXT;
                                                                //    815      %repeatuntil s==nil
#line 815 "regression-bugs-tmp/SIM.imp"
if (((S) == (NIL))) goto L_0103;
#line 815 "regression-bugs-tmp/SIM.imp"
goto L_0102;
#line 815 "regression-bugs-tmp/SIM.imp"
L_0103:;
                                                                //    816    %finish
#line 816 "regression-bugs-tmp/SIM.imp"
L_0101:;
#line 816 "regression-bugs-tmp/SIM.imp"
L_00e5:;
                                                                //    817  %repeat
#line 817 "regression-bugs-tmp/SIM.imp"
goto L_00db;
                                                                //    818  %end
#line 818 "regression-bugs-tmp/SIM.imp"
return;
} // End of block SIMULATE at level 2
                                                                //    819  
                                                                //    820  %integer stream=1
#line 820 "regression-bugs-tmp/SIM.imp"
int STREAM;
#line 820 "regression-bugs-tmp/SIM.imp"
STREAM = 1;
                                                                //    821  
                                                                //    822  %onevent 9 %start
#line 822 "regression-bugs-tmp/SIM.imp"
if (!_imp_on_event(9)) goto L_00dc;  /* TO DO: Remove %on %event handler just before L_00dc: if present for this block */
                                                                //    823    %stopif stream=0; stream=0
#line 823 "regression-bugs-tmp/SIM.imp"
if (((STREAM) != (0))) goto L_010f;
#line 823 "regression-bugs-tmp/SIM.imp"
exit(0);
#line 823 "regression-bugs-tmp/SIM.imp"
L_010f:;
#line 823 "regression-bugs-tmp/SIM.imp"
STREAM = 0;
                                                                //    824  %finish
#line 824 "regression-bugs-tmp/SIM.imp"
L_00dc:;
                                                                //    825  
                                                                //    826  selectinput(stream)
#line 826 "regression-bugs-tmp/SIM.imp"
_imp_SELECTINPUT(STREAM);
                                                                //    827  simulate %if stream=0
#line 827 "regression-bugs-tmp/SIM.imp"
if (((STREAM) != (0))) goto L_0110;
#line 827 "regression-bugs-tmp/SIM.imp"
SIMULATE();
#line 827 "regression-bugs-tmp/SIM.imp"
L_0110:;
                                                                //    828  %cycle
#line 828 "regression-bugs-tmp/SIM.imp"
L_0111:;
                                                                //    829    readcomponent
#line 829 "regression-bugs-tmp/SIM.imp"
READCOMPONENT();
                                                                //    830  %repeat
#line 830 "regression-bugs-tmp/SIM.imp"
goto L_0111;
                                                                //    831  
                                                                //    832  %endofprogram
#line 832 "regression-bugs-tmp/SIM.imp"
return 0;
} // End of block _imp_main at level 1
#line 832 "regression-bugs-tmp/SIM.imp"
// End of file
