// File: /workspace/github_cpp_makefile_star2_O3/BU-DiSC[P]BF-Shared-Hashing/hash/xxhash.cc
// Function: ROCKSDB_XXH64_update
XXH_PUBLIC_API XXH_errorcode
XXH64_update (XXH64_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 += len;

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

        if (state->memsize) {   /* tmp buffer is full */
            XXH_memcpy(((xxh_u8*)state->mem64) + state->memsize, input, 32-state->memsize);
            state->v1 = XXH64_round(state->v1, XXH_readLE64(state->mem64+0));
            state->v2 = XXH64_round(state->v2, XXH_readLE64(state->mem64+1));
            state->v3 = XXH64_round(state->v3, XXH_readLE64(state->mem64+2));
            state->v4 = XXH64_round(state->v4, XXH_readLE64(state->mem64+3));
            p += 32-state->memsize;
            state->memsize = 0;
        }

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

            do {
                v1 = XXH64_round(v1, XXH_readLE64(p)); p+=8;
                v2 = XXH64_round(v2, XXH_readLE64(p)); p+=8;
                v3 = XXH64_round(v3, XXH_readLE64(p)); p+=8;
                v4 = XXH64_round(v4, XXH_readLE64(p)); p+=8;
            } while ((uintptr_t)p <= limit);

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

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

    return XXH_OK;
}

// Assembly:
testq %rsi, %rsi
je 0x2446a
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
addq %rdx, (%rdi)
movl 0x48(%rdi), %eax
leaq (%rax,%rdx), %rcx
cmpq $0x1f, %rcx
ja 0x24470
leaq (%r14,%rax), %rdi
addq $0x28, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x5330
addl 0x48(%r14), %ebx
jmp 0x245cc
movl $0x1, %eax
retq
addq %r15, %rbx
movabsq $-0x3d4d51c2d82b14b1, %r12 # imm = 0xC2B2AE3D27D4EB4F
movabsq $-0x61c8864e7a143579, %r13 # imm = 0x9E3779B185EBCA87
testq %rax, %rax
je 0x2451b
leaq (%r14,%rax), %rdi
addq $0x28, %rdi
movl $0x20, %ebp
movl $0x20, %edx
subl %eax, %edx
movq %r15, %rsi
callq 0x5330
movq 0x28(%r14), %rax
imulq %r12, %rax
addq 0x8(%r14), %rax
rolq $0x1f, %rax
imulq %r13, %rax
movq %rax, 0x8(%r14)
movq 0x30(%r14), %rax
imulq %r12, %rax
addq 0x10(%r14), %rax
rolq $0x1f, %rax
imulq %r13, %rax
movq %rax, 0x10(%r14)
movq 0x38(%r14), %rax
imulq %r12, %rax
addq 0x18(%r14), %rax
rolq $0x1f, %rax
imulq %r13, %rax
movq %rax, 0x18(%r14)
movq 0x40(%r14), %rax
imulq %r12, %rax
addq 0x20(%r14), %rax
rolq $0x1f, %rax
imulq %r13, %rax
movq %rax, 0x20(%r14)
subl 0x48(%r14), %ebp
addq %rbp, %r15
movl $0x0, 0x48(%r14)
leaq 0x20(%r15), %rax
cmpq %rbx, %rax
ja 0x245b3
leaq -0x20(%rbx), %rax
movq 0x8(%r14), %rcx
movq 0x10(%r14), %rdi
movq 0x18(%r14), %rdx
movq 0x20(%r14), %rsi
movq %r15, %r8
movq (%r15), %r9
imulq %r12, %r9
addq %rcx, %r9
rolq $0x1f, %r9
movq %r9, %rcx
movq 0x8(%r15), %r9
imulq %r12, %r9
addq %rdi, %r9
rolq $0x1f, %r9
imulq %r13, %rcx
movq %r9, %rdi
imulq %r13, %rdi
movq 0x10(%r15), %r9
imulq %r12, %r9
addq %rdx, %r9
rolq $0x1f, %r9
movq %r9, %rdx
imulq %r13, %rdx
movq 0x18(%r15), %r9
imulq %r12, %r9
addq %rsi, %r9
rolq $0x1f, %r9
movq %r9, %rsi
imulq %r13, %rsi
addq $0x20, %r15
addq $0x20, %r8
cmpq %r8, %rax
jae 0x2453f
movq %rcx, 0x8(%r14)
movq %rdi, 0x10(%r14)
movq %rdx, 0x18(%r14)
movq %rsi, 0x20(%r14)
xorl %eax, %eax
cmpq %rbx, %r15
jae 0x245d2
leaq 0x28(%r14), %rdi
subq %r15, %rbx
movq %r15, %rsi
movq %rbx, %rdx
callq 0x5330
movl %ebx, 0x48(%r14)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq