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

```asm
<_hs_text_decode_utf8_int>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %rsi,0x10(%rsp)
  mov    %rdx,0x18(%rsp)
  mov    (%rdx),%rdx
  mov    %rdi,0x8(%rsp)
  mov    %r8,0x20(%rsp)
  mov    %r9,0x28(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  mov    (%rsi),%rax
  mov    (%r8),%esi
  mov    %esi,0x34(%rsp)
  lea    (%rdi,%rax,8),%rbp
  mov    (%r9),%eax
  mov    %eax,0x30(%rsp)
  cmp    %rcx,%rdx
  jae    L19
  mov    %rdx,(%rsp)
  mov    %rcx,%rbx
  lea    0x34(%rsp),%r15
  lea    -0x10(%rcx),%r13
  lea    0x30(%rsp),%r14
  test   %eax,%eax
  je     L23
L133:
  lea    0x4(%rdx),%r12
  mov    (%rdx),%edx
  mov    %r15,%rsi
  mov    %r14,%rdi
  call   <decode@plt>
  test   %rax,%rax
  je     L74
  mov    0x30(%rsp),%eax
  cmp    $0xc,%eax
  jne    L48
L120:
  mov    0x34(%rsp),%esi
L81:
  mov    0x10(%rsp),%rbx
  mov    %rbp,%rcx
  sub    0x8(%rsp),%rcx
  sar    $0x3,%rcx
  mov    %rcx,(%rbx)
  mov    0x20(%rsp),%rbx
  mov    (%rsp),%rcx
  mov    %esi,(%rbx)
  mov    0x28(%rsp),%rbx
  mov    %eax,(%rbx)
  mov    0x18(%rsp),%rax
  mov    %rcx,(%rax)
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L51
  add    $0x48,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  xchg   %ax,%ax
L74:
  movslq 0x34(%rsp),%rdx
  mov    0x30(%rsp),%eax
  cmp    $0xffff,%edx
  jg     L110
  mov    %r12,(%rsp)
  add    $0x8,%rbp
  mov    %rdx,-0x8(%rbp)
L48:
  cmp    %r12,%rbx
  jbe    L120
  mov    %r12,%rdx
  test   %eax,%eax
  jne    L133
L23:
  cmp    %rdx,%r13
  ja     L56
  jmp    L95
  nopl   0x0(%rax)
L82:
  movzbl %al,%esi
  add    $0x20,%rbp
  add    $0x10,%rdx
  mov    %rsi,-0x20(%rbp)
  movzbl %ah,%esi
  movslq %esi,%rsi
  mov    %rsi,-0x18(%rbp)
  mov    %eax,%esi
  shr    $0x18,%eax
  sar    $0x10,%esi
  movzbl %sil,%esi
  mov    %rsi,-0x10(%rbp)
  mov    %rax,-0x8(%rbp)
  cmp    %r13,%rdx
  jae    L95
L56:
  mov    (%rdx),%eax
  mov    %eax,0x34(%rsp)
  test   $0x80808080,%eax
  je     L82
L95:
  mov    %rdx,(%rsp)
  jmp    L133
L110:
  mov    %edx,%esi
  and    $0x3ff,%edx
  mov    %r12,(%rsp)
  add    $0x10,%rbp
  sar    $0xa,%esi
  add    $0xdc00,%rdx
  add    $0xd7c0,%esi
  mov    %rdx,-0x8(%rbp)
  movslq %esi,%rsi
  mov    %rsi,-0x10(%rbp)
  jmp    L48
L19:
  mov    %rdx,(%rsp)
  mov    %rdx,%r12
  jmp    L81
L51:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
uint8_t const *_hs_text_decode_utf8_int(uint16_t *const dest, size_t *destoff, const uint8_t **src, const uint8_t *srcend, uint32_t *codepoint0, uint32_t *state0) {
  uint16_t *d = dest + *destoff;
  const uint8_t *s = *src, *last = *src;
  uint32_t state = *state0;
  uint32_t codepoint = *codepoint0;
  while (s < srcend) {
    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);
      }
      last = s;
    }
    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));
    }
    last = s;
  }
  *destoff = d - dest;
  *codepoint0 = codepoint;
  *state0 = state;
  *src = last;
  return s;
}
```