// File: kernel.cpp
#include "loop_038.h"
#include <stdint.h>

extern "C" void inner_loop_038(struct loop_038_data *data) {
    _Float16 *a = data->a;
    _Float16 *b = data->b;
    _Float16 *c = data->c;
    int dim = data->dim;
    _Float16 k = (_Float16)0.25f;
    for (int row = 0; row < dim - 1; row++) {
        for (int col = 0; col < dim - 1; col++) {
            _Float16 s0 = a[row * dim + col];
            _Float16 s1 = a[row * dim + col + 1];
            _Float16 s2 = a[(row + 1) * dim + col];
            _Float16 s3 = a[(row + 1) * dim + col + 1];
            _Float16 ac = b[row * dim + col];
            c[row * dim + col] = ac + s0 * k + s1 * k + s2 * k + s3 * k;
        }
    }
}