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

extern "C" void inner_loop_006(struct loop_006_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;
}