#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_loadu_si128(int /*<<< orphan*/ *);
int /*<<< orphan*/ _mm_xor_si128(int /*<<< orphan*/ const, int /*<<< orphan*/);
void load_xor_and_store_eight(__m128i *out, const __m128i *in,
                              const __m128i *states) {
  out[0] = _mm_xor_si128(states[0], _mm_loadu_si128((__m128i *)in));
  out[1] = _mm_xor_si128(states[1], _mm_loadu_si128((__m128i *)in + 1));
  out[2] = _mm_xor_si128(states[2], _mm_loadu_si128((__m128i *)in + 2));
  out[3] = _mm_xor_si128(states[3], _mm_loadu_si128((__m128i *)in + 3));
  out[4] = _mm_xor_si128(states[4], _mm_loadu_si128((__m128i *)in + 4));
  out[5] = _mm_xor_si128(states[5], _mm_loadu_si128((__m128i *)in + 5));
  out[6] = _mm_xor_si128(states[6], _mm_loadu_si128((__m128i *)in + 6));
  out[7] = _mm_xor_si128(states[7], _mm_loadu_si128((__m128i *)in + 7));
}


x86 assembly (clang, -O0):
<load_xor_and_store_eight>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x38(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <_mm_loadu_si128@plt>
mov    -0x38(%rbp),%edi
mov    %eax,%esi
call   1030 <_mm_xor_si128@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x34(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x4,%rdi
call   1040 <_mm_loadu_si128@plt>
mov    -0x34(%rbp),%edi
mov    %eax,%esi
call   1030 <_mm_xor_si128@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%eax
mov    %eax,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x8,%rdi
call   1040 <_mm_loadu_si128@plt>
mov    -0x30(%rbp),%edi
mov    %eax,%esi
call   1030 <_mm_xor_si128@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x18(%rbp),%rax
mov    0xc(%rax),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%rdi
add    $0xc,%rdi
call   1040 <_mm_loadu_si128@plt>
mov    -0x2c(%rbp),%edi
mov    %eax,%esi
call   1030 <_mm_xor_si128@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%eax
mov    %eax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x10,%rdi
call   1040 <_mm_loadu_si128@plt>
mov    -0x28(%rbp),%edi
mov    %eax,%esi
call   1030 <_mm_xor_si128@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x10(%rax)
mov    -0x18(%rbp),%rax
mov    0x14(%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x14,%rdi
call   1040 <_mm_loadu_si128@plt>
mov    -0x24(%rbp),%edi
mov    %eax,%esi
call   1030 <_mm_xor_si128@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x14(%rax)
mov    -0x18(%rbp),%rax
mov    0x18(%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x18,%rdi
call   1040 <_mm_loadu_si128@plt>
mov    -0x20(%rbp),%edi
mov    %eax,%esi
call   1030 <_mm_xor_si128@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x18(%rax)
mov    -0x18(%rbp),%rax
mov    0x1c(%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1c,%rdi
call   1040 <_mm_loadu_si128@plt>
mov    -0x1c(%rbp),%edi
mov    %eax,%esi
call   1030 <_mm_xor_si128@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x1c(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<load_xor_and_store_eight>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %rdi,%r14
mov    (%rdx),%ebp
mov    %rsi,%rdi
call   1040 <_mm_loadu_si128@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1030 <_mm_xor_si128@plt>
mov    %eax,(%r14)
mov    0x4(%r15),%ebp
lea    0x4(%rbx),%rdi
call   1040 <_mm_loadu_si128@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1030 <_mm_xor_si128@plt>
mov    %eax,0x4(%r14)
mov    0x8(%r15),%ebp
lea    0x8(%rbx),%rdi
call   1040 <_mm_loadu_si128@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1030 <_mm_xor_si128@plt>
mov    %eax,0x8(%r14)
mov    0xc(%r15),%ebp
lea    0xc(%rbx),%rdi
call   1040 <_mm_loadu_si128@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1030 <_mm_xor_si128@plt>
mov    %eax,0xc(%r14)
mov    0x10(%r15),%ebp
lea    0x10(%rbx),%rdi
call   1040 <_mm_loadu_si128@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1030 <_mm_xor_si128@plt>
mov    %eax,0x10(%r14)
mov    0x14(%r15),%ebp
lea    0x14(%rbx),%rdi
call   1040 <_mm_loadu_si128@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1030 <_mm_xor_si128@plt>
mov    %eax,0x14(%r14)
mov    0x18(%r15),%ebp
lea    0x18(%rbx),%rdi
call   1040 <_mm_loadu_si128@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1030 <_mm_xor_si128@plt>
mov    %eax,0x18(%r14)
mov    0x1c(%r15),%ebp
add    $0x1c,%rbx
mov    %rbx,%rdi
call   1040 <_mm_loadu_si128@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1030 <_mm_xor_si128@plt>
mov    %eax,0x1c(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @load_xor_and_store_eight(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %6
%8 = getelementptr inbounds i32, i32* %7, i64 0
%9 = load i32, i32* %8
%10 = load i32*, i32** %5
%11 = call i32 @_mm_loadu_si128(i32* %10)
%12 = call i32 @_mm_xor_si128(i32 %9, i32 %11)
%13 = load i32*, i32** %4
%14 = getelementptr inbounds i32, i32* %13, i64 0
store i32 %12, i32* %14
%15 = load i32*, i32** %6
%16 = getelementptr inbounds i32, i32* %15, i64 1
%17 = load i32, i32* %16
%18 = load i32*, i32** %5
%19 = getelementptr inbounds i32, i32* %18, i64 1
%20 = call i32 @_mm_loadu_si128(i32* %19)
%21 = call i32 @_mm_xor_si128(i32 %17, i32 %20)
%22 = load i32*, i32** %4
%23 = getelementptr inbounds i32, i32* %22, i64 1
store i32 %21, i32* %23
%24 = load i32*, i32** %6
%25 = getelementptr inbounds i32, i32* %24, i64 2
%26 = load i32, i32* %25
%27 = load i32*, i32** %5
%28 = getelementptr inbounds i32, i32* %27, i64 2
%29 = call i32 @_mm_loadu_si128(i32* %28)
%30 = call i32 @_mm_xor_si128(i32 %26, i32 %29)
%31 = load i32*, i32** %4
%32 = getelementptr inbounds i32, i32* %31, i64 2
store i32 %30, i32* %32
%33 = load i32*, i32** %6
%34 = getelementptr inbounds i32, i32* %33, i64 3
%35 = load i32, i32* %34
%36 = load i32*, i32** %5
%37 = getelementptr inbounds i32, i32* %36, i64 3
%38 = call i32 @_mm_loadu_si128(i32* %37)
%39 = call i32 @_mm_xor_si128(i32 %35, i32 %38)
%40 = load i32*, i32** %4
%41 = getelementptr inbounds i32, i32* %40, i64 3
store i32 %39, i32* %41
%42 = load i32*, i32** %6
%43 = getelementptr inbounds i32, i32* %42, i64 4
%44 = load i32, i32* %43
%45 = load i32*, i32** %5
%46 = getelementptr inbounds i32, i32* %45, i64 4
%47 = call i32 @_mm_loadu_si128(i32* %46)
%48 = call i32 @_mm_xor_si128(i32 %44, i32 %47)
%49 = load i32*, i32** %4
%50 = getelementptr inbounds i32, i32* %49, i64 4
store i32 %48, i32* %50
%51 = load i32*, i32** %6
%52 = getelementptr inbounds i32, i32* %51, i64 5
%53 = load i32, i32* %52
%54 = load i32*, i32** %5
%55 = getelementptr inbounds i32, i32* %54, i64 5
%56 = call i32 @_mm_loadu_si128(i32* %55)
%57 = call i32 @_mm_xor_si128(i32 %53, i32 %56)
%58 = load i32*, i32** %4
%59 = getelementptr inbounds i32, i32* %58, i64 5
store i32 %57, i32* %59
%60 = load i32*, i32** %6
%61 = getelementptr inbounds i32, i32* %60, i64 6
%62 = load i32, i32* %61
%63 = load i32*, i32** %5
%64 = getelementptr inbounds i32, i32* %63, i64 6
%65 = call i32 @_mm_loadu_si128(i32* %64)
%66 = call i32 @_mm_xor_si128(i32 %62, i32 %65)
%67 = load i32*, i32** %4
%68 = getelementptr inbounds i32, i32* %67, i64 6
store i32 %66, i32* %68
%69 = load i32*, i32** %6
%70 = getelementptr inbounds i32, i32* %69, i64 7
%71 = load i32, i32* %70
%72 = load i32*, i32** %5
%73 = getelementptr inbounds i32, i32* %72, i64 7
%74 = call i32 @_mm_loadu_si128(i32* %73)
%75 = call i32 @_mm_xor_si128(i32 %71, i32 %74)
%76 = load i32*, i32** %4
%77 = getelementptr inbounds i32, i32* %76, i64 7
store i32 %75, i32* %77
ret void
}

LLVM IR (-O2):
define void @load_xor_and_store_eight(i32* nocapture writeonly %0, i32* %1, i32* nocapture %2) {
%4 = load i32, i32* %2
%5 = tail call i32 @_mm_loadu_si128(i32* %1)
%6 = tail call i32 @_mm_xor_si128(i32 %4, i32 %5)
store i32 %6, i32* %0
%7 = getelementptr inbounds i32, i32* %2, i64 1
%8 = load i32, i32* %7
%9 = getelementptr inbounds i32, i32* %1, i64 1
%10 = tail call i32 @_mm_loadu_si128(i32* %9)
%11 = tail call i32 @_mm_xor_si128(i32 %8, i32 %10)
%12 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %11, i32* %12
%13 = getelementptr inbounds i32, i32* %2, i64 2
%14 = load i32, i32* %13
%15 = getelementptr inbounds i32, i32* %1, i64 2
%16 = tail call i32 @_mm_loadu_si128(i32* %15)
%17 = tail call i32 @_mm_xor_si128(i32 %14, i32 %16)
%18 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %17, i32* %18
%19 = getelementptr inbounds i32, i32* %2, i64 3
%20 = load i32, i32* %19
%21 = getelementptr inbounds i32, i32* %1, i64 3
%22 = tail call i32 @_mm_loadu_si128(i32* %21)
%23 = tail call i32 @_mm_xor_si128(i32 %20, i32 %22)
%24 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %23, i32* %24
%25 = getelementptr inbounds i32, i32* %2, i64 4
%26 = load i32, i32* %25
%27 = getelementptr inbounds i32, i32* %1, i64 4
%28 = tail call i32 @_mm_loadu_si128(i32* %27)
%29 = tail call i32 @_mm_xor_si128(i32 %26, i32 %28)
%30 = getelementptr inbounds i32, i32* %0, i64 4
store i32 %29, i32* %30
%31 = getelementptr inbounds i32, i32* %2, i64 5
%32 = load i32, i32* %31
%33 = getelementptr inbounds i32, i32* %1, i64 5
%34 = tail call i32 @_mm_loadu_si128(i32* %33)
%35 = tail call i32 @_mm_xor_si128(i32 %32, i32 %34)
%36 = getelementptr inbounds i32, i32* %0, i64 5
store i32 %35, i32* %36
%37 = getelementptr inbounds i32, i32* %2, i64 6
%38 = load i32, i32* %37
%39 = getelementptr inbounds i32, i32* %1, i64 6
%40 = tail call i32 @_mm_loadu_si128(i32* %39)
%41 = tail call i32 @_mm_xor_si128(i32 %38, i32 %40)
%42 = getelementptr inbounds i32, i32* %0, i64 6
store i32 %41, i32* %42
%43 = getelementptr inbounds i32, i32* %2, i64 7
%44 = load i32, i32* %43
%45 = getelementptr inbounds i32, i32* %1, i64 7
%46 = tail call i32 @_mm_loadu_si128(i32* %45)
%47 = tail call i32 @_mm_xor_si128(i32 %44, i32 %46)
%48 = getelementptr inbounds i32, i32* %0, i64 7
store i32 %47, i32* %48
ret void
}