text: #include <stdio.h>
  #include <stdlib.h>
  #include <sys/time.h>
  #include <math.h>
  
  double A[N][N+13];
  
  void init_arrays()
  {
    int i, j;
    for (i=0; i<N; i++) 
      for (j=0; j<N; j++) 
        A[i][j] = i*i+j*j;
  }
  
  double rtclock()
  {
    struct timezone tzp;
    struct timeval tp;
    int stat;
    gettimeofday (&tp, &tzp);
    return (tp.tv_sec + tp.tv_usec*1.0e-6);
  }
  
  int main()
  {
    init_arrays();
  
    double annot_t_start=0, annot_t_end=0, annot_t_total=0;
    int annot_i;
  
    for (annot_i=0; annot_i<REPS; annot_i++)
    {
      annot_t_start = rtclock();
      
  
  /*@ begin PerfTuning (          
    def build  
    {  
      arg build_command = 'icc -O3 -openmp -I/usr/local/icc/include -lm';  
    }
       
    def performance_counter           
    {  
      arg repetitions = 1;  
    } 
   
    def performance_params  
    { 
  #    param T1_1[] = [1,16,32,64,128]; 
  #    param T1_2[] = [1,16,32,64,128];
  #    param T1_3[] = [1,16,32,64,128];
  #    param T2_1[] = [1,4,8,16,32]; 
  #    param T2_2[] = [1,4,8,16,32]; 
  #    param T2_3[] = [1,4,8,16,32]; 
  
      param T1_1[] = [1]; 
      param T1_2[] = [32]; 
      param T1_3[] = [32]; 
      param T2_1[] = [1]; 
      param T2_2[] = [1]; 
      param T2_3[] = [1]; 
   
      constraint c1 = (T1_1*T2_1<=1024 and T1_1*T2_1<=1024 and T1_1*T2_1<=1024);
  
  #    param U1[] = [1,2,4,8];
  #    param U2[] = [1,2,4,8];
  #    param U3[] = [1,2,4,8];
  
      param U1[] = [10];
      param U2[] = [8];
      param U3[] = [1];
  
      constraint c2 = (U1*U2*U3<=256);
  
      param PERM[] = [
       [0,1,2],
       #[0,2,1],
       #[1,0,2],
       #[1,2,0],
       #[2,0,1],
       #[2,1,0],
      ];
  
      param PAR[] = [True];
      param SCREP[] = [False];
      param IVEC[] = [True];
    } 
   
    def search  
    {
      arg algorithm = 'Exhaustive';  
  #    arg algorithm = 'Simplex';  
  #    arg algorithm = 'Random';  
  #    arg time_limit = 30;
  #    arg total_runs = 1; 
    }  
  
    def input_params  
    { 
      param N[] = [1024];
      param T[] = [1024];
    } 
  
    def input_vars
    {
      decl static double A[N][N+17] = random;
    }
  ) @*/
  
  /**-- (Generated by Orio) 
  Best performance cost: 
    3.043570 
  Tuned for specific problem sizes: 
    N = 1024 
    T = 1024 
  Best performance parameters: 
    IVEC = True 
    PAR = True 
    PERM = [0, 1, 2] 
    SCREP = False 
    T1_1 = 1 
    T1_2 = 32 
    T1_3 = 32 
    T2_1 = 1 
    T2_2 = 1 
    T2_3 = 1 
    U1 = 10 
    U2 = 8 
    U3 = 1 
  --**/
  
    
  
  register int i,j,k,t; 
  register int c1t, c2t, c3t, c4t, c5t, c6t, c7t, c8t, c9t, c10t, c11t, c12t; 
  register int newlb_c1, newlb_c2, newlb_c3, newlb_c4, newlb_c5, newlb_c6, 
    newlb_c7, newlb_c8, newlb_c9, newlb_c10, newlb_c11, newlb_c12; 
  register int newub_c1, newub_c2, newub_c3, newub_c4, newub_c5, newub_c6, 
    newub_c7, newub_c8, newub_c9, newub_c10, newub_c11, newub_c12; 
  
  /*@ begin PolySyn( 
    parallel = PAR;
    tiles = [T1_1,T1_2,T1_3,T2_1,T2_2,T2_3];
    permut = PERM;
    unroll_factors = [U1,U2,U3];
    scalar_replace = SCREP;
    vectorize = IVEC;
  
    profiling_code = 'seidel_profiling.c';
    compile_cmd = 'gcc';
    compile_opts = '-lm';
  ) @*/
  
  #include <math.h>
  #include <assert.h>
  
  #define ceild(n,d)  ceil(((double)(n))/((double)(d)))
  #define floord(n,d) floor(((double)(n))/((double)(d)))
  #define max(x,y)    ((x) > (y)? (x) : (y))
  #define min(x,y)    ((x) < (y)? (x) : (y))
  
  	
  	int c1, c2, c3, c4, c5, c6, c7, c8, c9;
  
  	register int lb, ub, lb1, ub1, lb2, ub2;
  /* Generated from PLuTo-produced CLooG file by CLooG v0.14.1 64 bits in 0.02s. */
  for (c1=0;c1<=floord(33*T+N-35,32);c1++) {
  	lb1=max(ceild(c1-30,33),c1-T+1);
  	ub1=min(floord(c1+N-2,33),c1);
  #pragma omp parallel for shared(c1,lb1,ub1) private(c2,c3,c4,c5,c6,c7,c8,c9)
  	for (c2=lb1; c2<=ub1; c2++) {
  /*@ begin Loop(
  transform Composite(
  permut = [['c3', 'c8', 'c9']],
    regtile = (['c3', 'c8', 'c9'],[10, 8, 1]),
    scalarreplace = (False, 'double'),
    vector = (True, ['ivdep','vector always']))
  
      for (c3=max(ceild(2*c1-2*c2-29,32),ceild(c1+31*c2-30,32));c3<=min(floord(c1+31*c2+N+29,32),floord(c1-c2+N-2,16));c3++) {
        for (c8=max(max(c1-c2+1,32*c2),-c1+c2+32*c3-N+2);c8<=min(min(32*c2+31,-c1+c2+32*c3+30),c1-c2+N-2);c8++) {
          for (c9=max(c1-c2+c8+1,32*c3);c9<=min(32*c3+31,c1-c2+c8+N-2);c9++) {
            A[-c1+c2+c8][-c1+c2-c8+c9]=(A[1+-c1+c2+c8][1+-c1+c2-c8+c9]+A[1+-c1+c2+c8][-c1+c2-c8+c9]+A[1+-c1+c2+c8][-c1+c2-c8+c9-1]+A[-c1+c2+c8][1+-c1+c2-c8+c9]+A[-c1+c2+c8][-c1+c2-c8+c9]+A[-c1+c2+c8][-c1+c2-c8+c9-1]+A[-c1+c2+c8-1][1+-c1+c2-c8+c9]+A[-c1+c2+c8-1][-c1+c2-c8+c9]+A[-c1+c2+c8-1][-c1+c2-c8+c9-1])/9 ;
          }
        }
      }
  
  ) @*/{
    for (c3t=max(ceild(2*c1-2*c2-29,32),ceild(c1+31*c2-30,32)); c3t<=min(floord(c1+31*c2+N+29,32),floord(c1+N-c2-2,16))-9; c3t=c3t+10) {
      newlb_c8=-2147483648;
      newub_c8=2147483647;
      register int cbv_1;
      cbv_1=c3t+9;
  #pragma ivdep
  #pragma vector always
      for (c3=c3t; c3<=cbv_1; c3=c3+1) {
        newlb_c8=max(newlb_c8,max(max(c1-c2+1,32*c2),-c1+c2+32*c3-N+2));
        newub_c8=min(newub_c8,min(min(32*c2+31,-c1+c2+32*c3+30),c1-c2+N-2));
      }
      for (c3=c3t; c3<=c3t+9; c3=c3+1) 
        for (c8=max(max(c1-c2+1,32*c2),-c1+c2+32*c3-N+2); c8<=newlb_c8-1; c8=c8+1) {
          register int cbv_2, cbv_3;
          cbv_2=max(c1-c2+c8+1,32*c3);
          cbv_3=min(32*c3+31,c1-c2+c8+N-2);
  #pragma ivdep
  #pragma vector always
          for (c9=cbv_2; c9<=cbv_3; c9++ ) {
            A[-c1+c2+c8][-c1+c2-c8+c9]=(A[1+-c1+c2+c8][1+-c1+c2-c8+c9]+A[1+-c1+c2+c8][-c1+c2-c8+c9]+A[1+-c1+c2+c8][-c1+c2-c8+c9-1]+A[-c1+c2+c8][1+-c1+c2-c8+c9]+A[-c1+c2+c8][-c1+c2-c8+c9]+A[-c1+c2+c8][-c1+c2-c8+c9-1]+A[-c1+c2+c8-1][1+-c1+c2-c8+c9]+A[-c1+c2+c8-1][-c1+c2-c8+c9]+A[-c1+c2+c8-1][-c1+c2-c8+c9-1])/9;
          }
        }
      for (c8t=newlb_c8; c8t<=newub_c8-7; c8t=c8t+8) {
        for (c3=c3t; c3<=c3t+9; c3=c3+1) 
          for (c8=c8t; c8<=c8t+7; c8=c8+1) {
            register int cbv_4, cbv_5;
            cbv_4=max(c1-c2+c8+1,32*c3);
            cbv_5=min(32*c3+31,c1-c2+c8+N-2);
  #pragma ivdep
  #pragma vector always
            for (c9=cbv_4; c9<=cbv_5; c9++ ) {
              A[-c1+c2+c8][-c1+c2-c8+c9]=(A[1+-c1+c2+c8][1+-c1+c2-c8+c9]+A[1+-c1+c2+c8][-c1+c2-c8+c9]+A[1+-c1+c2+c8][-c1+c2-c8+c9-1]+A[-c1+c2+c8][1+-c1+c2-c8+c9]+A[-c1+c2+c8][-c1+c2-c8+c9]+A[-c1+c2+c8][-c1+c2-c8+c9-1]+A[-c1+c2+c8-1][1+-c1+c2-c8+c9]+A[-c1+c2+c8-1][-c1+c2-c8+c9]+A[-c1+c2+c8-1][-c1+c2-c8+c9-1])/9;
            }
          }
      }
      for (c8=c8t; c8<=newub_c8; c8=c8+1) {
        for (c3=c3t; c3<=c3t+9; c3=c3+1) {
          register int cbv_6, cbv_7;
          cbv_6=max(c1-c2+c8+1,32*c3);
          cbv_7=min(32*c3+31,c1-c2+c8+N-2);
  #pragma ivdep
  #pragma vector always
          for (c9=cbv_6; c9<=cbv_7; c9++ ) {
            A[-c1+c2+c8][-c1+c2-c8+c9]=(A[1+-c1+c2+c8][1+-c1+c2-c8+c9]+A[1+-c1+c2+c8][-c1+c2-c8+c9]+A[1+-c1+c2+c8][-c1+c2-c8+c9-1]+A[-c1+c2+c8][1+-c1+c2-c8+c9]+A[-c1+c2+c8][-c1+c2-c8+c9]+A[-c1+c2+c8][-c1+c2-c8+c9-1]+A[-c1+c2+c8-1][1+-c1+c2-c8+c9]+A[-c1+c2+c8-1][-c1+c2-c8+c9]+A[-c1+c2+c8-1][-c1+c2-c8+c9-1])/9;
          }
        }
      }
      for (c3=c3t; c3<=c3t+9; c3=c3+1) 
        for (c8=newub_c8+1; c8<=min(min(32*c2+31,-c1+c2+32*c3+30),c1-c2+N-2); c8=c8+1) {
          register int cbv_8, cbv_9;
          cbv_8=max(c1-c2+c8+1,32*c3);
          cbv_9=min(32*c3+31,c1-c2+c8+N-2);
  #pragma ivdep
  #pragma vector always
          for (c9=cbv_8; c9<=cbv_9; c9++ ) {
            A[-c1+c2+c8][-c1+c2-c8+c9]=(A[1+-c1+c2+c8][1+-c1+c2-c8+c9]+A[1+-c1+c2+c8][-c1+c2-c8+c9]+A[1+-c1+c2+c8][-c1+c2-c8+c9-1]+A[-c1+c2+c8][1+-c1+c2-c8+c9]+A[-c1+c2+c8][-c1+c2-c8+c9]+A[-c1+c2+c8][-c1+c2-c8+c9-1]+A[-c1+c2+c8-1][1+-c1+c2-c8+c9]+A[-c1+c2+c8-1][-c1+c2-c8+c9]+A[-c1+c2+c8-1][-c1+c2-c8+c9-1])/9;
          }
        }
    }
    for (c3=c3t; c3<=min(floord(c1+31*c2+N+29,32),floord(c1-c2+N-2,16)); c3=c3+1) {
      for (c8t=max(max(c1-c2+1,32*c2),-c1+c2+32*c3-N+2); c8t<=min(min(32*c2+31,-c1+c2+32*c3+30),c1+N-c2-2)-7; c8t=c8t+8) {
        for (c8=c8t; c8<=c8t+7; c8=c8+1) {
          register int cbv_10, cbv_11;
          cbv_10=max(c1-c2+c8+1,32*c3);
          cbv_11=min(32*c3+31,c1-c2+c8+N-2);
  #pragma ivdep
  #pragma vector always
          for (c9=cbv_10; c9<=cbv_11; c9++ ) {
            A[-c1+c2+c8][-c1+c2-c8+c9]=(A[1+-c1+c2+c8][1+-c1+c2-c8+c9]+A[1+-c1+c2+c8][-c1+c2-c8+c9]+A[1+-c1+c2+c8][-c1+c2-c8+c9-1]+A[-c1+c2+c8][1+-c1+c2-c8+c9]+A[-c1+c2+c8][-c1+c2-c8+c9]+A[-c1+c2+c8][-c1+c2-c8+c9-1]+A[-c1+c2+c8-1][1+-c1+c2-c8+c9]+A[-c1+c2+c8-1][-c1+c2-c8+c9]+A[-c1+c2+c8-1][-c1+c2-c8+c9-1])/9;
          }
        }
      }
      for (c8=c8t; c8<=min(min(32*c2+31,-c1+c2+32*c3+30),c1-c2+N-2); c8=c8+1) {
        register int cbv_12, cbv_13;
        cbv_12=max(c1-c2+c8+1,32*c3);
        cbv_13=min(32*c3+31,c1-c2+c8+N-2);
  #pragma ivdep
  #pragma vector always
        for (c9=cbv_12; c9<=cbv_13; c9++ ) {
          A[-c1+c2+c8][-c1+c2-c8+c9]=(A[1+-c1+c2+c8][1+-c1+c2-c8+c9]+A[1+-c1+c2+c8][-c1+c2-c8+c9]+A[1+-c1+c2+c8][-c1+c2-c8+c9-1]+A[-c1+c2+c8][1+-c1+c2-c8+c9]+A[-c1+c2+c8][-c1+c2-c8+c9]+A[-c1+c2+c8][-c1+c2-c8+c9-1]+A[-c1+c2+c8-1][1+-c1+c2-c8+c9]+A[-c1+c2+c8-1][-c1+c2-c8+c9]+A[-c1+c2+c8-1][-c1+c2-c8+c9-1])/9;
        }
      }
    }
  }
  /*@ end @*/
  
    }
  }
  /* End of CLooG code */
  
  /*@ end @*/ 
  /*@ end @*/ 
  
  
  
      annot_t_end = rtclock();
      annot_t_total += annot_t_end - annot_t_start;
    }
    
    annot_t_total = annot_t_total / REPS;
  
  #ifndef TEST
    printf("%f\n", annot_t_total);
  #else
    {
      int i, j;
      for (i=0; i<N; i++) {
        for (j=0; j<N; j++) {
  	if (j%100==0)
  	  printf("\n");
  	printf("%f ",A[i][j]);
        }
        printf("\n");
      }
    }
  #endif
    
    return ((int) A[0][0]); 
  
  }
                                      
  