user: Demonstrate the C code that generates the assembly output below:

```asm
<stbtt__h_prefilter>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %esi,0x10(%rsp)
  mov    %edx,0x24(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  mov    %esi,%eax
  movslq %ecx,%rsi
  movl   $0x0,0xc(%rsp)
  mov    %rsi,0x18(%rsp)
  lea    0x30(%rsp),%rsi
  mov    %rsi,0x28(%rsp)
  sub    %r8d,%eax
  mov    %eax,0x20(%rsp)
  add    $0x1,%eax
  mov    %eax,0x14(%rsp)
  test   %edx,%edx
  jle    L8
  mov    %r8d,%ebx
  mov    %rdi,%r15
L244:
  mov    0x28(%rsp),%rdi
  xor    %esi,%esi
  mov    %ebx,%edx
  call   <memset@plt>
  cmp    $0x4,%ebx
  je     L156
  ja     L182
  cmp    $0x2,%ebx
  je     L246
  cmp    $0x3,%ebx
  jne    L243
  mov    0x20(%rsp),%ecx
  mov    0x14(%rsp),%esi
  xor    %eax,%eax
  xor    %r12d,%r12d
  test   %ecx,%ecx
  js     L115
L176:
  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    L176
L10:
  mov    0x14(%rsp),%eax
L115:
  cmp    %eax,0x10(%rsp)
  jle    L185
  mov    0x10(%rsp),%ecx
  movslq %eax,%r13
  lea    0x1(%r13),%r14
  lea    -0x1(%rcx),%ebp
  sub    %eax,%ebp
  add    %r14,%rbp
  jmp    L33
  nopl   (%rax)
L164:
  add    $0x1,%r14
L33:
  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    L164
L185:
  addl   $0x1,0xc(%rsp)
  add    0x18(%rsp),%r15
  mov    0xc(%rsp),%eax
  cmp    %eax,0x24(%rsp)
  jne    L244
L8:
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L147
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L182:
  cmp    $0x5,%ebx
  jne    L243
  mov    0x20(%rsp),%edi
  mov    0x14(%rsp),%esi
  xor    %eax,%eax
  xor    %r12d,%r12d
  test   %edi,%edi
  js     L115
  nopw   0x0(%rax,%rax,1)
L13:
  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    L13
  jmp    L10
  nopl   0x0(%rax,%rax,1)
L243:
  mov    0x20(%rsp),%eax
  mov    0x14(%rsp),%edi
  xor    %esi,%esi
  xor    %r12d,%r12d
  test   %eax,%eax
  js     L215
  nopl   (%rax)
L158:
  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    L158
  jmp    L10
  nopw   0x0(%rax,%rax,1)
L156:
  mov    0x20(%rsp),%esi
  mov    0x14(%rsp),%edi
  xor    %eax,%eax
  xor    %r12d,%r12d
  test   %esi,%esi
  js     L115
  nopl   (%rax)
L38:
  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    L38
  jmp    L10
  nopl   0x0(%rax)
L246:
  mov    0x20(%rsp),%edx
  mov    0x14(%rsp),%edi
  xor    %eax,%eax
  xor    %r12d,%r12d
  test   %edx,%edx
  js     L115
  nopl   (%rax)
L83:
  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    L83
  jmp    L10
L215:
  xor    %eax,%eax
  jmp    L115
L147:
  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;
  }
}
```