user: What would the C source look like for the assembly code provided here:

```asm
<oauth_url_escape>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x48(%rbp)
  movq   $0x0,-0x20(%rbp)
  movq   $0x0,-0x8(%rbp)
  movq   $0x0,-0x18(%rbp)
  cmpq   $0x0,-0x48(%rbp)
  jne    L46
  lea    D18(%rip),%rax
  mov    %rax,%rdi
  call   <strdup@plt>
  jmp    L9
L46:
  mov    -0x48(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  add    $0x1,%eax
  cltq
  mov    %rax,-0x30(%rbp)
  mov    -0x30(%rbp),%rax
  mov    %rax,-0x28(%rbp)
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x20(%rbp)
  mov    -0x30(%rbp),%rax
  sub    $0x1,%rax
  mov    %rax,-0x10(%rbp)
  jmp    L64
L20:
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0x31(%rbp)
  movzbl -0x31(%rbp),%eax
  cmp    $0x7e,%eax
  jg     L128
  cmp    $0x41,%eax
  jge    L6
  cmp    $0x2e,%eax
  jg     L96
  cmp    $0x2d,%eax
  jge    L58
  jmp    L128
L6:
  sub    $0x41,%eax
  movabs $0x23ffffff43ffffff,%rdx
  mov    %eax,%ecx
  shr    %cl,%rdx
  mov    %rdx,%rax
  and    $0x1,%eax
  test   %rax,%rax
  setne  %al
  test   %al,%al
  jne    L58
  jmp    L128
L96:
  sub    $0x30,%eax
  cmp    $0x9,%eax
  ja     L128
L58:
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  mov    -0x20(%rbp),%rdx
  add    %rax,%rdx
  movzbl -0x31(%rbp),%eax
  mov    %al,(%rdx)
  jmp    L108
L128:
  addq   $0x2,-0x28(%rbp)
  mov    -0x28(%rbp),%rax
  cmp    -0x30(%rbp),%rax
  jbe    L25
  shlq   -0x30(%rbp)
  mov    -0x30(%rbp),%rdx
  mov    -0x20(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <realloc@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %rax,-0x20(%rbp)
L25:
  movzbl -0x31(%rbp),%eax
  mov    -0x20(%rbp),%rcx
  mov    -0x18(%rbp),%rdx
  lea    (%rcx,%rdx,1),%rdi
  mov    %eax,%ecx
  lea    D15(%rip),%rax
  mov    %rax,%rdx
  mov    $0x4,%esi
  call   <snprintf@plt>
  addq   $0x3,-0x18(%rbp)
  nop
L108:
  addq   $0x1,-0x48(%rbp)
L64:
  mov    -0x10(%rbp),%rax
  lea    -0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  test   %rax,%rax
  jne    L20
  mov    -0x20(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x20(%rbp),%rax
L9:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: tag: D18
data_type: string
name: disassemble_data
arguments: tag: D15
data_type: string

tool: 

tool: D15: %%%02X

assistant: ```c
char *oauth_url_escape(const char *string) {
  size_t alloc, newlen;
  char *ns = NULL, *testing_ptr = NULL;
  unsigned char in;
  size_t strindex = 0;
  size_t length;
  if (!string)
    return strdup("");
  alloc = strlen(string) + 1;
  newlen = alloc;
  ns = (char *)malloc(alloc);
  length = alloc - 1;
  while (length--) {
    in = *string;
    switch (in) {
    case '0':
    case '1':
    case '2':
    case '3':
    case '4':
    case '5':
    case '6':
    case '7':
    case '8':
    case '9':
    case 'a':
    case 'b':
    case 'c':
    case 'd':
    case 'e':
    case 'f':
    case 'g':
    case 'h':
    case 'i':
    case 'j':
    case 'k':
    case 'l':
    case 'm':
    case 'n':
    case 'o':
    case 'p':
    case 'q':
    case 'r':
    case 's':
    case 't':
    case 'u':
    case 'v':
    case 'w':
    case 'x':
    case 'y':
    case 'z':
    case 'A':
    case 'B':
    case 'C':
    case 'D':
    case 'E':
    case 'F':
    case 'G':
    case 'H':
    case 'I':
    case 'J':
    case 'K':
    case 'L':
    case 'M':
    case 'N':
    case 'O':
    case 'P':
    case 'Q':
    case 'R':
    case 'S':
    case 'T':
    case 'U':
    case 'V':
    case 'W':
    case 'X':
    case 'Y':
    case 'Z':
    case '_':
    case '~':
    case '.':
    case '-':
      ns[strindex++] = in;
      break;
    default:
      newlen += 2;
      if (newlen > alloc) {
        alloc *= 2;
        testing_ptr = (char *)realloc(ns, alloc);
        ns = testing_ptr;
      }
      snprintf(&ns[strindex], 4, "%%%02X", in);
      strindex += 3;
      break;
    }
    string++;
  }
  ns[strindex] = 0;
  return ns;
}
```