user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<__imlib_ReBlendShapedSpanToRGB>:
  endbr64
  mov    %esi,%r8d
  push   %r13
  mov    %rdx,%rax
  shr    $0x18,%r8d
  push   %r12
  push   %rbp
  push   %rbx
  cmp    $0xff,%r8b
  jne    L32
  test   %ecx,%ecx
  je     L103
  mov    %esi,%r8d
  mov    %esi,%edx
  movzbl %sil,%esi
  mov    %ecx,%ecx
  shr    $0x10,%r8d
  movzbl %dh,%edx
  sub    $0x7f,%esi
  add    %rdi,%rcx
  movzbl %r8b,%r8d
  mov    %edx,%r9d
  lea    (%rsi,%rsi,1),%r10d
  sub    $0x7f,%r8d
  sub    $0x7f,%r9d
  lea    (%r8,%r8,1),%ebx
  lea    (%r9,%r9,1),%r11d
  jmp    L119
  nopl   0x0(%rax,%rax,1)
L79:
  movzbl 0x2(%rax),%edx
  add    %ebx,%edx
  mov    %edx,%ebp
  shr    $0x8,%ebp
  neg    %ebp
  or     %edx,%ebp
  shr    $0x9,%edx
  not    %edx
  and    %ebp,%edx
  mov    %dl,0x2(%rax)
  movzbl 0x1(%rax),%edx
  add    %r11d,%edx
  mov    %edx,%ebp
  shr    $0x8,%ebp
  neg    %ebp
  or     %edx,%ebp
  shr    $0x9,%edx
  not    %edx
  and    %ebp,%edx
  mov    %dl,0x1(%rax)
  movzbl (%rax),%edx
  add    %r10d,%edx
L40:
  mov    %edx,%ebp
  shr    $0x8,%ebp
  neg    %ebp
  or     %edx,%ebp
  shr    $0x9,%edx
  not    %edx
  and    %ebp,%edx
  mov    %dl,(%rax)
L6:
  add    $0x1,%rdi
  add    $0x4,%rax
  cmp    %rcx,%rdi
  je     L103
L119:
  movzbl (%rdi),%edx
  test   %dl,%dl
  je     L6
  cmp    $0xff,%dl
  je     L79
  imul   %r8d,%edx
  movzbl 0x2(%rax),%ebp
  sar    $0x7,%edx
  add    %ebp,%edx
  mov    %edx,%ebp
  shr    $0x8,%ebp
  neg    %ebp
  or     %edx,%ebp
  shr    $0x9,%edx
  not    %edx
  and    %ebp,%edx
  movzbl 0x1(%rax),%ebp
  mov    %dl,0x2(%rax)
  movzbl (%rdi),%edx
  imul   %r9d,%edx
  sar    $0x7,%edx
  add    %ebp,%edx
  mov    %edx,%ebp
  shr    $0x8,%ebp
  neg    %ebp
  or     %edx,%ebp
  shr    $0x9,%edx
  not    %edx
  and    %ebp,%edx
  movzbl (%rax),%ebp
  mov    %dl,0x1(%rax)
  movzbl (%rdi),%edx
  imul   %esi,%edx
  sar    $0x7,%edx
  add    %ebp,%edx
  jmp    L40
  nopw   0x0(%rax,%rax,1)
L32:
  test   %ecx,%ecx
  jne    L124
L103:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax,%rax,1)
L124:
  mov    %esi,%r9d
  mov    %esi,%edx
  movzbl %sil,%esi
  movzbl %r8b,%ebp
  shr    $0x10,%r9d
  movzbl %dh,%edx
  sub    $0x7f,%esi
  mov    %ecx,%ecx
  movzbl %r9b,%r9d
  mov    %edx,%r10d
  add    %rdi,%rcx
  sub    $0x7f,%r9d
  sub    $0x7f,%r10d
  mov    %r9d,%ebx
  mov    %r10d,%r11d
  imul   %r8d,%ebx
  imul   %r8d,%r11d
  imul   %esi,%r8d
  sar    $0x7,%ebx
  sar    $0x7,%r11d
  sar    $0x7,%r8d
  jmp    L96
  nopw   0x0(%rax,%rax,1)
L7:
  movzbl 0x2(%rax),%edx
  add    %ebx,%edx
  mov    %edx,%r12d
  shr    $0x8,%r12d
  neg    %r12d
  or     %edx,%r12d
  shr    $0x9,%edx
  not    %edx
  and    %r12d,%edx
  mov    %dl,0x2(%rax)
  movzbl 0x1(%rax),%edx
  add    %r11d,%edx
  mov    %edx,%r12d
  shr    $0x8,%r12d
  neg    %r12d
  or     %edx,%r12d
  shr    $0x9,%edx
  not    %edx
  and    %r12d,%edx
  mov    %dl,0x1(%rax)
  movzbl (%rax),%edx
  add    %r8d,%edx
L20:
  mov    %edx,%r12d
  shr    $0x8,%r12d
  neg    %r12d
  or     %edx,%r12d
  shr    $0x9,%edx
  not    %edx
  and    %r12d,%edx
  mov    %dl,(%rax)
L78:
  add    $0x1,%rdi
  add    $0x4,%rax
  cmp    %rcx,%rdi
  je     L103
L96:
  movzbl (%rdi),%edx
  test   %dl,%dl
  je     L78
  cmp    $0xff,%dl
  je     L7
  imul   %ebp,%edx
  movzbl 0x2(%rax),%r13d
  sub    $0xffffff80,%edx
  mov    %edx,%r12d
  shr    $0x8,%r12d
  add    %r12d,%edx
  mov    %r9d,%r12d
  shr    $0x8,%edx
  imul   %edx,%r12d
  sar    $0x7,%r12d
  add    %r13d,%r12d
  mov    %r12d,%r13d
  shr    $0x8,%r13d
  neg    %r13d
  or     %r12d,%r13d
  shr    $0x9,%r12d
  not    %r12d
  and    %r13d,%r12d
  movzbl 0x1(%rax),%r13d
  mov    %r12b,0x2(%rax)
  mov    %r10d,%r12d
  imul   %edx,%r12d
  imul   %esi,%edx
  sar    $0x7,%r12d
  add    %r13d,%r12d
  sar    $0x7,%edx
  mov    %r12d,%r13d
  shr    $0x8,%r13d
  neg    %r13d
  or     %r12d,%r13d
  shr    $0x9,%r12d
  not    %r12d
  and    %r13d,%r12d
  mov    %r12b,0x1(%rax)
  movzbl (%rax),%r12d
  add    %r12d,%edx
  jmp    L20
```

assistant: ```c
void __imlib_ReBlendShapedSpanToRGB(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 *)(dst))[2]) + ((((((unsigned char *)(&color))[2]) - 127) * (((unsigned char *)(&color))[3])) >> 7);
        ((unsigned char *)(dst))[2] = (tmp | (-(tmp >> 8))) & (~(tmp >> 9));
        ;
        tmp = (((unsigned char *)(dst))[1]) + ((((((unsigned char *)(&color))[1]) - 127) * (((unsigned char *)(&color))[3])) >> 7);
        ((unsigned char *)(dst))[1] = (tmp | (-(tmp >> 8))) & (~(tmp >> 9));
        ;
        tmp = (((unsigned char *)(dst))[0]) + ((((((unsigned char *)(&color))[0]) - 127) * (((unsigned char *)(&color))[3])) >> 7);
        ((unsigned char *)(dst))[0] = (tmp | (-(tmp >> 8))) & (~(tmp >> 9));
        ;
        ;
        break;
      }
      default: {
        do {
          tmp = ((*src) * (((unsigned char *)(&color))[3])) + 0x80;
          a = (tmp + (tmp >> 8)) >> 8;
        } while (0);
        tmp = (((unsigned char *)(dst))[2]) + ((((((unsigned char *)(&color))[2]) - 127) * (a)) >> 7);
        ((unsigned char *)(dst))[2] = (tmp | (-(tmp >> 8))) & (~(tmp >> 9));
        ;
        tmp = (((unsigned char *)(dst))[1]) + ((((((unsigned char *)(&color))[1]) - 127) * (a)) >> 7);
        ((unsigned char *)(dst))[1] = (tmp | (-(tmp >> 8))) & (~(tmp >> 9));
        ;
        tmp = (((unsigned char *)(dst))[0]) + ((((((unsigned char *)(&color))[0]) - 127) * (a)) >> 7);
        ((unsigned char *)(dst))[0] = (tmp | (-(tmp >> 8))) & (~(tmp >> 9));
        ;
        ;
        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]) - 127) << 1);
        ((unsigned char *)(dst))[2] = (tmp | (-(tmp >> 8))) & (~(tmp >> 9));
        ;
        tmp = (((unsigned char *)(dst))[1]) + (((((unsigned char *)(&color))[1]) - 127) << 1);
        ((unsigned char *)(dst))[1] = (tmp | (-(tmp >> 8))) & (~(tmp >> 9));
        ;
        tmp = (((unsigned char *)(dst))[0]) + (((((unsigned char *)(&color))[0]) - 127) << 1);
        ((unsigned char *)(dst))[0] = (tmp | (-(tmp >> 8))) & (~(tmp >> 9));
        ;
      } while (0);
      break;
    }
    default: {
      tmp = (((unsigned char *)(dst))[2]) + ((((((unsigned char *)(&color))[2]) - 127) * (*src)) >> 7);
      ((unsigned char *)(dst))[2] = (tmp | (-(tmp >> 8))) & (~(tmp >> 9));
      ;
      tmp = (((unsigned char *)(dst))[1]) + ((((((unsigned char *)(&color))[1]) - 127) * (*src)) >> 7);
      ((unsigned char *)(dst))[1] = (tmp | (-(tmp >> 8))) & (~(tmp >> 9));
      ;
      tmp = (((unsigned char *)(dst))[0]) + ((((((unsigned char *)(&color))[0]) - 127) * (*src)) >> 7);
      ((unsigned char *)(dst))[0] = (tmp | (-(tmp >> 8))) & (~(tmp >> 9));
      ;
      ;
      break;
    }
    }
    src++;
    dst++;
  }
}
```