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

```asm
<parity>:
  endbr64
  test   %esi,%esi
  jle    L171
  mov    %rdi,%r9
  mov    %esi,%r8d
  cmp    $0xf,%esi
  jle    L47
  mov    %esi,%ecx
  movdqa D7(%rip),%xmm2
  mov    %rdi,%rax
  pxor   %xmm0,%xmm0
  shr    $0x4,%ecx
  sub    $0x1,%ecx
  shl    $0x4,%rcx
  lea    0x10(%rdi,%rcx,1),%rcx
  nopl   0x0(%rax,%rax,1)
L69:
  movdqu (%rax),%xmm1
  add    $0x10,%rax
  pand   %xmm2,%xmm1
  pxor   %xmm1,%xmm0
  cmp    %rax,%rcx
  jne    L69
  movdqa %xmm0,%xmm1
  mov    %esi,%eax
  psrldq $0x8,%xmm1
  and    $0xfffffff0,%eax
  pxor   %xmm1,%xmm0
  mov    %eax,%edi
  sub    %eax,%esi
  movdqa %xmm0,%xmm1
  add    %r9,%rdi
  psrldq $0x4,%xmm1
  pxor   %xmm1,%xmm0
  movdqa %xmm0,%xmm1
  psrldq $0x2,%xmm1
  pxor   %xmm1,%xmm0
  movdqa %xmm0,%xmm1
  psrldq $0x1,%xmm1
  pxor   %xmm1,%xmm0
  movd   %xmm0,%ecx
  xor    %edx,%ecx
  cmp    %eax,%r8d
  je     L91
L103:
  sub    %eax,%r8d
  lea    -0x1(%r8),%edx
  cmp    $0x6,%edx
  jbe    L136
  movq   D7(%rip),%xmm0
  push   %rbx
  movq   (%r9,%rax,1),%xmm1
  pand   %xmm0,%xmm1
  movq   %xmm1,%rdx
  mov    %edx,%eax
  movzbl %dh,%ebx
  shr    $0x38,%rdx
  xor    %ebx,%eax
  xor    %ecx,%eax
  movq   %xmm1,%rcx
  shr    $0x10,%rcx
  xor    %ecx,%eax
  movq   %xmm1,%rcx
  shr    $0x18,%rcx
  xor    %ecx,%eax
  movq   %xmm1,%rcx
  shr    $0x20,%rcx
  xor    %ecx,%eax
  movq   %xmm1,%rcx
  shr    $0x28,%rcx
  xor    %ecx,%eax
  movq   %xmm1,%rcx
  shr    $0x30,%rcx
  xor    %ecx,%eax
  xor    %edx,%eax
  mov    %r8d,%edx
  and    $0xfffffff8,%edx
  mov    %edx,%ecx
  sub    %edx,%esi
  add    %rcx,%rdi
  cmp    %edx,%r8d
  je     L105
  movzbl (%rdi),%edx
  and    $0x1,%edx
  xor    %edx,%eax
  cmp    $0x1,%esi
  je     L105
  movzbl 0x1(%rdi),%edx
  and    $0x1,%edx
  xor    %edx,%eax
  cmp    $0x2,%esi
  je     L105
  movzbl 0x2(%rdi),%edx
  and    $0x1,%edx
  xor    %edx,%eax
  cmp    $0x3,%esi
  je     L105
  movzbl 0x3(%rdi),%edx
  and    $0x1,%edx
  xor    %edx,%eax
  cmp    $0x4,%esi
  je     L105
  movzbl 0x4(%rdi),%edx
  and    $0x1,%edx
  xor    %edx,%eax
  cmp    $0x5,%esi
  je     L105
  movzbl 0x5(%rdi),%edx
  and    $0x1,%edx
  xor    %edx,%eax
  cmp    $0x6,%esi
  je     L105
  movzbl 0x6(%rdi),%edx
  and    $0x1,%edx
  xor    %edx,%eax
L105:
  pop    %rbx
  ret
  nopw   0x0(%rax,%rax,1)
L171:
  mov    %edx,%eax
  ret
L47:
  mov    %edx,%ecx
  xor    %eax,%eax
  jmp    L103
L136:
  movzbl (%rdi),%edx
  mov    %ecx,%eax
  and    $0x1,%edx
  xor    %edx,%eax
  cmp    $0x1,%esi
  je     L83
  movzbl 0x1(%rdi),%edx
  and    $0x1,%edx
  xor    %edx,%eax
  cmp    $0x2,%esi
  je     L83
  movzbl 0x2(%rdi),%edx
  and    $0x1,%edx
  xor    %edx,%eax
  cmp    $0x3,%esi
  je     L83
  movzbl 0x3(%rdi),%edx
  and    $0x1,%edx
  xor    %edx,%eax
  cmp    $0x4,%esi
  je     L83
  movzbl 0x4(%rdi),%edx
  and    $0x1,%edx
  xor    %edx,%eax
  cmp    $0x5,%esi
  je     L83
  movzbl 0x5(%rdi),%edx
  and    $0x1,%edx
  xor    %edx,%eax
  cmp    $0x6,%esi
  je     L83
  movzbl 0x6(%rdi),%edx
  and    $0x1,%edx
  xor    %edx,%eax
L83:
  ret
L91:
  mov    %ecx,%eax
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D7
data_type: byte[16]

tool: {"D7": [0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01]}

assistant: ```c
char parity(char *buffer, int length, char start) {
  char result = start;
  for (; length > 0; length--) {
    result ^= (*buffer++ & 1);
  }
  return result;
}
```