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

```asm
<clean_mask>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%r8
  mov    %rsi,%r15
  mov    %edx,%r9d
  mov    %ecx,%edi
  mov    %ecx,-0x24(%rsp)
  imul   %edx,%edi
  test   %edi,%edi
  jle    L227
  mov    %edi,%ecx
  mov    $0x0,%eax
L195:
  cmpq   $0x0,(%r8,%rax,8)
  setg   %dl
  movzbl %dl,%edx
  mov    %rdx,(%r15,%rax,8)
  add    $0x1,%rax
  cmp    %rcx,%rax
  jne    L195
L227:
  mov    -0x24(%rsp),%ebx
  test   %ebx,%ebx
  jle    L83
  mov    %ebx,%esi
  mov    $0x0,%eax
  mov    $0x0,%r11d
  lea    -0x1(%rbx),%r10d
  jmp    L256
L213:
  test   %rdx,%rdx
  jle    L275
  add    $0x1,%r11d
L109:
  add    $0x1,%rax
  cmp    %rsi,%rax
  je     L234
L256:
  cmpq   $0x0,(%r15,%rax,8)
  jle    L109
  lea    (%rbx,%rax,1),%edx
  movslq %edx,%rdx
  mov    (%r8,%rdx,8),%rdx
  mov    %eax,%ecx
  test   %eax,%eax
  jle    L281
  add    -0x8(%r8,%rax,8),%rdx
L281:
  cmp    %ecx,%r10d
  jle    L213
  add    0x8(%r8,%rax,8),%rdx
  jmp    L213
L275:
  movq   $0x0,(%r15,%rax,8)
  jmp    L109
L234:
  lea    -0x1(%r9),%eax
  mov    %eax,-0x10(%rsp)
  mov    %edi,%ebx
  sub    -0x24(%rsp),%ebx
  mov    %ebx,-0xc(%rsp)
  cmp    $0x1,%eax
  jle    L99
L315:
  mov    -0x24(%rsp),%eax
  movslq %eax,%rdi
  lea    0x0(,%rdi,8),%rbx
  mov    %rbx,-0x18(%rsp)
  lea    (%r8,%rbx,1),%r13
  lea    -0x1(%rax),%r9d
  lea    0x8(%r15,%rbx,1),%rbp
  lea    (%rax,%rax,1),%ebx
  mov    $0x0,%r12d
  mov    $0x1,%r14d
  mov    %r15,-0x8(%rsp)
  mov    %rdi,%r15
  jmp    L335
L84:
  mov    -0x20(%rsp),%rax
  movq   $0x0,-0x8(%rax)
  jmp    L27
L21:
  movq   $0x0,(%rcx)
L340:
  add    $0x8,%rcx
  add    $0x1,%edx
  add    $0x8,%rsi
  cmp    %r9d,%edx
  je     L343
L313:
  cmpq   $0x0,(%rcx)
  jle    L340
  lea    (%rdx,%rbx,1),%r10d
  movslq %r10d,%r10
  movslq %edx,%rax
  mov    (%r8,%rax,8),%rax
  add    (%r8,%r10,8),%rax
  add    (%rsi),%rax
  add    0x10(%rsi),%rax
  test   %rax,%rax
  jle    L21
  add    $0x1,%r11d
  jmp    L340
L343:
  add    $0x1,%r14d
  mov    -0x20(%rsp),%rax
  cmpq   $0x0,-0x10(%rax,%r15,8)
  jle    L306
  lea    (%r9,%rbx,1),%edx
  movslq %edx,%rdx
  movslq %r9d,%rax
  mov    (%r8,%rax,8),%rax
  add    (%r8,%rdx,8),%rax
  add    -0x10(%r13,%r15,8),%rax
  test   %rax,%rax
  jle    L43
  add    $0x1,%r11d
L306:
  mov    -0x24(%rsp),%edi
  add    %edi,%r12d
  mov    -0x18(%rsp),%rax
  add    %rax,%r13
  add    %edi,%r9d
  add    %rax,%rbp
  cmp    -0x10(%rsp),%r14d
  jge    L7
L335:
  mov    %rbp,-0x20(%rsp)
  cmpq   $0x0,-0x8(%rbp)
  jle    L27
  lea    (%r12,%rbx,1),%edx
  movslq %edx,%rdx
  movslq %r12d,%rax
  mov    (%r8,%rax,8),%rax
  add    (%r8,%rdx,8),%rax
  add    0x8(%r13),%rax
  test   %rax,%rax
  jle    L84
  add    $0x1,%r11d
L27:
  lea    0x1(%r12),%edx
  mov    %r13,%rsi
  mov    %rbp,%rcx
  cmpl   $0x2,-0x24(%rsp)
  jg     L313
  jmp    L343
L43:
  mov    -0x20(%rsp),%rax
  movq   $0x0,-0x10(%rax,%r15,8)
  jmp    L306
L7:
  mov    -0x8(%rsp),%r15
  test   %edi,%edi
  jle    L274
L99:
  mov    -0x24(%rsp),%edi
  mov    %edi,%r9d
  mov    -0xc(%rsp),%ebx
  movslq %ebx,%rcx
  shl    $0x3,%rcx
  lea    (%r15,%rcx,1),%rsi
  add    %r8,%rcx
  mov    $0x0,%eax
  sub    %edi,%ebx
  lea    -0x1(%rdi),%r10d
  jmp    L187
L183:
  test   %rdx,%rdx
  jle    L107
  add    $0x1,%r11d
L334:
  add    $0x1,%rax
  cmp    %r9,%rax
  je     L274
L187:
  cmpq   $0x0,(%rsi,%rax,8)
  jle    L334
  lea    (%rbx,%rax,1),%edx
  movslq %edx,%rdx
  mov    (%r8,%rdx,8),%rdx
  mov    %eax,%edi
  test   %eax,%eax
  jle    L345
  add    -0x8(%rcx,%rax,8),%rdx
L345:
  cmp    %edi,%r10d
  jle    L183
  add    0x8(%rcx,%rax,8),%rdx
  jmp    L183
L107:
  movq   $0x0,(%rsi,%rax,8)
  jmp    L334
L159:
  mov    $0x0,%r11d
L274:
  mov    %r11d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L83:
  lea    -0x1(%r9),%eax
  mov    %eax,-0x10(%rsp)
  cmp    $0x1,%eax
  jle    L159
  sub    -0x24(%rsp),%edi
  mov    %edi,-0xc(%rsp)
  mov    $0x0,%r11d
  jmp    L315
```

assistant: ```c
int clean_mask(const int8_t *__restrict msk, int8_t *__restrict ret, int ns, int nf) {
  int i, j, q, npx;
  int8_t t;
  npx = 0;
#pragma omp parallel for private(i)
  for (i = 0; i < ns * nf; i++) {
    if (msk[i] > 0) {
      ret[i] = 1;
    } else {
      ret[i] = 0;
    }
  }
  i = 0;
  for (j = 0; j < nf; j++) {
    q = i * nf + j;
    if (ret[q] > 0) {
      t = msk[q + nf];
      if (j > 0)
        t += msk[q - 1];
      if (j < (nf - 1))
        t += msk[q + 1];
      if (t > 0) {
        npx++;
      } else {
        ret[q] = 0;
      }
    }
  }
#pragma omp parallel for private(i, j, q, t) reduction(+ : npx)
  for (i = 1; i < (ns - 1); i++) {
    q = i * nf;
    if (ret[q] > 0) {
      t = msk[q - nf] + msk[q + nf] + msk[q + 1];
      if (t > 0) {
        npx++;
      } else {
        ret[q] = 0;
      }
    }
    for (j = 1; j < (nf - 1); j++) {
      q = i * nf + j;
      if (ret[q] > 0) {
        t = msk[q - nf] + msk[q + nf] + msk[q - 1] + msk[q + 1];
        if (t > 0) {
          npx++;
        } else {
          ret[q] = 0;
        }
      }
    }
    q = (i + 1) * nf - 1;
    if (ret[q] > 0) {
      t = msk[q - nf] + msk[q + nf] + msk[q - 1];
      if (t > 0) {
        npx++;
      } else {
        ret[q] = 0;
      }
    }
  }
  i = ns - 1;
  for (j = 0; j < nf; j++) {
    q = i * nf + j;
    if (ret[q] > 0) {
      t = msk[q - nf];
      if (j > 0)
        t += msk[q - 1];
      if (j < (nf - 1))
        t += msk[q + 1];
      if (t > 0) {
        npx++;
      } else {
        ret[q] = 0;
      }
    }
  }
  return npx;
}
```