// File: /workspace/github_cpp_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
movl (%rdi), %eax
leaq 0x3e09(%rip), %rcx      # 0x51e0
movl (%rcx,%rax,4), %r9d
movl %edx, %r8d
negl %r8d
addq $0xb, %rsi
movl $0x9e3779b9, %ecx       # imm = 0x9E3779B9
movl $0x9e3779b9, %eax       # imm = 0x9E3779B9
cmpl $0xc, %edx
jb 0x14fa
movsbl -0xb(%rsi), %r10d
movsbl -0xa(%rsi), %edi
shll $0x8, %edi
movsbl -0x9(%rsi), %ebx
shll $0x10, %ebx
movzbl -0x8(%rsi), %r11d
shll $0x18, %r11d
addl %ebx, %r11d
movsbl -0x7(%rsi), %ebx
movsbl -0x6(%rsi), %ebp
shll $0x8, %ebp
movsbl -0x5(%rsi), %r14d
shll $0x10, %r14d
movzbl -0x4(%rsi), %r15d
shll $0x18, %r15d
addl %r14d, %r15d
addl %ebx, %eax
addl %ebp, %eax
addl %r15d, %eax
movsbl -0x3(%rsi), %ebx
movsbl -0x2(%rsi), %ebp
shll $0x8, %ebp
movsbl -0x1(%rsi), %r14d
shll $0x10, %r14d
movzbl (%rsi), %r15d
shll $0x18, %r15d
addl %r14d, %r15d
addl %ebx, %r9d
addl %ebp, %r9d
addl %r15d, %r9d
addl %r10d, %ecx
addl %edi, %ecx
addl %r11d, %ecx
subl %eax, %ecx
subl %r9d, %ecx
movl %r9d, %edi
shrl $0xd, %edi
xorl %ecx, %edi
subl %r9d, %eax
subl %edi, %eax
movl %edi, %ecx
shll $0x8, %ecx
xorl %eax, %ecx
subl %edi, %r9d
subl %ecx, %r9d
movl %ecx, %eax
shrl $0xd, %eax
xorl %r9d, %eax
subl %ecx, %edi
subl %eax, %edi
movl %eax, %r9d
shrl $0xc, %r9d
xorl %edi, %r9d
subl %eax, %ecx
subl %r9d, %ecx
movl %r9d, %edi
shll $0x10, %edi
xorl %ecx, %edi
subl %r9d, %eax
subl %edi, %eax
movl %edi, %r10d
shrl $0x5, %r10d
xorl %eax, %r10d
subl %edi, %r9d
subl %r10d, %r9d
movl %r10d, %ecx
shrl $0x3, %ecx
xorl %r9d, %ecx
subl %r10d, %edi
subl %ecx, %edi
movl %ecx, %eax
shll $0xa, %eax
xorl %edi, %eax
subl %ecx, %r10d
subl %eax, %r10d
movl %eax, %r9d
shrl $0xf, %r9d
xorl %r10d, %r9d
addl $-0xc, %edx
addl $0xc, %r8d
addq $0xc, %rsi
jmp 0x13ef
movl %r9d, %edi
subl %r8d, %edi
decl %edx
cmpl $0xa, %edx
ja 0x158c
leaq 0x1af2(%rip), %r10      # 0x3004
movslq (%r10,%rdx,4), %rdx
addq %r10, %rdx
jmpq *%rdx
movzbl -0x1(%rsi), %edi
shll $0x18, %edi
addl %r9d, %edi
subl %r8d, %edi
movsbl -0x2(%rsi), %edx
shll $0x10, %edx
addl %edx, %edi
movsbl -0x3(%rsi), %edx
shll $0x8, %edx
addl %edx, %edi
movzbl -0x4(%rsi), %edx
shll $0x18, %edx
addl %eax, %edx
movl %edx, %eax
movsbl -0x5(%rsi), %edx
shll $0x10, %edx
addl %eax, %edx
movl %edx, %eax
movsbl -0x6(%rsi), %edx
shll $0x8, %edx
addl %eax, %edx
movl %edx, %eax
movsbl -0x7(%rsi), %edx
addl %eax, %edx
movl %edx, %eax
movzbl -0x8(%rsi), %edx
shll $0x18, %edx
addl %ecx, %edx
movl %edx, %ecx
movsbl -0x9(%rsi), %edx
shll $0x10, %edx
addl %ecx, %edx
movl %edx, %ecx
movsbl -0xa(%rsi), %edx
shll $0x8, %edx
addl %ecx, %edx
movl %edx, %ecx
movsbl -0xb(%rsi), %edx
addl %ecx, %edx
movl %edx, %ecx
subl %eax, %ecx
subl %edi, %ecx
movl %edi, %edx
shrl $0xd, %edx
xorl %ecx, %edx
subl %edi, %eax
subl %edx, %eax
movl %edx, %ecx
shll $0x8, %ecx
xorl %eax, %ecx
subl %edx, %edi
subl %ecx, %edi
movl %ecx, %eax
shrl $0xd, %eax
xorl %edi, %eax
subl %ecx, %edx
subl %eax, %edx
movl %eax, %esi
shrl $0xc, %esi
xorl %edx, %esi
subl %eax, %ecx
subl %esi, %ecx
movl %esi, %edx
shll $0x10, %edx
xorl %ecx, %edx
subl %esi, %eax
subl %edx, %eax
movl %edx, %ecx
shrl $0x5, %ecx
xorl %eax, %ecx
subl %edx, %esi
subl %ecx, %esi
movl %ecx, %edi
shrl $0x3, %edi
xorl %esi, %edi
subl %ecx, %edx
subl %edi, %edx
movl %edi, %eax
shll $0xa, %eax
xorl %edx, %eax
addl %eax, %edi
subl %edi, %ecx
shrl $0xf, %eax
xorl %ecx, %eax
popq %rbx
popq %r14
popq %r15
popq %rbp
retq