user: Demonstrate the C code that generates the assembly output below:

```asm
<print_string_ptr>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  movl   $0x0,-0x1c(%rbp)
  cmpq   $0x0,-0x28(%rbp)
  jne    L17
  lea    D13(%rip),%rax
  mov    %rax,%rdi
  call   <json_strdup@plt>
  jmp    L259
L17:
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  jmp    L214
L27:
  movzbl -0x1d(%rbp),%eax
  mov    %eax,%esi
  lea    D7(%rip),%rax
  mov    %rax,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  je     L195
  addl   $0x1,-0x1c(%rbp)
  jmp    L4
L195:
  cmpb   $0x1f,-0x1d(%rbp)
  ja     L4
  addl   $0x5,-0x1c(%rbp)
L4:
  addq   $0x1,-0x18(%rbp)
L214:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0x1d(%rbp)
  cmpb   $0x0,-0x1d(%rbp)
  je     L264
  addl   $0x1,-0x1c(%rbp)
  cmpl   $0x0,-0x1c(%rbp)
  jne    L27
L264:
  mov    -0x1c(%rbp),%eax
  add    $0x3,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  jne    L223
  mov    $0x0,%eax
  jmp    L259
L223:
  mov    -0x8(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x22,(%rax)
  jmp    L6
L256:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x1f,%al
  jbe    L228
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x22,%al
  je     L228
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x5c,%al
  je     L228
  mov    -0x18(%rbp),%rdx
  lea    0x1(%rdx),%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rcx
  mov    %rcx,-0x10(%rbp)
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
  jmp    L6
L228:
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x5c,(%rax)
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  movzbl (%rax),%eax
  mov    %al,-0x1d(%rbp)
  movzbl -0x1d(%rbp),%eax
  cmp    $0x22,%eax
  jg     L249
  cmp    $0x8,%eax
  jl     L108
  sub    $0x8,%eax
  cmp    $0x1a,%eax
  ja     L108
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  lea    D9(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D9(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
L249:
  cmp    $0x5c,%eax
  jne    L108
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x5c,(%rax)
  jmp    L6
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x22,(%rax)
  jmp    L6
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x62,(%rax)
  jmp    L6
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x66,(%rax)
  jmp    L6
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x6e,(%rax)
  jmp    L6
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x72,(%rax)
  jmp    L6
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x74,(%rax)
  jmp    L6
L108:
  movzbl -0x1d(%rbp),%edx
  mov    -0x10(%rbp),%rax
  lea    D47(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sprintf@plt>
  addq   $0x5,-0x10(%rbp)
  nop
L6:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L256
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x22,(%rax)
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x0,(%rax)
  mov    -0x8(%rbp),%rax
L259:
  leave
  ret
```

tool_calls: name: parse_data
arguments: label: D13
datatype: string
name: parse_data
arguments: label: D7
datatype: string
name: parse_data
arguments: label: D47
datatype: string

tool: 

tool: D7: "\
	

tool: D47: u%04x

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;
}
```