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

```asm
<frac_pch>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  add    $0xffffffffffffff80,%rsp
  mov    %rdi,-0x58(%rbp)
  mov    %rsi,-0x60(%rbp)
  movss  %xmm0,-0x64(%rbp)
  mov    %edx,-0x68(%rbp)
  mov    %ecx,-0x6c(%rbp)
  mov    %r8d,-0x70(%rbp)
  mov    %r9d,-0x74(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  cmpl   $0x0,-0x68(%rbp)
  jle    L136
  pxor   %xmm1,%xmm1
  cvtss2sd -0x64(%rbp),%xmm1
  movsd  D64(%rip),%xmm0
  addsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,-0x38(%rbp)
  mov    -0x38(%rbp),%eax
  sub    -0x68(%rbp),%eax
  mov    %eax,-0x40(%rbp)
  mov    -0x38(%rbp),%edx
  mov    -0x68(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x3c(%rbp)
  mov    -0x3c(%rbp),%eax
  cmp    -0x70(%rbp),%eax
  jle    L83
  mov    -0x70(%rbp),%eax
  mov    %eax,-0x3c(%rbp)
L83:
  mov    -0x40(%rbp),%eax
  cmp    -0x6c(%rbp),%eax
  jge    L137
  mov    -0x6c(%rbp),%eax
  mov    %eax,-0x40(%rbp)
L137:
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x40(%rbp),%xmm1
  pxor   %xmm2,%xmm2
  cvtsi2sdl -0x38(%rbp),%xmm2
  movsd  D6(%rip),%xmm0
  mulsd  %xmm2,%xmm0
  comisd %xmm1,%xmm0
  jbe    L122
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x38(%rbp),%xmm1
  movsd  D6(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,-0x40(%rbp)
L122:
  mov    -0x38(%rbp),%eax
  mov    %eax,-0x44(%rbp)
  mov    -0x44(%rbp),%eax
  cmp    -0x74(%rbp),%eax
  jge    L150
  mov    -0x74(%rbp),%eax
  mov    %eax,-0x44(%rbp)
L150:
  mov    -0x44(%rbp),%edi
  mov    -0x3c(%rbp),%ecx
  mov    -0x40(%rbp),%edx
  lea    -0x48(%rbp),%rsi
  mov    -0x58(%rbp),%rax
  mov    %edi,%r8d
  mov    %rax,%rdi
  call   <find_pitch@plt>
  movd   %xmm0,%eax
  mov    %eax,-0x64(%rbp)
L136:
  pxor   %xmm1,%xmm1
  cvtss2sd -0x64(%rbp),%xmm1
  movsd  D64(%rip),%xmm0
  addsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,-0x38(%rbp)
  mov    -0x38(%rbp),%eax
  cmp    -0x70(%rbp),%eax
  jl     L33
  mov    -0x70(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x38(%rbp)
L33:
  mov    -0x38(%rbp),%eax
  mov    %eax,-0x44(%rbp)
  mov    -0x44(%rbp),%eax
  cmp    -0x74(%rbp),%eax
  jge    L22
  mov    -0x74(%rbp),%eax
  mov    %eax,-0x44(%rbp)
L22:
  mov    -0x44(%rbp),%edx
  mov    -0x38(%rbp),%eax
  add    %edx,%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  neg    %eax
  mov    %eax,-0x28(%rbp)
  mov    -0x28(%rbp),%edx
  mov    -0x38(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x58(%rbp),%rax
  lea    (%rdx,%rax,1),%rsi
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x58(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x44(%rbp),%eax
  mov    %eax,%edx
  mov    %rcx,%rdi
  call   <v_inner@plt>
  movd   %xmm0,%eax
  mov    %eax,-0x34(%rbp)
  mov    -0x28(%rbp),%edx
  mov    -0x38(%rbp),%eax
  add    %edx,%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x58(%rbp),%rax
  lea    (%rdx,%rax,1),%rsi
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x58(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x44(%rbp),%eax
  mov    %eax,%edx
  mov    %rcx,%rdi
  call   <v_inner@plt>
  movd   %xmm0,%eax
  mov    %eax,-0x30(%rbp)
  mov    -0x28(%rbp),%edx
  mov    -0x38(%rbp),%eax
  add    %edx,%eax
  cltq
  shl    $0x2,%rax
  lea    -0x4(%rax),%rdx
  mov    -0x58(%rbp),%rax
  lea    (%rdx,%rax,1),%rsi
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x58(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x44(%rbp),%eax
  mov    %eax,%edx
  mov    %rcx,%rdi
  call   <v_inner@plt>
  movd   %xmm0,%eax
  mov    %eax,-0x24(%rbp)
  movss  -0x24(%rbp),%xmm0
  comiss -0x30(%rbp),%xmm0
  jbe    L141
  movss  -0x34(%rbp),%xmm0
  movss  %xmm0,-0x30(%rbp)
  movss  -0x24(%rbp),%xmm0
  movss  %xmm0,-0x34(%rbp)
  subl   $0x1,-0x38(%rbp)
L141:
  mov    -0x28(%rbp),%edx
  mov    -0x38(%rbp),%eax
  add    %edx,%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x58(%rbp),%rax
  lea    (%rdx,%rax,1),%rsi
  mov    -0x28(%rbp),%edx
  mov    -0x38(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x58(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x44(%rbp),%eax
  mov    %eax,%edx
  mov    %rcx,%rdi
  call   <v_inner@plt>
  movd   %xmm0,%eax
  mov    %eax,-0x20(%rbp)
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x58(%rbp),%rax
  lea    (%rdx,%rax,1),%rsi
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x58(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x44(%rbp),%eax
  mov    %eax,%edx
  mov    %rcx,%rdi
  call   <v_inner@plt>
  movd   %xmm0,%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x28(%rbp),%edx
  mov    -0x38(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x58(%rbp),%rax
  lea    (%rdx,%rax,1),%rsi
  mov    -0x28(%rbp),%edx
  mov    -0x38(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x58(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x44(%rbp),%eax
  mov    %eax,%edx
  mov    %rcx,%rdi
  call   <v_inner@plt>
  movd   %xmm0,%eax
  mov    %eax,-0x18(%rbp)
  mov    -0x28(%rbp),%edx
  mov    -0x38(%rbp),%eax
  add    %edx,%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x58(%rbp),%rax
  lea    (%rdx,%rax,1),%rsi
  mov    -0x28(%rbp),%edx
  mov    -0x38(%rbp),%eax
  add    %edx,%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x58(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x44(%rbp),%eax
  mov    %eax,%edx
  mov    %rcx,%rdi
  call   <v_inner@plt>
  movd   %xmm0,%eax
  mov    %eax,-0x14(%rbp)
  movss  -0x18(%rbp),%xmm0
  subss  -0x20(%rbp),%xmm0
  movaps %xmm0,%xmm1
  mulss  -0x30(%rbp),%xmm1
  movss  -0x14(%rbp),%xmm0
  subss  -0x20(%rbp),%xmm0
  mulss  -0x34(%rbp),%xmm0
  addss  %xmm1,%xmm0
  movss  %xmm0,-0x10(%rbp)
  mov    -0x10(%rbp),%eax
  movd   %eax,%xmm0
  call   <fabs@plt>
  movq   %xmm0,%rax
  movq   %rax,%xmm3
  comisd D19(%rip),%xmm3
  jbe    L147
  movss  -0x30(%rbp),%xmm0
  mulss  -0x18(%rbp),%xmm0
  movss  -0x34(%rbp),%xmm1
  mulss  -0x20(%rbp),%xmm1
  subss  %xmm1,%xmm0
  divss  -0x10(%rbp),%xmm0
  movss  %xmm0,-0x2c(%rbp)
  jmp    L109
L147:
  movss  D0(%rip),%xmm0
  movss  %xmm0,-0x2c(%rbp)
L109:
  movss  -0x2c(%rbp),%xmm0
  comiss D83(%rip),%xmm0
  jbe    L169
  movss  D83(%rip),%xmm0
  movss  %xmm0,-0x2c(%rbp)
L169:
  movss  D94(%rip),%xmm0
  comiss -0x2c(%rbp),%xmm0
  jbe    L121
  movss  D94(%rip),%xmm0
  movss  %xmm0,-0x2c(%rbp)
L121:
  pxor   %xmm0,%xmm0
  cvtsi2ssl -0x38(%rbp),%xmm0
  movss  -0x2c(%rbp),%xmm1
  addss  %xmm1,%xmm0
  movss  %xmm0,-0x64(%rbp)
  pxor   %xmm1,%xmm1
  cvtsi2ssl -0x70(%rbp),%xmm1
  movss  -0x64(%rbp),%xmm0
  comiss %xmm1,%xmm0
  jbe    L124
  pxor   %xmm0,%xmm0
  cvtsi2ssl -0x70(%rbp),%xmm0
  movss  %xmm0,-0x64(%rbp)
L124:
  pxor   %xmm0,%xmm0
  cvtsi2ssl -0x6c(%rbp),%xmm0
  comiss -0x64(%rbp),%xmm0
  jbe    L51
  pxor   %xmm0,%xmm0
  cvtsi2ssl -0x6c(%rbp),%xmm0
  movss  %xmm0,-0x64(%rbp)
L51:
  pxor   %xmm1,%xmm1
  cvtsi2ssl -0x38(%rbp),%xmm1
  movss  -0x64(%rbp),%xmm0
  subss  %xmm1,%xmm0
  movss  %xmm0,-0x2c(%rbp)
  movss  D51(%rip),%xmm0
  subss  -0x2c(%rbp),%xmm0
  movss  %xmm0,-0xc(%rbp)
  movss  -0xc(%rbp),%xmm0
  mulss  %xmm0,%xmm0
  movaps %xmm0,%xmm1
  mulss  -0x18(%rbp),%xmm1
  movss  -0x2c(%rbp),%xmm0
  addss  %xmm0,%xmm0
  mulss  -0xc(%rbp),%xmm0
  mulss  -0x20(%rbp),%xmm0
  addss  %xmm0,%xmm1
  movss  -0x2c(%rbp),%xmm0
  mulss  %xmm0,%xmm0
  mulss  -0x14(%rbp),%xmm0
  addss  %xmm1,%xmm0
  movss  -0x1c(%rbp),%xmm1
  mulss  %xmm1,%xmm0
  movss  %xmm0,-0x10(%rbp)
  mov    -0x10(%rbp),%eax
  movd   %eax,%xmm0
  call   <sqrt@plt>
  movd   %xmm0,%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x10(%rbp),%eax
  movd   %eax,%xmm0
  call   <fabs@plt>
  movq   %xmm0,%rax
  movq   %rax,%xmm4
  comisd D19(%rip),%xmm4
  jbe    L30
  movss  -0xc(%rbp),%xmm0
  movaps %xmm0,%xmm1
  mulss  -0x34(%rbp),%xmm1
  movss  -0x2c(%rbp),%xmm0
  mulss  -0x30(%rbp),%xmm0
  addss  %xmm1,%xmm0
  divss  -0x10(%rbp),%xmm0
  mov    -0x60(%rbp),%rax
  movss  %xmm0,(%rax)
  jmp    L95
L30:
  mov    -0x60(%rbp),%rax
  pxor   %xmm0,%xmm0
  movss  %xmm0,(%rax)
L95:
  movss  -0x64(%rbp),%xmm0
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L74
  call   <__stack_chk_fail@plt>
L74:
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: tag: D64
type_infered: f64
name: retrieve_data
arguments: tag: D6
type_infered: f64
name: retrieve_data
arguments: tag: D19
type_infered: f64[2]
name: retrieve_data
arguments: tag: D0
type_infered: byte[4]
name: retrieve_data
arguments: tag: D83
type_infered: f32
name: retrieve_data
arguments: tag: D94
type_infered: byte[4]
name: retrieve_data
arguments: tag: D51
type_infered: f32

tool: D64: 0.5

tool: D6: 0.75

tool: {"D19": [0.01,2.0000004693865776]}

tool: {"D0": [0x00,0x00,0x00,0x3f]}

tool: D83: 2

tool: {"D94": [0x00,0x00,0x80,0xbf]}

tool: D51: 1

assistant: ```c
float frac_pch(float sig_in[], float *pcorr, float fpitch, int range, int pmin, int pmax, int lmin) {
  int length, cbegin, lower, upper, ipitch;
  float c0_0, c0_T, c0_T1, cT_T, cT_T1, cT1_T1, c0_Tm1;
  float frac, frac1;
  float corr, denom;
  if (range > 0) {
    ipitch = fpitch + 0.5;
    lower = ipitch - range;
    upper = ipitch + range;
    if (upper > pmax)
      upper = pmax;
    if (lower < pmin)
      lower = pmin;
    if (lower < 0.75 * ipitch)
      lower = 0.75 * ipitch;
    length = ipitch;
    if (length < lmin)
      length = lmin;
    fpitch = find_pitch(sig_in, &corr, lower, upper, length);
  }
  ipitch = fpitch + 0.5;
  if (ipitch >= pmax)
    ipitch = pmax - 1;
  length = ipitch;
  if (length < lmin)
    length = lmin;
  cbegin = -((length + ipitch) / 2);
  c0_T = v_inner(&sig_in[cbegin], &sig_in[cbegin + ipitch], length);
  c0_T1 = v_inner(&sig_in[cbegin], &sig_in[cbegin + ipitch + 1], length);
  c0_Tm1 = v_inner(&sig_in[cbegin], &sig_in[cbegin + ipitch - 1], length);
  if (c0_Tm1 > c0_T1) {
    c0_T1 = c0_T;
    c0_T = c0_Tm1;
    ipitch--;
  }
  cT_T1 = v_inner(&sig_in[cbegin + ipitch], &sig_in[cbegin + ipitch + 1], length);
  c0_0 = v_inner(&sig_in[cbegin], &sig_in[cbegin], length);
  cT_T = v_inner(&sig_in[cbegin + ipitch], &sig_in[cbegin + ipitch], length);
  cT1_T1 = v_inner(&sig_in[cbegin + ipitch + 1], &sig_in[cbegin + ipitch + 1], length);
  denom = c0_T1 * (cT_T - cT_T1) + c0_T * (cT1_T1 - cT_T1);
  if (fabs(denom) > 0.01)
    frac = (c0_T1 * cT_T - c0_T * cT_T1) / denom;
  else
    frac = 0.5;
  if (frac > 2.0)
    frac = 2.0;
  if (frac < -1.0)
    frac = -1.0;
  fpitch = ipitch + frac;
  if (fpitch > pmax)
    fpitch = pmax;
  if (fpitch < pmin)
    fpitch = pmin;
  frac = fpitch - ipitch;
  frac1 = 1.0 - frac;
  denom = c0_0 * (frac1 * frac1 * cT_T + 2 * frac * frac1 * cT_T1 + frac * frac * cT1_T1);
  denom = sqrt(denom);
  if (fabs(denom) > 0.01)
    *pcorr = (frac1 * c0_T + frac * c0_T1) / denom;
  else
    *pcorr = 0.0;
  return (fpitch);
}
```