#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
unsigned int hash(register const char *str, register size_t len) {
  static const unsigned char asso_values[] = {
      78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
      78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
      78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
      78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 5,  78, 39, 14, 1,  31, 31,
      13, 13, 78, 78, 22, 25, 10, 2,  7,  78, 22, 0,  1,  3,  1,  78, 0,  36,
      14, 17, 20, 78, 78, 78, 78, 5,  78, 39, 14, 1,  31, 31, 13, 13, 78, 78,
      22, 25, 10, 2,  7,  78, 22, 0,  1,  3,  1,  78, 0,  36, 14, 17, 20, 78,
      78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
      78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
      78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
      78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
      78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
      78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
      78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
      78, 78, 78, 78, 78, 78};
  register unsigned int hval = len;
  switch (hval) {
  default:
    hval += asso_values[(unsigned char)str[9]];
  case 9:
  case 8:
  case 7:
  case 6:
  case 5:
  case 4:
  case 3:
  case 2:
  case 1:
    hval += asso_values[(unsigned char)str[0] + 2];
    break;
  }
  return hval + asso_values[(unsigned char)str[len - 1]];
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
sub    $0x9,%eax
jb     1141 <hash+0x41>
jmp    1126 <hash+0x26>
mov    -0x8(%rbp),%rax
movzbl 0x9(%rax),%eax
mov    %eax,%ecx
lea    0xec9(%rip),%rax
movzbl (%rax,%rcx,1),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
add    $0x2,%eax
movslq %eax,%rcx
lea    0xeab(%rip),%rax
movzbl (%rax,%rcx,1),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rdx
sub    $0x1,%rdx
movzbl (%rcx,%rdx,1),%ecx
mov    %ecx,%edx
lea    0xe85(%rip),%rcx
movzbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
lea    -0x1(%rsi),%eax
cmp    $0x9,%eax
jae    110c <hash+0xc>
mov    %esi,%eax
jmp    111d <hash+0x1d>
movzbl 0x9(%rdi),%eax
lea    0xee9(%rip),%rcx
movzbl (%rax,%rcx,1),%eax
add    %esi,%eax
movzbl (%rdi),%ecx
lea    0xed9(%rip),%rdx
movzbl 0x2(%rcx,%rdx,1),%ecx
add    %eax,%ecx
movzbl -0x1(%rsi,%rdi,1),%eax
movzbl (%rax,%rdx,1),%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
@hash.asso_values = internal constant [258 x i8] c"NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN\05N'\0E\01\1F\1F\0D\0DNN\16\19\0A\02\07N\16\00\01\03\01N\00$\0E\11\14NNNN\05N'\0E\01\1F\1F\0D\0DNN\16\19\0A\02\07N\16\00\01\03\01N\00$\0E\11\14NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN"
define i32 @hash(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = trunc i64 %6 to i32
store i32 %7, i32* %5
%8 = load i32, i32* %5
switch i32 %8, label %9 [
i32 9, label %19
i32 8, label %19
i32 7, label %19
i32 6, label %19
i32 5, label %19
i32 4, label %19
i32 3, label %19
i32 2, label %19
i32 1, label %19
]
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 9
%12 = load i8, i8* %11
%13 = zext i8 %12 to i64
%14 = getelementptr inbounds [258 x i8], [258 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 i32 %17, %16
store i32 %18, i32* %5
br label %19
19: ; preds = %2, %2, %2, %2, %2, %2, %2, %2, %2, %9
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i64 0
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = add nsw i32 %23, 2
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [258 x i8], [258 x i8]* @hash.asso_values, i64 0, i64 %25
%27 = load i8, i8* %26
%28 = zext i8 %27 to i32
%29 = load i32, i32* %5
%30 = add i32 %29, %28
store i32 %30, i32* %5
br label %31
31: ; preds = %19
%32 = load i32, i32* %5
%33 = load i8*, i8** %3
%34 = load i64, i64* %4
%35 = sub i64 %34, 1
%36 = getelementptr inbounds i8, i8* %33, i64 %35
%37 = load i8, i8* %36
%38 = zext i8 %37 to i64
%39 = getelementptr inbounds [258 x i8], [258 x i8]* @hash.asso_values, i64 0, i64 %38
%40 = load i8, i8* %39
%41 = zext i8 %40 to i32
%42 = add i32 %32, %41
ret i32 %42
}

LLVM IR (-O2):
@hash.asso_values = internal unnamed_addr constant [258 x i8] c"NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN\05N'\0E\01\1F\1F\0D\0DNN\16\19\0A\02\07N\16\00\01\03\01N\00$\0E\11\14NNNN\05N'\0E\01\1F\1F\0D\0DNN\16\19\0A\02\07N\16\00\01\03\01N\00$\0E\11\14NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN"
define i32 @hash(i8* nocapture %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = add i32 %3, -1
%5 = icmp ult i32 %4, 9
br i1 %5, label %14, label %6
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %0, i64 9
%8 = load i8, i8* %7
%9 = zext i8 %8 to i64
%10 = getelementptr inbounds [258 x i8], [258 x i8]* @hash.asso_values, i64 0, i64 %9
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = add i32 %12, %3
br label %14
14: ; preds = %2, %6
%15 = phi i32 [ %13, %6 ], [ %3, %2 ]
%16 = load i8, i8* %0
%17 = zext i8 %16 to i64
%18 = add nuw nsw i64 %17, 2
%19 = getelementptr inbounds [258 x i8], [258 x i8]* @hash.asso_values, i64 0, i64 %18
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = add i32 %15, %21
%23 = add i64 %1, -1
%24 = getelementptr inbounds i8, i8* %0, i64 %23
%25 = load i8, i8* %24
%26 = zext i8 %25 to i64
%27 = getelementptr inbounds [258 x i8], [258 x i8]* @hash.asso_values, i64 0, i64 %26
%28 = load i8, i8* %27
%29 = zext i8 %28 to i32
%30 = add i32 %22, %29
ret i32 %30
}