user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<stbtt__h_prefilter>:
  endbr64
  push   %r15
  push   %r14
  mov    %rdi,%r14
  push   %r13
  mov    %edx,%r13d
  push   %r12
  push   %rbp
  mov    %ecx,%ebp
  push   %rbx
  mov    %r8d,%ebx
  sub    $0x48,%rsp
  mov    %esi,0x10(%rsp)
  sub    %r8d,%esi
  lea    0x30(%rsp),%rdi
  mov    %edx,0x24(%rsp)
  mov    %esi,%r15d
  mov    $0x8,%edx
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  mov    %esi,0x20(%rsp)
  xor    %esi,%esi
  mov    %rdi,0x28(%rsp)
  call   <memset@plt>
  movslq %ebp,%rax
  movl   $0x0,0xc(%rsp)
  mov    %rax,0x18(%rsp)
  lea    0x1(%r15),%eax
  mov    %eax,0x14(%rsp)
  test   %r13d,%r13d
  jle    L35
  mov    %r14,%r15
  nopl   0x0(%rax)
L60:
  mov    0x28(%rsp),%rdi
  xor    %esi,%esi
  mov    %ebx,%edx
  call   <memset@plt>
  cmp    $0x4,%ebx
  je     L49
  ja     L188
  cmp    $0x2,%ebx
  je     L151
  cmp    $0x3,%ebx
  jne    L29
  mov    0x20(%rsp),%ecx
  mov    0x14(%rsp),%esi
  xor    %eax,%eax
  xor    %r12d,%r12d
  test   %ecx,%ecx
  js     L196
L0:
  mov    %rax,%rdi
  movzbl (%r15,%rax,1),%edx
  and    $0x7,%edi
  movzbl 0x30(%rsp,%rdi,1),%edi
  mov    %edx,%ecx
  sub    %edi,%edx
  add    %edx,%r12d
  lea    0x3(%rax),%edx
  and    $0x7,%edx
  mov    %cl,0x30(%rsp,%rdx,1)
  mov    %r12d,%edx
  mov    $0xaaaaaaab,%ecx
  imul   %rcx,%rdx
  shr    $0x21,%rdx
  mov    %dl,(%r15,%rax,1)
  add    $0x1,%rax
  cmp    %rax,%rsi
  jne    L0
L104:
  mov    0x14(%rsp),%eax
L196:
  cmp    %eax,0x10(%rsp)
  jle    L8
  mov    0x10(%rsp),%ecx
  movslq %eax,%r13
  lea    0x1(%r13),%r14
  lea    -0x1(%rcx),%ebp
  sub    %eax,%ebp
  add    %r14,%rbp
  jmp    L96
  nopl   (%rax)
L30:
  add    $0x1,%r14
L96:
  xor    %edi,%edi
  cmpb   $0x0,(%r15,%r13,1)
  sete   %dil
  call   <assert@plt>
  mov    %r13,%rax
  xor    %edx,%edx
  and    $0x7,%eax
  movzbl 0x30(%rsp,%rax,1),%eax
  sub    %eax,%r12d
  mov    %r12d,%eax
  div    %ebx
  mov    %al,(%r15,%r13,1)
  mov    %r14,%r13
  cmp    %r14,%rbp
  jne    L30
L8:
  addl   $0x1,0xc(%rsp)
  add    0x18(%rsp),%r15
  mov    0xc(%rsp),%eax
  cmp    %eax,0x24(%rsp)
  jne    L60
L35:
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L199
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L188:
  cmp    $0x5,%ebx
  jne    L29
  mov    0x20(%rsp),%edi
  mov    0x14(%rsp),%esi
  xor    %eax,%eax
  xor    %r12d,%r12d
  test   %edi,%edi
  js     L196
  nopw   0x0(%rax,%rax,1)
L78:
  mov    %rax,%rdi
  movzbl (%r15,%rax,1),%edx
  and    $0x7,%edi
  movzbl 0x30(%rsp,%rdi,1),%edi
  mov    %edx,%ecx
  sub    %edi,%edx
  add    %edx,%r12d
  lea    0x5(%rax),%edx
  and    $0x7,%edx
  mov    %cl,0x30(%rsp,%rdx,1)
  mov    %r12d,%edx
  mov    $0xcccccccd,%ecx
  imul   %rcx,%rdx
  shr    $0x22,%rdx
  mov    %dl,(%r15,%rax,1)
  add    $0x1,%rax
  cmp    %rax,%rsi
  jne    L78
  jmp    L104
  nopl   0x0(%rax,%rax,1)
L29:
  mov    0x20(%rsp),%eax
  mov    0x14(%rsp),%edi
  xor    %esi,%esi
  xor    %r12d,%r12d
  test   %eax,%eax
  js     L129
  nopl   (%rax)
L50:
  mov    %rsi,%rcx
  movzbl (%r15,%rsi,1),%eax
  and    $0x7,%ecx
  movzbl 0x30(%rsp,%rcx,1),%ecx
  mov    %eax,%edx
  sub    %ecx,%eax
  add    %eax,%r12d
  lea    (%rbx,%rsi,1),%eax
  and    $0x7,%eax
  mov    %dl,0x30(%rsp,%rax,1)
  mov    %r12d,%eax
  xor    %edx,%edx
  div    %ebx
  mov    %al,(%r15,%rsi,1)
  add    $0x1,%rsi
  cmp    %rsi,%rdi
  jne    L50
  jmp    L104
  nopw   0x0(%rax,%rax,1)
L49:
  mov    0x20(%rsp),%esi
  mov    0x14(%rsp),%edi
  xor    %eax,%eax
  xor    %r12d,%r12d
  test   %esi,%esi
  js     L196
  nopl   (%rax)
L204:
  mov    %rax,%rsi
  movzbl (%r15,%rax,1),%edx
  and    $0x7,%esi
  movzbl 0x30(%rsp,%rsi,1),%esi
  mov    %edx,%ecx
  sub    %esi,%edx
  add    %edx,%r12d
  lea    0x4(%rax),%edx
  and    $0x7,%edx
  mov    %cl,0x30(%rsp,%rdx,1)
  mov    %r12d,%edx
  shr    $0x2,%edx
  mov    %dl,(%r15,%rax,1)
  add    $0x1,%rax
  cmp    %rax,%rdi
  jne    L204
  jmp    L104
  nopl   0x0(%rax)
L151:
  mov    0x20(%rsp),%edx
  mov    0x14(%rsp),%edi
  xor    %eax,%eax
  xor    %r12d,%r12d
  test   %edx,%edx
  js     L196
  nopl   (%rax)
L167:
  mov    %rax,%rsi
  movzbl (%r15,%rax,1),%edx
  and    $0x7,%esi
  movzbl 0x30(%rsp,%rsi,1),%esi
  mov    %edx,%ecx
  sub    %esi,%edx
  add    %edx,%r12d
  lea    0x2(%rax),%edx
  and    $0x7,%edx
  mov    %cl,0x30(%rsp,%rdx,1)
  mov    %r12d,%edx
  shr    %edx
  mov    %dl,(%r15,%rax,1)
  add    $0x1,%rax
  cmp    %rax,%rdi
  jne    L167
  jmp    L104
L129:
  xor    %eax,%eax
  jmp    L196
L199:
  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;
  memset(buffer, 0, 8);
  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;
  }
}
```