user: What is the c source code of the assembly code below?

```asm
<vertex_degree>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %edi,%ebx
  mov    %esi,%r15d
  mov    %rdx,%r14
  mov    %ecx,%ebp
  mov    %r8d,%r12d
  mov    %r9d,%r13d
  mov    %ecx,%eax
  or     %r8d,%eax
  js     L12
  cmp    %edi,%ecx
  jg     L12
  cmp    %esi,%r8d
  setle  %dil
  movzbl %dil,%edi
L231:
  call   <assert@plt>
  test   %ebp,%ebp
  setg   %dl
  test   %r12d,%r12d
  setg   %sil
  test   %dl,%dl
  je     L209
  test   %sil,%sil
  je     L209
  lea    -0x1(%r12),%ecx
  lea    -0x1(%rbp),%edi
  mov    %ecx,%eax
  imul   %ebx,%eax
  add    %edi,%eax
  cltq
  movsbl (%r14,%rax,1),%r8d
  mov    $0x0,%eax
  cmp    %r13d,%r8d
  jge    L186
  cmpq   $0x0,0x40(%rsp)
  je     L169
  mov    0x40(%rsp),%rax
  mov    %edi,(%rax)
L169:
  mov    $0x1,%eax
  cmpq   $0x0,0x48(%rsp)
  je     L186
  mov    0x48(%rsp),%rax
  mov    %ecx,(%rax)
  mov    $0x1,%eax
  jmp    L186
L12:
  mov    $0x0,%edi
  jmp    L231
L209:
  mov    $0x0,%eax
L186:
  cmp    %r15d,%r12d
  setl   %cl
  test   %dl,%dl
  je     L212
  test   %cl,%cl
  je     L212
  lea    -0x1(%rbp),%edi
  mov    %ebx,%edx
  imul   %r12d,%edx
  add    %edi,%edx
  movslq %edx,%rdx
  movsbl (%r14,%rdx,1),%edx
  add    %r13d,%edx
  test   %edx,%edx
  jle    L212
  cmpq   $0x0,0x40(%rsp)
  je     L240
  mov    0x40(%rsp),%rdx
  mov    %edi,(%rdx)
L240:
  cmpq   $0x0,0x48(%rsp)
  je     L83
  mov    0x48(%rsp),%rdi
  mov    %r12d,(%rdi)
L83:
  add    $0x1,%eax
L212:
  cmp    %ebx,%ebp
  setl   %dil
  test   %sil,%sil
  je     L79
  test   %dil,%dil
  je     L79
  lea    -0x1(%r12),%esi
  mov    %esi,%edx
  imul   %ebx,%edx
  add    %ebp,%edx
  movslq %edx,%rdx
  movsbl (%r14,%rdx,1),%edx
  add    %r13d,%edx
  test   %edx,%edx
  jle    L79
  cmpq   $0x0,0x40(%rsp)
  je     L88
  mov    0x40(%rsp),%rdx
  mov    %ebp,(%rdx)
L88:
  cmpq   $0x0,0x48(%rsp)
  je     L216
  mov    0x48(%rsp),%rdx
  mov    %esi,(%rdx)
L216:
  add    $0x1,%eax
L79:
  test   %cl,%cl
  je     L241
  test   %dil,%dil
  je     L241
  imul   %r12d,%ebx
  add    %ebp,%ebx
  movslq %ebx,%rbx
  movsbl (%r14,%rbx,1),%edx
  cmp    %r13d,%edx
  jl     L234
L241:
  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
L234:
  cmpq   $0x0,0x40(%rsp)
  je     L199
  mov    0x40(%rsp),%rcx
  mov    %ebp,(%rcx)
L199:
  cmpq   $0x0,0x48(%rsp)
  je     L180
  mov    0x48(%rsp),%rsi
  mov    %r12d,(%rsi)
L180:
  add    $0x1,%eax
  jmp    L241
```

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;
}
```