unsigned int svgtiny_color_hash(register const char *str,
                                register unsigned int len) {
  static const unsigned short asso_values[] = {
      566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566,
      566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566,
      566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566,
      566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566,
      566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566,
      566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566,
      566, 566, 566, 566, 566, 566, 566, 5,   55,  0,   35,  0,   75,  10,  5,
      0,   566, 250, 10,  40,  85,  60,  70,  144, 0,   20,  45,  10,  30,  185,
      95,  195, 566, 0,   566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566,
      566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566,
      566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566,
      566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566,
      566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566,
      566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566,
      566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566,
      566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566,
      566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566,
      566, 566, 566};
  register int hval = len;
  switch (hval) {
  default:
    hval += asso_values[(unsigned char)str[12]];
  case 12:
    hval += asso_values[(unsigned char)str[11]];
  case 11:
  case 10:
  case 9:
  case 8:
    hval += asso_values[(unsigned char)str[7]];
  case 7:
    hval += asso_values[(unsigned char)str[6]];
  case 6:
    hval += asso_values[(unsigned char)str[5]];
  case 5:
  case 4:
  case 3:
    hval += asso_values[(unsigned char)str[2] + 2];
  case 2:
  case 1:
    hval += asso_values[(unsigned char)str[0]];
    break;
  }
  return hval;
}


x86 assembly (clang, -O0):
<svgtiny_color_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
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0xb,%eax
ja     113a <svgtiny_color_hash+0x3a>
mov    -0x18(%rbp),%rax
lea    0xecf(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x8(%rbp),%rax
movzbl 0xc(%rax),%eax
mov    %eax,%ecx
lea    0xee5(%rip),%rax
movzwl (%rax,%rcx,2),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0xb(%rax),%eax
mov    %eax,%ecx
lea    0xeca(%rip),%rax
movzwl (%rax,%rcx,2),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x7(%rax),%eax
mov    %eax,%ecx
lea    0xeaf(%rip),%rax
movzwl (%rax,%rcx,2),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x6(%rax),%eax
mov    %eax,%ecx
lea    0xe94(%rip),%rax
movzwl (%rax,%rcx,2),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x5(%rax),%eax
mov    %eax,%ecx
lea    0xe79(%rip),%rax
movzwl (%rax,%rcx,2),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%eax
add    $0x2,%eax
movslq %eax,%rcx
lea    0xe5a(%rip),%rax
movzwl (%rax,%rcx,2),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    %eax,%ecx
lea    0xe40(%rip),%rax
movzwl (%rax,%rcx,2),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<svgtiny_color_hash>:
lea    -0x1(%rsi),%eax
cmp    $0xb,%eax
ja     1118 <svgtiny_color_hash+0x18>
lea    0xef1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movzbl 0xc(%rdi),%eax
lea    0xf0d(%rip),%rcx
movzwl (%rcx,%rax,2),%eax
add    %esi,%eax
mov    %eax,%esi
movzbl 0xb(%rdi),%eax
lea    0xefa(%rip),%rcx
movzwl (%rcx,%rax,2),%eax
add    %eax,%esi
movzbl 0x7(%rdi),%eax
lea    0xee9(%rip),%rcx
movzwl (%rcx,%rax,2),%eax
add    %eax,%esi
movzbl 0x6(%rdi),%eax
lea    0xed8(%rip),%rcx
movzwl (%rcx,%rax,2),%eax
add    %eax,%esi
movzbl 0x5(%rdi),%eax
lea    0xec7(%rip),%rcx
movzwl (%rcx,%rax,2),%eax
add    %eax,%esi
movzbl 0x2(%rdi),%eax
lea    0xeb6(%rip),%rcx
movzwl 0x4(%rcx,%rax,2),%eax
add    %eax,%esi
movzbl (%rdi),%eax
lea    0xea5(%rip),%rcx
movzwl (%rcx,%rax,2),%eax
add    %esi,%eax
ret

LLVM IR (-O0):
@svgtiny_color_hash.asso_values = internal constant [258 x i16] [i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 5, i16 55, i16 0, i16 35, i16 0, i16 75, i16 10, i16 5, i16 0, i16 566, i16 250, i16 10, i16 40, i16 85, i16 60, i16 70, i16 144, i16 0, i16 20, i16 45, i16 10, i16 30, i16 185, i16 95, i16 195, i16 566, i16 0, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566]
define i32 @svgtiny_color_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 12, label %18
i32 11, label %28
i32 10, label %28
i32 9, label %28
i32 8, label %28
i32 7, label %38
i32 6, label %48
i32 5, label %58
i32 4, label %58
i32 3, label %58
i32 2, label %70
i32 1, label %70
]
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 12
%11 = load i8, i8* %10
%12 = zext i8 %11 to i64
%13 = getelementptr inbounds [258 x i16], [258 x i16]* @svgtiny_color_hash.asso_values, i64 0, i64 %12
%14 = load i16, i16* %13
%15 = zext i16 %14 to i32
%16 = load i32, i32* %5
%17 = add nsw i32 %16, %15
store i32 %17, i32* %5
br label %18
18: ; preds = %2, %8
%19 = load i8*, i8** %3
%20 = getelementptr inbounds i8, i8* %19, i64 11
%21 = load i8, i8* %20
%22 = zext i8 %21 to i64
%23 = getelementptr inbounds [258 x i16], [258 x i16]* @svgtiny_color_hash.asso_values, i64 0, i64 %22
%24 = load i16, i16* %23
%25 = zext i16 %24 to i32
%26 = load i32, i32* %5
%27 = add nsw i32 %26, %25
store i32 %27, i32* %5
br label %28
28: ; preds = %2, %2, %2, %2, %18
%29 = load i8*, i8** %3
%30 = getelementptr inbounds i8, i8* %29, i64 7
%31 = load i8, i8* %30
%32 = zext i8 %31 to i64
%33 = getelementptr inbounds [258 x i16], [258 x i16]* @svgtiny_color_hash.asso_values, i64 0, i64 %32
%34 = load i16, i16* %33
%35 = zext i16 %34 to i32
%36 = load i32, i32* %5
%37 = add nsw i32 %36, %35
store i32 %37, i32* %5
br label %38
38: ; preds = %2, %28
%39 = load i8*, i8** %3
%40 = getelementptr inbounds i8, i8* %39, i64 6
%41 = load i8, i8* %40
%42 = zext i8 %41 to i64
%43 = getelementptr inbounds [258 x i16], [258 x i16]* @svgtiny_color_hash.asso_values, i64 0, i64 %42
%44 = load i16, i16* %43
%45 = zext i16 %44 to i32
%46 = load i32, i32* %5
%47 = add nsw i32 %46, %45
store i32 %47, i32* %5
br label %48
48: ; preds = %2, %38
%49 = load i8*, i8** %3
%50 = getelementptr inbounds i8, i8* %49, i64 5
%51 = load i8, i8* %50
%52 = zext i8 %51 to i64
%53 = getelementptr inbounds [258 x i16], [258 x i16]* @svgtiny_color_hash.asso_values, i64 0, i64 %52
%54 = load i16, i16* %53
%55 = zext i16 %54 to i32
%56 = load i32, i32* %5
%57 = add nsw i32 %56, %55
store i32 %57, i32* %5
br label %58
58: ; preds = %2, %2, %2, %48
%59 = load i8*, i8** %3
%60 = getelementptr inbounds i8, i8* %59, i64 2
%61 = load i8, i8* %60
%62 = zext i8 %61 to i32
%63 = add nsw i32 %62, 2
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds [258 x i16], [258 x i16]* @svgtiny_color_hash.asso_values, i64 0, i64 %64
%66 = load i16, i16* %65
%67 = zext i16 %66 to i32
%68 = load i32, i32* %5
%69 = add nsw i32 %68, %67
store i32 %69, i32* %5
br label %70
70: ; preds = %2, %2, %58
%71 = load i8*, i8** %3
%72 = getelementptr inbounds i8, i8* %71, i64 0
%73 = load i8, i8* %72
%74 = zext i8 %73 to i64
%75 = getelementptr inbounds [258 x i16], [258 x i16]* @svgtiny_color_hash.asso_values, i64 0, i64 %74
%76 = load i16, i16* %75
%77 = zext i16 %76 to i32
%78 = load i32, i32* %5
%79 = add nsw i32 %78, %77
store i32 %79, i32* %5
br label %80
80: ; preds = %70
%81 = load i32, i32* %5
ret i32 %81
}

LLVM IR (-O2):
@svgtiny_color_hash.asso_values = internal unnamed_addr constant [258 x i16] [i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 5, i16 55, i16 0, i16 35, i16 0, i16 75, i16 10, i16 5, i16 0, i16 566, i16 250, i16 10, i16 40, i16 85, i16 60, i16 70, i16 144, i16 0, i16 20, i16 45, i16 10, i16 30, i16 185, i16 95, i16 195, i16 566, i16 0, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566, i16 566]
define i32 @svgtiny_color_hash(i8* nocapture %0, i32 %1) {
switch i32 %1, label %3 [
i32 12, label %11
i32 11, label %20
i32 10, label %20
i32 9, label %20
i32 8, label %20
i32 7, label %29
i32 6, label %38
i32 5, label %47
i32 4, label %47
i32 3, label %47
i32 2, label %57
i32 1, label %57
]
3: ; preds = %2
%4 = getelementptr inbounds i8, i8* %0, i64 12
%5 = load i8, i8* %4
%6 = zext i8 %5 to i64
%7 = getelementptr inbounds [258 x i16], [258 x i16]* @svgtiny_color_hash.asso_values, i64 0, i64 %6
%8 = load i16, i16* %7
%9 = zext i16 %8 to i32
%10 = add nsw i32 %9, %1
br label %11
11: ; preds = %2, %3
%12 = phi i32 [ %10, %3 ], [ %1, %2 ]
%13 = getelementptr inbounds i8, i8* %0, i64 11
%14 = load i8, i8* %13
%15 = zext i8 %14 to i64
%16 = getelementptr inbounds [258 x i16], [258 x i16]* @svgtiny_color_hash.asso_values, i64 0, i64 %15
%17 = load i16, i16* %16
%18 = zext i16 %17 to i32
%19 = add nsw i32 %12, %18
br label %20
20: ; preds = %2, %2, %2, %2, %11
%21 = phi i32 [ %19, %11 ], [ %1, %2 ], [ %1, %2 ], [ %1, %2 ], [ %1, %2 ]
%22 = getelementptr inbounds i8, i8* %0, i64 7
%23 = load i8, i8* %22
%24 = zext i8 %23 to i64
%25 = getelementptr inbounds [258 x i16], [258 x i16]* @svgtiny_color_hash.asso_values, i64 0, i64 %24
%26 = load i16, i16* %25
%27 = zext i16 %26 to i32
%28 = add nsw i32 %21, %27
br label %29
29: ; preds = %2, %20
%30 = phi i32 [ %28, %20 ], [ %1, %2 ]
%31 = getelementptr inbounds i8, i8* %0, i64 6
%32 = load i8, i8* %31
%33 = zext i8 %32 to i64
%34 = getelementptr inbounds [258 x i16], [258 x i16]* @svgtiny_color_hash.asso_values, i64 0, i64 %33
%35 = load i16, i16* %34
%36 = zext i16 %35 to i32
%37 = add nsw i32 %30, %36
br label %38
38: ; preds = %2, %29
%39 = phi i32 [ %37, %29 ], [ %1, %2 ]
%40 = getelementptr inbounds i8, i8* %0, i64 5
%41 = load i8, i8* %40
%42 = zext i8 %41 to i64
%43 = getelementptr inbounds [258 x i16], [258 x i16]* @svgtiny_color_hash.asso_values, i64 0, i64 %42
%44 = load i16, i16* %43
%45 = zext i16 %44 to i32
%46 = add nsw i32 %39, %45
br label %47
47: ; preds = %2, %2, %2, %38
%48 = phi i32 [ %46, %38 ], [ %1, %2 ], [ %1, %2 ], [ %1, %2 ]
%49 = getelementptr inbounds i8, i8* %0, i64 2
%50 = load i8, i8* %49
%51 = zext i8 %50 to i64
%52 = add nuw nsw i64 %51, 2
%53 = getelementptr inbounds [258 x i16], [258 x i16]* @svgtiny_color_hash.asso_values, i64 0, i64 %52
%54 = load i16, i16* %53
%55 = zext i16 %54 to i32
%56 = add nsw i32 %48, %55
br label %57
57: ; preds = %2, %2, %47
%58 = phi i32 [ %56, %47 ], [ %1, %2 ], [ %1, %2 ]
%59 = load i8, i8* %0
%60 = zext i8 %59 to i64
%61 = getelementptr inbounds [258 x i16], [258 x i16]* @svgtiny_color_hash.asso_values, i64 0, i64 %60
%62 = load i16, i16* %61
%63 = zext i16 %62 to i32
%64 = add nsw i32 %58, %63
ret i32 %64
}