#include <perms.h>

                                                                //      1  
                                                                //      2  !Original grotty faulty version
                                                                //      3  !%systemrealfn stor(%string(255)input)
                                                                //      4  !  !reads a real from the string, assuming string starts with the real
                                                                //      5  !  !(or blank spaces followed by a real)
                                                                //      6  !  %integer sign=0,sym,pos=0
                                                                //      7  !  %real value,exp
                                                                //      8  !  !
                                                                //      9  !  input=input."!";         !check that there is a finish character
                                                                //     10  !  %cycle
                                                                //     11  !    sym = charno(input,pos+1)
                                                                //     12  !    %exit %if sym > ' '
                                                                //     13  !    pos=pos+1
                                                                //     14  !  %repeat
                                                                //     15  !  %if sym = '-' %start
                                                                //     16  !    sign = 1
                                                                //     17  !    pos=pos+1;  sym = charno(input,pos+1)
                                                                //     18  !  %finish
                                                                //     19  !  value = 0
                                                                //     20  !  %if sym # '.' %start
                                                                //     21  !    %signal 6,5,pos %unless '0' <= sym <= '9';  !charno out of range
                                                                //     22  !    %cycle
                                                                //     23  !      value = value*10.0+(sym-'0')
                                                                //     24  !      pos=pos+1;  sym = charno(input,pos+1)
                                                                //     25  !    %repeat %until %not '0' <= sym <= '9'
                                                                //     26  !  %finish
                                                                //     27  !  %if sym = '.' %start
                                                                //     28  !    exp = 10.0
                                                                //     29  !    %cycle
                                                                //     30  !      pos=pos+1;  sym = charno(input,pos+1)
                                                                //     31  !      %exit %unless '0' <= sym <= '9'
                                                                //     32  !      value = value+(sym-'0')/exp
                                                                //     33  !      exp = exp*10.0
                                                                //     34  !    %repeat
                                                                //     35  !  %finish
                                                                //     36  !  %if sym = '@' %start
                                                                //     37  !    pos = pos+1
                                                                //     38  !    sym = charno(input,pos+1); pos = pos+1
                                                                //     39  !    value = value*10.0\(sym-'0')
                                                                //     40  !  %finish
                                                                //     41  !  value = -value %if sign # 0
                                                                //     42  !  %result = value
                                                                //     43  !%end;  !stor
                                                                //     44  
                                                                //     45  !Working version, courtesy of RMM (as if it wasn't obvious
                                                                //     46  !from the grotesque 'aesthetic' source layout)
                                                                //     47  
                                                                //     48  %systemintegerfnspec stoi(%string(255) S)
#line 48 "regression-bugs-tmp/stor.imp"
extern int stoi( _imp_string /*%string(255)*/ S );
                                                                //     49  %system %real %function S To R (%string (255) Input)
#line 49 "regression-bugs-tmp/stor.imp"
extern float stor( _imp_string /*%string(255)*/ INPUT )
#line 49 "regression-bugs-tmp/stor.imp"
{
  __label__ _imp_endofblock;
                                                                //     50    %integer Sign = 0,
_imp_current_line = 50; _imp_current_file = "regression-bugs-tmp/stor.imp";
#line 50 "regression-bugs-tmp/stor.imp"
int SIGN;
#line 50 "regression-bugs-tmp/stor.imp"
SIGN = 0;
#line 50 "regression-bugs-tmp/stor.imp"
int SYM;
#line 50 "regression-bugs-tmp/stor.imp"
int POS;
#line 50 "regression-bugs-tmp/stor.imp"
POS = 1;
                                                                //     51             Sym,
                                                                //     52             Pos = 1
                                                                //     53    %long %real Value,
_imp_current_line = 53; _imp_current_file = "regression-bugs-tmp/stor.imp";
#line 53 "regression-bugs-tmp/stor.imp"
double VALUE;
#line 53 "regression-bugs-tmp/stor.imp"
double EXP;
                                                                //     54                Exp
                                                                //     55  
                                                                //     56     %routine Next
_imp_current_line = 56; _imp_current_file = "regression-bugs-tmp/stor.imp";
#line 56 "regression-bugs-tmp/stor.imp"
void NEXT( void )
#line 56 "regression-bugs-tmp/stor.imp"
{
  __label__ _imp_endofblock;
                                                                //     57        Pos = Pos + 1
_imp_current_line = 57; _imp_current_file = "regression-bugs-tmp/stor.imp";
#line 57 "regression-bugs-tmp/stor.imp"
POS = (((int)(POS)) + (1));
                                                                //     58        %if Pos > Length (Input) %start
_imp_current_line = 58; _imp_current_file = "regression-bugs-tmp/stor.imp";
#line 58 "regression-bugs-tmp/stor.imp"
if (((POS) <= (*_imp_LENGTH(&INPUT)))) goto L_0002;
                                                                //     59           Sym = 0
_imp_current_line = 59; _imp_current_file = "regression-bugs-tmp/stor.imp";
#line 59 "regression-bugs-tmp/stor.imp"
SYM = 0;
                                                                //     60        %else
_imp_current_line = 60; _imp_current_file = "regression-bugs-tmp/stor.imp";
#line 60 "regression-bugs-tmp/stor.imp"
goto L_0003;
#line 60 "regression-bugs-tmp/stor.imp"
L_0002:;
                                                                //     61           Sym = Char No (Input, Pos)
_imp_current_line = 61; _imp_current_file = "regression-bugs-tmp/stor.imp";
#line 61 "regression-bugs-tmp/stor.imp"
SYM = *_imp_CHARNO(&INPUT, POS);
                                                                //     62        %finish
_imp_current_line = 62; _imp_current_file = "regression-bugs-tmp/stor.imp";
#line 62 "regression-bugs-tmp/stor.imp"
L_0003:;
                                                                //     63     %end
_imp_current_line = 63; _imp_current_file = "regression-bugs-tmp/stor.imp";
#line 63 "regression-bugs-tmp/stor.imp"
return;
_imp_endofblock: ;
} // End of block NEXT at level 2
                                                                //     64  
                                                                //     65     Sym = Char No (Input, Pos)
_imp_current_line = 65; _imp_current_file = "regression-bugs-tmp/stor.imp";
#line 65 "regression-bugs-tmp/stor.imp"
SYM = *_imp_CHARNO(&INPUT, POS);
                                                                //     66     %if Sym = '-' %start
_imp_current_line = 66; _imp_current_file = "regression-bugs-tmp/stor.imp";
#line 66 "regression-bugs-tmp/stor.imp"
if (((SYM) != (45))) goto L_0004;
                                                                //     67        Sign = 1
_imp_current_line = 67; _imp_current_file = "regression-bugs-tmp/stor.imp";
#line 67 "regression-bugs-tmp/stor.imp"
SIGN = 1;
                                                                //     68        Next
_imp_current_line = 68; _imp_current_file = "regression-bugs-tmp/stor.imp";
#line 68 "regression-bugs-tmp/stor.imp"
NEXT();
                                                                //     69     %finish
_imp_current_line = 69; _imp_current_file = "regression-bugs-tmp/stor.imp";
#line 69 "regression-bugs-tmp/stor.imp"
L_0004:;
                                                                //     70     Value = 0
_imp_current_line = 70; _imp_current_file = "regression-bugs-tmp/stor.imp";
#line 70 "regression-bugs-tmp/stor.imp"
VALUE = 0;
                                                                //     71     %if Sym # '.' %start
_imp_current_line = 71; _imp_current_file = "regression-bugs-tmp/stor.imp";
#line 71 "regression-bugs-tmp/stor.imp"
if (((SYM) == (46))) goto L_0005;
                                                                //     72        %signal 6, 5, Pos %unless '0' <= Sym <= '9'           {Char No out of range}
_imp_current_line = 72; _imp_current_file = "regression-bugs-tmp/stor.imp";
#line 72 "regression-bugs-tmp/stor.imp"
if ((((48) > (SYM))) || (((SYM) <= (57)))) goto L_0007;
#line 72 "regression-bugs-tmp/stor.imp"
L_0006:;
#line 72 "regression-bugs-tmp/stor.imp"
_imp_signal(6, 5, POS, "");
#line 72 "regression-bugs-tmp/stor.imp"
L_0007:;
                                                                //     73        %cycle
_imp_current_line = 73; _imp_current_file = "regression-bugs-tmp/stor.imp";
#line 73 "regression-bugs-tmp/stor.imp"
L_0008:;
/*Warning: potential loss of precision converting from integer AST_BINOP ((((int)(SYM)) - (48)) - 0 bytes) to real AST_BINOP ((((double)(VALUE)) * (10.0)) - 0 bytes) detected at ast.c line 108 */
                                                                //     74           Value = Value*10.0 + (Sym - '0')
_imp_current_line = 74; _imp_current_file = "regression-bugs-tmp/stor.imp";
#line 74 "regression-bugs-tmp/stor.imp"
VALUE = (((((double)(VALUE)) * (10.0))) + (((((int)(SYM)) - (48)))));
                                                                //     75           Next
_imp_current_line = 75; _imp_current_file = "regression-bugs-tmp/stor.imp";
#line 75 "regression-bugs-tmp/stor.imp"
NEXT();
                                                                //     76        %repeat %until %not '0' <= Sym <= '9'
_imp_current_line = 76; _imp_current_file = "regression-bugs-tmp/stor.imp";
#line 76 "regression-bugs-tmp/stor.imp"
if ((((48) > (SYM))) || (((SYM) > (57)))) goto L_0009;
#line 76 "regression-bugs-tmp/stor.imp"
goto L_0008;
#line 76 "regression-bugs-tmp/stor.imp"
L_0009:;
                                                                //     77     %finish
_imp_current_line = 77; _imp_current_file = "regression-bugs-tmp/stor.imp";
#line 77 "regression-bugs-tmp/stor.imp"
L_0005:;
                                                                //     78     %if Sym = '.' %start
_imp_current_line = 78; _imp_current_file = "regression-bugs-tmp/stor.imp";
#line 78 "regression-bugs-tmp/stor.imp"
if (((SYM) != (46))) goto L_000b;
                                                                //     79        Exp = 10.0
_imp_current_line = 79; _imp_current_file = "regression-bugs-tmp/stor.imp";
#line 79 "regression-bugs-tmp/stor.imp"
EXP = 10.0;
                                                                //     80        %cycle
_imp_current_line = 80; _imp_current_file = "regression-bugs-tmp/stor.imp";
#line 80 "regression-bugs-tmp/stor.imp"
L_000c:;
                                                                //     81           Next
_imp_current_line = 81; _imp_current_file = "regression-bugs-tmp/stor.imp";
#line 81 "regression-bugs-tmp/stor.imp"
NEXT();
                                                                //     82           %exit %unless '0' <= Sym <= '9'
_imp_current_line = 82; _imp_current_file = "regression-bugs-tmp/stor.imp";
#line 82 "regression-bugs-tmp/stor.imp"
if ((((48) > (SYM))) || (((SYM) <= (57)))) goto L_0010;
#line 82 "regression-bugs-tmp/stor.imp"
L_000f:;
#line 82 "regression-bugs-tmp/stor.imp"
goto L_000d;
#line 82 "regression-bugs-tmp/stor.imp"
L_0010:;
                                                                //     83           Value = Value + (Sym - '0')/Exp
_imp_current_line = 83; _imp_current_file = "regression-bugs-tmp/stor.imp";
#line 83 "regression-bugs-tmp/stor.imp"
VALUE = ((VALUE) + (((double)((double)(((((int)(SYM)) - (48)))) / (double)((double)(EXP))))));
                                                                //     84           Exp = Exp * 10.0
_imp_current_line = 84; _imp_current_file = "regression-bugs-tmp/stor.imp";
#line 84 "regression-bugs-tmp/stor.imp"
EXP = (((double)(EXP)) * (10.0));
                                                                //     85        %repeat
_imp_current_line = 85; _imp_current_file = "regression-bugs-tmp/stor.imp";
#line 85 "regression-bugs-tmp/stor.imp"
goto L_000c;
#line 85 "regression-bugs-tmp/stor.imp"
L_000d:;
                                                                //     86     %finish
_imp_current_line = 86; _imp_current_file = "regression-bugs-tmp/stor.imp";
#line 86 "regression-bugs-tmp/stor.imp"
L_000b:;
                                                                //     87     %if Sym = '@' %start
_imp_current_line = 87; _imp_current_file = "regression-bugs-tmp/stor.imp";
#line 87 "regression-bugs-tmp/stor.imp"
if (((SYM) != (64))) goto L_0011;
                                                                //     88        Sym = S To I (Sub String (Input, Pos + 1, Length (Input)))
_imp_current_line = 88; _imp_current_file = "regression-bugs-tmp/stor.imp";
#line 88 "regression-bugs-tmp/stor.imp"
SYM = stoi(_imp_SUBSTRING(INPUT, (((int)(POS)) + (1)), *_imp_LENGTH(&INPUT)));
                                                                //     89        Value = Value * 10.0\Sym
_imp_current_line = 89; _imp_current_file = "regression-bugs-tmp/stor.imp";
#line 89 "regression-bugs-tmp/stor.imp"
VALUE = ((VALUE) * ((double)(_imp_REXP(10.0, SYM))));
                                                                //     90     %finish
_imp_current_line = 90; _imp_current_file = "regression-bugs-tmp/stor.imp";
#line 90 "regression-bugs-tmp/stor.imp"
L_0011:;
                                                                //     91     Value = -Value %if Sign # 0
_imp_current_line = 91; _imp_current_file = "regression-bugs-tmp/stor.imp";
#line 91 "regression-bugs-tmp/stor.imp"
if (((SIGN) == (0))) goto L_0012;
#line 91 "regression-bugs-tmp/stor.imp"
VALUE = (-(VALUE));
#line 91 "regression-bugs-tmp/stor.imp"
L_0012:;
                                                                //     92     %result = Value
_imp_current_line = 92; _imp_current_file = "regression-bugs-tmp/stor.imp";
#line 92 "regression-bugs-tmp/stor.imp"
return VALUE;
                                                                //     93  %end {S To R}
_imp_current_line = 93; _imp_current_file = "regression-bugs-tmp/stor.imp";
#line 93 "regression-bugs-tmp/stor.imp"
_imp_endofblock: ;
} // End of block stor at level 1
                                                                //     94  
                                                                //     95  %systemrealfn ftor(%string(255)s)
#line 95 "regression-bugs-tmp/stor.imp"
extern float ftor( _imp_string /*%string(255)*/ S )
#line 95 "regression-bugs-tmp/stor.imp"
{
  __label__ _imp_endofblock;
                                                                //     96    %result = stor(s)
_imp_current_line = 96; _imp_current_file = "regression-bugs-tmp/stor.imp";
#line 96 "regression-bugs-tmp/stor.imp"
return stor(S);
                                                                //     97  %end
_imp_current_line = 97; _imp_current_file = "regression-bugs-tmp/stor.imp";
#line 97 "regression-bugs-tmp/stor.imp"
_imp_endofblock: ;
} // End of block ftor at level 1
                                                                //     98  
                                                                //     99  %endoffile
#line 99 "regression-bugs-tmp/stor.imp"
// End of file
