// File: /workspace/github_cpp_makefile_star2_O2/mh0fm4[P]SCDC/src/extra/xxhash/xxhash.c
// Function: XXH64_finalize
static U64
XXH64_finalize(U64 h64, const void* ptr, size_t len,
               XXH_endianess endian, XXH_alignment align)
{
    const BYTE* p = (const BYTE*)ptr;

#define PROCESS1_64          \
    h64 ^= (*p) * PRIME64_5; \
    p++;                     \
    h64 = XXH_rotl64(h64, 11) * PRIME64_1;

#define PROCESS4_64          \
    h64 ^= (U64)(XXH_get32bits(p)) * PRIME64_1; \
    p+=4;                    \
    h64 = XXH_rotl64(h64, 23) * PRIME64_2 + PRIME64_3;

#define PROCESS8_64 {        \
    U64 const k1 = XXH64_round(0, XXH_get64bits(p)); \
    p+=8;                    \
    h64 ^= k1;               \
    h64  = XXH_rotl64(h64,27) * PRIME64_1 + PRIME64_4; \
}

    switch(len&31) {
      case 24: PROCESS8_64;
                    /* fallthrough */
      case 16: PROCESS8_64;
                    /* fallthrough */
      case  8: PROCESS8_64;
               return XXH64_avalanche(h64);

      case 28: PROCESS8_64;
                    /* fallthrough */
      case 20: PROCESS8_64;
                    /* fallthrough */
      case 12: PROCESS8_64;
                    /* fallthrough */
      case  4: PROCESS4_64;
               return XXH64_avalanche(h64);

      case 25: PROCESS8_64;
                    /* fallthrough */
      case 17: PROCESS8_64;
                    /* fallthrough */
      case  9: PROCESS8_64;
               PROCESS1_64;
               return XXH64_avalanche(h64);

      case 29: PROCESS8_64;
                    /* fallthrough */
      case 21: PROCESS8_64;
                    /* fallthrough */
      case 13: PROCESS8_64;
                    /* fallthrough */
      case  5: PROCESS4_64;
               PROCESS1_64;
               return XXH64_avalanche(h64);

      case 26: PROCESS8_64;
                    /* fallthrough */
      case 18: PROCESS8_64;
                    /* fallthrough */
      case 10: PROCESS8_64;
               PROCESS1_64;
               PROCESS1_64;
               return XXH64_avalanche(h64);

      case 30: PROCESS8_64;
                    /* fallthrough */
      case 22: PROCESS8_64;
                    /* fallthrough */
      case 14: PROCESS8_64;
                    /* fallthrough */
      case  6: PROCESS4_64;
               PROCESS1_64;
               PROCESS1_64;
               return XXH64_avalanche(h64);

      case 27: PROCESS8_64;
                    /* fallthrough */
      case 19: PROCESS8_64;
                    /* fallthrough */
      case 11: PROCESS8_64;
               PROCESS1_64;
               PROCESS1_64;
               PROCESS1_64;
               return XXH64_avalanche(h64);

      case 31: PROCESS8_64;
                    /* fallthrough */
      case 23: PROCESS8_64;
                    /* fallthrough */
      case 15: PROCESS8_64;
                    /* fallthrough */
      case  7: PROCESS4_64;
                    /* fallthrough */
      case  3: PROCESS1_64;
                    /* fallthrough */
      case  2: PROCESS1_64;
                    /* fallthrough */
      case  1: PROCESS1_64;
                    /* fallthrough */
      case  0: return XXH64_avalanche(h64);
    }

    /* impossible to reach */
    assert(0);
    return 0;  /* unreachable, but some compilers complain without it */
}

// Assembly:
movabsq $-0x3d4d51c2d82b14b1, %rcx # imm = 0xC2B2AE3D27D4EB4F
movabsq $-0x61c8864e7a143579, %rax # imm = 0x9E3779B185EBCA87
movabsq $-0x7a1435883d4d519d, %r9 # imm = 0x85EBCA77C2B2AE63
movabsq $0x27d4eb2f165667c5, %r8 # imm = 0x27D4EB2F165667C5
andl $0x1f, %edx
leaq 0x2573d(%rip), %r10     # 0x52b80
movslq (%r10,%rdx,4), %rdx
addq %r10, %rdx
jmpq *%rdx
movq (%rsi), %rdx
imulq %rcx, %rdx
rolq $0x1f, %rdx
imulq %rax, %rdx
xorq %rdi, %rdx
rolq $0x1b, %rdx
addq $0x8, %rsi
imulq %rax, %rdx
addq %r9, %rdx
movq %rdx, %rdi
movq (%rsi), %rdx
imulq %rcx, %rdx
rolq $0x1f, %rdx
imulq %rax, %rdx
xorq %rdi, %rdx
rolq $0x1b, %rdx
addq $0x8, %rsi
imulq %rax, %rdx
addq %r9, %rdx
movq %rdx, %rdi
imulq (%rsi), %rcx
rolq $0x1f, %rcx
imulq %rax, %rcx
xorq %rdi, %rcx
rolq $0x1b, %rcx
imulq %rax, %rcx
addq %r9, %rcx
jmp 0x2d67f
movq (%rsi), %rdx
imulq %rcx, %rdx
rolq $0x1f, %rdx
imulq %rax, %rdx
xorq %rdi, %rdx
rolq $0x1b, %rdx
addq $0x8, %rsi
imulq %rax, %rdx
addq %r9, %rdx
movq %rdx, %rdi
movq (%rsi), %rdx
imulq %rcx, %rdx
rolq $0x1f, %rdx
imulq %rax, %rdx
xorq %rdi, %rdx
rolq $0x1b, %rdx
addq $0x8, %rsi
imulq %rax, %rdx
addq %r9, %rdx
movq %rdx, %rdi
imulq (%rsi), %rcx
rolq $0x1f, %rcx
imulq %rax, %rcx
xorq %rdi, %rcx
rolq $0x1b, %rcx
imulq %rax, %rcx
addq %r9, %rcx
movzbl 0x8(%rsi), %edx
imulq %r8, %rdx
xorq %rcx, %rdx
rolq $0xb, %rdx
imulq %rax, %rdx
movzbl 0x9(%rsi), %ecx
imulq %r8, %rcx
xorq %rdx, %rcx
rolq $0xb, %rcx
imulq %rax, %rcx
movzbl 0xa(%rsi), %edi
jmp 0x2d84a
movq (%rsi), %rdx
imulq %rcx, %rdx
rolq $0x1f, %rdx
imulq %rax, %rdx
xorq %rdi, %rdx
rolq $0x1b, %rdx
addq $0x8, %rsi
imulq %rax, %rdx
addq %r9, %rdx
movq %rdx, %rdi
movq (%rsi), %rdx
imulq %rcx, %rdx
rolq $0x1f, %rdx
imulq %rax, %rdx
xorq %rdi, %rdx
rolq $0x1b, %rdx
addq $0x8, %rsi
imulq %rax, %rdx
addq %r9, %rdx
movq %rdx, %rdi
imulq (%rsi), %rcx
rolq $0x1f, %rcx
imulq %rax, %rcx
xorq %rdi, %rcx
rolq $0x1b, %rcx
imulq %rax, %rcx
addq %r9, %rcx
movzbl 0x8(%rsi), %edi
jmp 0x2d84a
movq (%rsi), %rdx
imulq %rcx, %rdx
rolq $0x1f, %rdx
imulq %rax, %rdx
xorq %rdi, %rdx
rolq $0x1b, %rdx
addq $0x8, %rsi
imulq %rax, %rdx
addq %r9, %rdx
movq %rdx, %rdi
movq (%rsi), %rdx
imulq %rcx, %rdx
rolq $0x1f, %rdx
imulq %rax, %rdx
xorq %rdi, %rdx
rolq $0x1b, %rdx
addq $0x8, %rsi
imulq %rax, %rdx
addq %r9, %rdx
movq %rdx, %rdi
movq (%rsi), %rdx
imulq %rcx, %rdx
rolq $0x1f, %rdx
imulq %rax, %rdx
xorq %rdi, %rdx
rolq $0x1b, %rdx
addq $0x8, %rsi
imulq %rax, %rdx
addq %r9, %rdx
movq %rdx, %rdi
movl (%rsi), %edx
imulq %rax, %rdx
xorq %rdi, %rdx
rolq $0x17, %rdx
addq $0x4, %rsi
imulq %rcx, %rdx
movabsq $0x165667b19e3779f9, %rdi # imm = 0x165667B19E3779F9
addq %rdx, %rdi
movzbl (%rsi), %ecx
imulq %r8, %rcx
xorq %rdi, %rcx
incq %rsi
rolq $0xb, %rcx
imulq %rax, %rcx
movq %rcx, %rdi
movzbl (%rsi), %ecx
imulq %r8, %rcx
xorq %rdi, %rcx
incq %rsi
rolq $0xb, %rcx
imulq %rax, %rcx
movq %rcx, %rdi
movzbl (%rsi), %ecx
imulq %r8, %rcx
xorq %rdi, %rcx
rolq $0xb, %rcx
imulq %rax, %rcx
movq %rcx, %rdi
jmp 0x2d8e0
movq (%rsi), %rdx
imulq %rcx, %rdx
rolq $0x1f, %rdx
imulq %rax, %rdx
xorq %rdi, %rdx
rolq $0x1b, %rdx
addq $0x8, %rsi
imulq %rax, %rdx
addq %r9, %rdx
movq %rdx, %rdi
movq (%rsi), %rdx
imulq %rcx, %rdx
rolq $0x1f, %rdx
imulq %rax, %rdx
xorq %rdi, %rdx
rolq $0x1b, %rdx
addq $0x8, %rsi
imulq %rax, %rdx
addq %r9, %rdx
movq %rdx, %rdi
movq (%rsi), %rdx
imulq %rcx, %rdx
rolq $0x1f, %rdx
imulq %rax, %rdx
xorq %rdi, %rdx
rolq $0x1b, %rdx
addq $0x8, %rsi
imulq %rax, %rdx
addq %r9, %rdx
movq %rdx, %rdi
movl (%rsi), %edx
imulq %rax, %rdx
xorq %rdi, %rdx
rolq $0x17, %rdx
imulq %rcx, %rdx
movabsq $0x165667b19e3779f9, %rcx # imm = 0x165667B19E3779F9
addq %rdx, %rcx
movzbl 0x4(%rsi), %edx
imulq %r8, %rdx
xorq %rcx, %rdx
rolq $0xb, %rdx
imulq %rax, %rdx
movzbl 0x5(%rsi), %edi
jmp 0x2d8cf
movq (%rsi), %rdx
imulq %rcx, %rdx
rolq $0x1f, %rdx
imulq %rax, %rdx
xorq %rdi, %rdx
rolq $0x1b, %rdx
addq $0x8, %rsi
imulq %rax, %rdx
addq %r9, %rdx
movq %rdx, %rdi
movq (%rsi), %rdx
imulq %rcx, %rdx
rolq $0x1f, %rdx
imulq %rax, %rdx
xorq %rdi, %rdx
rolq $0x1b, %rdx
addq $0x8, %rsi
imulq %rax, %rdx
addq %r9, %rdx
movq %rdx, %rdi
movq (%rsi), %rdx
imulq %rcx, %rdx
rolq $0x1f, %rdx
imulq %rax, %rdx
xorq %rdi, %rdx
rolq $0x1b, %rdx
addq $0x8, %rsi
imulq %rax, %rdx
addq %r9, %rdx
movq %rdx, %rdi
movl (%rsi), %edx
imulq %rax, %rdx
xorq %rdi, %rdx
rolq $0x17, %rdx
imulq %rcx, %rdx
movabsq $0x165667b19e3779f9, %rdi # imm = 0x165667B19E3779F9
addq %rdx, %rdi
jmp 0x2d8e0
movq (%rsi), %rdx
imulq %rcx, %rdx
rolq $0x1f, %rdx
imulq %rax, %rdx
xorq %rdi, %rdx
rolq $0x1b, %rdx
addq $0x8, %rsi
imulq %rax, %rdx
addq %r9, %rdx
movq %rdx, %rdi
movq (%rsi), %rdx
imulq %rcx, %rdx
rolq $0x1f, %rdx
imulq %rax, %rdx
xorq %rdi, %rdx
rolq $0x1b, %rdx
addq $0x8, %rsi
imulq %rax, %rdx
addq %r9, %rdx
movq %rdx, %rdi
movq (%rsi), %rdx
imulq %rcx, %rdx
rolq $0x1f, %rdx
imulq %rax, %rdx
xorq %rdi, %rdx
rolq $0x1b, %rdx
addq $0x8, %rsi
imulq %rax, %rdx
addq %r9, %rdx
movq %rdx, %rdi
movl (%rsi), %edx
imulq %rax, %rdx
xorq %rdi, %rdx
rolq $0x17, %rdx
imulq %rcx, %rdx
movabsq $0x165667b19e3779f9, %rcx # imm = 0x165667B19E3779F9
addq %rdx, %rcx
movzbl 0x4(%rsi), %edi
imulq %r8, %rdi
xorq %rcx, %rdi
jmp 0x2d8d6
movq (%rsi), %rdx
imulq %rcx, %rdx
rolq $0x1f, %rdx
imulq %rax, %rdx
xorq %rdi, %rdx
rolq $0x1b, %rdx
addq $0x8, %rsi
imulq %rax, %rdx
addq %r9, %rdx
movq %rdx, %rdi
movq (%rsi), %rdx
imulq %rcx, %rdx
rolq $0x1f, %rdx
imulq %rax, %rdx
xorq %rdi, %rdx
rolq $0x1b, %rdx
addq $0x8, %rsi
imulq %rax, %rdx
addq %r9, %rdx
movq %rdx, %rdi
imulq (%rsi), %rcx
rolq $0x1f, %rcx
imulq %rax, %rcx
xorq %rdi, %rcx
rolq $0x1b, %rcx
imulq %rax, %rcx
addq %r9, %rcx
movzbl 0x8(%rsi), %edx
imulq %r8, %rdx
xorq %rcx, %rdx
rolq $0xb, %rdx
imulq %rax, %rdx
movzbl 0x9(%rsi), %edi
imulq %r8, %rdi
xorq %rdx, %rdi
rolq $0xb, %rdi
imulq %rax, %rdi
jmp 0x2d8e0