#include <perms.h>

                                                                //      1  %begin
#line 1 "regression-bugs-tmp/nestedfns.imp"
int main(int argc, char **argv) {
  __label__ _imp_endofblock;
  _imp_initialise(argc, argv);
                                                                //      2    %routine do something(%integer i)
_imp_current_line = 2; _imp_current_file = "regression-bugs-tmp/nestedfns.imp";
#line 2 "regression-bugs-tmp/nestedfns.imp"
void DOSOMETHING( int I )
#line 2 "regression-bugs-tmp/nestedfns.imp"
{
  __label__ _imp_endofblock;
                                                                //      3       %integerfn succ(%integer i)
_imp_current_line = 3; _imp_current_file = "regression-bugs-tmp/nestedfns.imp";
#line 3 "regression-bugs-tmp/nestedfns.imp"
int SUCC( int I )
#line 3 "regression-bugs-tmp/nestedfns.imp"
{
  __label__ _imp_endofblock;
                                                                //      4         %result = i+1
_imp_current_line = 4; _imp_current_file = "regression-bugs-tmp/nestedfns.imp";
#line 4 "regression-bugs-tmp/nestedfns.imp"
return (((int)(I)) + (1));
                                                                //      5       %end
_imp_current_line = 5; _imp_current_file = "regression-bugs-tmp/nestedfns.imp";
#line 5 "regression-bugs-tmp/nestedfns.imp"
_imp_endofblock: ;
} // End of block SUCC at level 3
                                                                //      6       print string("succ("); write (i,0); print string(") = "); write(succ(i), 0); newline
_imp_current_line = 6; _imp_current_file = "regression-bugs-tmp/nestedfns.imp";
#line 6 "regression-bugs-tmp/nestedfns.imp"
_imp_PRINTSTRING(_imp_str_literal("succ("));
_imp_current_line = 6; _imp_current_file = "regression-bugs-tmp/nestedfns.imp";
#line 6 "regression-bugs-tmp/nestedfns.imp"
_imp_WRITE(I, 0);
_imp_current_line = 6; _imp_current_file = "regression-bugs-tmp/nestedfns.imp";
#line 6 "regression-bugs-tmp/nestedfns.imp"
_imp_PRINTSTRING(_imp_str_literal(") = "));
_imp_current_line = 6; _imp_current_file = "regression-bugs-tmp/nestedfns.imp";
#line 6 "regression-bugs-tmp/nestedfns.imp"
_imp_WRITE(SUCC(I), 0);
_imp_current_line = 6; _imp_current_file = "regression-bugs-tmp/nestedfns.imp";
#line 6 "regression-bugs-tmp/nestedfns.imp"
_imp_NEWLINE();
                                                                //      7    %end
_imp_current_line = 7; _imp_current_file = "regression-bugs-tmp/nestedfns.imp";
#line 7 "regression-bugs-tmp/nestedfns.imp"
return;
_imp_endofblock: ;
} // End of block DOSOMETHING at level 2
                                                                //      8  
                                                                //      9    do something(42)
_imp_current_line = 9; _imp_current_file = "regression-bugs-tmp/nestedfns.imp";
#line 9 "regression-bugs-tmp/nestedfns.imp"
DOSOMETHING(42);
                                                                //     10  
                                                                //     11  %endofprogram
_imp_current_line = 11; _imp_current_file = "regression-bugs-tmp/nestedfns.imp";
#line 11 "regression-bugs-tmp/nestedfns.imp"
return 0;
_imp_endofblock: ;
} // End of block _imp_main at level 1
#line 11 "regression-bugs-tmp/nestedfns.imp"
// End of file
