user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<SDL_imageFilterAddByteToHalf>:
  endbr64
  test   %rdi,%rdi
  je     L241
  push   %r14
  push   %r13
  mov    %rsi,%r13
  push   %r12
  push   %rbp
  push   %rbx
  test   %rsi,%rsi
  je     L221
  mov    %edx,%ebp
  test   %edx,%edx
  jne    L214
L217:
  xor    %eax,%eax
L220:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopw   0x0(%rax,%rax,1)
L214:
  xor    %eax,%eax
  mov    %ecx,%r14d
  mov    %rdi,%rbx
  call   <SDL_imageFilterMMXdetect@plt>
  movzbl %r14b,%r12d
  test   %rax,%rax
  je     L151
  cmp    $0x7,%ebp
  ja     L0
L151:
  xor    %edi,%edi
L146:
  mov    %ebp,%eax
  lea    0x1(%rdi),%esi
  movzbl %r14b,%r14d
  sub    %edi,%eax
  lea    -0x1(%rax),%edx
  cmp    $0xe,%edx
  seta   %cl
  cmp    %ebp,%esi
  setbe  %dl
  test   %dl,%cl
  je     L218
  lea    0x1(%rbx),%rcx
  mov    %r13,%rdx
  sub    %rcx,%rdx
  cmp    $0xe,%rdx
  jbe    L218
  cmp    %ebp,%esi
  movd   %r14d,%xmm3
  pxor   %xmm5,%xmm5
  mov    $0x1,%edi
  cmovbe %eax,%edi
  punpcklwd %xmm3,%xmm3
  xor    %eax,%eax
  xor    %edx,%edx
  movdqa D23(%rip),%xmm6
  movdqa D9(%rip),%xmm2
  pshufd $0x0,%xmm3,%xmm3
  pxor   %xmm4,%xmm4
  lea    -0x10(%rdi),%ecx
  shr    $0x4,%ecx
  add    $0x1,%ecx
  nopl   0x0(%rax,%rax,1)
L120:
  movdqu (%rbx,%rax,1),%xmm0
  add    $0x1,%edx
  psrlw  $0x1,%xmm0
  pand   %xmm6,%xmm0
  movdqa %xmm0,%xmm7
  punpckhbw %xmm5,%xmm0
  punpcklbw %xmm5,%xmm7
  paddw  %xmm3,%xmm0
  paddw  %xmm3,%xmm7
  movdqa %xmm7,%xmm1
  psubusw %xmm2,%xmm1
  pcmpeqw %xmm4,%xmm1
  pand   %xmm1,%xmm7
  pandn  %xmm2,%xmm1
  por    %xmm7,%xmm1
  movdqa %xmm0,%xmm7
  psubusw %xmm2,%xmm7
  pand   %xmm2,%xmm1
  pcmpeqw %xmm4,%xmm7
  pand   %xmm7,%xmm0
  pandn  %xmm2,%xmm7
  por    %xmm0,%xmm7
  pand   %xmm2,%xmm7
  packuswb %xmm7,%xmm1
  movups %xmm1,0x0(%r13,%rax,1)
  add    $0x10,%rax
  cmp    %ecx,%edx
  jb     L120
  shl    $0x4,%ecx
  mov    %ecx,%eax
  add    %rax,%rbx
  add    %r13,%rax
  cmp    %ecx,%edi
  je     L217
  movzbl (%rbx),%edx
  mov    $0xff,%edi
  shr    %dl
  movzbl %dl,%edx
  add    %r12d,%edx
  cmp    %edi,%edx
  cmovg  %edi,%edx
  add    %esi,%ecx
  mov    %dl,(%rax)
  cmp    %ecx,%ebp
  jbe    L217
  movzbl 0x1(%rbx),%edx
  mov    $0xff,%esi
  shr    %dl
  movzbl %dl,%edx
  add    %r12d,%edx
  cmp    %esi,%edx
  cmovg  %esi,%edx
  mov    %dl,0x1(%rax)
  lea    0x1(%rcx),%edx
  cmp    %edx,%ebp
  jbe    L217
  movzbl 0x2(%rbx),%edx
  shr    %dl
  movzbl %dl,%edx
  add    %r12d,%edx
  cmp    %esi,%edx
  cmovg  %esi,%edx
  mov    %dl,0x2(%rax)
  lea    0x2(%rcx),%edx
  cmp    %edx,%ebp
  jbe    L217
  movzbl 0x3(%rbx),%edx
  shr    %dl
  movzbl %dl,%edx
  add    %r12d,%edx
  cmp    %esi,%edx
  cmovg  %esi,%edx
  mov    %dl,0x3(%rax)
  lea    0x3(%rcx),%edx
  cmp    %edx,%ebp
  jbe    L217
  movzbl 0x4(%rbx),%edx
  shr    %dl
  movzbl %dl,%edx
  add    %r12d,%edx
  cmp    %esi,%edx
  cmovg  %esi,%edx
  mov    %dl,0x4(%rax)
  lea    0x4(%rcx),%edx
  cmp    %edx,%ebp
  jbe    L217
  movzbl 0x5(%rbx),%edx
  shr    %dl
  movzbl %dl,%edx
  add    %r12d,%edx
  cmp    %esi,%edx
  cmovg  %esi,%edx
  mov    %dl,0x5(%rax)
  lea    0x5(%rcx),%edx
  cmp    %edx,%ebp
  jbe    L217
  movzbl 0x6(%rbx),%edx
  shr    %dl
  movzbl %dl,%edx
  add    %r12d,%edx
  cmp    %esi,%edx
  cmovg  %esi,%edx
  mov    %dl,0x6(%rax)
  lea    0x6(%rcx),%edx
  cmp    %edx,%ebp
  jbe    L217
  movzbl 0x7(%rbx),%edx
  shr    %dl
  movzbl %dl,%edx
  add    %r12d,%edx
  cmp    %esi,%edx
  cmovg  %esi,%edx
  mov    %dl,0x7(%rax)
  lea    0x7(%rcx),%edx
  cmp    %edx,%ebp
  jbe    L217
  movzbl 0x8(%rbx),%edx
  shr    %dl
  movzbl %dl,%edx
  add    %r12d,%edx
  cmp    %esi,%edx
  cmovg  %esi,%edx
  mov    %dl,0x8(%rax)
  lea    0x8(%rcx),%edx
  cmp    %edx,%ebp
  jbe    L217
  movzbl 0x9(%rbx),%edx
  shr    %dl
  movzbl %dl,%edx
  add    %r12d,%edx
  cmp    %esi,%edx
  cmovg  %esi,%edx
  mov    %dl,0x9(%rax)
  lea    0x9(%rcx),%edx
  cmp    %edx,%ebp
  jbe    L217
  movzbl 0xa(%rbx),%edx
  shr    %dl
  movzbl %dl,%edx
  add    %r12d,%edx
  cmp    %esi,%edx
  cmovg  %esi,%edx
  mov    %dl,0xa(%rax)
  lea    0xa(%rcx),%edx
  cmp    %edx,%ebp
  jbe    L217
  movzbl 0xb(%rbx),%edx
  shr    %dl
  movzbl %dl,%edx
  add    %r12d,%edx
  cmp    %esi,%edx
  cmovg  %esi,%edx
  mov    %dl,0xb(%rax)
  lea    0xb(%rcx),%edx
  cmp    %edx,%ebp
  jbe    L217
  movzbl 0xc(%rbx),%edx
  shr    %dl
  movzbl %dl,%edx
  add    %r12d,%edx
  cmp    %esi,%edx
  cmovg  %esi,%edx
  mov    %dl,0xc(%rax)
  lea    0xc(%rcx),%edx
  cmp    %edx,%ebp
  jbe    L217
  movzbl 0xd(%rbx),%edx
  shr    %dl
  movzbl %dl,%edx
  add    %r12d,%edx
  cmp    %esi,%edx
  cmovg  %esi,%edx
  add    $0xd,%ecx
  mov    %dl,0xd(%rax)
  cmp    %ecx,%ebp
  jbe    L217
  movzbl 0xe(%rbx),%edx
  mov    $0xff,%ecx
  shr    %dl
  movzbl %dl,%edx
  add    %r12d,%edx
  cmp    %ecx,%edx
  cmovg  %ecx,%edx
  mov    %dl,0xe(%rax)
  jmp    L217
  nopl   0x0(%rax)
L0:
  lea    D10(%rip),%r8
  mov    %r12d,%ecx
  mov    %ebp,%edx
  mov    %r13,%rsi
  mov    %rbx,%rdi
  call   <SDL_imageFilterAddByteToHalfMMX@plt>
  test   $0x7,%bpl
  je     L217
  mov    %ebp,%edi
  and    $0xfffffff8,%edi
  mov    %edi,%eax
  add    %rax,%rbx
  add    %rax,%r13
  cmp    %edi,%ebp
  jbe    L217
  jmp    L146
  nopl   0x0(%rax,%rax,1)
L218:
  xor    %edx,%edx
  nopw   0x0(%rax,%rax,1)
L65:
  movzbl (%rbx,%rdx,1),%eax
  mov    $0xff,%ecx
  shr    %al
  movzbl %al,%eax
  add    %r12d,%eax
  cmp    %ecx,%eax
  cmovg  %ecx,%eax
  mov    %al,0x0(%r13,%rdx,1)
  add    $0x1,%rdx
  lea    (%rdi,%rdx,1),%eax
  cmp    %eax,%ebp
  ja     L65
  jmp    L217
L221:
  mov    $0xffffffff,%eax
  jmp    L220
L241:
  or     $0xffffffff,%eax
  ret
```

tool_calls: name: extract_symbolic_data
arguments: label: D23
datatype: byte[16]
name: extract_symbolic_data
arguments: label: D9
datatype: byte[16]

tool: {"D23": [0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f]}

tool: {"D9": [0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00]}

assistant: ```c
int SDL_imageFilterAddByteToHalf(unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char C) {
  static unsigned char Mask[8] = {0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F};
  unsigned int i, istart;
  int iC;
  unsigned char *cursrc1;
  unsigned char *curdest;
  int result;
  if ((Src1 == NULL) || (Dest == NULL))
    return (-1);
  if (length == 0)
    return (0);
  if ((SDL_imageFilterMMXdetect()) && (length > 7)) {
    SDL_imageFilterAddByteToHalfMMX(Src1, Dest, length, C, Mask);
    if ((length & 7) > 0) {
      istart = length & 0xfffffff8;
      cursrc1 = &Src1[istart];
      curdest = &Dest[istart];
    } else {
      return (0);
    }
  } else {
    istart = 0;
    cursrc1 = Src1;
    curdest = Dest;
  }
  iC = (int)C;
  for (i = istart; i < length; i++) {
    result = (int)(*cursrc1 / 2) + iC;
    if (result > 255)
      result = 255;
    *curdest = (unsigned char)result;
    cursrc1++;
    curdest++;
  }
  return (0);
}
```