user: What is the c source code of the assembly code below?

```asm
<TXT_DecodeUTF8>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  js     L130
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  lea    0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rdx,(%rax)
  jmp    L87
L130:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  and    $0xe0,%eax
  cmp    $0xc0,%eax
  jne    L122
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  and    $0xc0,%eax
  cmp    $0x80,%eax
  jne    L122
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  shl    $0x6,%eax
  and    $0x7c0,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  and    $0x3f,%eax
  or     %edx,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  lea    0x2(%rax),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rdx,(%rax)
  jmp    L87
L122:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  and    $0xf0,%eax
  cmp    $0xe0,%eax
  jne    L32
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  and    $0xc0,%eax
  cmp    $0x80,%eax
  jne    L32
  mov    -0x8(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  and    $0xc0,%eax
  cmp    $0x80,%eax
  jne    L32
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  shl    $0xc,%eax
  movzwl %ax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  shl    $0x6,%eax
  and    $0xfc0,%eax
  or     %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  and    $0x3f,%eax
  or     %edx,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  lea    0x3(%rax),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rdx,(%rax)
  jmp    L87
L32:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  and    $0xf8,%eax
  cmp    $0xf0,%eax
  jne    L80
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  and    $0xc0,%eax
  cmp    $0x80,%eax
  jne    L80
  mov    -0x8(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  and    $0xc0,%eax
  cmp    $0x80,%eax
  jne    L80
  mov    -0x8(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  and    $0xc0,%eax
  cmp    $0x80,%eax
  jne    L80
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  shl    $0x12,%eax
  and    $0x1c0000,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  shl    $0xc,%eax
  and    $0x3f000,%eax
  or     %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  shl    $0x6,%eax
  and    $0xfc0,%eax
  or     %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  and    $0x3f,%eax
  or     %edx,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  lea    0x4(%rax),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rdx,(%rax)
  jmp    L87
L80:
  movl   $0x0,-0xc(%rbp)
L87:
  mov    -0xc(%rbp),%eax
  pop    %rbp
  ret
```

assistant: ```c
unsigned int TXT_DecodeUTF8(const char **ptr) {
  const char *p = *ptr;
  unsigned int c;
  if ((*p & 0x80) == 0) {
    c = *p;
    *ptr += 1;
  } else if ((p[0] & 0xe0) == 0xc0 && (p[1] & 0xc0) == 0x80) {
    c = ((p[0] & 0x1f) << 6) | (p[1] & 0x3f);
    *ptr += 2;
  } else if ((p[0] & 0xf0) == 0xe0 && (p[1] & 0xc0) == 0x80 && (p[2] & 0xc0) == 0x80) {
    c = ((p[0] & 0x0f) << 12) | ((p[1] & 0x3f) << 6) | (p[2] & 0x3f);
    *ptr += 3;
  } else if ((p[0] & 0xf8) == 0xf0 && (p[1] & 0xc0) == 0x80 && (p[2] & 0xc0) == 0x80 && (p[3] & 0xc0) == 0x80) {
    c = ((p[0] & 0x07) << 18) | ((p[1] & 0x3f) << 12) | ((p[2] & 0x3f) << 6) | (p[3] & 0x3f);
    *ptr += 4;
  } else {
    c = 0;
  }
  return c;
}
```