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

```asm
<imgngbs>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  mov    %rdi,%rbp
  imul   %rsi,%rbp
  push   %rbx
  mov    %rsi,%rbx
  lea    -0x1(%rbx),%r14
  lea    0x0(%rbp,%rbp,4),%rdi
  sub    $0x28,%rsp
  shl    $0x4,%rdi
  mov    %rdx,0x10(%rsp)
  call   <malloc@plt>
  xor    %edi,%edi
  test   %rax,%rax
  mov    %rax,%r13
  setne  %dil
  sub    $0x1,%r12
  call   <assert@plt>
  mov    %r12,%rsi
  lea    (%rbx,%r14,1),%rdx
  lea    (%r14,%r14,4),%rax
  imul   %rbx,%rsi
  shl    $0x4,%rax
  lea    -0x1(%rdx),%rcx
  mov    %rbx,0x18(%r13)
  lea    0x1(%rbx),%r10
  lea    -0x2(%rbx),%r8
  movq   $0x1,0x10(%r13)
  mov    %r10,0x8(%r13)
  movq   $0x2,0x0(%r13)
  lea    (%rsi,%rsi,4),%r9
  movq   $0xffffffffffffffff,0x20(%r13)
  shl    $0x4,%r9
  mov    %rcx,0x8(%r13,%rax,1)
  mov    %rdx,0x18(%r13,%rax,1)
  mov    %r8,0x10(%r13,%rax,1)
  movq   $0x2,0x0(%r13,%rax,1)
  movq   $0xffffffffffffffff,0x20(%r13,%rax,1)
  mov    %rsi,%rax
  movq   $0x2,0x0(%r13,%r9,1)
  sub    %rbx,%rax
  lea    0x1(%rax),%rdx
  mov    %rax,0x18(%r13,%r9,1)
  lea    -0x1(%rbp),%rax
  sub    $0x2,%rbp
  mov    %rdx,0x8(%r13,%r9,1)
  lea    0x1(%rsi),%rdx
  mov    %rdx,0x10(%r13,%r9,1)
  mov    %rax,%rdx
  lea    (%rax,%rax,4),%rax
  movq   $0xffffffffffffffff,0x20(%r13,%r9,1)
  sub    %rbx,%rdx
  shl    $0x4,%rax
  lea    -0x1(%rdx),%rcx
  mov    %rbp,0x10(%r13,%rax,1)
  mov    %rcx,0x8(%r13,%rax,1)
  mov    %rdx,0x18(%r13,%rax,1)
  movq   $0x2,0x0(%r13,%rax,1)
  movq   $0xffffffffffffffff,0x20(%r13,%rax,1)
  cmp    $0x1,%r14
  jbe    L87
  lea    0x50(%r13),%rax
  mov    $0x1,%edx
L38:
  lea    (%r10,%rdx,1),%rcx
  lea    (%rbx,%rdx,1),%rdi
  add    $0x50,%rax
  movq   $0x3,-0x50(%rax)
  mov    %rcx,-0x48(%rax)
  lea    (%r14,%rdx,1),%rcx
  mov    %rcx,-0x40(%rax)
  mov    %rdx,%rcx
  add    $0x1,%rdx
  sub    $0x1,%rcx
  mov    %rdx,-0x38(%rax)
  mov    %rcx,-0x30(%rax)
  mov    %rdi,-0x28(%rax)
  movq   $0xffffffffffffffff,-0x20(%rax)
  cmp    %r14,%rdx
  jne    L38
  mov    %rsi,%rax
  sub    %rbx,%rax
  lea    0x2(%rax),%rdx
  lea    0x50(%r13,%r9,1),%rax
  nopl   0x0(%rax,%rax,1)
L22:
  lea    -0x2(%rdx),%rcx
  mov    %rdx,0x8(%rax)
  add    $0x50,%rax
  mov    %rcx,-0x40(%rax)
  lea    (%rdx,%rbx,1),%rcx
  mov    %rcx,-0x38(%rax)
  lea    (%r8,%rdx,1),%rcx
  mov    %rcx,-0x30(%rax)
  lea    -0x1(%rdx),%rcx
  add    $0x1,%rdx
  mov    %rcx,-0x28(%rax)
  movq   $0x3,-0x50(%rax)
  movq   $0xffffffffffffffff,-0x20(%rax)
  cmp    %rsi,%rdx
  jne    L22
L87:
  cmp    $0x1,%r12
  jbe    L51
  lea    (%rbx,%rbx,4),%r15
  lea    (%rbx,%rbx,1),%r9
  mov    $0x1,%eax
  mov    $0x1,%ecx
  shl    $0x4,%r15
  lea    -0x1(%r9),%r10
  lea    0x0(%r13,%r15,1),%rdx
  nopw   0x0(%rax,%rax,1)
L0:
  mov    %rax,0x8(%rdx)
  lea    -0x1(%rax),%rsi
  lea    (%r10,%rax,1),%rdi
  add    %r9,%rax
  mov    %rax,0x10(%rdx)
  add    $0x1,%rcx
  sub    %rbx,%rax
  mov    %rax,0x18(%rdx)
  mov    %rdi,0x20(%rdx)
  mov    %rsi,0x28(%rdx)
  movq   $0x3,(%rdx)
  movq   $0xffffffffffffffff,0x30(%rdx)
  add    %r15,%rdx
  cmp    %rcx,%r12
  jne    L0
  lea    (%rbx,%rbx,4),%rax
  mov    $0x1,%ecx
  lea    0x1(%r9),%r10
  shl    $0x5,%rax
  lea    -0x50(%r13,%rax,1),%rdx
  mov    %r8,%rax
  xchg   %ax,%ax
L45:
  mov    %rax,0x8(%rdx)
  lea    0x1(%rax),%rsi
  lea    (%r10,%rax,1),%rdi
  add    %r9,%rax
  mov    %rax,0x10(%rdx)
  add    $0x1,%rcx
  sub    %rbx,%rax
  mov    %rax,0x18(%rdx)
  mov    %rdi,0x20(%rdx)
  mov    %rsi,0x28(%rdx)
  movq   $0x3,(%rdx)
  movq   $0xffffffffffffffff,0x30(%rdx)
  add    %r15,%rdx
  cmp    %rcx,%r12
  jne    L45
  mov    $0x2,%eax
  lea    0x50(%r13,%r15,1),%rdi
  mov    $0x1,%ecx
  mov    %r12,0x8(%rsp)
  sub    %rbx,%rax
  mov    %r13,0x18(%rsp)
  lea    0x2(%r9),%rbp
  lea    0x2(%rbx),%r11
  mov    %rax,(%rsp)
  mov    %rcx,%r12
  mov    %rdi,%r13
  nopl   0x0(%rax,%rax,1)
L10:
  mov    (%rsp),%rax
  lea    (%rax,%r8,1),%rcx
  mov    %r13,%rax
  cmp    $0x1,%r14
  jbe    L46
  nopl   0x0(%rax)
L58:
  mov    %rcx,%rdx
  add    $0x1,%rcx
  movq   $0x5,(%rax)
  add    $0x50,%rax
  lea    0x2(%rdx),%rsi
  lea    0x0(%rbp,%rdx,1),%rdi
  mov    %rdx,-0x48(%rax)
  mov    %rsi,-0x40(%rax)
  lea    (%r9,%rdx,1),%rsi
  mov    %rsi,-0x38(%rax)
  sub    %rbx,%rsi
  mov    %rdi,-0x30(%rax)
  lea    (%r11,%rdx,1),%rdi
  add    %r10,%rdx
  mov    %rdi,-0x28(%rax)
  mov    %rsi,-0x20(%rax)
  mov    %rdx,-0x18(%rax)
  mov    %rcx,-0x10(%rax)
  movq   $0xffffffffffffffff,-0x8(%rax)
  cmp    %r8,%rcx
  jne    L58
L46:
  add    $0x1,%r12
  add    %r15,%r13
  add    %rbx,%r8
  cmp    %r12,0x8(%rsp)
  jne    L10
  mov    0x18(%rsp),%r13
L51:
  mov    0x10(%rsp),%rax
  mov    %r13,(%rax)
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void imgngbs(size_t s0, size_t s1, size_t **ngbs) {
  size_t ind, i, j;
  size_t *n, numngb;
  assert((n = malloc(s0 * s1 * 10 * sizeof *n)) != NULL);
  ind = 0;
  n[ind * 10 + 1] = ind + s1 + 1;
  n[ind * 10 + 2] = ind + 1;
  n[ind * 10 + 3] = ind + s1;
  n[ind * 10] = 2;
  n[ind * 10 + 4] = -1;
  ;
  ind = s1 - 1;
  n[ind * 10 + 1] = ind + s1 - 1;
  n[ind * 10 + 2] = ind - 1;
  n[ind * 10 + 3] = ind + s1;
  n[ind * 10] = 2;
  n[ind * 10 + 4] = -1;
  ;
  ind = (s0 - 1) * s1;
  n[ind * 10 + 1] = ind - s1 + 1;
  n[ind * 10 + 2] = ind + 1;
  n[ind * 10 + 3] = ind - s1;
  n[ind * 10] = 2;
  n[ind * 10 + 4] = -1;
  ;
  ind = s0 * s1 - 1;
  n[ind * 10 + 1] = ind - s1 - 1;
  n[ind * 10 + 2] = ind - 1;
  n[ind * 10 + 3] = ind - s1;
  n[ind * 10] = 2;
  n[ind * 10 + 4] = -1;
  ;
  for (j = 1; j < s1 - 1; j++) {
    ind = j;
    n[ind * 10 + 1] = ind + s1 + 1;
    n[ind * 10 + 2] = ind + s1 - 1;
    n[ind * 10 + 3] = ind + 1;
    n[ind * 10 + 4] = ind - 1;
    n[ind * 10 + 5] = ind + s1;
    n[ind * 10] = 3;
    n[ind * 10 + 6] = -1;
    ;
  }
  for (j = 1; j < s1 - 1; j++) {
    ind = (s0 - 1) * s1 + j;
    n[ind * 10 + 1] = ind - s1 + 1;
    n[ind * 10 + 2] = ind - s1 - 1;
    n[ind * 10 + 3] = ind + 1;
    n[ind * 10 + 4] = ind - 1;
    n[ind * 10 + 5] = ind - s1;
    n[ind * 10] = 3;
    n[ind * 10 + 6] = -1;
    ;
  }
  for (i = 1; i < s0 - 1; i++) {
    ind = i * s1;
    n[ind * 10 + 1] = ind - s1 + 1;
    n[ind * 10 + 2] = ind + s1 + 1;
    n[ind * 10 + 3] = ind + 1;
    n[ind * 10 + 4] = ind + s1;
    n[ind * 10 + 5] = ind - s1;
    n[ind * 10] = 3;
    n[ind * 10 + 6] = -1;
    ;
  }
  for (i = 1; i < s0 - 1; i++) {
    ind = (i + 1) * s1 - 1;
    n[ind * 10 + 1] = ind - s1 - 1;
    n[ind * 10 + 2] = ind + s1 - 1;
    n[ind * 10 + 3] = ind - 1;
    n[ind * 10 + 4] = ind + s1;
    n[ind * 10 + 5] = ind - s1;
    n[ind * 10] = 3;
    n[ind * 10 + 6] = -1;
    ;
  }
  for (i = 1; i < s0 - 1; i++)
    for (j = 1; j < s1 - 1; j++) {
      ind = i * s1 + j;
      n[ind * 10 + 1] = ind - s1 - 1;
      n[ind * 10 + 2] = ind - s1 + 1;
      n[ind * 10 + 3] = ind + s1 - 1;
      n[ind * 10 + 4] = ind + s1 + 1;
      n[ind * 10 + 5] = ind + 1;
      n[ind * 10 + 6] = ind - 1;
      n[ind * 10 + 7] = ind + s1;
      n[ind * 10 + 8] = ind - s1;
      n[ind * 10] = 5;
      n[ind * 10 + 9] = -1;
    }
  if (0) {
    for (i = 0; i < s0; i++)
      for (j = 0; j < s1; j++) {
        printf("%lu: ", i * s1 + j);
        numngb = n[(i * s1 + j) * 10];
        ;
        do
          printf("%lu, ", n[(i * s1 + j) * 10 + numngb]);
        while (n[(i * s1 + j) * 10 + ++numngb] != (size_t)(-1));
        printf("\b\b.\n");
      }
  }
  *ngbs = n;
}
```