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

```asm
<u8_mbtouc_aux>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0x1(%rbp)
  cmpb   $0xc1,-0x1(%rbp)
  jbe    L46
  cmpb   $0xdf,-0x1(%rbp)
  ja     L30
  cmpq   $0x1,-0x28(%rbp)
  jbe    L11
  mov    -0x20(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  xor    $0xffffff80,%eax
  cmp    $0x3f,%al
  ja     L46
  movzbl -0x1(%rbp),%eax
  shl    $0x6,%eax
  and    $0x7c0,%eax
  mov    %eax,%edx
  mov    -0x20(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  xor    $0xffffff80,%eax
  movzbl %al,%eax
  or     %eax,%edx
  mov    -0x18(%rbp),%rax
  mov    %edx,(%rax)
  mov    $0x2,%eax
  jmp    L246
L11:
  mov    -0x18(%rbp),%rax
  movl   $0xfffd,(%rax)
  mov    -0x28(%rbp),%rax
  jmp    L246
L30:
  cmpb   $0xef,-0x1(%rbp)
  ja     L42
  cmpq   $0x2,-0x28(%rbp)
  jbe    L77
  mov    -0x20(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  xor    $0xffffff80,%eax
  cmp    $0x3f,%al
  ja     L46
  mov    -0x20(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  xor    $0xffffff80,%eax
  cmp    $0x3f,%al
  ja     L46
  cmpb   $0xe0,-0x1(%rbp)
  ja     L240
  mov    -0x20(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x9f,%al
  jbe    L46
L240:
  movzbl -0x1(%rbp),%eax
  shl    $0xc,%eax
  movzwl %ax,%edx
  mov    -0x20(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  xor    $0xffffff80,%eax
  movzbl %al,%eax
  shl    $0x6,%eax
  or     %eax,%edx
  mov    -0x20(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  xor    $0xffffff80,%eax
  movzbl %al,%eax
  or     %eax,%edx
  mov    -0x18(%rbp),%rax
  mov    %edx,(%rax)
  mov    $0x3,%eax
  jmp    L246
L77:
  mov    -0x18(%rbp),%rax
  movl   $0xfffd,(%rax)
  mov    -0x28(%rbp),%rax
  jmp    L246
L42:
  cmpb   $0xf7,-0x1(%rbp)
  ja     L46
  cmpq   $0x3,-0x28(%rbp)
  jbe    L111
  mov    -0x20(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  xor    $0xffffff80,%eax
  cmp    $0x3f,%al
  ja     L46
  mov    -0x20(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  xor    $0xffffff80,%eax
  cmp    $0x3f,%al
  ja     L46
  mov    -0x20(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  xor    $0xffffff80,%eax
  cmp    $0x3f,%al
  ja     L46
  cmpb   $0xf0,-0x1(%rbp)
  ja     L68
  mov    -0x20(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x8f,%al
  jbe    L46
L68:
  cmpb   $0xf3,-0x1(%rbp)
  jbe    L78
  cmpb   $0xf4,-0x1(%rbp)
  jne    L46
  mov    -0x20(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x8f,%al
  ja     L46
L78:
  movzbl -0x1(%rbp),%eax
  shl    $0x12,%eax
  and    $0x1c0000,%eax
  mov    %eax,%edx
  mov    -0x20(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  xor    $0xffffff80,%eax
  movzbl %al,%eax
  shl    $0xc,%eax
  or     %eax,%edx
  mov    -0x20(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  xor    $0xffffff80,%eax
  movzbl %al,%eax
  shl    $0x6,%eax
  or     %eax,%edx
  mov    -0x20(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  xor    $0xffffff80,%eax
  movzbl %al,%eax
  or     %eax,%edx
  mov    -0x18(%rbp),%rax
  mov    %edx,(%rax)
  mov    $0x4,%eax
  jmp    L246
L111:
  mov    -0x18(%rbp),%rax
  movl   $0xfffd,(%rax)
  mov    -0x28(%rbp),%rax
  jmp    L246
L46:
  mov    -0x18(%rbp),%rax
  movl   $0xfffd,(%rax)
  mov    $0x1,%eax
L246:
  pop    %rbp
  ret
```

assistant: ```c
int u8_mbtouc_aux(unsigned int *puc, const unsigned char *s, size_t n) {
  unsigned char c = *s;
  if (c >= 0xc2) {
    if (c < 0xe0) {
      if (n >= 2) {
        if ((s[1] ^ 0x80) < 0x40) {
          *puc = ((unsigned int)(c & 0x1f) << 6) | (unsigned int)(s[1] ^ 0x80);
          return 2;
        }
      } else {
        *puc = 0xfffd;
        return n;
      }
    } else if (c < 0xf0) {
      if (n >= 3) {
        if ((s[1] ^ 0x80) < 0x40 && (s[2] ^ 0x80) < 0x40 && (c >= 0xe1 || s[1] >= 0xa0)) {
          *puc = ((unsigned int)(c & 0x0f) << 12) | ((unsigned int)(s[1] ^ 0x80) << 6) | (unsigned int)(s[2] ^ 0x80);
          return 3;
        }
      } else {
        *puc = 0xfffd;
        return n;
      }
    } else if (c < 0xf8) {
      if (n >= 4) {
        if ((s[1] ^ 0x80) < 0x40 && (s[2] ^ 0x80) < 0x40 && (s[3] ^ 0x80) < 0x40 && (c >= 0xf1 || s[1] >= 0x90) && (c < 0xf4 || (c == 0xf4 && s[1] < 0x90))) {
          *puc = ((unsigned int)(c & 0x07) << 18) | ((unsigned int)(s[1] ^ 0x80) << 12) | ((unsigned int)(s[2] ^ 0x80) << 6) | (unsigned int)(s[3] ^ 0x80);
          return 4;
        }
      } else {
        *puc = 0xfffd;
        return n;
      }
    }
  }
  *puc = 0xfffd;
  return 1;
}
```