// File: BU-DiSC[P]BF-Shared-Hashing/hash/xxhash.cc
// Function: ROCKSDB_XXH64
XXH_PUBLIC_API XXH64_hash_t XXH64 (const void* input, size_t len, XXH64_hash_t seed)
{
#if 0
    /* Simple version, good for code maintenance, but unfortunately slow for small inputs */
    XXH64_state_t state;
    XXH64_reset(&state, seed);
    XXH64_update(&state, (const xxh_u8*)input, len);
    return XXH64_digest(&state);

#else

    if (XXH_FORCE_ALIGN_CHECK) {
        if ((((size_t)input) & 7)==0) {  /* Input is aligned, let's leverage the speed advantage */
            return XXH64_endian_align((const xxh_u8*)input, len, seed, XXH_aligned);
    }   }

    return XXH64_endian_align((const xxh_u8*)input, len, seed, XXH_unaligned);

#endif
}

// Assembly:
subq $0x118, %rsp            # imm = 0x118
movq %rdi, 0x38(%rsp)
movq %rsi, 0x30(%rsp)
movq %rdx, 0x28(%rsp)
movq 0x38(%rsp), %rdx
movq 0x30(%rsp), %rcx
movq 0x28(%rsp), %rax
movq %rdx, 0x90(%rsp)
movq %rcx, 0x88(%rsp)
movq %rax, 0x80(%rsp)
movl $0x1, 0x7c(%rsp)
movq 0x90(%rsp), %rax
addq 0x88(%rsp), %rax
movq %rax, 0x70(%rsp)
cmpq $0x20, 0x88(%rsp)
jb 0x4e45f
movq 0x70(%rsp), %rax
addq $-0x20, %rax
movq %rax, 0x60(%rsp)
movabsq $-0x61c8864e7a143579, %rax # imm = 0x9E3779B185EBCA87
addq 0x80(%rsp), %rax
movabsq $-0x3d4d51c2d82b14b1, %rcx # imm = 0xC2B2AE3D27D4EB4F
addq %rcx, %rax
movq %rax, 0x58(%rsp)
movabsq $-0x3d4d51c2d82b14b1, %rax # imm = 0xC2B2AE3D27D4EB4F
addq 0x80(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x80(%rsp), %rax
movabsq $-0x61c8864e7a143579, %rcx # imm = 0x9E3779B185EBCA87
subq %rcx, %rax
movq %rax, 0x40(%rsp)
movq 0x58(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x90(%rsp), %rcx
movl 0x7c(%rsp), %eax
movq %rcx, 0x100(%rsp)
movl %eax, 0xfc(%rsp)
cmpl $0x1, 0xfc(%rsp)
jne 0x4e1cf
movq 0x100(%rsp), %rax
movq %rax, 0x110(%rsp)
movq 0x110(%rsp), %rdi
callq 0x5fae0
movq %rax, 0x108(%rsp)
jmp 0x4e1e2
movq 0x100(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x108(%rsp)
movq 0x20(%rsp), %rdi
movq 0x108(%rsp), %rsi
callq 0x4ea60
movq %rax, 0x58(%rsp)
movq 0x90(%rsp), %rax
addq $0x8, %rax
movq %rax, 0x90(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x90(%rsp), %rcx
movl 0x7c(%rsp), %eax
movq %rcx, 0xe0(%rsp)
movl %eax, 0xdc(%rsp)
cmpl $0x1, 0xdc(%rsp)
jne 0x4e263
movq 0xe0(%rsp), %rax
movq %rax, 0xf0(%rsp)
movq 0xf0(%rsp), %rdi
callq 0x5fae0
movq %rax, 0xe8(%rsp)
jmp 0x4e276
movq 0xe0(%rsp), %rax
movq (%rax), %rax
movq %rax, 0xe8(%rsp)
movq 0x18(%rsp), %rdi
movq 0xe8(%rsp), %rsi
callq 0x4ea60
movq %rax, 0x50(%rsp)
movq 0x90(%rsp), %rax
addq $0x8, %rax
movq %rax, 0x90(%rsp)
movq 0x48(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x90(%rsp), %rcx
movl 0x7c(%rsp), %eax
movq %rcx, 0xc0(%rsp)
movl %eax, 0xbc(%rsp)
cmpl $0x1, 0xbc(%rsp)
jne 0x4e2f7
movq 0xc0(%rsp), %rax
movq %rax, 0xd0(%rsp)
movq 0xd0(%rsp), %rdi
callq 0x5fae0
movq %rax, 0xc8(%rsp)
jmp 0x4e30a
movq 0xc0(%rsp), %rax
movq (%rax), %rax
movq %rax, 0xc8(%rsp)
movq 0x10(%rsp), %rdi
movq 0xc8(%rsp), %rsi
callq 0x4ea60
movq %rax, 0x48(%rsp)
movq 0x90(%rsp), %rax
addq $0x8, %rax
movq %rax, 0x90(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x90(%rsp), %rcx
movl 0x7c(%rsp), %eax
movq %rcx, 0xa0(%rsp)
movl %eax, 0x9c(%rsp)
cmpl $0x1, 0x9c(%rsp)
jne 0x4e38b
movq 0xa0(%rsp), %rax
movq %rax, 0xb0(%rsp)
movq 0xb0(%rsp), %rdi
callq 0x5fae0
movq %rax, 0xa8(%rsp)
jmp 0x4e39e
movq 0xa0(%rsp), %rax
movq (%rax), %rax
movq %rax, 0xa8(%rsp)
movq 0x8(%rsp), %rdi
movq 0xa8(%rsp), %rsi
callq 0x4ea60
movq %rax, 0x40(%rsp)
movq 0x90(%rsp), %rax
addq $0x8, %rax
movq %rax, 0x90(%rsp)
movq 0x90(%rsp), %rax
cmpq 0x60(%rsp), %rax
jbe 0x4e179
movq 0x58(%rsp), %rax
rolq %rax
movq 0x50(%rsp), %rcx
rolq $0x7, %rcx
addq %rcx, %rax
movq 0x48(%rsp), %rcx
rolq $0xc, %rcx
addq %rcx, %rax
movq 0x40(%rsp), %rcx
rolq $0x12, %rcx
addq %rcx, %rax
movq %rax, 0x68(%rsp)
movq 0x68(%rsp), %rdi
movq 0x58(%rsp), %rsi
callq 0x4ebd0
movq %rax, 0x68(%rsp)
movq 0x68(%rsp), %rdi
movq 0x50(%rsp), %rsi
callq 0x4ebd0
movq %rax, 0x68(%rsp)
movq 0x68(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0x4ebd0
movq %rax, 0x68(%rsp)
movq 0x68(%rsp), %rdi
movq 0x40(%rsp), %rsi
callq 0x4ebd0
movq %rax, 0x68(%rsp)
jmp 0x4e476
movabsq $0x27d4eb2f165667c5, %rax # imm = 0x27D4EB2F165667C5
addq 0x80(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0x88(%rsp), %rax
addq 0x68(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0x68(%rsp), %rdi
movq 0x90(%rsp), %rsi
movq 0x88(%rsp), %rdx
movl 0x7c(%rsp), %ecx
callq 0x4ec30
addq $0x118, %rsp            # imm = 0x118
retq
nop