user: Converte this assembly snippet into its equivalent C code:

```asm
<getAnzNachbarn>:
  endbr64
  mov    %esi,%r9d
  mov    %ecx,%eax
  mov    %rdx,%rsi
  cmp    %edi,%ecx
  jge    L53
  test   %ecx,%ecx
  js     L53
  cmp    %r9d,%r8d
  jge    L12
  test   %r8d,%r8d
  js     L12
  lea    -0x1(%r8),%ecx
  setne  %dl
  cmp    %ecx,%r9d
  setg   %r10b
  imul   %edi,%ecx
  add    $0x1,%r8d
  and    %r10d,%edx
  lea    (%rcx,%rdi,1),%r10d
  cmp    %r8d,%r9d
  jg     L43
  test   %dl,%dl
  lea    -0x1(%rax),%edx
  jne    L88
  cmp    %edi,%edx
  jge    L240
  cmp    $0xffffffff,%edx
  je     L240
  add    %r10d,%edx
  xor    %r9d,%r9d
  movslq %edx,%rdx
  mov    (%rsi,%rdx,4),%r11d
  test   %r11d,%r11d
  setne  %r9b
  jmp    L13
  nopl   0x0(%rax)
L43:
  test   %dl,%dl
  lea    -0x1(%rax),%edx
  jne    L120
  cmp    %edx,%edi
  jle    L20
  cmp    $0xffffffff,%edx
  je     L20
  lea    (%r10,%rdx,1),%ecx
  xor    %r9d,%r9d
  movslq %ecx,%rcx
  mov    (%rsi,%rcx,4),%r11d
  mov    %edi,%ecx
  test   %r11d,%r11d
  setne  %r9b
  imul   %r8d,%ecx
  add    %ecx,%edx
  movslq %edx,%rdx
  cmpl   $0x1,(%rsi,%rdx,4)
  sbb    $0xffffffff,%r9d
  jmp    L179
  xchg   %ax,%ax
L240:
  xor    %r9d,%r9d
L13:
  add    $0x1,%eax
  cmp    %eax,%edi
  jg     L177
L238:
  mov    %r9d,%eax
  ret
  xchg   %ax,%ax
L20:
  xor    %r9d,%r9d
L179:
  imul   %edi,%r8d
  lea    (%r8,%rax,1),%edx
  movslq %edx,%rdx
  cmpl   $0x1,(%rsi,%rdx,4)
  sbb    $0xffffffff,%r9d
  add    $0x1,%eax
  cmp    %eax,%edi
  jle    L238
L46:
  lea    (%rax,%r10,1),%edx
  movslq %edx,%rdx
  cmpl   $0x1,(%rsi,%rdx,4)
  sbb    $0xffffffff,%r9d
  add    %eax,%r8d
  movslq %r8d,%rax
  cmpl   $0x1,(%rsi,%rax,4)
  sbb    $0xffffffff,%r9d
  jmp    L238
  nopl   0x0(%rax)
L88:
  cmp    %edx,%edi
  jle    L236
  cmp    $0xffffffff,%edx
  jne    L255
L236:
  xor    %r9d,%r9d
L134:
  lea    (%rax,%rcx,1),%edx
  movslq %edx,%rdx
  cmpl   $0x1,(%rsi,%rdx,4)
  sbb    $0xffffffff,%r9d
  add    $0x1,%eax
  cmp    %eax,%edi
  jle    L238
  add    %eax,%ecx
  movslq %ecx,%rdx
  cmpl   $0x1,(%rsi,%rdx,4)
  sbb    $0xffffffff,%r9d
  nopw   0x0(%rax,%rax,1)
L177:
  add    %r10d,%eax
  cltq
  cmpl   $0x1,(%rsi,%rax,4)
  sbb    $0xffffffff,%r9d
  jmp    L238
  nopw   0x0(%rax,%rax,1)
L120:
  cmp    %edx,%edi
  jle    L112
  cmp    $0xffffffff,%edx
  jne    L181
L112:
  xor    %r9d,%r9d
L131:
  lea    (%rax,%rcx,1),%edx
  movslq %edx,%rdx
  cmpl   $0x1,(%rsi,%rdx,4)
  sbb    $0xffffffff,%r9d
  imul   %edi,%r8d
  lea    (%r8,%rax,1),%edx
  movslq %edx,%rdx
  cmpl   $0x1,(%rsi,%rdx,4)
  sbb    $0xffffffff,%r9d
  add    $0x1,%eax
  cmp    %edi,%eax
  jge    L238
  add    %eax,%ecx
  movslq %ecx,%rdx
  cmpl   $0x1,(%rsi,%rdx,4)
  sbb    $0xffffffff,%r9d
  jmp    L46
  nopw   0x0(%rax,%rax,1)
L255:
  lea    (%rcx,%rdx,1),%r8d
  xor    %r9d,%r9d
  movslq %r8d,%r8
  mov    (%rsi,%r8,4),%r8d
  test   %r8d,%r8d
  setne  %r9b
  add    %r10d,%edx
  movslq %edx,%rdx
  cmpl   $0x1,(%rsi,%rdx,4)
  sbb    $0xffffffff,%r9d
  jmp    L134
  nopl   0x0(%rax,%rax,1)
L181:
  lea    (%rcx,%rdx,1),%r9d
  lea    (%r10,%rdx,1),%r11d
  movslq %r9d,%r9
  movslq %r11d,%r11
  mov    (%rsi,%r9,4),%r9d
  test   %r9d,%r9d
  setne  %r9b
  cmpl   $0x1,(%rsi,%r11,4)
  mov    %edi,%r11d
  movzbl %r9b,%r9d
  sbb    $0xffffffff,%r9d
  imul   %r8d,%r11d
  add    %r11d,%edx
  movslq %edx,%rdx
  cmpl   $0x1,(%rsi,%rdx,4)
  sbb    $0xffffffff,%r9d
  jmp    L131
L53:
  mov    $0xffffffff,%r9d
  jmp    L238
L12:
  mov    $0xfffffffe,%r9d
  jmp    L238
```

assistant: ```c
int getAnzNachbarn(int breite, int hoehe, bool *spielfeld, int xPos, int yPos) {
  if (xPos >= breite || xPos < 0)
    return -1;
  if (yPos >= hoehe || yPos < 0)
    return -2;
  int n = 0;
  for (int b = -1; b <= 1; b++) {
    if (xPos + b >= 0 && xPos + b < breite) {
      for (int h = -1; h <= 1; h++) {
        if (yPos + h >= 0 && yPos + h < hoehe) {
          if (!(b == 0 && h == 0) && spielfeld[(yPos + h) * breite + (xPos + b)])
            n++;
        }
      }
    }
  }
  return n;
}
```