user: 这段汇编代码用C语言表示是什么样的？

```asm
<toml_ucs_to_utf8>:
  endbr64
  mov    %edi,%eax
  lea    -0xd800(%rdi),%ecx
  cmp    $0x7ff,%ecx
  jbe    L65
  lea    -0xfffe(%rdi),%ecx
  cmp    $0x1,%ecx
  jbe    L24
  test   %edi,%edi
  js     L24
  cmp    $0x7f,%edi
  jle    L56
  cmp    $0x7ff,%edi
  jle    L18
  cmp    $0xffff,%edi
  jle    L60
  cmp    $0x1fffff,%edi
  jle    L72
  cmp    $0x3ffffff,%edi
  jg     L74
  mov    %edi,%ecx
  sar    $0x18,%ecx
  or     $0xfffffff8,%ecx
  mov    %cl,(%rsi)
  mov    %edi,%ecx
  sar    $0x12,%ecx
  and    $0x3f,%ecx
  or     $0xffffff80,%ecx
  mov    %cl,0x1(%rsi)
  mov    %edi,%ecx
  sar    $0xc,%ecx
  and    $0x3f,%ecx
  or     $0xffffff80,%ecx
  mov    %cl,0x2(%rsi)
  mov    %edi,%ecx
  sar    $0x6,%ecx
  and    $0x3f,%ecx
  or     $0xffffff80,%ecx
  mov    %cl,0x3(%rsi)
  and    $0x3f,%eax
  or     $0xffffff80,%eax
  mov    %al,0x4(%rsi)
  mov    $0x5,%eax
  ret
L56:
  mov    %dil,(%rsi)
  mov    $0x1,%eax
  ret
L18:
  mov    %edi,%ecx
  sar    $0x6,%ecx
  or     $0xffffffc0,%ecx
  mov    %cl,(%rsi)
  and    $0x3f,%eax
  or     $0xffffff80,%eax
  mov    %al,0x1(%rsi)
  mov    $0x2,%eax
  ret
L60:
  mov    %edi,%ecx
  sar    $0xc,%ecx
  or     $0xffffffe0,%ecx
  mov    %cl,(%rsi)
  mov    %edi,%ecx
  sar    $0x6,%ecx
  and    $0x3f,%ecx
  or     $0xffffff80,%ecx
  mov    %cl,0x1(%rsi)
  and    $0x3f,%eax
  or     $0xffffff80,%eax
  mov    %al,0x2(%rsi)
  mov    $0x3,%eax
  ret
L72:
  mov    %edi,%ecx
  sar    $0x12,%ecx
  or     $0xfffffff0,%ecx
  mov    %cl,(%rsi)
  mov    %edi,%ecx
  sar    $0xc,%ecx
  and    $0x3f,%ecx
  or     $0xffffff80,%ecx
  mov    %cl,0x1(%rsi)
  mov    %edi,%ecx
  sar    $0x6,%ecx
  and    $0x3f,%ecx
  or     $0xffffff80,%ecx
  mov    %cl,0x2(%rsi)
  and    $0x3f,%eax
  or     $0xffffff80,%eax
  mov    %al,0x3(%rsi)
  mov    $0x4,%eax
  ret
L74:
  mov    %edi,%ecx
  sar    $0x1e,%ecx
  or     $0xfffffffc,%ecx
  mov    %cl,(%rsi)
  mov    %edi,%ecx
  sar    $0x18,%ecx
  and    $0x3f,%ecx
  or     $0xffffff80,%ecx
  mov    %cl,0x1(%rsi)
  mov    %edi,%ecx
  sar    $0x12,%ecx
  and    $0x3f,%ecx
  or     $0xffffff80,%ecx
  mov    %cl,0x2(%rsi)
  mov    %edi,%ecx
  sar    $0xc,%ecx
  and    $0x3f,%ecx
  or     $0xffffff80,%ecx
  mov    %cl,0x3(%rsi)
  mov    %edi,%ecx
  sar    $0x6,%ecx
  and    $0x3f,%ecx
  or     $0xffffff80,%ecx
  mov    %cl,0x4(%rsi)
  and    $0x3f,%eax
  or     $0xffffff80,%eax
  mov    %al,0x5(%rsi)
  mov    $0x6,%eax
  ret
L65:
  mov    $0xffffffff,%eax
  ret
L24:
  mov    $0xffffffff,%eax
  ret
```

assistant: ```c
int toml_ucs_to_utf8(int64_t code, char buf[6]) {
  if (0xd800 <= code && code <= 0xdfff)
    return -1;
  if (0xfffe <= code && code <= 0xffff)
    return -1;
  if (code < 0)
    return -1;
  if (code <= 0x7F) {
    buf[0] = (unsigned char)code;
    return 1;
  }
  if (code <= 0x000007FF) {
    buf[0] = 0xc0 | (code >> 6);
    buf[1] = 0x80 | (code & 0x3f);
    return 2;
  }
  if (code <= 0x0000FFFF) {
    buf[0] = 0xe0 | (code >> 12);
    buf[1] = 0x80 | ((code >> 6) & 0x3f);
    buf[2] = 0x80 | (code & 0x3f);
    return 3;
  }
  if (code <= 0x001FFFFF) {
    buf[0] = 0xf0 | (code >> 18);
    buf[1] = 0x80 | ((code >> 12) & 0x3f);
    buf[2] = 0x80 | ((code >> 6) & 0x3f);
    buf[3] = 0x80 | (code & 0x3f);
    return 4;
  }
  if (code <= 0x03FFFFFF) {
    buf[0] = 0xf8 | (code >> 24);
    buf[1] = 0x80 | ((code >> 18) & 0x3f);
    buf[2] = 0x80 | ((code >> 12) & 0x3f);
    buf[3] = 0x80 | ((code >> 6) & 0x3f);
    buf[4] = 0x80 | (code & 0x3f);
    return 5;
  }
  if (code <= 0x7FFFFFFF) {
    buf[0] = 0xfc | (code >> 30);
    buf[1] = 0x80 | ((code >> 24) & 0x3f);
    buf[2] = 0x80 | ((code >> 18) & 0x3f);
    buf[3] = 0x80 | ((code >> 12) & 0x3f);
    buf[4] = 0x80 | ((code >> 6) & 0x3f);
    buf[5] = 0x80 | (code & 0x3f);
    return 6;
  }
  return -1;
}
```