// File: /workspace/github_cpp_makefile_star2_O1/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 0x34e3c
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 0x34e42
leaq (%rbx,%rax), %rdi
addq $0x18, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0xb3f0
movl 0x28(%rbx), %eax
addl %r14d, %eax
jmp 0x34f6e
movl $0x1, %eax
retq
addq %r15, %r14
testq %rax, %rax
je 0x34ed1
leaq (%rbx,%rax), %rdi
addq $0x18, %rdi
movl $0x10, %r12d
movl $0x10, %edx
subl %eax, %edx
movq %r15, %rsi
callq 0xb3f0
imull $0x85ebca77, 0x18(%rbx), %eax # imm = 0x85EBCA77
addl 0x8(%rbx), %eax
roll $0xd, %eax
imull $0x9e3779b1, %eax, %eax # imm = 0x9E3779B1
movl %eax, 0x8(%rbx)
imull $0x85ebca77, 0x1c(%rbx), %eax # imm = 0x85EBCA77
addl 0xc(%rbx), %eax
roll $0xd, %eax
imull $0x9e3779b1, %eax, %eax # imm = 0x9E3779B1
movl %eax, 0xc(%rbx)
imull $0x85ebca77, 0x20(%rbx), %eax # imm = 0x85EBCA77
addl 0x10(%rbx), %eax
roll $0xd, %eax
imull $0x9e3779b1, %eax, %eax # imm = 0x9E3779B1
movl %eax, 0x10(%rbx)
imull $0x85ebca77, 0x24(%rbx), %eax # imm = 0x85EBCA77
addl 0x14(%rbx), %eax
roll $0xd, %eax
imull $0x9e3779b1, %eax, %eax # imm = 0x9E3779B1
movl %eax, 0x14(%rbx)
subl 0x28(%rbx), %r12d
addq %r12, %r15
movl $0x0, 0x28(%rbx)
leaq -0x10(%r14), %rax
cmpq %rax, %r15
ja 0x34f52
movl 0x8(%rbx), %edx
movl 0xc(%rbx), %edi
movl 0x10(%rbx), %esi
movl 0x14(%rbx), %ecx
imull $0x85ebca77, (%r15), %r8d # imm = 0x85EBCA77
addl %edx, %r8d
roll $0xd, %r8d
imull $0x85ebca77, 0x4(%r15), %r9d # imm = 0x85EBCA77
addl %edi, %r9d
roll $0xd, %r9d
imull $0x9e3779b1, %r8d, %edx # imm = 0x9E3779B1
imull $0x85ebca77, 0x8(%r15), %r8d # imm = 0x85EBCA77
addl %esi, %r8d
roll $0xd, %r8d
imull $0x85ebca77, 0xc(%r15), %r10d # imm = 0x85EBCA77
imull $0x9e3779b1, %r9d, %edi # imm = 0x9E3779B1
addl %ecx, %r10d
roll $0xd, %r10d
imull $0x9e3779b1, %r8d, %esi # imm = 0x9E3779B1
imull $0x9e3779b1, %r10d, %ecx # imm = 0x9E3779B1
addq $0x10, %r15
cmpq %rax, %r15
jbe 0x34ee6
movl %edx, 0x8(%rbx)
movl %edi, 0xc(%rbx)
movl %esi, 0x10(%rbx)
movl %ecx, 0x14(%rbx)
xorl %eax, %eax
cmpq %r14, %r15
jae 0x34f73
leaq 0x18(%rbx), %rdi
subq %r15, %r14
movq %r15, %rsi
movq %r14, %rdx
callq 0xb3f0
movl %r14d, %eax
movl %eax, 0x28(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq