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

```asm
<shrink_line>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x90,%rsp
  mov    %rdi,-0x78(%rbp)
  mov    %rsi,-0x80(%rbp)
  mov    %edx,-0x84(%rbp)
  mov    %ecx,-0x88(%rbp)
  mov    %r8d,-0x8c(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x8c(%rbp),%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x88(%rbp),%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x48(%rbp)
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x8c(%rbp),%xmm1
  movsd  D21(%rip),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x40(%rbp)
  mov    -0x80(%rbp),%rax
  mov    %rax,-0x58(%rbp)
  mov    -0x78(%rbp),%rax
  mov    %rax,-0x50(%rbp)
  movl   $0x0,-0x5c(%rbp)
  movl   $0x0,-0x60(%rbp)
  jmp    L137
L139:
  mov    -0x60(%rbp),%eax
  cltq
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x30(%rbp,%rax,8)
  addl   $0x1,-0x60(%rbp)
L137:
  mov    -0x60(%rbp),%eax
  cmp    -0x84(%rbp),%eax
  jl     L139
  movl   $0x0,-0x64(%rbp)
  jmp    L87
L63:
  movl   $0x0,-0x60(%rbp)
  jmp    L104
L12:
  mov    -0x58(%rbp),%rax
  lea    0x8(%rax),%rdx
  mov    %rdx,-0x58(%rbp)
  movsd  (%rax),%xmm1
  mov    -0x60(%rbp),%eax
  cltq
  movsd  -0x30(%rbp,%rax,8),%xmm0
  addsd  %xmm1,%xmm0
  mov    -0x60(%rbp),%eax
  cltq
  movsd  %xmm0,-0x30(%rbp,%rax,8)
  addl   $0x1,-0x60(%rbp)
L104:
  mov    -0x60(%rbp),%eax
  cmp    -0x84(%rbp),%eax
  jl     L12
  mov    -0x8c(%rbp),%eax
  add    %eax,-0x5c(%rbp)
  mov    -0x5c(%rbp),%eax
  cmp    -0x88(%rbp),%eax
  jl     L63
  mov    -0x88(%rbp),%eax
  sub    %eax,-0x5c(%rbp)
  mov    -0x5c(%rbp),%eax
  cmp    -0x8c(%rbp),%eax
  jl     L106
  lea    D28(%rip),%rax
  mov    %rax,%rdi
  call   <Com_Printf@plt>
L106:
  cmpl   $0x0,-0x5c(%rbp)
  jne    L57
  movl   $0x0,-0x60(%rbp)
  jmp    L140
L79:
  mov    -0x60(%rbp),%eax
  cltq
  movsd  -0x30(%rbp,%rax,8),%xmm0
  mov    -0x50(%rbp),%rax
  lea    0x8(%rax),%rdx
  mov    %rdx,-0x50(%rbp)
  mulsd  -0x48(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x60(%rbp),%eax
  cltq
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x30(%rbp,%rax,8)
  addl   $0x1,-0x60(%rbp)
L140:
  mov    -0x60(%rbp),%eax
  cmp    -0x84(%rbp),%eax
  jl     L79
  jmp    L112
L57:
  movl   $0x0,-0x60(%rbp)
  jmp    L32
L73:
  mov    -0x60(%rbp),%eax
  sub    -0x84(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x5c(%rbp),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  -0x40(%rbp),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  mov    -0x60(%rbp),%eax
  cltq
  movsd  -0x30(%rbp,%rax,8),%xmm0
  subsd  -0x38(%rbp),%xmm0
  mov    -0x50(%rbp),%rax
  lea    0x8(%rax),%rdx
  mov    %rdx,-0x50(%rbp)
  mulsd  -0x48(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x60(%rbp),%eax
  cltq
  movsd  -0x38(%rbp),%xmm0
  movsd  %xmm0,-0x30(%rbp,%rax,8)
  addl   $0x1,-0x60(%rbp)
L32:
  mov    -0x60(%rbp),%eax
  cmp    -0x84(%rbp),%eax
  jl     L73
L112:
  addl   $0x1,-0x64(%rbp)
L87:
  mov    -0x64(%rbp),%eax
  cmp    -0x8c(%rbp),%eax
  jl     L63
  mov    -0x58(%rbp),%rax
  sub    -0x80(%rbp),%rax
  sar    $0x3,%rax
  mov    %rax,%rdx
  mov    -0x88(%rbp),%eax
  imul   -0x84(%rbp),%eax
  cltq
  cmp    %rax,%rdx
  jne    L19
  cmpl   $0x0,-0x5c(%rbp)
  je     L141
L19:
  lea    D22(%rip),%rax
  mov    %rax,%rdi
  call   <Com_Printf@plt>
L141:
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L126
  call   <__stack_chk_fail@plt>
L126:
  leave
  ret
```

tool_calls: name: read_data
arguments: label: D21
type: f64
name: read_data
arguments: label: D28
type: string
name: read_data
arguments: label: D22
type: string

tool: D21: 1

tool: D28: Assertion (slicepos < width) failed. Please report.


tool: D22: Assertion (srcp - src == old_width * bytes && slicepos == 0) failed. Please report.

assistant: ```c
void shrink_line(double *dest, double *src, int bytes, int old_width, int width) {
  int x;
  int b;
  double *srcp;
  double *destp;
  double accum[4];
  double slice;
  const double avg_ratio = (double)width / old_width;
  const double inv_width = 1.0 / width;
  int slicepos;
  srcp = src;
  destp = dest;
  slicepos = 0;
  for (b = 0; b < bytes; ++b) {
    accum[b] = 0.0;
  }
  for (x = 0; x < width; x++) {
    do {
      for (b = 0; b < bytes; b++)
        accum[b] += *srcp++;
      slicepos += width;
    } while (slicepos < old_width);
    slicepos -= old_width;
    if (!(slicepos < width))
      Com_Printf("Assertion (slicepos < width) failed. Please report.\n");
    if (slicepos == 0) {
      for (b = 0; b < bytes; b++) {
        *destp++ = accum[b] * avg_ratio;
        accum[b] = 0.0;
      }
    } else {
      for (b = 0; b < bytes; b++) {
        slice = srcp[-bytes + b] * slicepos * inv_width;
        *destp++ = (accum[b] - slice) * avg_ratio;
        accum[b] = slice;
      }
    }
  }
  if (!(srcp - src == old_width * bytes && slicepos == 0)) {
    Com_Printf("Assertion (srcp - src == old_width * bytes && slicepos == 0)"
               " failed. Please report.");
  }
}
```