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

```asm
<hexdump>:
  endbr64
  test   %esi,%esi
  jle    L572
  push   %r15
  lea    -0x1(%rsi),%eax
  lea    D22(%rip),%r15
  push   %r14
  and    $0xfffffff0,%eax
  push   %r13
  add    $0x10,%eax
  push   %r12
  lea    0x10(%rdi),%r12
  push   %rbp
  xor    %ebp,%ebp
  push   %rbx
  mov    %esi,%ebx
  sub    $0x18,%rsp
  mov    %rdi,(%rsp)
  mov    %eax,0xc(%rsp)
  nopw   0x0(%rax,%rax,1)
L436:
  mov    %ebp,%esi
  lea    D26(%rip),%rdi
  xor    %eax,%eax
  mov    %ebp,%r13d
  call   <printf@plt>
  mov    (%rsp),%rax
  mov    %rax,%r14
  sub    %eax,%r13d
  jmp    L657
  nop
L556:
  movzbl (%r14),%esi
  lea    D11(%rip),%rdi
  xor    %eax,%eax
  add    $0x1,%r14
  call   <printf@plt>
  cmp    %r14,%r12
  je     L569
L657:
  lea    0x0(%r13,%r14,1),%eax
  cmp    %ebx,%eax
  jl     L556
  mov    %r15,%rdi
  xor    %eax,%eax
  add    $0x1,%r14
  call   <printf@plt>
  cmp    %r14,%r12
  jne    L657
L569:
  mov    $0x20,%edi
  call   <putchar@plt>
  mov    (%rsp),%rax
  movzbl (%rax),%edi
  call   <isprint@plt>
  test   %rax,%rax
  je     L188
  mov    (%rsp),%rax
  movzbl (%rax),%edi
  call   <putchar@plt>
  lea    0x1(%rbp),%eax
  cmp    %eax,%ebx
  jg     L169
L244:
  lea    0x2(%rbp),%eax
  cmp    %eax,%ebx
  jg     L359
L415:
  lea    0x3(%rbp),%eax
  cmp    %eax,%ebx
  jg     L643
L290:
  lea    0x4(%rbp),%eax
  cmp    %eax,%ebx
  jg     L343
L166:
  lea    0x5(%rbp),%eax
  cmp    %eax,%ebx
  jg     L576
L145:
  lea    0x6(%rbp),%eax
  cmp    %eax,%ebx
  jg     L186
L289:
  lea    0x7(%rbp),%eax
  cmp    %eax,%ebx
  jg     L20
L418:
  lea    0x8(%rbp),%eax
  cmp    %eax,%ebx
  jg     L567
L679:
  lea    0x9(%rbp),%eax
  cmp    %eax,%ebx
  jg     L185
L360:
  lea    0xa(%rbp),%eax
  cmp    %eax,%ebx
  jg     L331
L212:
  lea    0xb(%rbp),%eax
  cmp    %eax,%ebx
  jg     L254
L209:
  lea    0xc(%rbp),%eax
  cmp    %eax,%ebx
  jg     L199
L547:
  lea    0xd(%rbp),%eax
  cmp    %eax,%ebx
  jg     L477
L416:
  lea    0xe(%rbp),%eax
  cmp    %eax,%ebx
  jg     L310
L350:
  lea    0xf(%rbp),%eax
  cmp    %eax,%ebx
  jg     L229
L153:
  mov    $0xa,%edi
  add    $0x10,%ebp
  add    $0x10,%r12
  call   <putchar@plt>
  addq   $0x10,(%rsp)
  cmp    0xc(%rsp),%ebp
  jne    L436
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  cs nopw 0x0(%rax,%rax,1)
L188:
  mov    $0x2e,%edi
  call   <putchar@plt>
  lea    0x1(%rbp),%eax
  cmp    %eax,%ebx
  jle    L244
L169:
  mov    (%rsp),%rax
  movzbl 0x1(%rax),%edi
  call   <isprint@plt>
  test   %rax,%rax
  jne    L179
  mov    $0x2e,%edi
L300:
  call   <putchar@plt>
  lea    0x2(%rbp),%eax
  cmp    %eax,%ebx
  jle    L415
L359:
  mov    (%rsp),%rax
  movzbl 0x2(%rax),%edi
  call   <isprint@plt>
  test   %rax,%rax
  jne    L422
  mov    $0x2e,%edi
L637:
  call   <putchar@plt>
  lea    0x3(%rbp),%eax
  cmp    %eax,%ebx
  jle    L290
L643:
  mov    (%rsp),%rax
  movzbl 0x3(%rax),%edi
  call   <isprint@plt>
  test   %rax,%rax
  jne    L460
  mov    $0x2e,%edi
L342:
  call   <putchar@plt>
  lea    0x4(%rbp),%eax
  cmp    %eax,%ebx
  jle    L166
L343:
  mov    (%rsp),%rax
  movzbl 0x4(%rax),%edi
  call   <isprint@plt>
  test   %rax,%rax
  jne    L332
  mov    $0x2e,%edi
L256:
  call   <putchar@plt>
  lea    0x5(%rbp),%eax
  cmp    %eax,%ebx
  jle    L145
L576:
  mov    (%rsp),%rax
  movzbl 0x5(%rax),%edi
  call   <isprint@plt>
  test   %rax,%rax
  jne    L678
  mov    $0x2e,%edi
L85:
  call   <putchar@plt>
  lea    0x6(%rbp),%eax
  cmp    %eax,%ebx
  jle    L289
L186:
  mov    (%rsp),%rax
  movzbl 0x6(%rax),%edi
  call   <isprint@plt>
  test   %rax,%rax
  jne    L79
  mov    $0x2e,%edi
L429:
  call   <putchar@plt>
  lea    0x7(%rbp),%eax
  cmp    %eax,%ebx
  jle    L418
L20:
  mov    (%rsp),%rax
  movzbl 0x7(%rax),%edi
  call   <isprint@plt>
  test   %rax,%rax
  jne    L391
  mov    $0x2e,%edi
L47:
  call   <putchar@plt>
  lea    0x8(%rbp),%eax
  cmp    %eax,%ebx
  jle    L679
L567:
  mov    (%rsp),%rax
  movzbl 0x8(%rax),%edi
  call   <isprint@plt>
  test   %rax,%rax
  jne    L171
  mov    $0x2e,%edi
L134:
  call   <putchar@plt>
  lea    0x9(%rbp),%eax
  cmp    %eax,%ebx
  jle    L360
L185:
  mov    (%rsp),%rax
  movzbl 0x9(%rax),%edi
  call   <isprint@plt>
  test   %rax,%rax
  jne    L355
  mov    $0x2e,%edi
L510:
  call   <putchar@plt>
  lea    0xa(%rbp),%eax
  cmp    %eax,%ebx
  jle    L212
L331:
  mov    (%rsp),%rax
  movzbl 0xa(%rax),%edi
  call   <isprint@plt>
  test   %rax,%rax
  jne    L4
  mov    $0x2e,%edi
L281:
  call   <putchar@plt>
  lea    0xb(%rbp),%eax
  cmp    %eax,%ebx
  jle    L209
L254:
  mov    (%rsp),%rax
  movzbl 0xb(%rax),%edi
  call   <isprint@plt>
  test   %rax,%rax
  jne    L544
  mov    $0x2e,%edi
L499:
  call   <putchar@plt>
  lea    0xc(%rbp),%eax
  cmp    %eax,%ebx
  jle    L547
L199:
  mov    (%rsp),%rax
  movzbl 0xc(%rax),%edi
  call   <isprint@plt>
  test   %rax,%rax
  jne    L611
  mov    $0x2e,%edi
L31:
  call   <putchar@plt>
  lea    0xd(%rbp),%eax
  cmp    %eax,%ebx
  jle    L416
L477:
  mov    (%rsp),%rax
  movzbl 0xd(%rax),%edi
  call   <isprint@plt>
  test   %rax,%rax
  jne    L548
  mov    $0x2e,%edi
L407:
  call   <putchar@plt>
  lea    0xe(%rbp),%eax
  cmp    %eax,%ebx
  jle    L350
L310:
  mov    (%rsp),%rax
  movzbl 0xe(%rax),%edi
  call   <isprint@plt>
  test   %rax,%rax
  jne    L616
  mov    $0x2e,%edi
L97:
  call   <putchar@plt>
  lea    0xf(%rbp),%eax
  cmp    %eax,%ebx
  jle    L153
L229:
  mov    (%rsp),%rax
  movzbl 0xf(%rax),%edi
  call   <isprint@plt>
  test   %rax,%rax
  jne    L105
  mov    $0x2e,%edi
L50:
  call   <putchar@plt>
  jmp    L153
L179:
  mov    (%rsp),%rax
  movzbl 0x1(%rax),%edi
  jmp    L300
L460:
  mov    (%rsp),%rax
  movzbl 0x3(%rax),%edi
  jmp    L342
L171:
  mov    (%rsp),%rax
  movzbl 0x8(%rax),%edi
  jmp    L134
L422:
  mov    (%rsp),%rax
  movzbl 0x2(%rax),%edi
  jmp    L637
L678:
  mov    (%rsp),%rax
  movzbl 0x5(%rax),%edi
  jmp    L85
L391:
  mov    (%rsp),%rax
  movzbl 0x7(%rax),%edi
  jmp    L47
L79:
  mov    (%rsp),%rax
  movzbl 0x6(%rax),%edi
  jmp    L429
L332:
  mov    (%rsp),%rax
  movzbl 0x4(%rax),%edi
  jmp    L256
L355:
  mov    (%rsp),%rax
  movzbl 0x9(%rax),%edi
  jmp    L510
L544:
  mov    (%rsp),%rax
  movzbl 0xb(%rax),%edi
  jmp    L499
L4:
  mov    (%rsp),%rax
  movzbl 0xa(%rax),%edi
  jmp    L281
L105:
  mov    (%rsp),%rax
  movzbl 0xf(%rax),%edi
  jmp    L50
L616:
  mov    (%rsp),%rax
  movzbl 0xe(%rax),%edi
  jmp    L97
L548:
  mov    (%rsp),%rax
  movzbl 0xd(%rax),%edi
  jmp    L407
L611:
  mov    (%rsp),%rax
  movzbl 0xc(%rax),%edi
  jmp    L31
L572:
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D22
type: string
name: unpack_data
arguments: data_label: D26
type: string
name: unpack_data
arguments: data_label: D11
type: string

tool: D22:    

tool: D26: %06x: 

tool: D11: %02x 

assistant: ```c
void hexdump(void *ptr, int buflen) {
  unsigned char *buf = (unsigned char *)ptr;
  int i, j;
  for (i = 0; i < buflen; i += 16) {
    printf("%06x: ", i);
    for (j = 0; j < 16; j++)
      if (i + j < buflen)
        printf("%02x ", buf[i + j]);
      else
        printf("   ");
    printf(" ");
    for (j = 0; j < 16; j++)
      if (i + j < buflen)
        printf("%c", isprint(buf[i + j]) ? buf[i + j] : '.');
    printf("\n");
  }
}
```