user: 请从给定的汇编指令推导出C源代码:

```asm
<Mask_calcN1N3>:
  endbr64
  mov    %edi,%r9d
  mov    %rsi,%r10
  test   %edi,%edi
  jle    L239
  lea    -0x2(%rdi),%edi
  test   %edi,%edi
  jle    L188
  cmp    %edi,%r9d
  mov    %rsi,%rcx
  cmovle %r9d,%edi
  xor    %r8d,%r8d
  xor    %eax,%eax
  nopl   0x0(%rax)
L163:
  mov    (%rcx),%edx
  lea    -0x2(%rdx,%r8,1),%esi
  cmp    $0x4,%edx
  cmovg  %esi,%r8d
  cmp    $0x2,%eax
  jle    L55
  test   $0x1,%al
  je     L55
  imul   $0xaaaaaaab,%edx,%esi
  add    $0x2aaaaaaa,%esi
  cmp    $0x55555554,%esi
  ja     L55
  movslq %edx,%rsi
  sar    $0x1f,%edx
  imul   $0x55555556,%rsi,%rsi
  shr    $0x20,%rsi
  sub    %edx,%esi
  cmp    %esi,-0x8(%rcx)
  je     L20
  nopw   0x0(%rax,%rax,1)
L55:
  add    $0x1,%eax
  add    $0x4,%rcx
  cmp    %edi,%eax
  jl     L163
  cmp    %eax,%r9d
  jle    L60
L90:
  mov    %r9d,%edx
  mov    $0x1,%edi
  sub    %eax,%edx
  cmp    %eax,%r9d
  cmovg  %edx,%edi
  sub    $0x1,%edx
  cmp    $0x2,%edx
  jbe    L45
  cmp    %eax,%r9d
  jle    L45
  movslq %eax,%rdx
  movdqa D10(%rip),%xmm4
  movdqa D3(%rip),%xmm3
  pxor   %xmm1,%xmm1
  lea    (%r10,%rdx,4),%rcx
  mov    %edi,%edx
  shr    $0x2,%edx
  lea    -0x1(%rdx),%esi
  lea    0x10(%rcx),%rdx
  shl    $0x4,%rsi
  add    %rdx,%rsi
  jmp    L100
  nopl   0x0(%rax)
L144:
  add    $0x10,%rdx
L100:
  movdqu (%rcx),%xmm0
  mov    %rdx,%rcx
  movdqa %xmm0,%xmm2
  pcmpgtd %xmm4,%xmm0
  paddd  %xmm3,%xmm2
  pand   %xmm2,%xmm0
  paddd  %xmm0,%xmm1
  cmp    %rsi,%rdx
  jne    L144
  movdqa %xmm1,%xmm0
  psrldq $0x8,%xmm0
  paddd  %xmm0,%xmm1
  movdqa %xmm1,%xmm0
  psrldq $0x4,%xmm0
  paddd  %xmm0,%xmm1
  movd   %xmm1,%edx
  add    %edx,%r8d
  mov    %edi,%edx
  and    $0xfffffffc,%edx
  add    %edx,%eax
  cmp    %edx,%edi
  je     L60
L45:
  movslq %eax,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    (%r10,%rdx,4),%edx
  lea    -0x2(%rdx,%r8,1),%esi
  cmp    $0x4,%edx
  lea    0x1(%rax),%edx
  cmovg  %esi,%r8d
  cmp    %edx,%r9d
  jle    L60
  mov    0x4(%r10,%rcx,1),%edx
  cmp    $0x4,%edx
  lea    -0x2(%rdx,%r8,1),%esi
  cmovg  %esi,%r8d
  add    $0x2,%eax
  cmp    %eax,%r9d
  jle    L60
  mov    0x8(%r10,%rcx,1),%eax
  lea    -0x2(%rax,%r8,1),%edx
  cmp    $0x4,%eax
  cmovg  %edx,%r8d
L60:
  mov    %r8d,%eax
  ret
  nopl   0x0(%rax)
L188:
  xor    %r8d,%r8d
  xor    %eax,%eax
  jmp    L90
  nopw   0x0(%rax,%rax,1)
L20:
  cmp    %esi,-0x4(%rcx)
  jne    L55
  cmp    %esi,0x4(%rcx)
  jne    L55
  cmp    %esi,0x8(%rcx)
  jne    L55
  mov    -0xc(%rcx),%edx
  test   %edx,%edx
  js     L27
  shl    $0x2,%esi
  cmp    %esi,%edx
  jge    L27
  lea    0x3(%rax),%edx
  cmp    %edx,%r9d
  jle    L27
  cmp    0xc(%rcx),%esi
  jg     L55
L27:
  add    $0x28,%r8d
  jmp    L55
  nopl   0x0(%rax,%rax,1)
L239:
  xor    %r8d,%r8d
  mov    %r8d,%eax
  ret
```

tool_calls: name: unpack_data
arguments: label: D10
type_guessed: byte[16]
name: unpack_data
arguments: label: D3
type_guessed: byte[16]

tool: {"D10": [0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00]}

tool: {"D3": [0xfe,0xff,0xff,0xff,0xfe,0xff,0xff,0xff,0xfe,0xff,0xff,0xff,0xfe,0xff,0xff,0xff]}

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