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

```asm
<_strToUtf8>:
  endbr64
  push   %r15
  mov    %rsi,%r10
  mov    %edx,%r15d
  lea    -0x1(%rdx),%r11d
  push   %r14
  xor    %edx,%edx
  mov    %rdi,%r14
  lea    D35(%rip),%rsi
  push   %r13
  xor    %r13d,%r13d
  push   %r12
  xor    %r12d,%r12d
  push   %rbp
  xor    %ebp,%ebp
  push   %rbx
  sub    $0x28,%rsp
  jmp    L38
  nopw   0x0(%rax,%rax,1)
L15:
  test   %r9d,%r9d
  je     L83
  mov    %ebx,%eax
  and    $0xffffffdf,%eax
  sub    $0x41,%eax
  cmp    $0x19,%al
  jbe    L83
  lea    -0x2e(%rbx),%eax
  cmp    $0xc,%al
  ja     L217
  nopl   0x0(%rax)
L83:
  mov    %bl,(%rdi)
  add    $0x1,%r12d
  add    $0x1,%r13d
  movslq %r12d,%rdx
L140:
  test   %bl,%bl
  je     L119
L38:
  movslq %ebp,%rax
  cmp    $0x1,%ecx
  lea    (%r14,%rdx,1),%rdi
  movzbl (%r10,%rax,1),%ebx
  sbb    $0xfffffffe,%ebp
  test   %bl,%bl
  js     L74
  cmp    %r11d,%r12d
  jl     L15
L74:
  lea    -0x2(%r15),%eax
  cmp    %r12d,%eax
  jle    L76
  test   %r9d,%r9d
  je     L213
  lea    -0x7(%r15),%eax
  cmp    %r12d,%eax
  jle    L140
  mov    %ebx,%edx
  mov    %r9d,0x1c(%rsp)
  shr    $0x6,%dl
  mov    %r8,0x10(%rsp)
  mov    %ecx,0x18(%rsp)
  or     $0xffffffc0,%edx
  mov    %r10,0x8(%rsp)
  movzbl %dl,%edx
  mov    %r11d,0x4(%rsp)
L78:
  call   <sprintf@plt>
  mov    %ebx,%edx
  lea    D35(%rip),%rsi
  add    %eax,%r12d
  and    $0x3f,%edx
  movslq %r12d,%rdi
  or     $0x80,%dl
  add    %r14,%rdi
L162:
  call   <sprintf@plt>
  add    $0x1,%r13d
  mov    0x4(%rsp),%r11d
  mov    0x8(%rsp),%r10
  add    %eax,%r12d
  mov    0x18(%rsp),%ecx
  mov    0x10(%rsp),%r8
  lea    D35(%rip),%rsi
  mov    0x1c(%rsp),%r9d
  movslq %r12d,%rdx
  test   %bl,%bl
  jne    L38
  nopl   (%rax)
L119:
  movb   $0x0,(%r14,%rdx,1)
  test   %r8,%r8
  je     L109
  mov    %r13d,(%r8)
L109:
  add    $0x28,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nop
L76:
  lea    -0x3(%r15),%eax
  cmp    %r12d,%eax
  jle    L10
  test   %r9d,%r9d
  je     L3
  lea    -0xa(%r15),%eax
  cmp    %r12d,%eax
  jle    L140
  mov    $0xf0,%edx
  mov    %r9d,0x1c(%rsp)
  mov    %r8,0x10(%rsp)
  mov    %ecx,0x18(%rsp)
  mov    %r10,0x8(%rsp)
  mov    %r11d,0x4(%rsp)
  call   <sprintf@plt>
  mov    %ebx,%edx
  lea    D35(%rip),%rsi
  add    %eax,%r12d
  shr    $0x6,%dl
  or     $0xffffff80,%edx
  movslq %r12d,%rdi
  movzbl %dl,%edx
  add    %r14,%rdi
  jmp    L78
  nopl   (%rax)
L213:
  mov    %ebx,%edx
  lea    0x1(%r12),%eax
  add    $0x2,%r12d
  shr    $0x6,%dl
  or     $0xffffffc0,%edx
  mov    %dl,(%rdi)
L165:
  mov    %ebx,%edx
  cltq
  add    $0x1,%r13d
  and    $0x3f,%edx
  or     $0xffffff80,%edx
  mov    %dl,(%r14,%rax,1)
  movslq %r12d,%rdx
  jmp    L140
  nopl   (%rax)
L10:
  lea    -0x4(%r15),%eax
  cmp    %r12d,%eax
  jg     L140
  jmp    L119
  nopw   0x0(%rax,%rax,1)
L3:
  movb   $0xf0,(%rdi)
  mov    %ebx,%edi
  lea    0x1(%r12),%edx
  lea    0x2(%r12),%eax
  shr    $0x6,%dil
  movslq %edx,%rdx
  add    $0x3,%r12d
  or     $0xffffff80,%edi
  mov    %dil,(%r14,%rdx,1)
  jmp    L165
  nopl   0x0(%rax,%rax,1)
L217:
  lea    -0x3f(%rbx),%eax
  test   $0xdf,%al
  je     L83
  lea    -0x4(%r15),%eax
  cmp    %r12d,%eax
  jle    L140
  mov    %r9d,0x1c(%rsp)
  movzbl %bl,%edx
  mov    %r8,0x10(%rsp)
  mov    %ecx,0x18(%rsp)
  mov    %r10,0x8(%rsp)
  mov    %r11d,0x4(%rsp)
  jmp    L162
```

tool_calls: name: disassemble_data
arguments: tag: D35
datatype: string

tool: D35: %%%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;
}
```