user: What would the C source look like for the assembly code provided here?

```asm
<putsprite_remapblend_>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r12
  push   %rbx
  mov    %rdi,-0x28(%rbp)
  mov    %esi,-0x2c(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %ecx,-0x30(%rbp)
  mov    %r8d,-0x3c(%rbp)
  mov    %r9,-0x48(%rbp)
  jmp    L140
L69:
  mov    -0x2c(%rbp),%ebx
  mov    -0x38(%rbp),%rax
  mov    (%rax),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x18(%rbp)
  addq   $0x4,-0x38(%rbp)
  jmp    L31
L44:
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  movzbl (%rax),%eax
  movzbl %al,%r12d
  cmp    $0xff,%r12d
  je     L43
  add    %r12d,%ebx
  cmp    -0x3c(%rbp),%ebx
  jge    L35
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  movzbl (%rax),%eax
  movzbl %al,%r12d
  test   %r12d,%r12d
  jne    L158
  jmp    L31
L158:
  lea    (%rbx,%r12,1),%eax
  test   %eax,%eax
  jg     L81
  add    %r12d,%ebx
  movslq %r12d,%rax
  add    %rax,-0x18(%rbp)
  jmp    L31
L81:
  test   %ebx,%ebx
  jns    L150
  add    %ebx,%r12d
  movslq %ebx,%rax
  neg    %rax
  add    %rax,-0x18(%rbp)
  mov    $0x0,%ebx
L150:
  lea    (%rbx,%r12,1),%eax
  cmp    %eax,-0x3c(%rbp)
  jge    L156
  mov    -0x3c(%rbp),%eax
  sub    %ebx,%eax
  mov    %eax,%r12d
  jmp    L156
L97:
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  movzbl (%rax),%eax
  movzbl %al,%edx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x8,%eax
  mov    %eax,%ecx
  movslq %ebx,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  or     %ecx,%eax
  movslq %eax,%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  movslq %ebx,%rcx
  mov    -0x28(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  add    $0x1,%ebx
  sub    $0x1,%r12d
L156:
  test   %r12d,%r12d
  jg     L97
L31:
  cmp    -0x3c(%rbp),%ebx
  jl     L44
  jmp    L26
L43:
  nop
  jmp    L26
L35:
  nop
L26:
  subl   $0x1,-0x30(%rbp)
  mov    -0x3c(%rbp),%eax
  cltq
  add    %rax,-0x28(%rbp)
L140:
  cmpl   $0x0,-0x30(%rbp)
  jg     L69
  nop
  nop
  pop    %rbx
  pop    %r12
  pop    %rbp
  ret
```

assistant: ```c
void putsprite_remapblend_(unsigned char *dest, int x, int *linetab, int h, int screenwidth, unsigned char *remap, unsigned char *blend) {
  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--) {
        dest[lx] = blend[(remap[(((int)(*data++)) & 0xFF)] << 8) | dest[lx]];
        lx++;
      }
    }
  }
}
```