user: 请从给定的汇编指令推导出C源代码:

```asm
<shrink_line>:
  endbr64
  push   %r15
  pxor   %xmm0,%xmm0
  pxor   %xmm1,%xmm1
  mov    %rdi,%r9
  push   %r14
  cvtsi2sd %r8d,%xmm0
  mov    %edx,%r14d
  push   %r13
  cvtsi2sd %ecx,%xmm1
  push   %r12
  mov    %ecx,%r12d
  push   %rbp
  push   %rbx
  movapd %xmm0,%xmm2
  divsd  %xmm1,%xmm2
  sub    $0x68,%rsp
  movsd  D9(%rip),%xmm4
  mov    %rsi,0x28(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x58(%rsp)
  xor    %eax,%eax
  divsd  %xmm0,%xmm4
  test   %edx,%edx
  jle    L82
  movslq %edx,%rdx
  mov    %rdi,0x10(%rsp)
  xor    %esi,%esi
  lea    0x30(%rsp),%rdi
  shl    $0x3,%rdx
  mov    %r8d,0x1c(%rsp)
  movsd  %xmm4,0x8(%rsp)
  movsd  %xmm2,(%rsp)
  call   <memset@plt>
  movsd  (%rsp),%xmm2
  movsd  0x8(%rsp),%xmm4
  mov    0x10(%rsp),%r9
  mov    0x1c(%rsp),%r8d
L82:
  xor    %ebx,%ebx
  xor    %edx,%edx
  test   %r8d,%r8d
  jle    L161
  mov    %r14d,%ebp
  lea    -0x1(%r14),%eax
  mov    0x28(%rsp),%rbx
  xor    %r15d,%r15d
  neg    %ebp
  lea    0x8(,%rax,8),%r13
  movslq %ebp,%rbp
  lea    0x0(,%rbp,8),%rax
  xor    %ebp,%ebp
  mov    %rax,0x20(%rsp)
  xchg   %ax,%ax
L1:
  test   %r14d,%r14d
  jle    L23
  xor    %eax,%eax
  lea    0x30(%rsp),%rdx
L71:
  movsd  (%rdx,%rax,8),%xmm0
  addsd  (%rbx,%rax,8),%xmm0
  movsd  %xmm0,(%rdx,%rax,8)
  add    $0x1,%rax
  cmp    %eax,%r14d
  jg     L71
  add    %r13,%rbx
L23:
  add    %r8d,%r15d
  cmp    %r15d,%r12d
  jg     L1
  sub    %r12d,%r15d
  cmp    %r15d,%r8d
  jle    L24
  test   %r15d,%r15d
  jne    L0
  test   %r14d,%r14d
  jle    L30
  xor    %eax,%eax
  lea    0x30(%rsp),%rdx
L117:
  movsd  (%rdx,%rax,8),%xmm0
  movq   $0x0,(%rdx,%rax,8)
  mulsd  %xmm2,%xmm0
  movsd  %xmm0,(%r9,%rax,8)
  add    $0x1,%rax
  cmp    %eax,%r14d
  jg     L117
L98:
  add    %r13,%r9
L30:
  add    $0x1,%ebp
  cmp    %ebp,%r8d
  jne    L1
  test   %r15d,%r15d
  setne  %dl
  sub    0x28(%rsp),%rbx
  sar    $0x3,%rbx
L161:
  mov    %r12d,%ecx
  imul   %r14d,%ecx
  movslq %ecx,%rax
  cmp    %rbx,%rax
  jne    L78
  test   %dl,%dl
  je     L154
L78:
  mov    0x58(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L70
  add    $0x68,%rsp
  lea    D0(%rip),%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1090 <Com_Printf@plt>
L24:
  lea    D14(%rip),%rdi
  mov    %r8d,0x1c(%rsp)
  mov    %r9,0x10(%rsp)
  movsd  %xmm4,0x8(%rsp)
  movsd  %xmm2,(%rsp)
  call   <Com_Printf@plt>
  movsd  (%rsp),%xmm2
  movsd  0x8(%rsp),%xmm4
  mov    0x10(%rsp),%r9
  mov    0x1c(%rsp),%r8d
L0:
  test   %r14d,%r14d
  jle    L30
  pxor   %xmm3,%xmm3
  mov    0x20(%rsp),%rax
  lea    0x30(%rsp),%rdx
  cvtsi2sd %r15d,%xmm3
  lea    (%rbx,%rax,1),%rcx
  xor    %eax,%eax
L124:
  movsd  (%rcx,%rax,8),%xmm1
  movsd  (%rdx,%rax,8),%xmm0
  mulsd  %xmm3,%xmm1
  mulsd  %xmm4,%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm1,(%rdx,%rax,8)
  mulsd  %xmm2,%xmm0
  movsd  %xmm0,(%r9,%rax,8)
  add    $0x1,%rax
  cmp    %eax,%r14d
  jg     L124
  jmp    L98
L154:
  mov    0x58(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L70
  add    $0x68,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L70:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: tag: D9
type_guessed: f64
name: read_data
arguments: tag: D0
type_guessed: string
name: read_data
arguments: tag: D14
type_guessed: string

tool: D9: 1

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

tool: D14: Assertion (slicepos < width) 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.");
  }
}
```