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

```asm
<hexdump8>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <assert@plt>
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x20(%rbp)
  cmpq   $0x0,-0x30(%rbp)
  je     L85
  movq   $0x0,-0x18(%rbp)
  jmp    L38
L95:
  mov    -0x18(%rbp),%rax
  and    $0xf,%eax
  test   %rax,%rax
  jne    L104
  cmpq   $0x0,-0x18(%rbp)
  je     L40
  lea    D14(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x20(%rbp),%rax
  sub    $0x40,%rax
  mov    $0x10,%esi
  mov    %rax,%rdi
  call   <strdump@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
L40:
  mov    -0x20(%rbp),%rax
  mov    %rax,%rsi
  lea    D29(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L104:
  mov    -0x18(%rbp),%rax
  and    $0x3,%eax
  test   %rax,%rax
  jne    L20
  mov    $0x20,%edi
  call   <putchar@plt>
L20:
  mov    -0x20(%rbp),%rax
  lea    0x4(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  mov    (%rax),%eax
  mov    %eax,%esi
  lea    D38(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  addq   $0x1,-0x18(%rbp)
L38:
  mov    -0x18(%rbp),%rax
  cmp    -0x30(%rbp),%rax
  jb     L95
  mov    -0x30(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x30(%rbp),%rax
  and    $0xf,%eax
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  je     L23
  mov    -0x10(%rbp),%rax
  sub    -0x8(%rbp),%rax
  add    $0x10,%rax
  mov    %rax,-0x10(%rbp)
  jmp    L100
L23:
  movq   $0x10,-0x8(%rbp)
  jmp    L100
L7:
  mov    -0x18(%rbp),%rax
  and    $0x3,%eax
  test   %rax,%rax
  jne    L3
  mov    $0x20,%edi
  call   <putchar@plt>
L3:
  addq   $0x1,-0x18(%rbp)
  lea    D23(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L100:
  mov    -0x18(%rbp),%rax
  cmp    -0x10(%rbp),%rax
  jb     L7
  lea    D14(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x8(%rbp),%rax
  shl    $0x2,%rax
  neg    %rax
  mov    %rax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rax,%rdx
  mov    -0x8(%rbp),%rax
  mov    %rax,%rsi
  mov    %rdx,%rdi
  call   <strdump@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  jmp    L97
L85:
  nop
L97:
  leave
  ret
```

tool_calls: name: parse_data
arguments: data_label: D14
type_guessed: string
name: parse_data
arguments: data_label: D29
type_guessed: string
name: parse_data
arguments: data_label: D38
type_guessed: string
name: parse_data
arguments: data_label: D23
type_guessed: string

tool: D14:  | 

tool: D29: %p |

tool: D38: %02x

tool: D23:   

assistant: ```c
void hexdump8(const void *buf, size_t len) {
  assert(buf);
  const uint8_t *data = buf;
  size_t i, spaces, tail;
  if (!len) {
    return;
  }
  for (i = 0; i < len; ++i) {
    if (i % 16 == 0) {
      if (i) {
        printf(" | ");
        strdump(data - 16, 16);
        putchar('\n');
      }
      printf("%p |", data);
    }
    if (i % 4 == 0) {
      putchar(' ');
    }
    printf("%02x", *data++);
  }
  spaces = len;
  tail = len % 16;
  if (tail) {
    spaces += 16 - tail;
  } else {
    tail = 16;
  }
  while (i < spaces) {
    if (i % 4 == 0) {
      putchar(' ');
    }
    ++i;
    printf("  ");
  }
  printf(" | ");
  strdump(data - tail, tail);
  putchar('\n');
}
```