user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<convertFromUTF8ToUTF16>:
  endbr64
  mov    %rdi,%r9
  mov    %rdx,%r8
  mov    %rsi,%rdi
  xor    %ecx,%ecx
  movsbq (%r9),%rax
  mov    (%rdx),%rsi
  test   %al,%al
  je     L186
  test   %rsi,%rsi
  jg     L27
  jmp    L186
  nopl   0x0(%rax,%rax,1)
L166:
  lea    (%rdi,%rcx,8),%rdx
L60:
  mov    %rax,(%rdx)
  add    $0x2,%rcx
L173:
  movsbq (%r9),%rax
  cmp    %rsi,%rcx
  jge    L186
L164:
  test   %al,%al
  je     L186
L27:
  test   %al,%al
  jns    L166
  mov    %eax,%r10d
  movsbl %al,%edx
  and    $0xe0,%r10d
  cmp    $0xc0,%r10d
  je     L68
  mov    %edx,%eax
  and    $0xf0,%eax
  cmp    $0xe0,%eax
  mov    %edx,%eax
  je     L79
  and    $0xf8,%eax
  cmp    $0xf0,%eax
  jne    L173
  mov    %edx,%eax
  shl    $0x12,%edx
  lea    0x3(%r9),%r10
  shl    $0xc,%eax
  and    $0x1c0000,%edx
  and    $0x3f000,%eax
  or     %eax,%edx
  movsbl 0x1(%r9),%eax
  shl    $0x6,%eax
  and    $0xfc0,%eax
  or     %eax,%edx
  movzbl 0x2(%r9),%eax
  movslq %edx,%rdx
  and    $0x3f,%eax
  or     %rdx,%rax
  lea    (%rdi,%rcx,8),%rdx
  cmp    $0xd7ff,%rax
  jle    L72
  cmp    $0xffff,%rax
  jle    L154
  lea    -0x10000(%rax),%r9
  and    $0x3ff,%eax
  sar    $0xa,%r9
  add    $0xdc00,%rax
  add    $0xd800,%r9
  mov    %r9,(%rdx)
  lea    0x2(%rcx),%r9
  cmp    %r9,%rsi
  jle    L67
  mov    %r10,%r9
  add    $0x4,%rcx
  mov    %rax,0x8(%rdx)
  movsbq (%r9),%rax
  cmp    %rsi,%rcx
  jl     L164
L186:
  mov    %rcx,(%r8)
  ret
  nopl   0x0(%rax)
L79:
  shl    $0xc,%eax
  shl    $0x6,%edx
  lea    0x2(%r9),%r10
  movzwl %ax,%eax
  and    $0xfc0,%edx
  or     %eax,%edx
  movzbl 0x1(%r9),%eax
  movslq %edx,%rdx
  and    $0x3f,%eax
  or     %rdx,%rax
  cmp    $0xd7ff,%rax
  jle    L11
L154:
  mov    %r10,%r9
  jmp    L173
  nopl   0x0(%rax,%rax,1)
L68:
  shl    $0x6,%edx
  and    $0x3f,%eax
  add    $0x1,%r9
  and    $0x7c0,%edx
  or     %rdx,%rax
  jmp    L166
L67:
  movq   $0x0,(%rdx)
  jmp    L186
L11:
  lea    (%rdi,%rcx,8),%rdx
  mov    %r10,%r9
  jmp    L60
L72:
  mov    %r10,%r9
  jmp    L60
```

assistant: ```c
void convertFromUTF8ToUTF16(char *source, uint16_t *destination, uint32_t *destinationByteLen) {
  uint32_t desti = 0;
  uint32_t destinationMaxLen = *destinationByteLen;
  while (*source && desti < destinationMaxLen) {
    char a = *source;
    uint32_t codepoint;
    if (a == 0) {
      break;
    } else if ((a & 0x80) == 0) {
      codepoint = a;
    } else if ((a & 0xE0) == 0xC0) {
      codepoint = (a & 0x1F) << 6;
      a = *(source++);
      codepoint |= (a & 0x3F);
    } else if ((a & 0xF0) == 0xE0) {
      codepoint = (a & 0x0F) << 12;
      a = *(source++);
      codepoint |= (a & 0x3F) << 6;
      a = *(source++);
      codepoint |= (a & 0x3F);
    } else if ((a & 0xF8) == 0xF0) {
      codepoint = (a & 0x07) << 18;
      a = *(source++);
      codepoint |= (a & 0x3F) << 12;
      a = *(source++);
      codepoint |= (a & 0x3F) << 6;
      a = *(source++);
      codepoint |= (a & 0x3F);
    } else {
      continue;
    }
    uint16_t *dst = (uint16_t *)((char *)destination) + desti;
    if (codepoint <= 0xD7FF) {
      *dst = codepoint;
      desti += 2;
    } else if (codepoint >= 0x10000) {
      codepoint -= 0x10000;
      uint16_t first = (codepoint >> 10) + 0xD800;
      uint16_t second = (codepoint & 0x3FF) + 0xDC00;
      *dst = first;
      desti += 2;
      if (desti >= destinationMaxLen) {
        *dst = 0;
        desti -= 2;
        break;
      }
      dst++;
      *dst = second;
      desti += 2;
    }
  }
  *destinationByteLen = desti;
}
```