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

```asm
<putsprite_blend_>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x48,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %esi,-0x3c(%rbp)
  mov    %rdx,-0x48(%rbp)
  mov    %rcx,-0x50(%rbp)
  mov    %r8d,-0x40(%rbp)
  mov    %r9d,-0x54(%rbp)
  jmp    L52
L55:
  mov    -0x3c(%rbp),%ebx
  mov    -0x48(%rbp),%rax
  mov    (%rax),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x28(%rbp)
  addq   $0x4,-0x48(%rbp)
  jmp    L151
L107:
  mov    -0x28(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x28(%rbp)
  movzbl (%rax),%eax
  movzbl %al,%r12d
  cmp    $0xff,%r12d
  je     L115
  add    %r12d,%ebx
  cmp    -0x54(%rbp),%ebx
  jge    L42
  mov    -0x28(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x28(%rbp)
  movzbl (%rax),%eax
  movzbl %al,%r12d
  test   %r12d,%r12d
  jne    L13
  jmp    L151
L13:
  lea    (%rbx,%r12,1),%eax
  test   %eax,%eax
  jg     L101
  add    %r12d,%ebx
  movslq %r12d,%rax
  add    %rax,-0x28(%rbp)
  jmp    L151
L101:
  test   %ebx,%ebx
  jns    L146
  add    %ebx,%r12d
  movslq %ebx,%rax
  neg    %rax
  add    %rax,-0x28(%rbp)
  mov    $0x0,%ebx
L146:
  lea    (%rbx,%r12,1),%eax
  cmp    %eax,-0x54(%rbp)
  jge    L98
  mov    -0x54(%rbp),%eax
  sub    %ebx,%eax
  mov    %eax,%r12d
  jmp    L98
L104:
  movslq %ebx,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x28(%rbp),%rax
  lea    0x1(%rax),%rcx
  mov    %rcx,-0x28(%rbp)
  movzbl (%rax),%eax
  movzbl %al,%eax
  lea    0x0(,%rax,4),%rcx
  mov    -0x50(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  movslq %ebx,%rcx
  lea    0x0(,%rcx,4),%rsi
  mov    -0x38(%rbp),%rcx
  lea    (%rsi,%rcx,1),%r13
  mov    0x10(%rbp),%rcx
  mov    %edx,%esi
  mov    %eax,%edi
  call   *%rcx
  mov    %eax,0x0(%r13)
  sub    $0x1,%r12d
  add    $0x1,%ebx
L98:
  test   %r12d,%r12d
  jg     L104
L151:
  cmp    -0x54(%rbp),%ebx
  jl     L107
  jmp    L134
L115:
  nop
  jmp    L134
L42:
  nop
L134:
  subl   $0x1,-0x40(%rbp)
  mov    -0x54(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rax,-0x38(%rbp)
L52:
  cmpl   $0x0,-0x40(%rbp)
  jg     L55
  nop
  nop
  add    $0x48,%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %rbp
  ret
```

assistant: ```c
void putsprite_blend_(unsigned *dest, int x, int *linetab, unsigned *palette, int h, int screenwidth, unsigned (*blendfp)(unsigned, unsigned)) {
  for (; h > 0; h--, dest += screenwidth) {
    register int lx = x;
    unsigned char *data = ((unsigned char *)linetab) + (*linetab);
    linetab++;
    while (lx < screenwidth) {
      register int count = *data++;
      if (count == 0xFF)
        break;
      lx += count;
      if (lx >= screenwidth)
        break;
      count = *data++;
      if (!count)
        continue;
      if ((lx + count) <= 0) {
        lx += count;
        data += count;
        continue;
      }
      if (lx < 0) {
        count += lx;
        data -= lx;
        lx = 0;
      }
      if ((lx + count) > screenwidth) {
        count = screenwidth - lx;
      }
      for (; count > 0; count--, lx++) {
        dest[lx] = blendfp(palette[*data++], dest[lx]);
      }
    }
  }
}
```