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

```asm
<hex_dump>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %esi,%ebx
  sub    $0x28,%rsp
  mov    %rdi,0x8(%rsp)
  cmp    $0xf,%esi
  jle    L94
  lea    -0x10(%rsi),%eax
  movl   $0x0,0x4(%rsp)
  lea    0x10(%rdi),%rbp
  mov    %eax,0x1c(%rsp)
  shr    $0x4,%eax
  lea    0x8(%rdi),%r12
  lea    D64(%rip),%r13
  mov    %eax,0x14(%rsp)
  add    $0x1,%eax
  mov    %eax,0x18(%rsp)
  shl    $0x4,%eax
  mov    %eax,0x10(%rsp)
  nopl   (%rax)
L142:
  mov    0x4(%rsp),%esi
  lea    -0x10(%rbp),%rbx
  lea    D71(%rip),%rdi
  xor    %eax,%eax
  mov    %rbx,%r14
  call   <printf@plt>
  nopl   0x0(%rax)
L87:
  movzbl (%r14),%esi
  mov    %r13,%rdi
  xor    %eax,%eax
  add    $0x1,%r14
  mov    %r12,%r15
  call   <printf@plt>
  cmp    %r12,%r14
  jne    L87
  mov    $0x20,%edi
  call   <putchar@plt>
  nopl   0x0(%rax)
L51:
  movzbl (%r15),%esi
  mov    %r13,%rdi
  xor    %eax,%eax
  add    $0x1,%r15
  call   <printf@plt>
  cmp    %rbp,%r15
  jne    L51
  mov    $0x7c,%edi
  call   <putchar@plt>
  jmp    L204
  nopl   0x0(%rax,%rax,1)
L56:
  movzbl (%rbx),%edi
  add    $0x1,%rbx
  call   <putchar@plt>
  cmp    %rbp,%rbx
  je     L158
L204:
  movzbl (%rbx),%edi
  call   <isprint@plt>
  test   %rax,%rax
  jne    L56
  mov    $0x2e,%edi
  add    $0x1,%rbx
  call   <putchar@plt>
  cmp    %rbp,%rbx
  jne    L204
L158:
  lea    D50(%rip),%rdi
  lea    0x10(%rbx),%rbp
  add    $0x10,%r12
  call   <puts@plt>
  addl   $0x10,0x4(%rsp)
  mov    0x4(%rsp),%eax
  cmp    0x10(%rsp),%eax
  jne    L142
  mov    0x14(%rsp),%eax
  mov    0x1c(%rsp),%ebx
  shl    $0x4,%eax
  sub    %eax,%ebx
  mov    0x18(%rsp),%eax
  shl    $0x4,%rax
  add    %rax,0x8(%rsp)
L109:
  test   %ebx,%ebx
  jle    L234
  mov    0x10(%rsp),%esi
  lea    D71(%rip),%rdi
  xor    %eax,%eax
  lea    D19(%rip),%r14
  lea    D64(%rip),%r13
  call   <printf@plt>
  mov    0x8(%rsp),%rax
  lea    0x8(%rax),%rbp
  mov    %rax,%r15
  lea    (%rbx,%rax,1),%r12d
  jmp    L89
  nopl   0x0(%rax)
L116:
  movzbl (%r15),%esi
  mov    %r13,%rdi
  xor    %eax,%eax
  add    $0x1,%r15
  call   <printf@plt>
  cmp    %rbp,%r15
  je     L182
L89:
  mov    %r12d,%eax
  sub    %r15d,%eax
  test   %eax,%eax
  jg     L116
  mov    %r14,%rdi
  xor    %eax,%eax
  add    $0x1,%r15
  call   <printf@plt>
  cmp    %rbp,%r15
  jne    L89
L182:
  mov    $0x20,%edi
  lea    -0x8(%rbx),%r15d
  lea    D19(%rip),%r14
  sub    $0x10,%ebx
  call   <putchar@plt>
  lea    D64(%rip),%r13
  jmp    L74
  nopl   (%rax)
L177:
  movzbl 0x0(%rbp),%esi
  mov    %r13,%rdi
  xor    %eax,%eax
  sub    $0x1,%r15d
  add    $0x1,%rbp
  call   <printf@plt>
  cmp    %ebx,%r15d
  je     L151
L74:
  test   %r15d,%r15d
  jg     L177
  mov    %r14,%rdi
  xor    %eax,%eax
  sub    $0x1,%r15d
  add    $0x1,%rbp
  call   <printf@plt>
  cmp    %ebx,%r15d
  jne    L74
L151:
  mov    $0x7c,%edi
  call   <putchar@plt>
  mov    0x8(%rsp),%rbp
  lea    0x10(%rbp),%rbx
  jmp    L8
  nopl   0x0(%rax)
L232:
  movzbl 0x0(%rbp),%edi
  call   <putchar@plt>
L21:
  add    $0x1,%rbp
  cmp    %rbx,%rbp
  je     L135
L8:
  mov    %r12d,%eax
  sub    %ebp,%eax
  test   %eax,%eax
  jle    L32
  movzbl 0x0(%rbp),%edi
  call   <isprint@plt>
  test   %rax,%rax
  jne    L232
  mov    $0x2e,%edi
  add    $0x1,%rbp
  call   <putchar@plt>
  cmp    %rbx,%rbp
  jne    L8
L135:
  add    $0x28,%rsp
  lea    D50(%rip),%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1090 <puts@plt>
  cs nopw 0x0(%rax,%rax,1)
L32:
  mov    $0x20,%edi
  call   <putchar@plt>
  jmp    L21
L234:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L94:
  movl   $0x0,0x10(%rsp)
  jmp    L109
```

tool_calls: name: read_data
arguments: tag: D64
type_infered: string
name: read_data
arguments: tag: D71
type_infered: string
name: read_data
arguments: tag: D50
type_infered: string
name: read_data
arguments: tag: D19
type_infered: string

tool: D64: %02x 

tool: D71: $%04x: 

tool: D50: |

tool: D19:    

assistant: ```c
void hex_dump(const unsigned char *data, int size) {
  int i;
  unsigned int offset = 0;
  for (; size >= 8 << 1; size -= 8 << 1) {
    printf("$%04x:"
           " ",
           offset);
    for (i = 0; i < 8; i++, data++)
      printf("%02x"
             " ",
             *data);
    putchar(' ');
    for (i = 0; i < 8; i++, data++)
      printf("%02x"
             " ",
             *data);
    data -= 8 << 1;
    putchar('|');
    for (i = 0; i < 8 << 1; i++, data++) {
      if (isprint(*data))
        putchar(*data);
      else
        putchar('.');
    }
    printf("|\n");
    offset += 8 << 1;
  }
  if (size <= 0)
    return;
  printf("$%04x:"
         " ",
         offset);
  for (i = 0; i < 8; i++, data++, size--) {
    if (size > 0)
      printf("%02x"
             " ",
             *data);
    else
      printf("  "
             " ");
  }
  putchar(' ');
  for (i = 0; i < 8; i++, data++, size--) {
    if (size > 0)
      printf("%02x"
             " ",
             *data);
    else
      printf("  "
             " ");
  }
  data -= 8 << 1;
  size += 8 << 1;
  putchar('|');
  for (i = 0; i < 8 << 1; i++, data++, size--) {
    if (size <= 0) {
      putchar(' ');
      continue;
    }
    if (isprint(*data))
      putchar(*data);
    else
      putchar('.');
  }
  printf("|\n");
}
```