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

```asm
<xscale_calc_coeffs>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x98,%rsp
  mov    %edi,-0x84(%rbp)
  mov    %esi,-0x88(%rbp)
  mov    %rdx,-0x90(%rbp)
  mov    %rcx,-0x98(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x74(%rbp)
  movl   $0x0,-0x70(%rbp)
  mov    -0x88(%rbp),%edx
  mov    -0x84(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <calc_taps@plt>
  mov    %eax,-0x6c(%rbp)
  pxor   %xmm1,%xmm1
  cvtsi2ssl -0x6c(%rbp),%xmm1
  movss  D0(%rip),%xmm0
  divss  %xmm1,%xmm0
  movss  %xmm0,-0x68(%rbp)
  movl   $0x0,-0x7c(%rbp)
  jmp    L83
L25:
  mov    -0x7c(%rbp),%edx
  mov    -0x88(%rbp),%ecx
  mov    -0x84(%rbp),%eax
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <map@plt>
  neg    %eax
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  mulss  -0x68(%rbp),%xmm0
  mov    -0x7c(%rbp),%eax
  cltq
  shl    $0x4,%rax
  lea    -0x10(%rax),%rax
  add    %rbp,%rax
  sub    $0x50,%rax
  movss  %xmm0,(%rax)
  mov    -0x7c(%rbp),%eax
  cltq
  shl    $0x4,%rax
  lea    -0x10(%rax),%rax
  add    %rbp,%rax
  sub    $0x4c,%rax
  movss  D12(%rip),%xmm0
  movss  %xmm0,(%rax)
  addl   $0x1,-0x7c(%rbp)
L83:
  cmpl   $0x3,-0x7c(%rbp)
  jle    L25
  movl   $0x0,-0x7c(%rbp)
  jmp    L95
L36:
  movl   $0x0,-0x78(%rbp)
  jmp    L58
L47:
  mov    -0x78(%rbp),%eax
  cltq
  shl    $0x4,%rax
  lea    -0x10(%rax),%rax
  add    %rbp,%rax
  sub    $0x50,%rax
  movss  (%rax),%xmm0
  cvttss2si %xmm0,%eax
  mov    %eax,%edi
  call   <fabsf@plt>
  movd   %xmm0,%eax
  mov    %eax,-0x64(%rbp)
  mov    -0x64(%rbp),%eax
  movd   %eax,%xmm0
  call   <catrom@plt>
  movd   %xmm0,%eax
  mov    -0x78(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x90(%rbp),%rdx
  add    %rcx,%rdx
  movd   %eax,%xmm0
  mulss  -0x68(%rbp),%xmm0
  movss  %xmm0,(%rdx)
  mov    -0x78(%rbp),%eax
  cltq
  shl    $0x4,%rax
  lea    -0x10(%rax),%rax
  add    %rbp,%rax
  sub    $0x4c,%rax
  movss  (%rax),%xmm0
  mov    -0x78(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x90(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm1
  subss  %xmm1,%xmm0
  mov    -0x78(%rbp),%eax
  cltq
  shl    $0x4,%rax
  lea    -0x10(%rax),%rax
  add    %rbp,%rax
  sub    $0x4c,%rax
  movss  %xmm0,(%rax)
  movss  -0x68(%rbp),%xmm0
  comiss -0x64(%rbp),%xmm0
  jbe    L6
  mov    -0x78(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x90(%rbp),%rax
  add    %rax,%rdx
  mov    -0x78(%rbp),%eax
  cltq
  shl    $0x4,%rax
  lea    -0x10(%rax),%rax
  add    %rbp,%rax
  sub    $0x48,%rax
  mov    %rdx,(%rax)
L6:
  mov    -0x78(%rbp),%eax
  cltq
  shl    $0x4,%rax
  lea    -0x10(%rax),%rax
  add    %rbp,%rax
  sub    $0x50,%rax
  movss  (%rax),%xmm0
  addss  -0x68(%rbp),%xmm0
  mov    -0x78(%rbp),%eax
  cltq
  shl    $0x4,%rax
  lea    -0x10(%rax),%rax
  add    %rbp,%rax
  sub    $0x50,%rax
  movss  %xmm0,(%rax)
  addl   $0x1,-0x78(%rbp)
L58:
  cmpl   $0x3,-0x78(%rbp)
  jle    L47
  addl   $0x1,-0x70(%rbp)
  addq   $0x10,-0x90(%rbp)
  movss  -0x60(%rbp),%xmm0
  comiss D33(%rip),%xmm0
  jb     L81
  mov    -0x58(%rbp),%rax
  movss  (%rax),%xmm1
  movss  -0x5c(%rbp),%xmm0
  mov    -0x58(%rbp),%rax
  addss  %xmm1,%xmm0
  movss  %xmm0,(%rax)
  mov    -0x50(%rbp),%rax
  mov    -0x48(%rbp),%rdx
  mov    %rax,-0x60(%rbp)
  mov    %rdx,-0x58(%rbp)
  mov    -0x40(%rbp),%rax
  mov    -0x38(%rbp),%rdx
  mov    %rax,-0x50(%rbp)
  mov    %rdx,-0x48(%rbp)
  mov    -0x30(%rbp),%rax
  mov    -0x28(%rbp),%rdx
  mov    %rax,-0x40(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    -0x7c(%rbp),%eax
  lea    0x1(%rax),%ebx
  mov    -0x74(%rbp),%eax
  lea    0x4(%rax),%edx
  mov    -0x88(%rbp),%ecx
  mov    -0x84(%rbp),%eax
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <map@plt>
  sub    %eax,%ebx
  mov    %ebx,%edx
  pxor   %xmm0,%xmm0
  cvtsi2ss %edx,%xmm0
  mulss  -0x68(%rbp),%xmm0
  movss  %xmm0,-0x30(%rbp)
  movss  D12(%rip),%xmm0
  movss  %xmm0,-0x2c(%rbp)
  mov    -0x74(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x98(%rbp),%rax
  add    %rax,%rdx
  mov    -0x70(%rbp),%eax
  mov    %eax,(%rdx)
  movl   $0x0,-0x70(%rbp)
  addl   $0x1,-0x74(%rbp)
L81:
  addl   $0x1,-0x7c(%rbp)
L95:
  mov    -0x7c(%rbp),%eax
  cmp    -0x84(%rbp),%eax
  jl     L36
  movl   $0x0,-0x7c(%rbp)
  jmp    L45
L52:
  mov    -0x7c(%rbp),%eax
  cltq
  shl    $0x4,%rax
  lea    -0x10(%rax),%rax
  add    %rbp,%rax
  sub    $0x48,%rax
  mov    (%rax),%rax
  movss  (%rax),%xmm1
  mov    -0x7c(%rbp),%eax
  cltq
  shl    $0x4,%rax
  lea    -0x10(%rax),%rax
  add    %rbp,%rax
  sub    $0x4c,%rax
  movss  (%rax),%xmm0
  mov    -0x7c(%rbp),%eax
  cltq
  shl    $0x4,%rax
  lea    -0x10(%rax),%rax
  add    %rbp,%rax
  sub    $0x48,%rax
  mov    (%rax),%rax
  addss  %xmm1,%xmm0
  movss  %xmm0,(%rax)
  mov    -0x7c(%rbp),%edx
  mov    -0x74(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x98(%rbp),%rax
  add    %rax,%rdx
  mov    -0x70(%rbp),%eax
  mov    %eax,(%rdx)
  movl   $0x0,-0x70(%rbp)
  addl   $0x1,-0x7c(%rbp)
L45:
  mov    -0x7c(%rbp),%edx
  mov    -0x74(%rbp),%eax
  add    %edx,%eax
  cmp    %eax,-0x88(%rbp)
  jg     L52
  nop
  mov    -0x18(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L65
  call   <__stack_chk_fail@plt>
L65:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: read_data
arguments: data_label: D0
datatype: byte[4]
name: read_data
arguments: data_label: D12
datatype: byte[4]
name: read_data
arguments: data_label: D33
datatype: byte[4]

tool: {"D0": [0x00,0x00,0x80,0x40]}

tool: {"D12": [0x00,0x00,0x80,0x3f]}

tool: {"D33": [0x00,0x00,0x00,0x40]}

assistant: ```c
void xscale_calc_coeffs(int in_width, int out_width, float *coeff_buf, int *border_buf) {
  struct {
    float tx;
    float fudge;
    float *center;
  } out_s[4];
  int i, j, out_pos, border, taps;
  float tap_mult_f, tx;
  out_pos = 0;
  border = 0;
  taps = calc_taps(in_width, out_width);
  tap_mult_f = (float)4 / taps;
  for (i = 0; i < 4; i++) {
    out_s[i].tx = -1 * map(in_width, out_width, i) * tap_mult_f;
    out_s[i].fudge = 1.0f;
  }
  for (i = 0; i < in_width; i++) {
    for (j = 0; j < 4; j++) {
      tx = fabsf(out_s[j].tx);
      coeff_buf[j] = catrom(tx) * tap_mult_f;
      out_s[j].fudge -= coeff_buf[j];
      if (tx < tap_mult_f) {
        out_s[j].center = coeff_buf + j;
      }
      out_s[j].tx += tap_mult_f;
    }
    border++;
    coeff_buf += 4;
    if (out_s[0].tx >= 2.0f) {
      out_s[0].center[0] += out_s[0].fudge;
      out_s[0] = out_s[1];
      out_s[1] = out_s[2];
      out_s[2] = out_s[3];
      out_s[3].tx = (i + 1 - map(in_width, out_width, out_pos + 4)) * tap_mult_f;
      out_s[3].fudge = 1.0f;
      border_buf[out_pos] = border;
      border = 0;
      out_pos++;
    }
  }
  for (i = 0; i + out_pos < out_width; i++) {
    out_s[i].center[0] += out_s[i].fudge;
    border_buf[i + out_pos] = border;
    border = 0;
  }
}
```