#include <perms.h>

                                                                //      1  %begin
#line 1 "regression-bugs-tmp/TPK-imp77.imp"
int main(int argc, char **argv) {
  __label__ _imp_endofblock;
  _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)
_imp_current_line = 4; _imp_current_file = "regression-bugs-tmp/TPK-imp77.imp";
#line 4 "regression-bugs-tmp/TPK-imp77.imp"
void TPK( float /*arrayname*/*A, float /*arrayname*/*B )
#line 4 "regression-bugs-tmp/TPK-imp77.imp"
{
  __label__ _imp_endofblock;
                                                                //      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)
_imp_current_line = 8; _imp_current_file = "regression-bugs-tmp/TPK-imp77.imp";
#line 8 "regression-bugs-tmp/TPK-imp77.imp"
float F( float T )
#line 8 "regression-bugs-tmp/TPK-imp77.imp"
{
  __label__ _imp_endofblock;
/*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
_imp_current_line = 9; _imp_current_file = "regression-bugs-tmp/TPK-imp77.imp";
#line 9 "regression-bugs-tmp/TPK-imp77.imp"
return ((_imp_SQRT(_imp_MOD(T))) + ((double)((((5)) * (_imp_REXP(T, 3))))));
                                                                //     10      %end
_imp_current_line = 10; _imp_current_file = "regression-bugs-tmp/TPK-imp77.imp";
#line 10 "regression-bugs-tmp/TPK-imp77.imp"
_imp_endofblock: ;
} // End of block F at level 3
                                                                //     11      %real y
_imp_current_line = 11; _imp_current_file = "regression-bugs-tmp/TPK-imp77.imp";
#line 11 "regression-bugs-tmp/TPK-imp77.imp"
float Y;
                                                                //     12      %integer i
_imp_current_line = 12; _imp_current_file = "regression-bugs-tmp/TPK-imp77.imp";
#line 12 "regression-bugs-tmp/TPK-imp77.imp"
int I;
                                                                //     13      %cycle i = 10, -1, 0
_imp_current_line = 13; _imp_current_file = "regression-bugs-tmp/TPK-imp77.imp";
#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))
_imp_current_line = 14; _imp_current_file = "regression-bugs-tmp/TPK-imp77.imp";
#line 14 "regression-bugs-tmp/TPK-imp77.imp"
Y = F(A[I]);
                                                                //     15        y = 999 %if y > 400
_imp_current_line = 15; _imp_current_file = "regression-bugs-tmp/TPK-imp77.imp";
#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
_imp_current_line = 16; _imp_current_file = "regression-bugs-tmp/TPK-imp77.imp";
#line 16 "regression-bugs-tmp/TPK-imp77.imp"
B[((20) - ((int)((((int)(2)) * (I)))))] = I;
                                                                //     17        b(21-2*i) = y
_imp_current_line = 17; _imp_current_file = "regression-bugs-tmp/TPK-imp77.imp";
#line 17 "regression-bugs-tmp/TPK-imp77.imp"
B[((21) - ((int)((((int)(2)) * (I)))))] = Y;
                                                                //     18      %repeat
_imp_current_line = 18; _imp_current_file = "regression-bugs-tmp/TPK-imp77.imp";
#line 18 "regression-bugs-tmp/TPK-imp77.imp"
goto L_0002;
#line 18 "regression-bugs-tmp/TPK-imp77.imp"
L_0003:;
                                                                //     19    %end; ! TPK
_imp_current_line = 19; _imp_current_file = "regression-bugs-tmp/TPK-imp77.imp";
#line 19 "regression-bugs-tmp/TPK-imp77.imp"
return;
_imp_endofblock: ;
} // End of block TPK at level 2
                                                                //     20  
                                                                //     21    %real %array a(0:10), b(0:21)
_imp_current_line = 21; _imp_current_file = "regression-bugs-tmp/TPK-imp77.imp";
#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)
_imp_current_line = 23; _imp_current_file = "regression-bugs-tmp/TPK-imp77.imp";
#line 23 "regression-bugs-tmp/TPK-imp77.imp"
TPK(&A[-(0)], &B[-(0)]);
                                                                //     24  
                                                                //     25  %endofprogram
_imp_current_line = 25; _imp_current_file = "regression-bugs-tmp/TPK-imp77.imp";
#line 25 "regression-bugs-tmp/TPK-imp77.imp"
return 0;
_imp_endofblock: ;
} // End of block _imp_main at level 1
#line 25 "regression-bugs-tmp/TPK-imp77.imp"
// End of file
