user: What is the c source code of the assembly code below?

```asm
<hex_dump>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%r15
  mov    %esi,0x8(%rsp)
  cmp    $0xf,%esi
  jle    L118
  mov    %esi,%eax
  lea    0x10(%rdi),%r13
  lea    0x8(%rdi),%r14
  sub    $0x10,%eax
  shr    $0x4,%eax
  mov    %eax,0xc(%rsp)
  add    $0x1,%eax
  shl    $0x4,%eax
  mov    %eax,0x4(%rsp)
  movl   $0x0,(%rsp)
  lea    D51(%rip),%r12
  jmp    L221
L154:
  mov    $0x2e,%edi
  call   <putchar@plt>
L144:
  add    $0x1,%rbp
  cmp    %rbx,%rbp
  je     L37
L155:
  movzbl 0x0(%rbp),%edi
  call   <isprint@plt>
  test   %rax,%rax
  je     L154
  movzbl 0x0(%rbp),%edi
  call   <putchar@plt>
  jmp    L144
L37:
  lea    D64(%rip),%rdi
  call   <puts@plt>
  addl   $0x10,(%rsp)
  mov    (%rsp),%eax
  add    $0x10,%r13
  add    $0x10,%r14
  cmp    0x4(%rsp),%eax
  je     L29
L221:
  lea    -0x10(%r13),%rbp
  mov    (%rsp),%esi
  lea    D24(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %rbp,%rbx
L200:
  movzbl (%rbx),%esi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  add    $0x1,%rbx
  cmp    %r14,%rbx
  jne    L200
  mov    $0x20,%edi
  call   <putchar@plt>
L134:
  movzbl (%rbx),%esi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  add    $0x1,%rbx
  cmp    %r13,%rbx
  jne    L134
  mov    $0x7c,%edi
  call   <putchar@plt>
  jmp    L155
L29:
  mov    0xc(%rsp),%ecx
  mov    %ecx,%eax
  neg    %eax
  shl    $0x4,%eax
  mov    0x8(%rsp),%edx
  lea    -0x10(%rdx,%rax,1),%eax
  mov    %eax,0x8(%rsp)
  mov    %ecx,%eax
  add    $0x1,%eax
  mov    %eax,%eax
  shl    $0x4,%rax
  add    %rax,%r15
L98:
  mov    0x8(%rsp),%r14d
  test   %r14d,%r14d
  jle    L143
  mov    0x4(%rsp),%esi
  lea    D24(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    0x8(%r15),%rbp
  mov    %r15,%rbx
  mov    %r14d,(%rsp)
  lea    (%r14,%r15,1),%r12d
  lea    D0(%rip),%r14
  lea    D51(%rip),%r13
  jmp    L217
L118:
  movl   $0x0,0x4(%rsp)
  jmp    L98
L190:
  mov    %r14,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L42:
  add    $0x1,%rbx
  cmp    %rbp,%rbx
  je     L186
L217:
  mov    %r12d,%eax
  sub    %ebx,%eax
  test   %eax,%eax
  jle    L190
  movzbl (%rbx),%esi
  mov    %r13,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L42
L186:
  mov    0x8(%rsp),%ebx
  sub    $0x8,%ebx
  mov    $0x20,%edi
  call   <putchar@plt>
  mov    (%rsp),%r13d
  sub    $0x10,%r13d
  lea    D51(%rip),%r14
  jmp    L239
L180:
  lea    D0(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L34:
  add    $0x1,%rbp
  sub    $0x1,%ebx
  cmp    %r13d,%ebx
  je     L189
L239:
  test   %ebx,%ebx
  jle    L180
  movzbl 0x0(%rbp),%esi
  mov    %r14,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L34
L189:
  mov    $0x7c,%edi
  call   <putchar@plt>
  lea    0x10(%r15),%rbx
  jmp    L227
L158:
  mov    $0x20,%edi
  call   <putchar@plt>
  jmp    L197
L56:
  mov    $0x2e,%edi
  call   <putchar@plt>
L197:
  add    $0x1,%r15
  cmp    %r15,%rbx
  je     L236
L227:
  mov    %r12d,%eax
  sub    %r15d,%eax
  test   %eax,%eax
  jle    L158
  movzbl (%r15),%edi
  call   <isprint@plt>
  test   %rax,%rax
  je     L56
  movzbl (%r15),%edi
  call   <putchar@plt>
  jmp    L197
L236:
  lea    D64(%rip),%rdi
  call   <puts@plt>
L143:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: retrieve_data
arguments: data_tag: D51
data_type: string
name: retrieve_data
arguments: data_tag: D64
data_type: string
name: retrieve_data
arguments: data_tag: D24
data_type: string
name: retrieve_data
arguments: data_tag: D0
data_type: string

tool: D51: %02x 

tool: D64: |

tool: D24: $%04x: 

tool: D0:    

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