static void calc_sums(int pmin, int pmax, uint32_t *data, int n, int pred_order,

                      uint32_t sums[][MAX_PARTITIONS])

{

    int i, j;

    int parts;

    uint32_t *res, *res_end;



    /* sums for highest level */

    parts   = (1 << pmax);

    res     = &data[pred_order];

    res_end = &data[n >> pmax];

    for (i = 0; i < parts; i++) {

        uint32_t sum = 0;

        while (res < res_end)

            sum += *(res++);

        sums[pmax][i] = sum;

        res_end += n >> pmax;

    }

    /* sums for lower levels */

    for (i = pmax - 1; i >= pmin; i--) {

        parts = (1 << i);

        for (j = 0; j < parts; j++)

            sums[i][j] = sums[i+1][2*j] + sums[i+1][2*j+1];

    }

}

static void calc_sums(int pmin, int pmax, uint32_t *data, int n, int pred_order,

                      uint32_t sums[][MAX_PARTITIONS])

{

    int i, j;

    int parts;

    uint32_t *res, *res_end;



    

    parts   = (1 << pmax);

    res     = &data[pred_order];

    res_end = &data[n >> pmax];

    for (i = 0; i < parts; i++) {

        uint32_t sum = 0;

        while (res < res_end)

            sum += *(res++);

        sums[pmax][i] = sum;

        res_end += n >> pmax;

    }

    

    for (i = pmax - 1; i >= pmin; i--) {

        parts = (1 << i);

        for (j = 0; j < parts; j++)

            sums[i][j] = sums[i+1][2*j] + sums[i+1][2*j+1];

    }

}

                      uint32_t sums[][MAX_PARTITIONS])         uint32_t sum = 0;
static void FUNC_0(int VAR_0, int VAR_1, uint32_t *VAR_2, int VAR_3, int VAR_4,

                      uint32_t VAR_5[][MAX_PARTITIONS])

{

    int VAR_6, VAR_7;

    int VAR_8;

    uint32_t *res, *res_end;



    

    VAR_8   = (1 << VAR_1);

    res     = &VAR_2[VAR_4];

    res_end = &VAR_2[VAR_3 >> VAR_1];

    for (VAR_6 = 0; VAR_6 < VAR_8; VAR_6++) {

        uint32_t sum = 0;

        while (res < res_end)

            sum += *(res++);

        VAR_5[VAR_1][VAR_6] = sum;

        res_end += VAR_3 >> VAR_1;

    }

    

    for (VAR_6 = VAR_1 - 1; VAR_6 >= VAR_0; VAR_6--) {

        VAR_8 = (1 << VAR_6);

        for (VAR_7 = 0; VAR_7 < VAR_8; VAR_7++)

            VAR_5[VAR_6][VAR_7] = VAR_5[VAR_6+1][2*VAR_7] + VAR_5[VAR_6+1][2*VAR_7+1];

    }

}

static void FUNC_0(int VAR_0, int VAR_1, uint32_t *VAR_2, int VAR_3, int VAR_4,
uint32_t VAR_5[][MAX_PARTITIONS])
{ int VAR_6, VAR_7; int VAR_8; uint32_t *res, *res_end; VAR_8   = (1 << VAR_1); res     = &VAR_2[VAR_4]; res_end = &VAR_2[VAR_3 >> VAR_1]; for (VAR_6 = 0; VAR_6 < VAR_8; VAR_6++) { uint32_t sum = 0; while (res < res_end)
sum += *(res++); VAR_5[VAR_1][VAR_6] = sum; res_end += VAR_3 >> VAR_1; } for (VAR_6 = VAR_1 - 1; VAR_6 >= VAR_0; VAR_6--) { VAR_8 = (1 << VAR_6); for (VAR_7 = 0; VAR_7 < VAR_8; VAR_7++) VAR_5[VAR_6][VAR_7] = VAR_5[VAR_6+1][2*VAR_7] + VAR_5[VAR_6+1][2*VAR_7+1]; } }