#include <perms.h>

                                                                //      1  %begin
#line 1 "regression-bugs-tmp/derefs.imp"
int main(int argc, char **argv) {
  _imp_initialise(argc, argv);
                                                                //      2  
                                                                //      3    %integerfn use pointer(%integername n)
#line 3 "regression-bugs-tmp/derefs.imp"
int USEPOINTER( int /*name*/*N )
#line 3 "regression-bugs-tmp/derefs.imp"
{
                                                                //      4      %result = n
#line 4 "regression-bugs-tmp/derefs.imp"
/* Remove %on %event handler here if present for this block */
return *N;
                                                                //      5    %end
#line 5 "regression-bugs-tmp/derefs.imp"
} // End of block USEPOINTER at level 2
                                                                //      6    
                                                                //      7    %integerfn use scalar(%integer n)
#line 7 "regression-bugs-tmp/derefs.imp"
int USESCALAR( int N )
#line 7 "regression-bugs-tmp/derefs.imp"
{
                                                                //      8      %result = n
#line 8 "regression-bugs-tmp/derefs.imp"
/* Remove %on %event handler here if present for this block */
return N;
                                                                //      9    %end
#line 9 "regression-bugs-tmp/derefs.imp"
} // End of block USESCALAR at level 2
                                                                //     10    
                                                                //     11    %integermap map scalar(%integer n)
#line 11 "regression-bugs-tmp/derefs.imp"
int /*map*/*MAPSCALAR( int N )
#line 11 "regression-bugs-tmp/derefs.imp"
{
                                                                //     12      %owninteger local
#line 12 "regression-bugs-tmp/derefs.imp"
static int LOCAL;
                                                                //     13      local = n;
#line 13 "regression-bugs-tmp/derefs.imp"
LOCAL = N;
                                                                //     14      %result == local
#line 14 "regression-bugs-tmp/derefs.imp"
/* Remove %on %event handler here if present for this block */
return &LOCAL;
                                                                //     15    %end
#line 15 "regression-bugs-tmp/derefs.imp"
} // End of block MAPSCALAR at level 2
                                                                //     16  
                                                                //     17    %routine increment(%integername var)
#line 17 "regression-bugs-tmp/derefs.imp"
void INCREMENT( int /*name*/*VAR )
#line 17 "regression-bugs-tmp/derefs.imp"
{
                                                                //     18      var = var + 1
#line 18 "regression-bugs-tmp/derefs.imp"
*VAR = ((*(int *)(VAR)) + (1));
                                                                //     19    %end
#line 19 "regression-bugs-tmp/derefs.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block INCREMENT at level 2
                                                                //     20    
                                                                //     21    %integername ptr
#line 21 "regression-bugs-tmp/derefs.imp"
int /*name*/*PTR;
                                                                //     22  
                                                                //     23    %integer i
#line 23 "regression-bugs-tmp/derefs.imp"
int I;
                                                                //     24  
                                                                //     25    i = ptr
#line 25 "regression-bugs-tmp/derefs.imp"
I = *PTR;
                                                                //     26  
                                                                //     27    i = ptr+ptr
#line 27 "regression-bugs-tmp/derefs.imp"
I = ((*(int *)(PTR)) + (*PTR));
                                                                //     28  
                                                                //     29    i = use scalar(ptr)
#line 29 "regression-bugs-tmp/derefs.imp"
I = USESCALAR(*PTR);
                                                                //     30  
                                                                //     31    i = use scalar(ptr+ptr)
#line 31 "regression-bugs-tmp/derefs.imp"
I = USESCALAR(((*(int *)(PTR)) + (*PTR)));
                                                                //     32  
                                                                //     33    i = use scalar(ptr)+use scalar(ptr)
#line 33 "regression-bugs-tmp/derefs.imp"
I = (((int)(USESCALAR(*PTR))) + (USESCALAR(*PTR)));
                                                                //     34  
                                                                //     35    ptr = i
#line 35 "regression-bugs-tmp/derefs.imp"
*PTR = I;
                                                                //     36  
                                                                //     37    ptr = i+ptr
#line 37 "regression-bugs-tmp/derefs.imp"
*PTR = (((int)(I)) + (*PTR));
                                                                //     38  
                                                                //     39    ptr = use scalar(i)
#line 39 "regression-bugs-tmp/derefs.imp"
*PTR = USESCALAR(I);
                                                                //     40  
                                                                //     41    ptr = use scalar(ptr)
#line 41 "regression-bugs-tmp/derefs.imp"
*PTR = USESCALAR(*PTR);
                                                                //     42  
                                                                //     43    ptr = use scalar(ptr+ptr)
#line 43 "regression-bugs-tmp/derefs.imp"
*PTR = USESCALAR(((*(int *)(PTR)) + (*PTR)));
                                                                //     44  
                                                                //     45    ptr = -ptr
#line 45 "regression-bugs-tmp/derefs.imp"
*PTR = (-(*PTR));
                                                                //     46    
                                                                //     47    i = use pointer(ptr)
#line 47 "regression-bugs-tmp/derefs.imp"
I = USEPOINTER(PTR);
                                                                //     48  
                                                                //     49    i = use pointer(ptr)+use pointer(ptr)
#line 49 "regression-bugs-tmp/derefs.imp"
I = (((int)(USEPOINTER(PTR))) + (USEPOINTER(PTR)));
                                                                //     50  
                                                                //     51    ptr = use pointer(i)
#line 51 "regression-bugs-tmp/derefs.imp"
*PTR = USEPOINTER(&I);
                                                                //     52  
                                                                //     53    ptr = use pointer(ptr)
#line 53 "regression-bugs-tmp/derefs.imp"
*PTR = USEPOINTER(PTR);
                                                                //     54  
                                                                //     55    ->done %if ptr < ptr
#line 55 "regression-bugs-tmp/derefs.imp"
if (((*PTR) >= (*PTR))) goto L_0002;
#line 55 "regression-bugs-tmp/derefs.imp"
goto U_1000;
#line 55 "regression-bugs-tmp/derefs.imp"
L_0002:;
                                                                //     56  
                                                                //     57    ->done %if ptr < i
#line 57 "regression-bugs-tmp/derefs.imp"
if (((*PTR) >= (I))) goto L_0003;
#line 57 "regression-bugs-tmp/derefs.imp"
goto U_1000;
#line 57 "regression-bugs-tmp/derefs.imp"
L_0003:;
                                                                //     58  
                                                                //     59    ->done %if ptr < use scalar(i)
#line 59 "regression-bugs-tmp/derefs.imp"
if (((*PTR) >= (USESCALAR(I)))) goto L_0004;
#line 59 "regression-bugs-tmp/derefs.imp"
goto U_1000;
#line 59 "regression-bugs-tmp/derefs.imp"
L_0004:;
                                                                //     60  
                                                                //     61    ->done %if ptr < use scalar(ptr)
#line 61 "regression-bugs-tmp/derefs.imp"
if (((*PTR) >= (USESCALAR(*PTR)))) goto L_0005;
#line 61 "regression-bugs-tmp/derefs.imp"
goto U_1000;
#line 61 "regression-bugs-tmp/derefs.imp"
L_0005:;
                                                                //     62  
                                                                //     63    ->done %if ptr < use pointer(ptr)
#line 63 "regression-bugs-tmp/derefs.imp"
if (((*PTR) >= (USEPOINTER(PTR)))) goto L_0006;
#line 63 "regression-bugs-tmp/derefs.imp"
goto U_1000;
#line 63 "regression-bugs-tmp/derefs.imp"
L_0006:;
                                                                //     64  
                                                                //     65    ->done %if i + ptr < i + use scalar(i)
#line 65 "regression-bugs-tmp/derefs.imp"
if ((((((int)(I)) + (*PTR))) >= ((((int)(I)) + (USESCALAR(I)))))) goto L_0007;
#line 65 "regression-bugs-tmp/derefs.imp"
goto U_1000;
#line 65 "regression-bugs-tmp/derefs.imp"
L_0007:;
                                                                //     66  
                                                                //     67    ->done %if i + ptr < i + use scalar(ptr)
#line 67 "regression-bugs-tmp/derefs.imp"
if ((((((int)(I)) + (*PTR))) >= ((((int)(I)) + (USESCALAR(*PTR)))))) goto L_0008;
#line 67 "regression-bugs-tmp/derefs.imp"
goto U_1000;
#line 67 "regression-bugs-tmp/derefs.imp"
L_0008:;
                                                                //     68  
                                                                //     69    ->done %if i + ptr < i + use pointer(ptr)
#line 69 "regression-bugs-tmp/derefs.imp"
if ((((((int)(I)) + (*PTR))) >= ((((int)(I)) + (USEPOINTER(PTR)))))) goto L_0009;
#line 69 "regression-bugs-tmp/derefs.imp"
goto U_1000;
#line 69 "regression-bugs-tmp/derefs.imp"
L_0009:;
                                                                //     70  
                                                                //     71    ->done %if use scalar(i) < use scalar(i)
#line 71 "regression-bugs-tmp/derefs.imp"
if (((USESCALAR(I)) >= (USESCALAR(I)))) goto L_000a;
#line 71 "regression-bugs-tmp/derefs.imp"
goto U_1000;
#line 71 "regression-bugs-tmp/derefs.imp"
L_000a:;
                                                                //     72  
                                                                //     73    ->done %if use scalar(i) < use pointer(i)
#line 73 "regression-bugs-tmp/derefs.imp"
if (((USESCALAR(I)) >= (USEPOINTER(&I)))) goto L_000b;
#line 73 "regression-bugs-tmp/derefs.imp"
goto U_1000;
#line 73 "regression-bugs-tmp/derefs.imp"
L_000b:;
                                                                //     74  
                                                                //     75    ->done %if use pointer(i) < use pointer(i)
#line 75 "regression-bugs-tmp/derefs.imp"
if (((USEPOINTER(&I)) >= (USEPOINTER(&I)))) goto L_000c;
#line 75 "regression-bugs-tmp/derefs.imp"
goto U_1000;
#line 75 "regression-bugs-tmp/derefs.imp"
L_000c:;
                                                                //     76  
                                                                //     77    ->done %if i + use scalar(i) < use scalar(i)
#line 77 "regression-bugs-tmp/derefs.imp"
if ((((((int)(I)) + (USESCALAR(I)))) >= (USESCALAR(I)))) goto L_000d;
#line 77 "regression-bugs-tmp/derefs.imp"
goto U_1000;
#line 77 "regression-bugs-tmp/derefs.imp"
L_000d:;
                                                                //     78  
                                                                //     79    ->done %if i + use scalar(i) < use pointer(i)
#line 79 "regression-bugs-tmp/derefs.imp"
if ((((((int)(I)) + (USESCALAR(I)))) >= (USEPOINTER(&I)))) goto L_000e;
#line 79 "regression-bugs-tmp/derefs.imp"
goto U_1000;
#line 79 "regression-bugs-tmp/derefs.imp"
L_000e:;
                                                                //     80  
                                                                //     81    ->done %if i + use pointer(i) < use pointer(i)
#line 81 "regression-bugs-tmp/derefs.imp"
if ((((((int)(I)) + (USEPOINTER(&I)))) >= (USEPOINTER(&I)))) goto L_000f;
#line 81 "regression-bugs-tmp/derefs.imp"
goto U_1000;
#line 81 "regression-bugs-tmp/derefs.imp"
L_000f:;
                                                                //     82  
                                                                //     83    ->done %if ptr + use scalar(i) < use scalar(i)
#line 83 "regression-bugs-tmp/derefs.imp"
if (((((*(int *)(PTR)) + (USESCALAR(I)))) >= (USESCALAR(I)))) goto L_0010;
#line 83 "regression-bugs-tmp/derefs.imp"
goto U_1000;
#line 83 "regression-bugs-tmp/derefs.imp"
L_0010:;
                                                                //     84  
                                                                //     85    ->done %if ptr + use scalar(i) < use pointer(i)
#line 85 "regression-bugs-tmp/derefs.imp"
if (((((*(int *)(PTR)) + (USESCALAR(I)))) >= (USEPOINTER(&I)))) goto L_0011;
#line 85 "regression-bugs-tmp/derefs.imp"
goto U_1000;
#line 85 "regression-bugs-tmp/derefs.imp"
L_0011:;
                                                                //     86  
                                                                //     87    ->done %if ptr + use pointer(i) < use pointer(i)
#line 87 "regression-bugs-tmp/derefs.imp"
if (((((*(int *)(PTR)) + (USEPOINTER(&I)))) >= (USEPOINTER(&I)))) goto L_0012;
#line 87 "regression-bugs-tmp/derefs.imp"
goto U_1000;
#line 87 "regression-bugs-tmp/derefs.imp"
L_0012:;
                                                                //     88  
                                                                //     89    ->done %if i + ptr < i + map scalar(i)
#line 89 "regression-bugs-tmp/derefs.imp"
if ((((((int)(I)) + (*PTR))) >= ((((int)(I)) + (*MAPSCALAR(I)))))) goto L_0013;
#line 89 "regression-bugs-tmp/derefs.imp"
goto U_1000;
#line 89 "regression-bugs-tmp/derefs.imp"
L_0013:;
                                                                //     90  
                                                                //     91    ->done %if i + ptr < i + map scalar(ptr)
#line 91 "regression-bugs-tmp/derefs.imp"
if ((((((int)(I)) + (*PTR))) >= ((((int)(I)) + (*MAPSCALAR(*PTR)))))) goto L_0014;
#line 91 "regression-bugs-tmp/derefs.imp"
goto U_1000;
#line 91 "regression-bugs-tmp/derefs.imp"
L_0014:;
                                                                //     92  
                                                                //     93    map scalar(4) = i
#line 93 "regression-bugs-tmp/derefs.imp"
*MAPSCALAR(4) = I;
                                                                //     94  
                                                                //     95    map scalar(i) = i
#line 95 "regression-bugs-tmp/derefs.imp"
*MAPSCALAR(I) = I;
                                                                //     96  
                                                                //     97    map scalar(ptr) = i
#line 97 "regression-bugs-tmp/derefs.imp"
*MAPSCALAR(*PTR) = I;
                                                                //     98  
                                                                //     99    map scalar(i + ptr) = i
#line 99 "regression-bugs-tmp/derefs.imp"
*MAPSCALAR((((int)(I)) + (*PTR))) = I;
                                                                //    100  
                                                                //    101    increment(i)
#line 101 "regression-bugs-tmp/derefs.imp"
INCREMENT(&I);
                                                                //    102  
                                                                //    103    increment(ptr)
#line 103 "regression-bugs-tmp/derefs.imp"
INCREMENT(PTR);
                                                                //    104  
                                                                //    105    increment(map scalar(0))
#line 105 "regression-bugs-tmp/derefs.imp"
INCREMENT(MAPSCALAR(0));
                                                                //    106    
                                                                //    107    increment(map scalar(i))
#line 107 "regression-bugs-tmp/derefs.imp"
INCREMENT(MAPSCALAR(I));
                                                                //    108    
                                                                //    109    increment(map scalar(ptr))
#line 109 "regression-bugs-tmp/derefs.imp"
INCREMENT(MAPSCALAR(*PTR));
                                                                //    110    
                                                                //    111    increment(map scalar(map scalar(0)))
#line 111 "regression-bugs-tmp/derefs.imp"
INCREMENT(MAPSCALAR(*MAPSCALAR(0)));
                                                                //    112    
                                                                //    113  done:
#line 113 "regression-bugs-tmp/derefs.imp"
U_1000:;
                                                                //    114  %endofprogram
#line 114 "regression-bugs-tmp/derefs.imp"
/* Remove %on %event handler here if present for this block */
return 0;
} // End of block _imp_main at level 1
#line 114 "regression-bugs-tmp/derefs.imp"
// End of file
