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

```asm
<count_linefeeds>:
  endbr64
  lea    (%rdi,%rsi,1),%rcx
  mov    %rdi,%rdx
  cmp    %rcx,%rdi
  jae    L41
  mov    %rdi,%rax
  lea    -0x1(%rsi),%rdi
  cmp    $0xe,%rdi
  jbe    L62
  pxor   %xmm3,%xmm3
  pxor   %xmm5,%xmm5
  pxor   %xmm4,%xmm4
  mov    %rsi,%rdi
  and    $0xfffffffffffffff0,%rdi
  movdqa D0(%rip),%xmm7
  movdqa D5(%rip),%xmm6
  pxor   %xmm2,%xmm2
  add    %rdx,%rdi
  nop
L44:
  movdqu (%rax),%xmm0
  add    $0x10,%rax
  pcmpeqb %xmm7,%xmm0
  pand   %xmm6,%xmm0
  movdqa %xmm0,%xmm1
  punpckhbw %xmm5,%xmm0
  punpcklbw %xmm5,%xmm1
  movdqa %xmm0,%xmm8
  punpckhwd %xmm4,%xmm0
  movdqa %xmm1,%xmm9
  punpckhwd %xmm4,%xmm1
  punpcklwd %xmm4,%xmm8
  movdqa %xmm1,%xmm10
  punpcklwd %xmm4,%xmm9
  punpckhdq %xmm2,%xmm1
  punpckldq %xmm2,%xmm10
  paddq  %xmm10,%xmm1
  movdqa %xmm9,%xmm10
  punpckhdq %xmm2,%xmm9
  punpckldq %xmm2,%xmm10
  paddq  %xmm10,%xmm9
  paddq  %xmm9,%xmm1
  movdqa %xmm8,%xmm9
  punpckhdq %xmm2,%xmm8
  punpckldq %xmm2,%xmm9
  paddq  %xmm9,%xmm8
  movdqa %xmm0,%xmm9
  punpckhdq %xmm2,%xmm0
  punpckldq %xmm2,%xmm9
  paddq  %xmm3,%xmm0
  paddq  %xmm9,%xmm8
  paddq  %xmm8,%xmm1
  movdqa %xmm1,%xmm3
  paddq  %xmm0,%xmm3
  cmp    %rdi,%rax
  jne    L44
  movdqa %xmm3,%xmm0
  mov    %rsi,%rdi
  psrldq $0x8,%xmm0
  and    $0xfffffffffffffff0,%rdi
  paddq  %xmm0,%xmm3
  add    %rdi,%rdx
  movq   %xmm3,%rax
  cmp    %rdi,%rsi
  je     L175
L186:
  xor    %esi,%esi
  cmpb   $0xa,(%rdx)
  sete   %sil
  add    %rsi,%rax
  lea    0x1(%rdx),%rsi
  cmp    %rsi,%rcx
  jbe    L146
  xor    %esi,%esi
  cmpb   $0xa,0x1(%rdx)
  sete   %sil
  add    %rsi,%rax
  lea    0x2(%rdx),%rsi
  cmp    %rsi,%rcx
  jbe    L146
  xor    %esi,%esi
  cmpb   $0xa,0x2(%rdx)
  sete   %sil
  add    %rsi,%rax
  lea    0x3(%rdx),%rsi
  cmp    %rsi,%rcx
  jbe    L146
  xor    %esi,%esi
  cmpb   $0xa,0x3(%rdx)
  sete   %sil
  add    %rsi,%rax
  lea    0x4(%rdx),%rsi
  cmp    %rsi,%rcx
  jbe    L146
  xor    %esi,%esi
  cmpb   $0xa,0x4(%rdx)
  sete   %sil
  add    %rsi,%rax
  lea    0x5(%rdx),%rsi
  cmp    %rsi,%rcx
  jbe    L146
  xor    %esi,%esi
  cmpb   $0xa,0x5(%rdx)
  sete   %sil
  add    %rsi,%rax
  lea    0x6(%rdx),%rsi
  cmp    %rsi,%rcx
  jbe    L146
  xor    %esi,%esi
  cmpb   $0xa,0x6(%rdx)
  sete   %sil
  add    %rsi,%rax
  lea    0x7(%rdx),%rsi
  cmp    %rsi,%rcx
  jbe    L146
  xor    %esi,%esi
  cmpb   $0xa,0x7(%rdx)
  sete   %sil
  add    %rsi,%rax
  lea    0x8(%rdx),%rsi
  cmp    %rsi,%rcx
  jbe    L146
  xor    %esi,%esi
  cmpb   $0xa,0x8(%rdx)
  sete   %sil
  add    %rsi,%rax
  lea    0x9(%rdx),%rsi
  cmp    %rsi,%rcx
  jbe    L146
  xor    %esi,%esi
  cmpb   $0xa,0x9(%rdx)
  sete   %sil
  add    %rsi,%rax
  lea    0xa(%rdx),%rsi
  cmp    %rsi,%rcx
  jbe    L146
  xor    %esi,%esi
  cmpb   $0xa,0xa(%rdx)
  sete   %sil
  add    %rsi,%rax
  lea    0xb(%rdx),%rsi
  cmp    %rsi,%rcx
  jbe    L146
  xor    %esi,%esi
  cmpb   $0xa,0xb(%rdx)
  sete   %sil
  add    %rsi,%rax
  lea    0xc(%rdx),%rsi
  cmp    %rsi,%rcx
  jbe    L146
  xor    %esi,%esi
  cmpb   $0xa,0xc(%rdx)
  sete   %sil
  add    %rsi,%rax
  lea    0xd(%rdx),%rsi
  cmp    %rsi,%rcx
  jbe    L146
  xor    %esi,%esi
  cmpb   $0xa,0xd(%rdx)
  sete   %sil
  add    %rsi,%rax
  lea    0xe(%rdx),%rsi
  cmp    %rsi,%rcx
  jbe    L146
  cmpb   $0xa,0xe(%rdx)
  sete   %dl
  movzbl %dl,%edx
  add    %rdx,%rax
  ret
  nop
L41:
  xor    %eax,%eax
L146:
  ret
L62:
  xor    %eax,%eax
  jmp    L186
L175:
  ret
```

tool_calls: name: retrieve_data
arguments: data_tag: D0
type_guessed: byte[16]
name: retrieve_data
arguments: data_tag: D5
type_guessed: byte[16]

tool: {"D0": [0x0a,0x0a,0x0a,0x0a,0x0a,0x0a,0x0a,0x0a,0x0a,0x0a,0x0a,0x0a,0x0a,0x0a,0x0a,0x0a]}

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

assistant: ```c
size_t count_linefeeds(const char *buf, size_t len) {
  const char *p = buf, *e = buf + len;
  size_t cnt = 0;
  while (p < e) {
    if (*p == '\n')
      cnt++;
    p++;
  }
  return cnt;
}
```