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

```asm
<MapsWithMe_UrlEncodeString>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    -0x30(%rbp),%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  add    $0x1,%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,%rdx
  mov    -0x38(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0x38(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,-0x8(%rbp)
  movq   $0x0,-0x10(%rbp)
  jmp    L96
L123:
  mov    -0x28(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0x11(%rbp)
  movzbl -0x11(%rbp),%eax
  cmp    $0x7f,%eax
  jg     L29
  cmp    $0x5b,%eax
  jge    L67
  cmp    $0x40,%eax
  jg     L29
  cmp    $0x3a,%eax
  jge    L114
  cmp    $0x2c,%eax
  jg     L101
  test   %eax,%eax
  jns    L114
  jmp    L29
L67:
  sub    $0x5b,%eax
  movabs $0x170000002d,%rdx
  mov    %eax,%ecx
  shr    %cl,%rdx
  mov    %rdx,%rax
  and    $0x1,%eax
  test   %rax,%rax
  setne  %al
  test   %al,%al
  jne    L114
  jmp    L29
L101:
  cmp    $0x2f,%eax
  jne    L29
L114:
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  movb   $0x25,(%rax)
  movzbl -0x11(%rbp),%eax
  shr    $0x4,%al
  movzbl %al,%ecx
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  movslq %ecx,%rdx
  lea    D15(%rip),%rcx
  movzbl (%rdx,%rcx,1),%edx
  mov    %dl,(%rax)
  movzbl -0x11(%rbp),%eax
  and    $0xf,%eax
  mov    %eax,%ecx
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  movslq %ecx,%rdx
  lea    D15(%rip),%rcx
  movzbl (%rdx,%rcx,1),%edx
  mov    %dl,(%rax)
  jmp    L12
L29:
  mov    -0x28(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  movzbl (%rcx),%edx
  mov    %dl,(%rax)
L12:
  addq   $0x1,-0x10(%rbp)
L96:
  mov    -0x10(%rbp),%rax
  cmp    -0x30(%rbp),%rax
  jb     L123
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  movb   $0x0,(%rax)
  mov    -0x38(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x8(%rbp),%rax
  sub    %rdx,%rax
  sub    $0x1,%rax
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D15
type_infered: string

tool: D15: 0123456789ABCDEF

assistant: ```c
size_t MapsWithMe_UrlEncodeString(char const *s, size_t size, char **res) {
  size_t i;
  char *out;
  *res = malloc(size * 3 + 1);
  out = *res;
  for (i = 0; i < size; ++i) {
    unsigned char c = (unsigned char)(s[i]);
    switch (c) {
    case 0x00:
    case 0x01:
    case 0x02:
    case 0x03:
    case 0x04:
    case 0x05:
    case 0x06:
    case 0x07:
    case 0x08:
    case 0x09:
    case 0x0A:
    case 0x0B:
    case 0x0C:
    case 0x0D:
    case 0x0E:
    case 0x0F:
    case 0x10:
    case 0x11:
    case 0x12:
    case 0x13:
    case 0x14:
    case 0x15:
    case 0x16:
    case 0x17:
    case 0x18:
    case 0x19:
    case 0x1A:
    case 0x1B:
    case 0x1C:
    case 0x1D:
    case 0x1E:
    case 0x1F:
    case 0x7F:
    case ' ':
    case '<':
    case '>':
    case '#':
    case '%':
    case '"':
    case '!':
    case '*':
    case '\'':
    case '(':
    case ')':
    case ';':
    case ':':
    case '@':
    case '&':
    case '=':
    case '+':
    case '$':
    case ',':
    case '/':
    case '?':
    case '[':
    case ']':
    case '{':
    case '}':
    case '|':
    case '^':
    case '`':
      *(out++) = '%';
      *(out++) = "0123456789ABCDEF"[c >> 4];
      *(out++) = "0123456789ABCDEF"[c & 15];
      break;
    default:
      *(out++) = s[i];
    }
  }
  *(out++) = 0;
  return out - *res - 1;
}
```