user: 请从给定的汇编指令推导出C源代码：

```asm
<cst_make_url>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbp
  call   <strlen@plt>
  cmp    $0x2,%eax
  jle    L103
  lea    D31(%rip),%rsi
  mov    %rbp,%rdi
  call   <strstr@plt>
  cmp    %rax,%rbp
  jb     L8
  lea    D38(%rip),%rsi
  mov    %rbp,%rdi
  call   <strstr@plt>
  lea    0x1(%rbp),%rdx
  mov    $0x0,%ebx
  cmp    %rax,%rdx
  je     L72
L133:
  mov    %rbx,%rax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L8:
  mov    %rbp,%rdi
  call   <xstrdup@plt>
  mov    %rax,%rbx
  jmp    L133
L72:
  lea    D25(%rip),%rdi
  call   <xstrdup@plt>
  mov    %rax,%rdi
  movzbl 0x0(%rbp),%eax
  mov    %al,0x7(%rdi)
  movzbl 0x1(%rbp),%eax
  mov    %al,0x8(%rdi)
  lea    0x2(%rbp),%rsi
  call   <xstrappend@plt>
  mov    %rax,%rbx
  mov    %rax,%rdi
  jmp    L127
L54:
  lea    0x1(%rax),%rdi
  movb   $0x2f,(%rax)
L127:
  mov    $0x5c,%esi
  call   <strchr@plt>
  test   %rax,%rax
  jne    L54
  mov    %rbx,%rdi
  mov    $0x0,%ebp
  jmp    L99
L65:
  lea    0x1(%rax),%rdi
  add    $0x1,%ebp
L99:
  mov    $0x20,%esi
  call   <strchr@plt>
  test   %rax,%rax
  jne    L65
  test   %ebp,%ebp
  jle    L133
  mov    %rbx,%rdi
  call   <strlen@plt>
  lea    0x1(%rax,%rbp,2),%edi
  mov    $0x1,%esi
  call   <xcalloc@plt>
  mov    %rax,%r14
  mov    %rax,%rbp
  mov    %rbx,%r13
  lea    D33(%rip),%r15
  jmp    L14
L11:
  mov    %r15,%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  lea    0x1(%r12),%r13
  mov    %r14,%rdi
  call   <strlen@plt>
  movslq %eax,%rbp
  add    %r14,%rbp
L14:
  mov    $0x20,%esi
  mov    %r13,%rdi
  call   <strchr@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L39
  cmp    %r12,%r13
  je     L11
  mov    %r12d,%edx
  sub    %r13d,%edx
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <strncpy@plt>
  jmp    L11
L39:
  movzbl 0x0(%r13),%edx
  test   %dl,%dl
  je     L143
  mov    $0x0,%eax
L158:
  mov    %dl,0x0(%rbp,%rax,1)
  add    $0x1,%rax
  movzbl 0x0(%r13,%rax,1),%edx
  test   %dl,%dl
  jne    L158
L143:
  mov    %rbx,%rdi
  call   <xfree@plt>
  mov    %r14,%rbx
  jmp    L133
L103:
  mov    $0x0,%ebx
  jmp    L133
```

tool_calls: name: unpack_data
arguments: data_tag: D31
type_infered: string
name: unpack_data
arguments: data_tag: D38
type_infered: string
name: unpack_data
arguments: data_tag: D25
type_infered: string
name: unpack_data
arguments: data_tag: D33
type_infered: string

tool: D31: ://

tool: D38: :\

tool: D25: file://*:

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