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

```asm
<put_dump>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %edx,-0x34(%rbp)
  mov    %ecx,-0x38(%rbp)
  mov    -0x30(%rbp),%rax
  movzbl %al,%eax
  mov    %eax,%esi
  lea    D38(%rip),%rax
  mov    %rax,%rdi
  call   <xprintf@plt>
  cmpl   $0x8,-0x38(%rbp)
  je     L144
  cmpl   $0x8,-0x38(%rbp)
  jg     L141
  cmpl   $0x1,-0x38(%rbp)
  je     L152
  cmpl   $0x2,-0x38(%rbp)
  je     L13
  jmp    L141
L152:
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0x1c(%rbp)
  jmp    L78
L82:
  mov    -0x1c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,%esi
  lea    D3(%rip),%rax
  mov    %rax,%rdi
  call   <xprintf@plt>
  addl   $0x1,-0x1c(%rbp)
L78:
  mov    -0x1c(%rbp),%eax
  cmp    -0x34(%rbp),%eax
  jl     L82
  mov    $0x20,%edi
  call   <xputc@plt>
  movl   $0x0,-0x1c(%rbp)
  jmp    L28
L109:
  mov    -0x1c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x1f,%al
  jbe    L49
  mov    -0x1c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x7e,%al
  ja     L49
  mov    -0x1c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  jmp    L150
L49:
  mov    $0x2e,%eax
L150:
  mov    %eax,%edi
  call   <xputc@plt>
  addl   $0x1,-0x1c(%rbp)
L28:
  mov    -0x1c(%rbp),%eax
  cmp    -0x34(%rbp),%eax
  jl     L109
  jmp    L141
L13:
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x18(%rbp)
L50:
  mov    -0x18(%rbp),%rax
  lea    0x2(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  movzwl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,%esi
  lea    D23(%rip),%rax
  mov    %rax,%rdi
  call   <xprintf@plt>
  subl   $0x1,-0x34(%rbp)
  cmpl   $0x0,-0x34(%rbp)
  jne    L50
  jmp    L141
L144:
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x10(%rbp)
L113:
  mov    -0x10(%rbp),%rax
  lea    0x8(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  mov    (%rax),%rax
  movzbl %al,%eax
  mov    %eax,%esi
  lea    D11(%rip),%rax
  mov    %rax,%rdi
  call   <xprintf@plt>
  subl   $0x1,-0x34(%rbp)
  cmpl   $0x0,-0x34(%rbp)
  jne    L113
  nop
L141:
  mov    $0xa,%edi
  call   <xputc@plt>
  nop
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D38
datatype: string
name: unpack_data
arguments: data_tag: D3
datatype: string
name: unpack_data
arguments: data_tag: D23
datatype: string
name: unpack_data
arguments: data_tag: D11
datatype: string

tool: D38: %08lX 

tool: D3:  %02X

tool: D23:  %04X

tool: D11:  %08LX

assistant: ```c
void put_dump(const void *buff, unsigned long addr, int len, int width) {
  int i;
  const unsigned char *bp;
  const unsigned short *sp;
  const unsigned long *lp;
  xprintf("%08lX ", addr);
  switch (width) {
  case sizeof(char):
    bp = buff;
    for (i = 0; i < len; i++)
      xprintf(" %02X", bp[i]);
    xputc(' ');
    for (i = 0; i < len; i++)
      xputc((unsigned char)((bp[i] >= ' ' && bp[i] <= '~') ? bp[i] : '.'));
    break;
  case sizeof(short):
    sp = buff;
    do
      xprintf(" %04X", *sp++);
    while (--len);
    break;
  case sizeof(long):
    lp = buff;
    do
      xprintf(" %08LX", *lp++);
    while (--len);
    break;
  }
  xputc('\n');
}
```