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

```asm
<ut_hexDumpBuf>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %esi,-0x4c(%rbp)
  mov    %rdx,-0x58(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x48(%rbp),%rax
  mov    %rax,-0x38(%rbp)
  mov    -0x4c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x28(%rbp)
  lea    -0x20(%rbp),%rax
  mov    %rax,-0x30(%rbp)
  jmp    L0
L76:
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%edx
  mov    -0x58(%rbp),%rax
  lea    D15(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  cltq
  add    %rax,-0x58(%rbp)
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x1f,%al
  jbe    L5
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x7e,%al
  ja     L5
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%ecx
  mov    -0x30(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x30(%rbp)
  mov    %ecx,%edx
  mov    %dl,(%rax)
  jmp    L19
L5:
  mov    -0x30(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x30(%rbp)
  movb   $0x2e,(%rax)
L19:
  mov    -0x38(%rbp),%rax
  sub    -0x48(%rbp),%rax
  cqto
  shr    $0x3c,%rdx
  add    %rdx,%rax
  and    $0xf,%eax
  sub    %rdx,%rax
  mov    %eax,-0x3c(%rbp)
  cmpl   $0x7,-0x3c(%rbp)
  jne    L91
  mov    -0x58(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x58(%rbp)
  movb   $0x20,(%rax)
  mov    -0x30(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x30(%rbp)
  movb   $0x20,(%rax)
  jmp    L120
L91:
  cmpl   $0xf,-0x3c(%rbp)
  jne    L120
  mov    -0x30(%rbp),%rax
  movb   $0x0,(%rax)
  lea    -0x20(%rbp),%rdx
  mov    -0x58(%rbp),%rax
  lea    D8(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  cltq
  add    %rax,-0x58(%rbp)
  lea    -0x20(%rbp),%rax
  mov    %rax,-0x30(%rbp)
L120:
  addq   $0x1,-0x38(%rbp)
L0:
  mov    -0x38(%rbp),%rax
  cmp    -0x28(%rbp),%rax
  jb     L76
  mov    -0x38(%rbp),%rax
  sub    -0x48(%rbp),%rax
  cqto
  shr    $0x3c,%rdx
  add    %rdx,%rax
  and    $0xf,%eax
  sub    %rdx,%rax
  mov    %eax,-0x3c(%rbp)
  cmpl   $0x0,-0x3c(%rbp)
  je     L123
  cmpl   $0x7,-0x3c(%rbp)
  jg     L9
  mov    -0x58(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x58(%rbp)
  movb   $0x20,(%rax)
  jmp    L9
L85:
  mov    -0x58(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x58(%rbp)
  movb   $0x20,(%rax)
  mov    -0x58(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x58(%rbp)
  movb   $0x20,(%rax)
  mov    -0x58(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x58(%rbp)
  movb   $0x20,(%rax)
  addl   $0x1,-0x3c(%rbp)
L9:
  cmpl   $0xf,-0x3c(%rbp)
  jle    L85
  mov    -0x30(%rbp),%rax
  movb   $0x0,(%rax)
  lea    -0x20(%rbp),%rdx
  mov    -0x58(%rbp),%rax
  lea    D8(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  cltq
  add    %rax,-0x58(%rbp)
L123:
  mov    -0x58(%rbp),%rax
  movb   $0x0,(%rax)
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L58
  call   <__stack_chk_fail@plt>
L58:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: tag: D15
data_type: string
name: unpack_data
arguments: tag: D8
data_type: string

tool: D15: %02X 

tool: D8:   %s


assistant: ```c
void ut_hexDumpBuf(const unsigned char *data, int len, char *out) {
  const unsigned char *b = data;
  const unsigned char *end = data + len;
  char buf[20];
  char *s = buf;
  int i;
  for (; b < end; b++) {
    out += sprintf(out, "%02X ", *b);
    if (' ' <= *b && *b < 127) {
      *s++ = (char)*b;
    } else {
      *s++ = '.';
    }
    i = (b - data) % 16;
    if (7 == i) {
      *out++ = ' ';
      *s++ = ' ';
    } else if (15 == i) {
      *s = '\0';
      out += sprintf(out, "  %s\n", buf);
      s = buf;
    }
  }
  i = (b - data) % 16;
  if (0 != i) {
    if (i < 8) {
      *out++ = ' ';
    }
    for (; i < 16; i++) {
      *out++ = ' ';
      *out++ = ' ';
      *out++ = ' ';
    }
    *s = '\0';
    out += sprintf(out, "  %s\n", buf);
  }
  *out = '\0';
}
```