// File: sgielen[P]clife/./xxhash/xxhash.h
// Function: XXH3_scrambleAcc_sse2(void*, void const*)
XXH_FORCE_INLINE XXH_TARGET_SSE2 void
XXH3_scrambleAcc_sse2(void* XXH_RESTRICT acc, const void* XXH_RESTRICT secret)
{
    XXH_ASSERT((((size_t)acc) & 15) == 0);
    {   __m128i* const xacc = (__m128i*) acc;
        /* Unaligned. This is mainly for pointer arithmetic, and because
         * _mm_loadu_si128 requires a const __m128i * pointer for some reason. */
        const         __m128i* const xsecret = (const __m128i *) secret;
        const __m128i prime32 = _mm_set1_epi32((int)XXH_PRIME32_1);

        size_t i;
        for (i=0; i < XXH_STRIPE_LEN/sizeof(__m128i); i++) {
            /* xacc[i] ^= (xacc[i] >> 47) */
            __m128i const acc_vec     = xacc[i];
            __m128i const shifted     = _mm_srli_epi64    (acc_vec, 47);
            __m128i const data_vec    = _mm_xor_si128     (acc_vec, shifted);
            /* xacc[i] ^= xsecret[i]; */
            __m128i const key_vec     = _mm_loadu_si128   (xsecret+i);
            __m128i const data_key    = _mm_xor_si128     (data_vec, key_vec);

            /* xacc[i] *= XXH_PRIME32_1; */
            __m128i const data_key_hi = _mm_shuffle_epi32 (data_key, _MM_SHUFFLE(0, 3, 0, 1));
            __m128i const prod_lo     = _mm_mul_epu32     (data_key, prime32);
            __m128i const prod_hi     = _mm_mul_epu32     (data_key_hi, prime32);
            xacc[i] = _mm_add_epi64(prod_lo, _mm_slli_epi64(prod_hi, 32));
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movq %rdi, -0x118(%rbp)
movq %rsi, -0x120(%rbp)
movq -0x118(%rbp), %rax
movq %rax, -0x128(%rbp)
movq -0x120(%rbp), %rax
movq %rax, -0x130(%rbp)
movl $0x9e3779b1, -0x58(%rbp) # imm = 0x9E3779B1
movl -0x58(%rbp), %eax
movl %eax, -0x4(%rbp)
movl %eax, -0x8(%rbp)
movl %eax, -0xc(%rbp)
movl %eax, -0x10(%rbp)
movd -0x4(%rbp), %xmm0
movd -0x8(%rbp), %xmm1
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movd -0xc(%rbp), %xmm2
movd -0x10(%rbp), %xmm0
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
punpcklqdq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0]
movdqa %xmm0, -0x20(%rbp)
movdqa -0x20(%rbp), %xmm0
movdqa %xmm0, -0x140(%rbp)
movq $0x0, -0x148(%rbp)
cmpq $0x4, -0x148(%rbp)
jae 0x4843
movq -0x128(%rbp), %rax
movq -0x148(%rbp), %rcx
shlq $0x4, %rcx
movaps (%rax,%rcx), %xmm0
movaps %xmm0, -0x160(%rbp)
movaps -0x160(%rbp), %xmm0
movaps %xmm0, -0x50(%rbp)
movl $0x2f, -0x54(%rbp)
movaps -0x50(%rbp), %xmm0
movd -0x54(%rbp), %xmm1
psrlq %xmm1, %xmm0
movaps %xmm0, -0x170(%rbp)
movaps -0x160(%rbp), %xmm1
movaps -0x170(%rbp), %xmm0
movaps %xmm1, -0xb0(%rbp)
movaps %xmm0, -0xc0(%rbp)
movaps -0xb0(%rbp), %xmm0
movaps -0xc0(%rbp), %xmm1
pxor %xmm1, %xmm0
movaps %xmm0, -0x180(%rbp)
movq -0x130(%rbp), %rax
movq -0x148(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0xe8(%rbp)
movq -0xe8(%rbp), %rax
movups (%rax), %xmm0
movaps %xmm0, -0x190(%rbp)
movaps -0x180(%rbp), %xmm1
movaps -0x190(%rbp), %xmm0
movaps %xmm1, -0xd0(%rbp)
movaps %xmm0, -0xe0(%rbp)
movaps -0xd0(%rbp), %xmm0
movaps -0xe0(%rbp), %xmm1
pxor %xmm1, %xmm0
movaps %xmm0, -0x1a0(%rbp)
movaps -0x1a0(%rbp), %xmm0
pshufd $0x31, %xmm0, %xmm0     # xmm0 = xmm0[1,0,3,0]
movaps %xmm0, -0x1b0(%rbp)
movaps -0x1a0(%rbp), %xmm1
movaps -0x140(%rbp), %xmm0
movaps %xmm1, -0x70(%rbp)
movaps %xmm0, -0x80(%rbp)
movaps -0x70(%rbp), %xmm0
movaps -0x80(%rbp), %xmm1
pmuludq %xmm1, %xmm0
movaps %xmm0, -0x1c0(%rbp)
movaps -0x1b0(%rbp), %xmm1
movaps -0x140(%rbp), %xmm0
movaps %xmm1, -0x90(%rbp)
movaps %xmm0, -0xa0(%rbp)
movaps -0x90(%rbp), %xmm0
movaps -0xa0(%rbp), %xmm1
movaps 0x6863(%rip), %xmm3     # 0xb010
movaps %xmm0, %xmm2
pand %xmm3, %xmm2
movaps %xmm1, %xmm2
pand %xmm3, %xmm2
pmuludq %xmm1, %xmm0
movdqa %xmm0, -0x1d0(%rbp)
movdqa -0x1c0(%rbp), %xmm1
movdqa -0x1d0(%rbp), %xmm0
movdqa %xmm0, -0x30(%rbp)
movl $0x20, -0x34(%rbp)
movdqa -0x30(%rbp), %xmm0
movl -0x34(%rbp), %eax
movd %eax, %xmm2
psllq %xmm2, %xmm0
movdqa %xmm1, -0x100(%rbp)
movdqa %xmm0, -0x110(%rbp)
movdqa -0x100(%rbp), %xmm0
paddq -0x110(%rbp), %xmm0
movq -0x128(%rbp), %rax
movq -0x148(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movdqa %xmm0, (%rax)
movq -0x148(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x148(%rbp)
jmp 0x4658
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
nopl (%rax)