user: What is the c source code of the assembly code below?

```asm
<utf8_to_utf16>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <utf8_widen_len@plt>
  mov    %rax,-0x10(%rbp)
  mov    -0x10(%rbp),%rax
  add    $0x1,%rax
  mov    $0x4,%edx
  mov    %rax,%rsi
  mov    $0x0,%edi
  call   <reallocarray@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %rax,-0x20(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  jmp    L49
L27:
  movzbl -0x29(%rbp),%eax
  test   %al,%al
  js     L6
  movzbl -0x29(%rbp),%eax
  mov    %eax,-0x28(%rbp)
  jmp    L13
L6:
  movzbl -0x29(%rbp),%eax
  and    $0xe0,%eax
  cmp    $0xc0,%eax
  jne    L18
  movzbl -0x29(%rbp),%eax
  shl    $0x6,%eax
  and    $0x7c0,%eax
  mov    %eax,%ecx
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  movzbl (%rax),%eax
  movsbl %al,%eax
  and    $0x3f,%eax
  or     %ecx,%eax
  mov    %eax,-0x28(%rbp)
  jmp    L13
L18:
  movzbl -0x29(%rbp),%eax
  and    $0xf0,%eax
  cmp    $0xe0,%eax
  jne    L40
  movzbl -0x29(%rbp),%eax
  shl    $0xc,%eax
  movzwl %ax,%edx
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  shl    $0x6,%eax
  and    $0xfc0,%eax
  or     %eax,%edx
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  and    $0x3f,%eax
  or     %edx,%eax
  mov    %eax,-0x28(%rbp)
  addq   $0x2,-0x18(%rbp)
  jmp    L13
L40:
  movzbl -0x29(%rbp),%eax
  shl    $0x12,%eax
  and    $0x1c0000,%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  shl    $0xc,%eax
  and    $0x3f000,%eax
  or     %eax,%edx
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  shl    $0x6,%eax
  and    $0xfc0,%eax
  or     %eax,%edx
  mov    -0x18(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  and    $0x3f,%eax
  or     %edx,%eax
  mov    %eax,-0x24(%rbp)
  addq   $0x3,-0x18(%rbp)
  mov    -0x24(%rbp),%eax
  sub    $0x10000,%eax
  shr    $0xa,%eax
  and    $0x3ff,%eax
  or     $0xd8,%ah
  mov    %eax,%ecx
  mov    -0x20(%rbp),%rax
  lea    0x4(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  mov    %ecx,%edx
  mov    %edx,(%rax)
  mov    -0x24(%rbp),%eax
  and    $0x3ff,%eax
  or     $0xdc,%ah
  mov    %eax,-0x28(%rbp)
L13:
  mov    -0x20(%rbp),%rax
  lea    0x4(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  mov    -0x28(%rbp),%edx
  mov    %edx,(%rax)
L49:
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  movzbl (%rax),%eax
  mov    %al,-0x29(%rbp)
  cmpb   $0x0,-0x29(%rbp)
  jne    L27
  mov    -0x20(%rbp),%rax
  movl   $0x0,(%rax)
  mov    -0x8(%rbp),%rax
  leave
  ret
```

assistant: ```c
wchar_t *utf8_to_utf16(const char utf8[]) {
  size_t size = utf8_widen_len(utf8);
  wchar_t *const utf16 = reallocarray(NULL, size + 1, sizeof(wchar_t));
  wchar_t *t = utf16;
  const char *p = utf8;
  unsigned char c;
  while ((c = *p++) != '\0') {
    wchar_t wc;
    if (c < 0x80) {
      wc = c;
    } else if ((c & 0xe0) == 0xc0) {
      wc = ((c & 0x1f) << 6) | ((*p++) & 0x3f);
    } else if ((c & 0xf0) == 0xe0) {
      wc = ((c & 0x0f) << 12) | ((p[0] & 0x3f) << 6) | (p[1] & 0x3f);
      p += 2;
    } else {
      const unsigned int r32 = ((c & 0x07) << 18) | ((p[0] & 0x3f) << 12) | ((p[1] & 0x3f) << 6) | (p[2] & 0x3f);
      p += 3;
      *t++ = 0xd800 | (((r32 - 0x10000) >> 10) & 0x3ff);
      wc = 0xdc00 | (r32 & 0x3ff);
    }
    *t++ = wc;
  }
  *t = 0;
  return utf16;
}
```