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

```asm
<clean_mask>:
  endbr64
  push   %r15
  mov    %ecx,%r11d
  mov    %rdi,%r8
  xor    %eax,%eax
  push   %r14
  push   %r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  push   %rbx
  mov    %edx,%ebx
  imul   %ecx,%ebx
  mov    %ebx,-0xc(%rsp)
  movslq %ebx,%rcx
  test   %ebx,%ebx
  jle    L138
  nopl   0x0(%rax)
L313:
  cmpq   $0x0,(%r8,%rax,8)
  jle    L84
  movq   $0x1,(%r12,%rax,8)
  add    $0x1,%rax
  cmp    %rcx,%rax
  jne    L313
L138:
  lea    -0x1(%rdx),%eax
  mov    %eax,-0x14(%rsp)
  test   %r11d,%r11d
  jle    L161
L464:
  mov    %r11d,%eax
  sub    $0x1,%eax
  mov    %eax,-0x10(%rsp)
  je     L282
  cmp    %eax,%r11d
  mov    %eax,%ecx
  cmovle %r11d,%ecx
  xor    %eax,%eax
  xor    %r10d,%r10d
  jmp    L395
  nopl   0x0(%rax)
L150:
  add    $0x1,%r10d
L400:
  lea    0x1(%rax),%edx
  add    $0x1,%rax
  cmp    %eax,%ecx
  jle    L304
L395:
  cmpq   $0x0,(%r12,%rax,8)
  jle    L400
  lea    (%r11,%rax,1),%edx
  movslq %edx,%rdx
  mov    (%r8,%rdx,8),%rdx
  test   %rax,%rax
  je     L336
  add    -0x8(%r8,%rax,8),%rdx
L336:
  add    0x8(%r8,%rax,8),%rdx
  test   %rdx,%rdx
  jg     L150
  movq   $0x0,(%r12,%rax,8)
  lea    0x1(%rax),%edx
  add    $0x1,%rax
  cmp    %eax,%ecx
  jg     L395
L304:
  cmp    %edx,%r11d
  jle    L63
L213:
  movslq %edx,%rax
  jmp    L298
  nopw   0x0(%rax,%rax,1)
L168:
  add    $0x1,%r10d
L497:
  add    $0x1,%rax
  cmp    %eax,%r11d
  jle    L63
L298:
  cmpq   $0x0,(%r12,%rax,8)
  jle    L497
  lea    (%r11,%rax,1),%edx
  movslq %edx,%rdx
  mov    (%r8,%rdx,8),%rdx
  test   %eax,%eax
  je     L465
  add    -0x8(%r8,%rax,8),%rdx
L465:
  test   %rdx,%rdx
  jg     L168
  movq   $0x0,(%r12,%rax,8)
  add    $0x1,%rax
  cmp    %eax,%r11d
  jg     L298
L63:
  cmpl   $0x1,-0x14(%rsp)
  jle    L199
L312:
  movslq %r11d,%rax
  mov    -0x10(%rsp),%r9d
  mov    %r12,-0x8(%rsp)
  xor    %r13d,%r13d
  mov    %rax,-0x20(%rsp)
  shl    $0x3,%rax
  lea    (%r11,%r11,1),%ebx
  mov    $0x1,%r15d
  lea    0x8(%r12,%rax,1),%rbp
  lea    (%r8,%rax,1),%r14
  mov    %rax,%r12
L208:
  cmpq   $0x0,-0x8(%rbp)
  jle    L358
  lea    0x0(%r13,%rbx,1),%edx
  movslq %r13d,%rax
  movslq %edx,%rdx
  mov    (%r8,%rax,8),%rax
  add    (%r8,%rdx,8),%rax
  add    0x8(%r14),%rax
  test   %rax,%rax
  jle    L355
  add    $0x1,%r10d
L358:
  lea    0x1(%r13),%edx
  mov    %r14,%rsi
  mov    %rbp,%rcx
  cmp    $0x2,%r11d
  jg     L387
  jmp    L205
  nopl   (%rax)
L365:
  add    $0x1,%r10d
L113:
  add    $0x1,%edx
  add    $0x8,%rcx
  add    $0x8,%rsi
  cmp    %r9d,%edx
  je     L205
L387:
  cmpq   $0x0,(%rcx)
  jle    L113
  lea    (%rdx,%rbx,1),%edi
  movslq %edx,%rax
  movslq %edi,%rdi
  mov    (%r8,%rax,8),%rax
  add    (%r8,%rdi,8),%rax
  add    (%rsi),%rax
  add    0x10(%rsi),%rax
  test   %rax,%rax
  jg     L365
  add    $0x1,%edx
  movq   $0x0,(%rcx)
  add    $0x8,%rsi
  add    $0x8,%rcx
  cmp    %r9d,%edx
  jne    L387
L205:
  mov    -0x20(%rsp),%rdi
  add    $0x1,%r15d
  cmpq   $0x0,-0x10(%rbp,%rdi,8)
  jle    L58
  lea    (%r9,%rbx,1),%edx
  movslq %r9d,%rax
  movslq %edx,%rdx
  mov    (%r8,%rax,8),%rax
  add    (%r8,%rdx,8),%rax
  add    -0x10(%r14,%rdi,8),%rax
  test   %rax,%rax
  jle    L177
  add    $0x1,%r10d
L58:
  add    %r11d,%r13d
  add    %r12,%r14
  add    %r11d,%r9d
  add    %r12,%rbp
  cmp    -0x14(%rsp),%r15d
  jl     L208
  mov    -0x8(%rsp),%r12
  test   %r11d,%r11d
  jle    L281
L199:
  mov    -0xc(%rsp),%edi
  mov    -0x10(%rsp),%eax
  sub    %r11d,%edi
  test   %eax,%eax
  je     L406
  cmp    %eax,%r11d
  movslq %edi,%r9
  mov    %edi,%ebp
  cmovle %r11d,%eax
  lea    0x0(,%r9,8),%rdx
  sub    %r11d,%ebp
  lea    (%r12,%rdx,1),%rcx
  add    %r8,%rdx
  mov    %eax,%ebx
  xor    %eax,%eax
  jmp    L250
  nop
L178:
  add    $0x1,%r10d
L303:
  add    $0x1,%eax
  add    $0x8,%rcx
  add    $0x8,%rdx
  cmp    %ebx,%eax
  jge    L167
L250:
  cmpq   $0x0,(%rcx)
  jle    L303
  lea    0x0(%rbp,%rax,1),%esi
  movslq %esi,%rsi
  mov    (%r8,%rsi,8),%rsi
  test   %eax,%eax
  je     L215
  add    -0x8(%rdx),%rsi
L215:
  add    0x8(%rdx),%rsi
  test   %rsi,%rsi
  jg     L178
  add    $0x1,%eax
  movq   $0x0,(%rcx)
  add    $0x8,%rdx
  add    $0x8,%rcx
  cmp    %ebx,%eax
  jl     L250
L167:
  cmp    %eax,%r11d
  jg     L61
L281:
  pop    %rbx
  mov    %r10d,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  xchg   %ax,%ax
L84:
  movq   $0x0,(%r12,%rax,8)
  add    $0x1,%rax
  cmp    %rcx,%rax
  jne    L313
  lea    -0x1(%rdx),%eax
  mov    %eax,-0x14(%rsp)
  test   %r11d,%r11d
  jg     L464
L161:
  xor    %r10d,%r10d
  lea    -0x1(%r11),%eax
  cmpl   $0x1,-0x14(%rsp)
  mov    %eax,-0x10(%rsp)
  jg     L312
  jmp    L281
  nopl   (%rax)
L355:
  movq   $0x0,-0x8(%rbp)
  jmp    L358
  nopl   (%rax)
L177:
  movq   $0x0,-0x10(%rbp,%rdi,8)
  jmp    L58
  xchg   %ax,%ax
L406:
  xor    %eax,%eax
  movslq %edi,%r9
L61:
  lea    0x0(,%r9,8),%rcx
  cltq
  sub    %r11d,%edi
  add    %rcx,%r12
  add    %r8,%rcx
  jmp    L22
  nopw   0x0(%rax,%rax,1)
L347:
  add    $0x1,%r10d
L244:
  add    $0x1,%rax
  cmp    %eax,%r11d
  jle    L281
L22:
  cmpq   $0x0,(%r12,%rax,8)
  jle    L244
  lea    (%rdi,%rax,1),%edx
  movslq %edx,%rdx
  mov    (%r8,%rdx,8),%rdx
  test   %eax,%eax
  je     L430
  add    -0x8(%rcx,%rax,8),%rdx
L430:
  test   %rdx,%rdx
  jg     L347
  movq   $0x0,(%r12,%rax,8)
  jmp    L244
  nopw   0x0(%rax,%rax,1)
L282:
  xor    %r10d,%r10d
  xor    %edx,%edx
  jmp    L213
```

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;
}
```