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

```asm
<__imlib_AddCopyShapedSpanToRGBA>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    %ecx,-0x20(%rbp)
  lea    -0x1c(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  cmp    $0xff,%al
  je     L78
  jmp    L83
L46:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  test   %eax,%eax
  je     L42
  cmp    $0xff,%eax
  jne    L2
  mov    -0x28(%rbp),%rax
  lea    0x3(%rax),%rdx
  movzbl -0x19(%rbp),%eax
  mov    %al,(%rdx)
  mov    -0x28(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movzbl %al,%edx
  lea    -0x1c(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  add    %edx,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  shr    $0x8,%eax
  neg    %eax
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x28(%rbp),%rax
  add    $0x2,%rax
  or     %ecx,%edx
  mov    %dl,(%rax)
  mov    -0x28(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%edx
  lea    -0x1c(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  add    %edx,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  shr    $0x8,%eax
  neg    %eax
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x28(%rbp),%rax
  add    $0x1,%rax
  or     %ecx,%edx
  mov    %dl,(%rax)
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%edx
  lea    -0x1c(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  add    %edx,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  shr    $0x8,%eax
  neg    %eax
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  or     %eax,%edx
  mov    -0x28(%rbp),%rax
  mov    %dl,(%rax)
  jmp    L35
L2:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%edx
  lea    -0x1c(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  imul   %edx,%eax
  sub    $0xffffff80,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  shr    $0x8,%eax
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    %edx,%eax
  shr    $0x8,%eax
  mov    %eax,%edx
  mov    -0x28(%rbp),%rax
  add    $0x3,%rax
  mov    %dl,(%rax)
  mov    -0x28(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movzbl %al,%edx
  lea    -0x1c(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  add    %edx,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  shr    $0x8,%eax
  neg    %eax
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x28(%rbp),%rax
  add    $0x2,%rax
  or     %ecx,%edx
  mov    %dl,(%rax)
  mov    -0x28(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%edx
  lea    -0x1c(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  add    %edx,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  shr    $0x8,%eax
  neg    %eax
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x28(%rbp),%rax
  add    $0x1,%rax
  or     %ecx,%edx
  mov    %dl,(%rax)
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%edx
  lea    -0x1c(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  add    %edx,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  shr    $0x8,%eax
  neg    %eax
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  or     %eax,%edx
  mov    -0x28(%rbp),%rax
  mov    %dl,(%rax)
  jmp    L35
L42:
  nop
L35:
  addq   $0x1,-0x18(%rbp)
  addq   $0x4,-0x28(%rbp)
L83:
  mov    -0x20(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,-0x20(%rbp)
  test   %eax,%eax
  jne    L46
  jmp    L95
L89:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L94
  mov    -0x28(%rbp),%rax
  lea    0x3(%rax),%rdx
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  mov    -0x28(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movzbl %al,%edx
  lea    -0x1c(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  add    %edx,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x8(%rbp),%eax
  shr    $0x8,%eax
  neg    %eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x28(%rbp),%rax
  add    $0x2,%rax
  or     %ecx,%edx
  mov    %dl,(%rax)
  mov    -0x28(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%edx
  lea    -0x1c(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  add    %edx,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x8(%rbp),%eax
  shr    $0x8,%eax
  neg    %eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x28(%rbp),%rax
  add    $0x1,%rax
  or     %ecx,%edx
  mov    %dl,(%rax)
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%edx
  lea    -0x1c(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  add    %edx,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x8(%rbp),%eax
  shr    $0x8,%eax
  neg    %eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%eax
  or     %eax,%edx
  mov    -0x28(%rbp),%rax
  mov    %dl,(%rax)
L94:
  addq   $0x1,-0x18(%rbp)
  addq   $0x4,-0x28(%rbp)
L78:
  mov    -0x20(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,-0x20(%rbp)
  test   %eax,%eax
  jne    L89
L95:
  pop    %rbp
  ret
```

assistant: ```c
void __imlib_AddCopyShapedSpanToRGBA(unsigned char *src, unsigned int color, unsigned int *dst, int len) {
  if (((unsigned char *)(&color))[3] < 255) {
    while (len--) {
      unsigned int tmp;
      switch (*src) {
      case 0:
        break;
      case 255: {
        ((unsigned char *)(dst))[3] = ((unsigned char *)(&color))[3];
        do {
          tmp = (((unsigned char *)(dst))[2]) + (((unsigned char *)(&color))[2]);
          ((unsigned char *)(dst))[2] = (tmp | (-(tmp >> 8)));
          ;
          tmp = (((unsigned char *)(dst))[1]) + (((unsigned char *)(&color))[1]);
          ((unsigned char *)(dst))[1] = (tmp | (-(tmp >> 8)));
          ;
          tmp = (((unsigned char *)(dst))[0]) + (((unsigned char *)(&color))[0]);
          ((unsigned char *)(dst))[0] = (tmp | (-(tmp >> 8)));
          ;
        } while (0);
        break;
      }
      default: {
        do {
          tmp = ((*src) * (((unsigned char *)(&color))[3])) + 0x80;
          ((unsigned char *)(dst))[3] = (tmp + (tmp >> 8)) >> 8;
        } while (0);
        do {
          tmp = (((unsigned char *)(dst))[2]) + (((unsigned char *)(&color))[2]);
          ((unsigned char *)(dst))[2] = (tmp | (-(tmp >> 8)));
          ;
          tmp = (((unsigned char *)(dst))[1]) + (((unsigned char *)(&color))[1]);
          ((unsigned char *)(dst))[1] = (tmp | (-(tmp >> 8)));
          ;
          tmp = (((unsigned char *)(dst))[0]) + (((unsigned char *)(&color))[0]);
          ((unsigned char *)(dst))[0] = (tmp | (-(tmp >> 8)));
          ;
        } while (0);
        break;
      }
      }
      src++;
      dst++;
    }
    return;
  }
  while (len--) {
    unsigned int tmp;
    if (*src) {
      ((unsigned char *)(dst))[3] = *src;
      do {
        tmp = (((unsigned char *)(dst))[2]) + (((unsigned char *)(&color))[2]);
        ((unsigned char *)(dst))[2] = (tmp | (-(tmp >> 8)));
        ;
        tmp = (((unsigned char *)(dst))[1]) + (((unsigned char *)(&color))[1]);
        ((unsigned char *)(dst))[1] = (tmp | (-(tmp >> 8)));
        ;
        tmp = (((unsigned char *)(dst))[0]) + (((unsigned char *)(&color))[0]);
        ((unsigned char *)(dst))[0] = (tmp | (-(tmp >> 8)));
        ;
      } while (0);
    }
    src++;
    dst++;
  }
}
```