user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<stbtt__h_prefilter>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %esi,0x4(%rsp)
  mov    %edx,0xc(%rsp)
  mov    %ecx,0x18(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  sub    %r8d,%esi
  mov    %esi,0x8(%rsp)
  test   %edx,%edx
  jle    L57
  mov    %rdi,%r12
  mov    %r8d,%r13d
  mov    $0x0,%r15d
  lea    0x20(%rsp),%rax
  mov    %rax,0x10(%rsp)
  lea    0x1(%rsi),%eax
  mov    %eax,0x1c(%rsp)
  jmp    L135
L234:
  cmp    $0x5,%r13d
  jne    L180
  mov    0x8(%rsp),%esi
  mov    %esi,%ecx
  mov    $0x0,%eax
  mov    $0x0,%ebx
  test   %esi,%esi
  js     L199
L76:
  movzbl (%r12,%rax,1),%esi
  movzbl %sil,%edx
  mov    %rax,%rdi
  and    $0x7,%edi
  movzbl 0x20(%rsp,%rdi,1),%edi
  sub    %edi,%edx
  add    %edx,%ebx
  lea    0x5(%rax),%edx
  and    $0x7,%edx
  mov    %sil,0x20(%rsp,%rdx,1)
  mov    %ebx,%edx
  mov    $0xcccccccd,%esi
  imul   %rsi,%rdx
  shr    $0x22,%rdx
  mov    %dl,(%r12,%rax,1)
  mov    %rax,%rdx
  add    $0x1,%rax
  cmp    %rcx,%rdx
  jne    L76
  mov    0x1c(%rsp),%eax
  jmp    L199
L192:
  mov    0x8(%rsp),%ecx
  mov    %ecx,%esi
  mov    $0x0,%eax
  mov    $0x0,%ebx
  test   %ecx,%ecx
  js     L199
L26:
  movzbl (%r12,%rax,1),%ecx
  movzbl %cl,%edx
  mov    %rax,%rdi
  and    $0x7,%edi
  movzbl 0x20(%rsp,%rdi,1),%edi
  sub    %edi,%edx
  add    %edx,%ebx
  lea    0x4(%rax),%edx
  and    $0x7,%edx
  mov    %cl,0x20(%rsp,%rdx,1)
  mov    %ebx,%edx
  shr    $0x2,%edx
  mov    %dl,(%r12,%rax,1)
  mov    %rax,%rdx
  add    $0x1,%rax
  cmp    %rsi,%rdx
  jne    L26
  mov    0x1c(%rsp),%eax
  jmp    L199
L189:
  mov    0x8(%rsp),%ecx
  mov    %ecx,%esi
  mov    $0x0,%eax
  mov    $0x0,%ebx
  test   %ecx,%ecx
  js     L199
L161:
  movzbl (%r12,%rax,1),%ecx
  movzbl %cl,%edx
  mov    %rax,%rdi
  and    $0x7,%edi
  movzbl 0x20(%rsp,%rdi,1),%edi
  sub    %edi,%edx
  add    %edx,%ebx
  lea    0x2(%rax),%edx
  and    $0x7,%edx
  mov    %cl,0x20(%rsp,%rdx,1)
  mov    %ebx,%edx
  shr    %edx
  mov    %dl,(%r12,%rax,1)
  mov    %rax,%rdx
  add    $0x1,%rax
  cmp    %rdx,%rsi
  jne    L161
  mov    0x1c(%rsp),%eax
L199:
  cmp    %eax,0x4(%rsp)
  jle    L72
  movslq %eax,%rbp
  mov    0x4(%rsp),%ecx
  lea    -0x1(%rcx),%edx
  sub    %eax,%edx
  lea    0x1(%rbp,%rdx,1),%r14
L247:
  cmpb   $0x0,(%r12,%rbp,1)
  sete   %dil
  movzbl %dil,%edi
  call   <assert@plt>
  mov    %rbp,%rax
  and    $0x7,%eax
  movzbl 0x20(%rsp,%rax,1),%eax
  sub    %eax,%ebx
  mov    %ebx,%eax
  mov    $0x0,%edx
  div    %r13d
  mov    %al,(%r12,%rbp,1)
  add    $0x1,%rbp
  cmp    %r14,%rbp
  jne    L247
L72:
  movslq 0x18(%rsp),%rax
  add    %rax,%r12
  add    $0x1,%r15d
  cmp    %r15d,0xc(%rsp)
  je     L57
L135:
  mov    %r13d,%edx
  mov    $0x0,%esi
  mov    0x10(%rsp),%rdi
  call   <memset@plt>
  cmp    $0x4,%r13d
  je     L192
  ja     L234
  cmp    $0x2,%r13d
  je     L189
  cmp    $0x3,%r13d
  jne    L180
  mov    0x8(%rsp),%esi
  mov    %esi,%ecx
  mov    $0x0,%eax
  mov    $0x0,%ebx
  test   %esi,%esi
  js     L199
L179:
  movzbl (%r12,%rax,1),%esi
  movzbl %sil,%edx
  mov    %rax,%rdi
  and    $0x7,%edi
  movzbl 0x20(%rsp,%rdi,1),%edi
  sub    %edi,%edx
  add    %edx,%ebx
  lea    0x3(%rax),%edx
  and    $0x7,%edx
  mov    %sil,0x20(%rsp,%rdx,1)
  mov    %ebx,%edx
  mov    $0xaaaaaaab,%esi
  imul   %rsi,%rdx
  shr    $0x21,%rdx
  mov    %dl,(%r12,%rax,1)
  mov    %rax,%rdx
  add    $0x1,%rax
  cmp    %rcx,%rdx
  jne    L179
  mov    0x1c(%rsp),%eax
  jmp    L199
L180:
  mov    0x8(%rsp),%eax
  mov    %eax,%esi
  mov    $0x0,%ecx
  mov    $0x0,%ebx
  test   %eax,%eax
  js     L160
L198:
  movzbl (%r12,%rcx,1),%edx
  movzbl %dl,%eax
  mov    %rcx,%rdi
  and    $0x7,%edi
  movzbl 0x20(%rsp,%rdi,1),%edi
  sub    %edi,%eax
  add    %eax,%ebx
  lea    0x0(%r13,%rcx,1),%eax
  and    $0x7,%eax
  mov    %dl,0x20(%rsp,%rax,1)
  mov    %ebx,%eax
  mov    $0x0,%edx
  div    %r13d
  mov    %al,(%r12,%rcx,1)
  mov    %rcx,%rax
  add    $0x1,%rcx
  cmp    %rsi,%rax
  jne    L198
  mov    0x1c(%rsp),%eax
  jmp    L199
L160:
  mov    $0x0,%eax
  jmp    L199
L57:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L28
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L28:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void stbtt__h_prefilter(unsigned char *pixels, int w, int h, int stride_in_bytes, unsigned int kernel_width) {
  unsigned char buffer[8];
  int safe_w = w - kernel_width;
  int j;
  for (j = 0; j < h; ++j) {
    int i;
    unsigned int total;
    memset(buffer, 0, kernel_width);
    total = 0;
    switch (kernel_width) {
    case 2:
      for (i = 0; i <= safe_w; ++i) {
        total += pixels[i] - buffer[i & (8 - 1)];
        buffer[(i + kernel_width) & (8 - 1)] = pixels[i];
        pixels[i] = (unsigned char)(total / 2);
      }
      break;
    case 3:
      for (i = 0; i <= safe_w; ++i) {
        total += pixels[i] - buffer[i & (8 - 1)];
        buffer[(i + kernel_width) & (8 - 1)] = pixels[i];
        pixels[i] = (unsigned char)(total / 3);
      }
      break;
    case 4:
      for (i = 0; i <= safe_w; ++i) {
        total += pixels[i] - buffer[i & (8 - 1)];
        buffer[(i + kernel_width) & (8 - 1)] = pixels[i];
        pixels[i] = (unsigned char)(total / 4);
      }
      break;
    case 5:
      for (i = 0; i <= safe_w; ++i) {
        total += pixels[i] - buffer[i & (8 - 1)];
        buffer[(i + kernel_width) & (8 - 1)] = pixels[i];
        pixels[i] = (unsigned char)(total / 5);
      }
      break;
    default:
      for (i = 0; i <= safe_w; ++i) {
        total += pixels[i] - buffer[i & (8 - 1)];
        buffer[(i + kernel_width) & (8 - 1)] = pixels[i];
        pixels[i] = (unsigned char)(total / kernel_width);
      }
      break;
    }
    for (; i < w; ++i) {
      assert(pixels[i] == 0);
      total -= buffer[i & (8 - 1)];
      pixels[i] = (unsigned char)(total / kernel_width);
    }
    pixels += stride_in_bytes;
  }
}
```