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

```asm
<utf8_encode>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x8(%rbp)
  mov    %esi,-0xc(%rbp)
  cmpl   $0x7f,-0xc(%rbp)
  jg     L99
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  mov    -0xc(%rbp),%edx
  mov    %dl,(%rax)
  jmp    L44
L99:
  cmpl   $0x7ff,-0xc(%rbp)
  jg     L81
  mov    -0xc(%rbp),%eax
  sar    $0x6,%eax
  mov    %eax,%ecx
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  or     $0xffffffc0,%ecx
  mov    %ecx,%edx
  mov    %dl,(%rax)
  jmp    L48
L81:
  cmpl   $0xffff,-0xc(%rbp)
  jg     L65
  mov    -0xc(%rbp),%eax
  sar    $0xc,%eax
  mov    %eax,%ecx
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  or     $0xffffffe0,%ecx
  mov    %ecx,%edx
  mov    %dl,(%rax)
  jmp    L28
L65:
  cmpl   $0x1fffff,-0xc(%rbp)
  jg     L31
  mov    -0xc(%rbp),%eax
  sar    $0x12,%eax
  mov    %eax,%ecx
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  or     $0xfffffff0,%ecx
  mov    %ecx,%edx
  mov    %dl,(%rax)
  jmp    L6
L31:
  cmpl   $0x3ffffff,-0xc(%rbp)
  jg     L43
  mov    -0xc(%rbp),%eax
  sar    $0x18,%eax
  mov    %eax,%ecx
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  or     $0xfffffff8,%ecx
  mov    %ecx,%edx
  mov    %dl,(%rax)
  jmp    L72
L43:
  mov    -0xc(%rbp),%eax
  sar    $0x1e,%eax
  mov    %eax,%ecx
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  or     $0xfffffffc,%ecx
  mov    %ecx,%edx
  mov    %dl,(%rax)
  mov    -0xc(%rbp),%eax
  sar    $0x18,%eax
  and    $0x3f,%eax
  mov    %eax,%ecx
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  or     $0xffffff80,%ecx
  mov    %ecx,%edx
  mov    %dl,(%rax)
L72:
  mov    -0xc(%rbp),%eax
  sar    $0x12,%eax
  and    $0x3f,%eax
  mov    %eax,%ecx
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  or     $0xffffff80,%ecx
  mov    %ecx,%edx
  mov    %dl,(%rax)
L6:
  mov    -0xc(%rbp),%eax
  sar    $0xc,%eax
  and    $0x3f,%eax
  mov    %eax,%ecx
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  or     $0xffffff80,%ecx
  mov    %ecx,%edx
  mov    %dl,(%rax)
L28:
  mov    -0xc(%rbp),%eax
  sar    $0x6,%eax
  and    $0x3f,%eax
  mov    %eax,%ecx
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  or     $0xffffff80,%ecx
  mov    %ecx,%edx
  mov    %dl,(%rax)
L48:
  mov    -0xc(%rbp),%eax
  and    $0x3f,%eax
  mov    %eax,%ecx
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  mov    %ecx,%edx
  or     $0xffffff80,%edx
  mov    %dl,(%rax)
L44:
  mov    -0x8(%rbp),%rax
  pop    %rbp
  ret
```

assistant: ```c
char *utf8_encode(char *q, int c) {
  if (c < 0x80) {
    *q++ = c;
  } else {
    if (c < 0x800) {
      *q++ = (c >> 6) | 0xc0;
    } else {
      if (c < 0x10000) {
        *q++ = (c >> 12) | 0xe0;
      } else {
        if (c < 0x00200000) {
          *q++ = (c >> 18) | 0xf0;
        } else {
          if (c < 0x04000000) {
            *q++ = (c >> 24) | 0xf8;
          } else {
            *q++ = (c >> 30) | 0xfc;
            *q++ = ((c >> 24) & 0x3f) | 0x80;
          }
          *q++ = ((c >> 18) & 0x3f) | 0x80;
        }
        *q++ = ((c >> 12) & 0x3f) | 0x80;
      }
      *q++ = ((c >> 6) & 0x3f) | 0x80;
    }
    *q++ = (c & 0x3f) | 0x80;
  }
  return q;
}
```