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

```asm
<blur>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x88,%rsp
  mov    %rdi,0x68(%rsp)
  mov    %rsi,%r15
  mov    %edx,0x24(%rsp)
  mov    %ecx,0x20(%rsp)
  mov    %r8d,0x74(%rsp)
  mov    %r9,%r13
  mov    0xc0(%rsp),%ebp
  mov    0xc8(%rsp),%ebx
  lea    0x2(%rsi),%rax
  mov    %rax,(%rsp)
  test   %ecx,%ecx
  jle    L22
  mov    %rdi,%r11
  mov    %edx,%ecx
  lea    0x2(%rdx,%rdx,1),%eax
  mov    %eax,0x28(%rsp)
  movslq %edx,%rax
  lea    0x2(%rax,%rax,1),%rax
  mov    %rax,0x30(%rsp)
  movslq %r8d,%rax
  mov    %rax,0x38(%rsp)
  movslq %ebp,%rdi
  mov    %rdi,0x58(%rsp)
  add    %rdi,%r11
  mov    %r11,%r12
  mov    %rdi,%rax
  neg    %rax
  add    %rax,%rax
  mov    %rax,0x60(%rsp)
  test   %ebp,%ebp
  mov    $0x0,%eax
  mov    %eax,%esi
  cmovns %ebp,%esi
  mov    %esi,0x70(%rsp)
  sub    %ebp,%ecx
  mov    %ecx,0x18(%rsp)
  movslq %esi,%rax
  sub    %rdi,%rax
  mov    %rax,%rdx
  mov    %rax,0x48(%rsp)
  neg    %rdi
  mov    %rdi,0x40(%rsp)
  lea    -0x1(%rbx),%eax
  mov    %rdx,%rdi
  lea    (%rdx,%rax,1),%rdx
  mov    %rdx,0x50(%rsp)
  sub    %esi,%ecx
  lea    -0x1(%rcx),%edx
  lea    0x1(%rdi,%rdx,1),%r14
  movl   $0x0,0x8(%rsp)
  not    %rax
  add    %rax,%rax
  mov    %rax,0x10(%rsp)
  mov    %r15,0x78(%rsp)
  jmp    L48
L416:
  add    $0x1,%rdi
  add    $0x2,%rdx
  sub    $0x1,%esi
  je     L474
L66:
  movzbl (%r12,%rdi,1),%eax
  test   %eax,%eax
  je     L416
  imul   %ebx,%eax
  movslq %eax,%rcx
  cmp    %esi,%ebx
  jle    L416
  movslq %esi,%rax
  lea    0x0(%r13,%rcx,4),%r8
L444:
  mov    (%r8,%rax,4),%ecx
  add    %cx,(%rdx,%rax,2)
  add    $0x1,%rax
  cmp    %eax,%ebx
  jg     L444
  jmp    L416
L474:
  mov    0x18(%rsp),%edi
  cmp    %edi,0x70(%rsp)
  jge    L545
  mov    0x50(%rsp),%rax
  lea    0x2(%r15,%rax,2),%rcx
  mov    0x48(%rsp),%rdi
  jmp    L277
L78:
  add    $0x1,%rdi
  add    $0x2,%rcx
  cmp    %r14,%rdi
  je     L223
L277:
  movzbl (%r12,%rdi,1),%eax
  test   %eax,%eax
  je     L78
  imul   %ebx,%eax
  movslq %eax,%rdx
  test   %ebx,%ebx
  jle    L78
  mov    0x10(%rsp),%rax
  add    %rcx,%rax
  lea    0x0(%r13,%rdx,4),%rdx
L288:
  mov    (%rdx),%esi
  add    %si,(%rax)
  add    $0x2,%rax
  add    $0x4,%rdx
  cmp    %rcx,%rax
  jne    L288
  jmp    L78
L223:
  mov    0x18(%rsp),%eax
L37:
  mov    0x24(%rsp),%ecx
  cmp    %eax,%ecx
  jle    L228
  movslq %eax,%rdi
  sub    0x58(%rsp),%rdi
  lea    (%rcx,%rbp,1),%esi
  sub    %eax,%esi
  lea    0x2(%r15),%r8
  jmp    L514
L545:
  mov    0x70(%rsp),%eax
  jmp    L37
L438:
  add    $0x1,%rdi
  sub    $0x1,%esi
  cmp    %esi,%ebp
  je     L228
L514:
  movzbl (%r12,%rdi,1),%eax
  test   %eax,%eax
  je     L438
  imul   %ebx,%eax
  movslq %eax,%rdx
  test   %esi,%esi
  jle    L438
  lea    (%r15,%rdi,2),%rax
  lea    0x0(%r13,%rdx,4),%rdx
  lea    -0x1(%rsi),%ecx
  add    %rdi,%rcx
  lea    (%r8,%rcx,2),%r9
L450:
  mov    (%rdx),%ecx
  add    %cx,(%rax)
  add    $0x2,%rax
  add    $0x4,%rdx
  cmp    %r9,%rax
  jne    L450
  jmp    L438
L228:
  mov    0x30(%rsp),%rcx
  add    %rcx,(%rsp)
  addl   $0x1,0x8(%rsp)
  mov    0x8(%rsp),%eax
  add    0x38(%rsp),%r12
  cmp    %eax,0x20(%rsp)
  je     L262
L48:
  mov    (%rsp),%rax
  mov    %rax,%r15
  lea    -0x2(%rax),%rdi
  mov    0x28(%rsp),%edx
  mov    $0x0,%esi
  call   <memset@plt>
  test   %ebp,%ebp
  jle    L474
  mov    (%rsp),%rdx
  add    0x60(%rsp),%rdx
  mov    0x40(%rsp),%rdi
  mov    %ebp,%esi
  jmp    L66
L262:
  mov    0x78(%rsp),%r15
L22:
  mov    0x24(%rsp),%esi
  test   %esi,%esi
  jle    L403
  movslq %esi,%rax
  add    %rax,%rax
  mov    %rax,0x8(%rsp)
  lea    0x2(%rax),%rcx
  lea    0x1(%rsi),%edi
  mov    %edi,0x30(%rsp)
  mov    %edi,%eax
  imul   %ebp,%eax
  cltq
  add    %rax,%rax
  mov    $0xfffffffffffffffe,%rdx
  sub    %rax,%rdx
  mov    %rdx,%r11
  mov    %esi,%eax
  lea    (%r15,%rax,2),%rax
  mov    %rax,0x28(%rsp)
  test   %ebp,%ebp
  mov    $0x0,%eax
  cmovns %ebp,%eax
  mov    %eax,%esi
  mov    %eax,0x70(%rsp)
  mov    0x20(%rsp),%r9d
  sub    %ebp,%r9d
  movslq %edi,%rax
  lea    (%rax,%rax,1),%r14
  mov    %esi,%eax
  imul   %edi,%eax
  cltq
  lea    0x2(%rax,%rax,1),%rax
  mov    %rax,0x38(%rsp)
  mov    %r15,%r10
  lea    -0x1(%rbp),%eax
  mov    %eax,0x40(%rsp)
  cltq
  mov    %rax,0x10(%rsp)
  mov    %ebx,%edx
  sub    %ebp,%edx
  movslq %ebp,%rax
  add    %rdx,%rax
  mov    %rax,0x18(%rsp)
  lea    -0x1(%rbx),%eax
  mov    %eax,0x48(%rsp)
  mov    %r15,0x50(%rsp)
  jmp    L199
L183:
  add    $0x1,%r8d
  add    %rcx,%rdi
  cmp    %r8d,%ebp
  je     L547
L357:
  movzwl (%rdi),%edx
  test   %edx,%edx
  je     L183
  mov    0x8(%rsp),%rax
  add    %rdi,%rax
  lea    0x80(%rdx),%esi
  sar    $0x8,%esi
  imul   %ebx,%esi
  movslq %esi,%rsi
  movw   $0x80,(%rdi)
  cmp    %r12d,%ebx
  jle    L183
  mov    0x10(%rsp),%rdx
  add    %rsi,%rdx
  lea    0x0(%r13,%rdx,4),%rdx
  add    0x18(%rsp),%rsi
  lea    0x0(%r13,%rsi,4),%r15
L282:
  mov    (%rdx),%esi
  add    %si,(%rax)
  add    %rcx,%rax
  add    $0x4,%rdx
  cmp    %r15,%rdx
  jne    L282
  jmp    L183
L176:
  add    $0x1,%r8d
  add    %r14,%rdi
  cmp    %r9d,%r8d
  je     L202
L64:
  movzwl (%rdi),%edx
  test   %edx,%edx
  je     L176
  lea    (%rdi,%r11,1),%rax
  lea    0x80(%rdx),%esi
  sar    $0x8,%esi
  imul   %ebx,%esi
  movslq %esi,%rsi
  movw   $0x80,(%rdi)
  test   %ebx,%ebx
  jle    L176
  lea    0x0(%r13,%rsi,4),%rdx
  add    %r15,%rsi
  lea    (%r12,%rsi,4),%rsi
  mov    %rdi,(%rsp)
L27:
  movzwl (%rdx),%edi
  add    %di,(%rax)
  add    %rcx,%rax
  add    $0x4,%rdx
  cmp    %rdx,%rsi
  jne    L27
  mov    (%rsp),%rdi
  jmp    L176
L202:
  mov    %r9d,%eax
L335:
  mov    0x20(%rsp),%edi
  cmp    %eax,%edi
  jle    L336
  mov    0x30(%rsp),%edx
  imul   %eax,%edx
  movslq %edx,%rdx
  lea    0x2(%r10,%rdx,2),%r8
  add    %ebp,%edi
  sub    %eax,%edi
  lea    0x4(%r13),%r15
  jmp    L422
L326:
  mov    0x70(%rsp),%eax
  jmp    L335
L32:
  add    %r14,%r8
  sub    $0x1,%edi
  cmp    %ebp,%edi
  je     L336
L422:
  movzwl (%r8),%edx
  test   %edx,%edx
  je     L32
  lea    (%r11,%r8,1),%rax
  lea    0x80(%rdx),%esi
  sar    $0x8,%esi
  imul   %ebx,%esi
  movslq %esi,%rsi
  movw   $0x80,(%r8)
  test   %edi,%edi
  jle    L32
  lea    0x0(%r13,%rsi,4),%rdx
  lea    -0x1(%rdi),%r12d
  add    %r12,%rsi
  lea    (%r15,%rsi,4),%r12
L530:
  mov    (%rdx),%esi
  add    %si,(%rax)
  add    %rcx,%rax
  add    $0x4,%rdx
  cmp    %rdx,%r12
  jne    L530
  jmp    L32
L336:
  add    $0x2,%r10
  cmp    0x28(%rsp),%r10
  je     L130
L199:
  lea    0x2(%r10),%rdi
  mov    $0x0,%r8d
  mov    0x40(%rsp),%r12d
  test   %ebp,%ebp
  jg     L357
L547:
  mov    0x70(%rsp),%r8d
  cmp    %r9d,%r8d
  jge    L326
  mov    0x38(%rsp),%rax
  lea    (%r10,%rax,1),%rdi
  mov    0x48(%rsp),%r15d
  lea    0x4(%r13),%r12
  jmp    L64
L130:
  mov    0x50(%rsp),%r15
L403:
  mov    0x20(%rsp),%r11d
  test   %r11d,%r11d
  jle    L488
  mov    0x24(%rsp),%r10d
  movslq %r10d,%rax
  lea    0x2(%rax,%rax,1),%r8
  mov    $0x0,%esi
  mov    %r10d,%ecx
  movslq 0x74(%rsp),%rdi
  mov    0x68(%rsp),%r9
  jmp    L268
L478:
  movzbl 0x1(%r15,%rax,2),%edx
  mov    %dl,(%r9,%rax,1)
  add    $0x1,%rax
  cmp    %rax,%rcx
  jne    L478
L263:
  add    %rdi,%r9
  add    %r8,%r15
  add    $0x1,%esi
  cmp    %esi,%r11d
  je     L488
L268:
  mov    $0x0,%eax
  test   %r10d,%r10d
  jg     L478
  jmp    L263
L488:
  add    $0x88,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void blur(unsigned char *buffer, unsigned short *tmp2, int width, int height, int stride, int *m2, int r, int mwidth) {
  int x, y;
  unsigned char *s = buffer;
  unsigned short *t = tmp2 + 1;
  for (y = 0; y < height; y++) {
    memset(t - 1, 0, (width + 1) * sizeof(short));
    for (x = 0; x < r; x++) {
      const int src = s[x];
      if (src) {
        register unsigned short *dstp = t + x - r;
        int mx;
        unsigned *m3 = m2 + src * mwidth;
        for (mx = r - x; mx < mwidth; mx++) {
          dstp[mx] += m3[mx];
        }
      }
    }
    for (; x < width - r; x++) {
      const int src = s[x];
      if (src) {
        register unsigned short *dstp = t + x - r;
        int mx;
        unsigned *m3 = m2 + src * mwidth;
        for (mx = 0; mx < mwidth; mx++) {
          dstp[mx] += m3[mx];
        }
      }
    }
    for (; x < width; x++) {
      const int src = s[x];
      if (src) {
        register unsigned short *dstp = t + x - r;
        int mx;
        const int x2 = r + width - x;
        unsigned *m3 = m2 + src * mwidth;
        for (mx = 0; mx < x2; mx++) {
          dstp[mx] += m3[mx];
        }
      }
    }
    s += stride;
    t += width + 1;
  }
  t = tmp2;
  for (x = 0; x < width; x++) {
    for (y = 0; y < r; y++) {
      unsigned short *srcp = t + y * (width + 1) + 1;
      int src = *srcp;
      if (src) {
        register unsigned short *dstp = srcp - 1 + width + 1;
        const int src2 = (src + 128) >> 8;
        unsigned *m3 = m2 + src2 * mwidth;
        int mx;
        *srcp = 128;
        for (mx = r - 1; mx < mwidth; mx++) {
          *dstp += m3[mx];
          dstp += width + 1;
        }
      }
    }
    for (; y < height - r; y++) {
      unsigned short *srcp = t + y * (width + 1) + 1;
      int src = *srcp;
      if (src) {
        register unsigned short *dstp = srcp - 1 - r * (width + 1);
        const int src2 = (src + 128) >> 8;
        unsigned *m3 = m2 + src2 * mwidth;
        int mx;
        *srcp = 128;
        for (mx = 0; mx < mwidth; mx++) {
          *dstp += m3[mx];
          dstp += width + 1;
        }
      }
    }
    for (; y < height; y++) {
      unsigned short *srcp = t + y * (width + 1) + 1;
      int src = *srcp;
      if (src) {
        const int y2 = r + height - y;
        register unsigned short *dstp = srcp - 1 - r * (width + 1);
        const int src2 = (src + 128) >> 8;
        unsigned *m3 = m2 + src2 * mwidth;
        int mx;
        *srcp = 128;
        for (mx = 0; mx < y2; mx++) {
          *dstp += m3[mx];
          dstp += width + 1;
        }
      }
    }
    t++;
  }
  t = tmp2;
  s = buffer;
  for (y = 0; y < height; y++) {
    for (x = 0; x < width; x++) {
      s[x] = t[x] >> 8;
    }
    s += stride;
    t += width + 1;
  }
}
```