user: Converte this assembly snippet into its equivalent C code:

```asm
<conv_expand>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x8,%rsp
  mov    D7(%rip),%rdi
  test   %rdi,%rdi
  je     L9
  call   <free@plt>
L9:
  mov    %rbx,%rdi
  call   <strlen@plt>
  lea    0x1(,%rax,4),%edi
  call   <malloc@plt>
  mov    %rax,D3(%rip)
  mov    %rax,%rbp
  test   %rax,%rax
  je     L126
  lea    0x1(%rbx),%r12
  movzbl (%rbx),%ebx
  test   %bl,%bl
  je     L15
  lea    D3(%rip),%r13
  nop
L184:
  lea    -0x7(%rbx),%eax
  cmp    $0x55,%al
  ja     L104
  movzbl %al,%eax
  movslq 0x0(%r13,%rax,4),%rax
  add    %r13,%rax
  notrack jmp *%rax
  nopl   (%rax)
L104:
  movzbl %bl,%edi
  call   <isprint@plt>
  mov    %eax,%r8d
  lea    0x1(%rbp),%rax
  test   %r8d,%r8d
  jne    L183
  movb   $0x5c,0x0(%rbp)
  test   %bl,%bl
  jns    L161
  movb   $0x4d,0x1(%rbp)
  lea    0x2(%rbp),%rax
  and    $0x7f,%ebx
L161:
  lea    0x2(%rax),%rbp
  cmp    $0x7f,%bl
  je     L106
  cmp    $0x1f,%bl
  jg     L109
  or     $0x40,%ebx
  add    $0x1,%r12
  movb   $0x5e,(%rax)
  mov    %bl,0x1(%rax)
  movzbl -0x1(%r12),%ebx
  test   %bl,%bl
  jne    L184
L207:
  mov    D3(%rip),%rax
L15:
  movb   $0x0,0x0(%rbp)
L74:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  cs nopw 0x0(%rax,%rax,1)
  mov    $0x74,%ebx
  nopl   (%rax)
L32:
  movb   $0x5c,0x0(%rbp)
  add    $0x2,%rbp
  mov    %bl,-0x1(%rbp)
L166:
  movzbl (%r12),%ebx
  add    $0x1,%r12
  test   %bl,%bl
  jne    L184
  jmp    L207
  cs nopw 0x0(%rax,%rax,1)
  mov    $0x65,%ebx
  jmp    L32
  nopw   0x0(%rax,%rax,1)
  mov    $0x72,%ebx
  jmp    L32
  nopw   0x0(%rax,%rax,1)
  mov    $0x66,%ebx
  jmp    L32
  nopw   0x0(%rax,%rax,1)
  mov    $0x76,%ebx
  jmp    L32
  nopw   0x0(%rax,%rax,1)
  mov    $0x6e,%ebx
  jmp    L32
  nopw   0x0(%rax,%rax,1)
  mov    $0x62,%ebx
  jmp    L32
  nopw   0x0(%rax,%rax,1)
  mov    $0x61,%ebx
  jmp    L32
  nopw   0x0(%rax,%rax,1)
L183:
  mov    %bl,0x0(%rbp)
  mov    %rax,%rbp
  jmp    L166
  nopl   0x0(%rax,%rax,1)
L109:
  movb   $0x2d,(%rax)
  mov    %bl,0x1(%rax)
  jmp    L166
  nopl   0x0(%rax,%rax,1)
L106:
  mov    $0x3f5e,%edx
  mov    %dx,(%rax)
  jmp    L166
L126:
  xor    %eax,%eax
  jmp    L74
```

tool_calls: name: read_data
arguments: data_label: D3
type: string

tool: 

assistant: ```c
char *conv_expand(const char *str) {
  static char *conv_str;
  char *cp;
  char ch;
  if (conv_str)
    free(conv_str);
  conv_str = malloc(4 * strlen(str) + 1);
  if (!conv_str)
    return NULL;
  cp = conv_str;
  while ((ch = *(const char *)str++) != '\0') {
    switch (ch) {
    case '\\':
      ch = '\\';
      break;
    case '\'':
      ch = '\'';
      break;
    case '"':
      ch = '"';
      break;
    case '\a':
      ch = 'a';
      break;
    case '\b':
      ch = 'b';
      break;
    case '\e':
      ch = 'e';
      break;
    case '\f':
      ch = 'f';
      break;
    case '\n':
      ch = 'n';
      break;
    case '\r':
      ch = 'r';
      break;
    case '\t':
      ch = 't';
      break;
    case '\v':
      ch = 'v';
      break;
    default:
      if (isprint((unsigned char)ch)) {
        *cp++ = ch;
        continue;
      }
      *cp++ = '\\';
      if (ch & 0200) {
        *cp++ = 'M';
        ch &= (char)~0200;
      }
      if (ch == 0177) {
        *cp++ = '^';
        *cp++ = '?';
        continue;
      }
      if (ch < 040) {
        *cp++ = '^';
        *cp++ = ch | 0100;
        continue;
      }
      *cp++ = '-';
      *cp++ = ch;
      continue;
    }
    *cp++ = '\\';
    *cp++ = ch;
  }
  *cp = 0;
  return conv_str;
}
```