user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<print_string_ptr>:
  endbr64
  test   %rdi,%rdi
  je     L159
  push   %r14
  lea    D33(%rip),%r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  movzbl (%rdi),%r12d
  xor    %ebx,%ebx
  mov    $0x3,%edi
  test   %r12b,%r12b
  jne    L83
  jmp    L147
  nopl   0x0(%rax)
L90:
  movzbl 0x1(%r13),%r12d
  add    $0x1,%r13
  add    $0x2,%ebx
  test   %r12b,%r12b
  je     L162
L83:
  movzbl %r12b,%esi
  mov    %r14,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  jne    L90
  lea    0x1(%rbx),%eax
  add    $0x6,%ebx
  cmp    $0x20,%r12b
  cmovae %eax,%ebx
  movzbl 0x1(%r13),%r12d
  add    $0x1,%r13
  test   %r12b,%r12b
  jne    L83
L162:
  lea    0x3(%rbx),%edi
L147:
  call   <cJSON_malloc@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L43
  movb   $0x22,(%rax)
  lea    0x1(%rax),%rbx
  movzbl 0x0(%rbp),%eax
  test   %al,%al
  je     L230
  lea    D37(%rip),%r14
  lea    D8(%rip),%r13
  jmp    L17
  nopl   0x0(%rax)
L111:
  cmp    $0x1f,%al
  jbe    L165
  mov    %al,(%rbx)
  mov    %rdi,%rbx
L77:
  movzbl 0x0(%rbp),%eax
  test   %al,%al
  je     L230
L17:
  add    $0x1,%rbp
  cmp    $0x22,%al
  lea    0x1(%rbx),%rdi
  setne  %cl
  cmp    $0x5c,%al
  setne  %dl
  test   %dl,%cl
  jne    L111
L165:
  movb   $0x5c,(%rbx)
  movzbl -0x1(%rbp),%edx
  cmp    $0x22,%dl
  jg     L33
  cmp    $0x7,%dl
  jle    L64
  lea    -0x8(%rdx),%eax
  cmp    $0x1a,%al
  ja     L64
  movzbl %al,%eax
  movslq 0x0(%r13,%rax,4),%rax
  add    %r13,%rax
  notrack jmp *%rax
  nopl   0x0(%rax)
L64:
  mov    %r14,%rsi
  add    $0x6,%rbx
  call   <sprintf@plt>
  movzbl 0x0(%rbp),%eax
  test   %al,%al
  jne    L17
  nopl   0x0(%rax)
L230:
  mov    $0x22,%eax
  mov    %ax,(%rbx)
L43:
  pop    %rbx
  mov    %r12,%rax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
  movb   $0x22,0x1(%rbx)
  add    $0x2,%rbx
  jmp    L77
  nopl   (%rax)
  movb   $0x72,0x1(%rbx)
  add    $0x2,%rbx
  jmp    L77
  nopl   (%rax)
  movb   $0x66,0x1(%rbx)
  add    $0x2,%rbx
  jmp    L77
  nopl   (%rax)
  movb   $0x6e,0x1(%rbx)
  add    $0x2,%rbx
  jmp    L77
  nopl   (%rax)
  movb   $0x74,0x1(%rbx)
  add    $0x2,%rbx
  jmp    L77
  nopl   (%rax)
  movb   $0x62,0x1(%rbx)
  add    $0x2,%rbx
  jmp    L77
  nopl   (%rax)
L33:
  cmp    $0x5c,%dl
  jne    L64
  movb   $0x5c,0x1(%rbx)
  add    $0x2,%rbx
  jmp    L77
  xchg   %ax,%ax
L159:
  lea    D7(%rip),%rdi
  jmp    10a0 <cJSON_strdup@plt>
```

tool_calls: name: read_data
arguments: label: D33
type_infered: string
name: read_data
arguments: label: D37
type_infered: string
name: read_data
arguments: label: D7
type_infered: string

tool: D33: "\
	

tool: D37: u%04x

tool: 

assistant: ```c
char *print_string_ptr(const char *str) {
  const char *ptr;
  char *ptr2, *out;
  int len = 0;
  unsigned char token;
  if (!str)
    return cJSON_strdup("");
  ptr = str;
  while ((token = *ptr) && ++len) {
    if (strchr("\"\\\b\f\n\r\t", token))
      len++;
    else if (token < 32)
      len += 5;
    ptr++;
  }
  out = (char *)cJSON_malloc(len + 3);
  if (!out)
    return 0;
  ptr2 = out;
  ptr = str;
  *ptr2++ = '\"';
  while (*ptr) {
    if ((unsigned char)*ptr > 31 && *ptr != '\"' && *ptr != '\\')
      *ptr2++ = *ptr++;
    else {
      *ptr2++ = '\\';
      switch (token = *ptr++) {
      case '\\':
        *ptr2++ = '\\';
        break;
      case '\"':
        *ptr2++ = '\"';
        break;
      case '\b':
        *ptr2++ = 'b';
        break;
      case '\f':
        *ptr2++ = 'f';
        break;
      case '\n':
        *ptr2++ = 'n';
        break;
      case '\r':
        *ptr2++ = 'r';
        break;
      case '\t':
        *ptr2++ = 't';
        break;
      default:
        sprintf(ptr2, "u%04x", token);
        ptr2 += 5;
        break;
      }
    }
  }
  *ptr2++ = '\"';
  *ptr2++ = 0;
  return out;
}
```