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

```asm
<_hs_text_decode_utf8>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %rdx,%r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,(%rsp)
  mov    %rsi,0x8(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  mov    (%rsi),%rax
  movl   $0x0,0x10(%rsp)
  lea    (%rdi,%rax,8),%r15
  cmp    %rcx,%rdx
  jae    L137
  xor    %eax,%eax
  mov    (%r12),%edx
  mov    %rcx,%rbx
  lea    0x14(%rsp),%r14
  lea    0x10(%rsp),%r13
  lea    -0x10(%rcx),%rbp
  test   %eax,%eax
  je     L155
L89:
  mov    %r14,%rsi
  mov    %r13,%rdi
  call   <decode@plt>
  test   %rax,%rax
  je     L60
  mov    0x10(%rsp),%eax
  cmp    $0xc,%eax
  jne    L135
L137:
  mov    %r12,%r9
L158:
  mov    0x8(%rsp),%rax
  sub    (%rsp),%r15
  sar    $0x3,%r15
  mov    %r15,(%rax)
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L132
  add    $0x28,%rsp
  mov    %r9,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L60:
  mov    0x14(%rsp),%eax
  cmp    $0xffff,%eax
  jg     L167
  lea    0x8(%r15),%rsi
  movslq %eax,%rdx
L6:
  mov    0x10(%rsp),%eax
  mov    %rdx,(%r15)
  mov    %rsi,%r15
L135:
  lea    0x4(%r12),%r9
  cmp    %r9,%rbx
  jbe    L101
  mov    %r9,%r12
  mov    (%r12),%edx
  test   %eax,%eax
  jne    L89
L155:
  cmp    %rbp,%r12
  jb     L57
  jmp    L89
  nop
L78:
  movzbl %dl,%eax
  movzbl %dh,%esi
  lea    0x10(%r12),%rdi
  add    $0x20,%r15
  movq   %rax,%xmm0
  mov    %edx,%eax
  movslq %esi,%rsi
  sar    $0x10,%eax
  movq   %rsi,%xmm1
  movzbl %al,%eax
  punpcklqdq %xmm1,%xmm0
  mov    %rax,-0x10(%r15)
  mov    %edx,%eax
  movups %xmm0,-0x20(%r15)
  shr    $0x18,%eax
  mov    %rax,-0x8(%r15)
  cmp    %rbp,%rdi
  jae    L54
  mov    %rdi,%r12
L57:
  mov    (%r12),%edx
  test   $0x80808080,%edx
  je     L78
  mov    %edx,0x14(%rsp)
  jmp    L89
  nopw   0x0(%rax,%rax,1)
L167:
  mov    %eax,%edx
  and    $0x3ff,%eax
  lea    0x10(%r15),%rsi
  sar    $0xa,%edx
  add    $0xdc00,%rax
  add    $0xd7c0,%edx
  mov    %rax,0x8(%r15)
  movslq %edx,%rdx
  jmp    L6
  cs nopw 0x0(%rax,%rax,1)
L101:
  test   %eax,%eax
  je     L158
  jmp    L137
  nopl   (%rax)
L54:
  mov    %edx,0x14(%rsp)
  mov    0x10(%r12),%edx
  mov    %rdi,%r12
  jmp    L89
L132:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
uint8_t const *_hs_text_decode_utf8(uint16_t *dest, size_t *destoff, const uint8_t const *src, const uint8_t const *srcend) {
  uint16_t *d = dest + *destoff;
  const uint8_t const *s = src;
  uint32_t state = 0;
  while (s < srcend) {
    uint32_t codepoint;
    if (state == 0) {
      while (s < srcend - 4) {
        codepoint = *((uint32_t *)s);
        if ((codepoint & 0x80808080) != 0)
          break;
        s += 4;
        *d++ = (uint16_t)(codepoint & 0xff);
        *d++ = (uint16_t)((codepoint >> 8) & 0xff);
        *d++ = (uint16_t)((codepoint >> 16) & 0xff);
        *d++ = (uint16_t)((codepoint >> 24) & 0xff);
      }
    }
    if (decode(&state, &codepoint, *s++) != 0) {
      if (state != 12)
        continue;
      break;
    }
    if (codepoint <= 0xffff)
      *d++ = (uint16_t)codepoint;
    else {
      *d++ = (uint16_t)(0xD7C0 + (codepoint >> 10));
      *d++ = (uint16_t)(0xDC00 + (codepoint & 0x3FF));
    }
  }
  if (state != 0)
    s -= 1;
  *destoff = d - dest;
  return s;
}
```