unsigned int hash(str, len)
register char *str;
register int unsigned len;
{
  static unsigned char asso_values[] = {
      234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234,
      234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234,
      234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234,
      234, 234, 234, 234, 234, 10,  234, 234, 234, 234, 234, 234, 234, 234, 234,
      234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234,
      234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234,
      234, 234, 234, 234, 234, 234, 234, 70,  40,  30,  112, 95,  35,  50,  85,
      105, 234, 75,  25,  0,   75,  110, 95,  234, 30,  0,   0,   25,  35,  60,
      5,   5,   234, 234, 234, 234, 234, 234,
  };
  return len + asso_values[str[len - 1]] + asso_values[str[0]];
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
mov    %edx,%edx
movsbq (%rcx,%rdx,1),%rdx
lea    0x2f0a(%rip),%rcx
movzbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movsbq (%rcx),%rdx
lea    0x2ef5(%rip),%rcx
movzbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
lea    -0x1(%rsi),%eax
movsbq (%rdi,%rax,1),%rax
lea    0xef1(%rip),%rcx
movzbl (%rax,%rcx,1),%edx
add    %esi,%edx
movsbq (%rdi),%rax
movzbl (%rax,%rcx,1),%eax
add    %edx,%eax
ret

LLVM IR (-O0):
@hash.asso_values = internal global [128 x i8] c"\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\0A\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EAF(\1Ep_Ui\EAK\19\00Kn_\EA\1E\00\00\19#<\05\05\EA\EA\EA\EA\EA\EA"
define i32 @hash(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = sub i32 %7, 1
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %6, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i64
%13 = getelementptr inbounds [128 x i8], [128 x i8]* @hash.asso_values, i64 0, i64 %12
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = add i32 %5, %15
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i64 0
%19 = load i8, i8* %18
%20 = sext i8 %19 to i64
%21 = getelementptr inbounds [128 x i8], [128 x i8]* @hash.asso_values, i64 0, i64 %20
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = add i32 %16, %23
ret i32 %24
}

LLVM IR (-O2):
@hash.asso_values = internal unnamed_addr constant [128 x i8] c"\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\0A\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EA\EAF(\1Ep_Ui\EAK\19\00Kn_\EA\1E\00\00\19#<\05\05\EA\EA\EA\EA\EA\EA"
define i32 @hash(i8* nocapture %0, i32 %1) {
%3 = add i32 %1, -1
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = sext i8 %6 to i64
%8 = getelementptr inbounds [128 x i8], [128 x i8]* @hash.asso_values, i64 0, i64 %7
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = add i32 %10, %1
%12 = load i8, i8* %0
%13 = sext i8 %12 to i64
%14 = getelementptr inbounds [128 x i8], [128 x i8]* @hash.asso_values, i64 0, i64 %13
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = add i32 %11, %16
ret i32 %17
}