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

```asm
<hexdump>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %esi,%ebx
  sub    $0x18,%rsp
  mov    %rdi,0x8(%rsp)
  mov    %esi,0x4(%rsp)
  call   <map_memory@plt>
  mov    %rax,%r15
  cmp    $0x100000,%ebx
  jg     L28
  mov    0x4(%rsp),%edx
  test   %edx,%edx
  jle    L40
L177:
  xor    %ebp,%ebp
  xor    %r12d,%r12d
  lea    D4(%rip),%r13
  nopl   0x0(%rax)
L275:
  mov    (%r15),%eax
  test   %eax,%eax
  jne    L148
  mov    0x4(%r15),%eax
  test   %eax,%eax
  jne    L148
  mov    0x8(%r15),%eax
  test   %eax,%eax
  jne    L148
  mov    0xc(%r15),%eax
  test   %eax,%eax
  jne    L148
  mov    0x10(%r15),%eax
  test   %eax,%eax
  jne    L148
  mov    0x14(%r15),%r14d
  test   %r14d,%r14d
  jne    L148
  mov    0x18(%r15),%ebx
  test   %ebx,%ebx
  jne    L148
  mov    0x1c(%r15),%r11d
  test   %r11d,%r11d
  jne    L148
  mov    0x20(%r15),%r10d
  test   %r10d,%r10d
  jne    L148
  mov    0x24(%r15),%r9d
  test   %r9d,%r9d
  jne    L148
  mov    0x28(%r15),%r8d
  test   %r8d,%r8d
  jne    L148
  mov    0x2c(%r15),%edi
  test   %edi,%edi
  jne    L148
  mov    0x30(%r15),%esi
  test   %esi,%esi
  jne    L148
  mov    0x34(%r15),%ecx
  test   %ecx,%ecx
  jne    L148
  mov    0x38(%r15),%edx
  test   %edx,%edx
  jne    L148
  mov    0x3c(%r15),%eax
  test   %eax,%eax
  jne    L148
  add    $0x1,%r12d
  cmp    $0x1,%r12d
  je     L186
  lea    0x40(%r15),%rbx
  cmp    $0x2,%r12d
  jne    L18
  lea    D10(%rip),%rdi
  call   <puts@plt>
L18:
  add    $0x10,%rbp
  mov    %rbx,%r15
  cmp    %ebp,0x4(%rsp)
  jg     L275
L40:
  add    $0x18,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    10d0 <unmap_memory@plt>
  xchg   %ax,%ax
L148:
  xor    %r12d,%r12d
L186:
  mov    0x8(%rsp),%rax
  lea    D13(%rip),%rdi
  mov    %r15,%r14
  lea    0x40(%r15),%rbx
  lea    (%rax,%rbp,1),%rsi
  xor    %eax,%eax
  call   <printf@plt>
  nopl   0x0(%rax)
L229:
  mov    (%r14),%esi
  mov    %r13,%rdi
  xor    %eax,%eax
  add    $0x4,%r14
  call   <printf@plt>
  cmp    %r14,%rbx
  jne    L229
  lea    D0(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  nopl   0x0(%rax)
L265:
  mov    (%r15),%edi
  call   <isprint@plt>
  test   %rax,%rax
  je     L234
  mov    (%r15),%edi
  add    $0x4,%r15
  call   <putchar@plt>
  cmp    %r15,%rbx
  jne    L265
  mov    $0xa,%edi
  call   <putchar@plt>
  jmp    L18
  nopl   (%rax)
L234:
  mov    $0x2e,%edi
  add    $0x4,%r15
  call   <putchar@plt>
  cmp    %r15,%rbx
  jne    L265
  mov    $0xa,%edi
  call   <putchar@plt>
  jmp    L18
L28:
  mov    0x4(%rsp),%esi
  mov    $0x100000,%edx
  lea    D7(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  movl   $0x100000,0x4(%rsp)
  jmp    L177
```

tool_calls: name: parse_data
arguments: data_label: D4
datatype: string
name: parse_data
arguments: data_label: D10
datatype: string
name: parse_data
arguments: data_label: D13
datatype: string
name: parse_data
arguments: data_label: D0
datatype: string
name: parse_data
arguments: data_label: D7
datatype: string

tool: D4:  %02x

tool: D10: ...

tool: D13: %08lx:

tool: D0:   

tool: D7: Truncating hex dump from %d to %d bytes



assistant: ```c
void hexdump(unsigned long memory, int length) {
  int i;
  uint8_t *m;
  int all_zero = 0;
  m = map_memory((intptr_t)memory);
  if (length > (1024 * 1024)) {
    printf("Truncating hex dump from %d to %d bytes\n\n", length, (1024 * 1024));
    length = (1024 * 1024);
  }
  for (i = 0; i < length; i += 16) {
    int j;
    all_zero++;
    for (j = 0; j < 16; j++) {
      if (m[i + j] != 0) {
        all_zero = 0;
        break;
      }
    }
    if (all_zero < 2) {
      printf("%08lx:", memory + i);
      for (j = 0; j < 16; j++)
        printf(" %02x", m[i + j]);
      printf("  ");
      for (j = 0; j < 16; j++)
        printf("%c", isprint(m[i + j]) ? m[i + j] : '.');
      printf("\n");
    } else if (all_zero == 2) {
      printf("...\n");
    }
  }
  unmap_memory();
}
```