user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<Mask_calcN1N3>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x14(%rbp)
  mov    %rsi,-0x20(%rbp)
  movl   $0x0,-0x8(%rbp)
  movl   $0x0,-0xc(%rbp)
  jmp    L12
L96:
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    $0x4,%eax
  jle    L156
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  sub    $0x2,%eax
  add    %eax,-0x8(%rbp)
L156:
  mov    -0xc(%rbp),%eax
  and    $0x1,%eax
  test   %eax,%eax
  je     L74
  cmpl   $0x2,-0xc(%rbp)
  jle    L74
  mov    -0x14(%rbp),%eax
  sub    $0x2,%eax
  cmp    %eax,-0xc(%rbp)
  jge    L74
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  movslq %edx,%rax
  imul   $0x55555556,%rax,%rax
  shr    $0x20,%rax
  mov    %edx,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%eax
  mov    %eax,%ecx
  add    %ecx,%ecx
  add    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  test   %eax,%eax
  jne    L74
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  movslq %eax,%rdx
  imul   $0x55555556,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x1f,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0xc(%rbp),%eax
  cltq
  shl    $0x2,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0x4(%rbp)
  jne    L74
  mov    -0xc(%rbp),%eax
  cltq
  shl    $0x2,%rax
  lea    -0x4(%rax),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0x4(%rbp)
  jne    L74
  mov    -0xc(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0x4(%rbp)
  jne    L74
  mov    -0xc(%rbp),%eax
  cltq
  add    $0x2,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0x4(%rbp)
  jne    L74
  mov    -0xc(%rbp),%eax
  cltq
  shl    $0x2,%rax
  lea    -0xc(%rax),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  js     L69
  mov    -0xc(%rbp),%eax
  cltq
  shl    $0x2,%rax
  lea    -0xc(%rax),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    -0x4(%rbp),%edx
  shl    $0x2,%edx
  cmp    %edx,%eax
  jl     L39
L69:
  addl   $0x28,-0x8(%rbp)
  jmp    L74
L39:
  mov    -0xc(%rbp),%eax
  add    $0x3,%eax
  cmp    %eax,-0x14(%rbp)
  jle    L90
  mov    -0xc(%rbp),%eax
  cltq
  add    $0x3,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    -0x4(%rbp),%edx
  shl    $0x2,%edx
  cmp    %edx,%eax
  jl     L74
L90:
  addl   $0x28,-0x8(%rbp)
L74:
  addl   $0x1,-0xc(%rbp)
L12:
  mov    -0xc(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jl     L96
  mov    -0x8(%rbp),%eax
  pop    %rbp
  ret
```

assistant: ```c
int Mask_calcN1N3(int length, int *runLength) {
  int i;
  int demerit = 0;
  int fact;
  for (i = 0; i < length; i++) {
    if (runLength[i] >= 5) {
      demerit += (3) + (runLength[i] - 5);
    }
    if ((i & 1)) {
      if (i >= 3 && i < length - 2 && (runLength[i] % 3) == 0) {
        fact = runLength[i] / 3;
        if (runLength[i - 2] == fact && runLength[i - 1] == fact && runLength[i + 1] == fact && runLength[i + 2] == fact) {
          if (runLength[i - 3] < 0 || runLength[i - 3] >= 4 * fact) {
            demerit += (40);
          } else if (i + 3 >= length || runLength[i + 3] >= 4 * fact) {
            demerit += (40);
          }
        }
      }
    }
  }
  return demerit;
}
```