user: Translate the below assembly code into C programming language:

```asm
<get_neighbors>:
  endbr64
  mov    %edi,%eax
  mov    %esi,%edi
  lea    -0x1(%rsi),%r10d
  push   %rbp
  neg    %edi
  push   %rbx
  shr    $0x1f,%edi
  cmp    %r10d,%ecx
  setg   %r9b
  and    %edi,%r9d
  test   %esi,%esi
  js     L646
  cmp    %ecx,%esi
  jge    L646
  test   %r9b,%r9b
  lea    -0x1(%rax),%edi
  mov    %eax,%r9d
  jne    L329
  neg    %r9d
  jns    L218
  cmp    %edi,%edx
  jle    L218
  movslq %edi,%rdi
  movslq %esi,%r9
  lea    0x1(%rsi),%r10d
  mov    (%r8,%rdi,8),%rdi
  movsbl (%rdi,%r9,1),%r9d
  cmp    %r10d,%ecx
  jle    L482
  movslq %r10d,%r11
  movsbl (%rdi,%r11,1),%edi
  add    %edi,%r9d
  cmp    %edx,%eax
  jge    L482
  test   %eax,%eax
  js     L482
L387:
  movslq %eax,%rdi
  movslq %r10d,%r10
  mov    (%r8,%rdi,8),%rdi
  movsbl (%rdi,%r10,1),%edi
  add    %edi,%r9d
  jmp    L482
  nopl   0x0(%rax,%rax,1)
L646:
  test   %r9b,%r9b
  jne    L627
  mov    %eax,%edi
  lea    -0x1(%rax),%r9d
  neg    %edi
  jns    L135
  cmp    %edx,%r9d
  jge    L135
  mov    %esi,%edi
  add    $0x1,%edi
  js     L135
  cmp    %ecx,%edi
  jge    L135
  movslq %r9d,%r9
  movslq %edi,%r10
  mov    (%r8,%r9,8),%r11
  movsbl (%r11,%r10,1),%r9d
  test   %eax,%eax
  js     L545
  cmp    %edx,%eax
  jge    L545
L349:
  movslq %eax,%rsi
  movslq %edi,%rcx
  mov    (%r8,%rsi,8),%rsi
  movsbl (%rsi,%rcx,1),%ecx
  add    %ecx,%r9d
  add    $0x1,%eax
  js     L346
  cmp    %eax,%edx
  jle    L346
L484:
  cltq
  movslq %edi,%rdi
  mov    (%r8,%rax,8),%rax
  movsbl (%rax,%rdi,1),%eax
  add    %eax,%r9d
  jmp    L346
  nopl   0x0(%rax)
L627:
  mov    %eax,%r9d
  lea    -0x1(%rax),%edi
  neg    %r9d
  jns    L551
  cmp    %edi,%edx
  jle    L551
  movslq %edi,%rdi
  movslq %r10d,%rbx
  mov    (%r8,%rdi,8),%r11
  mov    %esi,%edi
  movsbl (%r11,%rbx,1),%r9d
  add    $0x1,%edi
  js     L287
  cmp    %edi,%ecx
  jle    L287
  movslq %edi,%rbp
  movsbl (%r11,%rbp,1),%r11d
  add    %r11d,%r9d
  test   %eax,%eax
  js     L376
  cmp    %edx,%eax
  jge    L376
  movslq %eax,%r11
  mov    (%r8,%r11,8),%r11
  movsbl (%r11,%rbx,1),%ebx
  add    %ebx,%r9d
L515:
  movslq %edi,%rdi
  movsbl (%r11,%rdi,1),%edi
  add    %edi,%r9d
L376:
  add    $0x1,%eax
  cmp    %eax,%edx
  jle    L346
  test   %eax,%eax
  js     L346
  cltq
  movslq %r10d,%r10
  add    $0x1,%esi
  mov    (%r8,%rax,8),%rax
  movsbl (%rax,%r10,1),%edx
  add    %edx,%r9d
  cmp    %ecx,%esi
  jge    L346
  test   %esi,%esi
  js     L346
  movslq %esi,%rsi
  movsbl (%rax,%rsi,1),%eax
  add    %eax,%r9d
  jmp    L346
  nopl   0x0(%rax)
L329:
  neg    %r9d
  jns    L189
  cmp    %edi,%edx
  jle    L189
  movslq %edi,%rdi
  movslq %r10d,%rbx
  movslq %esi,%r9
  mov    (%r8,%rdi,8),%r11
  lea    0x1(%rsi),%edi
  movsbl (%r11,%rbx,1),%ebp
  movsbl (%r11,%r9,1),%r9d
  add    %ebp,%r9d
  cmp    %edi,%ecx
  jle    L594
  movslq %edi,%rbp
  movsbl (%r11,%rbp,1),%r11d
  add    %r11d,%r9d
  test   %eax,%eax
  js     L418
  cmp    %edx,%eax
  jge    L418
  movslq %eax,%r11
  mov    (%r8,%r11,8),%r11
  movsbl (%r11,%rbx,1),%ebx
  add    %ebx,%r9d
L517:
  movslq %edi,%rdi
  movsbl (%r11,%rdi,1),%edi
  add    %edi,%r9d
  jmp    L418
  nopl   0x0(%rax,%rax,1)
L135:
  cmp    %edx,%eax
  jge    L607
  test   %eax,%eax
  js     L607
  lea    0x1(%rsi),%edi
  xor    %r9d,%r9d
  cmp    %edi,%ecx
  jle    L346
  test   %edi,%edi
  jns    L349
  jmp    L346
  nopl   0x0(%rax,%rax,1)
L218:
  test   %eax,%eax
  js     L109
  cmp    %edx,%eax
  jge    L109
  lea    0x1(%rsi),%r10d
  xor    %r9d,%r9d
  cmp    %r10d,%ecx
  jle    L482
  jmp    L387
  nopl   (%rax)
L607:
  xor    %r9d,%r9d
L545:
  add    $0x1,%eax
  js     L346
  cmp    %eax,%edx
  jle    L346
  add    $0x1,%esi
  mov    %esi,%edi
  js     L346
  cmp    %esi,%ecx
  jg     L484
  jmp    L346
  nopl   0x0(%rax)
L551:
  xor    %r9d,%r9d
L287:
  test   %eax,%eax
  js     L376
  cmp    %edx,%eax
  jge    L376
  movslq %eax,%rdi
  mov    (%r8,%rdi,8),%r11
  movslq %r10d,%rdi
  movsbl (%r11,%rdi,1),%edi
  add    %edi,%r9d
  mov    %esi,%edi
  add    $0x1,%edi
  js     L376
  cmp    %edi,%ecx
  jg     L515
  jmp    L376
  nopl   (%rax)
L189:
  xor    %r9d,%r9d
L594:
  test   %eax,%eax
  js     L418
  cmp    %edx,%eax
  jge    L418
  movslq %eax,%rdi
  mov    (%r8,%rdi,8),%r11
  movslq %r10d,%rdi
  movsbl (%r11,%rdi,1),%edi
  add    %edi,%r9d
  lea    0x1(%rsi),%edi
  cmp    %edi,%ecx
  jg     L517
L418:
  add    $0x1,%eax
  js     L346
  cmp    %eax,%edx
  jle    L346
  cltq
  movslq %r10d,%r10
  lea    0x1(%rsi),%edx
  movslq %esi,%rsi
  mov    (%r8,%rax,8),%rdi
  movsbl (%rdi,%r10,1),%eax
  add    %r9d,%eax
  movsbl (%rdi,%rsi,1),%r9d
  add    %eax,%r9d
  cmp    %edx,%ecx
  jle    L346
  movslq %edx,%rdx
  movsbl (%rdi,%rdx,1),%eax
  add    %eax,%r9d
L346:
  mov    %r9d,%eax
  pop    %rbx
  pop    %rbp
  ret
  nopl   0x0(%rax)
L109:
  xor    %r9d,%r9d
L482:
  add    $0x1,%eax
  js     L346
  cmp    %eax,%edx
  jle    L346
  cltq
  lea    0x1(%rsi),%edx
  movslq %esi,%rsi
  mov    (%r8,%rax,8),%rax
  movsbl (%rax,%rsi,1),%esi
  add    %esi,%r9d
  cmp    %edx,%ecx
  jle    L346
  movslq %edx,%rdx
  movsbl (%rax,%rdx,1),%eax
  add    %eax,%r9d
  jmp    L346
```

assistant: ```c
int get_neighbors(int i, int j, int x, int y, char **grid) {
  int neighbors = 0;
  for (int a = -1; a < 2; ++a) {
    for (int b = -1; b < 2; ++b) {
      if (a == 0 && b == 0) {
        continue;
      }
      int m = i + a;
      int n = j + b;
      if (m >= 0 && m < x && n >= 0 && n < y) {
        neighbors += grid[m][n];
      }
    }
  }
  return neighbors;
}
```