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

```asm
<hd>:
  endbr64
  push   %r15
  xor    %eax,%eax
  mov    %rdx,%r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rcx,%rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x18,%rsp
  mov    %rdx,0x8(%rsp)
  mov    %rsi,%rdx
  lea    D39(%rip),%rsi
  call   <fprintf@plt>
  test   %rbp,%rbp
  je     L88
  mov    %r15,(%rsp)
  mov    $0x10,%r13d
  xor    %r12d,%r12d
  lea    D30(%rip),%r15
  xchg   %ax,%ax
L41:
  mov    %r12d,%edx
  lea    D4(%rip),%rsi
  mov    %rbx,%rdi
  xor    %eax,%eax
  call   <fprintf@plt>
  xor    %r14d,%r14d
  jmp    L70
  nopl   0x0(%rax)
L21:
  mov    (%rsp),%rax
  lea    D18(%rip),%rsi
  mov    %rbx,%rdi
  movzbl (%rax,%r14,1),%edx
  xor    %eax,%eax
  mov    %edx,%ecx
  shr    $0x4,%edx
  and    $0xf,%ecx
  and    $0xf,%edx
  call   <fprintf@plt>
  mov    %rbx,%rsi
  mov    $0x20,%edi
  call   <fputc@plt>
  mov    %r14,%rax
  and    $0x7,%eax
  cmp    $0x7,%rax
  je     L89
L81:
  add    $0x1,%r14
  cmp    $0x10,%r14
  je     L69
L70:
  lea    (%r12,%r14,1),%rax
  cmp    %rax,%rbp
  ja     L21
  mov    %rbx,%rcx
  mov    $0x3,%edx
  mov    $0x1,%esi
  mov    %r15,%rdi
  call   <fwrite@plt>
  mov    %r14,%rax
  and    $0x7,%eax
  cmp    $0x7,%rax
  jne    L81
L89:
  mov    %rbx,%rsi
  mov    $0x20,%edi
  add    $0x1,%r14
  call   <fputc@plt>
  cmp    $0x10,%r14
  jne    L70
L69:
  mov    %rbx,%rsi
  mov    $0x7c,%edi
  mov    %r12,%r14
  call   <fputc@plt>
  nopl   0x0(%rax)
L44:
  cmp    %rbp,%r14
  jae    L50
  mov    0x8(%rsp),%rax
  mov    %rbx,%rsi
  movsbl (%rax,%r14,1),%edi
  lea    -0x20(%rdi),%eax
  cmp    $0x5f,%al
  mov    $0x2e,%eax
  cmovae %eax,%edi
  call   <fputc@plt>
L50:
  add    $0x1,%r14
  cmp    %r14,%r13
  jne    L44
  mov    %rbx,%rsi
  mov    $0x7c,%edi
  add    $0x10,%r12
  add    $0x10,%r13
  call   <fputc@plt>
  mov    %rbx,%rsi
  mov    $0xa,%edi
  call   <fputc@plt>
  addq   $0x10,(%rsp)
  cmp    %r12,%rbp
  ja     L41
L88:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: unpack_data
arguments: tag: D39
datatype: string
name: unpack_data
arguments: tag: D30
datatype: string
name: unpack_data
arguments: tag: D4
datatype: string
name: unpack_data
arguments: tag: D18
datatype: string

tool: D39: %s


tool: D30:    

tool: D4: %08X  

tool: D18: %X%X

assistant: ```c
void hd(FILE *file, const char *label, void *data, size_t bytes) {
  size_t goffset, loffset;
  char c;
  fprintf(file, "%s\n", label);
  for (goffset = 0; goffset < bytes; goffset += 16) {
    fprintf(file, "%08X  ", (unsigned int)goffset);
    for (loffset = 0; loffset < 16; ++loffset) {
      if (goffset + loffset < bytes) {
        c = *(char *)((unsigned char *)data + goffset + loffset);
        fprintf(file, "%X%X", (c & 0xF0) >> 4, (c & 0x0F) >> 0);
        fputc(' ', file);
      } else {
        fprintf(file, "   ");
      }
      if (loffset % 8 == 7)
        fputc(' ', file);
    }
    fputc('|', file);
    for (loffset = 0; loffset < 16; ++loffset) {
      if (goffset + loffset < bytes) {
        c = *(char *)((unsigned char *)data + goffset + loffset);
        fputc((c < ' ' || c > '~') ? '.' : c, file);
      }
    }
    fputc('|', file);
    fputc('\n', file);
  }
}
```