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

```asm
<ucs2_to_utf8>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x4(%rbp)
  mov    %rsi,-0x10(%rbp)
  cmpl   $0x7f,-0x4(%rbp)
  jg     L56
  mov    -0x4(%rbp),%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%rax
  mov    %dl,(%rax)
  mov    -0x10(%rbp),%rax
  add    $0x1,%rax
  movb   $0x0,(%rax)
  mov    $0x1,%eax
  jmp    L136
L56:
  cmpl   $0x7f,-0x4(%rbp)
  jle    L83
  cmpl   $0x7ff,-0x4(%rbp)
  jg     L83
  mov    -0x4(%rbp),%eax
  sar    $0x6,%eax
  or     $0xffffffc0,%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%rax
  mov    %dl,(%rax)
  mov    -0x4(%rbp),%eax
  and    $0x3f,%eax
  or     $0xffffff80,%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%rax
  add    $0x1,%rax
  mov    %dl,(%rax)
  mov    -0x10(%rbp),%rax
  add    $0x2,%rax
  movb   $0x0,(%rax)
  mov    $0x2,%eax
  jmp    L136
L83:
  cmpl   $0x7ff,-0x4(%rbp)
  jle    L127
  cmpl   $0xfffe,-0x4(%rbp)
  jg     L127
  cmpl   $0xd7ff,-0x4(%rbp)
  jle    L117
  cmpl   $0xdfff,-0x4(%rbp)
  jg     L117
  mov    $0xfffffffe,%eax
  jmp    L136
L117:
  mov    -0x4(%rbp),%eax
  sar    $0xc,%eax
  or     $0xffffffe0,%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%rax
  mov    %dl,(%rax)
  mov    -0x4(%rbp),%eax
  sar    $0x6,%eax
  and    $0x3f,%eax
  or     $0xffffff80,%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%rax
  add    $0x1,%rax
  mov    %dl,(%rax)
  mov    -0x4(%rbp),%eax
  and    $0x3f,%eax
  or     $0xffffff80,%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%rax
  add    $0x2,%rax
  mov    %dl,(%rax)
  mov    -0x10(%rbp),%rax
  add    $0x3,%rax
  movb   $0x0,(%rax)
  mov    $0x3,%eax
  jmp    L136
L127:
  cmpl   $0xffff,-0x4(%rbp)
  jle    L113
  cmpl   $0x10fffe,-0x4(%rbp)
  jg     L113
  mov    -0x4(%rbp),%eax
  sar    $0x12,%eax
  or     $0xfffffff0,%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%rax
  mov    %dl,(%rax)
  mov    -0x4(%rbp),%eax
  sar    $0xc,%eax
  and    $0x3f,%eax
  or     $0xffffff80,%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%rax
  add    $0x1,%rax
  mov    %dl,(%rax)
  mov    -0x4(%rbp),%eax
  sar    $0x6,%eax
  and    $0x3f,%eax
  or     $0xffffff80,%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%rax
  add    $0x2,%rax
  mov    %dl,(%rax)
  mov    -0x4(%rbp),%eax
  and    $0x3f,%eax
  or     $0xffffff80,%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%rax
  add    $0x3,%rax
  mov    %dl,(%rax)
  mov    -0x10(%rbp),%rax
  add    $0x4,%rax
  movb   $0x0,(%rax)
  mov    $0x4,%eax
  jmp    L136
L113:
  mov    $0xffffffff,%eax
L136:
  pop    %rbp
  ret
```

assistant: ```c
int ucs2_to_utf8(int ucs2, unsigned char *utf8) {
  if (ucs2 < 0x80) {
    utf8[0] = ucs2;
    utf8[1] = '\0';
    return 1;
  }
  if (ucs2 >= 0x80 && ucs2 < 0x800) {
    utf8[0] = (ucs2 >> 6) | 0xC0;
    utf8[1] = (ucs2 & 0x3F) | 0x80;
    utf8[2] = '\0';
    return 2;
  }
  if (ucs2 >= 0x800 && ucs2 < 0xFFFF) {
    if (ucs2 >= 0xD800 && ucs2 <= 0xDFFF) {
      return -2;
    }
    utf8[0] = ((ucs2 >> 12)) | 0xE0;
    utf8[1] = ((ucs2 >> 6) & 0x3F) | 0x80;
    utf8[2] = ((ucs2)&0x3F) | 0x80;
    utf8[3] = '\0';
    return 3;
  }
  if (ucs2 >= 0x10000 && ucs2 < 0x10FFFF) {
    utf8[0] = 0xF0 | (ucs2 >> 18);
    utf8[1] = 0x80 | ((ucs2 >> 12) & 0x3F);
    utf8[2] = 0x80 | ((ucs2 >> 6) & 0x3F);
    utf8[3] = 0x80 | ((ucs2 & 0x3F));
    utf8[4] = '\0';
    return 4;
  }
  return -1;
}
```