// File: BU-DiSC[P]BF-Shared-Hashing/hash/xxhash.cc
// Function: XXH32_finalize(unsigned int, unsigned char const*, unsigned long, XXH_alignment)
static xxh_u32
XXH32_finalize(xxh_u32 h32, const xxh_u8* ptr, size_t len, XXH_alignment align)
{
#define PROCESS1               \
    h32 += (*ptr++) * PRIME32_5; \
    h32 = XXH_rotl32(h32, 11) * PRIME32_1 ;

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

    /* Compact rerolled version */
    if (XXH_REROLL) {
        len &= 15;
        while (len >= 4) {
            PROCESS4;
            len -= 4;
        }
        while (len > 0) {
            PROCESS1;
            --len;
        }
        return XXH32_avalanche(h32);
    } else {
         switch(len&15) /* or switch(bEnd - p) */ {
           case 12:      PROCESS4;
                         FALLTHROUGH_INTENDED;
                         /* fallthrough */
           case 8:       PROCESS4;
                         FALLTHROUGH_INTENDED;
                         /* fallthrough */
           case 4:       PROCESS4;
                         return XXH32_avalanche(h32);

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

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

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

// Assembly:
subq $0x1a8, %rsp            # imm = 0x1A8
movl %edi, 0x24(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movl %ecx, 0xc(%rsp)
movq 0x10(%rsp), %rax
andl $0xf, %eax
movq %rax, (%rsp)
subq $0xf, %rax
ja 0x4dfea
movq (%rsp), %rax
leaq 0x17d46(%rip), %rcx     # 0x65580
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x18(%rsp), %rcx
movl 0xc(%rsp), %eax
movq %rcx, 0x190(%rsp)
movl %eax, 0x18c(%rsp)
cmpl $0x1, 0x18c(%rsp)
jne 0x4d88b
movq 0x190(%rsp), %rax
movq %rax, 0x1a0(%rsp)
movq 0x1a0(%rsp), %rdi
callq 0x5fa70
movl %eax, 0x19c(%rsp)
jmp 0x4d89c
movq 0x190(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x19c(%rsp)
imull $0xc2b2ae3d, 0x19c(%rsp), %eax # imm = 0xC2B2AE3D
addl 0x24(%rsp), %eax
movl %eax, 0x24(%rsp)
movq 0x18(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x18(%rsp)
movl 0x24(%rsp), %eax
roll $0x11, %eax
imull $0x27d4eb2f, %eax, %eax # imm = 0x27D4EB2F
movl %eax, 0x24(%rsp)
movq 0x18(%rsp), %rcx
movl 0xc(%rsp), %eax
movq %rcx, 0x170(%rsp)
movl %eax, 0x16c(%rsp)
cmpl $0x1, 0x16c(%rsp)
jne 0x4d916
movq 0x170(%rsp), %rax
movq %rax, 0x180(%rsp)
movq 0x180(%rsp), %rdi
callq 0x5fa70
movl %eax, 0x17c(%rsp)
jmp 0x4d927
movq 0x170(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x17c(%rsp)
imull $0xc2b2ae3d, 0x17c(%rsp), %eax # imm = 0xC2B2AE3D
addl 0x24(%rsp), %eax
movl %eax, 0x24(%rsp)
movq 0x18(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x18(%rsp)
movl 0x24(%rsp), %eax
roll $0x11, %eax
imull $0x27d4eb2f, %eax, %eax # imm = 0x27D4EB2F
movl %eax, 0x24(%rsp)
movq 0x18(%rsp), %rcx
movl 0xc(%rsp), %eax
movq %rcx, 0x150(%rsp)
movl %eax, 0x14c(%rsp)
cmpl $0x1, 0x14c(%rsp)
jne 0x4d9a1
movq 0x150(%rsp), %rax
movq %rax, 0x160(%rsp)
movq 0x160(%rsp), %rdi
callq 0x5fa70
movl %eax, 0x15c(%rsp)
jmp 0x4d9b2
movq 0x150(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x15c(%rsp)
imull $0xc2b2ae3d, 0x15c(%rsp), %eax # imm = 0xC2B2AE3D
addl 0x24(%rsp), %eax
movl %eax, 0x24(%rsp)
movq 0x18(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x18(%rsp)
movl 0x24(%rsp), %eax
roll $0x11, %eax
imull $0x27d4eb2f, %eax, %eax # imm = 0x27D4EB2F
movl %eax, 0x24(%rsp)
movl 0x24(%rsp), %edi
callq 0x5fa90
movl %eax, 0x28(%rsp)
jmp 0x4dff2
movq 0x18(%rsp), %rcx
movl 0xc(%rsp), %eax
movq %rcx, 0x130(%rsp)
movl %eax, 0x12c(%rsp)
cmpl $0x1, 0x12c(%rsp)
jne 0x4da3e
movq 0x130(%rsp), %rax
movq %rax, 0x140(%rsp)
movq 0x140(%rsp), %rdi
callq 0x5fa70
movl %eax, 0x13c(%rsp)
jmp 0x4da4f
movq 0x130(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x13c(%rsp)
imull $0xc2b2ae3d, 0x13c(%rsp), %eax # imm = 0xC2B2AE3D
addl 0x24(%rsp), %eax
movl %eax, 0x24(%rsp)
movq 0x18(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x18(%rsp)
movl 0x24(%rsp), %eax
roll $0x11, %eax
imull $0x27d4eb2f, %eax, %eax # imm = 0x27D4EB2F
movl %eax, 0x24(%rsp)
movq 0x18(%rsp), %rcx
movl 0xc(%rsp), %eax
movq %rcx, 0x110(%rsp)
movl %eax, 0x10c(%rsp)
cmpl $0x1, 0x10c(%rsp)
jne 0x4dac9
movq 0x110(%rsp), %rax
movq %rax, 0x120(%rsp)
movq 0x120(%rsp), %rdi
callq 0x5fa70
movl %eax, 0x11c(%rsp)
jmp 0x4dada
movq 0x110(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x11c(%rsp)
imull $0xc2b2ae3d, 0x11c(%rsp), %eax # imm = 0xC2B2AE3D
addl 0x24(%rsp), %eax
movl %eax, 0x24(%rsp)
movq 0x18(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x18(%rsp)
movl 0x24(%rsp), %eax
roll $0x11, %eax
imull $0x27d4eb2f, %eax, %eax # imm = 0x27D4EB2F
movl %eax, 0x24(%rsp)
movq 0x18(%rsp), %rcx
movl 0xc(%rsp), %eax
movq %rcx, 0xf0(%rsp)
movl %eax, 0xec(%rsp)
cmpl $0x1, 0xec(%rsp)
jne 0x4db54
movq 0xf0(%rsp), %rax
movq %rax, 0x100(%rsp)
movq 0x100(%rsp), %rdi
callq 0x5fa70
movl %eax, 0xfc(%rsp)
jmp 0x4db65
movq 0xf0(%rsp), %rax
movl (%rax), %eax
movl %eax, 0xfc(%rsp)
imull $0xc2b2ae3d, 0xfc(%rsp), %eax # imm = 0xC2B2AE3D
addl 0x24(%rsp), %eax
movl %eax, 0x24(%rsp)
movq 0x18(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x18(%rsp)
movl 0x24(%rsp), %eax
roll $0x11, %eax
imull $0x27d4eb2f, %eax, %eax # imm = 0x27D4EB2F
movl %eax, 0x24(%rsp)
movq 0x18(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x18(%rsp)
movzbl (%rax), %eax
imull $0x165667b1, %eax, %eax # imm = 0x165667B1
addl 0x24(%rsp), %eax
movl %eax, 0x24(%rsp)
movl 0x24(%rsp), %eax
roll $0xb, %eax
imull $0x9e3779b1, %eax, %eax # imm = 0x9E3779B1
movl %eax, 0x24(%rsp)
movl 0x24(%rsp), %edi
callq 0x5fa90
movl %eax, 0x28(%rsp)
jmp 0x4dff2
movq 0x18(%rsp), %rcx
movl 0xc(%rsp), %eax
movq %rcx, 0xd0(%rsp)
movl %eax, 0xcc(%rsp)
cmpl $0x1, 0xcc(%rsp)
jne 0x4dc24
movq 0xd0(%rsp), %rax
movq %rax, 0xe0(%rsp)
movq 0xe0(%rsp), %rdi
callq 0x5fa70
movl %eax, 0xdc(%rsp)
jmp 0x4dc35
movq 0xd0(%rsp), %rax
movl (%rax), %eax
movl %eax, 0xdc(%rsp)
imull $0xc2b2ae3d, 0xdc(%rsp), %eax # imm = 0xC2B2AE3D
addl 0x24(%rsp), %eax
movl %eax, 0x24(%rsp)
movq 0x18(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x18(%rsp)
movl 0x24(%rsp), %eax
roll $0x11, %eax
imull $0x27d4eb2f, %eax, %eax # imm = 0x27D4EB2F
movl %eax, 0x24(%rsp)
movq 0x18(%rsp), %rcx
movl 0xc(%rsp), %eax
movq %rcx, 0xb0(%rsp)
movl %eax, 0xac(%rsp)
cmpl $0x1, 0xac(%rsp)
jne 0x4dcaf
movq 0xb0(%rsp), %rax
movq %rax, 0xc0(%rsp)
movq 0xc0(%rsp), %rdi
callq 0x5fa70
movl %eax, 0xbc(%rsp)
jmp 0x4dcc0
movq 0xb0(%rsp), %rax
movl (%rax), %eax
movl %eax, 0xbc(%rsp)
imull $0xc2b2ae3d, 0xbc(%rsp), %eax # imm = 0xC2B2AE3D
addl 0x24(%rsp), %eax
movl %eax, 0x24(%rsp)
movq 0x18(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x18(%rsp)
movl 0x24(%rsp), %eax
roll $0x11, %eax
imull $0x27d4eb2f, %eax, %eax # imm = 0x27D4EB2F
movl %eax, 0x24(%rsp)
movq 0x18(%rsp), %rcx
movl 0xc(%rsp), %eax
movq %rcx, 0x90(%rsp)
movl %eax, 0x8c(%rsp)
cmpl $0x1, 0x8c(%rsp)
jne 0x4dd3a
movq 0x90(%rsp), %rax
movq %rax, 0xa0(%rsp)
movq 0xa0(%rsp), %rdi
callq 0x5fa70
movl %eax, 0x9c(%rsp)
jmp 0x4dd4b
movq 0x90(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x9c(%rsp)
imull $0xc2b2ae3d, 0x9c(%rsp), %eax # imm = 0xC2B2AE3D
addl 0x24(%rsp), %eax
movl %eax, 0x24(%rsp)
movq 0x18(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x18(%rsp)
movl 0x24(%rsp), %eax
roll $0x11, %eax
imull $0x27d4eb2f, %eax, %eax # imm = 0x27D4EB2F
movl %eax, 0x24(%rsp)
movq 0x18(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x18(%rsp)
movzbl (%rax), %eax
imull $0x165667b1, %eax, %eax # imm = 0x165667B1
addl 0x24(%rsp), %eax
movl %eax, 0x24(%rsp)
movl 0x24(%rsp), %eax
roll $0xb, %eax
imull $0x9e3779b1, %eax, %eax # imm = 0x9E3779B1
movl %eax, 0x24(%rsp)
movq 0x18(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x18(%rsp)
movzbl (%rax), %eax
imull $0x165667b1, %eax, %eax # imm = 0x165667B1
addl 0x24(%rsp), %eax
movl %eax, 0x24(%rsp)
movl 0x24(%rsp), %eax
roll $0xb, %eax
imull $0x9e3779b1, %eax, %eax # imm = 0x9E3779B1
movl %eax, 0x24(%rsp)
movl 0x24(%rsp), %edi
callq 0x5fa90
movl %eax, 0x28(%rsp)
jmp 0x4dff2
movq 0x18(%rsp), %rcx
movl 0xc(%rsp), %eax
movq %rcx, 0x70(%rsp)
movl %eax, 0x6c(%rsp)
cmpl $0x1, 0x6c(%rsp)
jne 0x4de2e
movq 0x70(%rsp), %rax
movq %rax, 0x80(%rsp)
movq 0x80(%rsp), %rdi
callq 0x5fa70
movl %eax, 0x7c(%rsp)
jmp 0x4de39
movq 0x70(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x7c(%rsp)
imull $0xc2b2ae3d, 0x7c(%rsp), %eax # imm = 0xC2B2AE3D
addl 0x24(%rsp), %eax
movl %eax, 0x24(%rsp)
movq 0x18(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x18(%rsp)
movl 0x24(%rsp), %eax
roll $0x11, %eax
imull $0x27d4eb2f, %eax, %eax # imm = 0x27D4EB2F
movl %eax, 0x24(%rsp)
movq 0x18(%rsp), %rcx
movl 0xc(%rsp), %eax
movq %rcx, 0x50(%rsp)
movl %eax, 0x4c(%rsp)
cmpl $0x1, 0x4c(%rsp)
jne 0x4de9b
movq 0x50(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0x60(%rsp), %rdi
callq 0x5fa70
movl %eax, 0x5c(%rsp)
jmp 0x4dea6
movq 0x50(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x5c(%rsp)
imull $0xc2b2ae3d, 0x5c(%rsp), %eax # imm = 0xC2B2AE3D
addl 0x24(%rsp), %eax
movl %eax, 0x24(%rsp)
movq 0x18(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x18(%rsp)
movl 0x24(%rsp), %eax
roll $0x11, %eax
imull $0x27d4eb2f, %eax, %eax # imm = 0x27D4EB2F
movl %eax, 0x24(%rsp)
movq 0x18(%rsp), %rcx
movl 0xc(%rsp), %eax
movq %rcx, 0x30(%rsp)
movl %eax, 0x2c(%rsp)
cmpl $0x1, 0x2c(%rsp)
jne 0x4df08
movq 0x30(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rdi
callq 0x5fa70
movl %eax, 0x3c(%rsp)
jmp 0x4df13
movq 0x30(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x3c(%rsp)
imull $0xc2b2ae3d, 0x3c(%rsp), %eax # imm = 0xC2B2AE3D
addl 0x24(%rsp), %eax
movl %eax, 0x24(%rsp)
movq 0x18(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x18(%rsp)
movl 0x24(%rsp), %eax
roll $0x11, %eax
imull $0x27d4eb2f, %eax, %eax # imm = 0x27D4EB2F
movl %eax, 0x24(%rsp)
movq 0x18(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x18(%rsp)
movzbl (%rax), %eax
imull $0x165667b1, %eax, %eax # imm = 0x165667B1
addl 0x24(%rsp), %eax
movl %eax, 0x24(%rsp)
movl 0x24(%rsp), %eax
roll $0xb, %eax
imull $0x9e3779b1, %eax, %eax # imm = 0x9E3779B1
movl %eax, 0x24(%rsp)
movq 0x18(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x18(%rsp)
movzbl (%rax), %eax
imull $0x165667b1, %eax, %eax # imm = 0x165667B1
addl 0x24(%rsp), %eax
movl %eax, 0x24(%rsp)
movl 0x24(%rsp), %eax
roll $0xb, %eax
imull $0x9e3779b1, %eax, %eax # imm = 0x9E3779B1
movl %eax, 0x24(%rsp)
movq 0x18(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x18(%rsp)
movzbl (%rax), %eax
imull $0x165667b1, %eax, %eax # imm = 0x165667B1
addl 0x24(%rsp), %eax
movl %eax, 0x24(%rsp)
movl 0x24(%rsp), %eax
roll $0xb, %eax
imull $0x9e3779b1, %eax, %eax # imm = 0x9E3779B1
movl %eax, 0x24(%rsp)
movl 0x24(%rsp), %edi
callq 0x5fa90
movl %eax, 0x28(%rsp)
jmp 0x4dff2
movl 0x24(%rsp), %eax
movl %eax, 0x28(%rsp)
movl 0x28(%rsp), %eax
addq $0x1a8, %rsp            # imm = 0x1A8
retq
nop