#include <perms.h>

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