user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<_xos_utf8_put_char>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x8(%rbp)
  mov    %esi,-0xc(%rbp)
  cmpl   $0x7f,-0xc(%rbp)
  jg     L34
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  mov    -0xc(%rbp),%edx
  mov    %dl,(%rax)
  jmp    L89
L34:
  cmpl   $0x7ff,-0xc(%rbp)
  jg     L15
  mov    -0xc(%rbp),%eax
  sar    $0x6,%eax
  and    $0x1f,%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)
  mov    -0xc(%rbp),%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)
  jmp    L89
L15:
  cmpl   $0xffff,-0xc(%rbp)
  jg     L32
  mov    -0xc(%rbp),%eax
  sar    $0xc,%eax
  and    $0xf,%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)
  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)
  mov    -0xc(%rbp),%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)
  jmp    L89
L32:
  cmpl   $0x1fffff,-0xc(%rbp)
  jg     L12
  mov    -0xc(%rbp),%eax
  sar    $0x12,%eax
  and    $0x7,%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)
  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)
  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)
  mov    -0xc(%rbp),%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)
  jmp    L89
L12:
  cmpl   $0x3ffffff,-0xc(%rbp)
  jg     L58
  mov    -0xc(%rbp),%eax
  sar    $0x18,%eax
  and    $0x3,%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)
  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)
  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)
  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)
  mov    -0xc(%rbp),%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)
  jmp    L89
L58:
  cmpl   $0x0,-0xc(%rbp)
  js     L89
  mov    -0xc(%rbp),%eax
  sar    $0x1e,%eax
  and    $0x1,%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)
  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)
  mov    %ecx,%edx
  or     $0xffffff80,%edx
  mov    %dl,(%rax)
  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)
  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)
  mov    %ecx,%edx
  or     $0xffffff80,%edx
  mov    %dl,(%rax)
  mov    -0xc(%rbp),%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)
L89:
  mov    -0x8(%rbp),%rax
  pop    %rbp
  ret
```

assistant: ```c
char *_xos_utf8_put_char(char *out, int chr) {
  if (chr < 0x80) {
    *out++ = chr;
  } else if (chr < 0x800) {
    *out++ = 0xc0 | ((chr >> 6) & 0x1f);
    *out++ = 0x80 | (chr & 0x3f);
  } else if (chr < 0x10000) {
    *out++ = 0xe0 | ((chr >> 12) & 0x0f);
    *out++ = 0x80 | ((chr >> 6) & 0x3f);
    *out++ = 0x80 | (chr & 0x3f);
  } else if (chr < 0x200000) {
    *out++ = 0xf0 | ((chr >> 18) & 0x07);
    *out++ = 0x80 | ((chr >> 12) & 0x3f);
    *out++ = 0x80 | ((chr >> 6) & 0x3f);
    *out++ = 0x80 | (chr & 0x3f);
  } else if (chr < 0x4000000) {
    *out++ = 0xf8 | ((chr >> 24) & 0x03);
    *out++ = 0x80 | ((chr >> 18) & 0x3f);
    *out++ = 0x80 | ((chr >> 12) & 0x3f);
    *out++ = 0x80 | ((chr >> 6) & 0x3f);
    *out++ = 0x80 | (chr & 0x3f);
  } else if (chr < 0x80000000) {
    *out++ = 0xfc | ((chr >> 30) & 0x01);
    *out++ = 0x80 | ((chr >> 24) & 0x3f);
    *out++ = 0x80 | ((chr >> 18) & 0x3f);
    *out++ = 0x80 | ((chr >> 12) & 0x3f);
    *out++ = 0x80 | ((chr >> 6) & 0x3f);
    *out++ = 0x80 | (chr & 0x3f);
  }
  return out;
}
```