unsigned Vec_IntUniqueHashKey(unsigned char *pStr, int nChars) {
  static unsigned s_BigPrimes[16] = {
      0x984b6ad9, 0x18a6eed3, 0x950353e2, 0x6222f6eb, 0xdfbedd47, 0xef0f9023,
      0xac932a26, 0x590eaf55, 0x97d0a034, 0xdc36cd2e, 0x22736b37, 0xdc9066b0,
      0x2eb2f98b, 0x5d9c7baf, 0x85747c9e, 0x8aca1055};
  static unsigned s_BigPrimes2[16] = {
      0x8d8a5ebe, 0x1e6a15dc, 0x197d49db, 0x5bab9c89, 0x4b55dea7, 0x55dede49,
      0x9a6a8080, 0xe5e51035, 0xe148d658, 0x8a17eb3b, 0xe22e4b38, 0xe5be2a9a,
      0xbe938cbb, 0x3b981069, 0x7f9c0c8e, 0xf756df10};
  unsigned Key = 0;
  int c;
  for (c = 0; c < nChars; c++)
    Key += s_BigPrimes2[(2 * c) & 15] * s_BigPrimes[(unsigned)pStr[c] & 15] +
           s_BigPrimes2[(2 * c + 1) & 15] * s_BigPrimes[(unsigned)pStr[c] >> 4];
  return Key;
}


x86 assembly (clang, -O0):
<Vec_IntUniqueHashKey>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11a6 <Vec_IntUniqueHashKey+0xa6>
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
and    $0xf,%eax
movslq %eax,%rcx
lea    0x2f38(%rip),%rax
mov    (%rax,%rcx,4),%eax
mov    -0x8(%rbp),%rcx
movslq -0x14(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
and    $0xf,%ecx
mov    %ecx,%ecx
mov    %ecx,%edx
lea    0x2edb(%rip),%rcx
imul   (%rcx,%rdx,4),%eax
mov    -0x14(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
and    $0xf,%ecx
movslq %ecx,%rdx
lea    0x2f01(%rip),%rcx
mov    (%rcx,%rdx,4),%ecx
mov    -0x8(%rbp),%rdx
movslq -0x14(%rbp),%rsi
movzbl (%rdx,%rsi,1),%edx
shr    $0x4,%edx
mov    %edx,%edx
mov    %edx,%esi
lea    0x2ea4(%rip),%rdx
imul   (%rdx,%rsi,4),%ecx
add    %ecx,%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1119 <Vec_IntUniqueHashKey+0x19>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Vec_IntUniqueHashKey>:
test   %esi,%esi
jle    1159 <Vec_IntUniqueHashKey+0x59>
mov    %esi,%r8d
add    %r8,%r8
xor    %r11d,%r11d
lea    0xf2c(%rip),%r9
lea    0xee5(%rip),%r10
xor    %eax,%eax
nopl   (%rax)
mov    %r11d,%edx
and    $0xe,%edx
movzbl (%rdi),%esi
mov    %esi,%ecx
and    $0xf,%ecx
mov    (%r10,%rcx,4),%ecx
imul   (%r9,%rdx,4),%ecx
add    %eax,%ecx
or     $0x1,%edx
shr    $0x4,%rsi
mov    (%r10,%rsi,4),%eax
imul   (%r9,%rdx,4),%eax
add    %ecx,%eax
add    $0x2,%r11
add    $0x1,%rdi
cmp    %r11,%r8
jne    1120 <Vec_IntUniqueHashKey+0x20>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@Vec_IntUniqueHashKey.s_BigPrimes = internal global [16 x i32] [i32 -1739887911, i32 413593299, i32 -1794944030, i32 1646458603, i32 -541139641, i32 -284192733, i32 -1399641562, i32 1494134613, i32 -1747935180, i32 -600388306, i32 577989431, i32 -594516304, i32 783481227, i32 1570536367, i32 -2055963490, i32 -1966469035]
@Vec_IntUniqueHashKey.s_BigPrimes2 = internal global [16 x i32] [i32 -1920311618, i32 510268892, i32 427641307, i32 1537973385, i32 1263918759, i32 1440669257, i32 -1704296320, i32 -437972939, i32 -515320232, i32 -1978143941, i32 -500282568, i32 -440522086, i32 -1097626437, i32 999821417, i32 2140933262, i32 -145301744]
define i32 @Vec_IntUniqueHashKey(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
br label %7
7: ; preds = %50, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %53
11: ; preds = %7
%12 = load i32, i32* %6
%13 = mul nsw i32 2, %12
%14 = and i32 %13, 15
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [16 x i32], [16 x i32]* @Vec_IntUniqueHashKey.s_BigPrimes2, i64 0, i64 %15
%17 = load i32, i32* %16
%18 = load i8*, i8** %3
%19 = load i32, i32* %6
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %18, i64 %20
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = and i32 %23, 15
%25 = zext i32 %24 to i64
%26 = getelementptr inbounds [16 x i32], [16 x i32]* @Vec_IntUniqueHashKey.s_BigPrimes, i64 0, i64 %25
%27 = load i32, i32* %26
%28 = mul i32 %17, %27
%29 = load i32, i32* %6
%30 = mul nsw i32 2, %29
%31 = add nsw i32 %30, 1
%32 = and i32 %31, 15
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [16 x i32], [16 x i32]* @Vec_IntUniqueHashKey.s_BigPrimes2, i64 0, i64 %33
%35 = load i32, i32* %34
%36 = load i8*, i8** %3
%37 = load i32, i32* %6
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds i8, i8* %36, i64 %38
%40 = load i8, i8* %39
%41 = zext i8 %40 to i32
%42 = lshr i32 %41, 4
%43 = zext i32 %42 to i64
%44 = getelementptr inbounds [16 x i32], [16 x i32]* @Vec_IntUniqueHashKey.s_BigPrimes, i64 0, i64 %43
%45 = load i32, i32* %44
%46 = mul i32 %35, %45
%47 = add i32 %28, %46
%48 = load i32, i32* %5
%49 = add i32 %48, %47
store i32 %49, i32* %5
br label %50
50: ; preds = %11
%51 = load i32, i32* %6
%52 = add nsw i32 %51, 1
store i32 %52, i32* %6
br label %7
53: ; preds = %7
%54 = load i32, i32* %5
ret i32 %54
}

LLVM IR (-O2):
@Vec_IntUniqueHashKey.s_BigPrimes = internal unnamed_addr constant [16 x i32] [i32 -1739887911, i32 413593299, i32 -1794944030, i32 1646458603, i32 -541139641, i32 -284192733, i32 -1399641562, i32 1494134613, i32 -1747935180, i32 -600388306, i32 577989431, i32 -594516304, i32 783481227, i32 1570536367, i32 -2055963490, i32 -1966469035]
@Vec_IntUniqueHashKey.s_BigPrimes2 = internal unnamed_addr constant [16 x i32] [i32 -1920311618, i32 510268892, i32 427641307, i32 1537973385, i32 1263918759, i32 1440669257, i32 -1704296320, i32 -437972939, i32 -515320232, i32 -1978143941, i32 -500282568, i32 -440522086, i32 -1097626437, i32 999821417, i32 2140933262, i32 -145301744]
define i32 @Vec_IntUniqueHashKey(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %36
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %34, %6 ]
%8 = phi i32 [ 0, %4 ], [ %33, %6 ]
%9 = trunc i64 %7 to i32
%10 = shl i32 %9, 1
%11 = and i32 %10, 14
%12 = zext i32 %11 to i64
%13 = getelementptr inbounds [16 x i32], [16 x i32]* @Vec_IntUniqueHashKey.s_BigPrimes2, i64 0, i64 %12
%14 = load i32, i32* %13
%15 = getelementptr inbounds i8, i8* %0, i64 %7
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = and i32 %17, 15
%19 = zext i32 %18 to i64
%20 = getelementptr inbounds [16 x i32], [16 x i32]* @Vec_IntUniqueHashKey.s_BigPrimes, i64 0, i64 %19
%21 = load i32, i32* %20
%22 = mul i32 %21, %14
%23 = or i32 %11, 1
%24 = zext i32 %23 to i64
%25 = getelementptr inbounds [16 x i32], [16 x i32]* @Vec_IntUniqueHashKey.s_BigPrimes2, i64 0, i64 %24
%26 = load i32, i32* %25
%27 = lshr i32 %17, 4
%28 = zext i32 %27 to i64
%29 = getelementptr inbounds [16 x i32], [16 x i32]* @Vec_IntUniqueHashKey.s_BigPrimes, i64 0, i64 %28
%30 = load i32, i32* %29
%31 = mul i32 %30, %26
%32 = add i32 %22, %8
%33 = add i32 %32, %31
%34 = add nuw nsw i64 %7, 1
%35 = icmp eq i64 %34, %5
br i1 %35, label %36, label %6
36: ; preds = %6, %2
%37 = phi i32 [ 0, %2 ], [ %33, %6 ]
ret i32 %37
}