user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<u8_mbtouc_aux>:
  endbr64
  mov    %rdi,%rcx
  movzbl (%rsi),%edi
  cmp    $0xc1,%dil
  jbe    L33
  cmp    $0xdf,%dil
  ja     L50
  cmp    $0x1,%rdx
  jbe    L35
  movzbl 0x1(%rsi),%esi
  mov    $0xfffd,%edx
  mov    $0x1,%eax
  add    $0xffffff80,%esi
  cmp    $0x3f,%sil
  ja     L154
  mov    %edi,%edx
  movzbl %sil,%esi
  mov    $0x2,%eax
  shl    $0x6,%edx
  and    $0x7c0,%edx
  or     %esi,%edx
  jmp    L154
  nop
L50:
  cmp    $0xef,%dil
  ja     L54
  cmp    $0x2,%rdx
  jbe    L35
  movzbl 0x1(%rsi),%r9d
  lea    -0x80(%r9),%r8d
  cmp    $0x3f,%r8b
  jbe    L93
  nopl   0x0(%rax,%rax,1)
L33:
  mov    $0xfffd,%edx
  mov    $0x1,%eax
L154:
  mov    %edx,(%rcx)
  ret
  nopl   (%rax)
L54:
  cmp    $0xf7,%dil
  ja     L33
  cmp    $0x3,%rdx
  jbe    L35
  movzbl 0x1(%rsi),%eax
  lea    -0x80(%rax),%r8d
  cmp    $0x3f,%r8b
  ja     L33
  movzbl 0x2(%rsi),%edx
  add    $0xffffff80,%edx
  cmp    $0x3f,%dl
  ja     L33
  movzbl 0x3(%rsi),%r9d
  add    $0xffffff80,%r9d
  cmp    $0x3f,%r9b
  ja     L33
  cmp    $0xf0,%dil
  jne    L227
  cmp    $0x8f,%al
  jbe    L33
L227:
  cmp    $0xf3,%dil
  jbe    L38
  cmp    $0xf4,%dil
  jne    L33
  cmp    $0x8f,%al
  ja     L33
L38:
  mov    %edi,%eax
  movzbl %r8b,%esi
  movzbl %r9b,%r9d
  movzbl %dl,%edx
  shl    $0x12,%eax
  shl    $0xc,%esi
  and    $0x1c0000,%eax
  shl    $0x6,%edx
  or     %esi,%eax
  or     %r9d,%eax
  or     %eax,%edx
  mov    $0x4,%eax
  jmp    L154
L35:
  mov    %edx,%eax
  mov    $0xfffd,%edx
  mov    %edx,(%rcx)
  ret
  nopw   0x0(%rax,%rax,1)
L93:
  movzbl 0x2(%rsi),%esi
  add    $0xffffff80,%esi
  cmp    $0x3f,%sil
  ja     L33
  cmp    $0xe0,%dil
  jne    L135
  mov    $0xfffd,%edx
  mov    $0x1,%eax
  cmp    $0x9f,%r9b
  jbe    L154
L135:
  mov    %edi,%edx
  movzbl %r8b,%r8d
  movzbl %sil,%esi
  mov    $0x3,%eax
  shl    $0xc,%edx
  shl    $0x6,%r8d
  and    $0xf000,%edx
  or     %r8d,%edx
  or     %esi,%edx
  jmp    L154
```

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;
}
```