#include <perms.h>

                                                                //      1  %begin
#line 1 "regression-bugs-tmp/arraynames.imp"
int main(int argc, char **argv) {
  __label__ _imp_endofblock;
  _imp_initialise(argc, argv);
                                                                //      2    %routine level2 test array(%string(255) who, %integerarrayname harry, %integer from low, to high)
_imp_current_line = 2; _imp_current_file = "regression-bugs-tmp/arraynames.imp";
#line 2 "regression-bugs-tmp/arraynames.imp"
void LEVEL2TESTARRAY( _imp_string /*%string(255)*/ WHO, int /*arrayname*/*HARRY, int FROMLOW, int TOHIGH )
#line 2 "regression-bugs-tmp/arraynames.imp"
{
  __label__ _imp_endofblock;
                                                                //      3      %integer element
_imp_current_line = 3; _imp_current_file = "regression-bugs-tmp/arraynames.imp";
#line 3 "regression-bugs-tmp/arraynames.imp"
int ELEMENT;
                                                                //      4      %for element = from low, 1, to high %cycle
_imp_current_line = 4; _imp_current_file = "regression-bugs-tmp/arraynames.imp";
#line 4 "regression-bugs-tmp/arraynames.imp"
{static int _initial, _increment, _final, _control;
_initial = FROMLOW; _increment = 1; _final = TOHIGH; ELEMENT = _control = _initial;
if (((_final-_initial) % _increment) != 0) _imp_signal(5,1,0,"Illegal cycle ELEMENT = FROMLOW, 1, TOHIGH");
ELEMENT -= _increment; _control -= _increment;
L_0002:;
if (ELEMENT == _final) goto L_0003;
ELEMENT += _increment; _control += _increment;
if (ELEMENT != _control) _imp_signal(4,2,0,"Corrupt control variable ELEMENT"); /* FOR loop control variable corrupted */
}
                                                                //      5        print string("Child of "); print string(who); printsymbol('('); write(element, 0); printstring(") = ");
_imp_current_line = 5; _imp_current_file = "regression-bugs-tmp/arraynames.imp";
#line 5 "regression-bugs-tmp/arraynames.imp"
_imp_PRINTSTRING(_imp_str_literal("Child of "));
_imp_current_line = 5; _imp_current_file = "regression-bugs-tmp/arraynames.imp";
#line 5 "regression-bugs-tmp/arraynames.imp"
_imp_PRINTSTRING(WHO);
_imp_current_line = 5; _imp_current_file = "regression-bugs-tmp/arraynames.imp";
#line 5 "regression-bugs-tmp/arraynames.imp"
_imp_PRINTSYMBOL(40);
_imp_current_line = 5; _imp_current_file = "regression-bugs-tmp/arraynames.imp";
#line 5 "regression-bugs-tmp/arraynames.imp"
_imp_WRITE(ELEMENT, 0);
_imp_current_line = 5; _imp_current_file = "regression-bugs-tmp/arraynames.imp";
#line 5 "regression-bugs-tmp/arraynames.imp"
_imp_PRINTSTRING(_imp_str_literal(") = "));
                                                                //      6        write(harry(element), 0); newline
_imp_current_line = 6; _imp_current_file = "regression-bugs-tmp/arraynames.imp";
#line 6 "regression-bugs-tmp/arraynames.imp"
_imp_WRITE(HARRY[ELEMENT], 0);
_imp_current_line = 6; _imp_current_file = "regression-bugs-tmp/arraynames.imp";
#line 6 "regression-bugs-tmp/arraynames.imp"
_imp_NEWLINE();
                                                                //      7      %repeat
_imp_current_line = 7; _imp_current_file = "regression-bugs-tmp/arraynames.imp";
#line 7 "regression-bugs-tmp/arraynames.imp"
goto L_0002;
#line 7 "regression-bugs-tmp/arraynames.imp"
L_0003:;
                                                                //      8    %end
_imp_current_line = 8; _imp_current_file = "regression-bugs-tmp/arraynames.imp";
#line 8 "regression-bugs-tmp/arraynames.imp"
return;
_imp_endofblock: ;
} // End of block LEVEL2TESTARRAY at level 2
                                                                //      9  
                                                                //     10    %routine test array(%string(255) who, %integerarrayname harry, %integer from low, to high)
_imp_current_line = 10; _imp_current_file = "regression-bugs-tmp/arraynames.imp";
#line 10 "regression-bugs-tmp/arraynames.imp"
void TESTARRAY( _imp_string /*%string(255)*/ WHO, int /*arrayname*/*HARRY, int FROMLOW, int TOHIGH )
#line 10 "regression-bugs-tmp/arraynames.imp"
{
  __label__ _imp_endofblock;
                                                                //     11      %integer element
_imp_current_line = 11; _imp_current_file = "regression-bugs-tmp/arraynames.imp";
#line 11 "regression-bugs-tmp/arraynames.imp"
int ELEMENT;
                                                                //     12      %for element = from low, 1, to high %cycle
_imp_current_line = 12; _imp_current_file = "regression-bugs-tmp/arraynames.imp";
#line 12 "regression-bugs-tmp/arraynames.imp"
{static int _initial, _increment, _final, _control;
_initial = FROMLOW; _increment = 1; _final = TOHIGH; ELEMENT = _control = _initial;
if (((_final-_initial) % _increment) != 0) _imp_signal(5,1,0,"Illegal cycle ELEMENT = FROMLOW, 1, TOHIGH");
ELEMENT -= _increment; _control -= _increment;
L_0005:;
if (ELEMENT == _final) goto L_0006;
ELEMENT += _increment; _control += _increment;
if (ELEMENT != _control) _imp_signal(4,2,0,"Corrupt control variable ELEMENT"); /* FOR loop control variable corrupted */
}
                                                                //     13        print string(who); printsymbol('('); write(element, 0); printstring(") = ");
_imp_current_line = 13; _imp_current_file = "regression-bugs-tmp/arraynames.imp";
#line 13 "regression-bugs-tmp/arraynames.imp"
_imp_PRINTSTRING(WHO);
_imp_current_line = 13; _imp_current_file = "regression-bugs-tmp/arraynames.imp";
#line 13 "regression-bugs-tmp/arraynames.imp"
_imp_PRINTSYMBOL(40);
_imp_current_line = 13; _imp_current_file = "regression-bugs-tmp/arraynames.imp";
#line 13 "regression-bugs-tmp/arraynames.imp"
_imp_WRITE(ELEMENT, 0);
_imp_current_line = 13; _imp_current_file = "regression-bugs-tmp/arraynames.imp";
#line 13 "regression-bugs-tmp/arraynames.imp"
_imp_PRINTSTRING(_imp_str_literal(") = "));
                                                                //     14        write(harry(element), 0); newline
_imp_current_line = 14; _imp_current_file = "regression-bugs-tmp/arraynames.imp";
#line 14 "regression-bugs-tmp/arraynames.imp"
_imp_WRITE(HARRY[ELEMENT], 0);
_imp_current_line = 14; _imp_current_file = "regression-bugs-tmp/arraynames.imp";
#line 14 "regression-bugs-tmp/arraynames.imp"
_imp_NEWLINE();
                                                                //     15      %repeat
_imp_current_line = 15; _imp_current_file = "regression-bugs-tmp/arraynames.imp";
#line 15 "regression-bugs-tmp/arraynames.imp"
goto L_0005;
#line 15 "regression-bugs-tmp/arraynames.imp"
L_0006:;
                                                                //     16      level2 test array(who, harry, from low, to high);
_imp_current_line = 16; _imp_current_file = "regression-bugs-tmp/arraynames.imp";
#line 16 "regression-bugs-tmp/arraynames.imp"
LEVEL2TESTARRAY(WHO, /*is_array_name_param2 BUG? */ &HARRY[0], FROMLOW, TOHIGH);
                                                                //     17    %end
_imp_current_line = 17; _imp_current_file = "regression-bugs-tmp/arraynames.imp";
#line 17 "regression-bugs-tmp/arraynames.imp"
return;
_imp_endofblock: ;
} // End of block TESTARRAY at level 2
                                                                //     18  
                                                                //     19    %ownintegerarray bert(-3:6);  ! note non-0 lower bound static array
_imp_current_line = 19; _imp_current_file = "regression-bugs-tmp/arraynames.imp";
#line 19 "regression-bugs-tmp/arraynames.imp"
static int BERT[10];
                                                                //     20    %integer i
_imp_current_line = 20; _imp_current_file = "regression-bugs-tmp/arraynames.imp";
#line 20 "regression-bugs-tmp/arraynames.imp"
int I;
                                                                //     21  
                                                                //     22    %for i = -3, 1, 6 %cycle
_imp_current_line = 22; _imp_current_file = "regression-bugs-tmp/arraynames.imp";
#line 22 "regression-bugs-tmp/arraynames.imp"
I = (-4);
if ((((6)-((-3))) % (1)) != 0) _imp_signal(5,1,0,"Illegal cycle I = (-3), 1, 6");
L_0008:;
if (I == 6) goto L_0009;
I += 1;
                                                                //     23      bert(i) = i * 10
_imp_current_line = 23; _imp_current_file = "regression-bugs-tmp/arraynames.imp";
#line 23 "regression-bugs-tmp/arraynames.imp"
(BERT+3)[I] = (((int)(I)) * (10));
                                                                //     24    %repeat
_imp_current_line = 24; _imp_current_file = "regression-bugs-tmp/arraynames.imp";
#line 24 "regression-bugs-tmp/arraynames.imp"
goto L_0008;
#line 24 "regression-bugs-tmp/arraynames.imp"
L_0009:;
                                                                //     25  
                                                                //     26    ! i2c passes &bert[0] but should have passed &(bert - (-3))[0]
                                                                //     27    !  or equivalent, to account for the non-0 lower bound!
                                                                //     28    test array("bert", bert, -3, 6);       ! static bounds arrays now fixed, but ...
_imp_current_line = 28; _imp_current_file = "regression-bugs-tmp/arraynames.imp";
#line 28 "regression-bugs-tmp/arraynames.imp"
TESTARRAY(_imp_str_literal("bert"), /*is_array_name4*/ &((BERT+3)[0]), (-3), 6);
                                                                //     29  
                                                                //     30    %ownintegerarrayname pointer
_imp_current_line = 30; _imp_current_file = "regression-bugs-tmp/arraynames.imp";
#line 30 "regression-bugs-tmp/arraynames.imp"
static int /*arrayname*/*POINTER;
                                                                //     31  
                                                                //     32    pointer == bert
_imp_current_line = 32; _imp_current_file = "regression-bugs-tmp/arraynames.imp";
#line 32 "regression-bugs-tmp/arraynames.imp"
POINTER = /*is_array_name6*/ &((BERT+3)[0]);                                                                //     33  
                                                                //     34    test array("pointer to bert", pointer, -3, 6);       ! static bounds arrays now fixed, but ...
_imp_current_line = 34; _imp_current_file = "regression-bugs-tmp/arraynames.imp";
#line 34 "regression-bugs-tmp/arraynames.imp"
TESTARRAY(_imp_str_literal("pointer to bert"), /*is_array_name_param2 BUG? */ &POINTER[0], (-3), 6);
                                                                //     35  
                                                                //     36    %begin
_imp_current_line = 36; _imp_current_file = "regression-bugs-tmp/arraynames.imp";
#line 36 "regression-bugs-tmp/arraynames.imp"
void _BLOCK_1_LEVEL_1_(void) {
  __label__ _imp_endofblock;
                                                                //     37      %integerarray sheila(-3:6);  ! note non-0 lower bound *AUTO* array
_imp_current_line = 37; _imp_current_file = "regression-bugs-tmp/arraynames.imp";
#line 37 "regression-bugs-tmp/arraynames.imp"
int SHEILA[10];
                                                                //     38  
                                                                //     39      %for i = -3, 1, 6 %cycle
_imp_current_line = 39; _imp_current_file = "regression-bugs-tmp/arraynames.imp";
#line 39 "regression-bugs-tmp/arraynames.imp"
I = (-4);
if ((((6)-((-3))) % (1)) != 0) _imp_signal(5,1,0,"Illegal cycle I = (-3), 1, 6");
L_000b:;
if (I == 6) goto L_000c;
I += 1;
                                                                //     40        sheila(i) = i * 10
_imp_current_line = 40; _imp_current_file = "regression-bugs-tmp/arraynames.imp";
#line 40 "regression-bugs-tmp/arraynames.imp"
SHEILA[((I) + ((int)(3)))] = (((int)(I)) * (10));
                                                                //     41      %repeat
_imp_current_line = 41; _imp_current_file = "regression-bugs-tmp/arraynames.imp";
#line 41 "regression-bugs-tmp/arraynames.imp"
goto L_000b;
#line 41 "regression-bugs-tmp/arraynames.imp"
L_000c:;
                                                                //     42  
                                                                //     43      ! i2c passes &bert[0] but should have passed &(bert - (-3))[0]
                                                                //     44      !  or equivalent, to account for the non-0 lower bound!
                                                                //     45      test array("sheila", sheila, -3, 6);   ! ... but dynamic bounds (auto) arrays not yet implemented... 
_imp_current_line = 45; _imp_current_file = "regression-bugs-tmp/arraynames.imp";
#line 45 "regression-bugs-tmp/arraynames.imp"
TESTARRAY(_imp_str_literal("sheila"), &SHEILA[-((-3))], (-3), 6);
                                                                //     46    %end
_imp_current_line = 46; _imp_current_file = "regression-bugs-tmp/arraynames.imp";
#line 46 "regression-bugs-tmp/arraynames.imp"
goto _imp_endofblock;
_imp_endofblock: ;
} // End of block _BLOCK_1_LEVEL_1_ at level 2
_BLOCK_1_LEVEL_1_();
                                                                //     47  
                                                                //     48  %endofprogram
_imp_current_line = 48; _imp_current_file = "regression-bugs-tmp/arraynames.imp";
#line 48 "regression-bugs-tmp/arraynames.imp"
return 0;
_imp_endofblock: ;
} // End of block _imp_main at level 1
#line 48 "regression-bugs-tmp/arraynames.imp"
// End of file
