// File: /workspace/github_cpp_makefile_star2_O1/mh0fm4[P]SCDC/src/extra/xxhash/xxhash.c
// Function: XXH32_finalize
static U32
XXH32_finalize(U32 h32, const void* ptr, size_t len,
                XXH_endianess endian, XXH_alignment align)

{
    const BYTE* p = (const BYTE*)ptr;
#define PROCESS1             \
    h32 += (*p) * PRIME32_5; \
    p++;                     \
    h32 = XXH_rotl32(h32, 11) * PRIME32_1 ;

#define PROCESS4                         \
    h32 += XXH_get32bits(p) * PRIME32_3; \
    p+=4;                                \
    h32  = XXH_rotl32(h32, 17) * PRIME32_4 ;

    switch(len&15)  /* or switch(bEnd - p) */
    {
      case 12:      PROCESS4;
                    /* fallthrough */
      case 8:       PROCESS4;
                    /* fallthrough */
      case 4:       PROCESS4;
                    return XXH32_avalanche(h32);

      case 13:      PROCESS4;
                    /* fallthrough */
      case 9:       PROCESS4;
                    /* fallthrough */
      case 5:       PROCESS4;
                    PROCESS1;
                    return XXH32_avalanche(h32);

      case 14:      PROCESS4;
                    /* fallthrough */
      case 10:      PROCESS4;
                    /* fallthrough */
      case 6:       PROCESS4;
                    PROCESS1;
                    PROCESS1;
                    return XXH32_avalanche(h32);

      case 15:      PROCESS4;
                    /* fallthrough */
      case 11:      PROCESS4;
                    /* fallthrough */
      case 7:       PROCESS4;
                    /* fallthrough */
      case 3:       PROCESS1;
                    /* fallthrough */
      case 2:       PROCESS1;
                    /* fallthrough */
      case 1:       PROCESS1;
                    /* fallthrough */
      case 0:       return XXH32_avalanche(h32);
    }
    assert(0);
    return h32;   /* reaching this point is deemed impossible */
}

// Assembly:
andl $0xf, %edx
leaq 0x36727(%rip), %rax     # 0x6bb58
movslq (%rax,%rdx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
imull $0xc2b2ae3d, (%rsi), %eax # imm = 0xC2B2AE3D
addl %edi, %eax
addq $0x4, %rsi
roll $0x11, %eax
imull $0x27d4eb2f, %eax, %edi # imm = 0x27D4EB2F
imull $0xc2b2ae3d, (%rsi), %eax # imm = 0xC2B2AE3D
addl %edi, %eax
addq $0x4, %rsi
roll $0x11, %eax
imull $0x27d4eb2f, %eax, %edi # imm = 0x27D4EB2F
imull $0xc2b2ae3d, (%rsi), %eax # imm = 0xC2B2AE3D
addl %edi, %eax
roll $0x11, %eax
imull $0x27d4eb2f, %eax, %edi # imm = 0x27D4EB2F
jmp 0x355a6
imull $0xc2b2ae3d, (%rsi), %eax # imm = 0xC2B2AE3D
addl %edi, %eax
addq $0x4, %rsi
roll $0x11, %eax
imull $0x27d4eb2f, %eax, %edi # imm = 0x27D4EB2F
imull $0xc2b2ae3d, (%rsi), %eax # imm = 0xC2B2AE3D
addl %edi, %eax
addq $0x4, %rsi
roll $0x11, %eax
imull $0x27d4eb2f, %eax, %edi # imm = 0x27D4EB2F
imull $0xc2b2ae3d, (%rsi), %eax # imm = 0xC2B2AE3D
addl %edi, %eax
roll $0x11, %eax
imull $0x27d4eb2f, %eax, %eax # imm = 0x27D4EB2F
movzbl 0x4(%rsi), %ecx
imull $0x165667b1, %ecx, %ecx # imm = 0x165667B1
addl %eax, %ecx
roll $0xb, %ecx
imull $0x9e3779b1, %ecx, %eax # imm = 0x9E3779B1
movzbl 0x5(%rsi), %ecx
jmp 0x35595
imull $0xc2b2ae3d, (%rsi), %eax # imm = 0xC2B2AE3D
addl %edi, %eax
addq $0x4, %rsi
roll $0x11, %eax
imull $0x27d4eb2f, %eax, %edi # imm = 0x27D4EB2F
imull $0xc2b2ae3d, (%rsi), %eax # imm = 0xC2B2AE3D
addl %edi, %eax
addq $0x4, %rsi
roll $0x11, %eax
imull $0x27d4eb2f, %eax, %edi # imm = 0x27D4EB2F
imull $0xc2b2ae3d, (%rsi), %eax # imm = 0xC2B2AE3D
addl %edi, %eax
addq $0x4, %rsi
roll $0x11, %eax
imull $0x27d4eb2f, %eax, %edi # imm = 0x27D4EB2F
movzbl (%rsi), %eax
imull $0x165667b1, %eax, %eax # imm = 0x165667B1
addl %edi, %eax
incq %rsi
roll $0xb, %eax
imull $0x9e3779b1, %eax, %edi # imm = 0x9E3779B1
movzbl (%rsi), %eax
imull $0x165667b1, %eax, %eax # imm = 0x165667B1
addl %edi, %eax
incq %rsi
roll $0xb, %eax
imull $0x9e3779b1, %eax, %edi # imm = 0x9E3779B1
movzbl (%rsi), %eax
imull $0x165667b1, %eax, %eax # imm = 0x165667B1
addl %edi, %eax
roll $0xb, %eax
imull $0x9e3779b1, %eax, %edi # imm = 0x9E3779B1
jmp 0x355a6
imull $0xc2b2ae3d, (%rsi), %eax # imm = 0xC2B2AE3D
addl %edi, %eax
addq $0x4, %rsi
roll $0x11, %eax
imull $0x27d4eb2f, %eax, %edi # imm = 0x27D4EB2F
imull $0xc2b2ae3d, (%rsi), %eax # imm = 0xC2B2AE3D
addl %edi, %eax
addq $0x4, %rsi
roll $0x11, %eax
imull $0x27d4eb2f, %eax, %edi # imm = 0x27D4EB2F
imull $0xc2b2ae3d, (%rsi), %eax # imm = 0xC2B2AE3D
addl %edi, %eax
roll $0x11, %eax
imull $0x27d4eb2f, %eax, %eax # imm = 0x27D4EB2F
movzbl 0x4(%rsi), %ecx
imull $0x165667b1, %ecx, %ecx # imm = 0x165667B1
addl %eax, %ecx
roll $0xb, %ecx
imull $0x9e3779b1, %ecx, %edi # imm = 0x9E3779B1
movl %edi, %eax
shrl $0xf, %eax
xorl %edi, %eax
imull $0x85ebca77, %eax, %eax # imm = 0x85EBCA77
movl %eax, %ecx
shrl $0xd, %ecx
xorl %eax, %ecx
imull $0xc2b2ae3d, %ecx, %ecx # imm = 0xC2B2AE3D
movl %ecx, %eax
shrl $0x10, %eax
xorl %ecx, %eax
retq