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

```asm
<c_escape>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  movq   $0x1,-0x18(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  jmp    L117
L64:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <iscntrl@plt>
  test   %rax,%rax
  jne    L122
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isascii@plt>
  test   %eax,%eax
  jne    L105
L122:
  addq   $0x4,-0x18(%rbp)
  jmp    L68
L105:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x22,%al
  je     L132
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x5c,%al
  jne    L60
L132:
  addq   $0x2,-0x18(%rbp)
  jmp    L68
L60:
  addq   $0x1,-0x18(%rbp)
L68:
  addq   $0x1,-0x8(%rbp)
L117:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L64
  mov    -0x18(%rbp),%rax
  cmp    -0x38(%rbp),%rax
  jbe    L175
  mov    -0x18(%rbp),%rax
  jmp    L57
L175:
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  jmp    L62
L93:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <iscntrl@plt>
  test   %rax,%rax
  jne    L97
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isascii@plt>
  test   %eax,%eax
  jne    L91
L97:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%edx
  mov    -0x38(%rbp),%rsi
  mov    -0x30(%rbp),%rax
  mov    %edx,%ecx
  lea    D13(%rip),%rdx
  mov    %rax,%rdi
  call   <snprintf@plt>
  mov    %rax,-0x10(%rbp)
  cmpq   $0x4,-0x10(%rbp)
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  jmp    L52
L91:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x22,%al
  je     L101
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x5c,%al
  jne    L160
L101:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%edx
  mov    -0x38(%rbp),%rsi
  mov    -0x30(%rbp),%rax
  mov    %edx,%ecx
  lea    D16(%rip),%rdx
  mov    %rax,%rdi
  call   <snprintf@plt>
  mov    %rax,-0x10(%rbp)
  cmpq   $0x2,-0x10(%rbp)
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  jmp    L52
L160:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%edx
  mov    -0x30(%rbp),%rax
  mov    %dl,(%rax)
  movq   $0x1,-0x10(%rbp)
L52:
  mov    -0x10(%rbp),%rax
  cmp    -0x38(%rbp),%rax
  setb   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x10(%rbp),%rax
  add    %rax,-0x30(%rbp)
  mov    -0x10(%rbp),%rax
  sub    %rax,-0x38(%rbp)
  addq   $0x1,-0x8(%rbp)
L62:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L93
  cmpq   $0x0,-0x38(%rbp)
  setne  %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x30(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x18(%rbp),%rax
L57:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: tag: D13
datatype: string
name: unpack_data
arguments: tag: D16
datatype: string

tool: D13: \x%02hhx

tool: D16: \%c

assistant: ```c
size_t c_escape(const char *in, char *out, size_t len) {
  size_t r = 1, s;
  const char *c;
  for (c = in; *c != '\0'; c++) {
    if (iscntrl(*c) || !isascii(*c))
      r += 4;
    else {
      if (*c == '\"' || *c == '\\')
        r += 2;
      else
        r++;
    }
  }
  if (r > len)
    return r;
  for (c = in; *c != '\0'; c++) {
    if (iscntrl(*c) || !isascii(*c)) {
      s = snprintf(out, len, "\\x%02hhx", *c);
      assert(s == 4);
    } else {
      if (*c == '\"' || *c == '\\') {
        s = snprintf(out, len, "\\%c", *c);
        assert(s == 2);
      } else {
        *out = *c;
        s = 1;
      }
    }
    assert(s < len);
    out += s;
    len -= s;
  }
  assert(len > 0);
  *out = '\0';
  return r;
}
```