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

```asm
<vertex_degree>:
  endbr64
  push   %r15
  mov    %ecx,%eax
  mov    %rdx,%r15
  push   %r14
  mov    %esi,%r14d
  push   %r13
  mov    %r9d,%r13d
  push   %r12
  mov    %r8d,%r12d
  push   %rbp
  mov    %ecx,%ebp
  push   %rbx
  mov    %edi,%ebx
  sub    $0x8,%rsp
  or     %r8d,%eax
  js     L154
  cmp    %edi,%ecx
  jg     L154
  xor    %edi,%edi
  cmp    %esi,%r8d
  setle  %dil
L186:
  call   <assert@plt>
  test   %ebp,%ebp
  setg   %dl
  test   %r12d,%r12d
  setg   %dil
  test   %dl,%dl
  je     L57
  test   %dil,%dil
  je     L57
  lea    -0x1(%r12),%ecx
  lea    -0x1(%rbp),%r8d
  mov    %ecx,%eax
  imul   %ebx,%eax
  add    %r8d,%eax
  cltq
  movsbl (%r15,%rax,1),%r10d
  xor    %eax,%eax
  cmp    %r13d,%r10d
  jl     L145
L174:
  cmp    %r14d,%r12d
  setl   %cl
  test   %dl,%dl
  je     L156
  test   %cl,%cl
  je     L156
  mov    %ebx,%edx
  lea    -0x1(%rbp),%esi
  imul   %r12d,%edx
  add    %esi,%edx
  movslq %edx,%rdx
  movsbl (%r15,%rdx,1),%edx
  add    %r13d,%edx
  test   %edx,%edx
  jle    L156
  cmpq   $0x0,0x40(%rsp)
  je     L221
  mov    0x40(%rsp),%rdx
  mov    %esi,(%rdx)
L221:
  cmpq   $0x0,0x48(%rsp)
  je     L219
  mov    0x48(%rsp),%rsi
  mov    %r12d,(%rsi)
L219:
  add    $0x1,%eax
L156:
  cmp    %ebx,%ebp
  setl   %sil
  test   %dil,%dil
  je     L10
  test   %sil,%sil
  je     L10
  lea    -0x1(%r12),%edi
  mov    %edi,%edx
  imul   %ebx,%edx
  add    %ebp,%edx
  movslq %edx,%rdx
  movsbl (%r15,%rdx,1),%edx
  add    %r13d,%edx
  test   %edx,%edx
  jle    L10
  cmpq   $0x0,0x40(%rsp)
  je     L20
  mov    0x40(%rsp),%rdx
  mov    %ebp,(%rdx)
L20:
  cmpq   $0x0,0x48(%rsp)
  je     L139
  mov    0x48(%rsp),%rdx
  mov    %edi,(%rdx)
L139:
  add    $0x1,%eax
L10:
  test   %cl,%cl
  je     L240
  test   %sil,%sil
  je     L240
  imul   %r12d,%ebx
  add    %ebp,%ebx
  movslq %ebx,%rbx
  movsbl (%r15,%rbx,1),%edx
  cmp    %r13d,%edx
  jl     L90
L240:
  mov    $0x4,%edx
  sub    %eax,%edx
  test   %r13d,%r13d
  cmovne %edx,%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L57:
  xor    %eax,%eax
  jmp    L174
  nop
L154:
  xor    %edi,%edi
  jmp    L186
  nopw   0x0(%rax,%rax,1)
L145:
  cmpq   $0x0,0x40(%rsp)
  je     L213
  mov    0x40(%rsp),%rax
  mov    %r8d,(%rax)
L213:
  cmpq   $0x0,0x48(%rsp)
  mov    $0x1,%eax
  je     L174
  mov    0x48(%rsp),%rsi
  mov    %ecx,(%rsi)
  jmp    L174
  nopl   (%rax)
L90:
  cmpq   $0x0,0x40(%rsp)
  je     L82
  mov    0x40(%rsp),%rcx
  mov    %ebp,(%rcx)
L82:
  cmpq   $0x0,0x48(%rsp)
  je     L49
  mov    0x48(%rsp),%rcx
  mov    %r12d,(%rcx)
L49:
  add    $0x1,%eax
  jmp    L240
```

assistant: ```c
int vertex_degree(int w, int h, signed char *soln, int x, int y, int anti, int *sx, int *sy) {
  int ret = 0;
  assert(x >= 0 && x <= w && y >= 0 && y <= h);
  if (x > 0 && y > 0 && soln[(y - 1) * w + (x - 1)] - anti < 0) {
    if (sx)
      *sx = x - 1;
    if (sy)
      *sy = y - 1;
    ret++;
  }
  if (x > 0 && y < h && soln[y * w + (x - 1)] + anti > 0) {
    if (sx)
      *sx = x - 1;
    if (sy)
      *sy = y;
    ret++;
  }
  if (x < w && y > 0 && soln[(y - 1) * w + x] + anti > 0) {
    if (sx)
      *sx = x;
    if (sy)
      *sy = y - 1;
    ret++;
  }
  if (x < w && y < h && soln[y * w + x] - anti < 0) {
    if (sx)
      *sx = x;
    if (sy)
      *sy = y;
    ret++;
  }
  return anti ? 4 - ret : ret;
}
```