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

```asm
<shrink_line>:
  endbr64
  push   %r15
  pxor   %xmm0,%xmm0
  pxor   %xmm1,%xmm1
  mov    %rdi,%r9
  push   %r14
  cvtsi2sd %r8d,%xmm0
  mov    %ecx,%r15d
  mov    %r8d,%r14d
  push   %r13
  cvtsi2sd %ecx,%xmm1
  push   %r12
  mov    %edx,%r12d
  push   %rbp
  push   %rbx
  movapd %xmm0,%xmm2
  divsd  %xmm1,%xmm2
  sub    $0xb8,%rsp
  movsd  D15(%rip),%xmm3
  mov    %rsi,0x60(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0xa8(%rsp)
  xor    %eax,%eax
  divsd  %xmm0,%xmm3
  test   %edx,%edx
  jle    L120
  movslq %edx,%rdx
  mov    %rdi,0x10(%rsp)
  xor    %esi,%esi
  lea    0x80(%rsp),%rdi
  shl    $0x3,%rdx
  movsd  %xmm3,0x8(%rsp)
  movsd  %xmm2,(%rsp)
  call   <memset@plt>
  movsd  (%rsp),%xmm2
  movsd  0x8(%rsp),%xmm3
  mov    0x10(%rsp),%r9
L120:
  xor    %ebx,%ebx
  xor    %edx,%edx
  test   %r14d,%r14d
  jle    L232
  lea    -0x1(%r12),%eax
  mov    %r12d,%r13d
  movapd %xmm3,%xmm7
  mov    %r12d,%r8d
  lea    0x8(,%rax,8),%rdx
  mov    %r12d,%eax
  shr    %r8d
  xor    %ebp,%ebp
  neg    %eax
  and    $0xfffffffe,%r13d
  unpcklpd %xmm7,%xmm7
  mov    0x60(%rsp),%rbx
  cltq
  mov    %r13d,%r11d
  mov    %r13d,%esi
  xor    %r10d,%r10d
  lea    0x8(,%rax,8),%rdi
  shl    $0x3,%rax
  sub    %r12d,%r11d
  shl    $0x3,%rsi
  mov    %rax,0x40(%rsp)
  mov    $0x1,%eax
  movslq %r11d,%r11
  sub    %r12d,%eax
  mov    %rdi,0x48(%rsp)
  shl    $0x3,%r11
  cltq
  movaps %xmm7,0x50(%rsp)
  shl    $0x3,%rax
  mov    %rax,0x68(%rsp)
  mov    $0x2,%eax
  sub    %r12d,%eax
  cltq
  shl    $0x3,%rax
  mov    %rax,0x70(%rsp)
  mov    $0x3,%eax
  sub    %r12d,%eax
  cltq
  shl    $0x3,%rax
  mov    %rax,0x78(%rsp)
L238:
  test   %r12d,%r12d
  jle    L271
  cmp    $0x1,%r12d
  je     L151
  movupd (%rbx),%xmm0
  addpd  0x80(%rsp),%xmm0
  movaps %xmm0,0x80(%rsp)
  cmp    $0x1,%r8d
  jbe    L54
  movupd 0x10(%rbx),%xmm0
  addpd  0x90(%rsp),%xmm0
  movaps %xmm0,0x90(%rsp)
L54:
  lea    (%rbx,%rsi,1),%rcx
  movslq %r13d,%rax
  cmp    %r13d,%r12d
  je     L132
L69:
  movsd  (%rcx),%xmm0
  addsd  0x80(%rsp,%rax,8),%xmm0
  movsd  %xmm0,0x80(%rsp,%rax,8)
L132:
  add    %rdx,%rbx
L271:
  add    %r14d,%ebp
  cmp    %ebp,%r15d
  jg     L238
  sub    %r15d,%ebp
  cmp    %ebp,%r14d
  jle    L23
  test   %ebp,%ebp
  jne    L220
  test   %r12d,%r12d
  jle    L61
  cmp    $0x1,%r12d
  je     L299
  movapd 0x80(%rsp),%xmm1
  movapd %xmm2,%xmm0
  unpcklpd %xmm0,%xmm0
  mulpd  %xmm0,%xmm1
  movups %xmm1,(%r9)
  pxor   %xmm1,%xmm1
  movaps %xmm1,0x80(%rsp)
  cmp    $0x1,%r8d
  jbe    L82
  mulpd  0x90(%rsp),%xmm0
  movaps %xmm1,0x90(%rsp)
  movups %xmm0,0x10(%r9)
L82:
  lea    (%r9,%rsi,1),%rcx
  movslq %r13d,%rax
  cmp    %r13d,%r12d
  je     L116
L229:
  movsd  0x80(%rsp,%rax,8),%xmm0
  mulsd  %xmm2,%xmm0
  movsd  %xmm0,(%rcx)
  movq   $0x0,0x80(%rsp,%rax,8)
L116:
  add    %rdx,%r9
L61:
  add    $0x1,%r10d
  cmp    %r10d,%r14d
  jne    L238
  test   %ebp,%ebp
  setne  %dl
  sub    0x60(%rsp),%rbx
  sar    $0x3,%rbx
L232:
  mov    %r15d,%ecx
  imul   %r12d,%ecx
  movslq %ecx,%rax
  cmp    %rbx,%rax
  jne    L213
  test   %dl,%dl
  je     L279
L213:
  mov    0xa8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L163
  add    $0xb8,%rsp
  lea    D22(%rip),%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1090 <Com_Printf@plt>
  nopl   0x0(%rax,%rax,1)
L151:
  mov    %rbx,%rcx
  xor    %eax,%eax
  jmp    L69
L23:
  lea    D19(%rip),%rdi
  mov    %r9,0x38(%rsp)
  mov    %rsi,0x30(%rsp)
  mov    %r8d,0x2c(%rsp)
  mov    %rdx,0x20(%rsp)
  mov    %r11,0x18(%rsp)
  mov    %r10d,0x10(%rsp)
  movsd  %xmm3,0x8(%rsp)
  movsd  %xmm2,(%rsp)
  call   <Com_Printf@plt>
  movsd  (%rsp),%xmm2
  movsd  0x8(%rsp),%xmm3
  mov    0x10(%rsp),%r10d
  mov    0x18(%rsp),%r11
  mov    0x20(%rsp),%rdx
  mov    0x2c(%rsp),%r8d
  mov    0x30(%rsp),%rsi
  mov    0x38(%rsp),%r9
L220:
  test   %r12d,%r12d
  jle    L61
  mov    0x48(%rsp),%rax
  pxor   %xmm1,%xmm1
  cvtsi2sd %ebp,%xmm1
  add    %rbx,%rax
  cmp    %rax,%r9
  mov    0x40(%rsp),%rax
  je     L182
  cmp    $0x1,%r12d
  je     L182
  add    %rbx,%rax
  movapd %xmm1,%xmm6
  movapd 0x50(%rsp),%xmm7
  movapd 0x80(%rsp),%xmm4
  movupd (%rax),%xmm0
  unpcklpd %xmm6,%xmm6
  movapd %xmm2,%xmm5
  unpcklpd %xmm5,%xmm5
  mulpd  %xmm6,%xmm0
  mulpd  %xmm7,%xmm0
  subpd  %xmm0,%xmm4
  movaps %xmm0,0x80(%rsp)
  mulpd  %xmm5,%xmm4
  movups %xmm4,(%r9)
  cmp    $0x1,%r8d
  jbe    L285
  movapd 0x90(%rsp),%xmm4
  movupd 0x10(%rax),%xmm0
  mulpd  %xmm6,%xmm0
  mulpd  %xmm7,%xmm0
  subpd  %xmm0,%xmm4
  movaps %xmm0,0x90(%rsp)
  mulpd  %xmm5,%xmm4
  movups %xmm4,0x10(%r9)
L285:
  lea    (%r9,%rsi,1),%rcx
  cmp    %r13d,%r12d
  je     L116
  mulsd  (%rbx,%r11,1),%xmm1
  movslq %r13d,%rax
  movsd  0x80(%rsp,%rax,8),%xmm0
  mulsd  %xmm3,%xmm1
  subsd  %xmm1,%xmm0
  mulsd  %xmm2,%xmm0
  movsd  %xmm0,(%rcx)
  movsd  %xmm1,0x80(%rsp,%rax,8)
  jmp    L116
L182:
  movsd  0x80(%rsp),%xmm0
  movsd  (%rbx,%rax,1),%xmm4
  mulsd  %xmm1,%xmm4
  mulsd  %xmm3,%xmm4
  movsd  %xmm4,0x80(%rsp)
  subsd  %xmm4,%xmm0
  mulsd  %xmm2,%xmm0
  movsd  %xmm0,(%r9)
  cmp    $0x1,%r12d
  je     L116
  movsd  0x88(%rsp),%xmm0
  mov    0x68(%rsp),%rax
  movsd  (%rbx,%rax,1),%xmm4
  mulsd  %xmm1,%xmm4
  mulsd  %xmm3,%xmm4
  movsd  %xmm4,0x88(%rsp)
  subsd  %xmm4,%xmm0
  mulsd  %xmm2,%xmm0
  movsd  %xmm0,0x8(%r9)
  cmp    $0x2,%r12d
  je     L116
  movsd  0x90(%rsp),%xmm0
  mov    0x70(%rsp),%rax
  movsd  (%rbx,%rax,1),%xmm4
  mulsd  %xmm1,%xmm4
  mulsd  %xmm3,%xmm4
  movsd  %xmm4,0x90(%rsp)
  subsd  %xmm4,%xmm0
  mulsd  %xmm2,%xmm0
  movsd  %xmm0,0x10(%r9)
  cmp    $0x3,%r12d
  je     L116
  movsd  0x98(%rsp),%xmm0
  mov    0x78(%rsp),%rax
  mulsd  (%rbx,%rax,1),%xmm1
  mulsd  %xmm3,%xmm1
  movsd  %xmm1,0x98(%rsp)
  subsd  %xmm1,%xmm0
  mulsd  %xmm2,%xmm0
  movsd  %xmm0,0x18(%r9)
  jmp    L116
L279:
  mov    0xa8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L163
  add    $0xb8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L299:
  mov    %r9,%rcx
  xor    %eax,%eax
  jmp    L229
L163:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_label: D15
type_guessed: f64
name: read_data
arguments: data_label: D22
type_guessed: string
name: read_data
arguments: data_label: D19
type_guessed: string

tool: D15: 1

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

tool: D19: 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.");
  }
}
```