typedef unsigned char u8;
int mymemcmp(const void *a, const void *b, unsigned int n) {
    const u8 *p = (const u8 *)a;
    const u8 *q = (const u8 *)b;
    while (n--) {
        if (*p != *q) return *p - *q;
        p++; q++;
    }
    return 0;
}
