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

```asm
<_strToUtf8>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,%r14
  mov    %rsi,%r15
  mov    %edx,0xc(%rsp)
  mov    %ecx,0x8(%rsp)
  mov    %r8,0x18(%rsp)
  mov    %r9d,0x10(%rsp)
  lea    -0x1(%rdx),%eax
  mov    %eax,0x14(%rsp)
  mov    $0x0,%r13d
  mov    $0x0,%ebx
  mov    $0x0,%r12d
  jmp    L117
L58:
  mov    0xc(%rsp),%eax
  sub    $0x4,%eax
  cmp    %ebx,%eax
  jle    L97
  movzbl %bpl,%edx
  movslq %ebx,%rdi
  add    %r14,%rdi
  lea    D26(%rip),%rsi
  call   <sprintf@plt>
  add    %eax,%ebx
  add    $0x1,%r13d
  jmp    L97
L52:
  movslq %ebx,%rax
  mov    %bpl,(%r14,%rax,1)
  add    $0x1,%r13d
  lea    0x1(%rbx),%ebx
L97:
  test   %bpl,%bpl
  je     L57
L117:
  movslq %r12d,%rax
  movzbl (%r15,%rax,1),%ebp
  cmpl   $0x1,0x8(%rsp)
  sbb    $0xfffffffe,%r12d
  test   %bpl,%bpl
  js     L102
  cmp    0x14(%rsp),%ebx
  jge    L102
  cmpl   $0x0,0x10(%rsp)
  je     L52
  mov    %ebp,%eax
  and    $0xffffffdf,%eax
  sub    $0x41,%eax
  cmp    $0x19,%al
  jbe    L86
  lea    -0x2e(%rbp),%eax
  cmp    $0xc,%al
  jbe    L86
  lea    -0x3f(%rbp),%eax
  test   $0xdf,%al
  jne    L58
L86:
  movslq %ebx,%rax
  mov    %bpl,(%r14,%rax,1)
  add    $0x1,%r13d
  lea    0x1(%rbx),%ebx
  jmp    L97
L102:
  mov    0xc(%rsp),%esi
  lea    -0x2(%rsi),%eax
  cmp    %ebx,%eax
  jle    L71
  cmpl   $0x0,0x10(%rsp)
  je     L224
  lea    -0x7(%rsi),%eax
  cmp    %ebx,%eax
  jle    L97
  mov    %ebp,%edx
  shr    $0x6,%dl
  or     $0xffffffc0,%edx
  movzbl %dl,%edx
  movslq %ebx,%rdi
  add    %r14,%rdi
  lea    D26(%rip),%rsi
  call   <sprintf@plt>
  add    %eax,%ebx
  mov    %ebp,%edx
  and    $0x3f,%edx
  or     $0x80,%dl
  movslq %ebx,%rdi
  add    %r14,%rdi
  lea    D26(%rip),%rsi
  call   <sprintf@plt>
  add    %eax,%ebx
  add    $0x1,%r13d
  jmp    L97
L224:
  lea    0x1(%rbx),%eax
  movslq %ebx,%rcx
  mov    %ebp,%edx
  shr    $0x6,%dl
  or     $0xffffffc0,%edx
  mov    %dl,(%r14,%rcx,1)
  add    $0x2,%ebx
  cltq
  mov    %ebp,%edx
  and    $0x3f,%edx
  or     $0xffffff80,%edx
  mov    %dl,(%r14,%rax,1)
  add    $0x1,%r13d
  jmp    L97
L71:
  mov    0xc(%rsp),%ecx
  lea    -0x3(%rcx),%eax
  cmp    %ebx,%eax
  jle    L167
  cmpl   $0x0,0x10(%rsp)
  je     L54
  lea    -0xa(%rcx),%eax
  cmp    %ebx,%eax
  jle    L97
  movslq %ebx,%rdi
  add    %r14,%rdi
  mov    $0xf0,%edx
  lea    D26(%rip),%rsi
  call   <sprintf@plt>
  add    %eax,%ebx
  mov    %ebp,%edx
  shr    $0x6,%dl
  or     $0xffffff80,%edx
  movzbl %dl,%edx
  movslq %ebx,%rdi
  add    %r14,%rdi
  lea    D26(%rip),%rsi
  call   <sprintf@plt>
  add    %eax,%ebx
  mov    %ebp,%edx
  and    $0x3f,%edx
  or     $0x80,%dl
  movslq %ebx,%rdi
  add    %r14,%rdi
  lea    D26(%rip),%rsi
  call   <sprintf@plt>
  add    %eax,%ebx
  add    $0x1,%r13d
  jmp    L97
L54:
  movslq %ebx,%rax
  movb   $0xf0,(%r14,%rax,1)
  lea    0x2(%rbx),%eax
  lea    0x1(%rbx),%edx
  movslq %edx,%rdx
  mov    %ebp,%ecx
  shr    $0x6,%cl
  or     $0xffffff80,%ecx
  mov    %cl,(%r14,%rdx,1)
  add    $0x3,%ebx
  cltq
  mov    %ebp,%edx
  and    $0x3f,%edx
  or     $0xffffff80,%edx
  mov    %dl,(%r14,%rax,1)
  add    $0x1,%r13d
  jmp    L97
L167:
  mov    0xc(%rsp),%eax
  sub    $0x4,%eax
  cmp    %ebx,%eax
  jg     L97
L57:
  movslq %ebx,%rax
  movb   $0x0,(%r14,%rax,1)
  mov    0x18(%rsp),%rax
  test   %rax,%rax
  je     L127
  mov    %r13d,(%rax)
L127:
  mov    %ebx,%eax
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: disassemble_data
arguments: data_label: D26
datatype: string

tool: D26: %%%x

assistant: ```c
int _strToUtf8(char *dest, const char *src, int destSize, int isWide, int *charactersConverted, int uriEscape) {
  wchar_t wcv;
  int i, j;
  int cc;
  int destLen;
  destLen = destSize - 1;
  cc = 0;
  i = 0;
  wcv = 0;
  j = 0;
  do {
    wcv = (unsigned char)src[i++];
    if (isWide != 0) {
      wcv |= (((unsigned char)src[i++]) << 8);
    }
    if ((wcv < 0x80) && (j < destLen)) {
      if (uriEscape != 0) {
        if (((((char)wcv >= 0x30) && ((char)wcv <= 0x39)) || (((char)wcv >= 0x41) && ((char)wcv <= 0x5A)) || (((char)wcv >= 0x61) && ((char)wcv <= 0x7A)) || ((char)wcv == 0x2E) || ((char)wcv == 0x2F) || ((char)wcv == 0x3A) || ((char)wcv == 0x36) || ((char)wcv == 0x5F) || ((char)wcv == 0x3F))) {
          dest[j++] = (char)wcv;
          cc++;
        } else if (j < destLen - 3) {
          j += sprintf(dest + j, "%%%x", wcv);
          cc++;
        }
      } else {
        dest[j++] = (char)wcv;
        cc++;
      }
    } else if ((wcv < 0x0800) && (j < destLen - 1)) {
      if (uriEscape != 0) {
        if (j < destLen - 6) {
          j += sprintf(dest + j, "%%%x", ((wcv >> 6) | 0xC0));
          j += sprintf(dest + j, "%%%x", ((wcv & 0x3F) | 0x80));
          cc++;
        }
      } else {
        dest[j++] = (char)((wcv >> 6) | 0xC0);
        dest[j++] = (char)((wcv & 0x3F) | 0x80);
        cc++;
      }
    } else if ((wcv < 0x10000) && (j < destLen - 2)) {
      if (uriEscape != 0) {
        if (j < destLen - 9) {
          j += sprintf(dest + j, "%%%x", ((wcv >> 12) | 0xF0));
          j += sprintf(dest + j, "%%%x", (((wcv >> 6) & 0x3F) | 0x80));
          j += sprintf(dest + j, "%%%x", ((wcv & 0x3F) | 0x80));
          cc++;
        }
      } else {
        dest[j++] = (char)((wcv >> 12) | 0xF0);
        dest[j++] = (char)(((wcv >> 6) & 0x3F) | 0x80);
        dest[j++] = (char)((wcv & 0x3F) | 0x80);
        cc++;
      }
    } else if (j < destLen - 3) {
    } else {
      break;
    }
  } while (wcv != 0);
  dest[j] = '\0';
  if (charactersConverted != NULL) {
    *charactersConverted = cc;
  }
  return j;
}
```