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

extern "C" void inner_loop_101(struct loop_101_data *data) {
    uint8_t *a = data->a;
    uint8_t *b = data->b;
    int n = data->n;
    for (int i = 0; i < n - 1; i++) {
        uint16_t s1 = b[i];
        uint16_t s2 = b[i + 1];
        a[2 * i]     = (3 * s1 + s2 + 2) >> 2;
        a[2 * i + 1] = (3 * s2 + s1 + 2) >> 2;
    }
}