#include <perms.h>

                                                                //      1  %begin
#line 1 "regression-bugs-tmp/readwrite.imp"
int main(int argc, char **argv) {
  _imp_initialise(argc, argv);
                                                                //      2    %constinteger TAB = 9
                                                                //      3    %integer a, b, c
#line 3 "regression-bugs-tmp/readwrite.imp"
int A;
#line 3 "regression-bugs-tmp/readwrite.imp"
int B;
#line 3 "regression-bugs-tmp/readwrite.imp"
int C;
                                                                //      4    ! create a tab-delimited data file:
                                                                //      5    open output(2, "temp.txt")
#line 5 "regression-bugs-tmp/readwrite.imp"
_imp_OPENOUTPUT(2, _imp_str_literal("temp.txt"));
                                                                //      6    select output(2)
#line 6 "regression-bugs-tmp/readwrite.imp"
_imp_SELECTOUTPUT(2);
                                                                //      7    {by the way PRINT CH is missing from the perms}
                                                                //      8    write(123, -1); print symbol(TAB); write (42, -1); print symbol(TAB); write(17, -1); newline
#line 8 "regression-bugs-tmp/readwrite.imp"
_imp_WRITE(123, (-1));
#line 8 "regression-bugs-tmp/readwrite.imp"
_imp_PRINTSYMBOL(9);
#line 8 "regression-bugs-tmp/readwrite.imp"
_imp_WRITE(42, (-1));
#line 8 "regression-bugs-tmp/readwrite.imp"
_imp_PRINTSYMBOL(9);
#line 8 "regression-bugs-tmp/readwrite.imp"
_imp_WRITE(17, (-1));
#line 8 "regression-bugs-tmp/readwrite.imp"
_imp_NEWLINE();
                                                                //      9    close output
#line 9 "regression-bugs-tmp/readwrite.imp"
_imp_CLOSEOUTPUT();
                                                                //     10    select output(0)
#line 10 "regression-bugs-tmp/readwrite.imp"
_imp_SELECTOUTPUT(0);
                                                                //     11    open input(2, "temp.txt")
#line 11 "regression-bugs-tmp/readwrite.imp"
_imp_OPENINPUT(2, _imp_str_literal("temp.txt"));
                                                                //     12    select input(2)
#line 12 "regression-bugs-tmp/readwrite.imp"
_imp_SELECTINPUT(2);
                                                                //     13    read(a)
#line 13 "regression-bugs-tmp/readwrite.imp"
_imp_READ(&A);
                                                                //     14    read(b)
#line 14 "regression-bugs-tmp/readwrite.imp"
_imp_READ(&B);
                                                                //     15    read(c)
#line 15 "regression-bugs-tmp/readwrite.imp"
_imp_READ(&C);
                                                                //     16    print string("Total = "); write(a+b+c, -1); newline
#line 16 "regression-bugs-tmp/readwrite.imp"
_imp_PRINTSTRING(_imp_str_literal("Total = "));
#line 16 "regression-bugs-tmp/readwrite.imp"
_imp_WRITE((((int)((((int)(A)) + (B)))) + (C)), (-1));
#line 16 "regression-bugs-tmp/readwrite.imp"
_imp_NEWLINE();
                                                                //     17  %endofprogram
#line 17 "regression-bugs-tmp/readwrite.imp"
/* Remove %on %event handler here if present for this block */
return 0;
} // End of block _imp_main at level 1
#line 17 "regression-bugs-tmp/readwrite.imp"
// End of file
