user: 请将以下的汇编代码转换成C语言代码:

```asm
<utf8_encode>:
  endbr64
  push   %r12
  mov    %rdx,%r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %rsi,%rbx
  call   <strlen@plt>
  mov    %rax,%rsi
  test   %rax,%rax
  je     L98
  lea    -0x1(%rax),%rax
  cmp    $0xe,%rax
  jbe    L90
  mov    %rsi,%rdx
  pxor   %xmm4,%xmm4
  pxor   %xmm6,%xmm6
  mov    %rbp,%rax
  and    $0xfffffffffffffff0,%rdx
  movdqa D0(%rip),%xmm7
  pxor   %xmm5,%xmm5
  pxor   %xmm3,%xmm3
  add    %rbp,%rdx
  nopl   (%rax)
L123:
  movdqu (%rax),%xmm2
  movdqa %xmm6,%xmm0
  add    $0x10,%rax
  pcmpgtb %xmm2,%xmm0
  pand   %xmm7,%xmm0
  movdqa %xmm0,%xmm1
  punpckhbw %xmm6,%xmm0
  punpcklbw %xmm6,%xmm1
  movdqa %xmm0,%xmm2
  punpckhwd %xmm5,%xmm0
  movdqa %xmm1,%xmm8
  punpckhwd %xmm5,%xmm1
  punpcklwd %xmm5,%xmm2
  movdqa %xmm1,%xmm9
  punpcklwd %xmm5,%xmm8
  punpckhdq %xmm3,%xmm1
  punpckldq %xmm3,%xmm9
  paddq  %xmm9,%xmm1
  movdqa %xmm8,%xmm9
  punpckhdq %xmm3,%xmm8
  punpckldq %xmm3,%xmm9
  paddq  %xmm9,%xmm8
  paddq  %xmm8,%xmm1
  movdqa %xmm2,%xmm8
  punpckhdq %xmm3,%xmm2
  punpckldq %xmm3,%xmm8
  paddq  %xmm8,%xmm2
  movdqa %xmm0,%xmm8
  punpckhdq %xmm3,%xmm0
  punpckldq %xmm3,%xmm8
  paddq  %xmm4,%xmm0
  paddq  %xmm8,%xmm2
  paddq  %xmm2,%xmm1
  movdqa %xmm1,%xmm4
  paddq  %xmm0,%xmm4
  cmp    %rax,%rdx
  jne    L123
  movdqa %xmm4,%xmm0
  mov    %rsi,%rax
  psrldq $0x8,%xmm0
  and    $0xfffffffffffffff0,%rax
  paddq  %xmm0,%xmm4
  movq   %xmm4,%rcx
  add    %rsi,%rcx
  test   $0xf,%sil
  je     L34
L148:
  cmpb   $0x80,0x0(%rbp,%rax,1)
  lea    0x1(%rax),%rdx
  sbb    $0xffffffffffffffff,%rcx
  cmp    %rsi,%rdx
  jae    L34
  cmpb   $0x80,0x1(%rbp,%rax,1)
  lea    0x2(%rax),%rdx
  sbb    $0xffffffffffffffff,%rcx
  cmp    %rdx,%rsi
  jbe    L34
  cmpb   $0x80,0x2(%rbp,%rax,1)
  lea    0x3(%rax),%rdx
  sbb    $0xffffffffffffffff,%rcx
  cmp    %rdx,%rsi
  jbe    L34
  cmpb   $0x80,0x3(%rbp,%rax,1)
  lea    0x4(%rax),%rdx
  sbb    $0xffffffffffffffff,%rcx
  cmp    %rdx,%rsi
  jbe    L34
  cmpb   $0x80,0x4(%rbp,%rax,1)
  lea    0x5(%rax),%rdx
  sbb    $0xffffffffffffffff,%rcx
  cmp    %rdx,%rsi
  jbe    L34
  cmpb   $0x80,0x5(%rbp,%rax,1)
  lea    0x6(%rax),%rdx
  sbb    $0xffffffffffffffff,%rcx
  cmp    %rdx,%rsi
  jbe    L34
  cmpb   $0x80,0x6(%rbp,%rax,1)
  lea    0x7(%rax),%rdx
  sbb    $0xffffffffffffffff,%rcx
  cmp    %rdx,%rsi
  jbe    L34
  cmpb   $0x80,0x7(%rbp,%rax,1)
  lea    0x8(%rax),%rdx
  sbb    $0xffffffffffffffff,%rcx
  cmp    %rdx,%rsi
  jbe    L34
  cmpb   $0x80,0x8(%rbp,%rax,1)
  lea    0x9(%rax),%rdx
  sbb    $0xffffffffffffffff,%rcx
  cmp    %rdx,%rsi
  jbe    L34
  cmpb   $0x80,0x9(%rbp,%rax,1)
  lea    0xa(%rax),%rdx
  sbb    $0xffffffffffffffff,%rcx
  cmp    %rdx,%rsi
  jbe    L34
  cmpb   $0x80,0xa(%rbp,%rax,1)
  lea    0xb(%rax),%rdx
  sbb    $0xffffffffffffffff,%rcx
  cmp    %rdx,%rsi
  jbe    L34
  cmpb   $0x80,0xb(%rbp,%rax,1)
  lea    0xc(%rax),%rdx
  sbb    $0xffffffffffffffff,%rcx
  cmp    %rdx,%rsi
  jbe    L34
  cmpb   $0x80,0xc(%rbp,%rax,1)
  lea    0xd(%rax),%rdx
  sbb    $0xffffffffffffffff,%rcx
  cmp    %rdx,%rsi
  jbe    L34
  cmpb   $0x80,0xd(%rbp,%rax,1)
  lea    0xe(%rax),%rdx
  sbb    $0xffffffffffffffff,%rcx
  cmp    %rdx,%rsi
  jbe    L34
  cmpb   $0x80,0xe(%rbp,%rax,1)
  sbb    $0xffffffffffffffff,%rcx
L34:
  mov    %rbx,%r9
  mov    %r12,%rdx
  lea    D5(%rip),%r8
  mov    %rbp,%rdi
  call   <convert@plt>
  pop    %rbx
  pop    %rbp
  sar    $0x1f,%eax
  pop    %r12
  ret
  nopl   0x0(%rax)
L98:
  xor    %ecx,%ecx
  jmp    L34
L90:
  mov    %rsi,%rcx
  xor    %eax,%eax
  jmp    L148
```

tool_calls: name: read_data
arguments: data_label: D0
type_guessed: byte[16]
name: read_data
arguments: data_label: D5
type_guessed: string

tool: {"D0": [0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01]}

tool: D5: UTF-8

assistant: ```c
int utf8_encode(const char *inbuf, const char *encoding, char **outbuf) {
  size_t inbuf_size, outbuf_size, i;
  int rc;
  inbuf_size = strlen(inbuf);
  outbuf_size = inbuf_size;
  for (i = 0; i < inbuf_size; i++) {
    unsigned char ch;
    ch = inbuf[i];
    if (ch > 127)
      outbuf_size++;
  }
  rc = convert(inbuf, inbuf_size, outbuf, outbuf_size, "UTF-8", encoding);
  return rc < 0 ? -1 : 0;
}
```