user: 请将以下的汇编代码转换成C语言代码：

```asm
<SDL_imageFilterSubByte>:
  endbr64
  test   %rdi,%rdi
  je     L3
  push   %r14
  push   %r13
  mov    %rsi,%r13
  push   %r12
  push   %rbp
  push   %rbx
  test   %rsi,%rsi
  je     L216
  mov    %edx,%r12d
  test   %edx,%edx
  je     L48
  mov    %rdi,%rbp
  mov    %ecx,%r14d
  test   %cl,%cl
  je     L65
  xor    %eax,%eax
  movzbl %r14b,%ebx
  call   <SDL_imageFilterMMXdetect@plt>
  test   %rax,%rax
  je     L111
  cmp    $0x7,%r12d
  ja     L142
L111:
  xor    %ecx,%ecx
L124:
  mov    %r12d,%eax
  lea    0x1(%rcx),%esi
  movzbl %r14b,%r14d
  sub    %ecx,%eax
  lea    -0x1(%rax),%edx
  cmp    $0xe,%edx
  seta   %dil
  cmp    %esi,%r12d
  setae  %dl
  test   %dl,%dil
  je     L49
  lea    0x1(%rbp),%rdi
  mov    %r13,%rdx
  sub    %rdi,%rdx
  cmp    $0xe,%rdx
  jbe    L49
  cmp    %esi,%r12d
  movd   %r14d,%xmm2
  pxor   %xmm4,%xmm4
  mov    $0x1,%edi
  cmovae %eax,%edi
  punpcklwd %xmm2,%xmm2
  xor    %eax,%eax
  xor    %edx,%edx
  movdqa D0(%rip),%xmm5
  pshufd $0x0,%xmm2,%xmm2
  pxor   %xmm3,%xmm3
  lea    -0x10(%rdi),%ecx
  shr    $0x4,%ecx
  add    $0x1,%ecx
  nopl   (%rax)
L84:
  movdqu 0x0(%rbp,%rax,1),%xmm0
  add    $0x1,%edx
  movdqa %xmm0,%xmm1
  punpckhbw %xmm4,%xmm0
  punpcklbw %xmm4,%xmm1
  psubw  %xmm2,%xmm0
  psubw  %xmm2,%xmm1
  pmaxsw %xmm3,%xmm0
  pmaxsw %xmm3,%xmm1
  pand   %xmm5,%xmm0
  pand   %xmm5,%xmm1
  packuswb %xmm0,%xmm1
  movups %xmm1,0x0(%r13,%rax,1)
  add    $0x10,%rax
  cmp    %ecx,%edx
  jb     L84
  shl    $0x4,%ecx
  mov    %ecx,%eax
  add    %rax,%rbp
  add    %r13,%rax
  cmp    %ecx,%edi
  je     L48
  movzbl 0x0(%rbp),%edx
  mov    $0x0,%edi
  sub    %ebx,%edx
  cmovs  %edi,%edx
  add    %esi,%ecx
  mov    %dl,(%rax)
  cmp    %ecx,%r12d
  jbe    L48
  movzbl 0x1(%rbp),%edx
  mov    $0x0,%esi
  sub    %ebx,%edx
  cmovs  %esi,%edx
  mov    %dl,0x1(%rax)
  lea    0x1(%rcx),%edx
  cmp    %r12d,%edx
  jae    L48
  movzbl 0x2(%rbp),%edx
  sub    %ebx,%edx
  cmovs  %esi,%edx
  mov    %dl,0x2(%rax)
  lea    0x2(%rcx),%edx
  cmp    %edx,%r12d
  jbe    L48
  movzbl 0x3(%rbp),%edx
  sub    %ebx,%edx
  cmovs  %esi,%edx
  mov    %dl,0x3(%rax)
  lea    0x3(%rcx),%edx
  cmp    %edx,%r12d
  jbe    L48
  movzbl 0x4(%rbp),%edx
  sub    %ebx,%edx
  cmovs  %esi,%edx
  mov    %dl,0x4(%rax)
  lea    0x4(%rcx),%edx
  cmp    %edx,%r12d
  jbe    L48
  movzbl 0x5(%rbp),%edx
  sub    %ebx,%edx
  cmovs  %esi,%edx
  mov    %dl,0x5(%rax)
  lea    0x5(%rcx),%edx
  cmp    %edx,%r12d
  jbe    L48
  movzbl 0x6(%rbp),%edx
  sub    %ebx,%edx
  cmovs  %esi,%edx
  mov    %dl,0x6(%rax)
  lea    0x6(%rcx),%edx
  cmp    %edx,%r12d
  jbe    L48
  movzbl 0x7(%rbp),%edx
  sub    %ebx,%edx
  cmovs  %esi,%edx
  mov    %dl,0x7(%rax)
  lea    0x7(%rcx),%edx
  cmp    %edx,%r12d
  jbe    L48
  movzbl 0x8(%rbp),%edx
  sub    %ebx,%edx
  cmovs  %esi,%edx
  mov    %dl,0x8(%rax)
  lea    0x8(%rcx),%edx
  cmp    %edx,%r12d
  jbe    L48
  movzbl 0x9(%rbp),%edx
  sub    %ebx,%edx
  cmovs  %esi,%edx
  mov    %dl,0x9(%rax)
  lea    0x9(%rcx),%edx
  cmp    %edx,%r12d
  jbe    L48
  movzbl 0xa(%rbp),%edx
  sub    %ebx,%edx
  cmovs  %esi,%edx
  mov    %dl,0xa(%rax)
  lea    0xa(%rcx),%edx
  cmp    %edx,%r12d
  jbe    L48
  movzbl 0xb(%rbp),%edx
  sub    %ebx,%edx
  cmovs  %esi,%edx
  mov    %dl,0xb(%rax)
  lea    0xb(%rcx),%edx
  cmp    %edx,%r12d
  jbe    L48
  movzbl 0xc(%rbp),%edx
  sub    %ebx,%edx
  cmovs  %esi,%edx
  mov    %dl,0xc(%rax)
  lea    0xc(%rcx),%edx
  cmp    %edx,%r12d
  jbe    L48
  movzbl 0xd(%rbp),%edx
  sub    %ebx,%edx
  cmovs  %esi,%edx
  add    $0xd,%ecx
  mov    %dl,0xd(%rax)
  cmp    %ecx,%r12d
  jbe    L48
  movzbl 0xe(%rbp),%edx
  mov    $0x0,%ecx
  sub    %ebx,%edx
  cmovs  %ecx,%edx
  mov    %dl,0xe(%rax)
  nopl   0x0(%rax,%rax,1)
L48:
  xor    %eax,%eax
L259:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax,%rax,1)
L65:
  call   <memcpy@plt>
  jmp    L48
  nopw   0x0(%rax,%rax,1)
L142:
  mov    %ebx,%ecx
  mov    %r12d,%edx
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <SDL_imageFilterSubByteMMX@plt>
  test   $0x7,%r12b
  je     L48
  mov    %r12d,%ecx
  and    $0xfffffff8,%ecx
  mov    %ecx,%eax
  add    %rax,%rbp
  add    %rax,%r13
  cmp    %ecx,%r12d
  jbe    L48
  jmp    L124
  xchg   %ax,%ax
L49:
  xor    %edx,%edx
  nopw   0x0(%rax,%rax,1)
L47:
  movzbl 0x0(%rbp,%rdx,1),%eax
  mov    $0x0,%esi
  sub    %ebx,%eax
  cmovs  %esi,%eax
  mov    %al,0x0(%r13,%rdx,1)
  add    $0x1,%rdx
  lea    (%rcx,%rdx,1),%eax
  cmp    %eax,%r12d
  ja     L47
  jmp    L48
L216:
  mov    $0xffffffff,%eax
  jmp    L259
L3:
  or     $0xffffffff,%eax
  ret
```

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

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

assistant: ```c
int SDL_imageFilterSubByte(unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char C) {
  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 (C == 0) {
    memcpy(Src1, Dest, length);
    return (0);
  }
  if ((SDL_imageFilterMMXdetect()) && (length > 7)) {
    SDL_imageFilterSubByteMMX(Src1, Dest, length, C);
    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 - iC;
    if (result < 0)
      result = 0;
    *curdest = (unsigned char)result;
    cursrc1++;
    curdest++;
  }
  return (0);
}
```