// File: /workspace/github_cpp_makefile_star2_O2/mh0fm4[P]SCDC/src/extra/xxhash/xxhash.c
// Function: XXH32_update
FORCE_INLINE
XXH_errorcode XXH32_update_endian (XXH32_state_t* state, const void* input, size_t len, XXH_endianess endian)
{
    const BYTE* p = (const BYTE*)input;
    const BYTE* const bEnd = p + 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

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

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

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

    if (p <= bEnd-16) {
        const BYTE* const limit = bEnd - 16;
        U32 v1 = state->v1;
        U32 v2 = state->v2;
        U32 v3 = state->v3;
        U32 v4 = state->v4;

        do {
            v1 = XXH32_round(v1, XXH_readLE32(p, endian)); p+=4;
            v2 = XXH32_round(v2, XXH_readLE32(p, endian)); p+=4;
            v3 = XXH32_round(v3, XXH_readLE32(p, endian)); p+=4;
            v4 = XXH32_round(v4, XXH_readLE32(p, endian)); p+=4;
        } while (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 0x2cc54
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 0x2cc58
leaq (%rbx,%rax), %rdi
addq $0x18, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0xb420
movl 0x28(%rbx), %eax
addl %r14d, %eax
jmp 0x2cd8c
pushq $0x1
popq %rax
retq
addq %r15, %r14
testq %rax, %rax
je 0x2ccf3
leaq (%rbx,%rax), %rdi
addq $0x18, %rdi
pushq $0x10
popq %r12
movl %r12d, %edx
subl %eax, %edx
movq %r15, %rsi
callq 0xb420
movdqu 0x8(%rbx), %xmm0
movdqu 0x18(%rbx), %xmm1
movdqa 0x25e81(%rip), %xmm2    # 0x52b10
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 0x25e58(%rip), %xmm0    # 0x52b20
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
andl $0x0, 0x28(%rbx)
leaq -0x10(%r14), %rax
cmpq %rax, %r15
ja 0x2cd70
movdqu 0x8(%rbx), %xmm2
movdqa 0x25e07(%rip), %xmm0    # 0x52b10
movdqa 0x25e0f(%rip), %xmm1    # 0x52b20
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
cmpq %rax, %r15
jbe 0x2cd11
movdqu %xmm2, 0x8(%rbx)
xorl %eax, %eax
cmpq %r14, %r15
jae 0x2cd91
leaq 0x18(%rbx), %rdi
subq %r15, %r14
movq %r15, %rsi
movq %r14, %rdx
callq 0xb420
movl %r14d, %eax
movl %eax, 0x28(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq