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

```asm
<compute_delay>:
  endbr64
  push   %r15
  mov    %rsi,%r15
  push   %r14
  mov    %rsi,%r14
  push   %r13
  sub    %rdi,%r14
  mov    %r8,%r13
  push   %r12
  push   %rbp
  mov    %rcx,%rbp
  push   %rbx
  mov    %rdi,%rbx
  lea    (%r14,%r14,1),%edi
  sub    $0x38,%rsp
  mov    %r9,0x20(%rsp)
  mov    %rdx,0x28(%rsp)
  mov    %rcx,(%rsp)
  call   <nextpow2@plt>
  mov    %r14,%rcx
  mov    %r15,%rdx
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  mov    %rax,%r12
  call   <pow_of@plt>
  pxor   %xmm1,%xmm1
  pxor   %xmm2,%xmm2
  mov    %r14,%rcx
  cvtsi2sd %r14,%xmm1
  movapd %xmm0,%xmm3
  mov    %r15,%rdx
  mov    %rbx,%rsi
  cvtsi2sd %r12,%xmm2
  mov    %r13,%rdi
  mulsd  %xmm1,%xmm3
  movsd  %xmm1,0x18(%rsp)
  movsd  %xmm2,0x10(%rsp)
  divsd  %xmm2,%xmm3
  movsd  %xmm3,0x8(%rsp)
  call   <pow_of@plt>
  movsd  0x18(%rsp),%xmm1
  movsd  0x10(%rsp),%xmm2
  movsd  0x8(%rsp),%xmm3
  mov    0x20(%rsp),%r9
  mulsd  %xmm0,%xmm1
  pxor   %xmm0,%xmm0
  divsd  %xmm2,%xmm1
  movapd %xmm3,%xmm2
  mulsd  %xmm1,%xmm2
  ucomisd %xmm2,%xmm0
  ja     L193
  sqrtsd %xmm2,%xmm2
L224:
  movsd  D23(%rip),%xmm0
  comisd %xmm3,%xmm0
  jae    L218
  comisd %xmm1,%xmm0
  jb     L386
L218:
  movl   $0x0,(%r9)
  add    $0x38,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L386:
  lea    0x8(,%r12,4),%rdx
  mov    %r9,0x18(%rsp)
  mov    %rdx,%rdi
  mov    %rdx,0x8(%rsp)
  movsd  %xmm2,0x10(%rsp)
  call   <safe_malloc@plt>
  mov    0x8(%rsp),%rdi
  mov    %rax,%rbp
  call   <safe_malloc@plt>
  mov    0x8(%rsp),%rdi
  mov    %rax,%r15
  call   <safe_malloc@plt>
  cmp    $0xffffffffffffffff,%r12
  mov    0x8(%rsp),%rdx
  movsd  0x10(%rsp),%xmm2
  mov    0x18(%rsp),%r9
  mov    %rax,%r10
  jl     L277
  lea    (%rdx,%r10,1),%rsi
  lea    (%rdx,%rbp,1),%rax
  cmp    %rsi,%rbp
  lea    (%rdx,%r15,1),%rcx
  setae  %r11b
  cmp    %rax,%r10
  setae  %dil
  mov    %r11d,%r8d
  or     %edi,%r8d
  cmp    %rcx,%rbp
  setae  %r11b
  cmp    %rax,%r15
  setae  %dil
  or     %edi,%r11d
  test   %r11b,%r8b
  je     L34
  cmp    %rsi,%r15
  setae  %sil
  cmp    %rcx,%r10
  setae  %dil
  or     %dil,%sil
  je     L34
  xor    %esi,%esi
  mov    %rbp,%rdi
  mov    %r9,0x20(%rsp)
  mov    %r10,0x10(%rsp)
  movsd  %xmm2,0x18(%rsp)
  mov    %rdx,0x8(%rsp)
  call   <memset@plt>
  mov    0x8(%rsp),%rdx
  xor    %esi,%esi
  mov    %r15,%rdi
  call   <memset@plt>
  mov    0x8(%rsp),%rdx
  mov    0x10(%rsp),%rdi
  xor    %esi,%esi
  call   <memset@plt>
  movsd  0x18(%rsp),%xmm2
  mov    0x20(%rsp),%r9
  mov    %rax,%r10
L277:
  test   %r14,%r14
  jle    L337
  mov    (%rsp),%r8
  lea    0x4(,%rbx,4),%rsi
  mov    %rbp,%rdx
  mov    %r15,%r11
  lea    -0x4(%rsi),%rax
  lea    (%r8,%rsi,1),%rdi
  lea    0x0(%r13,%rax,1),%rcx
  sub    %rdi,%rdx
  cmp    $0x8,%rdx
  seta   %dl
  sub    %rdi,%r11
  cmp    $0x8,%r11
  lea    0x0(%r13,%rsi,1),%r11
  seta   %dil
  and    %edi,%edx
  cmp    $0x1,%r14
  setne  %dil
  and    %edi,%edx
  mov    %r15,%rdi
  sub    %r11,%rdi
  cmp    $0x8,%rdi
  seta   %dil
  and    %edx,%edi
  lea    0xc(%r13,%rsi,1),%rdx
  lea    0x10(%rbp),%rsi
  cmp    %rdx,%rbp
  setae  %dl
  cmp    %rsi,%rcx
  setae  %sil
  or     %esi,%edx
  test   %dl,%dil
  je     L340
  lea    0x4(%rbp),%rsi
  mov    %r15,%rdx
  sub    %rsi,%rdx
  cmp    $0x8,%rdx
  jbe    L340
  lea    -0x1(%r14),%rdx
  mov    %r14,%rsi
  cmp    $0x2,%rdx
  jbe    L95
  shr    $0x2,%rsi
  sub    %rbp,%rax
  sub    %rbp,%rcx
  mov    %r15,%r11
  shl    $0x4,%rsi
  mov    %rbp,%rdx
  add    %r8,%rax
  mov    %rcx,%rdi
  movaps D25(%rip),%xmm1
  add    %rbp,%rsi
  sub    %rbp,%r11
  nopl   0x0(%rax,%rax,1)
L13:
  movups (%rax,%rdx,1),%xmm0
  andps  %xmm1,%xmm0
  movups %xmm0,(%rdx)
  movups (%rdi,%rdx,1),%xmm0
  andps  %xmm1,%xmm0
  movups %xmm0,(%r11,%rdx,1)
  add    $0x10,%rdx
  cmp    %rdx,%rsi
  jne    L13
  mov    %r14,%rdx
  and    $0xfffffffffffffffc,%rdx
  mov    %rdx,%rax
  cmp    %rdx,%r14
  je     L337
  mov    %r14,%rsi
  sub    %rdx,%rsi
  cmp    $0x1,%rsi
  je     L366
L101:
  mov    (%rsp),%rdi
  lea    (%rdx,%rbx,1),%rcx
  movq   D25(%rip),%xmm1
  movq   (%rdi,%rcx,4),%xmm0
  andps  %xmm1,%xmm0
  movlps %xmm0,0x0(%rbp,%rdx,4)
  movq   0x0(%r13,%rcx,4),%xmm0
  andps  %xmm1,%xmm0
  movlps %xmm0,(%r15,%rdx,4)
  mov    %rsi,%rdx
  and    $0xfffffffffffffffe,%rdx
  add    %rdx,%rax
  cmp    %rdx,%rsi
  je     L337
L366:
  mov    (%rsp),%rcx
  add    %rax,%rbx
  movss  D39(%rip),%xmm1
  movss  (%rcx,%rbx,4),%xmm0
  andps  %xmm1,%xmm0
  movss  %xmm0,0x0(%rbp,%rax,4)
  movss  0x0(%r13,%rbx,4),%xmm0
  andps  %xmm1,%xmm0
  movss  %xmm0,(%r15,%rax,4)
L337:
  mov    %r12,%rsi
  mov    %rbp,%rdi
  mov    %r9,0x10(%rsp)
  mov    %r10,(%rsp)
  movsd  %xmm2,0x8(%rsp)
  call   <RealFFT@plt>
  mov    %r12,%rsi
  mov    %r15,%rdi
  call   <RealFFT@plt>
  mov    %r12,%rcx
  mov    (%rsp),%r10
  movsd  0x8(%rsp),%xmm2
  shr    $0x3f,%rcx
  mov    0x10(%rsp),%r9
  add    %r12,%rcx
  sar    %rcx
  cmp    $0xffffffffffffffff,%r12
  jl     L258
  xor    %edx,%edx
  test   %rcx,%rcx
  pxor   %xmm1,%xmm1
  cmovns %rcx,%rdx
  cvtsi2ss %r12,%xmm1
  lea    0x1(%rdx),%rsi
  cmp    $0x1,%r12
  jle    L35
  mov    %rsi,%rdi
  movaps %xmm1,%xmm3
  mov    %rbp,%rax
  shr    %rdi
  shufps $0x0,%xmm3,%xmm3
  shl    $0x4,%rdi
  add    %rbp,%rdi
  nopl   0x0(%rax)
L244:
  movups (%rax),%xmm0
  add    $0x10,%rax
  divps  %xmm3,%xmm0
  movups %xmm0,-0x10(%rax)
  cmp    %rdi,%rax
  jne    L244
  mov    %rsi,%rax
  and    $0xfffffffffffffffe,%rax
  test   $0x1,%sil
  je     L127
L301:
  shl    $0x3,%rax
  lea    0x0(%rbp,%rax,1),%rdi
  lea    0x4(%rbp,%rax,1),%rax
  movss  (%rdi),%xmm0
  divss  %xmm1,%xmm0
  movss  %xmm0,(%rdi)
  movss  (%rax),%xmm0
  divss  %xmm1,%xmm0
  movss  %xmm0,(%rax)
L127:
  lea    0x20(%r15),%rax
  lea    0x20(%r10),%rbx
  mov    %r15,%rdi
  cmp    %rax,%r10
  setae  %r11b
  cmp    %rbx,%r15
  setae  %al
  or     %eax,%r11d
  lea    0x20(%rbp),%rax
  cmp    %rax,%r10
  setae  %al
  cmp    %rbx,%rbp
  setae  %bl
  or     %ebx,%eax
  test   %al,%r11b
  je     L192
  cmp    $0x2,%rdx
  jbe    L192
  mov    %rsi,%r13
  mov    %r10,%rbx
  lea    0x10(%rbp),%rdx
  mov    %rbp,%rax
  shr    $0x2,%r13
  lea    0x10(%r15),%r11
  sub    %rbp,%rbx
  shl    $0x5,%r13
  add    %rbp,%r13
  nopl   (%rax)
L172:
  movups (%rax),%xmm1
  movups (%rdx),%xmm7
  add    $0x20,%rax
  add    $0x20,%rdi
  movups -0x20(%rdi),%xmm4
  add    $0x20,%rdx
  add    $0x20,%r11
  movaps %xmm1,%xmm0
  shufps $0xdd,%xmm7,%xmm1
  movaps %xmm1,%xmm6
  shufps $0x88,%xmm7,%xmm0
  movups -0x20(%r11),%xmm7
  movaps %xmm4,%xmm5
  movaps %xmm0,%xmm3
  shufps $0x88,%xmm7,%xmm5
  shufps $0xdd,%xmm7,%xmm4
  mulps  %xmm5,%xmm3
  mulps  %xmm4,%xmm6
  mulps  %xmm5,%xmm1
  mulps  %xmm4,%xmm0
  addps  %xmm6,%xmm3
  subps  %xmm1,%xmm0
  movaps %xmm3,%xmm1
  unpcklps %xmm0,%xmm1
  unpckhps %xmm0,%xmm3
  movups %xmm1,-0x20(%rax,%rbx,1)
  movups %xmm3,-0x20(%rdx,%rbx,1)
  cmp    %r13,%rax
  jne    L172
  mov    %rsi,%rdx
  and    $0xfffffffffffffffc,%rdx
  and    $0x3,%esi
  je     L258
  lea    0x0(,%rdx,8),%rsi
  lea    0x4(%rsi),%rax
  lea    0x0(%rbp,%rsi,1),%rdi
  lea    0x0(%rbp,%rax,1),%rbx
  lea    (%r15,%rsi,1),%r11
  add    %r15,%rax
  movss  (%rdi),%xmm0
  movss  (%rbx),%xmm1
  mulss  (%r11),%xmm0
  mulss  (%rax),%xmm1
  addss  %xmm1,%xmm0
  movss  %xmm0,(%r10,%rdx,8)
  movss  (%rdi),%xmm0
  movss  (%rbx),%xmm1
  lea    0x1(%rdx),%rdi
  mulss  (%r11),%xmm1
  mulss  (%rax),%xmm0
  subss  %xmm1,%xmm0
  movss  %xmm0,0x4(%r10,%rsi,1)
  cmp    %rdi,%rcx
  jl     L258
  lea    0x0(,%rdi,8),%rax
  add    $0x2,%rdx
  lea    0x4(%rax),%rsi
  lea    0x0(%rbp,%rax,1),%r11
  lea    0x0(%rbp,%rsi,1),%r13
  lea    (%r15,%rax,1),%rbx
  add    %r15,%rsi
  movss  (%r11),%xmm1
  movss  (%rsi),%xmm0
  mulss  (%rbx),%xmm1
  mulss  0x0(%r13),%xmm0
  addss  %xmm1,%xmm0
  movss  %xmm0,(%r10,%rdi,8)
  movss  0x0(%r13),%xmm1
  movss  (%r11),%xmm0
  mulss  (%rbx),%xmm1
  mulss  (%rsi),%xmm0
  subss  %xmm1,%xmm0
  movss  %xmm0,0x4(%r10,%rax,1)
  cmp    %rcx,%rdx
  jg     L258
  lea    0x8(%rax),%rcx
  lea    0xc(%rax),%rdx
  lea    0x0(%rbp,%rcx,1),%rsi
  lea    0x0(%rbp,%rdx,1),%rdi
  add    %r15,%rcx
  add    %r15,%rdx
  movss  (%rsi),%xmm0
  movss  (%rdi),%xmm1
  mulss  (%rcx),%xmm0
  mulss  (%rdx),%xmm1
  addss  %xmm1,%xmm0
  movss  %xmm0,0x8(%r10,%rax,1)
  movss  (%rdi),%xmm1
  movss  (%rsi),%xmm0
  mulss  (%rcx),%xmm1
  mulss  (%rdx),%xmm0
  subss  %xmm1,%xmm0
  movss  %xmm0,0xc(%r10,%rax,1)
L258:
  mov    %r10,%rdi
  mov    %r12,%rsi
  mov    %r9,0x10(%rsp)
  xor    %ebx,%ebx
  mov    %r10,(%rsp)
  movsd  %xmm2,0x8(%rsp)
  call   <RealIFFT@plt>
  mov    0x28(%rsp),%rcx
  mov    0x10(%rsp),%r9
  mov    (%rsp),%r10
  movsd  0x8(%rsp),%xmm2
  mov    %rcx,%rax
  movl   $0x0,(%r9)
  neg    %rax
  test   %rcx,%rcx
  jle    L89
  sub    0x28(%rsp),%r12
  pxor   %xmm3,%xmm3
  pxor   %xmm4,%xmm4
  xor    %ebx,%ebx
  movq   D7(%rip),%xmm5
  lea    (%r10,%r12,4),%rdx
  movss  D39(%rip),%xmm1
  cvtss2sd %xmm3,%xmm4
  nopw   0x0(%rax,%rax,1)
L241:
  movss  (%rdx),%xmm0
  andps  %xmm1,%xmm0
  cvtss2sd %xmm0,%xmm0
  divsd  %xmm2,%xmm0
  andpd  %xmm5,%xmm0
  comisd %xmm4,%xmm0
  jbe    L131
  pxor   %xmm3,%xmm3
  pxor   %xmm4,%xmm4
  mov    %rax,%rbx
  cvtsd2ss %xmm0,%xmm3
  movss  %xmm3,(%r9)
  cvtss2sd %xmm3,%xmm4
L131:
  add    $0x4,%rdx
  add    $0x1,%rax
  jne    L241
  mov    0x28(%rsp),%rcx
  mov    %r10,%rdx
  jmp    L248
  nopl   (%rax)
L342:
  pxor   %xmm4,%xmm4
  cvtss2sd %xmm3,%xmm4
L248:
  movss  (%rdx),%xmm0
  andps  %xmm1,%xmm0
  cvtss2sd %xmm0,%xmm0
  divsd  %xmm2,%xmm0
  andpd  %xmm5,%xmm0
  comisd %xmm4,%xmm0
  jbe    L198
  pxor   %xmm3,%xmm3
  mov    %rax,%rbx
  cvtsd2ss %xmm0,%xmm3
  movss  %xmm3,(%r9)
L198:
  add    $0x1,%rax
  add    $0x4,%rdx
  cmp    %rax,%rcx
  jne    L342
L89:
  mov    %rbp,%rdi
  mov    %r10,(%rsp)
  call   <safe_free@plt>
  mov    %r15,%rdi
  call   <safe_free@plt>
  mov    (%rsp),%rdi
  call   <safe_free@plt>
  add    $0x38,%rsp
  mov    %ebx,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L192:
  lea    0x4(%r15),%rdi
  lea    0x4(%r10),%rsi
  mov    %r15,%rbx
  mov    %r10,%r11
  mov    %rbp,%rax
  xor    %edx,%edx
  sub    %rbp,%rbx
  sub    %rbp,%rdi
  sub    %rbp,%r11
  sub    %rbp,%rsi
  nop
L249:
  lea    (%rbx,%rax,1),%r13
  lea    (%rdi,%rax,1),%r8
  add    $0x1,%rdx
  movss  (%r8),%xmm0
  movss  0x0(%r13),%xmm1
  mulss  0x4(%rax),%xmm0
  mulss  (%rax),%xmm1
  addss  %xmm1,%xmm0
  movss  %xmm0,(%r11,%rax,1)
  movss  0x4(%rax),%xmm1
  movss  (%rax),%xmm0
  mulss  0x0(%r13),%xmm1
  mulss  (%r8),%xmm0
  subss  %xmm1,%xmm0
  movss  %xmm0,(%rsi,%rax,1)
  add    $0x8,%rax
  cmp    %rdx,%rcx
  jge    L249
  jmp    L258
  nopl   (%rax)
L340:
  lea    0x0(%rbp,%r14,4),%rdx
  mov    (%rsp),%r14
  sub    %rbp,%rax
  mov    %r15,%rcx
  add    %rax,%r13
  movss  D39(%rip),%xmm1
  sub    %rbp,%rcx
  add    %rax,%r14
  mov    %rbp,%rax
  nopl   0x0(%rax,%rax,1)
L246:
  movss  (%r14,%rax,1),%xmm0
  andps  %xmm1,%xmm0
  movss  %xmm0,(%rax)
  movss  0x0(%r13,%rax,1),%xmm0
  andps  %xmm1,%xmm0
  movss  %xmm0,(%rcx,%rax,1)
  add    $0x4,%rax
  cmp    %rax,%rdx
  jne    L246
  jmp    L337
L35:
  xor    %eax,%eax
  jmp    L301
L34:
  mov    %r15,%rdi
  mov    %r10,%rsi
  mov    %rbp,%rdx
  sub    %rbp,%rdi
  sub    %rbp,%rsi
L134:
  movl   $0x0,(%rdx)
  movl   $0x0,(%rdi,%rdx,1)
  movl   $0x0,(%rsi,%rdx,1)
  add    $0x4,%rdx
  cmp    %rax,%rdx
  jne    L134
  jmp    L277
L95:
  xor    %edx,%edx
  xor    %eax,%eax
  jmp    L101
L193:
  movapd %xmm2,%xmm0
  mov    %r9,0x18(%rsp)
  movsd  %xmm1,0x10(%rsp)
  movsd  %xmm3,0x8(%rsp)
  call   <sqrt@plt>
  mov    0x18(%rsp),%r9
  movsd  0x10(%rsp),%xmm1
  movsd  0x8(%rsp),%xmm3
  movapd %xmm0,%xmm2
  jmp    L224
```

tool_calls: name: extract_symbolic_data
arguments: tag: D23
data_type: byte[8]
name: extract_symbolic_data
arguments: tag: D25
data_type: dword[4]
name: extract_symbolic_data
arguments: tag: D39
data_type: dword
name: extract_symbolic_data
arguments: tag: D7
data_type: qword

tool: {"D23": [0x8d,0xed,0xb5,0xa0,0xf7,0xc6,0xb0,0x3e]}

tool: {"D25": [0x7fffffff,0x7fffffff,0x7fffffff,0x7fffffff]}

tool: D39: 2147483647

tool: D7: 9223372036854775807

assistant: ```c
int compute_delay(long start_sample, long stop_sample, long search_range, float *time_series1, float *time_series2, float *max_correlation) {
  double power1, power2, normalization;
  long i;
  float *x1, *x2, *y;
  double h;
  long n = stop_sample - start_sample;
  long power_of_2 = nextpow2(2 * n);
  long best_delay;
  power1 = pow_of(time_series1, start_sample, stop_sample, stop_sample - start_sample) * (double)n / (double)power_of_2;
  power2 = pow_of(time_series2, start_sample, stop_sample, stop_sample - start_sample) * (double)n / (double)power_of_2;
  normalization = sqrt(power1 * power2);
  if ((power1 <= 1E-6) || (power2 <= 1E-6)) {
    *max_correlation = 0;
    return 0;
  }
  x1 = (float *)safe_malloc((power_of_2 + 2) * sizeof(float));
  ;
  x2 = (float *)safe_malloc((power_of_2 + 2) * sizeof(float));
  ;
  y = (float *)safe_malloc((power_of_2 + 2) * sizeof(float));
  ;
  for (i = 0; i < power_of_2 + 2; i++) {
    x1[i] = 0.;
    x2[i] = 0.;
    y[i] = 0.;
  }
  for (i = 0; i < n; i++) {
    x1[i] = (float)fabs(time_series1[i + start_sample]);
    x2[i] = (float)fabs(time_series2[i + start_sample]);
  }
  RealFFT(x1, power_of_2);
  RealFFT(x2, power_of_2);
  for (i = 0; i <= power_of_2 / 2; i++) {
    x1[2 * i] /= power_of_2;
    x1[2 * i + 1] /= power_of_2;
  }
  for (i = 0; i <= power_of_2 / 2; i++) {
    y[2 * i] = x1[2 * i] * x2[2 * i] + x1[2 * i + 1] * x2[2 * i + 1];
    y[2 * i + 1] = -x1[2 * i + 1] * x2[2 * i] + x1[2 * i] * x2[2 * i + 1];
  }
  RealIFFT(y, power_of_2);
  best_delay = 0;
  *max_correlation = 0;
  for (i = -search_range; i <= -1; i++) {
    h = (float)fabs(y[(i + power_of_2)]) / normalization;
    if (fabs(h) > (double)*max_correlation) {
      *max_correlation = (float)fabs(h);
      best_delay = i;
    }
  }
  for (i = 0; i < search_range; i++) {
    h = (float)fabs(y[i]) / normalization;
    if (fabs(h) > (double)*max_correlation) {
      *max_correlation = (float)fabs(h);
      best_delay = i;
    }
  }
  safe_free(x1);
  safe_free(x2);
  safe_free(y);
  return best_delay;
}
```