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

```asm
<midpUTF8Decode>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    %ecx,-0x20(%rbp)
  movl   $0x0,-0x8(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L157
L85:
  mov    -0x4(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x4(%rbp)
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0x9(%rbp)
  movzbl -0x9(%rbp),%eax
  test   %al,%al
  js     L171
  mov    -0x8(%rbp),%eax
  cltq
  lea    (%rax,%rax,1),%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x9(%rbp),%eax
  mov    %ax,(%rdx)
  jmp    L87
L171:
  movzbl -0x9(%rbp),%eax
  and    $0xe0,%eax
  cmp    $0xc0,%eax
  jne    L124
  movzbl -0x9(%rbp),%eax
  shl    $0x6,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%eax
  cltq
  lea    (%rax,%rax,1),%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  and    $0x7c0,%dx
  mov    %dx,(%rax)
  mov    -0x4(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jne    L12
  mov    $0xffffffff,%eax
  jmp    L34
L12:
  mov    -0x4(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x4(%rbp)
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  and    $0x3f,%eax
  mov    %eax,%ecx
  mov    -0x8(%rbp),%eax
  cltq
  lea    (%rax,%rax,1),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzwl (%rax),%edx
  mov    -0x8(%rbp),%eax
  cltq
  lea    (%rax,%rax,1),%rsi
  mov    -0x28(%rbp),%rax
  add    %rsi,%rax
  add    %ecx,%edx
  mov    %dx,(%rax)
  jmp    L87
L124:
  movzbl -0x9(%rbp),%eax
  and    $0xf0,%eax
  cmp    $0xe0,%eax
  jne    L77
  movzbl -0x9(%rbp),%eax
  shl    $0xc,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%eax
  cltq
  lea    (%rax,%rax,1),%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  mov    %dx,(%rax)
  mov    -0x4(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jne    L51
  mov    $0xfffffffe,%eax
  jmp    L34
L51:
  mov    -0x4(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x4(%rbp)
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x6,%eax
  and    $0xfc0,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%eax
  cltq
  lea    (%rax,%rax,1),%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  movzwl (%rax),%ecx
  mov    %edx,%esi
  mov    -0x8(%rbp),%eax
  cltq
  lea    (%rax,%rax,1),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  lea    (%rcx,%rsi,1),%edx
  mov    %dx,(%rax)
  mov    -0x4(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jne    L54
  mov    $0xfffffffd,%eax
  jmp    L34
L54:
  mov    -0x4(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x4(%rbp)
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  and    $0x3f,%eax
  mov    %eax,%ecx
  mov    -0x8(%rbp),%eax
  cltq
  lea    (%rax,%rax,1),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzwl (%rax),%edx
  mov    -0x8(%rbp),%eax
  cltq
  lea    (%rax,%rax,1),%rsi
  mov    -0x28(%rbp),%rax
  add    %rsi,%rax
  add    %ecx,%edx
  mov    %dx,(%rax)
  jmp    L87
L77:
  mov    $0xfffffffc,%eax
  jmp    L34
L87:
  addl   $0x1,-0x8(%rbp)
L157:
  mov    -0x8(%rbp),%eax
  cmp    -0x20(%rbp),%eax
  jge    L93
  mov    -0x4(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jl     L85
L93:
  mov    -0x4(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jge    L6
  mov    $0xfffffffb,%eax
  jmp    L34
L6:
  mov    -0x8(%rbp),%eax
L34:
  pop    %rbp
  ret
```

assistant: ```c
int midpUTF8Decode(unsigned char *pUtf8, int utf8Len, unsigned short *pUcs2, int ucs2Len) {
  int i;
  int j;
  unsigned char current;
  for (i = 0, j = 0; i < ucs2Len && j < utf8Len; i++) {
    current = pUtf8[j++];
    if (current < 0x80) {
      pUcs2[i] = (unsigned short)current;
      continue;
    }
    if ((current & 0xE0) == 0xC0) {
      pUcs2[i] = (unsigned short)(current & 0x1F) << 6;
      if (j == utf8Len) {
        return -1;
      }
      pUcs2[i] += (unsigned short)(pUtf8[j++] & 0x3F);
      continue;
    }
    if ((current & 0xF0) == 0xE0) {
      pUcs2[i] = (unsigned short)(current & 0x0F) << 12;
      if (j == utf8Len) {
        return -2;
      }
      pUcs2[i] += (unsigned short)(pUtf8[j++] & 0x3F) << 6;
      if (j == utf8Len) {
        return -3;
      }
      pUcs2[i] += (unsigned short)(pUtf8[j++] & 0x3F);
      continue;
    }
    return -4;
  }
  if (j < utf8Len) {
    return -5;
  }
  return i;
}
```