#include <stdio.h>
#include <inttypes.h>
#include "stdint.h" /* Replace with <stdint.h> if appropriate */
#undef get16bits
#if (defined(__GNUC__) && defined(__i386__)) || defined(__WATCOMC__) \
|| defined(_MSC_VER) || defined (__BORLANDC__) || defined (__TURBOC__)
#define get16bits(d) (*((const uint16_t *) (d)))
#endif
#if !defined (get16bits)
#define get16bits(d) ((((uint32_t)(((const uint8_t *)(d))[1])) << 8)\
+(uint32_t)(((const uint8_t *)(d))[0]) )
#endif
uint32_t SuperFastHash (const char * data, int len) {
uint32_t hash = len, tmp;
int rem;
if (len <= 0 || data == NULL) return 0;
rem = len & 3;
len >>= 2;
/* Main loop */
for (;len > 0; len--) {
hash += get16bits (data);
tmp = (get16bits (data+2) << 11) ^ hash;
hash = (hash << 16) ^ tmp;
data += 2*sizeof (uint16_t);
hash += hash >> 11;
}
/* Handle end cases */
switch (rem) {
case 3: hash += get16bits (data);
hash ^= hash << 16;
hash ^= ((signed char)data[sizeof (uint16_t)]) << 18;
hash += hash >> 11;
break;
case 2: hash += get16bits (data);
hash ^= hash << 11;
hash += hash >> 17;
break;
case 1: hash += (signed char)*data;
hash ^= hash << 10;
hash += hash >> 1;
}
/* Force "avalanching" of final 127 bits */
hash ^= hash << 3;
hash += hash >> 5;
hash ^= hash << 4;
hash += hash >> 17;
hash ^= hash << 25;
hash += hash >> 6;
return hash;
}
int main(void) {
char chunk[] = "VPNFeatureNotification";
uint32_t hash = SuperFastHash(chunk, sizeof(chunk) - 1);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxpbnR0eXBlcy5oPgoKI2luY2x1ZGUgInN0ZGludC5oIiAvKiBSZXBsYWNlIHdpdGggPHN0ZGludC5oPiBpZiBhcHByb3ByaWF0ZSAqLwojdW5kZWYgZ2V0MTZiaXRzCiNpZiAoZGVmaW5lZChfX0dOVUNfXykgJiYgZGVmaW5lZChfX2kzODZfXykpIHx8IGRlZmluZWQoX19XQVRDT01DX18pIFwKICB8fCBkZ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AgIGhhc2ggXj0gKChzaWduZWQgY2hhcilkYXRhW3NpemVvZiAodWludDE2X3QpXSkgPDwgMTg7CiAgICAgICAgICAgICAgICBoYXNoICs9IGhhc2ggPj4gMTE7CiAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICBjYXNlIDI6IGhhc2ggKz0gZ2V0MTZiaXRzIChkYXRhKTsKICAgICAgICAgICAgICAgIGhhc2ggXj0gaGFzaCA8PCAxMTsKICAgICAgICAgICAgICAgIGhhc2ggKz0gaGFzaCA+PiAxNzsKICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgIGNhc2UgMTogaGFzaCArPSAoc2lnbmVkIGNoYXIpKmRhdGE7CiAgICAgICAgICAgICAgICBoYXNoIF49IGhhc2ggPDwgMTA7CiAgICAgICAgICAgICAgICBoYXNoICs9IGhhc2ggPj4gMTsKICAgIH0KCiAgICAvKiBGb3JjZSAiYXZhbGFuY2hpbmciIG9mIGZpbmFsIDEyNyBiaXRzICovCiAgICBoYXNoIF49IGhhc2ggPDwgMzsKICAgIGhhc2ggKz0gaGFzaCA+PiA1OwogICAgaGFzaCBePSBoYXNoIDw8IDQ7CiAgICBoYXNoICs9IGhhc2ggPj4gMTc7CiAgICBoYXNoIF49IGhhc2ggPDwgMjU7CiAgICBoYXNoICs9IGhhc2ggPj4gNjsKCiAgICByZXR1cm4gaGFzaDsKfQoKaW50IG1haW4odm9pZCkgewoJY2hhciBjaHVua1tdID0gIlZQTkZlYXR1cmVOb3RpZmljYXRpb24iOwoJdWludDMyX3QgaGFzaCA9IFN1cGVyRmFzdEhhc2goY2h1bmssIHNpemVvZihjaHVuaykgLSAxKTsKCXByaW50ZigidmFsdWUgPSAlZFxuIiwgaGFzaCk7CglyZXR1cm4gMDsKfQo=