user: Converte this assembly snippet into its equivalent C code:

```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    L12
  lea    -0x10(%rsi),%eax
  movl   $0x0,0x4(%rsp)
  lea    0x10(%rdi),%rbp
  mov    %eax,0x18(%rsp)
  shr    $0x4,%eax
  lea    0x8(%rdi),%r12
  lea    D73(%rip),%r13
  mov    %eax,0x14(%rsp)
  add    $0x1,%eax
  mov    %eax,0x1c(%rsp)
  shl    $0x4,%eax
  mov    %eax,0x10(%rsp)
  nopl   (%rax)
L0:
  mov    0x4(%rsp),%esi
  lea    -0x10(%rbp),%rbx
  lea    D10(%rip),%rdi
  xor    %eax,%eax
  mov    %rbx,%r14
  call   <printf@plt>
  nopl   0x0(%rax)
L47:
  movzbl (%r14),%esi
  mov    %r13,%rdi
  xor    %eax,%eax
  add    $0x1,%r14
  mov    %r12,%r15
  call   <printf@plt>
  cmp    %r12,%r14
  jne    L47
  mov    $0x20,%edi
  call   <putchar@plt>
  nopl   0x0(%rax)
L115:
  movzbl (%r15),%esi
  mov    %r13,%rdi
  xor    %eax,%eax
  add    $0x1,%r15
  call   <printf@plt>
  cmp    %rbp,%r15
  jne    L115
  mov    $0x7c,%edi
  call   <putchar@plt>
  jmp    L59
  nopl   0x0(%rax,%rax,1)
L90:
  movzbl (%rbx),%edi
  add    $0x1,%rbx
  call   <putchar@plt>
  cmp    %rbp,%rbx
  je     L54
L59:
  movzbl (%rbx),%edi
  call   <isprint@plt>
  test   %rax,%rax
  jne    L90
  mov    $0x2e,%edi
  add    $0x1,%rbx
  call   <putchar@plt>
  cmp    %rbp,%rbx
  jne    L59
L54:
  lea    D7(%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    L0
  mov    0x14(%rsp),%eax
  mov    0x18(%rsp),%ebx
  shl    $0x4,%eax
  sub    %eax,%ebx
  mov    0x1c(%rsp),%eax
  shl    $0x4,%rax
  add    %rax,0x8(%rsp)
L203:
  test   %ebx,%ebx
  jle    L75
  mov    0x10(%rsp),%esi
  lea    D10(%rip),%rdi
  xor    %eax,%eax
  lea    D41(%rip),%r14
  lea    D73(%rip),%r13
  call   <printf@plt>
  mov    0x8(%rsp),%rax
  lea    0x8(%rax),%rbp
  mov    %rax,%r15
  lea    (%rbx,%rax,1),%r12d
  jmp    L146
  nopl   0x0(%rax)
L190:
  movzbl (%r15),%esi
  mov    %r13,%rdi
  xor    %eax,%eax
  add    $0x1,%r15
  call   <printf@plt>
  cmp    %rbp,%r15
  je     L215
L146:
  mov    %r12d,%eax
  sub    %r15d,%eax
  test   %eax,%eax
  jg     L190
  mov    %r14,%rdi
  xor    %eax,%eax
  add    $0x1,%r15
  call   <printf@plt>
  cmp    %rbp,%r15
  jne    L146
L215:
  mov    $0x20,%edi
  lea    -0x8(%rbx),%r15d
  lea    D41(%rip),%r14
  sub    $0x10,%ebx
  call   <putchar@plt>
  lea    D73(%rip),%r13
  jmp    L78
  nopl   (%rax)
L147:
  movzbl 0x0(%rbp),%esi
  mov    %r13,%rdi
  xor    %eax,%eax
  sub    $0x1,%r15d
  add    $0x1,%rbp
  call   <printf@plt>
  cmp    %ebx,%r15d
  je     L150
L78:
  test   %r15d,%r15d
  jg     L147
  mov    %r14,%rdi
  xor    %eax,%eax
  sub    $0x1,%r15d
  add    $0x1,%rbp
  call   <printf@plt>
  cmp    %ebx,%r15d
  jne    L78
L150:
  mov    $0x7c,%edi
  call   <putchar@plt>
  mov    0x8(%rsp),%rbp
  lea    0x10(%rbp),%rbx
  jmp    L168
  nopl   0x0(%rax)
L17:
  movzbl 0x0(%rbp),%edi
  call   <putchar@plt>
L111:
  add    $0x1,%rbp
  cmp    %rbx,%rbp
  je     L15
L168:
  mov    %r12d,%eax
  sub    %ebp,%eax
  test   %eax,%eax
  jle    L173
  movzbl 0x0(%rbp),%edi
  call   <isprint@plt>
  test   %rax,%rax
  jne    L17
  mov    $0x2e,%edi
  add    $0x1,%rbp
  call   <putchar@plt>
  cmp    %rbx,%rbp
  jne    L168
L15:
  add    $0x28,%rsp
  lea    D7(%rip),%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1090 <puts@plt>
  cs nopw 0x0(%rax,%rax,1)
L173:
  mov    $0x20,%edi
  call   <putchar@plt>
  jmp    L111
L75:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L12:
  movl   $0x0,0x10(%rsp)
  jmp    L203
```

tool_calls: name: read_data
arguments: data_tag: D73
data_type: string
name: read_data
arguments: data_tag: D10
data_type: string
name: read_data
arguments: data_tag: D7
data_type: string
name: read_data
arguments: data_tag: D41
data_type: string

tool: D73: %02x 

tool: D10: $%04x: 

tool: D7: |

tool: D41:    

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");
}
```