/*  ACR33

    TESTING OF THE ACROSS CLAUSE'.
    DISTRIBUTED ARRAY A(N,M,K) IS TO HAVE DIFFERENT
    FLOW-DEP-LENGTH ON BOTH SIDES */

#include <math.h>
#include <stdlib.h>
#include <stdio.h>

#define Min(a, b) (((a) < (b)) ? (a) : (b))

static void acr3301();
static void acr3302();
static void acr3303();
static void acr3304();
static void acr3305();
static void acr3306();
static void acr3307();
static void acr3308();
static void acr3309();

static void ansyes(const char tname[]);
static void ansno(const char tname[]);

static int i, j, ii;

int main(int an, char **as)
{
    printf("===START OF ACR33========================\n");
    /* ---------------------------------------- */
    acr3301();
    /* ---------------------------------------- */
    acr3302();
    /* ---------------------------------------- */
    acr3303();
    /* ---------------------------------------- */
    acr3304();
    /* ---------------------------------------- */
    acr3305();
    /* ---------------------------------------- */
    acr3306();
    /* ---------------------------------------- */
    acr3307();
    /* ---------------------------------------- */
    acr3308();
    /* ---------------------------------------- */
    acr3309();
    /* ---------------------------------------- */

    printf("=== END OF ACR33 =========================\n");
    return 0;
}
/* ---------------------------------------------ACR3301*/
void acr3301()
{
    #define NL 1000
    #define N 16
    #define M 8
    #define K 8
    char tname[] = "ACR3301 ";
    int nloopi, nloopj, nloopii;
    #pragma dvm array distribute[block][block][block]
    int (*A)[M][K];
    A = (int (*)[M][K])malloc(N * sizeof(int[M][K]));
    int (*C)[M][K];
    C = (int (*)[M][K])malloc(N * sizeof(int[M][K]));
    int NNL = NL;

    for (i = 0; i < N; i++)
        for (j = 0; j < M; j++)
            for (ii = 0; ii < K; ii++)
                C[i][j][ii] = NNL + i + j + ii;
    nloopi = NL;
    nloopj = NL;
    nloopii = NL;

    for (i = 1; i < N - 1; i++)
        for (j = 1; j < M - 1; j++)
            for (ii = 1; ii < K - 1; ii++)
                C[i][j][ii] = C[i + 1][j][ii] + C[i][j + 1][ii] + C[i][j][ii + 1] + C[i - 1][j][ii] + C[i][j - 1][ii] +  C[i][j][ii - 1];

    #pragma dvm actual(nloopi, nloopj, C)
    #pragma dvm region inout(C), out(A)
    {
    #pragma dvm parallel([ii][j][i] on A[i][j][ii])
    for (ii = 0; ii < K; ii++)
        for (j = 0; j < M; j++)
            for (i = 0; i < N; i++)
                A[i][j][ii] = NL + i + j + ii;

    #pragma dvm parallel([ii][j][i] on A[i][j][ii]) across(A[1:1][1:1][1:1])
    for (ii = 1; ii < K - 1; ii++)
        for (j = 1; j < M - 1; j++)
            for (i = 1; i < N - 1; i++)
                A[i][j][ii] = A[i + 1][j][ii] + A[i][j + 1][ii] + A[i][j][ii + 1] + A[i - 1][j][ii] + A[i][j - 1][ii] +  A[i][j][ii - 1];
    }
    #pragma dvm get_actual(A)
    #pragma dvm parallel([ii][j][i] on A[i][j][ii]) reduction(min(nloopi), min(nloopj), min(nloopii))
    for (ii = 1; ii < K - 1; ii++)
        for (j = 1; j < M - 1; j++)
            for (i = 1; i < N - 1; i++)
                if (A[i][j][ii] != C[i][j][ii]) {
                    nloopi = Min(nloopi, i);
                    nloopj = Min(nloopj, j);
                    nloopii = Min(nloopii, ii);
                }

    #pragma dvm get_actual(nloopi)
    if (nloopi == NL)
        ansyes(tname);
    else
        ansno(tname);

    free(C);
    free(A);
    #undef NL
    #undef N
    #undef M
    #undef K
}
/* ---------------------------------------------ACR3302*/
void acr3302()
{
    #define NL 1000
    #define N 16
    #define M 10
    #define K 10
    char tname[] = "ACR3302 ";
    int nloopi, nloopj, nloopii;
    #pragma dvm array distribute[block][block][block], shadow[2:2][2:2][2:2]
    int (*A)[M][K];
    A = (int (*)[M][K])malloc(N * sizeof(int[M][K]));
    int (*C)[M][K];
    C = (int (*)[M][K])malloc(N * sizeof(int[M][K]));
    int NNL = NL;

    for (i = 0; i < N; i++)
        for (j = 0; j < M; j++)
            for (ii = 0; ii < K; ii++)
                C[i][j][ii] = NNL + i + j + ii;
    nloopi = NL;
    nloopj = NL;
    nloopii = NL;

    for (i = 2; i < N - 2; i++)
        for (j = 2; j < M - 2; j++)
            for (ii = 2; ii < K - 2; ii++)
                C[i][j][ii] = C[i + 2][j][ii] + C[i][j - 2][ii] + C[i][j][ii - 1] + C[i - 1][j][ii] + C[i + 1][j][ii] + C[i][j - 1][ii] + C[i][j + 2][ii] + C[i][j][ii + 2];

    #pragma dvm actual(nloopi)
    #pragma dvm region in(C)
    {
    #pragma dvm parallel([ii][j][i] on A[i][j][ii])
    for (ii = 0; ii < K; ii++)
        for (j = 0; j < M; j++)
            for (i = 0; i < N; i++)
                A[i][j][ii] = NL + i + j + ii;

    #pragma dvm parallel([ii][j][i] on A[i][j][ii]) across(A[1:2][2:2][1:2])
    for (ii = 2; ii < K - 2; ii++)
        for (j = 2; j < M - 2; j++)
            for (i = 2; i < N - 2; i++)
                A[i][j][ii] = A[i + 2][j][ii] + A[i][j - 2][ii] + A[i][j][ii - 1] + A[i - 1][j][ii] + A[i + 1][j][ii] + A[i][j - 1][ii] + A[i][j + 2][ii] + A[i][j][ii + 2];
    }
    #pragma dvm get_actual(A)
    #pragma dvm parallel([ii][j][i] on A[i][j][ii]) reduction(min(nloopi), min(nloopj), min(nloopii))
    for (ii = 2; ii < K - 2; ii++)
        for (j = 2; j < M - 2; j++)
            for (i = 2; i < N - 2; i++)
                if (A[i][j][ii] != C[i][j][ii]) {
                    nloopi = Min(nloopi, i);
                    nloopj = Min(nloopj, j);
                    nloopii = Min(nloopii, ii);
                }

    #pragma dvm get_actual(nloopi)
    if (nloopi == NL)
        ansyes(tname);
    else
        ansno(tname);

    free(C);
    free(A);
    #undef NL
    #undef N
    #undef M
    #undef K
}
/* ---------------------------------------------ACR3303*/
void acr3303()
{
    #define NL 1000
    #define N 16
    #define M 10
    #define K 10
    char tname[] = "ACR3303 ";
    int nloopi, nloopj, nloopii;
    #pragma dvm array distribute[block][block][block], shadow[2:2][2:2][2:2]
    int (*A)[M][K];
    A = (int (*)[M][K])malloc(N * sizeof(int[M][K]));
    int (*C)[M][K];
    C = (int (*)[M][K])malloc(N * sizeof(int[M][K]));
    int NNL = NL;

    for (i = 0; i < N; i++)
        for (j = 0; j < M; j++)
            for (ii = 0; ii < K; ii++)
                C[i][j][ii] = NNL + i + j + ii;
    nloopi = NL;
    nloopj = NL;
    nloopii = NL;

    for (i = 2; i < N - 2; i++)
        for (j = 2; j < M - 2; j++)
            for (ii = 2; ii < K - 2; ii++)
                C[i][j][ii] = C[i + 2][j][ii] + C[i][j + 2][ii] + C[i][j][ii + 2] + C[i][j - 2][ii] +  C[i][j - 1][ii] + C[i + 1][j][ii] + C[i][j + 1][ii] + C[i][j][ii + 1];

    #pragma dvm actual(nloopi)
    #pragma dvm region in(C)
    {
    #pragma dvm parallel([ii][j][i] on A[i][j][ii])
    for (ii = 0; ii < K; ii++)
        for (j = 0; j < M; j++)
            for (i = 0; i < N; i++)
                A[i][j][ii] = NL + i + j + ii;

    #pragma dvm parallel([ii][j][i] on A[i][j][ii]) across(A[0:2][2:2][0:2])
    for (ii = 2; ii < K - 2; ii++)
        for (j = 2; j < M - 2; j++)
            for (i = 2; i < N - 2; i++)
                A[i][j][ii] = A[i + 2][j][ii] + A[i][j + 2][ii] + A[i][j][ii + 2] + A[i][j - 2][ii] +  A[i][j - 1][ii] + A[i + 1][j][ii] + A[i][j + 1][ii] + A[i][j][ii + 1];
    }
    #pragma dvm get_actual(A)
    #pragma dvm parallel([ii][j][i] on A[i][j][ii]) reduction(min(nloopi), min(nloopj), min(nloopii))
    for (ii = 2; ii < K - 2; ii++)
        for (j = 2; j < M - 2; j++)
            for (i = 2; i < N - 2; i++)
                if (A[i][j][ii] != C[i][j][ii]) {
                    nloopi = Min(nloopi, i);
                    nloopj = Min(nloopj, j);
                    nloopii = Min(nloopii, ii);
                }

    #pragma dvm get_actual(nloopi)
    if (nloopi == NL)
        ansyes(tname);
    else
        ansno(tname);

    free(C);
    free(A);
    #undef NL
    #undef N
    #undef M
    #undef K
}
/* ---------------------------------------------ACR3304*/
void acr3304()
{
    #define NL 1000
    #define N 16
    #define M 10
    #define K 10
    char tname[] = "ACR3304 ";
    int nloopi, nloopj, nloopii;
    #pragma dvm array distribute[block][block][block], shadow[2:2][2:2][2:2]
    int (*A)[M][K];
    A = (int (*)[M][K])malloc(N * sizeof(int[M][K]));
    int (*C)[M][K];
    C = (int (*)[M][K])malloc(N * sizeof(int[M][K]));
    int NNL = NL;

    for (i = 0; i < N; i++)
        for (j = 0; j < M; j++)
            for (ii = 0; ii < K; ii++)
                C[i][j][ii] = NNL + i + j + ii;
    nloopi = NL;
    nloopj = NL;
    nloopii = NL;

    for (i = 2; i < N - 2; i++)
        for (j = 2; j < M - 2; j++)
            for (ii = 2; ii < K - 2; ii++)
                C[i][j][ii] = C[i + 2][j][ii] + C[i][j][ii - 2] + C[i - 2][j][ii] +  C[i][j - 2][ii] + C[i - 1][j][ii] + C[i][j - 1][ii] + C[i][j][ii - 1] + C[i + 1][j][ii];

    #pragma dvm actual(nloopi)
    #pragma dvm region in(C)
    {
    #pragma dvm parallel([ii][j][i] on A[i][j][ii])
    for (ii = 0; ii < K; ii++)
        for (j = 0; j < M; j++)
            for (i = 0; i < N; i++)
                A[i][j][ii] = NL + i + j + ii;

    #pragma dvm parallel([ii][j][i] on A[i][j][ii]) across(A[2:2][2:0][2:0])
    for (ii = 2; ii < K - 2; ii++)
        for (j = 2; j < M - 2; j++)
            for (i = 2; i < N - 2; i++)
                A[i][j][ii] = A[i + 2][j][ii] + A[i][j][ii - 2] + A[i - 2][j][ii] +  A[i][j - 2][ii] + A[i - 1][j][ii] + A[i][j - 1][ii] + A[i][j][ii - 1] + A[i + 1][j][ii];
    }
    #pragma dvm get_actual(A)
    #pragma dvm parallel([ii][j][i] on A[i][j][ii]) reduction(min(nloopi), min(nloopj), min(nloopii))
    for (ii = 2; ii < K - 2; ii++)
        for (j = 2; j < M - 2; j++)
            for (i = 2; i < N - 2; i++)
                if (A[i][j][ii] != C[i][j][ii]) {
                    nloopi = Min(nloopi, i);
                    nloopj = Min(nloopj, j);
                    nloopii = Min(nloopii, ii);
                }

    #pragma dvm get_actual(nloopi)
    if (nloopi == NL)
        ansyes(tname);
    else
        ansno(tname);

    free(C);
    free(A);
    #undef NL
    #undef N
    #undef M
    #undef K
}
/* ---------------------------------------------ACR3305*/
void acr3305()
{
    #define NL 1000
    #define N 16
    #define M 10
    #define K 10
    char tname[] = "ACR3305 ";
    int nloopi, nloopj, nloopii;
    #pragma dvm array distribute[block][block][block], shadow[0:2][2:2][0:2]
    int (*A)[M][K];
    A = (int (*)[M][K])malloc(N * sizeof(int[M][K]));
    int (*C)[M][K];
    C = (int (*)[M][K])malloc(N * sizeof(int[M][K]));
    int NNL = NL;

    for (i = 0; i < N; i++)
        for (j = 0; j < M; j++)
            for (ii = 0; ii < K; ii++)
                C[i][j][ii] = NNL + i + j + ii;
    nloopi = NL;
    nloopj = NL;
    nloopii = NL;

    for (i = 2; i < N - 2; i++)
        for (j = 2; j < M - 2; j++)
            for (ii = 2; ii < K - 2; ii++)
                C[i][j][ii] = C[i + 2][j][ii] + C[i][j + 2][ii] + C[i][j][ii + 2] + C[i][j - 2][ii] + C[i][j - 1][ii] + C[i + 1][j][ii] + C[i][j + 1][ii] + C[i][j][ii + 1];

    #pragma dvm actual(nloopi)
    #pragma dvm region in(C)
    {
    #pragma dvm parallel([ii][j][i] on A[i][j][ii])
    for (ii = 0; ii < K; ii++)
        for (j = 0; j < M; j++)
            for (i = 0; i < N; i++)
                A[i][j][ii] = NL + i + j + ii;

    #pragma dvm parallel([ii][j][i] on A[i][j][ii]) across(A[0:2][2:2][0:2])
    for (ii = 2; ii < K - 2; ii++)
        for (j = 2; j < M - 2; j++)
            for (i = 2; i < N - 2; i++)
                A[i][j][ii] = A[i + 2][j][ii] + A[i][j + 2][ii] + A[i][j][ii + 2] + A[i][j - 2][ii] + A[i][j - 1][ii] + A[i + 1][j][ii] + A[i][j + 1][ii] + A[i][j][ii + 1];
    }
    #pragma dvm get_actual(A)
    #pragma dvm parallel([ii][j][i] on A[i][j][ii]) reduction(min(nloopi), min(nloopj), min(nloopii))
    for (ii = 2; ii < K - 2; ii++)
        for (j = 2; j < M - 2; j++)
            for (i = 2; i < N - 2; i++)
                if (A[i][j][ii] != C[i][j][ii]) {
                    nloopi = Min(nloopi, i);
                    nloopj = Min(nloopj, j);
                    nloopii = Min(nloopii, ii);
                }

    #pragma dvm get_actual(nloopi)
    if (nloopi == NL)
        ansyes(tname);
    else
        ansno(tname);

    free(C);
    free(A);
    #undef NL
    #undef N
    #undef M
    #undef K
}
/* ---------------------------------------------ACR3306*/
void acr3306()
{
    #define NL 1000
    #define N 16
    #define M 16
    #define K 16
    char tname[] = "ACR3306 ";
    int nloopi, nloopj, nloopii;
    #pragma dvm array distribute[block][block][block], shadow[3:3][3:3][3:3]
    int (*A)[M][K];
    A = (int (*)[M][K])malloc(N * sizeof(int[M][K]));
    int (*C)[M][K];
    C = (int (*)[M][K])malloc(N * sizeof(int[M][K]));
    int NNL = NL;

    for (i = 0; i < N; i++)
        for (j = 0; j < M; j++)
            for (ii = 0; ii < K; ii++)
                C[i][j][ii] = NNL + i + j + ii;
    nloopi = NL;
    nloopj = NL;
    nloopii = NL;

    for (i = 3; i < N - 3; i++)
        for (j = 3; j < M - 3; j++)
            for (ii = 3; ii < K - 3; ii++)
                C[i][j][ii] = C[i + 3][j][ii] + C[i][j + 3][ii] + C[i][j][ii + 3] + C[i - 3][j][ii] + C[i][j - 3][ii] + C[i][j][ii - 3] + C[i + 2][j][ii] + C[i][j + 2][ii] + C[i][j][ii + 2] + C[i - 2][j][ii] + C[i][j - 2][ii] + C[i][j][ii - 2] + C[i + 1][j][ii] + C[i][j + 1][ii] + C[i][j][ii + 1] + C[i - 1][j][ii] + C[i][j - 1][ii] + C[i][j][ii - 1];

    #pragma dvm actual(nloopi)
    #pragma dvm region inout(C), out(A)
    {
    #pragma dvm parallel([ii][j][i] on A[i][j][ii])
    for (ii = 0; ii < K; ii++)
        for (j = 0; j < M; j++)
            for (i = 0; i < N; i++)
                A[i][j][ii] = NL + i + j + ii;

    #pragma dvm parallel([ii][j][i] on A[i][j][ii]) across(A[3:3][3:3][3:3])
    for (ii = 3; ii < K - 3; ii++)
        for (j = 3; j < M - 3; j++)
            for (i = 3; i < N - 3; i++)
                A[i][j][ii] = A[i + 3][j][ii] + A[i][j + 3][ii] + A[i][j][ii + 3] + A[i - 3][j][ii] + A[i][j - 3][ii] + A[i][j][ii - 3] + A[i + 2][j][ii] + A[i][j + 2][ii] + A[i][j][ii + 2] + A[i - 2][j][ii] + A[i][j - 2][ii] + A[i][j][ii - 2] + A[i + 1][j][ii] + A[i][j + 1][ii] + A[i][j][ii + 1] + A[i - 1][j][ii] + A[i][j - 1][ii] + A[i][j][ii - 1];
    }
    #pragma dvm get_actual(A)
    #pragma dvm parallel([ii][j][i] on A[i][j][ii]) reduction(min(nloopi), min(nloopj), min(nloopii))
    for (ii = 3; ii < K - 3; ii++)
        for (j = 3; j < M - 3; j++)
            for (i = 3; i < N - 3; i++)
                if (A[i][j][ii] != C[i][j][ii]) {
                    nloopi = Min(nloopi, i);
                    nloopj = Min(nloopj, j);
                    nloopii = Min(nloopii, ii);
                }

    #pragma dvm get_actual(nloopi)
    if (nloopi == NL)
        ansyes(tname);
    else
        ansno(tname);

    free(C);
    free(A);
    #undef NL
    #undef N
    #undef M
    #undef K
}
/* ---------------------------------------------ACR3307*/
void acr3307()
{
    #define NL 1000
    #define N 16
    #define M 16
    #define K 16
    char tname[] = "ACR3307 ";
    int nloopi, nloopj, nloopii;
    #pragma dvm array distribute[block][block][block], shadow[3:3][0:3][3:0]
    int (*A)[M][K];
    A = (int (*)[M][K])malloc(N * sizeof(int[M][K]));
    int (*C)[M][K];
    C = (int (*)[M][K])malloc(N * sizeof(int[M][K]));
    int NNL = NL;

    for (i = 0; i < N; i++)
        for (j = 0; j < M; j++)
            for (ii = 0; ii < K; ii++)
                C[i][j][ii] = NNL + i + j + ii;
    nloopi = NL;
    nloopj = NL;
    nloopii = NL;

    for (i = 3; i < N - 3; i++)
        for (j = 3; j < M - 3; j++)
            for (ii = 3; ii < K - 3; ii++)
                C[i][j][ii] = C[i + 3][j][ii] + C[i][j + 3][ii] + C[i - 3][j][ii] + C[i][j][ii - 3] + C[i + 2][j][ii] + C[i][j + 2][ii] + C[i - 2][j][ii] + C[i][j][ii - 2] + C[i + 1][j][ii] + C[i][j + 1][ii] + C[i + 1][j][ii] + C[i][j + 1][ii] + C[i - 1][j][ii] + C[i][j][ii - 1];

    #pragma dvm actual(nloopi)
    #pragma dvm region inout(C), out(A)
    {
    #pragma dvm parallel([ii][j][i] on A[i][j][ii])
    for (ii = 0; ii < K; ii++)
        for (j = 0; j < M; j++)
            for (i = 0; i < N; i++)
                A[i][j][ii] = NL + i + j + ii;

    #pragma dvm parallel([ii][j][i] on A[i][j][ii]) across(A[3:3][0:3][3:0])
    for (ii = 3; ii < K - 3; ii++)
        for (j = 3; j < M - 3; j++)
            for (i = 3; i < N - 3; i++)
                A[i][j][ii] = A[i + 3][j][ii] + A[i][j + 3][ii] + A[i - 3][j][ii] + A[i][j][ii - 3] + A[i + 2][j][ii] + A[i][j + 2][ii] + A[i - 2][j][ii] + A[i][j][ii - 2] + A[i + 1][j][ii] + A[i][j + 1][ii] + A[i + 1][j][ii] + A[i][j + 1][ii] + A[i - 1][j][ii] + A[i][j][ii - 1];
    }
    #pragma dvm get_actual(A)
    #pragma dvm parallel([ii][j][i] on A[i][j][ii]) reduction(min(nloopi), min(nloopj), min(nloopii))
    for (ii = 3; ii < K - 3; ii++)
        for (j = 3; j < M - 3; j++)
            for (i = 3; i < N - 3; i++)
                if (A[i][j][ii] != C[i][j][ii]) {
                    nloopi = Min(nloopi, i);
                    nloopj = Min(nloopj, j);
                    nloopii = Min(nloopii, ii);
                }

    #pragma dvm get_actual(nloopi)
    if (nloopi == NL)
        ansyes(tname);
    else
        ansno(tname);

    free(C);
    free(A);
    #undef NL
    #undef N
    #undef M
    #undef K
}
/* ---------------------------------------------ACR3308*/
void acr3308()
{
    #define NL 1000
    #define N 16
    #define M 16
    #define K 16
    char tname[] = "ACR3308 ";
    int nloopi, nloopj, nloopii;
    #pragma dvm array distribute[block][block][block], shadow[0:3][0:3][0:3]
    int (*A)[M][K];
    A = (int (*)[M][K])malloc(N * sizeof(int[M][K]));
    int (*C)[M][K];
    C = (int (*)[M][K])malloc(N * sizeof(int[M][K]));
    int NNL = NL;

    for (i = 0; i < N; i++)
        for (j = 0; j < M; j++)
            for (ii = 0; ii < K; ii++)
                C[i][j][ii] = NNL + i + j + ii;
    nloopi = NL;
    nloopj = NL;
    nloopii = NL;

    for (i = 0; i < N - 3; i++)
        for (j = 0; j < M - 3; j++)
            for (ii = 0; ii < K - 3; ii++)
                C[i][j][ii] = C[i + 3][j][ii] + C[i][j + 3][ii] + C[i][j][ii + 3] + C[i + 2][j][ii] + C[i][j + 2][ii] + C[i][j][ii + 2] + C[i + 1][j][ii] + C[i][j + 1][ii] + C[i][j][ii + 1];

    #pragma dvm actual(nloopi)
    #pragma dvm region
    {
    #pragma dvm parallel([ii][j][i] on A[i][j][ii])
    for (ii = 0; ii < K; ii++)
        for (j = 0; j < M; j++)
            for (i = 0; i < N; i++)
                A[i][j][ii] = NL + i + j + ii;

    #pragma dvm parallel([ii][j][i] on A[i][j][ii]) across(A[0:3][0:3][0:3])
    for (ii = 0; ii < K - 3; ii++)
        for (j = 0; j < M - 3; j++)
            for (i = 0; i < N - 3; i++)
                A[i][j][ii] = A[i + 3][j][ii] + A[i][j + 3][ii] + A[i][j][ii + 3] + A[i + 2][j][ii] + A[i][j + 2][ii] + A[i][j][ii + 2] + A[i + 1][j][ii] + A[i][j + 1][ii] + A[i][j][ii + 1];
    }
    #pragma dvm get_actual(A)
    #pragma dvm parallel([ii][j][i] on A[i][j][ii]) reduction(min(nloopi), min(nloopj), min(nloopii))
    for (ii = 0; ii < K - 3; ii++)
        for (j = 0; j < M - 3; j++)
            for (i = 0; i < N - 3; i++)
                if (A[i][j][ii] != C[i][j][ii]) {
                    nloopi = Min(nloopi, i);
                    nloopj = Min(nloopj, j);
                    nloopii = Min(nloopii, ii);
                }

    #pragma dvm get_actual(nloopi)
    if (nloopi == NL)
        ansyes(tname);
    else
        ansno(tname);

    free(C);
    free(A);
    #undef NL
    #undef N
    #undef M
    #undef K
}
/* ---------------------------------------------ACR3309*/
void acr3309()
{
    #define NL 1000
    #define N 59
    #define M 59
    #define K 59
    char tname[] = "ACR3309 ";
    int nloopi, nloopj, nloopii;
    #pragma dvm array distribute[block][block][block], shadow[11:11][11:11][11:11]
    int (*A)[M][K];
    A = (int (*)[M][K])malloc(N * sizeof(int[M][K]));
    int (*C)[M][K];
    C = (int (*)[M][K])malloc(N * sizeof(int[M][K]));
    int NNL = NL;

    for (i = 0; i < N; i++)
        for (j = 0; j < M; j++)
            for (ii = 0; ii < K; ii++)
                C[i][j][ii] = NNL + i + j + ii;
    nloopi = NL;
    nloopj = NL;
    nloopii = NL;

    for (i = 11; i < N - 11; i++)
        for (j = 11; j < M - 11; j++)
            for (ii = 11; ii < K - 11; ii++)
                C[i][j][ii] = C[i + 11][j][ii] + C[i][j + 11][ii] + C[i][j][ii + 11] + C[i - 11][j][ii] + C[i][j - 11][ii] + C[i][j][ii - 11] + C[i + 10][j][ii] + C[i][j + 10][ii] + C[i][j][ii + 10] + C[i - 10][j][ii] + C[i][j - 10][ii] + C[i][j][ii - 10] + C[i - 9][j][ii]  + C[i][j - 9][ii]  + C[i][j][ii - 9] + C[i + 9][j][ii]  + C[i][j + 9][ii]  + C[i][j][ii + 9];

    #pragma dvm actual(nloopi)
    #pragma dvm region
    {
    #pragma dvm parallel([ii][j][i] on A[i][j][ii])
    for (ii = 0; ii < K; ii++)
        for (j = 0; j < M; j++)
            for (i = 0; i < N; i++)
                A[i][j][ii] = NL + i + j + ii;

    #pragma dvm parallel([ii][j][i] on A[i][j][ii]) across(A[11:11][11:11][11:11])
    for (ii = 11; ii < K - 11; ii++)
        for (j = 11; j < M - 11; j++)
            for (i = 11; i < N - 11; i++)
                A[i][j][ii] = A[i + 11][j][ii] + A[i][j + 11][ii] + A[i][j][ii + 11] + A[i - 11][j][ii] + A[i][j - 11][ii] + A[i][j][ii - 11] + A[i + 10][j][ii] + A[i][j + 10][ii] + A[i][j][ii + 10] + A[i - 10][j][ii] + A[i][j - 10][ii] + A[i][j][ii - 10] + A[i - 9][j][ii]  + A[i][j - 9][ii]  + A[i][j][ii - 9] + A[i + 9][j][ii]  + A[i][j + 9][ii]  + A[i][j][ii + 9];
    }
    #pragma dvm get_actual(A)
    #pragma dvm parallel([ii][j][i] on A[i][j][ii]) reduction(min(nloopi), min(nloopj), min(nloopii))
    for (ii = 11; ii < K - 11; ii++)
        for (j = 11; j < M - 11; j++)
            for (i = 11; i < N - 11; i++)
                if (A[i][j][ii] != C[i][j][ii]) {
                    nloopi = Min(nloopi, i);
                    nloopj = Min(nloopj, j);
                    nloopii = Min(nloopii, ii);
                }

    #pragma dvm get_actual(nloopi)
    if (nloopi == NL)
        ansyes(tname);
    else
        ansno(tname);

    free(C);
    free(A);
    #undef NL
    #undef N
    #undef M
    #undef K
}
/* ----------------------------------------------- */
void ansyes(const char name[])
{
    printf("%s  -  complete\n", name);
}

void ansno(const char name[])
{
    printf("%s  -  ***error\n", name);
}
