// File: sgielen[P]clife/./xxhash/xxhash.h
// Function: XXH32_endian_align(unsigned char const*, unsigned long, unsigned int, XXH_alignment)
XXH_FORCE_INLINE XXH_PUREF xxh_u32
XXH32_endian_align(const xxh_u8* input, size_t len, xxh_u32 seed, XXH_alignment align)
{
    xxh_u32 h32;

    if (input==NULL) XXH_ASSERT(len == 0);

    if (len>=16) {
        const xxh_u8* const bEnd = input + len;
        const xxh_u8* const limit = bEnd - 15;
        xxh_u32 v1 = seed + XXH_PRIME32_1 + XXH_PRIME32_2;
        xxh_u32 v2 = seed + XXH_PRIME32_2;
        xxh_u32 v3 = seed + 0;
        xxh_u32 v4 = seed - XXH_PRIME32_1;

        do {
            v1 = XXH32_round(v1, XXH_get32bits(input)); input += 4;
            v2 = XXH32_round(v2, XXH_get32bits(input)); input += 4;
            v3 = XXH32_round(v3, XXH_get32bits(input)); input += 4;
            v4 = XXH32_round(v4, XXH_get32bits(input)); input += 4;
        } while (input < limit);

        h32 = XXH_rotl32(v1, 1)  + XXH_rotl32(v2, 7)
            + XXH_rotl32(v3, 12) + XXH_rotl32(v4, 18);
    } else {
        h32  = seed + XXH_PRIME32_5;
    }

    h32 += (xxh_u32)len;

    return XXH32_finalize(h32, input, len&15, align);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x23cf
jmp 0x23cf
cmpq $0x10, -0x10(%rbp)
jb 0x24fd
movq -0x8(%rbp), %rax
addq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
addq $-0xf, %rax
movq %rax, -0x30(%rbp)
movl -0x14(%rbp), %eax
addl $0x9e3779b1, %eax       # imm = 0x9E3779B1
addl $0x85ebca77, %eax       # imm = 0x85EBCA77
movl %eax, -0x34(%rbp)
movl -0x14(%rbp), %eax
addl $0x85ebca77, %eax       # imm = 0x85EBCA77
movl %eax, -0x38(%rbp)
movl -0x14(%rbp), %eax
addl $0x0, %eax
movl %eax, -0x3c(%rbp)
movl -0x14(%rbp), %eax
subl $0x9e3779b1, %eax       # imm = 0x9E3779B1
movl %eax, -0x40(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x50(%rbp)
movq -0x8(%rbp), %rdi
movl -0x18(%rbp), %esi
callq 0x5c90
movl -0x50(%rbp), %edi
movl %eax, %esi
callq 0x29b0
movl %eax, -0x34(%rbp)
movq -0x8(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x8(%rbp)
movl -0x38(%rbp), %eax
movl %eax, -0x4c(%rbp)
movq -0x8(%rbp), %rdi
movl -0x18(%rbp), %esi
callq 0x5c90
movl -0x4c(%rbp), %edi
movl %eax, %esi
callq 0x29b0
movl %eax, -0x38(%rbp)
movq -0x8(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x8(%rbp)
movl -0x3c(%rbp), %eax
movl %eax, -0x48(%rbp)
movq -0x8(%rbp), %rdi
movl -0x18(%rbp), %esi
callq 0x5c90
movl -0x48(%rbp), %edi
movl %eax, %esi
callq 0x29b0
movl %eax, -0x3c(%rbp)
movq -0x8(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x8(%rbp)
movl -0x40(%rbp), %eax
movl %eax, -0x44(%rbp)
movq -0x8(%rbp), %rdi
movl -0x18(%rbp), %esi
callq 0x5c90
movl -0x44(%rbp), %edi
movl %eax, %esi
callq 0x29b0
movl %eax, -0x40(%rbp)
movq -0x8(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpq -0x30(%rbp), %rax
jb 0x2421
movl -0x34(%rbp), %eax
roll %eax
movl -0x38(%rbp), %ecx
roll $0x7, %ecx
addl %ecx, %eax
movl -0x3c(%rbp), %ecx
roll $0xc, %ecx
addl %ecx, %eax
movl -0x40(%rbp), %ecx
roll $0x12, %ecx
addl %ecx, %eax
movl %eax, -0x1c(%rbp)
jmp 0x2508
movl -0x14(%rbp), %eax
addl $0x165667b1, %eax       # imm = 0x165667B1
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rax
addl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %edi
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rdx
andq $0xf, %rdx
movl -0x18(%rbp), %ecx
callq 0x2a90
addq $0x50, %rsp
popq %rbp
retq
nop