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

```asm
<cst_make_url>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x8,%rsp
  call   <strlen@plt>
  cmp    $0x2,%eax
  jle    L121
  lea    D31(%rip),%rsi
  mov    %rbp,%rdi
  call   <strstr@plt>
  cmp    %rax,%rbp
  jb     L131
  lea    D4(%rip),%rsi
  mov    %rbp,%rdi
  xor    %r12d,%r12d
  call   <strstr@plt>
  lea    0x1(%rbp),%rdx
  cmp    %rax,%rdx
  je     L93
L18:
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L93:
  lea    D21(%rip),%rdi
  call   <xstrdup@plt>
  lea    0x2(%rbp),%rsi
  mov    %rax,%rdi
  movzbl 0x0(%rbp),%eax
  mov    %al,0x7(%rdi)
  movzbl 0x1(%rbp),%eax
  mov    %al,0x8(%rdi)
  call   <xstrappend@plt>
  mov    %rax,%r12
  mov    %rax,%rdi
  jmp    L108
  xchg   %ax,%ax
L133:
  movb   $0x2f,(%rax)
  lea    0x1(%rax),%rdi
L108:
  mov    $0x5c,%esi
  call   <strchr@plt>
  test   %rax,%rax
  jne    L133
  mov    %r12,%rdi
  xor    %ebx,%ebx
  jmp    L87
  nopl   (%rax)
L109:
  lea    0x1(%rax),%rdi
  add    $0x1,%ebx
L87:
  mov    $0x20,%esi
  call   <strchr@plt>
  test   %rax,%rax
  jne    L109
  test   %ebx,%ebx
  je     L18
  mov    %r12,%rdi
  mov    %r12,%r15
  lea    D12(%rip),%r13
  call   <strlen@plt>
  mov    $0x1,%esi
  lea    0x1(%rax,%rbx,2),%edi
  call   <xcalloc@plt>
  mov    %rax,%rbx
  mov    %rax,%rbp
  jmp    L61
  cs nopw 0x0(%rax,%rax,1)
L71:
  cmp    %r14,%r15
  je     L58
  mov    %r14d,%edx
  mov    %r15,%rsi
  mov    %rbp,%rdi
  sub    %r15d,%edx
  call   <strncpy@plt>
L58:
  mov    %rbp,%rdi
  mov    %r13,%rsi
  lea    0x1(%r14),%r15
  call   <strcat@plt>
  mov    %rbx,%rdi
  call   <strlen@plt>
  movslq %eax,%rbp
  add    %rbx,%rbp
L61:
  mov    $0x20,%esi
  mov    %r15,%rdi
  call   <strchr@plt>
  mov    %rax,%r14
  test   %rax,%rax
  jne    L71
  movzbl (%r15),%edx
  test   %dl,%dl
  je     L38
  xor    %eax,%eax
  nopw   0x0(%rax,%rax,1)
L77:
  mov    %dl,0x0(%rbp,%rax,1)
  add    $0x1,%rax
  movzbl (%r15,%rax,1),%edx
  test   %dl,%dl
  jne    L77
L38:
  mov    %r12,%rdi
  mov    %rbx,%r12
  call   <xfree@plt>
  jmp    L18
  nopl   0x0(%rax)
L121:
  xor    %r12d,%r12d
  jmp    L18
  nopl   0x0(%rax,%rax,1)
L131:
  add    $0x8,%rsp
  mov    %rbp,%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1110 <xstrdup@plt>
```

tool_calls: name: unpack_data
arguments: data_label: D31
data_type: string
name: unpack_data
arguments: data_label: D4
data_type: string
name: unpack_data
arguments: data_label: D21
data_type: string
name: unpack_data
arguments: data_label: D12
data_type: string

tool: D31: ://

tool: D4: :\

tool: D21: file://*:

tool: D12: %20

assistant: ```c
char *cst_make_url(char *str) {
  int len = strlen(str);
  char *res;
  if (len < 3)
    return NULL;
  if (strstr(str, "://") > str)
    return xstrdup(str);
  else if (strstr(str, ":\\") == str + 1) {
    res = xstrdup("file://*:");
    res[7] = *str++;
    res[8] = *str++;
    res = xstrappend(res, str);
    {
      char *c;
      int i;
      c = res;
      while ((c = strchr(c, '\\')))
        *c++ = '/';
      c = res;
      i = 0;
      while ((c = strchr(c, ' '))) {
        c++;
        i++;
      }
      if (i > 0) {
        char *src, *dest, *last;
        last = src = res;
        res = dest = xcalloc(strlen(src) + (2 * i) + 1, 1);
        while ((c = strchr(src, ' '))) {
          if (c != src)
            strncpy(dest, src, c - src);
          strcat(dest, "%20");
          c++;
          src = c;
          dest = res + strlen(res);
        }
        while (*src != '\0')
          *dest++ = *src++;
        xfree(last);
      }
    }
    return res;
  } else
    return NULL;
}
```