user: Please show me the C implementation that matches the assembly code listed below:

```asm
<stralloc_printf>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  lea    -0x4000(%rsp),%r11
L19:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L19
  sub    $0xe0,%rsp
  mov    %rdi,-0x40d8(%rbp)
  mov    %rsi,-0x40e0(%rbp)
  mov    %rdx,-0xa0(%rbp)
  mov    %rcx,-0x98(%rbp)
  mov    %r8,-0x90(%rbp)
  mov    %r9,-0x88(%rbp)
  test   %al,%al
  je     L20
  movaps %xmm0,-0x80(%rbp)
  movaps %xmm1,-0x70(%rbp)
  movaps %xmm2,-0x60(%rbp)
  movaps %xmm3,-0x50(%rbp)
  movaps %xmm4,-0x40(%rbp)
  movaps %xmm5,-0x30(%rbp)
  movaps %xmm6,-0x20(%rbp)
  movaps %xmm7,-0x10(%rbp)
L20:
  mov    %fs:0x28,%rax
  mov    %rax,-0xb8(%rbp)
  xor    %eax,%eax
  mov    -0x40e0(%rbp),%rdx
  mov    -0x40c4(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <va_start@plt>
  mov    -0x40c4(%rbp),%ecx
  mov    -0x40e0(%rbp),%rdx
  lea    -0x40c0(%rbp),%rax
  mov    $0x4000,%esi
  mov    %rax,%rdi
  call   <vsnprintf@plt>
  mov    -0x40c4(%rbp),%eax
  mov    %eax,%edi
  call   <va_end@plt>
  mov    -0x40d8(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L42
  mov    -0x40d8(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L63
  mov    -0x40d8(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <in_hash_table@plt>
  test   %eax,%eax
  jne    L24
  mov    $0x3d,%edx
  lea    D2(%rip),%rax
  mov    %rax,%rsi
  lea    D38(%rip),%rax
  mov    %rax,%rdi
  call   <log_printf@plt>
  mov    -0x40d8(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <free@plt>
  jmp    L63
L24:
  mov    -0x40d8(%rbp),%rax
  mov    (%rax),%rax
  mov    $0x3d,%edx
  lea    D2(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <str_free@plt>
L63:
  mov    -0x40d8(%rbp),%rax
  movq   $0x0,(%rax)
L42:
  lea    -0x40c0(%rbp),%rax
  mov    $0x3e,%edx
  lea    D2(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <str_alloc@plt>
  mov    -0x40d8(%rbp),%rdx
  mov    %rax,(%rdx)
  nop
  mov    -0xb8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L64
  call   <__stack_chk_fail@plt>
L64:
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: label: D2
type: string
name: retrieve_data
arguments: label: D38
type: string

tool: D2: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/jpavonabian/6Dragones/refs/heads/master/src/handler.c

tool: D38: &RSTRFREE called on str_dup pointer: %s, line %d&D


assistant: ```c
void stralloc_printf(char **pointer, const char *fmt, ...) {
  char buf[8192 * 2];
  va_list args;
  va_start(args, fmt);
  vsnprintf(buf, 8192 * 2, fmt, args);
  va_end(args);
  if (*pointer)
    do {
      if ((*pointer)) {
        if (!in_hash_table((*pointer))) {
          log_printf("&RSTRFREE called on str_dup pointer: %s, line %d&D\n", "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/jpavonabian/6Dragones/refs/heads/master/src/handler.c", 61);
          free((*pointer));
        } else
          str_free((*pointer), "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/jpavonabian/6Dragones/refs/heads/master/src/handler.c", 61);
      }
      (*pointer) = NULL;
    } while (0);
  *pointer = str_alloc((buf), "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/jpavonabian/6Dragones/refs/heads/master/src/handler.c", 62);
  return;
}
```