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    L175
  cmpb   $0xdf,-0x1(%rbp)
  ja     L155
  cmpq   $0x1,-0x28(%rbp)
  jbe    L17
  mov    -0x20(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  xor    $0xffffff80,%eax
  cmp    $0x3f,%al
  ja     L175
  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    L90
L17:
  mov    -0x18(%rbp),%rax
  movl   $0xfffd,(%rax)
  mov    -0x28(%rbp),%rax
  jmp    L90
L155:
  cmpb   $0xef,-0x1(%rbp)
  ja     L21
  cmpq   $0x2,-0x28(%rbp)
  jbe    L102
  mov    -0x20(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  xor    $0xffffff80,%eax
  cmp    $0x3f,%al
  ja     L175
  mov    -0x20(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  xor    $0xffffff80,%eax
  cmp    $0x3f,%al
  ja     L175
  cmpb   $0xe0,-0x1(%rbp)
  ja     L30
  mov    -0x20(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x9f,%al
  jbe    L175
L30:
  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    L90
L102:
  mov    -0x18(%rbp),%rax
  movl   $0xfffd,(%rax)
  mov    -0x28(%rbp),%rax
  jmp    L90
L21:
  cmpb   $0xf7,-0x1(%rbp)
  ja     L175
  cmpq   $0x3,-0x28(%rbp)
  jbe    L83
  mov    -0x20(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  xor    $0xffffff80,%eax
  cmp    $0x3f,%al
  ja     L175
  mov    -0x20(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  xor    $0xffffff80,%eax
  cmp    $0x3f,%al
  ja     L175
  mov    -0x20(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  xor    $0xffffff80,%eax
  cmp    $0x3f,%al
  ja     L175
  cmpb   $0xf0,-0x1(%rbp)
  ja     L199
  mov    -0x20(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x8f,%al
  jbe    L175
L199:
  cmpb   $0xf3,-0x1(%rbp)
  jbe    L159
  cmpb   $0xf4,-0x1(%rbp)
  jne    L175
  mov    -0x20(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x8f,%al
  ja     L175
L159:
  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    L90
L83:
  mov    -0x18(%rbp),%rax
  movl   $0xfffd,(%rax)
  mov    -0x28(%rbp),%rax
  jmp    L90
L175:
  mov    -0x18(%rbp),%rax
  movl   $0xfffd,(%rax)
  mov    $0x1,%eax
L90:
  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;
}
```