// File: /workspace/github_cpp_makefile_star2_O1/shuhaosun[P]Splitter-Windowed-CountMin/./BOBHash32.h
// Function: BOBHash32::run(char const*, unsigned int)
uint BOBHash32::run(const char * str, uint len)
{
	//register ub4 a,b,c,len;
	uint a,b,c;
	uint initval = 0;
	/* Set up the internal state */
	//len = length;
	a = b = 0x9e3779b9;  /* the golden ratio; an arbitrary value */
	c = prime32[this->prime32Num];         /* the previous hash value */

	/*---------------------------------------- handle most of the key */
	while (len >= 12)
	{
		a += (str[0] +((uint)str[1]<<8) +((uint)str[2]<<16) +((uint)str[3]<<24));
		b += (str[4] +((uint)str[5]<<8) +((uint)str[6]<<16) +((uint)str[7]<<24));
		c += (str[8] +((uint)str[9]<<8) +((uint)str[10]<<16)+((uint)str[11]<<24));
		mix(a,b,c);
		str += 12; len -= 12;
	}

	/*------------------------------------- handle the last 11 bytes */
	c += len;
	switch(len)              /* all the case statements fall through */
	{
		case 11: c+=((uint)str[10]<<24);
		case 10: c+=((uint)str[9]<<16);
		case 9 : c+=((uint)str[8]<<8);
		/* the first byte of c is reserved for the length */
		case 8 : b+=((uint)str[7]<<24);
		case 7 : b+=((uint)str[6]<<16);
		case 6 : b+=((uint)str[5]<<8);
		case 5 : b+=str[4];
		case 4 : a+=((uint)str[3]<<24);
		case 3 : a+=((uint)str[2]<<16);
		case 2 : a+=((uint)str[1]<<8);
		case 1 : a+=str[0];
		/* case 0: nothing left to add */
	}
	mix(a,b,c);
	/*-------------------------------------------- report the result */
	return c;
}

// Assembly:
movl (%rdi), %eax
leaq 0x3dfb(%rip), %rcx      # 0x51e0
movl (%rcx,%rax,4), %eax
movl $0x9e3779b9, %edi       # imm = 0x9E3779B9
movl $0x9e3779b9, %ecx       # imm = 0x9E3779B9
cmpl $0xc, %edx
jb 0x1509
movl $0x9e3779b9, %edi       # imm = 0x9E3779B9
movsbl (%rsi), %r8d
addl %edi, %r8d
movsbl 0x1(%rsi), %r9d
shll $0x8, %r9d
addl %r8d, %r9d
movsbl 0x2(%rsi), %r8d
shll $0x10, %r8d
movzbl 0x3(%rsi), %edi
shll $0x18, %edi
addl %r8d, %edi
addl %r9d, %edi
movsbl 0x4(%rsi), %r8d
addl %ecx, %r8d
movsbl 0x5(%rsi), %r9d
shll $0x8, %r9d
addl %r8d, %r9d
movsbl 0x6(%rsi), %r8d
shll $0x10, %r8d
movzbl 0x7(%rsi), %ecx
shll $0x18, %ecx
addl %r8d, %ecx
addl %r9d, %ecx
movsbl 0x8(%rsi), %r8d
addl %eax, %r8d
movsbl 0x9(%rsi), %r9d
shll $0x8, %r9d
addl %r8d, %r9d
movsbl 0xa(%rsi), %r8d
shll $0x10, %r8d
movzbl 0xb(%rsi), %eax
shll $0x18, %eax
addl %r8d, %eax
addl %r9d, %eax
subl %ecx, %edi
subl %eax, %edi
movl %eax, %r8d
shrl $0xd, %r8d
xorl %edi, %r8d
subl %eax, %ecx
subl %r8d, %ecx
movl %r8d, %edi
shll $0x8, %edi
xorl %ecx, %edi
subl %r8d, %eax
subl %edi, %eax
movl %edi, %ecx
shrl $0xd, %ecx
xorl %eax, %ecx
subl %edi, %r8d
subl %ecx, %r8d
movl %ecx, %eax
shrl $0xc, %eax
xorl %r8d, %eax
subl %ecx, %edi
subl %eax, %edi
movl %eax, %r8d
shll $0x10, %r8d
xorl %edi, %r8d
subl %eax, %ecx
subl %r8d, %ecx
movl %r8d, %r9d
shrl $0x5, %r9d
xorl %ecx, %r9d
subl %r8d, %eax
subl %r9d, %eax
movl %r9d, %edi
shrl $0x3, %edi
xorl %eax, %edi
subl %r9d, %r8d
subl %edi, %r8d
movl %edi, %ecx
shll $0xa, %ecx
xorl %r8d, %ecx
subl %edi, %r9d
subl %ecx, %r9d
movl %ecx, %eax
shrl $0xf, %eax
xorl %r9d, %eax
addq $0xc, %rsi
addl $-0xc, %edx
cmpl $0xb, %edx
ja 0x1400
addl %edx, %eax
decl %edx
cmpl $0xa, %edx
ja 0x158e
leaq 0x1aeb(%rip), %r8       # 0x3004
movslq (%r8,%rdx,4), %rdx
addq %r8, %rdx
jmpq *%rdx
movzbl 0xa(%rsi), %edx
shll $0x18, %edx
addl %edx, %eax
movsbl 0x9(%rsi), %edx
shll $0x10, %edx
addl %edx, %eax
movsbl 0x8(%rsi), %edx
shll $0x8, %edx
addl %edx, %eax
movzbl 0x7(%rsi), %edx
shll $0x18, %edx
addl %ecx, %edx
movl %edx, %ecx
movsbl 0x6(%rsi), %edx
shll $0x10, %edx
addl %ecx, %edx
movl %edx, %ecx
movsbl 0x5(%rsi), %edx
shll $0x8, %edx
addl %ecx, %edx
movl %edx, %ecx
movsbl 0x4(%rsi), %edx
addl %ecx, %edx
movl %edx, %ecx
movzbl 0x3(%rsi), %edx
shll $0x18, %edx
addl %edi, %edx
movl %edx, %edi
movsbl 0x2(%rsi), %edx
shll $0x10, %edx
addl %edi, %edx
movl %edx, %edi
movsbl 0x1(%rsi), %edx
shll $0x8, %edx
addl %edi, %edx
movl %edx, %edi
movsbl (%rsi), %edx
addl %edi, %edx
movl %edx, %edi
subl %ecx, %edi
subl %eax, %edi
movl %eax, %edx
shrl $0xd, %edx
xorl %edi, %edx
subl %eax, %ecx
subl %edx, %ecx
movl %edx, %esi
shll $0x8, %esi
xorl %ecx, %esi
subl %edx, %eax
subl %esi, %eax
movl %esi, %ecx
shrl $0xd, %ecx
xorl %eax, %ecx
subl %esi, %edx
subl %ecx, %edx
movl %ecx, %eax
shrl $0xc, %eax
xorl %edx, %eax
subl %ecx, %esi
subl %eax, %esi
movl %eax, %edx
shll $0x10, %edx
xorl %esi, %edx
subl %eax, %ecx
subl %edx, %ecx
movl %edx, %esi
shrl $0x5, %esi
xorl %ecx, %esi
subl %edx, %eax
subl %esi, %eax
movl %esi, %ecx
shrl $0x3, %ecx
xorl %eax, %ecx
subl %esi, %edx
subl %ecx, %edx
movl %ecx, %eax
shll $0xa, %eax
xorl %edx, %eax
addl %eax, %ecx
subl %ecx, %esi
shrl $0xf, %eax
xorl %esi, %eax
retq