user: 请从给定的汇编指令推导出C源代码：

```asm
<__imlib_BlendShapedSpanToRGB>:
  endbr64
  push   %rbp
  push   %rbx
  mov    %esi,%ebx
  mov    %rdx,%rax
  mov    %esi,%edx
  shr    $0x18,%edx
  cmp    $0xff,%dl
  jne    L56
  mov    %ecx,%esi
  add    %rdi,%rsi
  test   %ecx,%ecx
  je     L74
  mov    %ebx,%r8d
  shr    $0x10,%r8d
  movzbl %r8b,%r8d
  movzbl %bh,%ebp
  movzbl %bl,%r9d
  and    $0xffffff,%ebx
  jmp    L116
L56:
  test   %ecx,%ecx
  je     L74
  mov    %ecx,%ecx
  add    %rdi,%rcx
  movzbl %dl,%esi
  mov    %ebx,%r9d
  shr    $0x10,%r9d
  movzbl %r9b,%r9d
  movzbl %bh,%ebp
  movzbl %bl,%ebx
  jmp    L94
L48:
  movzbl %dl,%edx
  imul   %esi,%edx
  sub    $0xffffff80,%edx
  movzbl 0x2(%rax),%r8d
  mov    %edx,%r10d
  shr    $0x8,%r10d
  add    %r10d,%edx
  shr    $0x8,%edx
  movzbl %r8b,%r11d
  mov    %r9d,%r10d
  sub    %r11d,%r10d
  imul   %edx,%r10d
  mov    %r10d,%r11d
  shr    $0x8,%r11d
  lea    0x80(%r10,%r11,1),%r10d
  shr    $0x8,%r10d
  add    %r10d,%r8d
  mov    %r8b,0x2(%rax)
  movzbl 0x1(%rax),%r8d
  movzbl %r8b,%r11d
  mov    %ebp,%r10d
  sub    %r11d,%r10d
  imul   %edx,%r10d
  mov    %r10d,%r11d
  shr    $0x8,%r11d
  lea    0x80(%r10,%r11,1),%r10d
  shr    $0x8,%r10d
  add    %r10d,%r8d
  mov    %r8b,0x1(%rax)
  movzbl (%rax),%r8d
  movzbl %r8b,%r11d
  mov    %ebx,%r10d
  sub    %r11d,%r10d
  imul   %r10d,%edx
  mov    %edx,%r10d
  shr    $0x8,%r10d
  lea    0x80(%rdx,%r10,1),%edx
  shr    $0x8,%edx
  add    %edx,%r8d
  mov    %r8b,(%rax)
L92:
  add    $0x1,%rdi
  add    $0x4,%rax
  cmp    %rdi,%rcx
  je     L74
L94:
  movzbl (%rdi),%edx
  test   %dl,%dl
  je     L92
  cmp    $0xff,%dl
  jne    L48
  movzbl 0x2(%rax),%edx
  movzbl %dl,%r10d
  mov    %r9d,%r8d
  sub    %r10d,%r8d
  imul   %esi,%r8d
  mov    %r8d,%r10d
  shr    $0x8,%r10d
  lea    0x80(%r8,%r10,1),%r8d
  shr    $0x8,%r8d
  add    %r8d,%edx
  mov    %dl,0x2(%rax)
  movzbl 0x1(%rax),%edx
  movzbl %dl,%r10d
  mov    %ebp,%r8d
  sub    %r10d,%r8d
  imul   %esi,%r8d
  mov    %r8d,%r10d
  shr    $0x8,%r10d
  lea    0x80(%r8,%r10,1),%r8d
  shr    $0x8,%r8d
  add    %r8d,%edx
  mov    %dl,0x1(%rax)
  movzbl (%rax),%edx
  movzbl %dl,%r10d
  mov    %ebx,%r8d
  sub    %r10d,%r8d
  imul   %esi,%r8d
  mov    %r8d,%r10d
  shr    $0x8,%r10d
  lea    0x80(%r8,%r10,1),%r8d
  shr    $0x8,%r8d
  add    %r8d,%edx
  mov    %dl,(%rax)
  jmp    L92
L121:
  movzbl 0x2(%rax),%ecx
  movzbl %cl,%r11d
  mov    %r8d,%r10d
  sub    %r11d,%r10d
  movzbl %dl,%edx
  imul   %r10d,%edx
  mov    %edx,%r10d
  shr    $0x8,%r10d
  lea    0x80(%rdx,%r10,1),%edx
  shr    $0x8,%edx
  add    %edx,%ecx
  mov    %cl,0x2(%rax)
  movzbl 0x1(%rax),%edx
  movzbl %dl,%r10d
  mov    %ebp,%ecx
  sub    %r10d,%ecx
  movzbl (%rdi),%r10d
  imul   %r10d,%ecx
  mov    %ecx,%r10d
  shr    $0x8,%r10d
  lea    0x80(%rcx,%r10,1),%ecx
  shr    $0x8,%ecx
  add    %ecx,%edx
  mov    %dl,0x1(%rax)
  movzbl (%rax),%edx
  movzbl %dl,%r10d
  mov    %r9d,%ecx
  sub    %r10d,%ecx
  movzbl (%rdi),%r10d
  imul   %r10d,%ecx
  mov    %ecx,%r10d
  shr    $0x8,%r10d
  lea    0x80(%rcx,%r10,1),%ecx
  shr    $0x8,%ecx
  add    %ecx,%edx
  mov    %dl,(%rax)
L40:
  add    $0x1,%rdi
  add    $0x4,%rax
  cmp    %rdi,%rsi
  je     L74
L116:
  movzbl (%rdi),%edx
  test   %dl,%dl
  je     L40
  cmp    $0xff,%dl
  jne    L121
  mov    (%rax),%edx
  and    $0xff000000,%edx
  or     %ebx,%edx
  mov    %edx,(%rax)
  jmp    L40
L74:
  pop    %rbx
  pop    %rbp
  ret
```

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