user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<conv_to_utf8>:
  endbr64
  mov    %rdi,%rcx
  mov    %esi,%eax
  mov    $0x1,%edi
  cmp    $0x7f,%esi
  jbe    L26
  mov    $0x2,%edi
  cmp    $0x7ff,%esi
  jbe    L26
  mov    $0x3,%edi
  cmp    $0xffff,%esi
  jbe    L26
  mov    $0x4,%edi
  cmp    $0x1fffff,%esi
  jbe    L26
  cmp    $0x3ffffff,%esi
  seta   %dil
  movzbl %dil,%edi
  add    $0x5,%edi
L26:
  cmp    %edx,%edi
  ja     L100
  test   %rcx,%rcx
  je     L27
  cmp    $0x6,%edi
  ja     L27
  mov    %edi,%edx
  lea    D9(%rip),%rsi
  movslq (%rsi,%rdx,4),%rdx
  add    %rsi,%rdx
  notrack jmp *%rdx
  mov    %al,(%rcx)
  jmp    L27
  mov    %eax,%edx
  and    $0x3f,%edx
  or     $0xffffff80,%edx
  mov    %dl,0x1(%rcx)
  mov    %eax,%edx
  shr    $0x6,%edx
  and    $0x1c,%edx
  shr    $0x6,%al
  or     %edx,%eax
  or     $0xffffffc0,%eax
  mov    %al,(%rcx)
  jmp    L27
  mov    %eax,%edx
  and    $0x3f,%edx
  or     $0xffffff80,%edx
  mov    %dl,0x2(%rcx)
  mov    %eax,%esi
  shr    $0x8,%esi
  lea    0x0(,%rsi,4),%edx
  and    $0x3c,%edx
  shr    $0x6,%al
  or     %edx,%eax
  or     $0xffffff80,%eax
  mov    %al,0x1(%rcx)
  shr    $0x4,%sil
  or     $0xffffffe0,%esi
  mov    %sil,(%rcx)
  jmp    L27
  mov    %eax,%edx
  and    $0x3f,%edx
  or     $0xffffff80,%edx
  mov    %dl,0x3(%rcx)
  mov    %eax,%esi
  shr    $0x8,%esi
  lea    0x0(,%rsi,4),%edx
  and    $0x3c,%edx
  mov    %eax,%r8d
  shr    $0x6,%r8b
  or     %r8d,%edx
  or     $0xffffff80,%edx
  mov    %dl,0x2(%rcx)
  shr    $0x10,%eax
  mov    %eax,%edx
  shl    $0x4,%edx
  and    $0x30,%edx
  shr    $0x4,%sil
  or     %esi,%edx
  or     $0xffffff80,%edx
  mov    %dl,0x1(%rcx)
  sar    $0x2,%eax
  and    $0x7,%eax
  or     $0xfffffff0,%eax
  mov    %al,(%rcx)
  jmp    L27
  mov    %eax,%edx
  and    $0x3f,%edx
  or     $0xffffff80,%edx
  mov    %dl,0x4(%rcx)
  mov    %eax,%r8d
  shr    $0x8,%r8d
  lea    0x0(,%r8,4),%edx
  and    $0x3c,%edx
  mov    %eax,%esi
  shr    $0x6,%sil
  or     %esi,%edx
  or     $0xffffff80,%edx
  mov    %dl,0x3(%rcx)
  mov    %eax,%esi
  shr    $0x10,%esi
  mov    %esi,%edx
  shl    $0x4,%edx
  and    $0x30,%edx
  shr    $0x4,%r8b
  or     %r8d,%edx
  or     $0xffffff80,%edx
  mov    %dl,0x2(%rcx)
  shr    $0x2,%sil
  or     $0xffffff80,%esi
  mov    %sil,0x1(%rcx)
  shr    $0x18,%eax
  and    $0x3,%eax
  or     $0xfffffff8,%eax
  mov    %al,(%rcx)
  jmp    L27
  mov    %eax,%edx
  and    $0x3f,%edx
  or     $0xffffff80,%edx
  mov    %dl,0x5(%rcx)
  mov    %eax,%r8d
  shr    $0x8,%r8d
  lea    0x0(,%r8,4),%edx
  and    $0x3c,%edx
  mov    %eax,%esi
  shr    $0x6,%sil
  or     %esi,%edx
  or     $0xffffff80,%edx
  mov    %dl,0x4(%rcx)
  mov    %eax,%esi
  shr    $0x10,%esi
  mov    %esi,%edx
  shl    $0x4,%edx
  and    $0x30,%edx
  shr    $0x4,%r8b
  or     %r8d,%edx
  or     $0xffffff80,%edx
  mov    %dl,0x3(%rcx)
  shr    $0x2,%sil
  or     $0xffffff80,%esi
  mov    %sil,0x2(%rcx)
  shr    $0x18,%eax
  mov    %eax,%edx
  and    $0x3f,%edx
  or     $0xffffff80,%edx
  mov    %dl,0x1(%rcx)
  sar    $0x6,%eax
  and    $0x1,%eax
  or     $0xfffffffc,%eax
  mov    %al,(%rcx)
  jmp    L27
L100:
  mov    $0x0,%edi
L27:
  mov    %edi,%eax
  ret
```

assistant: ```c
int conv_to_utf8(unsigned char *target, unsigned source, unsigned limit) {
  int rc = 0;
  if (source <= 0x0000007f)
    rc = 1;
  else if (source <= 0x000007ff)
    rc = 2;
  else if (source <= 0x0000ffff)
    rc = 3;
  else if (source <= 0x001fffff)
    rc = 4;
  else if (source <= 0x03ffffff)
    rc = 5;
  else
    rc = 6;
  if ((unsigned)rc > limit) {
    rc = 0;
  }
  if (target != 0) {
    switch (rc) {
    case 1:
      target[0] = ((unsigned char)((source) >> ((0) * 8)));
      break;
    case 2:
      target[1] = ((unsigned char)(0x80 | (((unsigned char)((source) >> ((0) * 8))) & 0x3f)));
      target[0] = ((unsigned char)(0xc0 | (((unsigned char)((source) >> ((0) * 8))) >> 6) | ((((unsigned char)((source) >> ((1) * 8))) & 0x07) << 2)));
      break;
    case 3:
      target[2] = ((unsigned char)(0x80 | (((unsigned char)((source) >> ((0) * 8))) & 0x3f)));
      target[1] = ((unsigned char)(0x80 | (((unsigned char)((source) >> ((0) * 8))) >> 6) | ((((unsigned char)((source) >> ((1) * 8))) & 0x0f) << 2)));
      target[0] = ((unsigned char)(0xe0 | ((int)(((unsigned char)((source) >> ((1) * 8))) & 0xf0) >> 4)));
      break;
    case 4:
      target[3] = ((unsigned char)(0x80 | (((unsigned char)((source) >> ((0) * 8))) & 0x3f)));
      target[2] = ((unsigned char)(0x80 | (((unsigned char)((source) >> ((0) * 8))) >> 6) | ((((unsigned char)((source) >> ((1) * 8))) & 0x0f) << 2)));
      target[1] = ((unsigned char)(0x80 | ((int)(((unsigned char)((source) >> ((1) * 8))) & 0xf0) >> 4) | ((int)(((unsigned char)((source) >> ((2) * 8))) & 0x03) << 4)));
      target[0] = ((unsigned char)(0xf0 | ((int)(((unsigned char)((source) >> ((2) * 8))) & 0x1f) >> 2)));
      break;
    case 5:
      target[4] = ((unsigned char)(0x80 | (((unsigned char)((source) >> ((0) * 8))) & 0x3f)));
      target[3] = ((unsigned char)(0x80 | (((unsigned char)((source) >> ((0) * 8))) >> 6) | ((((unsigned char)((source) >> ((1) * 8))) & 0x0f) << 2)));
      target[2] = ((unsigned char)(0x80 | ((int)(((unsigned char)((source) >> ((1) * 8))) & 0xf0) >> 4) | ((int)(((unsigned char)((source) >> ((2) * 8))) & 0x03) << 4)));
      target[1] = ((unsigned char)(0x80 | (((unsigned char)((source) >> ((2) * 8))) >> 2)));
      target[0] = ((unsigned char)(0xf8 | (((unsigned char)((source) >> ((3) * 8))) & 0x03)));
      break;
    case 6:
      target[5] = ((unsigned char)(0x80 | (((unsigned char)((source) >> ((0) * 8))) & 0x3f)));
      target[4] = ((unsigned char)(0x80 | (((unsigned char)((source) >> ((0) * 8))) >> 6) | ((((unsigned char)((source) >> ((1) * 8))) & 0x0f) << 2)));
      target[3] = ((unsigned char)(0x80 | (((unsigned char)((source) >> ((1) * 8))) >> 4) | ((((unsigned char)((source) >> ((2) * 8))) & 0x03) << 4)));
      target[2] = ((unsigned char)(0x80 | (((unsigned char)((source) >> ((2) * 8))) >> 2)));
      target[1] = ((unsigned char)(0x80 | (((unsigned char)((source) >> ((3) * 8))) & 0x3f)));
      target[0] = ((unsigned char)(0xfc | ((int)(((unsigned char)((source) >> ((3) * 8))) & 0x40) >> 6)));
      break;
    }
  }
  return rc;
}
```