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

```asm
<__imlib_AddCopyShapedSpanToRGBA>:
  endbr64
  mov    %rdx,%rax
  mov    %esi,%edx
  push   %r12
  shr    $0x18,%edx
  push   %rbp
  push   %rbx
  mov    %esi,%ebx
  cmp    $0xff,%dl
  jne    L67
  mov    %ecx,%esi
  add    %rdi,%rsi
  test   %ecx,%ecx
  je     L6
  mov    %ebx,%r8d
  movzbl %bh,%ecx
  movzbl %bl,%r9d
  shr    $0x10,%r8d
  movzbl %r8b,%r10d
  cs nopw 0x0(%rax,%rax,1)
L16:
  movzbl (%rdi),%edx
  test   %dl,%dl
  je     L17
  mov    %dl,0x3(%rax)
  movzbl 0x2(%rax),%edx
  mov    %edx,%r11d
  add    %r10d,%edx
  shr    $0x8,%edx
  add    %r8d,%r11d
  neg    %edx
  or     %r11d,%edx
  mov    %dl,0x2(%rax)
  movzbl 0x1(%rax),%edx
  mov    %edx,%r11d
  add    %ecx,%edx
  shr    $0x8,%edx
  add    %ecx,%r11d
  neg    %edx
  or     %r11d,%edx
  mov    %dl,0x1(%rax)
  movzbl (%rax),%edx
  mov    %edx,%r11d
  add    %r9d,%edx
  shr    $0x8,%edx
  add    %ebx,%r11d
  neg    %edx
  or     %r11d,%edx
  mov    %dl,(%rax)
L17:
  add    $0x1,%rdi
  add    $0x4,%rax
  cmp    %rsi,%rdi
  jne    L16
L6:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax)
L67:
  test   %ecx,%ecx
  je     L6
  mov    %esi,%r8d
  mov    %ecx,%ecx
  mov    %edx,%r11d
  movzbl %dl,%ebp
  shr    $0x10,%r8d
  add    %rdi,%rcx
  movzbl %bh,%esi
  movzbl %bl,%r9d
  movzbl %r8b,%r10d
  jmp    L92
  nopl   0x0(%rax,%rax,1)
L43:
  mov    %r11b,0x3(%rax)
L28:
  movzbl 0x2(%rax),%edx
  mov    %edx,%r12d
  add    %r10d,%edx
  shr    $0x8,%edx
  add    %r8d,%r12d
  neg    %edx
  or     %r12d,%edx
  mov    %dl,0x2(%rax)
  movzbl 0x1(%rax),%edx
  mov    %edx,%r12d
  add    %esi,%edx
  shr    $0x8,%edx
  add    %esi,%r12d
  neg    %edx
  or     %r12d,%edx
  mov    %dl,0x1(%rax)
  movzbl (%rax),%edx
  mov    %edx,%r12d
  add    %r9d,%edx
  shr    $0x8,%edx
  add    %ebx,%r12d
  neg    %edx
  or     %r12d,%edx
  mov    %dl,(%rax)
L9:
  add    $0x1,%rdi
  add    $0x4,%rax
  cmp    %rcx,%rdi
  je     L6
L92:
  movzbl (%rdi),%edx
  test   %dl,%dl
  je     L9
  cmp    $0xff,%dl
  je     L43
  imul   %ebp,%edx
  sub    $0xffffff80,%edx
  mov    %edx,%r12d
  shr    $0x8,%r12d
  add    %r12d,%edx
  mov    %dh,0x3(%rax)
  jmp    L28
```

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++;
  }
}
```