user: 请从给定的汇编指令推导出C源代码:

```asm
<vtkParse_DecodeUtf8>:
  endbr64
  mov    %rdi,%rdx
  mov    %rsi,%rcx
  mov    (%rdi),%rdi
  lea    0x1(%rdi),%r8
  movzbl (%rdi),%eax
  movzbl %al,%r9d
  mov    $0x1,%esi
  test   %al,%al
  js     L58
L4:
  test   %rcx,%rcx
  je     L27
  xor    $0x1,%esi
  mov    %esi,(%rcx)
L27:
  mov    %r8,(%rdx)
  mov    %r9d,%eax
  ret
L58:
  mov    %eax,%esi
  and    $0xffffffe0,%esi
  cmp    $0xc0,%sil
  je     L42
  mov    %eax,%esi
  and    $0xfffffff0,%esi
  cmp    $0xe0,%sil
  je     L72
  mov    %eax,%r10d
  and    $0xfffffff8,%r10d
  mov    $0x0,%esi
  cmp    $0xf0,%r10b
  jne    L4
  and    $0x7,%eax
  shl    $0x6,%eax
  movzbl 0x1(%rdi),%esi
  mov    %esi,%edi
  and    $0xffffffc0,%edi
  cmp    $0x80,%dil
  sete   %r10b
  movzbl %r10b,%r10d
  add    %r8,%r10
  and    $0x3f,%esi
  or     %eax,%esi
  shl    $0x6,%esi
  movzbl (%r10),%eax
  mov    %eax,%edi
  and    $0xffffffc0,%edi
  cmp    $0x80,%dil
  sete   %dil
  movzbl %dil,%edi
  add    %rdi,%r10
  mov    %eax,%edi
  and    $0x3f,%edi
  or     %esi,%edi
  shl    $0x6,%edi
  movzbl (%r10),%eax
  mov    %eax,%esi
  and    $0xffffffc0,%esi
  cmp    $0x80,%sil
  sete   %sil
  movzbl %sil,%esi
  sete   %r11b
  movzbl %r11b,%r11d
  add    %r11,%r10
  and    $0x3f,%eax
  or     %edi,%eax
  jmp    L63
L42:
  and    $0x1f,%eax
  shl    $0x6,%eax
  movzbl 0x1(%rdi),%edi
  mov    %edi,%esi
  and    $0xffffffc0,%esi
  cmp    $0x80,%sil
  sete   %sil
  movzbl %sil,%esi
  sete   %r10b
  movzbl %r10b,%r10d
  add    %r8,%r10
  and    $0x3f,%edi
  or     %edi,%eax
L63:
  test   %esi,%esi
  cmovne %eax,%r9d
  cmovne %r10,%r8
  jmp    L4
L72:
  and    $0xf,%eax
  shl    $0x6,%eax
  movzbl 0x1(%rdi),%esi
  mov    %esi,%edi
  and    $0xffffffc0,%edi
  cmp    $0x80,%dil
  sete   %r10b
  movzbl %r10b,%r10d
  add    %r8,%r10
  mov    %esi,%edi
  and    $0x3f,%edi
  or     %eax,%edi
  shl    $0x6,%edi
  movzbl (%r10),%eax
  mov    %eax,%esi
  and    $0xffffffc0,%esi
  cmp    $0x80,%sil
  sete   %sil
  movzbl %sil,%esi
  sete   %r11b
  movzbl %r11b,%r11d
  add    %r11,%r10
  and    $0x3f,%eax
  or     %edi,%eax
  jmp    L63
```

assistant: ```c
unsigned int vtkParse_DecodeUtf8(const char **cpp, int *error_flag) {
  const unsigned char *cp = (const unsigned char *)(*cpp);
  unsigned int code = *cp++;
  unsigned int s = 0;
  int good = 1;
  if ((code & 0x80) != 0) {
    good = 0;
    if ((code & 0xE0) == 0xC0) {
      code &= 0x1F;
      code <<= 6;
      s = *cp;
      good = ((s & 0xC0) == 0x80);
      cp += good;
      code |= (s & 0x3F);
    } else if ((code & 0xF0) == 0xE0) {
      code &= 0x0F;
      code <<= 6;
      s = *cp;
      good = ((s & 0xC0) == 0x80);
      cp += good;
      code |= (s & 0x3F);
      code <<= 6;
      s = *cp;
      good = ((s & 0xC0) == 0x80);
      cp += good;
      code |= (s & 0x3F);
    } else if ((code & 0xF8) == 0xF0) {
      code &= 0x07;
      code <<= 6;
      s = *cp;
      good = ((s & 0xC0) == 0x80);
      cp += good;
      code |= (s & 0x3F);
      code <<= 6;
      s = *cp;
      good = ((s & 0xC0) == 0x80);
      cp += good;
      code |= (s & 0x3F);
      code <<= 6;
      s = *cp;
      good = ((s & 0xC0) == 0x80);
      cp += good;
      code |= (s & 0x3F);
    }
    if (!good) {
      cp = (const unsigned char *)(*cpp);
      code = *cp++;
    }
  }
  if (error_flag) {
    *error_flag = !good;
  }
  *cpp = (const char *)(cp);
  return code;
}
```