#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_xor_si128(int /*<<< orphan*/, int /*<<< orphan*/ const);
void sse2_blkxor(void *dest, const void *src, size_t len) {
  __m128i *D = dest;
  const __m128i *S = src;
  size_t L = len / 16;
  size_t i;
  for (i = 0; i < L; i++)
    D[i] = _mm_xor_si128(D[i], S[i]);
}


x86 assembly (clang, -O0):
<sse2_blkxor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
shr    $0x4,%rax
mov    %rax,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%rax
cmp    -0x30(%rbp),%rax
jae    118f <sse2_blkxor+0x7f>
mov    -0x20(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
mov    -0x28(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
call   1030 <_mm_xor_si128@plt>
mov    %eax,%edx
mov    -0x20(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    1148 <sse2_blkxor+0x38>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sse2_blkxor>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
cmp    $0x10,%rdx
jb     114a <sse2_blkxor+0x3a>
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%r12
shr    $0x4,%r15
xor    %ebx,%ebx
nopl   (%rax)
mov    (%r12,%rbx,4),%edi
mov    (%r14,%rbx,4),%esi
call   1030 <_mm_xor_si128@plt>
mov    %eax,(%r12,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <sse2_blkxor+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @sse2_blkxor(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i64
%10 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%11 = load i8*, i8** %4
%12 = bitcast i8* %11 to i32*
store i32* %12, i32** %7
%13 = load i8*, i8** %5
%14 = bitcast i8* %13 to i32*
store i32* %14, i32** %8
%15 = load i64, i64* %6
%16 = udiv i64 %15, 16
store i64 %16, i64* %9
store i64 0, i64* %10
br label %17
17: ; preds = %34, %3
%18 = load i64, i64* %10
%19 = load i64, i64* %9
%20 = icmp ult i64 %18, %19
br i1 %20, label %21, label %37
21: ; preds = %17
%22 = load i32*, i32** %7
%23 = load i64, i64* %10
%24 = getelementptr inbounds i32, i32* %22, i64 %23
%25 = load i32, i32* %24
%26 = load i32*, i32** %8
%27 = load i64, i64* %10
%28 = getelementptr inbounds i32, i32* %26, i64 %27
%29 = load i32, i32* %28
%30 = call i32 @_mm_xor_si128(i32 %25, i32 %29)
%31 = load i32*, i32** %7
%32 = load i64, i64* %10
%33 = getelementptr inbounds i32, i32* %31, i64 %32
store i32 %30, i32* %33
br label %34
34: ; preds = %21
%35 = load i64, i64* %10
%36 = add i64 %35, 1
store i64 %36, i64* %10
br label %17
37: ; preds = %17
ret void
}

LLVM IR (-O2):
define void @sse2_blkxor(i8* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = bitcast i8* %0 to i32*
%5 = bitcast i8* %1 to i32*
%6 = icmp ult i64 %2, 16
br i1 %6, label %18, label %7
7: ; preds = %3
%8 = lshr i64 %2, 4
br label %9
9: ; preds = %7, %9
%10 = phi i64 [ %16, %9 ], [ 0, %7 ]
%11 = getelementptr inbounds i32, i32* %4, i64 %10
%12 = load i32, i32* %11
%13 = getelementptr inbounds i32, i32* %5, i64 %10
%14 = load i32, i32* %13
%15 = tail call i32 @_mm_xor_si128(i32 %12, i32 %14)
store i32 %15, i32* %11
%16 = add nuw nsw i64 %10, 1
%17 = icmp eq i64 %16, %8
br i1 %17, label %18, label %9
18: ; preds = %9, %3
ret void
}