user: 请从给定的汇编指令推导出C源代码:

```asm
<utf8_wctomb>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    -0x1c(%rbp),%eax
  mov    %eax,-0x4(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  jne    L30
  mov    $0x0,%eax
  jmp    L2
L30:
  cmpl   $0x7f,-0x4(%rbp)
  ja     L0
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  mov    -0x4(%rbp),%edx
  mov    %dl,(%rax)
  mov    $0x1,%eax
  jmp    L2
L0:
  cmpl   $0x7ff,-0x4(%rbp)
  ja     L7
  mov    -0x4(%rbp),%eax
  shr    $0x6,%eax
  or     $0xffffffc0,%eax
  mov    %eax,%ecx
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  mov    %ecx,%edx
  mov    %dl,(%rax)
  mov    -0x4(%rbp),%eax
  and    $0x3f,%eax
  or     $0xffffff80,%eax
  mov    %eax,%ecx
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  mov    %ecx,%edx
  mov    %dl,(%rax)
  mov    $0x2,%eax
  jmp    L2
L7:
  cmpl   $0xffff,-0x4(%rbp)
  ja     L87
  mov    -0x4(%rbp),%eax
  shr    $0xc,%eax
  or     $0xffffffe0,%eax
  mov    %eax,%ecx
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  mov    %ecx,%edx
  mov    %dl,(%rax)
  mov    -0x4(%rbp),%eax
  shr    $0x6,%eax
  and    $0x3f,%eax
  or     $0xffffff80,%eax
  mov    %eax,%ecx
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  mov    %ecx,%edx
  mov    %dl,(%rax)
  mov    -0x4(%rbp),%eax
  and    $0x3f,%eax
  or     $0xffffff80,%eax
  mov    %eax,%ecx
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  mov    %ecx,%edx
  mov    %dl,(%rax)
  mov    $0x3,%eax
  jmp    L2
L87:
  cmpl   $0x1fffff,-0x4(%rbp)
  ja     L62
  mov    -0x4(%rbp),%eax
  shr    $0x12,%eax
  or     $0xfffffff0,%eax
  mov    %eax,%ecx
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  mov    %ecx,%edx
  mov    %dl,(%rax)
  mov    -0x4(%rbp),%eax
  shr    $0xc,%eax
  and    $0x3f,%eax
  or     $0xffffff80,%eax
  mov    %eax,%ecx
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  mov    %ecx,%edx
  mov    %dl,(%rax)
  mov    -0x4(%rbp),%eax
  shr    $0x6,%eax
  and    $0x3f,%eax
  or     $0xffffff80,%eax
  mov    %eax,%ecx
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  mov    %ecx,%edx
  mov    %dl,(%rax)
  mov    -0x4(%rbp),%eax
  and    $0x3f,%eax
  or     $0xffffff80,%eax
  mov    %eax,%ecx
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  mov    %ecx,%edx
  mov    %dl,(%rax)
  mov    $0x4,%eax
  jmp    L2
L62:
  cmpl   $0x3ffffff,-0x4(%rbp)
  ja     L77
  mov    -0x4(%rbp),%eax
  shr    $0x18,%eax
  or     $0xfffffff8,%eax
  mov    %eax,%ecx
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  mov    %ecx,%edx
  mov    %dl,(%rax)
  mov    -0x4(%rbp),%eax
  shr    $0x12,%eax
  and    $0x3f,%eax
  or     $0xffffff80,%eax
  mov    %eax,%ecx
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  mov    %ecx,%edx
  mov    %dl,(%rax)
  mov    -0x4(%rbp),%eax
  shr    $0xc,%eax
  and    $0x3f,%eax
  or     $0xffffff80,%eax
  mov    %eax,%ecx
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  mov    %ecx,%edx
  mov    %dl,(%rax)
  mov    -0x4(%rbp),%eax
  shr    $0x6,%eax
  and    $0x3f,%eax
  or     $0xffffff80,%eax
  mov    %eax,%ecx
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  mov    %ecx,%edx
  mov    %dl,(%rax)
  mov    -0x4(%rbp),%eax
  and    $0x3f,%eax
  or     $0xffffff80,%eax
  mov    %eax,%ecx
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  mov    %ecx,%edx
  mov    %dl,(%rax)
  mov    $0x5,%eax
  jmp    L2
L77:
  mov    -0x4(%rbp),%eax
  test   %eax,%eax
  js     L82
  mov    -0x4(%rbp),%eax
  shr    $0x1e,%eax
  or     $0xfffffffc,%eax
  mov    %eax,%ecx
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  mov    %ecx,%edx
  mov    %dl,(%rax)
  mov    -0x4(%rbp),%eax
  shr    $0x18,%eax
  and    $0x3f,%eax
  or     $0xffffff80,%eax
  mov    %eax,%ecx
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  mov    %ecx,%edx
  mov    %dl,(%rax)
  mov    -0x4(%rbp),%eax
  shr    $0x12,%eax
  and    $0x3f,%eax
  or     $0xffffff80,%eax
  mov    %eax,%ecx
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  mov    %ecx,%edx
  mov    %dl,(%rax)
  mov    -0x4(%rbp),%eax
  shr    $0xc,%eax
  and    $0x3f,%eax
  or     $0xffffff80,%eax
  mov    %eax,%ecx
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  mov    %ecx,%edx
  mov    %dl,(%rax)
  mov    -0x4(%rbp),%eax
  shr    $0x6,%eax
  and    $0x3f,%eax
  or     $0xffffff80,%eax
  mov    %eax,%ecx
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  mov    %ecx,%edx
  mov    %dl,(%rax)
  mov    -0x4(%rbp),%eax
  and    $0x3f,%eax
  or     $0xffffff80,%eax
  mov    %eax,%ecx
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  mov    %ecx,%edx
  mov    %dl,(%rax)
  mov    $0x6,%eax
  jmp    L2
L82:
  mov    $0xffffffff,%eax
L2:
  pop    %rbp
  ret
```

assistant: ```c
int utf8_wctomb(char *s, int wc1) {
  unsigned int wc = wc1;
  if (!s)
    return 0;
  if (wc < (1 << 7)) {
    *s++ = wc;
    return 1;
  } else if (wc < (1 << 11)) {
    *s++ = 0xc0 | (wc >> 6);
    *s++ = 0x80 | (wc & 0x3f);
    return 2;
  } else if (wc < (1 << 16)) {
    *s++ = 0xe0 | (wc >> 12);
    *s++ = 0x80 | ((wc >> 6) & 0x3f);
    *s++ = 0x80 | (wc & 0x3f);
    return 3;
  } else if (wc < (1 << 21)) {
    *s++ = 0xf0 | (wc >> 18);
    *s++ = 0x80 | ((wc >> 12) & 0x3f);
    *s++ = 0x80 | ((wc >> 6) & 0x3f);
    *s++ = 0x80 | (wc & 0x3f);
    return 4;
  } else if (wc < (1 << 26)) {
    *s++ = 0xf8 | (wc >> 24);
    *s++ = 0x80 | ((wc >> 18) & 0x3f);
    *s++ = 0x80 | ((wc >> 12) & 0x3f);
    *s++ = 0x80 | ((wc >> 6) & 0x3f);
    *s++ = 0x80 | (wc & 0x3f);
    return 5;
  } else if (wc < (1 << 31)) {
    *s++ = 0xfc | (wc >> 30);
    *s++ = 0x80 | ((wc >> 24) & 0x3f);
    *s++ = 0x80 | ((wc >> 18) & 0x3f);
    *s++ = 0x80 | ((wc >> 12) & 0x3f);
    *s++ = 0x80 | ((wc >> 6) & 0x3f);
    *s++ = 0x80 | (wc & 0x3f);
    return 6;
  } else
    return -1;
}
```