#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 uint8_t;
typedef char *uint32_t;

/* Variables and functions */
uint32_t sse2_popcount3(uint8_t *buffer, int chunks16) {
  static uint8_t mask33[16] = {0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33,
                               0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33};
  static uint8_t mask55[16] = {0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
                               0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55};
  static uint8_t mask0f[16] = {0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f,
                               0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f};
  uint32_t result = 0;
  int i, n, k;
  __asm__ volatile("movdqu (%%eax), %%xmm5" : : "a"(mask55));
  __asm__ volatile("movdqu (%%eax), %%xmm6" : : "a"(mask33));
  __asm__ volatile("movdqu (%%eax), %%xmm7" : : "a"(mask0f));
  __asm__ volatile("pxor %xmm4, %xmm4");
  i = 0;
  while (chunks16 > 0) {
    if (chunks16 > (7 * 4)) {
      k = (7 * 4);
      chunks16 -= (7 * 4);
    } else {
      k = chunks16;
      chunks16 = 0;
    }
    __asm__ volatile("pxor %xmm3, %xmm3");
    for (n = 0; n < k; n += 4) {
      __asm__ volatile("movdqa	  (%%eax), %%xmm0	\n"
                       "movdqa    %%xmm0, %%xmm1	\n"
                       "psrlw         $1, %%xmm1	\n"
                       "pand      %%xmm5, %%xmm0	\n"
                       "pand      %%xmm5, %%xmm1	\n"
                       "paddb     %%xmm1, %%xmm0	\n"
                       "movdqa    %%xmm0, %%xmm1	\n"
                       "psrlw         $2, %%xmm1	\n"
                       "pand      %%xmm6, %%xmm0	\n"
                       "pand      %%xmm6, %%xmm1	\n"
                       "paddb     %%xmm1, %%xmm0	\n"
                       "movdqa    %%xmm0, %%xmm1	\n"
                       "psrlw         $4, %%xmm1	\n"
                       "pand      %%xmm7, %%xmm0	\n"
                       "pand      %%xmm7, %%xmm1	\n"
                       "paddb     %%xmm1, %%xmm0	\n"
                       "paddb     %%xmm0, %%xmm3	\n"
                       :
                       : "a"(&buffer[i + 0 * 16]));
      ;
      __asm__ volatile("movdqa	  (%%eax), %%xmm0	\n"
                       "movdqa    %%xmm0, %%xmm1	\n"
                       "psrlw         $1, %%xmm1	\n"
                       "pand      %%xmm5, %%xmm0	\n"
                       "pand      %%xmm5, %%xmm1	\n"
                       "paddb     %%xmm1, %%xmm0	\n"
                       "movdqa    %%xmm0, %%xmm1	\n"
                       "psrlw         $2, %%xmm1	\n"
                       "pand      %%xmm6, %%xmm0	\n"
                       "pand      %%xmm6, %%xmm1	\n"
                       "paddb     %%xmm1, %%xmm0	\n"
                       "movdqa    %%xmm0, %%xmm1	\n"
                       "psrlw         $4, %%xmm1	\n"
                       "pand      %%xmm7, %%xmm0	\n"
                       "pand      %%xmm7, %%xmm1	\n"
                       "paddb     %%xmm1, %%xmm0	\n"
                       "paddb     %%xmm0, %%xmm3	\n"
                       :
                       : "a"(&buffer[i + 1 * 16]));
      ;
      __asm__ volatile("movdqa	  (%%eax), %%xmm0	\n"
                       "movdqa    %%xmm0, %%xmm1	\n"
                       "psrlw         $1, %%xmm1	\n"
                       "pand      %%xmm5, %%xmm0	\n"
                       "pand      %%xmm5, %%xmm1	\n"
                       "paddb     %%xmm1, %%xmm0	\n"
                       "movdqa    %%xmm0, %%xmm1	\n"
                       "psrlw         $2, %%xmm1	\n"
                       "pand      %%xmm6, %%xmm0	\n"
                       "pand      %%xmm6, %%xmm1	\n"
                       "paddb     %%xmm1, %%xmm0	\n"
                       "movdqa    %%xmm0, %%xmm1	\n"
                       "psrlw         $4, %%xmm1	\n"
                       "pand      %%xmm7, %%xmm0	\n"
                       "pand      %%xmm7, %%xmm1	\n"
                       "paddb     %%xmm1, %%xmm0	\n"
                       "paddb     %%xmm0, %%xmm3	\n"
                       :
                       : "a"(&buffer[i + 2 * 16]));
      ;
      __asm__ volatile("movdqa	  (%%eax), %%xmm0	\n"
                       "movdqa    %%xmm0, %%xmm1	\n"
                       "psrlw         $1, %%xmm1	\n"
                       "pand      %%xmm5, %%xmm0	\n"
                       "pand      %%xmm5, %%xmm1	\n"
                       "paddb     %%xmm1, %%xmm0	\n"
                       "movdqa    %%xmm0, %%xmm1	\n"
                       "psrlw         $2, %%xmm1	\n"
                       "pand      %%xmm6, %%xmm0	\n"
                       "pand      %%xmm6, %%xmm1	\n"
                       "paddb     %%xmm1, %%xmm0	\n"
                       "movdqa    %%xmm0, %%xmm1	\n"
                       "psrlw         $4, %%xmm1	\n"
                       "pand      %%xmm7, %%xmm0	\n"
                       "pand      %%xmm7, %%xmm1	\n"
                       "paddb     %%xmm1, %%xmm0	\n"
                       "paddb     %%xmm0, %%xmm3	\n"
                       :
                       : "a"(&buffer[i + 3 * 16]));
      ;
      i += 4 * 16;
    }
    __asm__ volatile("pxor	%xmm0, %xmm0		\n"
                     "psadbw	%xmm0, %xmm3		\n"
                     "paddd	%xmm3, %xmm4		\n");
  }
  __asm__ volatile("movhlps   %%xmm4, %%xmm0	\n"
                   "paddd     %%xmm4, %%xmm0	\n"
                   "movd      %%xmm0, %%eax	\n"
                   : "=a"(result));
  return result;
}


x86 assembly (clang, -O0):
<sse2_popcount3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
lea    0x2f56(%rip),%rax
movdqu (%eax),%xmm5
lea    0x2f0a(%rip),%rax
movdqu (%eax),%xmm6
lea    0x2f7e(%rip),%rax
movdqu (%eax),%xmm7
pxor   %xmm4,%xmm4
movl   $0x0,-0x1c(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1327 <sse2_popcount3+0x227>
cmpl   $0x1c,-0xc(%rbp)
jle    116b <sse2_popcount3+0x6b>
movl   $0x1c,-0x24(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1c,%eax
mov    %eax,-0xc(%rbp)
jmp    1178 <sse2_popcount3+0x78>
mov    -0xc(%rbp),%eax
mov    %eax,-0x24(%rbp)
movl   $0x0,-0xc(%rbp)
pxor   %xmm3,%xmm3
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1316 <sse2_popcount3+0x216>
mov    -0x8(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
movdqa (%eax),%xmm0
movdqa %xmm0,%xmm1
psrlw  $0x1,%xmm1
pand   %xmm5,%xmm0
pand   %xmm5,%xmm1
paddb  %xmm1,%xmm0
movdqa %xmm0,%xmm1
psrlw  $0x2,%xmm1
pand   %xmm6,%xmm0
pand   %xmm6,%xmm1
paddb  %xmm1,%xmm0
movdqa %xmm0,%xmm1
psrlw  $0x4,%xmm1
pand   %xmm7,%xmm0
pand   %xmm7,%xmm1
paddb  %xmm1,%xmm0
paddb  %xmm0,%xmm3
mov    -0x8(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x10,%ecx
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
movdqa (%eax),%xmm0
movdqa %xmm0,%xmm1
psrlw  $0x1,%xmm1
pand   %xmm5,%xmm0
pand   %xmm5,%xmm1
paddb  %xmm1,%xmm0
movdqa %xmm0,%xmm1
psrlw  $0x2,%xmm1
pand   %xmm6,%xmm0
pand   %xmm6,%xmm1
paddb  %xmm1,%xmm0
movdqa %xmm0,%xmm1
psrlw  $0x4,%xmm1
pand   %xmm7,%xmm0
pand   %xmm7,%xmm1
paddb  %xmm1,%xmm0
paddb  %xmm0,%xmm3
mov    -0x8(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x20,%ecx
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
movdqa (%eax),%xmm0
movdqa %xmm0,%xmm1
psrlw  $0x1,%xmm1
pand   %xmm5,%xmm0
pand   %xmm5,%xmm1
paddb  %xmm1,%xmm0
movdqa %xmm0,%xmm1
psrlw  $0x2,%xmm1
pand   %xmm6,%xmm0
pand   %xmm6,%xmm1
paddb  %xmm1,%xmm0
movdqa %xmm0,%xmm1
psrlw  $0x4,%xmm1
pand   %xmm7,%xmm0
pand   %xmm7,%xmm1
paddb  %xmm1,%xmm0
paddb  %xmm0,%xmm3
mov    -0x8(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x30,%ecx
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
movdqa (%eax),%xmm0
movdqa %xmm0,%xmm1
psrlw  $0x1,%xmm1
pand   %xmm5,%xmm0
pand   %xmm5,%xmm1
paddb  %xmm1,%xmm0
movdqa %xmm0,%xmm1
psrlw  $0x2,%xmm1
pand   %xmm6,%xmm0
pand   %xmm6,%xmm1
paddb  %xmm1,%xmm0
movdqa %xmm0,%xmm1
psrlw  $0x4,%xmm1
pand   %xmm7,%xmm0
pand   %xmm7,%xmm1
paddb  %xmm1,%xmm0
paddb  %xmm0,%xmm3
mov    -0x1c(%rbp),%eax
add    $0x40,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x20(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x20(%rbp)
jmp    1183 <sse2_popcount3+0x83>
pxor   %xmm0,%xmm0
psadbw %xmm0,%xmm3
paddd  %xmm3,%xmm4
jmp    1142 <sse2_popcount3+0x42>
movhlps %xmm4,%xmm0
paddd  %xmm4,%xmm0
movd   %xmm0,%eax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sse2_popcount3>:
lea    0x2f69(%rip),%rax
movdqu (%eax),%xmm5
lea    0x2f1d(%rip),%rax
movdqu (%eax),%xmm6
lea    0x2f91(%rip),%rax
movdqu (%eax),%xmm7
pxor   %xmm4,%xmm4
test   %esi,%esi
jle    12c7 <sse2_popcount3+0x1c7>
xor    %r8d,%r8d
xor    %r10d,%r10d
cs nopw 0x0(%rax,%rax,1)
cmp    $0x1c,%esi
mov    $0x1c,%r9d
cmovb  %esi,%r9d
pxor   %xmm3,%xmm3
movslq %r10d,%r10
lea    (%rdi,%r10,4),%rcx
xor    %edx,%edx
nopw   0x0(%rax,%rax,1)
mov    %rcx,%rax
movdqa (%eax),%xmm0
movdqa %xmm0,%xmm1
psrlw  $0x1,%xmm1
pand   %xmm5,%xmm0
pand   %xmm5,%xmm1
paddb  %xmm1,%xmm0
movdqa %xmm0,%xmm1
psrlw  $0x2,%xmm1
pand   %xmm6,%xmm0
pand   %xmm6,%xmm1
paddb  %xmm1,%xmm0
movdqa %xmm0,%xmm1
psrlw  $0x4,%xmm1
pand   %xmm7,%xmm0
pand   %xmm7,%xmm1
paddb  %xmm1,%xmm0
paddb  %xmm0,%xmm3
lea    0x40(%rcx),%rax
movdqa (%eax),%xmm0
movdqa %xmm0,%xmm1
psrlw  $0x1,%xmm1
pand   %xmm5,%xmm0
pand   %xmm5,%xmm1
paddb  %xmm1,%xmm0
movdqa %xmm0,%xmm1
psrlw  $0x2,%xmm1
pand   %xmm6,%xmm0
pand   %xmm6,%xmm1
paddb  %xmm1,%xmm0
movdqa %xmm0,%xmm1
psrlw  $0x4,%xmm1
pand   %xmm7,%xmm0
pand   %xmm7,%xmm1
paddb  %xmm1,%xmm0
paddb  %xmm0,%xmm3
lea    0x80(%rcx),%rax
movdqa (%eax),%xmm0
movdqa %xmm0,%xmm1
psrlw  $0x1,%xmm1
pand   %xmm5,%xmm0
pand   %xmm5,%xmm1
paddb  %xmm1,%xmm0
movdqa %xmm0,%xmm1
psrlw  $0x2,%xmm1
pand   %xmm6,%xmm0
pand   %xmm6,%xmm1
paddb  %xmm1,%xmm0
movdqa %xmm0,%xmm1
psrlw  $0x4,%xmm1
pand   %xmm7,%xmm0
pand   %xmm7,%xmm1
paddb  %xmm1,%xmm0
paddb  %xmm0,%xmm3
lea    0xc0(%rcx),%rax
movdqa (%eax),%xmm0
movdqa %xmm0,%xmm1
psrlw  $0x1,%xmm1
pand   %xmm5,%xmm0
pand   %xmm5,%xmm1
paddb  %xmm1,%xmm0
movdqa %xmm0,%xmm1
psrlw  $0x2,%xmm1
pand   %xmm6,%xmm0
pand   %xmm6,%xmm1
paddb  %xmm1,%xmm0
movdqa %xmm0,%xmm1
psrlw  $0x4,%xmm1
pand   %xmm7,%xmm0
pand   %xmm7,%xmm1
paddb  %xmm1,%xmm0
paddb  %xmm0,%xmm3
add    $0x40,%r10
add    $0x4,%edx
add    $0x100,%rcx
cmp    %r9d,%edx
jb     1160 <sse2_popcount3+0x60>
sub    $0x1c,%esi
cmovb  %r8d,%esi
pxor   %xmm0,%xmm0
psadbw %xmm0,%xmm3
paddd  %xmm3,%xmm4
test   %esi,%esi
jg     1140 <sse2_popcount3+0x40>
movhlps %xmm4,%xmm0
paddd  %xmm4,%xmm0
movd   %xmm0,%eax
ret

LLVM IR (-O0):
@sse2_popcount3.mask33 = internal global [16 x i32] [i32 51, i32 51, i32 51, i32 51, i32 51, i32 51, i32 51, i32 51, i32 51, i32 51, i32 51, i32 51, i32 51, i32 51, i32 51, i32 51]
@sse2_popcount3.mask55 = internal global [16 x i32] [i32 85, i32 85, i32 85, i32 85, i32 85, i32 85, i32 85, i32 85, i32 85, i32 85, i32 85, i32 85, i32 85, i32 85, i32 85, i32 85]
@sse2_popcount3.mask0f = internal global [16 x i32] [i32 15, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15]
define i8* @sse2_popcount3(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i8* null, i8** %5
store i32 0, i32* %6
br label %9
9: ; preds = %51, %2
%10 = load i32, i32* %4
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %52
12: ; preds = %9
%13 = load i32, i32* %4
%14 = icmp sgt i32 %13, 28
br i1 %14, label %15, label %18
15: ; preds = %12
store i32 28, i32* %8
%16 = load i32, i32* %4
%17 = sub nsw i32 %16, 28
store i32 %17, i32* %4
br label %20
18: ; preds = %12
%19 = load i32, i32* %4
store i32 %19, i32* %8
store i32 0, i32* %4
br label %20
20: ; preds = %18, %15
store i32 0, i32* %7
br label %21
21: ; preds = %48, %20
%22 = load i32, i32* %7
%23 = load i32, i32* %8
%24 = icmp slt i32 %22, %23
br i1 %24, label %25, label %51
25: ; preds = %21
%26 = load i32*, i32** %3
%27 = load i32, i32* %6
%28 = add nsw i32 %27, 0
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i32, i32* %26, i64 %29
%31 = load i32*, i32** %3
%32 = load i32, i32* %6
%33 = add nsw i32 %32, 16
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i32, i32* %31, i64 %34
%36 = load i32*, i32** %3
%37 = load i32, i32* %6
%38 = add nsw i32 %37, 32
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds i32, i32* %36, i64 %39
%41 = load i32*, i32** %3
%42 = load i32, i32* %6
%43 = add nsw i32 %42, 48
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds i32, i32* %41, i64 %44
%46 = load i32, i32* %6
%47 = add nsw i32 %46, 64
store i32 %47, i32* %6
br label %48
48: ; preds = %25
%49 = load i32, i32* %7
%50 = add nsw i32 %49, 4
store i32 %50, i32* %7
br label %21
51: ; preds = %21
br label %9
52: ; preds = %9
%53 = call i8* asm sideeffect "movhlps %xmm4, %xmm0\09\0Apaddd %xmm4, %xmm0\09\0Amovd %xmm0, %eax\09\0A", "={ax},~{dirflag},~{fpsr},~{flags}"()
store i8* %53, i8** %5
%54 = load i8*, i8** %5
ret i8* %54
}

LLVM IR (-O2):
@sse2_popcount3.mask33 = internal global [16 x i32] [i32 51, i32 51, i32 51, i32 51, i32 51, i32 51, i32 51, i32 51, i32 51, i32 51, i32 51, i32 51, i32 51, i32 51, i32 51, i32 51]
@sse2_popcount3.mask55 = internal global [16 x i32] [i32 85, i32 85, i32 85, i32 85, i32 85, i32 85, i32 85, i32 85, i32 85, i32 85, i32 85, i32 85, i32 85, i32 85, i32 85, i32 85]
@sse2_popcount3.mask0f = internal global [16 x i32] [i32 15, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15]
define i8* @sse2_popcount3(i32* %0, i32 %1) {
tail call void asm sideeffect "movdqu (%eax), %xmm5", "{ax},~{dirflag},~{fpsr},~{flags}"(i32* getelementptr inbounds ([16 x i32], [16 x i32]* @sse2_popcount3.mask55, i64 0, i64 0))
tail call void asm sideeffect "movdqu (%eax), %xmm6", "{ax},~{dirflag},~{fpsr},~{flags}"(i32* getelementptr inbounds ([16 x i32], [16 x i32]* @sse2_popcount3.mask33, i64 0, i64 0))
tail call void asm sideeffect "movdqu (%eax), %xmm7", "{ax},~{dirflag},~{fpsr},~{flags}"(i32* getelementptr inbounds ([16 x i32], [16 x i32]* @sse2_popcount3.mask0f, i64 0, i64 0))
tail call void asm sideeffect "pxor %xmm4, %xmm4", "~{dirflag},~{fpsr},~{flags}"()
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %27
4: ; preds = %2, %24
%5 = phi i64 [ %21, %24 ], [ 0, %2 ]
%6 = phi i32 [ %25, %24 ], [ %1, %2 ]
%7 = icmp ult i32 %6, 28
%8 = select i1 %7, i32 %6, i32 28
tail call void asm sideeffect "pxor %xmm3, %xmm3", "~{dirflag},~{fpsr},~{flags}"()
%9 = shl i64 %5, 32
%10 = ashr exact i64 %9, 32
br label %11
11: ; preds = %4, %11
%12 = phi i64 [ %10, %4 ], [ %21, %11 ]
%13 = phi i32 [ 0, %4 ], [ %22, %11 ]
%14 = getelementptr inbounds i32, i32* %0, i64 %12
tail call void asm sideeffect "movdqa\09 (%eax), %xmm0\09\0Amovdqa %xmm0, %xmm1\09\0Apsrlw $$1, %xmm1\09\0Apand %xmm5, %xmm0\09\0Apand %xmm5, %xmm1\09\0Apaddb %xmm1, %xmm0\09\0Amovdqa %xmm0, %xmm1\09\0Apsrlw $$2, %xmm1\09\0Apand %xmm6, %xmm0\09\0Apand %xmm6, %xmm1\09\0Apaddb %xmm1, %xmm0\09\0Amovdqa %xmm0, %xmm1\09\0Apsrlw $$4, %xmm1\09\0Apand %xmm7, %xmm0\09\0Apand %xmm7, %xmm1\09\0Apaddb %xmm1, %xmm0\09\0Apaddb %xmm0, %xmm3\09\0A", "{ax},~{dirflag},~{fpsr},~{flags}"(i32* %14)
%15 = add nsw i64 %12, 16
%16 = getelementptr inbounds i32, i32* %0, i64 %15
tail call void asm sideeffect "movdqa\09 (%eax), %xmm0\09\0Amovdqa %xmm0, %xmm1\09\0Apsrlw $$1, %xmm1\09\0Apand %xmm5, %xmm0\09\0Apand %xmm5, %xmm1\09\0Apaddb %xmm1, %xmm0\09\0Amovdqa %xmm0, %xmm1\09\0Apsrlw $$2, %xmm1\09\0Apand %xmm6, %xmm0\09\0Apand %xmm6, %xmm1\09\0Apaddb %xmm1, %xmm0\09\0Amovdqa %xmm0, %xmm1\09\0Apsrlw $$4, %xmm1\09\0Apand %xmm7, %xmm0\09\0Apand %xmm7, %xmm1\09\0Apaddb %xmm1, %xmm0\09\0Apaddb %xmm0, %xmm3\09\0A", "{ax},~{dirflag},~{fpsr},~{flags}"(i32* %16)
%17 = add nsw i64 %12, 32
%18 = getelementptr inbounds i32, i32* %0, i64 %17
tail call void asm sideeffect "movdqa\09 (%eax), %xmm0\09\0Amovdqa %xmm0, %xmm1\09\0Apsrlw $$1, %xmm1\09\0Apand %xmm5, %xmm0\09\0Apand %xmm5, %xmm1\09\0Apaddb %xmm1, %xmm0\09\0Amovdqa %xmm0, %xmm1\09\0Apsrlw $$2, %xmm1\09\0Apand %xmm6, %xmm0\09\0Apand %xmm6, %xmm1\09\0Apaddb %xmm1, %xmm0\09\0Amovdqa %xmm0, %xmm1\09\0Apsrlw $$4, %xmm1\09\0Apand %xmm7, %xmm0\09\0Apand %xmm7, %xmm1\09\0Apaddb %xmm1, %xmm0\09\0Apaddb %xmm0, %xmm3\09\0A", "{ax},~{dirflag},~{fpsr},~{flags}"(i32* %18)
%19 = add nsw i64 %12, 48
%20 = getelementptr inbounds i32, i32* %0, i64 %19
tail call void asm sideeffect "movdqa\09 (%eax), %xmm0\09\0Amovdqa %xmm0, %xmm1\09\0Apsrlw $$1, %xmm1\09\0Apand %xmm5, %xmm0\09\0Apand %xmm5, %xmm1\09\0Apaddb %xmm1, %xmm0\09\0Amovdqa %xmm0, %xmm1\09\0Apsrlw $$2, %xmm1\09\0Apand %xmm6, %xmm0\09\0Apand %xmm6, %xmm1\09\0Apaddb %xmm1, %xmm0\09\0Amovdqa %xmm0, %xmm1\09\0Apsrlw $$4, %xmm1\09\0Apand %xmm7, %xmm0\09\0Apand %xmm7, %xmm1\09\0Apaddb %xmm1, %xmm0\09\0Apaddb %xmm0, %xmm3\09\0A", "{ax},~{dirflag},~{fpsr},~{flags}"(i32* %20)
%21 = add nsw i64 %12, 64
%22 = add nuw nsw i32 %13, 4
%23 = icmp ult i32 %22, %8
br i1 %23, label %11, label %24
24: ; preds = %11
%25 = tail call i32 @llvm.usub.sat.i32(i32 %6, i32 28)
tail call void asm sideeffect "pxor\09%xmm0, %xmm0\09\09\0Apsadbw\09%xmm0, %xmm3\09\09\0Apaddd\09%xmm3, %xmm4\09\09\0A", "~{dirflag},~{fpsr},~{flags}"()
%26 = icmp sgt i32 %25, 0
br i1 %26, label %4, label %27
27: ; preds = %24, %2
%28 = tail call i8* asm sideeffect "movhlps %xmm4, %xmm0\09\0Apaddd %xmm4, %xmm0\09\0Amovd %xmm0, %eax\09\0A", "={ax},~{dirflag},~{fpsr},~{flags}"()
ret i8* %28
}