#include <perms.h>

                                                                //      1  %begin
#line 1 "regression-bugs-tmp/TPK-imp77.imp"
int main(int argc, char **argv) {
  _imp_initialise(argc, argv);
                                                                //      2    !%external %real %fn %spec sqrt %alias "sqrt" (%real n)  {should be in prims. Using Linux/C's external here.}
                                                                //      3    
                                                                //      4    %routine TPK(%real %array %name a, b)
#line 4 "regression-bugs-tmp/TPK-imp77.imp"
void TPK( float /*arrayname*/*A, float /*arrayname*/*B )
#line 4 "regression-bugs-tmp/TPK-imp77.imp"
{
                                                                //      5      ! given 11 input values a(0),...,a(10), this routine
                                                                //      6      ! produces 22 output values b(0),...b(21), according
                                                                //      7      ! to the classical TPK algorithm
                                                                //      8      %real %fn f(%real t)
#line 8 "regression-bugs-tmp/TPK-imp77.imp"
float F( float T )
#line 8 "regression-bugs-tmp/TPK-imp77.imp"
{
/*Warning: potential loss of precision converting from integer AST_ICONST (5 - 4 bytes) to real AST_BINOP (_imp_REXP(T, 3) - 0 bytes) detected at ast.c line 108 */
/*promote*/                                                                //      9        %result = sqrt(|t|) + 5 * t^3
#line 9 "regression-bugs-tmp/TPK-imp77.imp"
/* Remove %on %event handler here if present for this block */
return ((_imp_SQRT(_imp_MOD(T))) + ((double)((((5)) * (_imp_REXP(T, 3))))));
                                                                //     10      %end
#line 10 "regression-bugs-tmp/TPK-imp77.imp"
} // End of block F at level 3
                                                                //     11      %real y
#line 11 "regression-bugs-tmp/TPK-imp77.imp"
float Y;
                                                                //     12      %integer i
#line 12 "regression-bugs-tmp/TPK-imp77.imp"
int I;
                                                                //     13      %cycle i = 10, -1, 0
#line 13 "regression-bugs-tmp/TPK-imp77.imp"
I = 11;
if ((((0)-(10)) % ((-1))) != 0) _imp_signal(5,1,0,"Illegal cycle I = 10, (-1), 0");
L_0002:;
if (I == 0) goto L_0003;
I += (-1);
                                                                //     14        y = f(a(i))
#line 14 "regression-bugs-tmp/TPK-imp77.imp"
Y = F(A[I]);
                                                                //     15        y = 999 %if y > 400
#line 15 "regression-bugs-tmp/TPK-imp77.imp"
if (((Y) <= (400))) goto L_0005;
#line 15 "regression-bugs-tmp/TPK-imp77.imp"
Y = 999;
#line 15 "regression-bugs-tmp/TPK-imp77.imp"
L_0005:;
                                                                //     16        b(20-2*i) = i
#line 16 "regression-bugs-tmp/TPK-imp77.imp"
B[((20) - ((int)((((int)(2)) * (I)))))] = I;
                                                                //     17        b(21-2*i) = y
#line 17 "regression-bugs-tmp/TPK-imp77.imp"
B[((21) - ((int)((((int)(2)) * (I)))))] = Y;
                                                                //     18      %repeat
#line 18 "regression-bugs-tmp/TPK-imp77.imp"
goto L_0002;
#line 18 "regression-bugs-tmp/TPK-imp77.imp"
L_0003:;
                                                                //     19    %end; ! TPK
#line 19 "regression-bugs-tmp/TPK-imp77.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block TPK at level 2
                                                                //     20  
                                                                //     21    %real %array a(0:10), b(0:21)
#line 21 "regression-bugs-tmp/TPK-imp77.imp"
float A[11];
#line 21 "regression-bugs-tmp/TPK-imp77.imp"
float B[22];
                                                                //     22  
                                                                //     23    TPK(a,b)
#line 23 "regression-bugs-tmp/TPK-imp77.imp"
TPK(&A[-(0)], &B[-(0)]);
                                                                //     24  
                                                                //     25  %endofprogram
#line 25 "regression-bugs-tmp/TPK-imp77.imp"
/* Remove %on %event handler here if present for this block */
return 0;
} // End of block _imp_main at level 1
#line 25 "regression-bugs-tmp/TPK-imp77.imp"
// End of file
