user: What is the c source code of the assembly code below:

```asm
<encodeUTF8str>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  call   <strlen@plt>
  lea    0x1(%rax),%edi
  mov    %rax,0x8(%rsp)
  call   <malloc@plt>
  xor    %esi,%esi
  mov    %rax,%rbp
  mov    0x8(%rsp),%rax
  mov    %rbp,%rdi
  lea    0x1(%rax),%rdx
  call   <memset@plt>
  movsbl (%rbx),%edi
  test   %dil,%dil
  je     L110
  mov    %rbx,%r8
  xor    %r15d,%r15d
  xor    %r14d,%r14d
  movabs $0x400000000002001,%r12
  jmp    L47
  xchg   %ax,%ax
L145:
  lea    -0x22(%rdi),%eax
  cmp    $0x3a,%al
  ja     L56
  bt     %rax,%r12
  jb     L75
L37:
  mov    %dil,0x0(%rbp,%r15,1)
  add    $0x1,%r14
  add    $0x1,%r15
L132:
  lea    (%rbx,%r14,1),%r8
  movsbl (%r8),%edi
  test   %dil,%dil
  je     L110
L47:
  cmp    $0x1f,%dil
  ja     L145
L75:
  lea    0x10(%rsp),%rsi
  add    $0x1,%r14
  movq   $0x0,0x10(%rsp)
  call   <encodeControlChar@plt>
  mov    0x10(%rsp),%rcx
  mov    %r15,%r8
  mov    %rbp,%rdi
  mov    %rax,%r13
  lea    0x8(%rsp),%rsi
  mov    %rax,%rdx
  call   <insertSubString@plt>
  mov    %r13,%rdi
  mov    %rax,%rbp
  call   <free@plt>
  lea    (%rbx,%r14,1),%r8
  add    0x10(%rsp),%r15
  movsbl (%r8),%edi
  test   %dil,%dil
  jne    L47
L110:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L5
  add    $0x28,%rsp
  mov    %rbp,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  cs nopw 0x0(%rax,%rax,1)
L56:
  test   %dil,%dil
  jns    L37
  movq   $0x0,0x10(%rsp)
  test   $0x40,%dil
  je     L159
  mov    %edi,%eax
  and    $0x60,%eax
  cmp    $0x40,%al
  je     L129
  cmp    $0x60,%al
  je     L87
L46:
  and    $0x78,%edi
  xor    %esi,%esi
  cmp    $0x70,%dil
  je     L183
L153:
  mov    %r8,%rdi
  lea    0x10(%rsp),%rdx
  call   <highCharToUnicode@plt>
  mov    0x10(%rsp),%rcx
  mov    %r15,%r8
  mov    %rbp,%rdi
  mov    %rax,%r13
  lea    0x8(%rsp),%rsi
  mov    %rax,%rdx
  call   <insertSubString@plt>
  mov    %r13,%rdi
  mov    %rax,%rbp
  call   <free@plt>
  add    0x10(%rsp),%r15
  jmp    L132
  nopl   (%rax)
L159:
  mov    $0x1,%eax
L139:
  add    %rax,%r14
  jmp    L132
  nopl   (%rax)
L129:
  add    $0x2,%r14
  mov    $0x2,%esi
  jmp    L153
  nopl   0x0(%rax,%rax,1)
L87:
  test   $0x10,%dil
  jne    L46
  add    $0x3,%r14
  mov    $0x3,%esi
  jmp    L153
  nopl   0x0(%rax)
L183:
  mov    $0x4,%eax
  jmp    L139
L5:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
char *encodeUTF8str(const char *str) {
  char *out = NULL;
  size_t len = strlen(str);
  size_t i = 0, o = 0;
  out = malloc(sizeof(char) * (len + 1));
  memset(out, 0, len + 1);
  while (str[i] != '\0') {
    unsigned char s = (unsigned char)str[i];
    if (s < 32 || str[i] == '"' || str[i] == '\\' || str[i] == '/') {
      size_t sublen = 0;
      char *substr = encodeControlChar(str[i], &sublen);
      out = insertSubString(out, &len, substr, sublen, o);
      free(substr);
      o += sublen;
      i++;
    } else if (s & 128) {
      char *substr = NULL;
      size_t sublen = 0;
      size_t ulen = 0;
      if ((s & 128) && !(s & 64)) {
        ulen = 1;
      } else if ((s & 128) && (s & 64) && !(s & 32)) {
        ulen = 2;
      } else if ((s & 128) && (s & 64) && (s & 32) && !(s & 16)) {
        ulen = 3;
      } else if ((s & 128) && (s & 64) && (s & 32) && (s & 16) && !(s & 8)) {
        ulen = 4;
      }
      if (ulen == 1 || ulen == 4) {
        i += ulen;
        continue;
      }
      substr = highCharToUnicode(&str[i], ulen, &sublen);
      out = insertSubString(out, &len, substr, sublen, o);
      free(substr);
      o += sublen;
      i += ulen;
    } else {
      out[o] = str[i];
      o++;
      i++;
    }
  }
  return out;
}
```