user: Converte this assembly snippet into its equivalent C code:

```asm
<keytag>:
  endbr64
  mov    %esi,%ecx
  test   %esi,%esi
  je     L67
  lea    -0x1(%rsi),%eax
  cmp    $0xe,%eax
  jbe    L77
  mov    %esi,%edx
  pxor   %xmm1,%xmm1
  pxor   %xmm12,%xmm12
  mov    %rdi,%rax
  shr    $0x4,%edx
  pxor   %xmm5,%xmm5
  movdqa D16(%rip),%xmm10
  movdqa D59(%rip),%xmm15
  movdqa D14(%rip),%xmm8
  sub    $0x1,%edx
  pxor   %xmm7,%xmm7
  movdqa D13(%rip),%xmm14
  movdqa D25(%rip),%xmm13
  shl    $0x4,%rdx
  lea    0x10(%rdi,%rdx,1),%rdx
  nopl   0x0(%rax)
L37:
  movdqu (%rax),%xmm6
  movdqa %xmm10,%xmm0
  add    $0x10,%rax
  paddd  %xmm15,%xmm10
  movdqa %xmm0,%xmm4
  movdqa %xmm6,%xmm3
  pand   %xmm8,%xmm4
  punpckhbw %xmm12,%xmm6
  punpcklbw %xmm12,%xmm3
  pcmpeqd %xmm5,%xmm4
  movdqa %xmm6,%xmm11
  movdqa %xmm3,%xmm2
  punpckhwd %xmm7,%xmm3
  punpcklwd %xmm7,%xmm11
  punpcklwd %xmm7,%xmm2
  punpckhwd %xmm7,%xmm6
  movdqa %xmm2,%xmm9
  pslld  $0x8,%xmm9
  pand   %xmm4,%xmm9
  pandn  %xmm2,%xmm4
  movdqa %xmm0,%xmm2
  paddd  %xmm14,%xmm2
  por    %xmm9,%xmm4
  movdqa %xmm3,%xmm9
  pand   %xmm8,%xmm2
  pslld  $0x8,%xmm9
  pcmpeqd %xmm5,%xmm2
  pand   %xmm2,%xmm9
  pandn  %xmm3,%xmm2
  movdqa %xmm0,%xmm3
  paddd  %xmm13,%xmm3
  paddd  D29(%rip),%xmm0
  por    %xmm9,%xmm2
  pand   %xmm8,%xmm3
  movdqa %xmm11,%xmm9
  pcmpeqd %xmm5,%xmm3
  pslld  $0x8,%xmm9
  pand   %xmm8,%xmm0
  pcmpeqd %xmm5,%xmm0
  pand   %xmm3,%xmm9
  pandn  %xmm11,%xmm3
  por    %xmm9,%xmm3
  movdqa %xmm6,%xmm9
  pslld  $0x8,%xmm9
  pand   %xmm0,%xmm9
  pandn  %xmm6,%xmm0
  movdqa %xmm2,%xmm6
  punpckldq %xmm5,%xmm6
  punpckhdq %xmm5,%xmm2
  por    %xmm9,%xmm0
  paddq  %xmm6,%xmm2
  movdqa %xmm4,%xmm6
  punpckhdq %xmm5,%xmm4
  punpckldq %xmm5,%xmm6
  paddq  %xmm6,%xmm4
  paddq  %xmm4,%xmm2
  movdqa %xmm3,%xmm4
  punpckhdq %xmm5,%xmm3
  punpckldq %xmm5,%xmm4
  paddq  %xmm4,%xmm3
  movdqa %xmm0,%xmm4
  punpckhdq %xmm5,%xmm0
  punpckldq %xmm5,%xmm4
  paddq  %xmm1,%xmm0
  paddq  %xmm4,%xmm3
  paddq  %xmm3,%xmm2
  movdqa %xmm2,%xmm1
  paddq  %xmm0,%xmm1
  cmp    %rax,%rdx
  jne    L37
  movdqa %xmm1,%xmm0
  mov    %ecx,%eax
  psrldq $0x8,%xmm0
  and    $0xfffffff0,%eax
  paddq  %xmm0,%xmm1
  movq   %xmm1,%rdx
  test   $0xf,%cl
  je     L78
  mov    %eax,%esi
  movzbl (%rdi,%rsi,1),%esi
L297:
  shl    $0x8,%rsi
  lea    0x1(%rax),%r8d
  and    $0xff00,%esi
  add    %rsi,%rdx
  cmp    %r8d,%ecx
  jbe    L78
  mov    %r8d,%esi
  and    $0x1,%r8d
  movzbl (%rdi,%rsi,1),%esi
  je     L55
L215:
  add    %rsi,%rdx
  lea    0x2(%rax),%esi
  cmp    %esi,%ecx
  jbe    L78
  movzbl (%rdi,%rsi,1),%esi
  lea    0x3(%rax),%r8d
  shl    $0x8,%rsi
  and    $0xff00,%esi
  add    %rsi,%rdx
  cmp    %r8d,%ecx
  jbe    L78
  mov    %r8d,%esi
  and    $0x1,%r8d
  movzbl (%rdi,%rsi,1),%esi
  je     L91
L256:
  add    %rsi,%rdx
  lea    0x4(%rax),%esi
  cmp    %esi,%ecx
  jbe    L78
  movzbl (%rdi,%rsi,1),%esi
  lea    0x5(%rax),%r8d
  shl    $0x8,%rsi
  and    $0xff00,%esi
  add    %rsi,%rdx
  cmp    %r8d,%ecx
  jbe    L78
  mov    %r8d,%esi
  and    $0x1,%r8d
  movzbl (%rdi,%rsi,1),%esi
  jne    L171
  shl    $0x8,%rsi
  and    $0xff00,%esi
L171:
  add    %rsi,%rdx
  lea    0x6(%rax),%esi
  cmp    %esi,%ecx
  jbe    L78
  movzbl (%rdi,%rsi,1),%esi
  lea    0x7(%rax),%r8d
  shl    $0x8,%rsi
  and    $0xff00,%esi
  add    %rsi,%rdx
  cmp    %r8d,%ecx
  jbe    L78
  mov    %r8d,%esi
  and    $0x1,%r8d
  movzbl (%rdi,%rsi,1),%esi
  je     L241
L204:
  add    %rsi,%rdx
  lea    0x8(%rax),%esi
  cmp    %esi,%ecx
  jbe    L78
  movzbl (%rdi,%rsi,1),%esi
  lea    0x9(%rax),%r8d
  shl    $0x8,%rsi
  and    $0xff00,%esi
  add    %rsi,%rdx
  cmp    %r8d,%ecx
  jbe    L78
  mov    %r8d,%esi
  and    $0x1,%r8d
  movzbl (%rdi,%rsi,1),%esi
  je     L130
L65:
  add    %rsi,%rdx
  lea    0xa(%rax),%esi
  cmp    %esi,%ecx
  jbe    L78
  movzbl (%rdi,%rsi,1),%esi
  lea    0xb(%rax),%r8d
  shl    $0x8,%rsi
  and    $0xff00,%esi
  add    %rsi,%rdx
  cmp    %r8d,%ecx
  jbe    L78
  mov    %r8d,%esi
  and    $0x1,%r8d
  movzbl (%rdi,%rsi,1),%esi
  je     L169
L235:
  add    %rsi,%rdx
  lea    0xc(%rax),%esi
  cmp    %esi,%ecx
  jbe    L78
  movzbl (%rdi,%rsi,1),%esi
  lea    0xd(%rax),%r8d
  shl    $0x8,%rsi
  and    $0xff00,%esi
  add    %rsi,%rdx
  cmp    %r8d,%ecx
  jbe    L78
  mov    %r8d,%esi
  and    $0x1,%r8d
  movzbl (%rdi,%rsi,1),%esi
  jne    L183
  shl    $0x8,%rsi
  and    $0xff00,%esi
L183:
  add    $0xe,%eax
  add    %rsi,%rdx
  cmp    %eax,%ecx
  jbe    L78
  movzbl (%rdi,%rax,1),%eax
  shl    $0x8,%rax
  and    $0xff00,%eax
  add    %rax,%rdx
L78:
  mov    %rdx,%rax
  shr    $0x10,%rax
  add    %edx,%eax
  movzwl %ax,%eax
  ret
  nopl   0x0(%rax)
L55:
  shl    $0x8,%rsi
  and    $0xff00,%esi
  jmp    L215
  nopw   0x0(%rax,%rax,1)
L91:
  shl    $0x8,%rsi
  and    $0xff00,%esi
  jmp    L256
  nop
L241:
  shl    $0x8,%rsi
  and    $0xff00,%esi
  jmp    L204
  nop
L130:
  shl    $0x8,%rsi
  and    $0xff00,%esi
  jmp    L65
  nop
L169:
  shl    $0x8,%rsi
  and    $0xff00,%esi
  jmp    L235
  nop
L67:
  xor    %eax,%eax
  ret
L77:
  movzbl (%rdi),%esi
  xor    %eax,%eax
  xor    %edx,%edx
  jmp    L297
```

tool_calls: name: unpack_data
arguments: data_tag: D16
data_type: byte[16]
name: unpack_data
arguments: data_tag: D59
data_type: byte[16]
name: unpack_data
arguments: data_tag: D14
data_type: byte[16]
name: unpack_data
arguments: data_tag: D13
data_type: byte[16]
name: unpack_data
arguments: data_tag: D25
data_type: byte[16]
name: unpack_data
arguments: data_tag: D29
data_type: byte[16]

tool: {"D16": [0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x03,0x00,0x00,0x00]}

tool: {"D59": [0x10,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x10,0x00,0x00,0x00]}

tool: {"D14": [0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00]}

tool: {"D13": [0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00]}

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

tool: {"D29": [0x0c,0x00,0x00,0x00,0x0c,0x00,0x00,0x00,0x0c,0x00,0x00,0x00,0x0c,0x00,0x00,0x00]}

assistant: ```c
unsigned int keytag(unsigned char *key, unsigned int keysize) {
  unsigned long ac;
  unsigned int i;
  for (ac = 0, i = 0; i < keysize; ++i)
    ac += (i & 1) ? key[i] : key[i] << 8;
  ac += (ac >> 16) & 0xFFFF;
  return ac & 0xFFFF;
}
```