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

```asm
<trace_edge>:
  endbr64
  push   %r15
  mov    %ecx,%eax
  lea    -0x1(%rsi),%ecx
  push   %r14
  push   %r13
  push   %r12
  mov    %edx,%r12d
  sub    $0x1,%edx
  push   %rbp
  sub    %r9d,%edx
  push   %rbx
  mov    0x70(%rsp),%r10
  mov    0x38(%rsp),%r13
  mov    0x40(%rsp),%rbp
  movl   $0x0,(%r10)
  mov    0x58(%rsp),%ebx
  mov    %ecx,-0x8(%rsp)
  sub    %r9d,%ecx
  mov    %ecx,-0xc(%rsp)
  mov    %edx,-0x4(%rsp)
L293:
  test   %ebx,%ebx
  je     L312
  cmp    %eax,%r9d
  jle    L114
L130:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L114:
  cmp    %eax,-0xc(%rsp)
  jl     L130
  cmp    %r8d,%r9d
  jg     L130
  cmp    %r8d,-0x4(%rsp)
  jl     L130
  nopw   0x0(%rax,%rax,1)
L312:
  mov    %esi,%ecx
  imul   %r8d,%ecx
  lea    (%rcx,%rax,1),%edx
  movslq %edx,%rdx
  movb   $0xff,(%rdi,%rdx,1)
  mov    (%r10),%edx
  cmp    0x60(%rsp),%edx
  jge    L280
  mov    0x68(%rsp),%r15
  add    %edx,%edx
  movslq %edx,%rdx
  mov    %eax,(%r15,%rdx,4)
  mov    (%r10),%edx
  add    %edx,%edx
  movslq %edx,%rdx
  mov    %r8d,0x4(%r15,%rdx,4)
  addl   $0x1,(%r10)
L280:
  cmp    %eax,0x0(%r13)
  jle    L116
  mov    %eax,0x0(%r13)
L248:
  cmp    %r8d,0x0(%rbp)
  jle    L113
L326:
  mov    %r8d,0x0(%rbp)
L231:
  mov    %r8d,%r14d
  lea    -0x1(%rax),%edx
  sub    $0x1,%r14d
  js     L234
L179:
  mov    %ecx,%r11d
  sub    %esi,%r11d
  test   %edx,%edx
  js     L128
  lea    (%rdx,%r11,1),%r15d
  movslq %r15d,%r15
  cmpb   $0x0,(%rdi,%r15,1)
  jne    L128
  mov    %r14d,%r8d
  mov    %edx,%eax
  jmp    L293
  nopw   0x0(%rax,%rax,1)
L116:
  mov    0x48(%rsp),%rdx
  cmp    %eax,(%rdx)
  jge    L248
  mov    %eax,(%rdx)
  cmp    %r8d,0x0(%rbp)
  jg     L326
L113:
  mov    0x50(%rsp),%rdx
  cmp    %r8d,(%rdx)
  jge    L231
  mov    %r8d,%r14d
  mov    %r8d,(%rdx)
  lea    -0x1(%rax),%edx
  sub    $0x1,%r14d
  jns    L179
  nopw   0x0(%rax,%rax,1)
L234:
  test   %eax,%eax
  jle    L156
  lea    (%rcx,%rdx,1),%r11d
  movslq %r11d,%r11
  cmpb   $0x0,(%rdi,%r11,1)
  je     L169
L156:
  cmp    %eax,-0x8(%rsp)
  jle    L244
  lea    0x1(%rax),%r14d
  lea    (%rcx,%r14,1),%r11d
  movslq %r11d,%r11
  cmpb   $0x0,(%rdi,%r11,1)
  je     L163
L244:
  add    $0x1,%r8d
  cmp    %r8d,%r12d
  jle    L130
  add    %esi,%ecx
  test   %edx,%edx
  js     L120
  lea    (%rdx,%rcx,1),%r11d
  movslq %r11d,%r11
  cmpb   $0x0,(%rdi,%r11,1)
  je     L169
L120:
  lea    (%rcx,%rax,1),%edx
  movslq %edx,%rdx
  cmpb   $0x0,(%rdi,%rdx,1)
  je     L293
  add    $0x1,%eax
  cmp    %eax,%esi
  jle    L130
  add    %eax,%ecx
  movslq %ecx,%rcx
  cmpb   $0x0,(%rdi,%rcx,1)
  je     L293
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L169:
  mov    %edx,%eax
  jmp    L293
  nop
L128:
  lea    (%r11,%rax,1),%r15d
  movslq %r15d,%r15
  cmpb   $0x0,(%rdi,%r15,1)
  jne    L96
  mov    %r14d,%r8d
  jmp    L293
  cs nopw 0x0(%rax,%rax,1)
L96:
  lea    0x1(%rax),%r15d
  cmp    %r15d,%esi
  jle    L234
  add    %r15d,%r11d
  movslq %r11d,%r11
  cmpb   $0x0,(%rdi,%r11,1)
  jne    L234
  mov    %r14d,%r8d
  mov    %r15d,%eax
  jmp    L293
  nopl   0x0(%rax)
L163:
  mov    %r14d,%eax
  jmp    L293
```

assistant: ```c
void trace_edge(unsigned char *edgesImage, int width, int height, int x, int y, int image_border, int *perimeter_tx, int *perimeter_ty, int *perimeter_bx, int *perimeter_by, int ignore_periphery, int max_members, int *members, int *no_of_members) {
  int following, n, xx, yy;
  *no_of_members = 0;
  following = 1;
  while (following != 0) {
    following = 0;
    if ((ignore_periphery == 0) || ((ignore_periphery != 0) && ((x >= image_border) && (x <= width - 1 - image_border) && (y >= image_border) && (y <= height - 1 - image_border)))) {
      edgesImage[(y * width) + x] = 255;
      if (*no_of_members < max_members) {
        members[*no_of_members * 2] = x;
        members[*no_of_members * 2 + 1] = y;
        *no_of_members = *no_of_members + 1;
      }
      if (x < *perimeter_tx) {
        *perimeter_tx = x;
      } else {
        if (x > *perimeter_bx)
          *perimeter_bx = x;
      }
      if (y < *perimeter_ty) {
        *perimeter_ty = y;
      } else {
        if (y > *perimeter_by)
          *perimeter_by = y;
      }
      yy = y - 1;
      xx = x - 1;
      if (yy > -1) {
        n = yy * width;
        if (xx > -1) {
          if (edgesImage[n + xx] == 0) {
            x = xx;
            y = yy;
            following = 1;
          }
        }
        xx = x;
        if ((following == 0) && (edgesImage[n + xx] == 0)) {
          x = xx;
          y = yy;
          following = 1;
        }
        xx = x + 1;
        if ((following == 0) && (xx < width)) {
          if (edgesImage[n + xx] == 0) {
            x = xx;
            y = yy;
            following = 1;
          }
        }
      }
      if (following == 0) {
        yy = y;
        n = yy * width;
        if (x > 0) {
          xx = x - 1;
          if (edgesImage[n + xx] == 0) {
            x = xx;
            y = yy;
            following = 1;
          }
        }
        if ((following == 0) && (x < width - 1)) {
          xx = x + 1;
          if (edgesImage[n + xx] == 0) {
            x = xx;
            y = yy;
            following = 1;
          }
        }
      }
      if (following == 0) {
        yy = y + 1;
        n = yy * width;
        if (yy < height) {
          xx = x - 1;
          if (xx > -1) {
            if (edgesImage[n + xx] == 0) {
              x = xx;
              y = yy;
              following = 1;
            }
          }
          if (following == 0) {
            xx++;
            if (edgesImage[n + xx] == 0) {
              x = xx;
              y = yy;
              following = 1;
            }
          }
          if (following == 0) {
            xx++;
            if (xx < width) {
              if (edgesImage[n + xx] == 0) {
                x = xx;
                y = yy;
                following = 1;
              }
            }
          }
        }
      }
    }
  }
}
```