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

```asm
<strip_endpoints_8>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %edx,-0x24(%rbp)
  mov    %ecx,-0x28(%rbp)
  mov    -0x18(%rbp),%rax
  cmp    -0x20(%rbp),%rax
  setne  %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  movl   $0x0,-0x8(%rbp)
  jmp    L38
L57:
  movl   $0x0,-0xc(%rbp)
  jmp    L19
L8:
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0xc(%rbp),%eax
  cltq
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L21
  mov    -0x8(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0xc(%rbp),%eax
  cltq
  sub    $0x1,%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%edx
  mov    -0x8(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rcx
  mov    -0x20(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%rcx
  mov    -0xc(%rbp),%eax
  cltq
  add    %rcx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  lea    (%rdx,%rax,1),%ecx
  mov    -0x8(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0xc(%rbp),%eax
  cltq
  add    $0x1,%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  add    %eax,%ecx
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0xc(%rbp),%eax
  cltq
  sub    $0x1,%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  add    %eax,%ecx
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0xc(%rbp),%eax
  cltq
  add    $0x1,%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  add    %eax,%ecx
  mov    -0x8(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0xc(%rbp),%eax
  cltq
  sub    $0x1,%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  add    %eax,%ecx
  mov    -0x8(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0xc(%rbp),%eax
  cltq
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  add    %eax,%ecx
  mov    -0x8(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0xc(%rbp),%eax
  cltq
  add    $0x1,%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  add    %ecx,%eax
  mov    %eax,-0x4(%rbp)
  cmpl   $0x1,-0x4(%rbp)
  je     L21
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0xc(%rbp),%eax
  cltq
  add    %rdx,%rax
  movb   $0x1,(%rax)
L21:
  addl   $0x1,-0xc(%rbp)
L19:
  mov    -0xc(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L8
  addl   $0x1,-0x8(%rbp)
L38:
  mov    -0x8(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jl     L57
  nop
  nop
  leave
  ret
```

assistant: ```c
void strip_endpoints_8(unsigned char **result, unsigned char **pixels, int w, int h) {
  int x, y;
  assert(result != pixels);
  for (y = 0; y < h; y++)
    for (x = 0; x < w; x++)
      if (pixels[y][x]) {
        int degree = pixels[y - 1][x - 1] + pixels[y - 1][x] + pixels[y - 1][x + 1] + pixels[y][x - 1] + pixels[y][x + 1] + pixels[y + 1][x - 1] + pixels[y + 1][x] + pixels[y + 1][x + 1];
        if (degree != 1)
          result[y][x] = 1;
      }
}
```