user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<popcount4>:
  endbr64
  mov    %rdi,%rcx
  mov    %esi,%edx
  test   %esi,%esi
  je     L13
  lea    -0x1(%rsi),%eax
  cmp    $0x2,%eax
  jbe    L42
  shr    $0x2,%esi
  movdqa D29(%rip),%xmm2
  mov    %rdi,%rax
  pxor   %xmm4,%xmm4
  sub    $0x1,%esi
  movdqa D25(%rip),%xmm5
  shl    $0x4,%rsi
  lea    0x10(%rdi,%rsi,1),%rsi
  nopl   0x0(%rax,%rax,1)
L58:
  movdqu (%rax),%xmm1
  add    $0x10,%rax
  movdqa %xmm1,%xmm0
  movdqa %xmm1,%xmm3
  movdqa %xmm1,%xmm6
  psrld  $0x2,%xmm0
  psrld  $0x1,%xmm3
  pand   %xmm2,%xmm3
  psrld  $0x3,%xmm6
  pand   %xmm2,%xmm0
  paddd  %xmm3,%xmm0
  movdqa %xmm1,%xmm3
  pand   %xmm2,%xmm6
  psrld  $0x4,%xmm3
  pand   %xmm2,%xmm3
  paddd  %xmm6,%xmm3
  movdqa %xmm1,%xmm6
  paddd  %xmm3,%xmm0
  psrld  $0x5,%xmm6
  movdqa %xmm1,%xmm3
  psrld  $0x6,%xmm3
  pand   %xmm2,%xmm6
  pand   %xmm2,%xmm3
  paddd  %xmm6,%xmm3
  paddd  %xmm3,%xmm0
  movdqa %xmm1,%xmm3
  pand   %xmm2,%xmm1
  psrld  $0x7,%xmm3
  pand   %xmm2,%xmm3
  paddd  %xmm3,%xmm1
  paddd  %xmm1,%xmm0
  movdqa %xmm0,%xmm1
  psrad  $0x10,%xmm1
  paddd  %xmm0,%xmm1
  movdqa %xmm1,%xmm0
  psrad  $0x8,%xmm0
  paddd  %xmm1,%xmm0
  pand   %xmm5,%xmm0
  paddd  %xmm0,%xmm4
  cmp    %rsi,%rax
  jne    L58
  movdqa %xmm4,%xmm0
  mov    %edx,%esi
  psrldq $0x8,%xmm0
  and    $0xfffffffc,%esi
  paddd  %xmm0,%xmm4
  mov    %esi,%eax
  movdqa %xmm4,%xmm0
  psrldq $0x4,%xmm0
  paddd  %xmm0,%xmm4
  movd   %xmm4,%r8d
  cmp    %esi,%edx
  je     L6
L46:
  sub    %esi,%edx
  cmp    $0x1,%edx
  je     L43
  movq   D29(%rip),%xmm2
  movq   (%rcx,%rsi,4),%xmm1
  movdqa %xmm1,%xmm0
  movdqa %xmm1,%xmm3
  movdqa %xmm1,%xmm4
  psrld  $0x1,%xmm0
  psrld  $0x2,%xmm3
  pand   %xmm2,%xmm3
  psrld  $0x4,%xmm4
  pand   %xmm2,%xmm0
  paddd  %xmm3,%xmm0
  movdqa %xmm1,%xmm3
  pand   %xmm2,%xmm4
  psrld  $0x3,%xmm3
  pand   %xmm2,%xmm3
  paddd  %xmm4,%xmm3
  movdqa %xmm1,%xmm4
  psrld  $0x6,%xmm4
  pand   %xmm2,%xmm4
  paddd  %xmm3,%xmm0
  movdqa %xmm1,%xmm3
  psrld  $0x5,%xmm3
  pand   %xmm2,%xmm3
  paddd  %xmm4,%xmm3
  paddd  %xmm3,%xmm0
  movdqa %xmm1,%xmm3
  pand   %xmm2,%xmm1
  psrld  $0x7,%xmm3
  pand   %xmm2,%xmm3
  paddd  %xmm3,%xmm1
  paddd  %xmm1,%xmm0
  movdqa %xmm0,%xmm1
  psrad  $0x10,%xmm1
  paddd  %xmm0,%xmm1
  movdqa %xmm1,%xmm0
  psrad  $0x8,%xmm0
  paddd  %xmm1,%xmm0
  movq   D25(%rip),%xmm1
  pand   %xmm1,%xmm0
  movd   %xmm0,%edi
  pshufd $0xe5,%xmm0,%xmm7
  movd   %xmm7,%esi
  add    %edi,%esi
  add    %esi,%r8d
  mov    %edx,%esi
  and    $0xfffffffe,%esi
  add    %esi,%eax
  cmp    %esi,%edx
  je     L6
L43:
  cltq
  mov    (%rcx,%rax,4),%edx
  mov    %edx,%eax
  mov    %edx,%ecx
  shr    %eax
  shr    $0x2,%ecx
  and    $0x1010101,%ecx
  and    $0x1010101,%eax
  add    %ecx,%eax
  mov    %edx,%ecx
  and    $0x1010101,%ecx
  add    %ecx,%eax
  mov    %edx,%ecx
  shr    $0x3,%ecx
  and    $0x1010101,%ecx
  add    %ecx,%eax
  mov    %edx,%ecx
  shr    $0x4,%ecx
  and    $0x1010101,%ecx
  add    %ecx,%eax
  mov    %edx,%ecx
  shr    $0x5,%ecx
  and    $0x1010101,%ecx
  add    %ecx,%eax
  mov    %edx,%ecx
  shr    $0x7,%edx
  shr    $0x6,%ecx
  and    $0x1010101,%edx
  and    $0x1010101,%ecx
  add    %ecx,%eax
  add    %edx,%eax
  mov    %eax,%edx
  sar    $0x10,%edx
  add    %edx,%eax
  mov    %eax,%edx
  sar    $0x8,%edx
  add    %edx,%eax
  movzbl %al,%eax
  add    %eax,%r8d
L6:
  mov    %r8d,%eax
  ret
L13:
  xor    %r8d,%r8d
  mov    %r8d,%eax
  ret
L42:
  xor    %esi,%esi
  xor    %r8d,%r8d
  xor    %eax,%eax
  jmp    L46
```

tool_calls: name: unpack_data
arguments: tag: D29
type_guessed: byte[16]
name: unpack_data
arguments: tag: D25
type_guessed: byte[16]

tool: {"D29": [0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01]}

tool: {"D25": [0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00]}

assistant: ```c
int popcount4(unsigned *lista, unsigned len) {
  int i, j, res = 0, val;
  unsigned x;
  for (i = 0; i < len; i++) {
    val = 0;
    x = lista[i];
    for (j = 0; j < 8; j++) {
      val += x & 0x01010101;
      x >>= 1;
    }
    val += (val >> 16);
    val += (val >> 8);
    res += val & 0xFF;
  }
  return res;
}
```