user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<utf8_to_code>:
  endbr64
  mov    %rdi,%rax
  test   %rdi,%rdi
  je     L104
  movzbl (%rdi),%ecx
  test   %cl,%cl
  je     L125
  jns    L218
  cmp    $0xbf,%cl
  jbe    L57
  cmp    $0xdf,%cl
  ja     L184
  movzbl 0x1(%rdi),%edx
  lea    -0x80(%rdx),%eax
  cmp    $0x3f,%al
  ja     L57
  movzbl %cl,%eax
  add    $0xffffff80,%edx
  sub    $0xc0,%eax
  shl    $0x6,%eax
  or     %edx,%eax
  ret
  nop
L218:
  mov    $0x1,%eax
  test   %rsi,%rsi
  je     L225
  mov    %ecx,(%rsi)
  ret
  nopl   0x0(%rax)
L161:
  cmp    $0xfd,%cl
  ja     L57
  movzbl 0x1(%rdi),%edi
  lea    -0x80(%rdi),%edx
  cmp    $0x3f,%dl
  ja     L57
  movzbl 0x2(%rax),%esi
  lea    -0x80(%rsi),%edx
  cmp    $0x3f,%dl
  ja     L57
  movzbl 0x3(%rax),%r8d
  lea    -0x80(%r8),%edx
  cmp    $0x3f,%dl
  ja     L57
  movzbl 0x4(%rax),%edx
  lea    -0x80(%rdx),%r9d
  cmp    $0x3f,%r9b
  ja     L57
  movzbl 0x5(%rax),%r9d
  lea    -0x80(%r9),%eax
  cmp    $0x3f,%al
  ja     L57
  mov    %ecx,%eax
  shl    $0x18,%edi
  add    $0xffffff80,%edx
  lea    -0x80000000(%rdi),%ecx
  shl    $0x1e,%eax
  shl    $0x6,%edx
  or     %ecx,%eax
  movzbl %r9b,%ecx
  add    $0xffffff80,%ecx
  or     %ecx,%eax
  movzbl %sil,%ecx
  add    $0xffffff80,%ecx
  shl    $0x12,%ecx
  or     %ecx,%eax
  movzbl %r8b,%ecx
  add    $0xffffff80,%ecx
  shl    $0xc,%ecx
  or     %ecx,%eax
  or     %edx,%eax
L225:
  ret
  nopl   0x0(%rax,%rax,1)
L125:
  mov    D17(%rip),%rax
  movq   $0x0,(%rax)
  xor    %eax,%eax
  ret
  nopl   0x0(%rax)
L184:
  cmp    $0xef,%cl
  ja     L219
  movzbl 0x1(%rdi),%edx
  lea    -0x80(%rdx),%esi
  cmp    $0x3f,%sil
  jbe    L220
L57:
  mov    D4(%rip),%rax
  mov    (%rax),%rdx
  mov    D17(%rip),%rax
  mov    %rdx,(%rax)
  xor    %eax,%eax
  ret
  nopl   (%rax)
L104:
  mov    D38(%rip),%rax
  mov    (%rax),%rdx
  mov    D17(%rip),%rax
  mov    %rdx,(%rax)
  xor    %eax,%eax
  ret
  nop
L219:
  cmp    $0xf7,%cl
  jbe    L208
  cmp    $0xfb,%cl
  ja     L161
  movzbl 0x1(%rdi),%edx
  lea    -0x80(%rdx),%esi
  cmp    $0x3f,%sil
  ja     L57
  movzbl 0x2(%rdi),%esi
  lea    -0x80(%rsi),%edi
  cmp    $0x3f,%dil
  ja     L57
  movzbl 0x3(%rax),%edi
  lea    -0x80(%rdi),%r8d
  cmp    $0x3f,%r8b
  ja     L57
  movzbl 0x4(%rax),%r8d
  lea    -0x80(%r8),%eax
  cmp    $0x3f,%al
  ja     L57
  mov    %ecx,%eax
  add    $0xffffff80,%edx
  shl    $0x18,%eax
  shl    $0x12,%edx
  add    $0x8000000,%eax
  or     %edx,%eax
  movzbl %r8b,%edx
  add    $0xffffff80,%edx
  or     %edx,%eax
  movzbl %sil,%edx
  add    $0xffffff80,%edx
  shl    $0xc,%edx
  or     %edx,%eax
  movzbl %dil,%edx
  add    $0xffffff80,%edx
  shl    $0x6,%edx
  or     %edx,%eax
  ret
  nop
L220:
  movzbl 0x2(%rdi),%esi
  lea    -0x80(%rsi),%eax
  cmp    $0x3f,%al
  ja     L57
  movzbl %cl,%eax
  add    $0xffffff80,%edx
  sub    $0xe0,%eax
  shl    $0x6,%edx
  shl    $0xc,%eax
  or     %edx,%eax
  movzbl %sil,%edx
  add    $0xffffff80,%edx
  or     %edx,%eax
  ret
  nopl   0x0(%rax)
L208:
  movzbl 0x1(%rdi),%edx
  lea    -0x80(%rdx),%esi
  cmp    $0x3f,%sil
  ja     L57
  movzbl 0x2(%rdi),%esi
  lea    -0x80(%rsi),%edi
  cmp    $0x3f,%dil
  ja     L57
  movzbl 0x3(%rax),%edi
  lea    -0x80(%rdi),%eax
  cmp    $0x3f,%al
  ja     L57
  movzbl %cl,%eax
  add    $0xffffff80,%edx
  sub    $0xf0,%eax
  shl    $0xc,%edx
  shl    $0x12,%eax
  or     %edx,%eax
  movzbl %dil,%edx
  add    $0xffffff80,%edx
  or     %edx,%eax
  movzbl %sil,%edx
  add    $0xffffff80,%edx
  shl    $0x6,%edx
  or     %edx,%eax
  ret
```

assistant: ```c
size_t utf8_to_code(const unsigned char *const buffer, unsigned int *const codeptr) {
  if (!buffer) {
    errno = EINVAL;
    return 0;
  }
  if (*buffer == 0U) {
    errno = 0;
    return 0;
  }
  if (*buffer < 128U) {
    if (codeptr)
      *codeptr = buffer[0];
    return 1;
  }
  if (*buffer < 192U) {
    errno = EILSEQ;
    return 0;
  }
  if (*buffer < 224U) {
    if (buffer[1] >= 128U && buffer[1] < 192U)
      return ((buffer[0] - 192U) << 6U) | (buffer[1] - 128U);
    errno = EILSEQ;
    return 0;
  }
  if (*buffer < 240U) {
    if (buffer[1] >= 128U && buffer[1] < 192U && buffer[2] >= 128U && buffer[2] < 192U)
      return ((buffer[0] - 224U) << 12U) | ((buffer[1] - 128U) << 6U) | (buffer[2] - 128U);
    errno = EILSEQ;
    return 0;
  }
  if (*buffer < 248U) {
    if (buffer[1] >= 128U && buffer[1] < 192U && buffer[2] >= 128U && buffer[2] < 192U && buffer[3] >= 128U && buffer[3] < 192U)
      return ((buffer[0] - 240U) << 18U) | ((buffer[1] - 128U) << 12U) | ((buffer[2] - 128U) << 6U) | (buffer[3] - 128U);
    errno = EILSEQ;
    return 0;
  }
  if (*buffer < 252U) {
    if (buffer[1] >= 128U && buffer[1] < 192U && buffer[2] >= 128U && buffer[2] < 192U && buffer[3] >= 128U && buffer[3] < 192U && buffer[4] >= 128U && buffer[4] < 192U)
      return ((buffer[0] - 248U) << 24U) | ((buffer[1] - 128U) << 18U) | ((buffer[2] - 128U) << 12U) | ((buffer[3] - 128U) << 6U) | (buffer[4] - 128U);
    errno = EILSEQ;
    return 0;
  }
  if (*buffer < 254U) {
    if (buffer[1] >= 128U && buffer[1] < 192U && buffer[2] >= 128U && buffer[2] < 192U && buffer[3] >= 128U && buffer[3] < 192U && buffer[4] >= 128U && buffer[4] < 192U && buffer[5] >= 128U && buffer[5] < 192U)
      return ((buffer[0] - 252U) << 30U) | ((buffer[1] - 128U) << 24U) | ((buffer[2] - 128U) << 18U) | ((buffer[3] - 128U) << 12U) | ((buffer[4] - 128U) << 6U) | (buffer[5] - 128U);
    errno = EILSEQ;
    return 0;
  }
  errno = EILSEQ;
  return 0;
}
```