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

extern "C" void inner_loop_005(struct loop_005_data *data) {
    uint8_t *p = data->p; uint8_t *lmt = data->lmt;
    uint32_t res = 0;
    while (p < lmt) {
        uint32_t len = (uint32_t)strlen((const char *)p);
        p += len + 1; res += 1; res ^= (len % 0xffff) << 16;
    }
    data->checksum = res;
}