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

```asm
<count_newlines>:
  endbr64
  mov    %rdi,%rdx
  mov    %rsi,%rcx
  cmp    %rsi,%rdi
  jae    L151
  mov    %rdi,%rax
  mov    %rsi,%rdi
  sub    %rdx,%rdi
  lea    -0x1(%rdi),%rsi
  cmp    $0xe,%rsi
  jbe    L108
  pxor   %xmm1,%xmm1
  pxor   %xmm5,%xmm5
  pxor   %xmm4,%xmm4
  mov    %rdi,%rsi
  and    $0xfffffffffffffff0,%rsi
  movdqa D10(%rip),%xmm7
  movdqa D15(%rip),%xmm6
  add    %rdx,%rsi
L173:
  movdqu (%rax),%xmm0
  movdqa %xmm5,%xmm3
  add    $0x10,%rax
  pcmpeqb %xmm7,%xmm0
  pand   %xmm6,%xmm0
  pcmpgtb %xmm0,%xmm3
  movdqa %xmm0,%xmm2
  punpcklbw %xmm3,%xmm2
  punpckhbw %xmm3,%xmm0
  movdqa %xmm4,%xmm3
  pcmpgtw %xmm2,%xmm3
  movdqa %xmm2,%xmm8
  punpcklwd %xmm3,%xmm8
  punpckhwd %xmm3,%xmm2
  movdqa %xmm0,%xmm3
  paddd  %xmm8,%xmm1
  paddd  %xmm2,%xmm1
  movdqa %xmm4,%xmm2
  pcmpgtw %xmm0,%xmm2
  punpcklwd %xmm2,%xmm3
  punpckhwd %xmm2,%xmm0
  paddd  %xmm3,%xmm1
  paddd  %xmm0,%xmm1
  cmp    %rax,%rsi
  jne    L173
  movdqa %xmm1,%xmm0
  mov    %rdi,%rsi
  psrldq $0x8,%xmm0
  and    $0xfffffffffffffff0,%rsi
  paddd  %xmm0,%xmm1
  add    %rsi,%rdx
  movdqa %xmm1,%xmm0
  psrldq $0x4,%xmm0
  paddd  %xmm0,%xmm1
  movd   %xmm1,%eax
  cmp    %rsi,%rdi
  je     L61
L7:
  xor    %esi,%esi
  cmpb   $0xa,(%rdx)
  sete   %sil
  add    %esi,%eax
  lea    0x1(%rdx),%rsi
  cmp    %rsi,%rcx
  jbe    L18
  xor    %esi,%esi
  cmpb   $0xa,0x1(%rdx)
  sete   %sil
  add    %esi,%eax
  lea    0x2(%rdx),%rsi
  cmp    %rsi,%rcx
  jbe    L18
  xor    %esi,%esi
  cmpb   $0xa,0x2(%rdx)
  sete   %sil
  add    %esi,%eax
  lea    0x3(%rdx),%rsi
  cmp    %rsi,%rcx
  jbe    L18
  xor    %esi,%esi
  cmpb   $0xa,0x3(%rdx)
  sete   %sil
  add    %esi,%eax
  lea    0x4(%rdx),%rsi
  cmp    %rsi,%rcx
  jbe    L18
  xor    %esi,%esi
  cmpb   $0xa,0x4(%rdx)
  sete   %sil
  add    %esi,%eax
  lea    0x5(%rdx),%rsi
  cmp    %rsi,%rcx
  jbe    L18
  xor    %esi,%esi
  cmpb   $0xa,0x5(%rdx)
  sete   %sil
  add    %esi,%eax
  lea    0x6(%rdx),%rsi
  cmp    %rsi,%rcx
  jbe    L18
  xor    %esi,%esi
  cmpb   $0xa,0x6(%rdx)
  sete   %sil
  add    %esi,%eax
  lea    0x7(%rdx),%rsi
  cmp    %rsi,%rcx
  jbe    L18
  xor    %esi,%esi
  cmpb   $0xa,0x7(%rdx)
  sete   %sil
  add    %esi,%eax
  lea    0x8(%rdx),%rsi
  cmp    %rsi,%rcx
  jbe    L18
  xor    %esi,%esi
  cmpb   $0xa,0x8(%rdx)
  sete   %sil
  add    %esi,%eax
  lea    0x9(%rdx),%rsi
  cmp    %rsi,%rcx
  jbe    L18
  xor    %esi,%esi
  cmpb   $0xa,0x9(%rdx)
  sete   %sil
  add    %esi,%eax
  lea    0xa(%rdx),%rsi
  cmp    %rsi,%rcx
  jbe    L18
  xor    %esi,%esi
  cmpb   $0xa,0xa(%rdx)
  sete   %sil
  add    %esi,%eax
  lea    0xb(%rdx),%rsi
  cmp    %rsi,%rcx
  jbe    L18
  xor    %esi,%esi
  cmpb   $0xa,0xb(%rdx)
  sete   %sil
  add    %esi,%eax
  lea    0xc(%rdx),%rsi
  cmp    %rsi,%rcx
  jbe    L18
  xor    %esi,%esi
  cmpb   $0xa,0xc(%rdx)
  sete   %sil
  add    %esi,%eax
  lea    0xd(%rdx),%rsi
  cmp    %rsi,%rcx
  jbe    L18
  xor    %esi,%esi
  cmpb   $0xa,0xd(%rdx)
  sete   %sil
  add    %esi,%eax
  lea    0xe(%rdx),%rsi
  cmp    %rsi,%rcx
  jbe    L18
  cmpb   $0xa,0xe(%rdx)
  sete   %dl
  movzbl %dl,%edx
  add    %edx,%eax
  ret
  nopl   0x0(%rax,%rax,1)
L151:
  xor    %eax,%eax
L18:
  ret
L108:
  xor    %eax,%eax
  jmp    L7
L61:
  ret
```

tool_calls: name: disassemble_data
arguments: data_label: D10
data_type: byte[16]
name: disassemble_data
arguments: data_label: D15
data_type: byte[16]

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

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

assistant: ```c
int count_newlines(const char *start, const char *end) {
  int count = 0;
  while (start < end) {
    if (*start == '\n')
      count++;
    start++;
  }
  return count;
}
```