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

```asm
<yyqq>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  cmpb   $0x0,(%rdi)
  je     L66
  lea    0x1(%rdi),%rbx
  mov    $0x1,%esi
  xor    %edi,%edi
  movabs $0x400000000000009,%r9
  mov    %rbx,%rdx
  sub    %ebx,%esi
  nopw   0x0(%rax,%rax,1)
L64:
  movzbl (%rdx),%eax
  lea    (%rsi,%rdx,1),%r8d
  add    $0x1,%rdx
  lea    -0x7(%rax),%ecx
  cmp    $0x2,%cl
  jbe    L152
  cmp    $0xb,%al
  je     L152
  cmp    $0xd,%al
  jg     L273
  cmp    $0xb,%al
  jg     L152
  cmp    $0xa,%al
  jne    L27
  add    $0x4,%edi
  jmp    L64
  nopl   0x0(%rax,%rax,1)
L152:
  add    $0x2,%edi
L286:
  test   %al,%al
  jne    L64
  mov    %rbp,%r12
  cmp    %r8d,%edi
  je     L239
  add    $0x1,%edi
  call   <malloc@plt>
  movsbl 0x0(%rbp),%edx
  mov    %rax,%r12
  mov    %rax,%rbp
  test   %dl,%dl
  je     L304
  lea    -0x7(%rdx),%eax
  lea    D4(%rip),%r14
  lea    D9(%rip),%r13
  cmp    $0x55,%al
  ja     L266
  xchg   %ax,%ax
L85:
  movzbl %al,%eax
  movslq 0x0(%r13,%rax,4),%rax
  add    %r13,%rax
  notrack jmp *%rax
  xchg   %ax,%ax
  movb   $0x5c,0x0(%rbp)
  movzbl -0x1(%rbx),%eax
  add    $0x2,%rbp
  mov    %al,-0x1(%rbp)
  nop
L232:
  movsbl (%rbx),%edx
  test   %dl,%dl
  je     L304
L159:
  lea    -0x7(%rdx),%eax
  add    $0x1,%rbx
  cmp    $0x55,%al
  jbe    L85
L266:
  cmp    $0x1f,%dl
  jle    L32
  mov    %dl,0x0(%rbp)
  movsbl (%rbx),%edx
  add    $0x1,%rbp
  test   %dl,%dl
  jne    L159
  nopl   0x0(%rax)
L304:
  movb   $0x0,0x0(%rbp)
L239:
  pop    %rbx
  mov    %r12,%rax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L273:
  cmp    $0x1b,%al
  je     L152
  lea    -0x22(%rax),%ecx
  cmp    $0x3a,%cl
  ja     L245
  bt     %rcx,%r9
  jb     L152
L122:
  add    $0x1,%edi
  jmp    L64
L245:
  cmp    $0x1f,%al
  jg     L122
  cs nopw 0x0(%rax,%rax,1)
L27:
  add    $0x5,%edi
  jmp    L286
  movb   $0x25,0x0(%rbp)
  movzbl -0x1(%rbx),%eax
  add    $0x2,%rbp
  mov    %al,-0x1(%rbp)
  jmp    L232
  mov    $0x655c,%ecx
  add    $0x2,%rbp
  mov    %cx,-0x2(%rbp)
  jmp    L232
  mov    $0x725c,%r8d
  add    $0x2,%rbp
  mov    %r8w,-0x2(%rbp)
  jmp    L232
  mov    $0x665c,%edx
  add    $0x2,%rbp
  mov    %dx,-0x2(%rbp)
  jmp    L232
  mov    $0x765c,%eax
  add    $0x2,%rbp
  mov    %ax,-0x2(%rbp)
  jmp    L232
  movl   $0xa5c6e5c,0x0(%rbp)
  add    $0x4,%rbp
  jmp    L232
  mov    $0x745c,%r9d
  add    $0x2,%rbp
  mov    %r9w,-0x2(%rbp)
  jmp    L232
  mov    $0x625c,%esi
  add    $0x2,%rbp
  mov    %si,-0x2(%rbp)
  jmp    L232
  mov    $0x615c,%edi
  add    $0x2,%rbp
  mov    %di,-0x2(%rbp)
  jmp    L232
  xchg   %ax,%ax
L32:
  mov    %rbp,%rdi
  mov    %r14,%rsi
  add    $0x4,%rbp
  call   <sprintf@plt>
  jmp    L232
  nopl   0x0(%rax)
L66:
  mov    %rdi,%r12
  pop    %rbx
  pop    %rbp
  mov    %r12,%rax
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

tool_calls: name: disassemble_data
arguments: label: D4
data_type: string

tool: D4: \%03o

assistant: ```c
char *yyqq(char *s) {
  char *d = s;
  char *dst;
  int sl = 0, dl = 0;
  while (*s++) {
    dl++;
    sl++;
    if (*s == 7 || *s == 8 || *s == 9 || *s == 11 || *s == 12 || *s == 13 || *s == 27 || *s == 34 || *s == '%' || *s == 92) {
      dl++;
    } else if (*s == 10) {
      dl += 3;
    } else if (*(signed char *)s < 32) {
      dl += 4;
    }
  }
  if (dl == sl)
    return d;
  s = d;
  dst = d = (char *)malloc(dl + 1);
  while (*s) {
    if (*s == '"') {
      *d++ = '\\';
      *d++ = *s++;
    } else if (*s == '%') {
      *d++ = '%';
      *d++ = *s++;
    } else if (*s == '\n') {
      *d++ = '\\';
      *d++ = 'n';
      *d++ = '\\';
      *d++ = 10;
      s++;
    } else if (*s == '\t') {
      *d++ = '\\';
      *d++ = 't';
      s++;
    } else if (*s == '\r') {
      *d++ = '\\';
      *d++ = 'r';
      s++;
    } else if (*s == '\a') {
      *d++ = '\\';
      *d++ = 'a';
      s++;
    } else if (*s == '\b') {
      *d++ = '\\';
      *d++ = 'b';
      s++;
    } else if (*s == '\033') {
      *d++ = '\\';
      *d++ = 'e';
      s++;
    } else if (*s == '\f') {
      *d++ = '\\';
      *d++ = 'f';
      s++;
    } else if (*s == '\v') {
      *d++ = '\\';
      *d++ = 'v';
      s++;
    } else if (*s == 92) {
      *d++ = '\\';
      *d++ = *s++;
    } else if (*(signed char *)s < 32) {
      sprintf(d, "\\%03o", *s);
      d += 4;
      s++;
    } else {
      *d++ = *s++;
    }
  }
  *d = 0;
  return dst;
}
```