user: 请将以下的汇编代码转换成C语言代码:

```asm
<print_string_ptr>:
  endbr64
  test   %rdi,%rdi
  je     L47
  push   %r14
  lea    D25(%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    L14
  jmp    L128
  nopl   0x0(%rax)
L149:
  movzbl 0x1(%r13),%r12d
  add    $0x1,%r13
  add    $0x2,%ebx
  test   %r12b,%r12b
  je     L73
L14:
  movzbl %r12b,%esi
  mov    %r14,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  jne    L149
  lea    0x1(%rbx),%eax
  add    $0x6,%ebx
  cmp    $0x20,%r12b
  cmovae %eax,%ebx
  movzbl 0x1(%r13),%r12d
  add    $0x1,%r13
  test   %r12b,%r12b
  jne    L14
L73:
  lea    0x3(%rbx),%edi
L128:
  call   <malloc@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L33
  movb   $0x22,(%rax)
  lea    0x1(%rax),%rbx
  movzbl 0x0(%rbp),%eax
  test   %al,%al
  je     L80
  lea    D15(%rip),%r14
  lea    D38(%rip),%r13
  jmp    L48
  nopl   0x0(%rax)
L194:
  cmp    $0x1f,%al
  jbe    L56
  mov    %al,(%rbx)
  mov    %rdi,%rbx
L66:
  movzbl 0x0(%rbp),%eax
  test   %al,%al
  je     L80
L48:
  add    $0x1,%rbp
  cmp    $0x22,%al
  lea    0x1(%rbx),%rdi
  setne  %cl
  cmp    $0x5c,%al
  setne  %dl
  test   %dl,%cl
  jne    L194
L56:
  movb   $0x5c,(%rbx)
  movzbl -0x1(%rbp),%edx
  cmp    $0x22,%dl
  jg     L135
  cmp    $0x7,%dl
  jle    L4
  lea    -0x8(%rdx),%eax
  cmp    $0x1a,%al
  ja     L4
  movzbl %al,%eax
  movslq 0x0(%r13,%rax,4),%rax
  add    %r13,%rax
  notrack jmp *%rax
  nopl   0x0(%rax)
L4:
  mov    %r14,%rsi
  add    $0x6,%rbx
  call   <sprintf@plt>
  movzbl 0x0(%rbp),%eax
  test   %al,%al
  jne    L48
  nopl   0x0(%rax)
L80:
  mov    $0x22,%eax
  mov    %ax,(%rbx)
L33:
  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    L66
  nopl   (%rax)
  movb   $0x72,0x1(%rbx)
  add    $0x2,%rbx
  jmp    L66
  nopl   (%rax)
  movb   $0x66,0x1(%rbx)
  add    $0x2,%rbx
  jmp    L66
  nopl   (%rax)
  movb   $0x6e,0x1(%rbx)
  add    $0x2,%rbx
  jmp    L66
  nopl   (%rax)
  movb   $0x74,0x1(%rbx)
  add    $0x2,%rbx
  jmp    L66
  nopl   (%rax)
  movb   $0x62,0x1(%rbx)
  add    $0x2,%rbx
  jmp    L66
  nopl   (%rax)
L135:
  cmp    $0x5c,%dl
  jne    L4
  movb   $0x5c,0x1(%rbx)
  add    $0x2,%rbx
  jmp    L66
  xchg   %ax,%ax
L47:
  lea    D12(%rip),%rdi
  jmp    1090 <json_strdup@plt>
```

tool_calls: name: parse_data
arguments: data_tag: D25
data_type: string
name: parse_data
arguments: data_tag: D15
data_type: string
name: parse_data
arguments: data_tag: D12
data_type: string

tool: D25: "\
	

tool: D15: 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 (NULL == str) {
    return json_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 *)malloc(len + 3);
  if (NULL == out) {
    return NULL;
  }
  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;
}
```