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

```asm
<u8_mbtouc_aux>:
  endbr64
  mov    %rdi,%rcx
  movzbl (%rsi),%edi
  cmp    $0xc1,%dil
  jbe    L296
  cmp    $0xdf,%dil
  ja     L116
  cmp    $0x1,%rdx
  jbe    L228
  movzbl 0x1(%rsi),%esi
  add    $0xffffff80,%esi
  mov    $0xfffd,%edx
  mov    $0x1,%eax
  cmp    $0x3f,%sil
  ja     L76
  mov    %edi,%edx
  shl    $0x6,%edx
  and    $0x7c0,%edx
  movzbl %sil,%esi
  or     %esi,%edx
  mov    $0x2,%eax
  jmp    L76
L228:
  mov    %edx,%eax
  mov    $0xfffd,%edx
  jmp    L76
L116:
  cmp    $0xef,%dil
  ja     L322
  cmp    $0x2,%rdx
  jbe    L224
  movzbl 0x1(%rsi),%eax
  lea    -0x80(%rax),%r8d
  cmp    $0x3f,%r8b
  ja     L189
  movzbl 0x2(%rsi),%esi
  add    $0xffffff80,%esi
  cmp    $0x3f,%sil
  ja     L123
  cmp    $0x9f,%al
  ja     L14
  mov    $0xfffd,%edx
  mov    $0x1,%eax
  cmp    $0xe0,%dil
  jbe    L76
L14:
  mov    %edi,%edx
  shl    $0xc,%edx
  and    $0xf000,%edx
  movzbl %r8b,%r8d
  shl    $0x6,%r8d
  or     %r8d,%edx
  movzbl %sil,%esi
  or     %esi,%edx
  mov    $0x3,%eax
  jmp    L76
L224:
  mov    %edx,%eax
  mov    $0xfffd,%edx
  jmp    L76
L322:
  cmp    $0xf7,%dil
  ja     L305
  cmp    $0x3,%rdx
  jbe    L61
  movzbl 0x1(%rsi),%eax
  lea    -0x80(%rax),%r8d
  cmp    $0x3f,%r8b
  ja     L12
  movzbl 0x2(%rsi),%edx
  add    $0xffffff80,%edx
  cmp    $0x3f,%dl
  ja     L257
  movzbl 0x3(%rsi),%r9d
  add    $0xffffff80,%r9d
  cmp    $0x3f,%r9b
  ja     L253
  cmp    $0x8f,%al
  ja     L324
  cmp    $0xf0,%dil
  jbe    L335
L324:
  cmp    $0xf3,%dil
  jbe    L313
  cmp    $0x8f,%al
  ja     L245
  cmp    $0xf4,%dil
  je     L313
L245:
  mov    $0xfffd,%edx
  mov    $0x1,%eax
  jmp    L76
L313:
  mov    %edi,%eax
  shl    $0x12,%eax
  and    $0x1c0000,%eax
  movzbl %r8b,%esi
  shl    $0xc,%esi
  or     %esi,%eax
  movzbl %r9b,%r9d
  or     %r9d,%eax
  movzbl %dl,%edx
  shl    $0x6,%edx
  or     %eax,%edx
  mov    $0x4,%eax
  jmp    L76
L61:
  mov    %edx,%eax
  mov    $0xfffd,%edx
  jmp    L76
L296:
  mov    $0xfffd,%edx
  mov    $0x1,%eax
L76:
  mov    %edx,(%rcx)
  ret
L189:
  mov    $0xfffd,%edx
  mov    $0x1,%eax
  jmp    L76
L123:
  mov    $0xfffd,%edx
  mov    $0x1,%eax
  jmp    L76
L305:
  mov    $0xfffd,%edx
  mov    $0x1,%eax
  jmp    L76
L12:
  mov    $0xfffd,%edx
  mov    $0x1,%eax
  jmp    L76
L257:
  mov    $0xfffd,%edx
  mov    $0x1,%eax
  jmp    L76
L253:
  mov    $0xfffd,%edx
  mov    $0x1,%eax
  jmp    L76
L335:
  mov    $0xfffd,%edx
  mov    $0x1,%eax
  jmp    L76
```

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