user: Please show me the C implementation that matches the assembly code listed below:

```asm
<convolve>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %rdi,0x28(%rsp)
  mov    %rsi,0x48(%rsp)
  mov    %rdx,0x38(%rsp)
  mov    %rcx,0x40(%rsp)
  mov    %r8,0x18(%rsp)
  test   %rcx,%rcx
  jle    L26
  mov    %r9,%r15
  lea    0x0(,%rcx,8),%rax
  mov    %rax,0x20(%rsp)
  movq   $0x0,0x10(%rsp)
  movq   $0x0,0x30(%rsp)
  jmp    L58
L66:
  mov    0x48(%rsp),%rax
  mov    0x30(%rsp),%rbx
  lea    (%rax,%rbx,8),%rax
  mov    %rax,(%rsp)
  mov    $0x0,%r14d
  mov    $0x0,%r13d
L1:
  mov    0x10(%rsp),%rax
  add    (%r15,%r13,8),%rax
  lea    0x2(%r13),%rcx
  mov    0x8(%r15,%r13,8),%r9
  test   %r9,%r9
  jle    L36
  lea    0x2(%r9,%r13,1),%r8
  sub    %r13,%rax
  mov    0x28(%rsp),%rbx
  lea    (%rbx,%rax,8),%rsi
  mov    $0x0,%ebx
  mov    $0x0,%ebp
  mov    $0x0,%r12d
  mov    $0x0,%edi
L29:
  add    $0x1,%rcx
  mov    -0x8(%r15,%rcx,8),%rax
  mov    -0x18(%rsi,%rcx,8),%rdx
  mov    %eax,%r10d
  imul   %edx,%r10d
  add    %r10d,%edi
  mov    %rdx,%r10
  sar    $0x8,%r10
  imul   %eax,%r10d
  add    %r10d,%r12d
  mov    %rdx,%r10
  sar    $0x10,%r10
  imul   %eax,%r10d
  add    %r10d,%ebp
  sar    $0x18,%rdx
  imul   %edx,%eax
  add    %eax,%ebx
  cmp    %r8,%rcx
  jne    L29
  lea    0x2(%r9,%r13,1),%r13
L30:
  add    $0x2000,%edi
  sar    $0xe,%edi
  call   <clampTo8@plt>
  mov    %eax,0xc(%rsp)
  lea    0x2000(%r12),%edi
  sar    $0xe,%edi
  call   <clampTo8@plt>
  mov    %eax,%r12d
  lea    0x2000(%rbp),%edi
  sar    $0xe,%edi
  call   <clampTo8@plt>
  shl    $0x8,%r12d
  shl    $0x10,%eax
  or     %eax,%r12d
  or     0xc(%rsp),%r12d
  lea    0x2000(%rbx),%edi
  sar    $0xe,%edi
  call   <clampTo8@plt>
  shl    $0x18,%eax
  or     %r12d,%eax
  cltq
  mov    (%rsp),%rsi
  mov    %rax,(%rsi)
  add    $0x1,%r14
  mov    0x20(%rsp),%rax
  add    %rax,%rsi
  mov    %rsi,(%rsp)
  cmp    %r14,0x18(%rsp)
  jne    L1
L35:
  addq   $0x1,0x30(%rsp)
  mov    0x30(%rsp),%rax
  mov    0x38(%rsp),%rsi
  add    %rsi,0x10(%rsp)
  cmp    %rax,0x40(%rsp)
  je     L26
L58:
  cmpq   $0x0,0x18(%rsp)
  jg     L66
  jmp    L35
L36:
  mov    %rcx,%r13
  mov    $0x0,%ebx
  mov    $0x0,%ebp
  mov    $0x0,%r12d
  mov    $0x0,%edi
  jmp    L30
L26:
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void convolve(uint32_t *src, uint32_t *dest, uint32_t srcW, uint32_t srcH, uint32_t destW, int16_t *filters) {
  int32_t r, g, b, a;
  uint32_t rgba;
  uint32_t filterPtr, filterShift, filterSize;
  uint32_t srcPtr, srcY, destX;
  int32_t filterVal;
  uint32_t srcOffset = 0, destOffset = 0;
  for (srcY = 0; srcY < srcH; srcY++) {
    filterPtr = 0;
    for (destX = 0; destX < destW; destX++) {
      filterShift = filters[filterPtr++];
      srcPtr = srcOffset + filterShift;
      filterSize = filters[filterPtr++];
      r = g = b = a = 0;
      for (; filterSize > 0; filterSize--) {
        filterVal = filters[filterPtr++];
        rgba = src[srcPtr++];
        r += filterVal * ((uint8_t)(rgba));
        g += filterVal * ((uint8_t)((rgba) >> 8));
        b += filterVal * ((uint8_t)((rgba) >> 16));
        a += filterVal * ((uint8_t)((rgba) >> 24));
      };
      dest[destOffset] = ((clampTo8((r + (1 << 13)) >> 14)) | ((clampTo8((g + (1 << 13)) >> 14)) << 8) | ((clampTo8((b + (1 << 13)) >> 14)) << 16) | ((clampTo8((a + (1 << 13)) >> 14)) << 24));
      destOffset += srcH;
    };
    destOffset = srcY + 1;
    srcOffset = (srcY + 1) * srcW;
  };
}
```