user: What would the C source look like for the assembly code provided here?

```asm
<vtkParse_DecodeUtf8>:
  endbr64
  mov    %rdi,%rdx
  mov    (%rdi),%rdi
  mov    %rsi,%rcx
  mov    $0x1,%esi
  movzbl (%rdi),%r9d
  lea    0x1(%rdi),%r8
  mov    %r9d,%eax
  test   %r9b,%r9b
  js     L55
L41:
  test   %rcx,%rcx
  je     L76
  xor    $0x1,%esi
  mov    %esi,(%rcx)
L76:
  mov    %r8,(%rdx)
  mov    %r9d,%eax
  ret
  nopl   0x0(%rax,%rax,1)
L55:
  mov    %r9d,%esi
  and    $0xffffffe0,%esi
  cmp    $0xc0,%sil
  je     L22
  mov    %r9d,%esi
  and    $0xfffffff0,%esi
  cmp    $0xe0,%sil
  je     L34
  mov    %r9d,%r10d
  xor    %esi,%esi
  and    $0xfffffff8,%r10d
  cmp    $0xf0,%r10b
  jne    L41
  movzbl 0x1(%rdi),%esi
  and    $0x7,%eax
  xor    %r10d,%r10d
  shl    $0x6,%eax
  mov    %esi,%edi
  and    $0xffffffc0,%edi
  cmp    $0x80,%dil
  sete   %r10b
  and    $0x3f,%esi
  add    %r8,%r10
  or     %eax,%esi
  movzbl (%r10),%eax
  shl    $0x6,%esi
  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
L44:
  movzbl (%r10),%eax
  shl    $0x6,%edi
  mov    %eax,%esi
  and    $0xffffffc0,%esi
  cmp    $0x80,%sil
  sete   %r11b
  sete   %sil
  and    $0x3f,%eax
  movzbl %r11b,%r11d
  movzbl %sil,%esi
  or     %edi,%eax
  add    %r11,%r10
L21:
  test   %esi,%esi
  cmovne %eax,%r9d
  cmovne %r10,%r8
  jmp    L41
  nopw   0x0(%rax,%rax,1)
L34:
  movzbl 0x1(%rdi),%esi
  and    $0xf,%eax
  xor    %r10d,%r10d
  shl    $0x6,%eax
  mov    %esi,%edi
  and    $0xffffffc0,%edi
  cmp    $0x80,%dil
  mov    %esi,%edi
  sete   %r10b
  and    $0x3f,%edi
  add    %r8,%r10
  or     %eax,%edi
  jmp    L44
  xchg   %ax,%ax
L22:
  movzbl 0x1(%rdi),%edi
  and    $0x1f,%eax
  shl    $0x6,%eax
  mov    %edi,%esi
  and    $0xffffffc0,%esi
  cmp    $0x80,%sil
  sete   %r10b
  sete   %sil
  and    $0x3f,%edi
  movzbl %r10b,%r10d
  movzbl %sil,%esi
  or     %edi,%eax
  add    %r8,%r10
  jmp    L21
```

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