user: 请从给定的汇编指令推导出C源代码：

```asm
<count_diffs>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x28(%rbp)
  mov    %esi,-0x2c(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %ecx,-0x30(%rbp)
  mov    %r8,-0x40(%rbp)
  mov    %r9d,-0x44(%rbp)
  movl   $0x0,-0x10(%rbp)
  movl   $0x0,-0xc(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L87
L7:
  addl   $0x1,-0x10(%rbp)
  mov    -0x2c(%rbp),%eax
  cmp    -0x10(%rbp),%eax
  jg     L39
  mov    -0x30(%rbp),%eax
  mov    %eax,-0x14(%rbp)
  jmp    L75
L39:
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  subsd  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x44(%rbp),%xmm1
  comisd %xmm1,%xmm0
  ja     L7
L75:
  mov    -0xc(%rbp),%eax
  cmp    -0x10(%rbp),%eax
  jge    L46
  mov    -0x10(%rbp),%eax
  mov    %eax,-0xc(%rbp)
L46:
  mov    -0x2c(%rbp),%eax
  cmp    -0xc(%rbp),%eax
  jle    L88
  jmp    L3
L23:
  addl   $0x1,-0xc(%rbp)
  mov    -0x2c(%rbp),%eax
  cmp    -0xc(%rbp),%eax
  jle    L76
L3:
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm2
  movapd %xmm0,%xmm1
  subsd  %xmm2,%xmm1
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x44(%rbp),%xmm0
  comisd %xmm1,%xmm0
  jae    L23
  jmp    L88
L76:
  nop
L88:
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  cvttsd2si %xmm0,%edx
  mov    -0x44(%rbp),%eax
  sub    %edx,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x10(%rbp),%eax
  mov    %eax,-0x8(%rbp)
  jmp    L0
L54:
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  cvttsd2si %xmm0,%edx
  mov    -0x4(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  movsd  D1(%rip),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x8(%rbp)
L0:
  mov    -0x8(%rbp),%eax
  cmp    -0xc(%rbp),%eax
  jl     L54
  addl   $0x1,-0x14(%rbp)
L87:
  mov    -0x14(%rbp),%eax
  cmp    -0x30(%rbp),%eax
  jl     L39
  nop
  nop
  pop    %rbp
  ret
```

tool_calls: name: read_data
arguments: label: D1
data_type: byte[8]

tool: {"D1": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x3f]}

assistant: ```c
void count_diffs(double *x, int Nx, double *y, int Ny, double *diffs, int maxdiff) {
  int curr_y, lo_x, hi_x, curr_x, offset;
  lo_x = 0;
  hi_x = 0;
  for (curr_y = 0; curr_y < Ny; curr_y++) {
    while ((y[curr_y] - x[lo_x]) > maxdiff) {
      lo_x++;
      if (lo_x > Nx - 1) {
        curr_y = Ny;
        break;
      }
    }
    if (hi_x < lo_x)
      hi_x = lo_x;
    if (hi_x <= Nx - 1) {
      while ((x[hi_x] - y[curr_y]) <= maxdiff) {
        hi_x++;
        if (hi_x > Nx - 1)
          break;
      }
    }
    offset = -(int)y[curr_y] + maxdiff;
    for (curr_x = lo_x; curr_x < hi_x; curr_x++) {
      diffs[(int)x[curr_x] + offset]++;
    }
  }
}
```