user: Demonstrate the C code that generates the assembly output below:

```asm
<UTFsize>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0xc(%rbp)
  jmp    L20
L73:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0xd(%rbp)
  cmpb   $0x0,-0xd(%rbp)
  jne    L45
  mov    -0xc(%rbp),%eax
  jmp    L223
L45:
  cmpb   $0xc0,-0xd(%rbp)
  je     L53
  cmpb   $0xc1,-0xd(%rbp)
  je     L53
  cmpb   $0xf7,-0xd(%rbp)
  je     L53
  cmpb   $0xfc,-0xd(%rbp)
  jbe    L63
L53:
  mov    -0xc(%rbp),%eax
  jmp    L223
L63:
  movzbl -0xd(%rbp),%eax
  and    $0xf0,%eax
  cmp    $0xe0,%eax
  jne    L149
  mov    -0xc(%rbp),%eax
  add    $0x1,%eax
  cmp    %eax,-0x1c(%rbp)
  jbe    L249
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  and    $0xc0,%eax
  cmp    $0x80,%eax
  jne    L149
L249:
  mov    -0xc(%rbp),%eax
  add    $0x2,%eax
  cmp    %eax,-0x1c(%rbp)
  jbe    L144
  mov    -0x8(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  and    $0xc0,%eax
  cmp    $0x80,%eax
  jne    L149
L144:
  addq   $0x3,-0x8(%rbp)
  addl   $0x3,-0xc(%rbp)
  jmp    L20
L149:
  movzbl -0xd(%rbp),%eax
  and    $0xe0,%eax
  cmp    $0xc0,%eax
  jne    L231
  mov    -0xc(%rbp),%eax
  add    $0x1,%eax
  cmp    %eax,-0x1c(%rbp)
  jbe    L195
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  and    $0xc0,%eax
  cmp    $0x80,%eax
  jne    L231
L195:
  addq   $0x2,-0x8(%rbp)
  addl   $0x2,-0xc(%rbp)
  jmp    L20
L231:
  movzbl -0xd(%rbp),%eax
  cmp    $0x1f,%eax
  jg     L14
  test   %eax,%eax
  js     L182
  mov    %eax,%edx
  mov    $0xffff18ff,%eax
  mov    %edx,%ecx
  shr    %cl,%rax
  and    $0x1,%eax
  test   %rax,%rax
  setne  %al
  test   %al,%al
  jne    L74
  jmp    L182
L14:
  cmp    $0x7f,%eax
  jne    L182
L74:
  mov    -0xc(%rbp),%eax
  jmp    L223
L182:
  addq   $0x1,-0x8(%rbp)
  addl   $0x1,-0xc(%rbp)
L20:
  mov    -0xc(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jb     L73
  mov    -0x1c(%rbp),%edx
  mov    -0xc(%rbp),%eax
  cmp    %eax,%edx
  cmovbe %edx,%eax
L223:
  pop    %rbp
  ret
```

assistant: ```c
int UTFsize(const unsigned char *buffer, const unsigned int buf_len) {
  const unsigned char *p = buffer;
  unsigned int i = 0;
  while (i < buf_len) {
    const unsigned char c = *p;
    if (c == '\0')
      return i;
    if (c == 0xc0 || c == 0xc1 || c == 0xf7 || c >= 0xfd)
      return i;
    if ((c & 0xf0) == 0xe0 && (i + 1 >= buf_len || (*(p + 1) & 0xc0) == 0x80) && (i + 2 >= buf_len || (*(p + 2) & 0xc0) == 0x80)) {
      p += 3;
      i += 3;
    } else if ((c & 0xe0) == 0xc0 && (i + 1 >= buf_len || (*(p + 1) & 0xc0) == 0x80)) {
      p += 2;
      i += 2;
    } else {
      switch (c) {
      case 0x00:
      case 0x01:
      case 0x02:
      case 0x03:
      case 0x04:
      case 0x05:
      case 0x06:
      case 0x07:
      case 0x0b:
      case 0x0c:
      case 0x10:
      case 0x11:
      case 0x12:
      case 0x13:
      case 0x14:
      case 0x15:
      case 0x16:
      case 0x17:
      case 0x18:
      case 0x19:
      case 0x1a:
      case 0x1b:
      case 0x1c:
      case 0x1d:
      case 0x1e:
      case 0x1f:
      case 0x7f:
        return i;
      }
      p++;
      i++;
    }
  }
  return (i < buf_len ? i : buf_len);
}
```