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

```asm
<vui_utf8_encode>:
  endbr64
  mov    %edi,%eax
  cmp    $0x7f,%edi
  ja     L46
  mov    %dil,(%rsi)
  lea    0x1(%rsi),%r8
L33:
  movb   $0x0,(%r8)
  mov    %r8,%rax
  ret
  nopw   0x0(%rax,%rax,1)
L46:
  cmp    $0x7ff,%edi
  ja     L6
  mov    %edi,%edx
  and    $0x3f,%eax
  lea    0x2(%rsi),%r8
  shr    $0x6,%edx
  or     $0xffffff80,%eax
  or     $0xffffffc0,%edx
  mov    %al,0x1(%rsi)
  mov    %r8,%rax
  mov    %dl,(%rsi)
  movb   $0x0,(%r8)
  ret
  nopw   0x0(%rax,%rax,1)
L6:
  cmp    $0xffff,%edi
  jbe    L40
  cmp    $0x1fffff,%edi
  ja     L47
  mov    %edi,%edx
  and    $0x3f,%eax
  lea    0x4(%rsi),%r8
  shr    $0x12,%edx
  or     $0xffffff80,%eax
  or     $0xfffffff0,%edx
  mov    %al,0x3(%rsi)
  mov    %dl,(%rsi)
  mov    %edi,%edx
  shr    $0xc,%edx
  and    $0x3f,%edx
  or     $0xffffff80,%edx
  mov    %dl,0x1(%rsi)
  mov    %edi,%edx
  shr    $0x6,%edx
  and    $0x3f,%edx
  or     $0xffffff80,%edx
  mov    %dl,0x2(%rsi)
  jmp    L33
  nopl   0x0(%rax,%rax,1)
L40:
  mov    %edi,%edx
  and    $0x3f,%eax
  lea    0x3(%rsi),%r8
  shr    $0xc,%edx
  or     $0xffffff80,%eax
  or     $0xffffffe0,%edx
  mov    %al,0x2(%rsi)
  mov    %r8,%rax
  mov    %dl,(%rsi)
  mov    %edi,%edx
  shr    $0x6,%edx
  and    $0x3f,%edx
  or     $0xffffff80,%edx
  mov    %dl,0x1(%rsi)
  movb   $0x0,(%r8)
  ret
  nopl   (%rax)
L47:
  cmp    $0x3ffffff,%edi
  jbe    L79
  mov    %rsi,%r8
  test   %edi,%edi
  js     L33
  mov    %edi,%edx
  and    $0x3f,%eax
  add    $0x6,%r8
  shr    $0x1e,%edx
  or     $0xffffff80,%eax
  or     $0xfffffffc,%edx
  mov    %al,0x5(%rsi)
  mov    %dl,(%rsi)
  mov    %edi,%edx
  shr    $0x18,%edx
  and    $0x3f,%edx
  or     $0xffffff80,%edx
  mov    %dl,0x1(%rsi)
  mov    %edi,%edx
  shr    $0x12,%edx
  and    $0x3f,%edx
  or     $0xffffff80,%edx
  mov    %dl,0x2(%rsi)
  mov    %edi,%edx
  shr    $0xc,%edx
  and    $0x3f,%edx
  or     $0xffffff80,%edx
  mov    %dl,0x3(%rsi)
  mov    %edi,%edx
  shr    $0x6,%edx
  and    $0x3f,%edx
  or     $0xffffff80,%edx
  mov    %dl,0x4(%rsi)
  jmp    L33
  nopw   0x0(%rax,%rax,1)
L79:
  mov    %edi,%edx
  and    $0x3f,%eax
  lea    0x5(%rsi),%r8
  shr    $0x18,%edx
  or     $0xffffff80,%eax
  or     $0xfffffff8,%edx
  mov    %al,0x4(%rsi)
  mov    %dl,(%rsi)
  mov    %edi,%edx
  shr    $0x12,%edx
  and    $0x3f,%edx
  or     $0xffffff80,%edx
  mov    %dl,0x1(%rsi)
  mov    %edi,%edx
  shr    $0xc,%edx
  and    $0x3f,%edx
  or     $0xffffff80,%edx
  mov    %dl,0x2(%rsi)
  mov    %edi,%edx
  shr    $0x6,%edx
  and    $0x3f,%edx
  or     $0xffffff80,%edx
  mov    %dl,0x3(%rsi)
  jmp    L33
```

assistant: ```c
char *vui_utf8_encode(unsigned int c, char *s) {
  if (c < 0x80) {
    *s++ = c;
  } else if (c < 0x800) {
    *s++ = 192 | ((c >> 6) & 0x1F);
    *s++ = 128 | ((c >> 0) & 0x3F);
  } else if (c < 0x10000) {
    *s++ = 224 | ((c >> 12) & 0x0F);
    *s++ = 128 | ((c >> 6) & 0x3F);
    *s++ = 128 | ((c >> 0) & 0x3F);
  } else if (c < 0x200000) {
    *s++ = 240 | ((c >> 18) & 0x07);
    *s++ = 128 | ((c >> 12) & 0x3F);
    *s++ = 128 | ((c >> 6) & 0x3F);
    *s++ = 128 | ((c >> 0) & 0x3F);
  } else if (c < 0x4000000) {
    *s++ = 248 | ((c >> 24) & 0x03);
    *s++ = 128 | ((c >> 18) & 0x3F);
    *s++ = 128 | ((c >> 12) & 0x3F);
    *s++ = 128 | ((c >> 6) & 0x3F);
    *s++ = 128 | ((c >> 0) & 0x3F);
  } else if (c < 0x80000000) {
    *s++ = 252 | ((c >> 30) & 0x01);
    *s++ = 128 | ((c >> 24) & 0x3F);
    *s++ = 128 | ((c >> 18) & 0x3F);
    *s++ = 128 | ((c >> 12) & 0x3F);
    *s++ = 128 | ((c >> 6) & 0x3F);
    *s++ = 128 | ((c >> 0) & 0x3F);
  }
  *s = 0;
  return s;
}
```