user: Please show me the C implementation that matches the assembly code listed below:

```asm
<__imlib_SubBlendShapedSpanToRGB>:
  endbr64
  mov    %rdx,%rax
  mov    %ecx,%edx
  mov    %esi,%ecx
  push   %r14
  shr    $0x18,%ecx
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %esi,%ebx
  cmp    $0xff,%cl
  jne    L123
  mov    %edx,%ecx
  add    %rdi,%rcx
  test   %edx,%edx
  je     L103
  mov    %esi,%r10d
  movzbl %bl,%r8d
  movzbl %bh,%esi
  shr    $0x10,%r10d
  movzbl %r10b,%r9d
  jmp    L2
  nopw   0x0(%rax,%rax,1)
L42:
  movzbl 0x2(%rax),%edx
  mov    %edx,%r11d
  sub    %r9d,%edx
  shr    $0x8,%edx
  sub    %r10d,%r11d
  not    %edx
  and    %r11d,%edx
  mov    %dl,0x2(%rax)
  movzbl 0x1(%rax),%edx
  mov    %edx,%r11d
  sub    %esi,%edx
  shr    $0x8,%edx
  sub    %esi,%r11d
  not    %edx
  and    %r11d,%edx
  mov    %dl,0x1(%rax)
  movzbl (%rax),%edx
  mov    %edx,%r11d
  sub    %r8d,%edx
  shr    $0x8,%edx
  sub    %ebx,%r11d
  not    %edx
  and    %r11d,%edx
  mov    %dl,(%rax)
L54:
  add    $0x1,%rdi
  add    $0x4,%rax
  cmp    %rcx,%rdi
  je     L103
L2:
  movzbl (%rdi),%edx
  test   %dl,%dl
  je     L54
  cmp    $0xff,%dl
  je     L42
  imul   %r9d,%edx
  add    $0x1,%rdi
  add    $0x4,%rax
  mov    %edx,%r11d
  shr    $0x8,%r11d
  lea    0x80(%rdx,%r11,1),%edx
  movzbl -0x2(%rax),%r11d
  shr    $0x8,%edx
  sub    %edx,%r11d
  mov    %r11d,%edx
  shr    $0x8,%edx
  not    %edx
  and    %r11d,%edx
  mov    %dl,-0x2(%rax)
  movzbl -0x1(%rdi),%edx
  imul   %esi,%edx
  mov    %edx,%r11d
  shr    $0x8,%r11d
  lea    0x80(%rdx,%r11,1),%edx
  movzbl -0x3(%rax),%r11d
  shr    $0x8,%edx
  sub    %edx,%r11d
  mov    %r11d,%edx
  shr    $0x8,%edx
  not    %edx
  and    %r11d,%edx
  mov    %dl,-0x3(%rax)
  movzbl -0x1(%rdi),%edx
  imul   %r8d,%edx
  mov    %edx,%r11d
  shr    $0x8,%r11d
  lea    0x80(%rdx,%r11,1),%edx
  movzbl -0x4(%rax),%r11d
  shr    $0x8,%edx
  sub    %edx,%r11d
  mov    %r11d,%edx
  shr    $0x8,%edx
  not    %edx
  and    %r11d,%edx
  mov    %dl,-0x4(%rax)
  cmp    %rcx,%rdi
  jne    L2
L103:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nop
L123:
  test   %edx,%edx
  je     L103
  shr    $0x10,%esi
  movzbl %bh,%ebp
  movzbl %bl,%ebx
  movzbl %cl,%r14d
  movzbl %sil,%esi
  mov    %ebp,%r11d
  mov    %esi,%r8d
  imul   %ecx,%r8d
  mov    %r8d,%r9d
  shr    $0x8,%r9d
  lea    0x80(%r8,%r9,1),%r10d
  mov    %ebp,%r8d
  imul   %ecx,%r8d
  shr    $0x8,%r10d
  imul   %ebx,%ecx
  mov    %r8d,%r9d
  shr    $0x8,%r9d
  lea    0x80(%r8,%r9,1),%r9d
  mov    %ecx,%r8d
  shr    $0x8,%r8d
  shr    $0x8,%r9d
  lea    0x80(%rcx,%r8,1),%r8d
  mov    %edx,%ecx
  shr    $0x8,%r8d
  add    %rdi,%rcx
  jmp    L34
  nopl   0x0(%rax)
L47:
  movzbl 0x2(%rax),%r12d
  sub    %r10d,%r12d
  mov    %r12d,%edx
  shr    $0x8,%edx
  not    %edx
  and    %r12d,%edx
  movzbl 0x1(%rax),%r12d
  mov    %dl,0x2(%rax)
  sub    %r9d,%r12d
  mov    %r12d,%edx
  shr    $0x8,%edx
  not    %edx
  and    %r12d,%edx
  movzbl (%rax),%r12d
  mov    %dl,0x1(%rax)
  sub    %r8d,%r12d
L38:
  mov    %r12d,%edx
  shr    $0x8,%edx
  not    %edx
  and    %r12d,%edx
  mov    %dl,(%rax)
L104:
  add    $0x1,%rdi
  add    $0x4,%rax
  cmp    %rcx,%rdi
  je     L103
L34:
  movzbl (%rdi),%edx
  test   %dl,%dl
  je     L104
  cmp    $0xff,%dl
  je     L47
  imul   %r14d,%edx
  sub    $0xffffff80,%edx
  mov    %edx,%r12d
  shr    $0x8,%r12d
  add    %r12d,%edx
  mov    %esi,%r12d
  shr    $0x8,%edx
  imul   %edx,%r12d
  mov    %r12d,%r13d
  shr    $0x8,%r13d
  lea    0x80(%r12,%r13,1),%r12d
  movzbl 0x2(%rax),%r13d
  shr    $0x8,%r12d
  sub    %r12d,%r13d
  mov    %r13d,%r12d
  shr    $0x8,%r12d
  not    %r12d
  and    %r13d,%r12d
  mov    %r12b,0x2(%rax)
  mov    %r11d,%r12d
  imul   %edx,%r12d
  imul   %ebx,%edx
  mov    %r12d,%r13d
  shr    $0x8,%r13d
  lea    0x80(%r12,%r13,1),%r12d
  movzbl 0x1(%rax),%r13d
  shr    $0x8,%r12d
  sub    %r12d,%r13d
  mov    %r13d,%r12d
  shr    $0x8,%r12d
  not    %r12d
  and    %r13d,%r12d
  mov    %r12b,0x1(%rax)
  mov    %edx,%r12d
  shr    $0x8,%r12d
  lea    0x80(%rdx,%r12,1),%edx
  movzbl (%rax),%r12d
  shr    $0x8,%edx
  sub    %edx,%r12d
  jmp    L38
```

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