user: 下面的汇编指令对应的C源代码是什么:

```asm
<uri_encode>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %rax,-0x10(%rbp)
  mov    -0x10(%rbp),%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  add    $0x1,%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  je     L14
  movq   $0x0,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x20(%rbp)
  jmp    L93
L44:
  mov    -0x38(%rbp),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0x21(%rbp)
  cmpb   $0x60,-0x21(%rbp)
  jle    L55
  cmpb   $0x7a,-0x21(%rbp)
  jg     L55
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  mov    -0x8(%rbp),%rdx
  add    %rax,%rdx
  movzbl -0x21(%rbp),%eax
  mov    %al,(%rdx)
  jmp    L98
L55:
  cmpb   $0x40,-0x21(%rbp)
  jle    L67
  cmpb   $0x5a,-0x21(%rbp)
  jg     L67
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  mov    -0x8(%rbp),%rdx
  add    %rax,%rdx
  movzbl -0x21(%rbp),%eax
  mov    %al,(%rdx)
  jmp    L98
L67:
  movsbl -0x21(%rbp),%eax
  mov    %eax,%esi
  lea    D9(%rip),%rax
  mov    %rax,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  je     L66
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  mov    -0x8(%rbp),%rdx
  add    %rax,%rdx
  movzbl -0x21(%rbp),%eax
  mov    %al,(%rdx)
  jmp    L98
L66:
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  mov    -0x8(%rbp),%rdx
  add    %rdx,%rax
  movb   $0x25,(%rax)
  movzbl -0x21(%rbp),%eax
  sar    $0x4,%al
  movsbl %al,%eax
  and    $0xf,%eax
  mov    %eax,%ecx
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  mov    -0x8(%rbp),%rdx
  add    %rax,%rdx
  movslq %ecx,%rax
  lea    D15(%rip),%rcx
  movzbl (%rax,%rcx,1),%eax
  mov    %al,(%rdx)
  movsbl -0x21(%rbp),%eax
  and    $0xf,%eax
  mov    %eax,%ecx
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  mov    -0x8(%rbp),%rdx
  add    %rax,%rdx
  movslq %ecx,%rax
  lea    D15(%rip),%rcx
  movzbl (%rax,%rcx,1),%eax
  mov    %al,(%rdx)
L98:
  addq   $0x1,-0x20(%rbp)
L93:
  mov    -0x20(%rbp),%rax
  cmp    -0x10(%rbp),%rax
  jb     L44
  mov    -0x8(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x8(%rbp),%rax
  jmp    L119
L14:
  nop
  mov    $0x0,%eax
L119:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: label: D9
type_infered: string
name: disassemble_data
arguments: label: D15
type_infered: string

tool: D9: 0123456789-_.~

tool: D15: 0123456789ABCDEF

assistant: ```c
char *uri_encode(const char *restrict string) {
  char *rc;
  size_t i, j, n;
  n = strlen(string);
  if (((rc = malloc((n * 3 + 1) * sizeof(char))) == NULL))
    goto fail;
  for (i = j = 0; i < n; i++) {
    char c = string[i];
    if (('a' <= c) && (c <= 'z'))
      rc[j++] = c;
    else if (('A' <= c) && (c <= 'Z'))
      rc[j++] = c;
    else if (strchr("0123456789-_.~", c))
      rc[j++] = c;
    else {
      rc[j++] = '%';
      rc[j++] = "0123456789ABCDEF"[(c >> 4) & 15];
      rc[j++] = "0123456789ABCDEF"[(c >> 0) & 15];
    }
  }
  rc[j] = '\0';
  return rc;
fail:
  return NULL;
}
```