user: Please show me the C implementation that matches the assembly code listed below:

```asm
<GrMapUTF8_Unicode>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <assert@plt>
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <assert@plt>
  movq   $0x0,-0x18(%rbp)
  movq   $0x0,-0x8(%rbp)
  jmp    L146
L138:
  addq   $0x1,-0x8(%rbp)
  subq   $0x1,-0x30(%rbp)
L146:
  cmpq   $0x0,-0x30(%rbp)
  je     L21
  mov    -0x28(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  and    $0xc0,%eax
  cmp    $0x80,%eax
  je     L138
L21:
  cmpq   $0x0,-0x30(%rbp)
  jne    L124
  mov    $0x0,%eax
  jmp    L84
L124:
  mov    -0x28(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  js     L23
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  mov    -0x28(%rbp),%rdx
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  and    $0x7f,%eax
  mov    %rax,-0x18(%rbp)
  movq   $0x0,-0x10(%rbp)
  jmp    L109
L23:
  mov    -0x28(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbq %al,%rax
  shl    $0x18,%rax
  not    %rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <NumLeadingZeros@plt>
  sub    $0x1,%eax
  cltq
  mov    %rax,-0x10(%rbp)
  cmpq   $0x5,-0x10(%rbp)
  jbe    L40
  movq   $0x0,-0x18(%rbp)
  movq   $0x0,-0x10(%rbp)
  addq   $0x1,-0x8(%rbp)
  jmp    L109
L40:
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  mov    -0x28(%rbp),%rdx
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%edx
  mov    -0x10(%rbp),%rax
  mov    %eax,%ecx
  mov    $0x6,%eax
  sub    %ecx,%eax
  mov    $0x1,%esi
  mov    %eax,%ecx
  shl    %cl,%esi
  mov    %esi,%eax
  sub    $0x1,%eax
  and    %edx,%eax
  cltq
  mov    %rax,-0x18(%rbp)
  jmp    L151
L137:
  mov    -0x28(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  and    $0xc0,%eax
  cmp    $0x80,%eax
  je     L94
  mov    -0x38(%rbp),%rax
  mov    -0x8(%rbp),%rdx
  mov    %rdx,(%rax)
  mov    $0x0,%eax
  jmp    L84
L94:
  mov    -0x18(%rbp),%rax
  shl    $0x6,%rax
  mov    %rax,%rcx
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  mov    -0x28(%rbp),%rdx
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  and    $0x3f,%eax
  or     %rcx,%rax
  mov    %rax,-0x18(%rbp)
  subq   $0x1,-0x10(%rbp)
  subq   $0x1,-0x30(%rbp)
L151:
  cmpq   $0x0,-0x30(%rbp)
  je     L45
  cmpq   $0x0,-0x10(%rbp)
  jne    L137
L45:
  cmpq   $0x0,-0x10(%rbp)
  je     L109
  mov    -0x38(%rbp),%rax
  mov    -0x8(%rbp),%rdx
  mov    %rdx,(%rax)
  mov    $0x0,%eax
  jmp    L84
L109:
  mov    -0x38(%rbp),%rax
  mov    -0x8(%rbp),%rdx
  mov    %rdx,(%rax)
  mov    -0x18(%rbp),%rax
L84:
  leave
  ret
```

assistant: ```c
unsigned long GrMapUTF8_Unicode(const char *pcSrcChar, unsigned long ulCount, unsigned long *pulSkip) {
  unsigned long ulUnicode, ulToRead, ulIndex;
  assert(pulSkip);
  assert(pcSrcChar);
  ulUnicode = 0;
  ulIndex = 0;
  while (ulCount && ((unsigned char)pcSrcChar[ulIndex] & 0xC0) == 0x80) {
    ulIndex++;
    ulCount--;
  }
  if (!ulCount) {
    return (0);
  }
  if (!((unsigned char)(pcSrcChar[ulIndex]) & 0x80)) {
    ulUnicode = (unsigned char)(pcSrcChar[ulIndex++]) & 0x7F;
    ulToRead = 0;
  } else {
    ulToRead = NumLeadingZeros(~((unsigned long)pcSrcChar[ulIndex] << 24)) - 1;
    if (ulToRead > 5) {
      ulUnicode = 0;
      ulToRead = 0;
      ulIndex++;
    } else {
      ulUnicode = (unsigned char)pcSrcChar[ulIndex++] & ((1 << (6 - ulToRead)) - 1);
      while (ulCount && ulToRead) {
        if (((unsigned char)pcSrcChar[ulIndex] & 0xC0) != 0x80) {
          *pulSkip = ulIndex;
          return (0);
        } else {
          ulUnicode = ((ulUnicode << 6) | ((unsigned char)pcSrcChar[ulIndex++] & 0x3F));
          ulToRead--;
          ulCount--;
        }
      }
      if (ulToRead) {
        *pulSkip = ulIndex;
        return (0);
      }
    }
  }
  *pulSkip = ulIndex;
  return (ulUnicode);
}
```