unsigned int hash(str, len)
register char *str;
register int unsigned len;
{
  static unsigned char asso_values[] = {
      251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
      251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
      251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
      251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
      251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
      251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
      251, 251, 251, 251, 251, 0,   251, 74,  5,   22,  1,   0,   101, 61,  0,
      92,  251, 1,   0,   57,  37,  69,  34,  24,  52,  7,   12,  50,  116, 10,
      3,   9,   251, 251, 251, 251, 251, 251,
  };
  register int hval = len;
  switch (hval) {
  default:
  case 7:
    hval += asso_values[str[6]];
  case 6:
  case 5:
  case 4:
    hval += asso_values[str[3]];
  case 3:
  case 2:
  case 1:
    hval += asso_values[str[0]];
    break;
  }
  return hval + asso_values[str[len - 1]];
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
add    $0xffffffff,%eax
sub    $0x3,%eax
jb     1186 <hash+0x86>
jmp    1128 <hash+0x28>
mov    -0x14(%rbp),%eax
add    $0xfffffffc,%eax
sub    $0x3,%eax
jb     116c <hash+0x6c>
jmp    113c <hash+0x3c>
mov    -0x14(%rbp),%eax
sub    $0x7,%eax
je     1152 <hash+0x52>
jmp    114d <hash+0x4d>
jmp    1152 <hash+0x52>
mov    -0x8(%rbp),%rax
movsbq 0x6(%rax),%rcx
lea    0x2ece(%rip),%rax
movzbl (%rax,%rcx,1),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbq 0x3(%rax),%rcx
lea    0x2eb4(%rip),%rax
movzbl (%rax,%rcx,1),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbq (%rax),%rcx
lea    0x2e9b(%rip),%rax
movzbl (%rax,%rcx,1),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
mov    %edx,%edx
movsbq (%rcx,%rdx,1),%rdx
lea    0x2e76(%rip),%rcx
movzbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
lea    -0x1(%rsi),%eax
cmp    $0x3,%eax
jb     1138 <hash+0x38>
lea    -0x4(%rsi),%ecx
cmp    $0x3,%ecx
jb     1124 <hash+0x24>
movsbq 0x6(%rdi),%rcx
lea    0xee4(%rip),%rdx
movzbl (%rcx,%rdx,1),%ecx
add    %esi,%ecx
mov    %ecx,%esi
movsbq 0x3(%rdi),%rcx
lea    0xed0(%rip),%rdx
movzbl (%rcx,%rdx,1),%ecx
add    %esi,%ecx
mov    %ecx,%esi
movsbq (%rdi),%rcx
lea    0xebd(%rip),%rdx
movzbl (%rcx,%rdx,1),%ecx
add    %esi,%ecx
movsbq (%rdi,%rax,1),%rax
movzbl (%rax,%rdx,1),%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
@hash.asso_values = internal global [128 x i8] c"\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\00\FBJ\05\16\01\00e=\00\\\FB\01\009%E\22\184\07\0C2t\0A\03\09\FB\FB\FB\FB\FB\FB"
define i32 @hash(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
store i32 %6, i32* %5
%7 = load i32, i32* %5
switch i32 %7, label %8 [
i32 7, label %9
i32 6, label %19
i32 5, label %19
i32 4, label %19
i32 3, label %29
i32 2, label %29
i32 1, label %29
]
8: ; preds = %2
br label %9
9: ; preds = %2, %8
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 6
%12 = load i8, i8* %11
%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 = load i32, i32* %5
%18 = add nsw i32 %17, %16
store i32 %18, i32* %5
br label %19
19: ; preds = %2, %2, %2, %9
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i64 3
%22 = load i8, i8* %21
%23 = sext i8 %22 to i64
%24 = getelementptr inbounds [128 x i8], [128 x i8]* @hash.asso_values, i64 0, i64 %23
%25 = load i8, i8* %24
%26 = zext i8 %25 to i32
%27 = load i32, i32* %5
%28 = add nsw i32 %27, %26
store i32 %28, i32* %5
br label %29
29: ; preds = %2, %2, %2, %19
%30 = load i8*, i8** %3
%31 = getelementptr inbounds i8, i8* %30, i64 0
%32 = load i8, i8* %31
%33 = sext i8 %32 to i64
%34 = getelementptr inbounds [128 x i8], [128 x i8]* @hash.asso_values, i64 0, i64 %33
%35 = load i8, i8* %34
%36 = zext i8 %35 to i32
%37 = load i32, i32* %5
%38 = add nsw i32 %37, %36
store i32 %38, i32* %5
br label %39
39: ; preds = %29
%40 = load i32, i32* %5
%41 = load i8*, i8** %3
%42 = load i32, i32* %4
%43 = sub i32 %42, 1
%44 = zext i32 %43 to i64
%45 = getelementptr inbounds i8, i8* %41, i64 %44
%46 = load i8, i8* %45
%47 = sext i8 %46 to i64
%48 = getelementptr inbounds [128 x i8], [128 x i8]* @hash.asso_values, i64 0, i64 %47
%49 = load i8, i8* %48
%50 = zext i8 %49 to i32
%51 = add nsw i32 %40, %50
ret i32 %51
}

LLVM IR (-O2):
@hash.asso_values = internal unnamed_addr constant [128 x i8] c"\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\00\FBJ\05\16\01\00e=\00\\\FB\01\009%E\22\184\07\0C2t\0A\03\09\FB\FB\FB\FB\FB\FB"
define i32 @hash(i8* nocapture %0, i32 %1) {
switch i32 %1, label %3 [
i32 1, label %20
i32 6, label %11
i32 5, label %11
i32 4, label %11
i32 3, label %20
i32 2, label %20
]
3: ; preds = %2
%4 = getelementptr inbounds i8, i8* %0, i64 6
%5 = load i8, i8* %4
%6 = sext i8 %5 to i64
%7 = getelementptr inbounds [128 x i8], [128 x i8]* @hash.asso_values, i64 0, i64 %6
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = add nsw i32 %9, %1
br label %11
11: ; preds = %2, %2, %2, %3
%12 = phi i32 [ %10, %3 ], [ %1, %2 ], [ %1, %2 ], [ %1, %2 ]
%13 = getelementptr inbounds i8, i8* %0, i64 3
%14 = load i8, i8* %13
%15 = sext i8 %14 to i64
%16 = getelementptr inbounds [128 x i8], [128 x i8]* @hash.asso_values, i64 0, i64 %15
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = add nsw i32 %12, %18
br label %20
20: ; preds = %2, %2, %2, %11
%21 = phi i32 [ %19, %11 ], [ %1, %2 ], [ %1, %2 ], [ %1, %2 ]
%22 = load i8, i8* %0
%23 = sext i8 %22 to i64
%24 = getelementptr inbounds [128 x i8], [128 x i8]* @hash.asso_values, i64 0, i64 %23
%25 = load i8, i8* %24
%26 = zext i8 %25 to i32
%27 = add nsw i32 %21, %26
%28 = add i32 %1, -1
%29 = zext i32 %28 to i64
%30 = getelementptr inbounds i8, i8* %0, i64 %29
%31 = load i8, i8* %30
%32 = sext i8 %31 to i64
%33 = getelementptr inbounds [128 x i8], [128 x i8]* @hash.asso_values, i64 0, i64 %32
%34 = load i8, i8* %33
%35 = zext i8 %34 to i32
%36 = add nsw i32 %27, %35
ret i32 %36
}