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

```asm
<escape_string>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbp
  call   <strlen@plt>
  lea    0x4(,%rax,4),%edi
  call   <malloc@plt>
  mov    %rax,%r13
  movzbl 0x0(%rbp),%edi
  test   %dil,%dil
  je     L102
  mov    %rax,%rbx
  lea    D7(%rip),%r12
  jmp    L149
L76:
  cmp    $0x5c,%dil
  je     L179
L40:
  movsbl %dil,%edi
  call   <isprint@plt>
  test   %eax,%eax
  je     L134
  movzbl 0x0(%rbp),%eax
  mov    %al,(%rbx)
  lea    0x1(%rbx),%rbx
  jmp    L171
  movb   $0x5c,(%rbx)
  movb   $0x62,0x1(%rbx)
  lea    0x2(%rbx),%rbx
L171:
  add    $0x1,%rbp
  movzbl 0x0(%rbp),%edi
  test   %dil,%dil
  je     L72
L149:
  cmp    $0x22,%dil
  jg     L76
  cmp    $0x6,%dil
  jle    L40
  lea    -0x7(%rdi),%eax
  cmp    $0x1b,%al
  ja     L40
  movzbl %al,%eax
  movslq (%r12,%rax,4),%rax
  add    %r12,%rax
  notrack jmp *%rax
  movb   $0x5c,(%rbx)
  movb   $0x66,0x1(%rbx)
  lea    0x2(%rbx),%rbx
  jmp    L171
  movb   $0x5c,(%rbx)
  movb   $0x6e,0x1(%rbx)
  lea    0x2(%rbx),%rbx
  jmp    L171
  movb   $0x5c,(%rbx)
  movb   $0x72,0x1(%rbx)
  lea    0x2(%rbx),%rbx
  jmp    L171
  movb   $0x5c,(%rbx)
  movb   $0x74,0x1(%rbx)
  lea    0x2(%rbx),%rbx
  jmp    L171
  movb   $0x5c,(%rbx)
  movb   $0x76,0x1(%rbx)
  lea    0x2(%rbx),%rbx
  jmp    L171
  movb   $0x5c,(%rbx)
  movb   $0x61,0x1(%rbx)
  lea    0x2(%rbx),%rbx
  jmp    L171
L179:
  movb   $0x5c,(%rbx)
  movzbl 0x0(%rbp),%eax
  mov    %al,0x1(%rbx)
  lea    0x2(%rbx),%rbx
  jmp    L171
L134:
  movb   $0x5c,(%rbx)
  movb   $0x78,0x1(%rbx)
  movzbl 0x0(%rbp),%eax
  sar    $0x4,%al
  add    $0x30,%eax
  mov    %al,0x2(%rbx)
  movzbl 0x0(%rbp),%eax
  mov    %eax,%edx
  and    $0xf,%edx
  cmp    $0x9,%dl
  jle    L23
  mov    %edx,%eax
  add    $0x37,%eax
L50:
  mov    %al,0x3(%rbx)
  lea    0x4(%rbx),%rbx
  jmp    L171
L23:
  and    $0xf,%eax
  add    $0x30,%eax
  jmp    L50
L102:
  mov    %rax,%rbx
L72:
  movb   $0x0,(%rbx)
  mov    %r13,%rax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
char *escape_string(char *s) {
  char *ss = (char *)malloc((strlen(s) + 1) * 4), *sss = ss;
  for (; *s; s++) {
    switch (*s) {
    case '\b':
      *ss++ = '\\';
      *ss++ = 'b';
      break;
      ;
    case '\f':
      *ss++ = '\\';
      *ss++ = 'f';
      break;
      ;
    case '\n':
      *ss++ = '\\';
      *ss++ = 'n';
      break;
      ;
    case '\r':
      *ss++ = '\\';
      *ss++ = 'r';
      break;
      ;
    case '\t':
      *ss++ = '\\';
      *ss++ = 't';
      break;
      ;
    case '\v':
      *ss++ = '\\';
      *ss++ = 'v';
      break;
      ;
    case '\a':
      *ss++ = '\\';
      *ss++ = 'a';
      break;
      ;
    case '\\':
    case '\"':
      *ss++ = '\\';
      *ss++ = *s;
      break;
    default:
      if (isprint(*s)) {
        *ss++ = *s;
      } else {
        *ss++ = '\\';
        *ss++ = 'x';
        *ss++ = ((((*s) >> 4) > 9) ? (((*s) >> 4) - 10 + 'A') : (((*s) >> 4) + '0'));
        *ss++ = ((((*s) & 15) > 9) ? (((*s) & 15) - 10 + 'A') : (((*s) & 15) + '0'));
      }
      break;
    }
  }
  *ss = 0;
  return sss;
}
```