user: Converte this assembly snippet into its equivalent C code:

```asm
<s_memcpy4a>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    $0x8,%r11d
  mov    %r11d,%r13d
  sub    %r8d,%r13d
  mov    %r11d,%r14d
  sub    %r9d,%r14d
  sub    0x38(%rsp),%r11d
  test   %ecx,%ecx
  je     L42
  mov    %rdi,%rbp
  mov    %rsi,%r12
  mov    %rdx,%rbx
  mov    %ecx,%r15d
  mov    $0x0,%edi
  mov    0x50(%rsp),%r9d
  jmp    L7
L11:
  mov    (%r12,%rdi,4),%edx
  mov    %edx,%esi
  movzbl 0x40(%rsp),%ecx
  shr    %cl,%esi
  mov    %r13d,%ecx
  shl    %cl,%esi
  mov    %edx,%r10d
  movzbl 0x48(%rsp),%ecx
  shr    %cl,%r10d
  mov    %r14d,%ecx
  shl    %cl,%r10d
  mov    %r9d,%ecx
  shr    %cl,%edx
  mov    %r11d,%ecx
  shl    %cl,%edx
  mov    %edx,%r8d
  movzbl %al,%eax
  mov    0x0(%rbp,%rdi,4),%edx
  movzbl 0x40(%rsp),%ecx
  shr    %cl,%edx
  mov    %r13d,%ecx
  shl    %cl,%edx
  movzbl %dl,%edx
  movzbl %sil,%ecx
  sub    %ecx,%edx
  imul   %eax,%edx
  sar    $0x8,%edx
  add    %esi,%edx
  movzbl %dl,%edx
  mov    %r13d,%ecx
  sar    %cl,%edx
  mov    %edx,%esi
  movzbl 0x40(%rsp),%ecx
  shl    %cl,%esi
  mov    0x0(%rbp,%rdi,4),%edx
  movzbl 0x48(%rsp),%ecx
  shr    %cl,%edx
  mov    %r14d,%ecx
  shl    %cl,%edx
  movzbl %dl,%edx
  movzbl %r10b,%ecx
  sub    %ecx,%edx
  imul   %eax,%edx
  sar    $0x8,%edx
  add    %r10d,%edx
  movzbl %dl,%edx
  mov    %r14d,%ecx
  sar    %cl,%edx
  movzbl 0x48(%rsp),%ecx
  shl    %cl,%edx
  or     %edx,%esi
  mov    0x0(%rbp,%rdi,4),%edx
  mov    %r9d,%ecx
  shr    %cl,%edx
  mov    %r11d,%ecx
  shl    %cl,%edx
  movzbl %dl,%edx
  movzbl %r8b,%ecx
  sub    %ecx,%edx
  imul   %eax,%edx
  sar    $0x8,%edx
  add    %r8d,%edx
  movzbl %dl,%edx
  mov    %r11d,%ecx
  sar    %cl,%edx
  mov    %r9d,%ecx
  shl    %cl,%edx
  or     %edx,%esi
  mov    %esi,0x0(%rbp,%rdi,4)
L41:
  add    $0x1,%rdi
  cmp    %r15,%rdi
  je     L42
L7:
  movzbl (%rbx,%rdi,1),%edx
  mov    %edx,%eax
  not    %eax
  test   %dl,%dl
  je     L41
  test   %al,%al
  jne    L11
  mov    (%r12,%rdi,4),%eax
  mov    %eax,0x0(%rbp,%rdi,4)
  jmp    L41
L42:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void s_memcpy4a(void *dest, void *src, unsigned char *mask, int n, int rl, int gl, int bl, int ro, int go, int bo) {
  unsigned char a;
  unsigned char sr;
  unsigned char sg;
  unsigned char sb;
  unsigned char dr;
  unsigned char dg;
  unsigned char db;
  unsigned char *m = (unsigned char *)mask;
  unsigned int *d = (unsigned int *)dest;
  unsigned int *s = (unsigned int *)src;
  rl = 8 - rl;
  gl = 8 - gl;
  bl = 8 - bl;
  while (n--) {
    a = ~*m;
    if (a != 0xff) {
      if (a == 0x00) {
        *d = *s;
      } else {
        dr = (*d >> ro) << rl;
        dg = (*d >> go) << gl;
        db = (*d >> bo) << bl;
        sr = (*s >> ro) << rl;
        sg = (*s >> go) << gl;
        sb = (*s >> bo) << bl;
        dr = (a * (dr - sr) >> 8) + sr;
        dg = (a * (dg - sg) >> 8) + sg;
        db = (a * (db - sb) >> 8) + sb;
        *d = ((dr >> rl) << ro) | ((dg >> gl) << go) | ((db >> bl) << bo);
      }
    }
    d++;
    s++;
    m++;
  };
}
```