user: Translate the below assembly code into C programming language:

```asm
<SDL_imageFilterAddUint>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  test   %rdi,%rdi
  je     L80
  mov    %rsi,%r12
  test   %rsi,%rsi
  je     L80
  mov    %edx,%r13d
  test   %edx,%edx
  je     L45
  mov    %rdi,%rbp
  mov    %ecx,%ebx
  test   %ecx,%ecx
  je     L106
  xor    %eax,%eax
  mov    %ebx,%r15d
  mov    %ebx,%r14d
  call   <SDL_imageFilterMMXdetect@plt>
  shr    $0x18,%r15d
  shr    $0x8,%r14d
  cmp    $0x7,%r13d
  jbe    L130
  test   %rax,%rax
  jne    L48
L130:
  mov    %ebx,%eax
  and    $0xff,%r14d
  mov    %r15d,0xc(%rsp)
  xor    %edi,%edi
  shr    $0x10,%eax
  and    $0xff,%ebx
  mov    %r14d,0x4(%rsp)
  and    $0xff,%eax
  mov    %ebx,(%rsp)
  mov    %eax,0x8(%rsp)
L31:
  mov    %rsp,%r9
  lea    0x10(%rsp),%r8
  nopl   (%rax)
L39:
  mov    %r9,%rax
  mov    %edi,%ecx
L44:
  cmp    %r13d,%ecx
  jae    L122
  movzbl 0x0(%rbp),%edx
  mov    $0xff,%esi
  add    (%rax),%edx
  cmp    %esi,%edx
  cmovg  %esi,%edx
  add    $0x1,%rbp
  add    $0x1,%r12
  mov    %dl,-0x1(%r12)
L122:
  add    $0x4,%rax
  add    $0x1,%ecx
  cmp    %rax,%r8
  jne    L44
  add    $0x4,%edi
  cmp    %edi,%r13d
  ja     L39
L45:
  xor    %eax,%eax
L37:
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L109
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L106:
  call   <memcpy@plt>
  jmp    L45
L48:
  mov    %ebx,%r8d
  mov    %ebx,%ecx
  mov    %r13d,%edx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  bswap  %r8d
  call   <SDL_imageFilterAddUintMMX@plt>
  test   $0x7,%r13b
  je     L45
  mov    %ebx,%eax
  mov    %r13d,%edi
  and    $0xff,%ebx
  and    $0xff,%r14d
  shr    $0x10,%eax
  and    $0xfffffff8,%edi
  mov    %r15d,0xc(%rsp)
  and    $0xff,%eax
  mov    %r14d,0x4(%rsp)
  mov    %eax,0x8(%rsp)
  mov    %ebx,(%rsp)
  cmp    %edi,%r13d
  jbe    L45
  mov    %edi,%eax
  add    %rax,%rbp
  add    %rax,%r12
  jmp    L31
L80:
  mov    $0xffffffff,%eax
  jmp    L37
L109:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int SDL_imageFilterAddUint(unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned int C) {
  unsigned int i, j, istart, D;
  int iC[4];
  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)) {
    D = (((C) >> 24) | (((C)&0x00ff0000) >> 8) | (((C)&0x0000ff00) << 8) | ((C) << 24));
    SDL_imageFilterAddUintMMX(Src1, Dest, length, C, D);
    if ((length & 7) > 0) {
      istart = length & 0xfffffff8;
      cursrc1 = &Src1[istart];
      curdest = &Dest[istart];
    } else {
      return (0);
    }
  } else {
    istart = 0;
    cursrc1 = Src1;
    curdest = Dest;
  }
  iC[3] = (int)((C >> 24) & 0xff);
  iC[2] = (int)((C >> 16) & 0xff);
  iC[1] = (int)((C >> 8) & 0xff);
  iC[0] = (int)((C >> 0) & 0xff);
  for (i = istart; i < length; i += 4) {
    for (j = 0; j < 4; j++) {
      if ((i + j) < length) {
        result = (int)*cursrc1 + iC[j];
        if (result > 255)
          result = 255;
        *curdest = (unsigned char)result;
        cursrc1++;
        curdest++;
      }
    }
  }
  return (0);
}
```