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

```asm
<codepoint2utf8>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x8(%rbp)
  mov    %rsi,-0x10(%rbp)
  cmpq   $0x7f,-0x10(%rbp)
  ja     L26
  mov    -0x10(%rbp),%rax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  mov    %dl,(%rax)
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movb   $0x0,(%rax)
  mov    $0x1,%eax
  jmp    L24
L26:
  cmpq   $0x7ff,-0x10(%rbp)
  ja     L35
  mov    -0x10(%rbp),%rax
  shr    $0x6,%rax
  and    $0x1f,%eax
  or     $0xffffffc0,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  mov    %dl,(%rax)
  mov    -0x10(%rbp),%rax
  and    $0x3f,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  or     $0xffffff80,%edx
  mov    %dl,(%rax)
  mov    -0x8(%rbp),%rax
  add    $0x2,%rax
  movb   $0x0,(%rax)
  mov    $0x2,%eax
  jmp    L24
L35:
  cmpq   $0xffff,-0x10(%rbp)
  ja     L67
  mov    -0x10(%rbp),%rax
  shr    $0xc,%rax
  and    $0xf,%eax
  or     $0xffffffe0,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  mov    %dl,(%rax)
  mov    -0x10(%rbp),%rax
  shr    $0x6,%rax
  and    $0x3f,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  or     $0xffffff80,%edx
  mov    %dl,(%rax)
  mov    -0x10(%rbp),%rax
  and    $0x3f,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x2,%rax
  or     $0xffffff80,%edx
  mov    %dl,(%rax)
  mov    -0x8(%rbp),%rax
  add    $0x3,%rax
  movb   $0x0,(%rax)
  mov    $0x3,%eax
  jmp    L24
L67:
  cmpq   $0x10ffff,-0x10(%rbp)
  ja     L18
  mov    -0x10(%rbp),%rax
  shr    $0x12,%rax
  and    $0x7,%eax
  or     $0xfffffff0,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  mov    %dl,(%rax)
  mov    -0x10(%rbp),%rax
  shr    $0xc,%rax
  and    $0x3f,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  or     $0xffffff80,%edx
  mov    %dl,(%rax)
  mov    -0x10(%rbp),%rax
  shr    $0x6,%rax
  and    $0x3f,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x2,%rax
  or     $0xffffff80,%edx
  mov    %dl,(%rax)
  mov    -0x10(%rbp),%rax
  and    $0x3f,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x3,%rax
  or     $0xffffff80,%edx
  mov    %dl,(%rax)
  mov    -0x8(%rbp),%rax
  add    $0x4,%rax
  movb   $0x0,(%rax)
  mov    $0x4,%eax
  jmp    L24
L18:
  mov    -0x8(%rbp),%rax
  movb   $0xef,(%rax)
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movb   $0xbf,(%rax)
  mov    -0x8(%rbp),%rax
  add    $0x2,%rax
  movb   $0xbd,(%rax)
  mov    -0x8(%rbp),%rax
  add    $0x3,%rax
  movb   $0x0,(%rax)
  mov    $0x0,%eax
L24:
  pop    %rbp
  ret
```

assistant: ```c
int codepoint2utf8(unsigned char *out, unsigned long utf) {
  if (utf <= 0x7F) {
    out[0] = (unsigned char)utf;
    out[1] = 0;
    return 1;
  } else if (utf <= 0x07FF) {
    out[0] = (unsigned char)(((utf >> 6) & 0x1F) | 0xC0);
    out[1] = (unsigned char)(((utf >> 0) & 0x3F) | 0x80);
    out[2] = 0;
    return 2;
  } else if (utf <= 0xFFFF) {
    out[0] = (unsigned char)(((utf >> 12) & 0x0F) | 0xE0);
    out[1] = (unsigned char)(((utf >> 6) & 0x3F) | 0x80);
    out[2] = (unsigned char)(((utf >> 0) & 0x3F) | 0x80);
    out[3] = 0;
    return 3;
  } else if (utf <= 0x10FFFF) {
    out[0] = (unsigned char)(((utf >> 18) & 0x07) | 0xF0);
    out[1] = (unsigned char)(((utf >> 12) & 0x3F) | 0x80);
    out[2] = (unsigned char)(((utf >> 6) & 0x3F) | 0x80);
    out[3] = (unsigned char)(((utf >> 0) & 0x3F) | 0x80);
    out[4] = 0;
    return 4;
  } else {
    out[0] = (unsigned char)0xEF;
    out[1] = (unsigned char)0xBF;
    out[2] = (unsigned char)0xBD;
    out[3] = 0;
    return 0;
  }
}
```