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

```asm
<packet_buildtext>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %ecx,%eax
  mov    %r8,-0x50(%rbp)
  mov    %esi,%ecx
  mov    %cl,-0x3c(%rbp)
  mov    %dl,-0x40(%rbp)
  mov    %al,-0x44(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movb   $0x41,-0x2b(%rbp)
  movb   $0x1b,-0x2a(%rbp)
  movb   $0x30,-0x29(%rbp)
  movq   $0x0,-0x28(%rbp)
  cmpq   $0x0,-0x50(%rbp)
  je     L12
  mov    -0x50(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %rax,-0x28(%rbp)
L12:
  cmpq   $0x1000,-0x28(%rbp)
  jbe    L29
  mov    $0x1000,%esi
  lea    D0(%rip),%rax
  mov    %rax,%rdi
  call   <config_error@plt>
  movq   $0x1000,-0x28(%rbp)
L29:
  mov    -0x28(%rbp),%rax
  add    $0x5,%rax
  mov    %rax,-0x20(%rbp)
  movzbl -0x44(%rbp),%eax
  test   %al,%al
  je     L4
  addq   $0x1,-0x20(%rbp)
L4:
  mov    -0x20(%rbp),%rax
  mov    $0x1,%esi
  mov    %rax,%rdi
  call   <calloc@plt>
  mov    %rax,-0x10(%rbp)
  movq   $0x0,-0x18(%rbp)
  mov    -0x10(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  lea    -0x2b(%rbp),%rax
  mov    $0x1,%edx
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <memcpy@plt>
  movq   $0x1,-0x18(%rbp)
  mov    -0x10(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  lea    -0x3c(%rbp),%rax
  mov    $0x1,%edx
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <memcpy@plt>
  addq   $0x1,-0x18(%rbp)
  mov    -0x10(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  lea    -0x2a(%rbp),%rax
  mov    $0x1,%edx
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <memcpy@plt>
  addq   $0x1,-0x18(%rbp)
  mov    -0x10(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  lea    -0x29(%rbp),%rax
  mov    $0x1,%edx
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <memcpy@plt>
  addq   $0x1,-0x18(%rbp)
  mov    -0x10(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  lea    -0x40(%rbp),%rax
  mov    $0x1,%edx
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <memcpy@plt>
  addq   $0x1,-0x18(%rbp)
  movzbl -0x44(%rbp),%eax
  test   %al,%al
  je     L32
  mov    -0x10(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  lea    -0x44(%rbp),%rax
  mov    $0x1,%edx
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <memcpy@plt>
  addq   $0x1,-0x18(%rbp)
L32:
  cmpq   $0x0,-0x28(%rbp)
  je     L11
  mov    -0x10(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x28(%rbp),%rdx
  mov    -0x50(%rbp),%rax
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <memcpy@plt>
L11:
  mov    -0x38(%rbp),%rax
  mov    -0x10(%rbp),%rdx
  mov    %rdx,(%rax)
  mov    -0x20(%rbp),%rax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L46
  call   <__stack_chk_fail@plt>
L46:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: label: D0
type_infered: string

tool: D0: Warning: shrank a text frame to fit %d bytes.

assistant: ```c
int packet_buildtext(char **outputptr, char filename, char mode, char special, char *text) {
  const char cmdcode = 'A', modedivider = 0x1b, position = 0x30;
  size_t textlen = 0;
  if (text != NULL) {
    textlen = strlen(text);
  }
  if (textlen > 4096) {
    config_error("Warning: shrank a text frame to fit %d bytes.", 4096);
    textlen = 4096;
  }
  size_t pktsize = sizeof(cmdcode) + sizeof(filename) + sizeof(modedivider) + sizeof(position) + sizeof(mode) + textlen;
  if (special != 0) {
    pktsize += sizeof(special);
  }
  char *data = (char *)calloc(pktsize, sizeof(char));
  size_t offset = 0;
  memcpy(&data[offset], &cmdcode, sizeof(cmdcode));
  offset = sizeof(cmdcode);
  memcpy(&data[offset], &filename, sizeof(filename));
  offset += sizeof(filename);
  memcpy(&data[offset], &modedivider, sizeof(modedivider));
  offset += sizeof(modedivider);
  memcpy(&data[offset], &position, sizeof(position));
  offset += sizeof(position);
  memcpy(&data[offset], &mode, sizeof(mode));
  offset += sizeof(mode);
  if (special != 0) {
    memcpy(&data[offset], &special, sizeof(special));
    offset += sizeof(special);
  }
  if (textlen > 0) {
    memcpy(&data[offset], text, textlen);
  }
  *outputptr = data;
  return pktsize;
}
```