user: 请将以下的汇编代码转换成C语言代码：

```asm
<xcorr_range>:
  endbr64
  push   %r15
  movapd %xmm0,%xmm3
  push   %r14
  lea    (%rcx,%r9,1),%r14d
  push   %r13
  lea    -0x1(%r14),%eax
  mov    %r8,%r13
  push   %r12
  mov    %r9d,%r12d
  push   %rbp
  mov    %ecx,%ebp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x38,%rsp
  mov    %esi,0x28(%rsp)
  mov    %rdx,0x10(%rsp)
  mov    %eax,0xc(%rsp)
  cmp    %esi,%eax
  jg     L335
  sub    0xc(%rsp),%esi
  jne    L270
L216:
  mov    0x28(%rsp),%eax
  test   %eax,%eax
  jle    L165
  lea    -0x1(%rbp),%edx
  mov    0x10(%rsp),%rsi
  mov    %rbx,%rax
  mov    0xc(%rsp),%edi
  not    %rdx
  lea    0x1(%r12),%ebx
  pxor   %xmm5,%xmm5
  xor    %r10d,%r10d
  shl    $0x3,%rdx
  mov    %rsi,%rcx
  sub    %r14d,%ebx
  movsd  D20(%rip),%xmm4
  mov    %rdx,0x18(%rsp)
  movslq %ebp,%rdx
  movsd  D32(%rip),%xmm6
  lea    (%rsi,%rdx,8),%r15
  movslq %r12d,%rdx
  lea    0x0(%r13,%rdx,8),%r11
  lea    -0x1(%r12),%edx
  not    %rdx
  lea    0x0(,%rdx,8),%rsi
  lea    -0x2(%rbp,%r12,1),%edx
  mov    %edx,0x2c(%rsp)
  mov    %rsi,0x20(%rsp)
  mov    $0xfffffffffffffff8,%rsi
  nopl   (%rax)
L285:
  movq   $0x0,(%rax)
  cmp    %r10d,0xc(%rsp)
  jl     L287
  cmp    %r12d,%ebp
  jl     L132
  cmp    %r10d,%r12d
  jg     L334
  cmp    %r10d,%ebp
  jle    L292
  mov    0x20(%rsp),%r8
  xor    %edx,%edx
  movapd %xmm5,%xmm0
  test   %r12d,%r12d
  jle    L225
  nopl   0x0(%rax)
L54:
  movsd  (%rcx,%rdx,1),%xmm2
  mulsd  -0x8(%r11,%rdx,1),%xmm2
  sub    $0x8,%rdx
  addsd  %xmm2,%xmm0
  movsd  %xmm0,(%rax)
  cmp    %rdx,%r8
  jne    L54
  nopl   (%rax)
L225:
  ucomisd %xmm4,%xmm3
  jp     L261
  je     L75
L261:
  comisd %xmm3,%xmm0
  ja     L253
L75:
  ucomisd %xmm6,%xmm1
  jp     L127
  je     L287
L127:
  comisd %xmm0,%xmm1
  ja     L253
L287:
  add    $0x1,%r10d
  add    $0x8,%rax
  sub    $0x1,%edi
  add    $0x8,%rcx
  sub    $0x8,%rsi
  add    $0x1,%ebx
  cmp    %r10d,0x28(%rsp)
  jne    L285
L165:
  xor    %r10d,%r10d
L253:
  add    $0x38,%rsp
  mov    %r10d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L132:
  cmp    %r10d,%ebp
  jg     L304
  cmp    %r10d,%r12d
  jle    L294
  test   %ebp,%ebp
  jle    L300
  mov    0x2c(%rsp),%edx
  mov    0x18(%rsp),%r9
  movapd %xmm5,%xmm0
  sub    %r10d,%edx
  movslq %edx,%rdx
  lea    0x0(%r13,%rdx,8),%r8
  xor    %edx,%edx
  nopl   0x0(%rax)
L241:
  movsd  -0x8(%r15,%rdx,1),%xmm2
  mulsd  (%r8,%rdx,1),%xmm2
  sub    $0x8,%rdx
  addsd  %xmm2,%xmm0
  movsd  %xmm0,(%rax)
  cmp    %rdx,%r9
  jne    L241
  jmp    L225
  nopl   0x0(%rax,%rax,1)
L292:
  test   %edi,%edi
  jle    L300
  mov    %ebp,%edx
  mov    0x10(%rsp),%r9
  mov    %edi,%r14d
  movapd %xmm5,%xmm0
  sub    %edi,%edx
  movslq %edx,%rdx
  lea    (%r9,%rdx,8),%r9
  movslq %ebx,%rdx
  lea    0x0(%r13,%rdx,8),%r8
  xor    %edx,%edx
  nopl   0x0(%rax)
L17:
  movsd  (%r9,%rdx,8),%xmm2
  mulsd  -0x8(%r8,%rdx,8),%xmm2
  add    $0x1,%rdx
  addsd  %xmm2,%xmm0
  movsd  %xmm0,(%rax)
  cmp    %rdx,%r14
  jne    L17
  jmp    L225
  nopl   0x0(%rax,%rax,1)
L294:
  test   %edi,%edi
  jle    L300
  mov    %ebp,%edx
  mov    0x10(%rsp),%r14
  mov    %edi,%r9d
  movapd %xmm5,%xmm0
  sub    %edi,%edx
  movslq %edx,%rdx
  lea    (%r14,%rdx,8),%r8
  xor    %edx,%edx
  nopl   0x0(%rax)
L189:
  movsd  (%r8,%rdx,8),%xmm2
  mulsd  0x0(%r13,%rdx,8),%xmm2
  add    $0x1,%rdx
  addsd  %xmm2,%xmm0
  movsd  %xmm0,(%rax)
  cmp    %rdx,%r9
  jne    L189
  jmp    L225
  nopl   0x0(%rax,%rax,1)
L304:
  xor    %edx,%edx
  movapd %xmm5,%xmm0
  xchg   %ax,%ax
L193:
  movsd  (%rcx,%rdx,1),%xmm2
  mulsd  -0x8(%r11,%rdx,1),%xmm2
  sub    $0x8,%rdx
  addsd  %xmm2,%xmm0
  movsd  %xmm0,(%rax)
  cmp    %rdx,%rsi
  jne    L193
  jmp    L225
  nopw   0x0(%rax,%rax,1)
L334:
  xor    %edx,%edx
  movapd %xmm5,%xmm0
  xchg   %ax,%ax
L34:
  movsd  (%rcx,%rdx,1),%xmm2
  mulsd  -0x8(%r11,%rdx,1),%xmm2
  sub    $0x8,%rdx
  addsd  %xmm2,%xmm0
  movsd  %xmm0,(%rax)
  cmp    %rdx,%rsi
  jne    L34
  jmp    L225
  nopw   0x0(%rax,%rax,1)
L300:
  movapd %xmm5,%xmm0
  jmp    L225
  nopl   0x0(%rax)
L270:
  lea    D35(%rip),%rdi
  xor    %eax,%eax
  movsd  %xmm1,0x20(%rsp)
  movsd  %xmm0,0x18(%rsp)
  call   <printf@plt>
  movsd  0x20(%rsp),%xmm1
  movsd  0x18(%rsp),%xmm3
  jmp    L216
  nopl   0x0(%rax,%rax,1)
L335:
  lea    D23(%rip),%rdi
  movsd  %xmm1,0x20(%rsp)
  movsd  %xmm0,0x18(%rsp)
  call   <puts@plt>
  movsd  0x18(%rsp),%xmm3
  movsd  0x20(%rsp),%xmm1
  jmp    L216
```

tool_calls: name: disassemble_data
arguments: data_tag: D20
type: f32[2]
name: disassemble_data
arguments: data_tag: D32
type: f32[2]
name: disassemble_data
arguments: data_tag: D35
type: string
name: disassemble_data
arguments: data_tag: D23
type: string

tool: {"D20": [0.0,-7.499969482421875]}

tool: {"D32": [0.0,7.4999542236328125]}

tool: D35: [xcorr] output vector has %d dummy values at the end of it


tool: D23: [xcorr] output vector is shorter than which it was expected

assistant: ```c
int xcorr_range(double *output, int len_output, double *rev, int len_rev, double *local, int len_local, double max_threshold, double min_threshold) {
  int len_out = len_rev + len_local - 1;
  int oBuff;
  int len_win;
  int i;
  int len_dummy;
  if (len_output < len_out)
    printf("[xcorr] output vector is shorter than which it was expected\n");
  else if ((len_dummy = len_output - len_out) > 0)
    printf("[xcorr] output vector has %d dummy values at the end of it\n", len_dummy);
  for (oBuff = 0; oBuff < len_output; oBuff++) {
    output[oBuff] = 0.;
    if (oBuff > len_out)
      continue;
    if (len_rev >= len_local) {
      if (oBuff < len_local) {
        len_win = oBuff;
        for (i = 0; i <= oBuff; i++)
          output[oBuff] += rev[len_win - i] * local[len_local - 1 - i];
      } else if (oBuff >= len_rev) {
        len_win = len_out - oBuff;
        for (i = 0; i < len_win; i++)
          output[oBuff] += rev[len_rev - len_win + i] * local[len_local - len_win - 1 + i];
      } else {
        len_win = len_local;
        for (i = 0; i < len_win; i++)
          output[oBuff] += rev[oBuff - i] * local[len_win - 1 - i];
      }
    } else {
      if (oBuff < len_rev) {
        len_win = oBuff;
        for (i = 0; i <= len_win; i++)
          output[oBuff] += rev[len_win - i] * local[len_local - 1 - i];
      } else if (oBuff >= len_local) {
        len_win = len_out - oBuff;
        for (i = 0; i < len_win; i++)
          output[oBuff] += rev[len_rev - len_win + i] * local[i];
      } else {
        len_win = len_rev;
        for (i = 0; i < len_win; i++)
          output[oBuff] += rev[len_win - 1 - i] * local[len_local - 1 - (oBuff + 1 - len_rev) - i];
      }
    }
    if ((max_threshold != -65534 && output[oBuff] > max_threshold) || (min_threshold != 65533 && output[oBuff] < min_threshold))
      return oBuff;
  }
  return 0;
}
```