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

```asm
<__imlib_ReBlendShapedSpanToRGB>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdx,%rax
  mov    %esi,%r8d
  shr    $0x18,%r8d
  cmp    $0xff,%r8b
  jne    L45
  test   %ecx,%ecx
  je     L124
  mov    %esi,%r8d
  shr    $0x10,%r8d
  movzbl %r8b,%edx
  lea    -0xfe(%rdx,%rdx,1),%ebx
  mov    %esi,%edx
  movzbl %dh,%edx
  lea    -0xfe(%rdx,%rdx,1),%r11d
  movzbl %sil,%edx
  lea    -0xfe(%rdx,%rdx,1),%r10d
  mov    %ecx,%ecx
  add    %rdi,%rcx
  movzbl %r8b,%r8d
  sub    $0x7f,%r8d
  mov    %esi,%edx
  movzbl %dh,%edx
  lea    -0x7f(%rdx),%r9d
  movzbl %sil,%esi
  sub    $0x7f,%esi
  jmp    L15
L45:
  mov    %r8d,%ebx
  test   %ecx,%ecx
  je     L124
  mov    %esi,%r11d
  shr    $0x10,%r11d
  movzbl %r11b,%r10d
  sub    $0x7f,%r10d
  imul   %r8d,%r10d
  sar    $0x7,%r10d
  mov    %esi,%edx
  movzbl %dh,%edx
  lea    -0x7f(%rdx),%r9d
  imul   %r8d,%r9d
  sar    $0x7,%r9d
  movzbl %sil,%edx
  sub    $0x7f,%edx
  imul   %edx,%r8d
  sar    $0x7,%r8d
  mov    %ecx,%ecx
  add    %rdi,%rcx
  movzbl %bl,%ebx
  movzbl %r11b,%r11d
  sub    $0x7f,%r11d
  mov    %esi,%edx
  movzbl %dh,%ebp
  sub    $0x7f,%ebp
  movzbl %sil,%esi
  sub    $0x7f,%esi
  jmp    L126
L50:
  movzbl %dl,%edx
  imul   %ebx,%edx
  sub    $0xffffff80,%edx
  mov    %edx,%r12d
  shr    $0x8,%r12d
  add    %r12d,%edx
  shr    $0x8,%edx
  mov    %r11d,%r12d
  imul   %edx,%r12d
  sar    $0x7,%r12d
  movzbl 0x2(%rax),%r13d
  add    %r13d,%r12d
  mov    %r12d,%r13d
  shr    $0x8,%r13d
  neg    %r13d
  or     %r12d,%r13d
  shr    $0x9,%r12d
  not    %r12d
  and    %r13d,%r12d
  mov    %r12b,0x2(%rax)
  mov    %ebp,%r12d
  imul   %edx,%r12d
  sar    $0x7,%r12d
  movzbl 0x1(%rax),%r13d
  add    %r13d,%r12d
  mov    %r12d,%r13d
  shr    $0x8,%r13d
  neg    %r13d
  or     %r12d,%r13d
  shr    $0x9,%r12d
  not    %r12d
  and    %r13d,%r12d
  mov    %r12b,0x1(%rax)
  imul   %esi,%edx
  sar    $0x7,%edx
  movzbl (%rax),%r12d
  add    %r12d,%edx
  mov    %edx,%r12d
  shr    $0x8,%r12d
  neg    %r12d
  or     %edx,%r12d
  shr    $0x9,%edx
  not    %edx
  and    %r12d,%edx
  mov    %dl,(%rax)
L67:
  add    $0x1,%rdi
  add    $0x4,%rax
  cmp    %rdi,%rcx
  je     L124
L126:
  movzbl (%rdi),%edx
  test   %dl,%dl
  je     L67
  cmp    $0xff,%dl
  jne    L50
  movzbl 0x2(%rax),%edx
  add    %r10d,%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    %r9d,%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
  mov    %edx,%r12d
  shr    $0x8,%r12d
  neg    %r12d
  or     %edx,%r12d
  shr    $0x9,%edx
  not    %edx
  and    %r12d,%edx
  mov    %dl,(%rax)
  jmp    L67
L3:
  movzbl %dl,%edx
  imul   %r8d,%edx
  sar    $0x7,%edx
  movzbl 0x2(%rax),%ebp
  add    %ebp,%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 (%rdi),%edx
  imul   %r9d,%edx
  sar    $0x7,%edx
  movzbl 0x1(%rax),%ebp
  add    %ebp,%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 (%rdi),%edx
  imul   %esi,%edx
  sar    $0x7,%edx
  movzbl (%rax),%ebp
  add    %ebp,%edx
  mov    %edx,%ebp
  shr    $0x8,%ebp
  neg    %ebp
  or     %edx,%ebp
  shr    $0x9,%edx
  not    %edx
  and    %ebp,%edx
  mov    %dl,(%rax)
L1:
  add    $0x1,%rdi
  add    $0x4,%rax
  cmp    %rdi,%rcx
  je     L124
L15:
  movzbl (%rdi),%edx
  test   %dl,%dl
  je     L1
  cmp    $0xff,%dl
  jne    L3
  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
  mov    %edx,%ebp
  shr    $0x8,%ebp
  neg    %ebp
  or     %edx,%ebp
  shr    $0x9,%edx
  not    %edx
  and    %ebp,%edx
  mov    %dl,(%rax)
  jmp    L1
L124:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

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