#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[] = {
      43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
      43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
      43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
      43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 12, 2,  10, 22, 1,  28,
      15, 1,  43, 43, 43, 0,  9,  26, 3,  17, 1,  11, 0,  22, 5,  43, 3,  2,
      43, 43, 43, 43, 43, 43, 43, 43, 12, 2,  10, 22, 1,  28, 15, 1,  43, 43,
      43, 0,  9,  26, 3,  17, 1,  11, 0,  22, 5,  43, 3,  2,  43, 43, 43, 43,
      43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
      43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
      43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
      43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
      43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
      43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
      43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
      43, 43, 43, 43, 43};
  register unsigned int hval = len;
  switch (hval) {
  default:
    hval += asso_values[(unsigned char)str[6] + 1];
  case 6:
  case 5:
  case 4:
  case 3:
    hval += asso_values[(unsigned char)str[2]];
    break;
  }
  return hval;
}


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    $0xfffffffd,%eax
sub    $0x4,%eax
jb     1145 <hash+0x45>
jmp    1126 <hash+0x26>
mov    -0x8(%rbp),%rax
movzbl 0x6(%rax),%eax
add    $0x1,%eax
movslq %eax,%rcx
lea    0xec5(%rip),%rax
movzbl (%rax,%rcx,1),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%eax
mov    %eax,%ecx
lea    0xeaa(%rip),%rax
movzbl (%rax,%rcx,1),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
lea    -0x3(%rsi),%eax
cmp    $0x4,%eax
jb     111c <hash+0x1c>
movzbl 0x6(%rdi),%eax
lea    0xeed(%rip),%rcx
movzbl 0x1(%rax,%rcx,1),%eax
add    %esi,%eax
mov    %eax,%esi
movzbl 0x2(%rdi),%eax
lea    0xed9(%rip),%rcx
movzbl (%rax,%rcx,1),%eax
add    %esi,%eax
ret

LLVM IR (-O0):
@hash.asso_values = internal constant [257 x i8] c"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\0C\02\0A\16\01\1C\0F\01+++\00\09\1A\03\11\01\0B\00\16\05+\03\02++++++++\0C\02\0A\16\01\1C\0F\01+++\00\09\1A\03\11\01\0B\00\16\05+\03\02+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
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 6, label %21
i32 5, label %21
i32 4, label %21
i32 3, label %21
]
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 6
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = add nsw i32 %13, 1
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [257 x i8], [257 x i8]* @hash.asso_values, i64 0, i64 %15
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = load i32, i32* %5
%20 = add i32 %19, %18
store i32 %20, i32* %5
br label %21
21: ; preds = %2, %2, %2, %2, %9
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i64 2
%24 = load i8, i8* %23
%25 = zext i8 %24 to i64
%26 = getelementptr inbounds [257 x i8], [257 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 = %21
%32 = load i32, i32* %5
ret i32 %32
}

LLVM IR (-O2):
@hash.asso_values = internal unnamed_addr constant [257 x i8] c"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\0C\02\0A\16\01\1C\0F\01+++\00\09\1A\03\11\01\0B\00\16\05+\03\02++++++++\0C\02\0A\16\01\1C\0F\01+++\00\09\1A\03\11\01\0B\00\16\05+\03\02+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
define i32 @hash(i8* nocapture %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = add i32 %3, -3
%5 = icmp ult i32 %4, 4
br i1 %5, label %15, label %6
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %0, i64 6
%8 = load i8, i8* %7
%9 = zext i8 %8 to i64
%10 = add nuw nsw i64 %9, 1
%11 = getelementptr inbounds [257 x i8], [257 x i8]* @hash.asso_values, i64 0, i64 %10
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = add i32 %13, %3
br label %15
15: ; preds = %2, %6
%16 = phi i32 [ %14, %6 ], [ %3, %2 ]
%17 = getelementptr inbounds i8, i8* %0, i64 2
%18 = load i8, i8* %17
%19 = zext i8 %18 to i64
%20 = getelementptr inbounds [257 x i8], [257 x i8]* @hash.asso_values, i64 0, i64 %19
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = add i32 %16, %22
ret i32 %23
}