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

```asm
<LogBuffer>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  add    $0xffffffffffffff80,%rsp
  mov    %rdi,-0x78(%rbp)
  mov    %esi,-0x7c(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x70(%rbp)
  movl   $0x0,-0x6c(%rbp)
  movl   $0x0,-0x68(%rbp)
  movl   $0x0,-0x6c(%rbp)
  jmp    L50
L8:
  mov    -0x6c(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x64(%rbp)
  mov    -0x70(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  mov    %eax,%edx
  lea    -0x40(%rbp),%rax
  lea    (%rax,%rdx,1),%rcx
  mov    -0x64(%rbp),%eax
  mov    %eax,%edx
  lea    D9(%rip),%rax
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <sprintf@plt>
  mov    -0x64(%rbp),%eax
  mov    %eax,%edi
  call   <isprint@plt>
  test   %rax,%rax
  je     L35
  mov    -0x64(%rbp),%eax
  mov    %eax,%ecx
  jmp    L29
L35:
  mov    $0x2e,%ecx
L29:
  mov    -0x70(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x70(%rbp)
  mov    %eax,%eax
  mov    %cl,-0x60(%rbp,%rax,1)
  cmpl   $0x10,-0x70(%rbp)
  jne    L18
  mov    -0x70(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %eax,%edx
  mov    %edx,%eax
  movb   $0x0,-0x40(%rbp,%rax,1)
  mov    %edx,%eax
  movzbl -0x40(%rbp,%rax,1),%edx
  mov    -0x70(%rbp),%eax
  mov    %dl,-0x60(%rbp,%rax,1)
  lea    -0x60(%rbp),%rcx
  lea    -0x40(%rbp),%rdx
  mov    -0x68(%rbp),%eax
  mov    %eax,%esi
  lea    D4(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    -0x6c(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x68(%rbp)
  movl   $0x0,-0x70(%rbp)
L18:
  addl   $0x1,-0x6c(%rbp)
L50:
  mov    -0x6c(%rbp),%eax
  cmp    -0x7c(%rbp),%eax
  jb     L8
  cmpl   $0x0,-0x70(%rbp)
  je     L3
  mov    -0x70(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %eax,%edx
  mov    %edx,%eax
  movb   $0x0,-0x40(%rbp,%rax,1)
  mov    %edx,%eax
  movzbl -0x40(%rbp,%rax,1),%edx
  mov    -0x70(%rbp),%eax
  mov    %dl,-0x60(%rbp,%rax,1)
  lea    -0x60(%rbp),%rcx
  lea    -0x40(%rbp),%rdx
  mov    -0x68(%rbp),%eax
  mov    %eax,%esi
  lea    D21(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L3:
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L60
  call   <__stack_chk_fail@plt>
L60:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D9
type_infered: string
name: extract_symbolic_data
arguments: data_label: D4
type_infered: string
name: extract_symbolic_data
arguments: data_label: D21
type_infered: string

tool: D9: %2.02X 

tool: D4: [%5u] %s %s


tool: D21: [%5u] %-48.48s %s


assistant: ```c
void LogBuffer(const uint8_t *p, unsigned n) {
  char hex[(3 * 16) + 1];
  char txt[16 + 1];
  unsigned odx = 0, idx = 0, at = 0;
  for (idx = 0; idx < n; idx++) {
    uint8_t byte = p[idx];
    sprintf(hex + 3 * odx, "%2.02X ", byte);
    txt[odx++] = isprint(byte) ? byte : '.';
    if (odx == 16) {
      txt[odx] = hex[3 * odx] = '\0';
      printf("[%5u] %s %s\n", at, hex, txt);
      at = idx + 1;
      odx = 0;
    }
  }
  if (odx) {
    txt[odx] = hex[3 * odx] = '\0';
    printf("[%5u] %-48.48s %s\n", at, hex, txt);
  }
}
```