#include <stdio.h>
#include <stdint.h>
#include <string.h>

static const char ScanKeywords_kw_string[] =
    "abort\0"
    "absolute\0"
    "access\0"
    "action\0"
    "add\0"
    "admin\0"
    "after\0"
    "aggregate\0"
    "all\0"
    "also\0"
    "alter\0"
    "always\0"
    "analyse\0"
    "analyze\0"
    "and\0"
    "any\0"
    "array\0"
    "as\0"
    "asc\0"
    "assertion\0"
    "assignment\0"
    "asymmetric\0"
    "at\0"
    "attach\0"
    "attribute\0"
    "authorization\0"
    "backward\0"
    "before\0"
    "begin\0"
    "between\0"
    "bigint\0"
    "binary\0"
    "bit\0"
    "boolean\0"
    "both\0"
    "by\0"
    "cache\0"
    "call\0"
    "called\0"
    "cascade\0"
    "cascaded\0"
    "case\0"
    "cast\0"
    "catalog\0"
    "chain\0"
    "char\0"
    "character\0"
    "characteristics\0"
    "check\0"
    "checkpoint\0"
    "class\0"
    "close\0"
    "cluster\0"
    "coalesce\0"
    "collate\0"
    "collation\0"
    "column\0"
    "columns\0"
    "comment\0"
    "comments\0"
    "commit\0"
    "committed\0"
    "concurrently\0"
    "configuration\0"
    "conflict\0"
    "connection\0"
    "constraint\0"
    "constraints\0"
    "content\0"
    "continue\0"
    "conversion\0"
    "copy\0"
    "cost\0"
    "create\0"
    "cross\0"
    "csv\0"
    "cube\0"
    "current\0"
    "current_catalog\0"
    "current_date\0"
    "current_role\0"
    "current_schema\0"
    "current_time\0"
    "current_timestamp\0"
    "current_user\0"
    "cursor\0"
    "cycle\0"
    "data\0"
    "database\0"
    "day\0"
    "deallocate\0"
    "dec\0"
    "decimal\0"
    "declare\0"
    "default\0"
    "defaults\0"
    "deferrable\0"
    "deferred\0"
    "definer\0"
    "delete\0"
    "delimiter\0"
    "delimiters\0"
    "depends\0"
    "desc\0"
    "detach\0"
    "dictionary\0"
    "disable\0"
    "discard\0"
    "distinct\0"
    "do\0"
    "document\0"
    "domain\0"
    "double\0"
    "drop\0"
    "each\0"
    "else\0"
    "enable\0"
    "encoding\0"
    "encrypted\0"
    "end\0"
    "enum\0"
    "escape\0"
    "event\0"
    "except\0"
    "exclude\0"
    "excluding\0"
    "exclusive\0"
    "execute\0"
    "exists\0"
    "explain\0"
    "extension\0"
    "external\0"
    "extract\0"
    "false\0"
    "family\0"
    "fetch\0"
    "filter\0"
    "first\0"
    "float\0"
    "following\0"
    "for\0"
    "force\0"
    "foreign\0"
    "forward\0"
    "freeze\0"
    "from\0"
    "full\0"
    "function\0"
    "functions\0"
    "generated\0"
    "global\0"
    "grant\0"
    "granted\0"
    "greatest\0"
    "group\0"
    "grouping\0"
    "groups\0"
    "handler\0"
    "having\0"
    "header\0"
    "hold\0"
    "hour\0"
    "identity\0"
    "if\0"
    "ilike\0"
    "immediate\0"
    "immutable\0"
    "implicit\0"
    "import\0"
    "in\0"
    "include\0"
    "including\0"
    "increment\0"
    "index\0"
    "indexes\0"
    "inherit\0"
    "inherits\0"
    "initially\0"
    "inline\0"
    "inner\0"
    "inout\0"
    "input\0"
    "insensitive\0"
    "insert\0"
    "instead\0"
    "int\0"
    "integer\0"
    "intersect\0"
    "interval\0"
    "into\0"
    "invoker\0"
    "is\0"
    "isnull\0"
    "isolation\0"
    "join\0"
    "key\0"
    "label\0"
    "language\0"
    "large\0"
    "last\0"
    "lateral\0"
    "leading\0"
    "leakproof\0"
    "least\0"
    "left\0"
    "level\0"
    "like\0"
    "limit\0"
    "listen\0"
    "load\0"
    "local\0"
    "localtime\0"
    "localtimestamp\0"
    "location\0"
    "lock\0"
    "locked\0"
    "logged\0"
    "mapping\0"
    "match\0"
    "materialized\0"
    "maxvalue\0"
    "method\0"
    "minute\0"
    "minvalue\0"
    "mode\0"
    "month\0"
    "move\0"
    "name\0"
    "names\0"
    "national\0"
    "natural\0"
    "nchar\0"
    "new\0"
    "next\0"
    "no\0"
    "none\0"
    "not\0"
    "nothing\0"
    "notify\0"
    "notnull\0"
    "nowait\0"
    "null\0"
    "nullif\0"
    "nulls\0"
    "numeric\0"
    "object\0"
    "of\0"
    "off\0"
    "offset\0"
    "oids\0"
    "old\0"
    "on\0"
    "only\0"
    "operator\0"
    "option\0"
    "options\0"
    "or\0"
    "order\0"
    "ordinality\0"
    "others\0"
    "out\0"
    "outer\0"
    "over\0"
    "overlaps\0"
    "overlay\0"
    "overriding\0"
    "owned\0"
    "owner\0"
    "parallel\0"
    "parser\0"
    "partial\0"
    "partition\0"
    "passing\0"
    "password\0"
    "placing\0"
    "plans\0"
    "policy\0"
    "position\0"
    "preceding\0"
    "precision\0"
    "prepare\0"
    "prepared\0"
    "preserve\0"
    "primary\0"
    "prior\0"
    "privileges\0"
    "procedural\0"
    "procedure\0"
    "procedures\0"
    "program\0"
    "publication\0"
    "quote\0"
    "range\0"
    "read\0"
    "real\0"
    "reassign\0"
    "recheck\0"
    "recursive\0"
    "ref\0"
    "references\0"
    "referencing\0"
    "refresh\0"
    "reindex\0"
    "relative\0"
    "release\0"
    "rename\0"
    "repeatable\0"
    "replace\0"
    "replica\0"
    "reset\0"
    "restart\0"
    "restrict\0"
    "returning\0"
    "returns\0"
    "revoke\0"
    "right\0"
    "role\0"
    "rollback\0"
    "rollup\0"
    "routine\0"
    "routines\0"
    "row\0"
    "rows\0"
    "rule\0"
    "savepoint\0"
    "schema\0"
    "schemas\0"
    "scroll\0"
    "search\0"
    "second\0"
    "security\0"
    "select\0"
    "sequence\0"
    "sequences\0"
    "serializable\0"
    "server\0"
    "session\0"
    "session_user\0"
    "set\0"
    "setof\0"
    "sets\0"
    "share\0"
    "show\0"
    "similar\0"
    "simple\0"
    "skip\0"
    "smallint\0"
    "snapshot\0"
    "some\0"
    "sql\0"
    "stable\0"
    "standalone\0"
    "start\0"
    "statement\0"
    "statistics\0"
    "stdin\0"
    "stdout\0"
    "storage\0"
    "strict\0"
    "strip\0"
    "subscription\0"
    "substring\0"
    "support\0"
    "symmetric\0"
    "sysid\0"
    "system\0"
    "table\0"
    "tables\0"
    "tablesample\0"
    "tablespace\0"
    "temp\0"
    "template\0"
    "temporary\0"
    "text\0"
    "then\0"
    "ties\0"
    "time\0"
    "timestamp\0"
    "to\0"
    "trailing\0"
    "transaction\0"
    "transform\0"
    "treat\0"
    "trigger\0"
    "trim\0"
    "true\0"
    "truncate\0"
    "trusted\0"
    "type\0"
    "types\0"
    "unbounded\0"
    "uncommitted\0"
    "unencrypted\0"
    "union\0"
    "unique\0"
    "unknown\0"
    "unlisten\0"
    "unlogged\0"
    "until\0"
    "update\0"
    "user\0"
    "using\0"
    "vacuum\0"
    "valid\0"
    "validate\0"
    "validator\0"
    "value\0"
    "values\0"
    "varchar\0"
    "variadic\0"
    "varying\0"
    "verbose\0"
    "version\0"
    "view\0"
    "views\0"
    "volatile\0"
    "when\0"
    "where\0"
    "whitespace\0"
    "window\0"
    "with\0"
    "within\0"
    "without\0"
    "work\0"
    "wrapper\0"
    "write\0"
    "xml\0"
    "xmlattributes\0"
    "xmlconcat\0"
    "xmlelement\0"
    "xmlexists\0"
    "xmlforest\0"
    "xmlnamespaces\0"
    "xmlparse\0"
    "xmlpi\0"
    "xmlroot\0"
    "xmlserialize\0"
    "xmltable\0"
    "year\0"
    "yes\0"
    "zone";

static const uint16_t ScanKeywords_kw_offsets[] = {
    0,
    6,
    15,
    22,
    29,
    33,
    39,
    45,
    55,
    59,
    64,
    70,
    77,
    85,
    93,
    97,
    101,
    107,
    110,
    114,
    124,
    135,
    146,
    149,
    156,
    166,
    180,
    189,
    196,
    202,
    210,
    217,
    224,
    228,
    236,
    241,
    244,
    250,
    255,
    262,
    270,
    279,
    284,
    289,
    297,
    303,
    308,
    318,
    334,
    340,
    351,
    357,
    363,
    371,
    380,
    388,
    398,
    405,
    413,
    421,
    430,
    437,
    447,
    460,
    474,
    483,
    494,
    505,
    517,
    525,
    534,
    545,
    550,
    555,
    562,
    568,
    572,
    577,
    585,
    601,
    614,
    627,
    642,
    655,
    673,
    686,
    693,
    699,
    704,
    713,
    717,
    728,
    732,
    740,
    748,
    756,
    765,
    776,
    785,
    793,
    800,
    810,
    821,
    829,
    834,
    841,
    852,
    860,
    868,
    877,
    880,
    889,
    896,
    903,
    908,
    913,
    918,
    925,
    934,
    944,
    948,
    953,
    960,
    966,
    973,
    981,
    991,
    1001,
    1009,
    1016,
    1024,
    1034,
    1043,
    1051,
    1057,
    1064,
    1070,
    1077,
    1083,
    1089,
    1099,
    1103,
    1109,
    1117,
    1125,
    1132,
    1137,
    1142,
    1151,
    1161,
    1171,
    1178,
    1184,
    1192,
    1201,
    1207,
    1216,
    1223,
    1231,
    1238,
    1245,
    1250,
    1255,
    1264,
    1267,
    1273,
    1283,
    1293,
    1302,
    1309,
    1312,
    1320,
    1330,
    1340,
    1346,
    1354,
    1362,
    1371,
    1381,
    1388,
    1394,
    1400,
    1406,
    1418,
    1425,
    1433,
    1437,
    1445,
    1455,
    1464,
    1469,
    1477,
    1480,
    1487,
    1497,
    1502,
    1506,
    1512,
    1521,
    1527,
    1532,
    1540,
    1548,
    1558,
    1564,
    1569,
    1575,
    1580,
    1586,
    1593,
    1598,
    1604,
    1614,
    1629,
    1638,
    1643,
    1650,
    1657,
    1665,
    1671,
    1684,
    1693,
    1700,
    1707,
    1716,
    1721,
    1727,
    1732,
    1737,
    1743,
    1752,
    1760,
    1766,
    1770,
    1775,
    1778,
    1783,
    1787,
    1795,
    1802,
    1810,
    1817,
    1822,
    1829,
    1835,
    1843,
    1850,
    1853,
    1857,
    1864,
    1869,
    1873,
    1876,
    1881,
    1890,
    1897,
    1905,
    1908,
    1914,
    1925,
    1932,
    1936,
    1942,
    1947,
    1956,
    1964,
    1975,
    1981,
    1987,
    1996,
    2003,
    2011,
    2021,
    2029,
    2038,
    2046,
    2052,
    2059,
    2068,
    2078,
    2088,
    2096,
    2105,
    2114,
    2122,
    2128,
    2139,
    2150,
    2160,
    2171,
    2179,
    2191,
    2197,
    2203,
    2208,
    2213,
    2222,
    2230,
    2240,
    2244,
    2255,
    2267,
    2275,
    2283,
    2292,
    2300,
    2307,
    2318,
    2326,
    2334,
    2340,
    2348,
    2357,
    2367,
    2375,
    2382,
    2388,
    2393,
    2402,
    2409,
    2417,
    2426,
    2430,
    2435,
    2440,
    2450,
    2457,
    2465,
    2472,
    2479,
    2486,
    2495,
    2502,
    2511,
    2521,
    2534,
    2541,
    2549,
    2562,
    2566,
    2572,
    2577,
    2583,
    2588,
    2596,
    2603,
    2608,
    2617,
    2626,
    2631,
    2635,
    2642,
    2653,
    2659,
    2669,
    2680,
    2686,
    2693,
    2701,
    2708,
    2714,
    2727,
    2737,
    2745,
    2755,
    2761,
    2768,
    2774,
    2781,
    2793,
    2804,
    2809,
    2818,
    2828,
    2833,
    2838,
    2843,
    2848,
    2858,
    2861,
    2870,
    2882,
    2892,
    2898,
    2906,
    2911,
    2916,
    2925,
    2933,
    2938,
    2944,
    2954,
    2966,
    2978,
    2984,
    2991,
    2999,
    3008,
    3017,
    3023,
    3030,
    3035,
    3041,
    3048,
    3054,
    3063,
    3073,
    3079,
    3086,
    3094,
    3103,
    3111,
    3119,
    3127,
    3132,
    3138,
    3147,
    3152,
    3158,
    3169,
    3176,
    3181,
    3188,
    3196,
    3201,
    3209,
    3215,
    3219,
    3233,
    3243,
    3254,
    3264,
    3274,
    3288,
    3297,
    3303,
    3311,
    3324,
    3333,
    3338,
    3342,
};

#define SCANKEYWORDS_NUM_KEYWORDS 441

static int
ScanKeywords_hash_func2(const void *key, size_t keylen)
{
	static const int16_t h[883] = {
		 32767,  32767,    -83,  32767,      0,     18,  32767,   -171,
		     0,   -273,  32767,  32767,   -369,    431,  32767,    229,
		 32767,      0,    -18,  32767,    -77,     81,   -281,  32767,
		     0,    114,    187,    196,  32767,  32767,    327,    535,
		 32767,    127,    621,  32767,    439,   -122,    526,    365,
		    -6,     77,  32767,  32767,    105,    138,  32767,    260,
		  -107,    122,    282,  32767,    232,    149,   -188,    -78,
		     2,      0,      0,    311,  32767,  32767,     52,  32767,
		     0,     32,     60,  32767,    209,    350,  32767,    458,
		     0,    142,  32767,  32767,  32767,   -331,  32767,    145,
		   163,  32767,    410,  32767,  32767,     85,  32767,      0,
		 32767,    699,  32767,  32767,    145,   -724,      0,    215,
		   126,    333,    166,     28,  32767,      0,      0,    687,
		 32767,    201,  32767,    811,      0,      0,  32767,  32767,
		   313,  32767,  32767,  32767,  32767,      0,  32767,   -141,
		   -75,   -140,  32767,  32767,  32767,    311,  32767,      0,
		 32767,  32767,    142,  32767,  32767,  32767,    106,    126,
		    93,     16,      0,  32767,  32767,  32767,     25,    380,
		 32767,      0,  32767,  32767,   -304,   -126,   -190,      0,
		    33,      0,  32767,    213,    262,   -228,  32767,    155,
		  1002,  32767,    676,    293,      0,      0,    132,  32767,
		  -119,    -79,    527,   -200,    314,      0,    104,  32767,
		    17,  32767,      0,    451,     60,     22,    -24,    442,
		 32767,  32767,  32767,  32767,  32767,  32767,      9,    -98,
		     0,     34,   -490,  32767,   -134,  32767,  32767,  32767,
		 32767,    280,    214,    374,    387,    182,  32767,    134,
		  -522,   -205,   -381,  32767,  32767,    413,    283,   -172,
		 32767,      0,    274,    425,   -171,  32767,  32767,      0,
		   128,      0,  32767,    929,    404,      0,  32767,  32767,
		   177,   -440,   -171,  32767,  32767,      0,    -62,    -77,
		   -66,  32767,  32767,   -114,  32767,     23,    194,  32767,
		     0,      6,    168,  32767,    128,  32767,  32767,    119,
		 32767,   -187,    553,      0,      0,     22,     96,  32767,
		  -232,  32767,      0,    190,   -607,  32767,   -234,   -300,
		   408,  32767,  32767,  32767,    378,  32767,  32767,      0,
		   388,    397,    -28,  32767,   -286,  32767,  32767,    355,
		 32767,     41,    365,   -219,   -530,  32767,  32767,  32767,
		 32767,  32767,  32767,      0,  32767,    597,  32767,  32767,
		   735,   -168,  32767,  32767,  32767,  32767,  32767,    -48,
		   658,      0,  32767,  32767,  32767,  32767,    124,    558,
		   394,  32767,     14,  32767,  32767,  32767,  32767,     85,
		   339,  32767,    315,    120,    285,    468,    878,   -358,
		 32767,    178,     83,    117,     89,      0,  32767,   -158,
		 32767,     57,  32767,  32767,    275,    382,    225,    505,
		   515,  32767,     43,    175,  32767,    309,  32767,    304,
		   319,      0,  32767,  32767,   -246,    262,      0,     -7,
		 32767,      0,    517,  32767,      0,    556,    396,  32767,
		 32767,    153,     81,    325,  32767,  32767,     77,      0,
		 32767,    133,    550,  32767,  32767,    551,   -242,  32767,
		 32767,    384,    217,     69,    305,    287,    153,  32767,
		   186,   -139,  32767,    421,  32767,     20,    191,    865,
		    45,   -177,  32767,    919,  32767,      0,  32767,  32767,
		   -34,  32767,    454,      0,  32767,     29,    223,      0,
		    44,    139,    291,      0,    188,     24,  32767,    273,
		   160,  32767,  32767,  32767,    198,    306,     -1,      0,
		     0,    212,    276,     38,    420,    787,   -224,  32767,
		   586,   -655,    288,  32767,  32767,    418,  32767,    342,
		     0,  32767,  32767,    324,    106,     29,    369,    225,
		     0,      0,    -31,  32767,  32767,  32767,   -483,    630,
		 32767,   -381,    110,    197,    -17,  32767,      0,    280,
		   400,    226,    148,     68,  32767,    292,    314,    172,
		   263,     91,      0,    304,  32767,  32767,  32767,     96,
		 32767,  32767,      0,      0,    502,    -16,  32767,     47,
		     0,      0,      0,    174,      0,  32767,  32767,    527,
		   195,      0,      0,  32767,  32767,      0,    322,    239,
		 32767,      0,  32767,  32767,    318,      1,    321,    323,
		   144,     81,   -514,    266,  32767,  32767,    135,  32767,
		   419,     11,  32767,  32767,   -491,   -237,      0,    234,
		 32767,    583,    235,      0,    396,  32767,    212,   -368,
		    30,    100,    532,    358,      0,  32767,  32767,    103,
		    50,    444,   -323,    308,  32767,  32767,    216,      0,
		   246,      0,     -2,    101,    297,     79,  32767,  32767,
		 32767,      0,    -37,  32767,      0,  32767,   -232,    155,
		    32,  32767,      0,    127,    181,  32767,    391,    249,
		  -297,  32767,   -407,    709,      0,     -1,  32767,  32767,
		 32767,  32767,  32767,    351,    338,      0,  32767,  32767,
		   580,  32767,    163,   -511,  32767,  32767,  32767,  32767,
		    21,      0,  32767,    108,  32767,  32767,      0,   -406,
		   773,    405,  32767,  32767,     68,  32767,  32767,    409,
		     0,  32767,  32767,  32767,    207,  32767,  32767,  32767,
		 32767,   -131,    214,      0,   -126,  32767,    852,     62,
		 32767,  32767,  32767,    223,  32767,      0,     -7,      0,
		  -128,      0,   -419,  32767,      0,     69,      0,      0,
		 32767,    193,    117,    434,      0,      0,    228,  32767,
		 32767,   -494,  32767,   -400,      0,   -136,      0,  32767,
		  -168,   -146,  32767,  32767,    640,      0,  32767,      0,
		  -208,    429,  32767,  32767,  32767,    317,      0,      3,
		    80,  32767,   -683,  32767,   -158,    469,  32767,    672,
		 32767,    288,    314,      0,  32767,      0,    105,  32767,
		     0,    176,    106,  32767,    404,    123,   -193,   -429,
		  -148,    -89,  32767,   -319,    405,     86,    253,  32767,
		    35,  32767,  32767,  32767,      0,   -261,  32767,    165,
		 32767,  32767,    373,      0,      0,    516,      0,     77,
		 32767,  32767,      0,    110,   -414,      0,    -80,      0,
		   567,  32767,      0,    180,  32767,      0,  32767,      0,
		    93,   -145,    292,  32767,  32767,    414,  32767,  32767,
		 32767,     32,    257,    118,      0,    413,     42,  32767,
		   710,    170,     19,  32767,  32767,  32767,  32767,    436,
		   317,     58,      0,    816,  32767,     78,    375,      0,
		 32767,  32767,   -144,  32767,   -305,      0,  32767,    184,
		 32767,  32767,  32767,  32767,    728,     74,    401,    468,
		   384,  32767,  32767,    267,    245,    109,   -101,    432,
		 32767,  32767,    289,  32767,   -416,  32767,  32767,      0,
		     0,    220,     72,      0,  32767,    266,  32767,      0,
		  -393,      0,      0,    803,     69,  32767,   -260,    101,
		     0,      0,      0,      0,      0,      0,      0,   -101,
		  -401,      0,      0,      0,     31,    348,     39,  32767,
		 32767,      0,    272,  32767,    582,  32767,  32767,      0,
		   367,  32767,  32767,    224,      0,  32767,    130,  32767,
		 32767,  32767,  32767,    218,   -177,     70,  32767,   -804,
		  -145,     51,  32767,
	};

	const unsigned char *k = (unsigned char *) key;
	uint32_t		a = 0;
	uint32_t		b = 4;

	for (;keylen >= 4; keylen -= 4, k += 4)
	{
		uint32_t c4;
		memcpy(&c4, k, 4);
		c4 |= 0x20202020;

		a = a * 31 ^ c4;
		b = b * 16383 ^ c4;
	}
	uint16_t c2;
	unsigned char c1;
	switch (keylen)
	{
		case 3:
			memcpy(&c2, k, 2);
			c2 |= 0x2020;
			a = a * 31 ^ c2;
			b = b * 16383 ^ c2;
			k+=2;
			memcpy(&c1, k, 1);
			c1 |= 0x20;
			a = a * 31 ^ c1;
			b = b * 16383 ^ c1;
			break;

		case 2:
			memcpy(&c2, k, 2);
			c2 |= 0x2020;
			a = a * 31 ^ c2;
			b = b * 16383 ^ c2;
			break;

		case 1:
			memcpy(&c1, k, 1);
			c1 |= 0x20;
			a = a * 31 ^ c1;
			b = b * 16383 ^ c1;
			break;
	}
	return h[a % 883] + h[b % 883];
}

static int
ScanKeywords_hash_func(const void *key, size_t keylen)
{
	static const int16_t h[883] = {
		 32767,    401,    313,    275,    -78,  32767,  32767,     87,
		   -92,  32767,    357,   -248,    304,    390,  32767,    172,
		  -358,    -97,  32767,   -208,   -207,    126,  32767,    189,
		   358,   -210,    341,  32767,   -123,    152,    127,  32767,
		  -200,  32767,  32767,    340,     95,     90,    105,    260,
		  -111,    177,      0,  32767,      0,    520,   -468,  32767,
		   186,      0,    639,    165,     58,    262,      0,      0,
		    39,    285,  32767,   -313,  32767,      0,   -213,    282,
		   429,  32767,    310,    187,  32767,  32767,    162,   -125,
		   581,    372,    271,     19,    468,      0,  32767,    248,
		    84,    148,  32767,      0,  32767,  32767,  32767,  32767,
		   187,    -44,    321,    138,      6,    -29,      0,   -321,
		 32767,  32767,   -448,    307,     84,      0,  32767,      0,
		   202,    625,    261,     86,  32767,      0,     37,    262,
		   111,     88,      0,    293,  32767,  32767,     16,    195,
		 32767,  32767,      0,  32767,    409,    320,  32767,      0,
		     0,  32767,  32767,    214,  32767,    -61,   -104,  32767,
		   141,  32767,  32767,  32767,   -363,    435,    329,  32767,
		 32767,  32767,  32767,  32767,    379,   -103,    402,    196,
		   389,    244,    284,  32767,     -1,  32767,      0,    -34,
		 32767,      0,  32767,      0,  32767,  32767,  32767,  32767,
		   411,  32767,    452,      0,     27,    379,      0,    191,
		 32767,  32767,  32767,  32767,    234,  32767,   -158,  32767,
		   494,  32767,     75,   -231,    583,      0,    419,     99,
		   223,   -136,   -313,  32767,  32767,  32767,    130,    400,
		   -96,  32767,  32767,  32767,    264,  32767,  32767,  32767,
		   399,  32767,    202,      0,    289,      0,    932,    271,
		   277,   -562,      0,    302,  32767,  32767,  32767,   -195,
		 32767,    -31,  32767,  32767,    177,   -391,    407,  32767,
		   414,    105,  32767,  32767,   -311,    326,    115,    417,
		 32767,      0,     74,  32767,  32767,  32767,  32767,  32767,
		 32767,      0,  32767,    610,  32767,     23,      0,    319,
		   154,   -721,   -222,    132,    258,  32767,     44,    563,
		 32767,      0,    336,   -361,  32767,  32767,     25,      0,
		 32767,      0,  32767,   -196,    110,  32767,      0,    183,
		 32767,    566,      1,     30,  32767,    679,  32767,    333,
		 32767,   -100,      0,  32767,    418,  32767,      0,    375,
		    61,    -61,      0,   -336,    311,  32767,   -101,    282,
		 32767,  32767,    494,   -409,    330,  32767,      0,      0,
		   311,    380,    459,    222,     34,    -61,     67,    268,
		 32767,  32767,    439,  32767,  32767,    311,   -179,    421,
		 32767,  32767,      0,      0,    -47,      0,  32767,  32767,
		   172,  32767,  32767,      0,      0,   -138,    101,    388,
		 32767,    149,  32767,  32767,    384,    327,  32767,    232,
		  -183,  32767,     83,  32767,  32767,     47,      0,    145,
		 32767,  32767,     27,    405,    408,  32767,  32767,  32767,
		   190,   -104,    188,  32767,  32767,    -25,    -17,    108,
		   423,  32767,  32767,  32767,  32767,  32767,    415,      0,
		    45,   -386,     49,    -10,     24,  32767,  32767,  32767,
		   366,  32767,    189,      0,   -254,  32767,   -198,  32767,
		 32767,  32767,  32767,      0,  32767,  32767,    599,  32767,
		     0,     96,    580,    184,  32767,    -84,      0,  32767,
		 32767,    218,   1093,     32,     73,    427,    168,      0,
		 32767,      0,   -409,     27,    316,  32767,  32767,  32767,
		   233,    218,    559,    174,  32767,    -55,      2,   -414,
		     0,    422,  32767,    136,    160,  32767,  32767,     57,
		   109,  32767,  32767,    320,  32767,    241,  32767,   -112,
		   200,  32767,  32767,  32767,  32767,     67,      0,      0,
		   120,    297,  32767,    324,  32767,   -248,  32767,   1078,
		     0,    426,   -308,  32767,  32767,  32767,  32767,  32767,
		    14,  32767,      0,    196,    300,      0,  32767,  32767,
		     0,  32767,      2,  32767,    187,  32767,    101,      0,
		     0,    879,      0,    -11,    425,    507,  32767,  32767,
		   -49,    429,   -492,  32767,     32,    217,     35,  32767,
		     0,    289,    420,    140,    198,  32767,    168,  32767,
		  -129,     87,  32767,  32767,  32767,    308,     80,     29,
		 32767,     60,  32767,  32767,  32767,      0,    -72,    270,
		    50,    -60,  32767,    351,  32767,     60,     44,    -12,
		   116,    293,      0,     54,  32767,  32767,   -265,     11,
		 32767,     81,  32767,      0,  32767,    -87,     34,   -104,
		     0,      0,    117,    239,  32767,  32767,  32767,    286,
		   254,    213,      0,    300,      0,    107,    348,      0,
		 32767,      0,  32767,  32767,   -398,  32767,      0,    -47,
		   271,      0,    210,    355,  32767,    312,    182,    215,
		   364,   -191,    527,  32767,   -414,      0,      6,    134,
		   -86,  32767,  32767,     47,    377,      0,      3,  32767,
		   -25,  32767,    358,      0,      0,      0,      0,   -141,
		 32767,      2,      0,   -241,  32767,      0,     62,  32767,
		 32767,  32767,      0,    599,  32767,  32767,     64,    337,
		     0,     66,    329,      0,      0,     28,    352,    415,
		     0,    774,    296,  32767,     12,  32767,      0,     40,
		 32767,  32767,      0,     26,    231,    114,  32767,  32767,
		 32767,    457,     40,  32767,      0,  32767,   -500,    102,
		 32767,  32767,  32767,    153,  32767,      0,      0,   -159,
		   324,    201,      0,      0,  32767,  32767,      0,     77,
		   243,  32767,  32767,  32767,     -8,  32767,    118,  32767,
		   121,     47,    298,  32767,      0,      0,  32767,  32767,
		   -25,     70,    132,    150,      0,  32767,      0,     94,
		   423,      0,  32767,  32767,    136,  32767,    139,   -302,
		 32767,  32767,      0,  32767,     -5,  32767,    365,     67,
		   347,    191,  32767,    -63,  32767,   -338,     45,     77,
		   290,  32767,    172,     51,  32767,   -113,    154,    513,
		    52,    161,    299,     15,     42,     49,      0,  32767,
		     0,    -10,    541,  32767,  32767,  32767,    519,    818,
		   386,  32767,    320,   -694,  32767,  32767,   -134,  32767,
		     0,      0,    151,      0,    440,  32767,  32767,  32767,
		   187,  32767,    114,      0,    333,      0,      0,    749,
		 32767,      0,  32767,      0,      0,  32767,    194,  32767,
		   316,    315,    157,    447,    307,    434,    225,     61,
		    75,      0,  32767,  32767,    154,  32767,    359,  32767,
		 32767,  32767,  32767,  32767,   -238,   -658,      0,      0,
		   224,    413,  32767,  32767,    373,  32767,  32767,      0,
		 32767,    303,  32767,   -226,      0,  32767,   -211,    130,
		   113,  32767,  32767,  32767,    144,  32767,      0,    306,
		 32767,    377,  32767,    -44,  32767,  32767,  32767,    122,
		 32767,  32767,  32767,    123,  32767,    143,  32767,    493,
		 32767,      0,  32767,  32767,  32767,    155,      0,  32767,
		   313,    352,  32767,  32767,     46,   -245,  32767,      0,
		 32767,  32767,  32767,  32767,  32767,  32767,  32767,  32767,
		  -349,  32767,  32767,    187,      0,    152,      0,  32767,
		 32767,    142,  32767,
	};

	const unsigned char *k = (unsigned char *) key;
	uint32_t		a = 0;
	uint32_t		b = 1;

	while (keylen--)
	{
		unsigned char c = *k++ | 0x20;

		a = a * 31 + c;
		b = b * 127 + c;
	}
	return h[a % 883] + h[b % 883];
}
