#include <perms.h>

                                                                //      1  %begin
#line 1 "regression-bugs-tmp/nestrec.imp"
int main(int argc, char **argv) {
  _imp_initialise(argc, argv);
                                                                //      2  
                                                                //      3  %constinteger slotmax = 10
                                                                //      4  %constinteger eqmax = 6
                                                                //      5  %constinteger hmax = 4
                                                                //      6  
                                                                //      7  %record(*)%name nil==record(0)
#line 7 "regression-bugs-tmp/nestrec.imp"
 void /*name*/*NIL;
#line 7 "regression-bugs-tmp/nestrec.imp"
NIL =  ( void /* BUG caused by a pooltostr(0) call? */  *) _imp_RECORD(0);
                                                                //      8  
                                                                //      9  %recordformat hfm(%record(hfm)%name next,%integer state,since)
#line 9 "regression-bugs-tmp/nestrec.imp"
typedef struct HFM HFM;
struct HFM {
   HFM /*name*/*NEXT;
  int STATE;
  int SINCE;
};
                                                                //     10  
                                                                //     11  %recordformatspec pinf
                                                                //     12  %recordformatspec sigf
                                                                //     13  
                                                                //     14  %recordformat compf(%record(compf)%name next,
#line 14 "regression-bugs-tmp/nestrec.imp"
typedef struct COMPF COMPF;
struct COMPF {
   COMPF /*name*/*NEXT;
  int TYPE;
   void /*name*/*INS;
   void /*name*/*OUTS;
   void /*name*/*PRIVATE;
};
                                                                //     15                      %integer type {indexes into behaviour switch},
                                                                //     16                      %record(pinf)%name ins,outs,private)
                                                                //     17  %recordformat pinf(%record(pinf)%name next {pin in component},
#line 17 "regression-bugs-tmp/nestrec.imp"
typedef struct PINF PINF;
struct PINF {
   PINF /*name*/*NEXT;
   PINF /*name*/*CHAIN;
   COMPF /*name*/*COMP;
   void /*name*/*SIGNAL;
  int STATE;
};
                                                                //     18                     chain {next pin in net},%record(compf)%name comp,
                                                                //     19                     %record(sigf)%name signal, %integer state)
                                                                //     20  %recordformat sigf(%record(sigf)%name next {for identification},
#line 20 "regression-bugs-tmp/nestrec.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;
};
                                                                //     21                     %integer state,%record(pinf)%name from,to,
                                                                //     22                     %integer screenslot,%record(hfm)%name history,
                                                                //     23                     %string(15)name)
                                                                //     24  %recordformat eqf(%record(eqf)%name next,%record(pinf)%name pin,
#line 24 "regression-bugs-tmp/nestrec.imp"
typedef struct EQF EQF;
struct EQF {
   EQF /*name*/*NEXT;
   PINF /*name*/*PIN;
  int STATE;
  int WHEN;
};
                                                                //     25                    %integer state,when)
                                                                //     26  
                                                                //     27  %record(sigf)%namearray slot(1:slotmax)
#line 27 "regression-bugs-tmp/nestrec.imp"
 SIGF /*name*/*SLOT[10];
                                                                //     28  %record(eqf)%name eventqueue,eclist
#line 28 "regression-bugs-tmp/nestrec.imp"
 EQF /*name*/*EVENTQUEUE;
#line 28 "regression-bugs-tmp/nestrec.imp"
 EQF /*name*/*ECLIST;
                                                                //     29  %record(eqf)%array ecell(1:eqmax)
#line 29 "regression-bugs-tmp/nestrec.imp"
 EQF ECELL[6];
                                                                //     30  %integer now=0
#line 30 "regression-bugs-tmp/nestrec.imp"
int NOW;
#line 30 "regression-bugs-tmp/nestrec.imp"
NOW = 0;
                                                                //     31  
                                                                //     32  %integer heapspace=1
#line 32 "regression-bugs-tmp/nestrec.imp"
int HEAPSPACE;
#line 32 "regression-bugs-tmp/nestrec.imp"
HEAPSPACE = 1;
                                                                //     33  %integerarray heap(1:hmax)
#line 33 "regression-bugs-tmp/nestrec.imp"
int HEAP[4];
                                                                //     34  %record(sigf)%name nets==nil
#line 34 "regression-bugs-tmp/nestrec.imp"
 SIGF /*name*/*NETS;
#line 34 "regression-bugs-tmp/nestrec.imp"
NETS = NIL;
                                                                //     35  %record(compf)%name components==nil
#line 35 "regression-bugs-tmp/nestrec.imp"
 COMPF /*name*/*COMPONENTS;
#line 35 "regression-bugs-tmp/nestrec.imp"
COMPONENTS = NIL;
                                                                //     36  
                                                                //     37  %record (pinf) test
#line 37 "regression-bugs-tmp/nestrec.imp"
 PINF TEST;
                                                                //     38  
                                                                //     39  print string(test_signal_name)
#line 39 "regression-bugs-tmp/nestrec.imp"
_imp_PRINTSTRING(TEST.SIGNAL-> void /* BUG caused by a pooltostr(0) call? */ );
                                                                //     40  
                                                                //     41  %endofprogram
#line 41 "regression-bugs-tmp/nestrec.imp"
/* Remove %on %event handler here if present for this block */
return 0;
} // End of block _imp_main at level 1
#line 41 "regression-bugs-tmp/nestrec.imp"
// End of file
