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

```asm
<vui_utf8_encode>:
  endbr64
  mov    %edi,%eax
  cmp    $0x7f,%edi
  ja     L50
  lea    0x1(%rsi),%rdx
  mov    %dil,(%rsi)
L74:
  movb   $0x0,(%rdx)
  mov    %rdx,%rax
  ret
L50:
  cmp    $0x7ff,%edi
  ja     L27
  mov    %edi,%edx
  shr    $0x6,%edx
  or     $0xffffffc0,%edx
  mov    %dl,(%rsi)
  lea    0x2(%rsi),%rdx
  and    $0x3f,%eax
  or     $0xffffff80,%eax
  mov    %al,0x1(%rsi)
  jmp    L74
L27:
  cmp    $0xffff,%edi
  ja     L38
  mov    %edi,%edx
  shr    $0xc,%edx
  or     $0xffffffe0,%edx
  mov    %dl,(%rsi)
  mov    %edi,%edx
  shr    $0x6,%edx
  and    $0x3f,%edx
  or     $0xffffff80,%edx
  mov    %dl,0x1(%rsi)
  lea    0x3(%rsi),%rdx
  and    $0x3f,%eax
  or     $0xffffff80,%eax
  mov    %al,0x2(%rsi)
  jmp    L74
L38:
  cmp    $0x1fffff,%edi
  ja     L102
  mov    %edi,%edx
  shr    $0x12,%edx
  or     $0xfffffff0,%edx
  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)
  lea    0x4(%rsi),%rdx
  and    $0x3f,%eax
  or     $0xffffff80,%eax
  mov    %al,0x3(%rsi)
  jmp    L74
L102:
  cmp    $0x3ffffff,%edi
  ja     L79
  mov    %edi,%edx
  shr    $0x18,%edx
  or     $0xfffffff8,%edx
  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)
  lea    0x5(%rsi),%rdx
  and    $0x3f,%eax
  or     $0xffffff80,%eax
  mov    %al,0x4(%rsi)
  jmp    L74
L79:
  mov    %rsi,%rdx
  test   %edi,%edi
  js     L74
  mov    %edi,%edx
  shr    $0x1e,%edx
  or     $0xfffffffc,%edx
  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)
  lea    0x6(%rsi),%rdx
  and    $0x3f,%eax
  or     $0xffffff80,%eax
  mov    %al,0x5(%rsi)
  jmp    L74
```

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;
}
```