user: 请将以下的汇编代码转换成C语言代码：

```asm
<countNeighbors>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %edx,-0x20(%rbp)
  mov    %ecx,-0x24(%rbp)
  mov    %r8d,-0x28(%rbp)
  mov    %r9d,-0x2c(%rbp)
  movl   $0x0,-0x10(%rbp)
  mov    0x10(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x2c(%rbp),%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x28(%rbp),%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x8(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    %eax,%edx
  mov    -0xc(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  imul   -0x20(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  setne  %al
  movzbl %al,%eax
  add    %eax,-0x10(%rbp)
  mov    0x10(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x2c(%rbp),%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x28(%rbp),%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x8(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    %eax,%edx
  mov    -0xc(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  imul   -0x20(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  setne  %al
  movzbl %al,%eax
  add    %eax,-0x10(%rbp)
  mov    0x10(%rbp),%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x2c(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x28(%rbp),%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x8(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    %eax,%edx
  mov    -0xc(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  imul   -0x20(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  setne  %al
  movzbl %al,%eax
  add    %eax,-0x10(%rbp)
  mov    0x10(%rbp),%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x2c(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x28(%rbp),%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x8(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    %eax,%edx
  mov    -0xc(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  imul   -0x20(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  setne  %al
  movzbl %al,%eax
  add    %eax,-0x10(%rbp)
  mov    0x10(%rbp),%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x2c(%rbp),%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x28(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x8(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    %eax,%edx
  mov    -0xc(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  imul   -0x20(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  setne  %al
  movzbl %al,%eax
  add    %eax,-0x10(%rbp)
  mov    0x10(%rbp),%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x2c(%rbp),%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x28(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x8(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    %eax,%edx
  mov    -0xc(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  imul   -0x20(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  setne  %al
  movzbl %al,%eax
  add    %eax,-0x10(%rbp)
  mov    0x10(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x2c(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x28(%rbp),%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x8(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    %eax,%edx
  mov    -0xc(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  imul   -0x20(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  setne  %al
  movzbl %al,%eax
  add    %eax,-0x10(%rbp)
  mov    0x10(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x2c(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x28(%rbp),%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x8(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    %eax,%edx
  mov    -0xc(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  imul   -0x20(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  setne  %al
  movzbl %al,%eax
  add    %eax,-0x10(%rbp)
  mov    0x10(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x2c(%rbp),%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x28(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x8(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    %eax,%edx
  mov    -0xc(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  imul   -0x20(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  setne  %al
  movzbl %al,%eax
  add    %eax,-0x10(%rbp)
  mov    0x10(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x2c(%rbp),%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x28(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x8(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    %eax,%edx
  mov    -0xc(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  imul   -0x20(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  setne  %al
  movzbl %al,%eax
  add    %eax,-0x10(%rbp)
  mov    0x10(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x2c(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x28(%rbp),%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x8(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    %eax,%edx
  mov    -0xc(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  imul   -0x20(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  setne  %al
  movzbl %al,%eax
  add    %eax,-0x10(%rbp)
  mov    0x10(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x2c(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x28(%rbp),%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x8(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    %eax,%edx
  mov    -0xc(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  imul   -0x20(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  setne  %al
  movzbl %al,%eax
  add    %eax,-0x10(%rbp)
  mov    0x10(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x2c(%rbp),%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x28(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x8(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    %eax,%edx
  mov    -0xc(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  imul   -0x20(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  setne  %al
  movzbl %al,%eax
  add    %eax,-0x10(%rbp)
  mov    0x10(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x2c(%rbp),%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x28(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x8(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    %eax,%edx
  mov    -0xc(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  imul   -0x20(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  setne  %al
  movzbl %al,%eax
  add    %eax,-0x10(%rbp)
  mov    0x10(%rbp),%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x2c(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x28(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x8(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    %eax,%edx
  mov    -0xc(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  imul   -0x20(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  setne  %al
  movzbl %al,%eax
  add    %eax,-0x10(%rbp)
  mov    0x10(%rbp),%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x2c(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x28(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x8(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    %eax,%edx
  mov    -0xc(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  imul   -0x20(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  setne  %al
  movzbl %al,%eax
  add    %eax,-0x10(%rbp)
  mov    0x10(%rbp),%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x2c(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x28(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x8(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    %eax,%edx
  mov    -0xc(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  imul   -0x20(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  setne  %al
  movzbl %al,%eax
  add    %eax,-0x10(%rbp)
  mov    0x10(%rbp),%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x2c(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x28(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x8(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    %eax,%edx
  mov    -0xc(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  imul   -0x20(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  setne  %al
  movzbl %al,%eax
  add    %eax,-0x10(%rbp)
  mov    0x10(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x2c(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x28(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x8(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    %eax,%edx
  mov    -0xc(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  imul   -0x20(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  setne  %al
  movzbl %al,%eax
  add    %eax,-0x10(%rbp)
  mov    0x10(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x2c(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x28(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x8(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    %eax,%edx
  mov    -0xc(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  imul   -0x20(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  setne  %al
  movzbl %al,%eax
  add    %eax,-0x10(%rbp)
  mov    0x10(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x2c(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x28(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x8(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    %eax,%edx
  mov    -0xc(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  imul   -0x20(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  setne  %al
  movzbl %al,%eax
  add    %eax,-0x10(%rbp)
  mov    0x10(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x2c(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x28(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x8(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    %eax,%edx
  mov    -0xc(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  imul   -0x20(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  setne  %al
  movzbl %al,%eax
  add    %eax,-0x10(%rbp)
  mov    0x10(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x2c(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x28(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x8(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    %eax,%edx
  mov    -0xc(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  imul   -0x20(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  setne  %al
  movzbl %al,%eax
  add    %eax,-0x10(%rbp)
  mov    0x10(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x2c(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x28(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x8(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    %eax,%edx
  mov    -0xc(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  imul   -0x20(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  setne  %al
  movzbl %al,%eax
  add    %eax,-0x10(%rbp)
  mov    0x10(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x2c(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x28(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x8(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    %eax,%edx
  mov    -0xc(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  imul   -0x20(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  setne  %al
  movzbl %al,%eax
  add    %eax,-0x10(%rbp)
  mov    0x10(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x2c(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x28(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x8(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    %eax,%edx
  mov    -0xc(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  imul   -0x20(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  setne  %al
  movzbl %al,%eax
  add    %eax,-0x10(%rbp)
  mov    -0x10(%rbp),%eax
  pop    %rbp
  ret
```

assistant: ```c
int countNeighbors(unsigned char *im, const int dimx, const int dimy, const int dimz, const int i, const int j, const int k) {
  int a, b, c;
  int ct = 0;
  c = k - 1;
  b = j;
  a = i;
  ct += (im[((b) * (dimx) + (a) + (c) * (dimx) * (dimy))] != 0) ? 1 : 0;
  c = k + 1;
  b = j;
  a = i;
  ct += (im[((b) * (dimx) + (a) + (c) * (dimx) * (dimy))] != 0) ? 1 : 0;
  c = k;
  b = j - 1;
  a = i;
  ct += (im[((b) * (dimx) + (a) + (c) * (dimx) * (dimy))] != 0) ? 1 : 0;
  c = k;
  b = j + 1;
  a = i;
  ct += (im[((b) * (dimx) + (a) + (c) * (dimx) * (dimy))] != 0) ? 1 : 0;
  c = k;
  b = j;
  a = i - 1;
  ct += (im[((b) * (dimx) + (a) + (c) * (dimx) * (dimy))] != 0) ? 1 : 0;
  c = k;
  b = j;
  a = i + 1;
  ct += (im[((b) * (dimx) + (a) + (c) * (dimx) * (dimy))] != 0) ? 1 : 0;
  c = k - 1;
  b = j - 1;
  a = i;
  ct += (im[((b) * (dimx) + (a) + (c) * (dimx) * (dimy))] != 0) ? 1 : 0;
  c = k - 1;
  b = j + 1;
  a = i;
  ct += (im[((b) * (dimx) + (a) + (c) * (dimx) * (dimy))] != 0) ? 1 : 0;
  c = k - 1;
  b = j;
  a = i - 1;
  ct += (im[((b) * (dimx) + (a) + (c) * (dimx) * (dimy))] != 0) ? 1 : 0;
  c = k - 1;
  b = j;
  a = i + 1;
  ct += (im[((b) * (dimx) + (a) + (c) * (dimx) * (dimy))] != 0) ? 1 : 0;
  c = k + 1;
  b = j - 1;
  a = i;
  ct += (im[((b) * (dimx) + (a) + (c) * (dimx) * (dimy))] != 0) ? 1 : 0;
  c = k + 1;
  b = j + 1;
  a = i;
  ct += (im[((b) * (dimx) + (a) + (c) * (dimx) * (dimy))] != 0) ? 1 : 0;
  c = k + 1;
  b = j;
  a = i - 1;
  ct += (im[((b) * (dimx) + (a) + (c) * (dimx) * (dimy))] != 0) ? 1 : 0;
  c = k + 1;
  b = j;
  a = i + 1;
  ct += (im[((b) * (dimx) + (a) + (c) * (dimx) * (dimy))] != 0) ? 1 : 0;
  c = k;
  b = j - 1;
  a = i - 1;
  ct += (im[((b) * (dimx) + (a) + (c) * (dimx) * (dimy))] != 0) ? 1 : 0;
  c = k;
  b = j - 1;
  a = i + 1;
  ct += (im[((b) * (dimx) + (a) + (c) * (dimx) * (dimy))] != 0) ? 1 : 0;
  c = k;
  b = j + 1;
  a = i - 1;
  ct += (im[((b) * (dimx) + (a) + (c) * (dimx) * (dimy))] != 0) ? 1 : 0;
  c = k;
  b = j + 1;
  a = i + 1;
  ct += (im[((b) * (dimx) + (a) + (c) * (dimx) * (dimy))] != 0) ? 1 : 0;
  c = k - 1;
  b = j - 1;
  a = i - 1;
  ct += (im[((b) * (dimx) + (a) + (c) * (dimx) * (dimy))] != 0) ? 1 : 0;
  c = k - 1;
  b = j - 1;
  a = i + 1;
  ct += (im[((b) * (dimx) + (a) + (c) * (dimx) * (dimy))] != 0) ? 1 : 0;
  c = k - 1;
  b = j + 1;
  a = i - 1;
  ct += (im[((b) * (dimx) + (a) + (c) * (dimx) * (dimy))] != 0) ? 1 : 0;
  c = k - 1;
  b = j + 1;
  a = i + 1;
  ct += (im[((b) * (dimx) + (a) + (c) * (dimx) * (dimy))] != 0) ? 1 : 0;
  c = k + 1;
  b = j - 1;
  a = i - 1;
  ct += (im[((b) * (dimx) + (a) + (c) * (dimx) * (dimy))] != 0) ? 1 : 0;
  c = k + 1;
  b = j - 1;
  a = i + 1;
  ct += (im[((b) * (dimx) + (a) + (c) * (dimx) * (dimy))] != 0) ? 1 : 0;
  c = k + 1;
  b = j + 1;
  a = i - 1;
  ct += (im[((b) * (dimx) + (a) + (c) * (dimx) * (dimy))] != 0) ? 1 : 0;
  c = k + 1;
  b = j + 1;
  a = i + 1;
  ct += (im[((b) * (dimx) + (a) + (c) * (dimx) * (dimy))] != 0) ? 1 : 0;
  return ct;
}
```