user: 请从给定的汇编指令推导出C源代码：

```asm
<arikkei_utf8_ucs2_strcpy>:
  endbr64
  mov    %rdi,%rcx
  mov    %rsi,%rdi
  movzbl (%rcx),%eax
  test   %al,%al
  je     L4
  mov    $0x1,%r8d
  jmp    L43
  nopl   (%rax)
L109:
  add    $0x1,%rcx
L88:
  mov    %ax,(%rsi)
  movzbl (%rcx),%eax
  lea    0x1(%r8),%edx
  test   %al,%al
  je     L59
L85:
  mov    %edx,%r8d
L43:
  lea    -0x1(%r8),%edx
  mov    %rdx,%r9
  lea    (%rdi,%rdx,2),%rsi
  test   %al,%al
  jns    L109
  mov    %eax,%r10d
  movzbl %al,%edx
  and    $0xffffffe0,%r10d
  cmp    $0xc0,%r10b
  je     L5
  mov    %eax,%r10d
  and    $0xfffffff0,%r10d
  cmp    $0xe0,%r10b
  je     L96
  mov    %eax,%edx
  and    $0xfffffff8,%edx
  cmp    $0xf0,%dl
  je     L19
  mov    %eax,%edx
  and    $0xfffffffc,%edx
  cmp    $0xf8,%dl
  je     L33
  and    $0xfffffffe,%eax
  cmp    $0xfc,%al
  jne    L16
  movzbl 0x3(%rcx),%edx
  movzbl 0x5(%rcx),%eax
  add    $0x6,%rcx
  shl    $0xc,%edx
  and    $0x3f,%eax
  or     %edx,%eax
  movzbl -0x2(%rcx),%edx
  shl    $0x6,%edx
  and    $0xfc0,%dx
  or     %edx,%eax
  lea    0x1(%r8),%edx
  mov    %ax,(%rsi)
  movzbl (%rcx),%eax
  test   %al,%al
  jne    L85
  nopl   0x0(%rax,%rax,1)
L59:
  mov    %r8d,%eax
  lea    (%rdi,%rax,2),%rsi
L137:
  xor    %eax,%eax
  mov    %ax,(%rsi)
  mov    %r8d,%eax
  ret
L5:
  mov    %edx,%eax
  movzbl 0x1(%rcx),%edx
  add    $0x2,%rcx
  shl    $0x6,%eax
  and    $0x7c0,%ax
  and    $0x3f,%edx
  or     %edx,%eax
  jmp    L88
  nopl   0x0(%rax,%rax,1)
L96:
  movzbl 0x2(%rcx),%eax
  shl    $0xc,%edx
  add    $0x3,%rcx
  and    $0x3f,%eax
  or     %eax,%edx
  movzbl -0x2(%rcx),%eax
  shl    $0x6,%eax
  and    $0xfc0,%ax
  or     %edx,%eax
  jmp    L88
  nopw   0x0(%rax,%rax,1)
L19:
  movzbl 0x1(%rcx),%edx
  movzbl 0x3(%rcx),%eax
  add    $0x4,%rcx
  shl    $0xc,%edx
  and    $0x3f,%eax
  or     %edx,%eax
  movzbl -0x2(%rcx),%edx
  shl    $0x6,%edx
  and    $0xfc0,%dx
  or     %edx,%eax
  jmp    L88
  nop
L33:
  movzbl 0x2(%rcx),%edx
  movzbl 0x4(%rcx),%eax
  add    $0x5,%rcx
  shl    $0xc,%edx
  and    $0x3f,%eax
  or     %edx,%eax
  movzbl -0x2(%rcx),%edx
  shl    $0x6,%edx
  and    $0xfc0,%dx
  or     %edx,%eax
  jmp    L88
L16:
  mov    %r9d,%r8d
  jmp    L137
L4:
  xor    %r8d,%r8d
  jmp    L137
```

assistant: ```c
unsigned int arikkei_utf8_ucs2_strcpy(const unsigned char *s, unsigned short *d) {
  unsigned int dp;
  dp = 0;
  while (*s) {
    if ((*s & 0x80) == 0x0) {
      d[dp++] = s[0];
      s += 1;
    } else if ((*s & 0xe0) == 0xc0) {
      d[dp++] = ((s[0] & 0x1f) << 6) | (s[1] & 0x3f);
      s += 2;
    } else if ((*s & 0xf0) == 0xe0) {
      d[dp++] = ((s[0] & 0x0f) << 12) | ((s[1] & 0x3f) << 6) | (s[2] & 0x3f);
      s += 3;
    } else if ((*s & 0xf8) == 0xf0) {
      d[dp++] = ((s[0] & 0x07) << 18) | ((s[1] & 0x3f) << 12) | ((s[2] & 0x3f) << 6) | (s[3] & 0x3f);
      s += 4;
    } else if ((*s & 0xfc) == 0xf8) {
      d[dp++] = ((s[0] & 0x03) << 24) | ((s[1] & 0x3f) << 18) | ((s[2] & 0x3f) << 12) | ((s[3] & 0x3f) << 6) | (s[4] & 0x3f);
      s += 5;
    } else if ((*s & 0xfe) == 0xfc) {
      d[dp++] = ((s[0] & 0x01) << 30) | ((s[1] & 0x3f) << 24) | ((s[2] & 0x3f) << 18) | ((s[3] & 0x3f) << 12) | ((s[4] & 0x3f) << 6) | (s[5] & 0x3f);
      s += 6;
    } else {
      break;
    }
  }
  d[dp] = 0;
  return dp;
}
```