user: Please show me the C implementation that matches the assembly code listed below:

```asm
<conv_expand>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x8,%rsp
  mov    D31(%rip),%rdi
  test   %rdi,%rdi
  je     L196
  call   <free@plt>
L196:
  mov    %rbx,%rdi
  call   <strlen@plt>
  lea    0x1(,%rax,4),%edi
  call   <malloc@plt>
  mov    %rax,D4(%rip)
  mov    %rax,%rbp
  test   %rax,%rax
  je     L219
  lea    0x1(%rbx),%r12
  movzbl (%rbx),%ebx
  test   %bl,%bl
  je     L170
  lea    D4(%rip),%r13
  nop
L91:
  lea    -0x7(%rbx),%eax
  cmp    $0x55,%al
  ja     L50
  movzbl %al,%eax
  movslq 0x0(%r13,%rax,4),%rax
  add    %r13,%rax
  notrack jmp *%rax
  nopl   (%rax)
L50:
  movzbl %bl,%edi
  call   <isprint@plt>
  mov    %eax,%r8d
  lea    0x1(%rbp),%rax
  test   %r8d,%r8d
  jne    L87
  movb   $0x5c,0x0(%rbp)
  test   %bl,%bl
  jns    L20
  movb   $0x4d,0x1(%rbp)
  lea    0x2(%rbp),%rax
  and    $0x7f,%ebx
L20:
  lea    0x2(%rax),%rbp
  cmp    $0x7f,%bl
  je     L156
  cmp    $0x1f,%bl
  jg     L89
  or     $0x40,%ebx
  add    $0x1,%r12
  movb   $0x5e,(%rax)
  mov    %bl,0x1(%rax)
  movzbl -0x1(%r12),%ebx
  test   %bl,%bl
  jne    L91
L90:
  mov    D4(%rip),%rax
L170:
  movb   $0x0,0x0(%rbp)
L33:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  cs nopw 0x0(%rax,%rax,1)
  mov    $0x74,%ebx
  nopl   (%rax)
L94:
  movb   $0x5c,0x0(%rbp)
  add    $0x2,%rbp
  mov    %bl,-0x1(%rbp)
L13:
  movzbl (%r12),%ebx
  add    $0x1,%r12
  test   %bl,%bl
  jne    L91
  jmp    L90
  cs nopw 0x0(%rax,%rax,1)
  mov    $0x65,%ebx
  jmp    L94
  nopw   0x0(%rax,%rax,1)
  mov    $0x72,%ebx
  jmp    L94
  nopw   0x0(%rax,%rax,1)
  mov    $0x66,%ebx
  jmp    L94
  nopw   0x0(%rax,%rax,1)
  mov    $0x76,%ebx
  jmp    L94
  nopw   0x0(%rax,%rax,1)
  mov    $0x6e,%ebx
  jmp    L94
  nopw   0x0(%rax,%rax,1)
  mov    $0x62,%ebx
  jmp    L94
  nopw   0x0(%rax,%rax,1)
  mov    $0x61,%ebx
  jmp    L94
  nopw   0x0(%rax,%rax,1)
L87:
  mov    %bl,0x0(%rbp)
  mov    %rax,%rbp
  jmp    L13
  nopl   0x0(%rax,%rax,1)
L89:
  movb   $0x2d,(%rax)
  mov    %bl,0x1(%rax)
  jmp    L13
  nopl   0x0(%rax,%rax,1)
L156:
  mov    $0x3f5e,%edx
  mov    %dx,(%rax)
  jmp    L13
L219:
  xor    %eax,%eax
  jmp    L33
```

tool_calls: name: disassemble_data
arguments: tag: D4
type_guessed: 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;
}
```