user: Please show me the C implementation that matches the assembly code listed below:

```asm
<find_sw2ne>:
  endbr64
  push   %r15
  push   %r14
  mov    %rdi,%r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rsi,(%rsp)
  mov    %edx,0x1c(%rsp)
  mov    %ecx,0x8(%rsp)
  movl   $0x0,0x18(%rsp)
  test   %edx,%edx
  jle    L174
  nopl   0x0(%rax)
L45:
  mov    0x8(%rsp),%eax
  movl   $0x0,0xc(%rsp)
  test   %eax,%eax
  jle    L115
  nopl   0x0(%rax)
L143:
  movsbl (%r14),%edi
  test   %dil,%dil
  je     L91
  mov    0xc(%rsp),%esi
  cmp    %esi,0x8(%rsp)
  jle    L91
  mov    0x18(%rsp),%r13d
  mov    0xc(%rsp),%r12d
  mov    %r14,%rbx
  mov    $0x1,%r15d
  xchg   %ax,%ax
L159:
  lea    -0x1(%r15),%ebp
  call   <isspace@plt>
  test   %rax,%rax
  jne    L6
  mov    (%rsp),%rdx
  movslq %r13d,%rax
  lea    (%rax,%rax,4),%rax
  lea    (%rdx,%rax,8),%rcx
  movslq %r12d,%rax
  movzbl (%rcx,%rax,1),%eax
  cmp    %al,(%rbx)
  je     L90
  movslq %ebp,%rbp
  cmpb   $0x0,(%r14,%rbp,1)
  jne    L91
L169:
  movsbl (%r14),%edi
  test   %dil,%dil
  je     L91
  mov    0x18(%rsp),%ebp
  mov    0xc(%rsp),%r12d
  mov    %r14,%r13
  xor    %ebx,%ebx
  jmp    L170
  nopl   0x0(%rax,%rax,1)
L160:
  add    $0x1,%ebx
L93:
  movslq %ebx,%r13
  add    %r14,%r13
  movsbl 0x0(%r13),%edi
  test   %dil,%dil
  je     L91
L170:
  call   <isspace@plt>
  test   %rax,%rax
  jne    L160
  mov    (%rsp),%rsi
  movslq %ebp,%rax
  movslq %r12d,%r15
  lea    (%rax,%rax,4),%rax
  lea    (%rsi,%rax,8),%rcx
  movsbl (%rcx,%r15,1),%edi
  cmp    %dil,0x0(%r13)
  jne    L93
  add    $0x1,%ebx
  mov    %rcx,0x10(%rsp)
  sub    $0x1,%ebp
  add    $0x1,%r12d
  call   <toupper@plt>
  movslq %ebx,%r13
  mov    0x10(%rsp),%rcx
  add    %r14,%r13
  mov    %al,(%rcx,%r15,1)
  movsbl 0x0(%r13),%edi
  test   %dil,%dil
  jne    L170
  nopw   0x0(%rax,%rax,1)
L91:
  addl   $0x1,0xc(%rsp)
  mov    0xc(%rsp),%eax
  cmp    %eax,0x8(%rsp)
  jne    L143
L115:
  addl   $0x1,0x18(%rsp)
  mov    0x18(%rsp),%eax
  cmp    %eax,0x1c(%rsp)
  jne    L45
L174:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L90:
  sub    $0x1,%r13d
  add    $0x1,%r12d
L6:
  movslq %r15d,%rbx
  add    %r14,%rbx
  movsbl (%rbx),%edi
  test   %dil,%dil
  je     L169
  add    $0x1,%r15d
  test   %r13d,%r13d
  js     L91
  cmp    0x8(%rsp),%r12d
  jl     L159
  jmp    L91
```

assistant: ```c
void find_sw2ne(char word[], char board[40][40], int nrows, int ncols) {
  int i, j;
  for (i = 0; i < nrows; i++) {
    for (j = 0; j < ncols; j++) {
      int k = 0;
      int match = 1;
      int h = j, m = i;
      ;
      while (word[k] != '\0' && m >= 0 && h < ncols && match) {
        if (isspace(word[k])) {
          k++;
        } else if (word[k] == board[m][h]) {
          k++;
          m--;
          h++;
        } else {
          match = 0;
        }
      }
      if (word[k] == '\0') {
        k = 0;
        h = j;
        m = i;
        while (word[k] != '\0') {
          if (isspace(word[k])) {
            k++;
          } else if (word[k] == board[m][h]) {
            board[m][h] = toupper(board[m][h]);
            k++;
            m--;
            h++;
          }
        }
      }
    }
  }
}
```