// File: /workspace/github_cpp_makefile_star2_O1/BU-DiSC[P]BF-Shared-Hashing/hash/xxhash.cc
// Function: ROCKSDB_XXH32_update
XXH_PUBLIC_API XXH_errorcode
XXH32_update(XXH32_state_t* state, const void* input, size_t len)
{
    if (input==NULL)
#if defined(XXH_ACCEPT_NULL_INPUT_POINTER) && (XXH_ACCEPT_NULL_INPUT_POINTER>=1)
        return XXH_OK;
#else
        return XXH_ERROR;
#endif

    {   const xxh_u8* p = (const xxh_u8*)input;
        const xxh_u8* const bEnd = p + len;

        state->total_len_32 += (XXH32_hash_t)len;
        state->large_len |= (XXH32_hash_t)((len>=16) | (state->total_len_32>=16));

        if (state->memsize + len < 16)  {   /* fill in tmp buffer */
            XXH_memcpy((xxh_u8*)(state->mem32) + state->memsize, input, len);
            state->memsize += (XXH32_hash_t)len;
            return XXH_OK;
        }

        if (state->memsize) {   /* some data left from previous update */
            XXH_memcpy((xxh_u8*)(state->mem32) + state->memsize, input, 16-state->memsize);
            {   const xxh_u32* p32 = state->mem32;
                state->v1 = XXH32_round(state->v1, XXH_readLE32(p32)); p32++;
                state->v2 = XXH32_round(state->v2, XXH_readLE32(p32)); p32++;
                state->v3 = XXH32_round(state->v3, XXH_readLE32(p32)); p32++;
                state->v4 = XXH32_round(state->v4, XXH_readLE32(p32));
            }
            p += 16-state->memsize;
            state->memsize = 0;
        }

        // uintptr_t casts added to avoid array-bounds error on
        // some inlined calls
        if ((uintptr_t)p <= (uintptr_t)bEnd - 16) {
            const uintptr_t limit = (uintptr_t)bEnd - 16;
            xxh_u32 v1 = state->v1;
            xxh_u32 v2 = state->v2;
            xxh_u32 v3 = state->v3;
            xxh_u32 v4 = state->v4;

            do {
                v1 = XXH32_round(v1, XXH_readLE32(p)); p+=4;
                v2 = XXH32_round(v2, XXH_readLE32(p)); p+=4;
                v3 = XXH32_round(v3, XXH_readLE32(p)); p+=4;
                v4 = XXH32_round(v4, XXH_readLE32(p)); p+=4;
            } while ((uintptr_t)p <= limit);

            state->v1 = v1;
            state->v2 = v2;
            state->v3 = v3;
            state->v4 = v4;
        }

        if (p < bEnd) {
            XXH_memcpy(state->mem32, p, (size_t)(bEnd-p));
            state->memsize = (unsigned)(bEnd-p);
        }
    }

    return XXH_OK;
}

// Assembly:
testq %rsi, %rsi
je 0x24594
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movl (%rdi), %eax
addl %r14d, %eax
movl %eax, (%rdi)
cmpq $0x10, %rdx
setae %cl
cmpl $0x10, %eax
setae %al
orb %cl, %al
movzbl %al, %eax
orl %eax, 0x4(%rdi)
movl 0x28(%rdi), %eax
leaq (%rax,%rdx), %rcx
cmpq $0xf, %rcx
ja 0x2459a
leaq (%rbx,%rax), %rdi
addq $0x18, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x5330
movl 0x28(%rbx), %eax
addl %r14d, %eax
jmp 0x246dc
movl $0x1, %eax
retq
addq %r15, %r14
testq %rax, %rax
je 0x2463c
leaq (%rbx,%rax), %rdi
addq $0x18, %rdi
movl $0x10, %r12d
movl $0x10, %edx
subl %eax, %edx
movq %r15, %rsi
callq 0x5330
movdqu 0x8(%rbx), %xmm0
movdqu 0x18(%rbx), %xmm1
movdqa 0x5f9b(%rip), %xmm2     # 0x2a570
pshufd $0xf5, %xmm1, %xmm3     # xmm3 = xmm1[1,1,3,3]
pmuludq %xmm2, %xmm1
pshufd $0xe8, %xmm1, %xmm1     # xmm1 = xmm1[0,2,2,3]
pmuludq %xmm2, %xmm3
pshufd $0xe8, %xmm3, %xmm2     # xmm2 = xmm3[0,2,2,3]
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
paddd %xmm0, %xmm1
movdqa %xmm1, %xmm0
psrld $0x13, %xmm0
pslld $0xd, %xmm1
por %xmm0, %xmm1
movdqa 0x5f72(%rip), %xmm0     # 0x2a580
pshufd $0xf5, %xmm1, %xmm2     # xmm2 = xmm1[1,1,3,3]
pmuludq %xmm0, %xmm1
pshufd $0xe8, %xmm1, %xmm1     # xmm1 = xmm1[0,2,2,3]
pmuludq %xmm0, %xmm2
pshufd $0xe8, %xmm2, %xmm0     # xmm0 = xmm2[0,2,2,3]
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movdqu %xmm1, 0x8(%rbx)
subl 0x28(%rbx), %r12d
addq %r12, %r15
movl $0x0, 0x28(%rbx)
leaq -0x10(%r14), %rax
cmpq %r15, %rax
jb 0x246c0
movdqu 0x8(%rbx), %xmm2
movdqa 0x5f1e(%rip), %xmm0     # 0x2a570
movdqa 0x5f26(%rip), %xmm1     # 0x2a580
movq %r15, %rcx
movdqu (%r15), %xmm3
pshufd $0xf5, %xmm3, %xmm4     # xmm4 = xmm3[1,1,3,3]
pmuludq %xmm0, %xmm3
pshufd $0xe8, %xmm3, %xmm3     # xmm3 = xmm3[0,2,2,3]
pmuludq %xmm0, %xmm4
pshufd $0xe8, %xmm4, %xmm4     # xmm4 = xmm4[0,2,2,3]
punpckldq %xmm4, %xmm3    # xmm3 = xmm3[0],xmm4[0],xmm3[1],xmm4[1]
paddd %xmm2, %xmm3
movdqa %xmm3, %xmm2
psrld $0x13, %xmm2
pslld $0xd, %xmm3
por %xmm2, %xmm3
pshufd $0xf5, %xmm3, %xmm4     # xmm4 = xmm3[1,1,3,3]
pmuludq %xmm1, %xmm3
pshufd $0xe8, %xmm3, %xmm2     # xmm2 = xmm3[0,2,2,3]
pmuludq %xmm1, %xmm4
pshufd $0xe8, %xmm4, %xmm3     # xmm3 = xmm4[0,2,2,3]
punpckldq %xmm3, %xmm2    # xmm2 = xmm2[0],xmm3[0],xmm2[1],xmm3[1]
addq $0x10, %r15
addq $0x10, %rcx
cmpq %rcx, %rax
jae 0x2465d
movdqu %xmm2, 0x8(%rbx)
xorl %eax, %eax
cmpq %r14, %r15
jae 0x246e1
leaq 0x18(%rbx), %rdi
subq %r15, %r14
movq %r15, %rsi
movq %r14, %rdx
callq 0x5330
movl %r14d, %eax
movl %eax, 0x28(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq