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

```asm
<dStrHex>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  movslq %esi,%r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x98,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x88(%rsp)
  xor    %eax,%eax
  test   %r13d,%r13d
  jle    L147
  lea    0x30(%rsp),%rbp
  mov    %rdi,%rbx
  mov    %edx,%r14d
  mov    $0x20,%esi
  mov    $0x50,%edx
  mov    %rbp,%rdi
  call   <memset@plt>
  movb   $0x0,0x80(%rsp)
  test   %r14d,%r14d
  js     L153
  lea    0x31(%rsp),%rax
  lea    D24(%rip),%r12
  xor    %edx,%edx
  mov    %r12,%rsi
  mov    %rax,%rdi
  mov    %rax,0x28(%rsp)
  call   <sprintf@plt>
  add    $0x1,%eax
  cltq
  movb   $0x20,0x30(%rsp,%rax,1)
  test   %r14d,%r14d
  jne    L79
  lea    (%rbx,%r13,1),%rax
  mov    $0x5,%r9d
  mov    $0x3c,%r15d
  mov    %rax,0x18(%rsp)
  lea    D43(%rip),%rax
  mov    %rax,0x20(%rsp)
  jmp    L164
  cs nopw 0x0(%rax,%rax,1)
L81:
  lea    0x5(%r9),%r13d
  movslq %eax,%rdi
  mov    %eax,%r9d
L274:
  movzbl %cl,%edx
  add    %rbp,%rdi
  mov    %r12,%rsi
  mov    %r9d,0x14(%rsp)
  mov    %cl,0x8(%rsp)
  movslq %r13d,%r13
  call   <sprintf@plt>
  movzbl 0x8(%rsp),%ecx
  movb   $0x20,0x30(%rsp,%r13,1)
  lea    0x1(%r15),%eax
  mov    0x14(%rsp),%r9d
  lea    -0x20(%rcx),%edx
  cmp    $0x5f,%dl
  mov    $0x2e,%edx
  cmovae %edx,%ecx
  movslq %r15d,%rdx
  cmp    $0x4b,%r15d
  mov    %cl,0x30(%rsp,%rdx,1)
  je     L40
  cmp    0x18(%rsp),%rbx
  je     L54
L129:
  mov    %eax,%r15d
L164:
  add    $0x1,%rbx
  lea    0x3(%r9),%eax
  movzbl -0x1(%rbx),%ecx
  cmp    $0x1d,%r9d
  jne    L81
  mov    $0x23,%r13d
  mov    $0x21,%edi
  mov    $0x21,%r9d
  jmp    L274
  nopw   0x0(%rax,%rax,1)
L6:
  cmp    $0x5,%r15d
  jne    L215
  nopw   0x0(%rax,%rax,1)
L147:
  mov    0x88(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L38
  add    $0x98,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L153:
  movslq %r13d,%rax
  xor    %r14d,%r14d
  mov    $0x5,%r15d
  mov    %rax,0x8(%rsp)
  lea    D24(%rip),%r12
  jmp    L142
  nopw   0x0(%rax,%rax,1)
L160:
  lea    0x5(%r15),%r13d
  movslq %eax,%rdi
  mov    %eax,%r15d
L0:
  add    %rbp,%rdi
  mov    %r12,%rsi
  movslq %r13d,%r13
  call   <sprintf@plt>
  movb   $0x20,0x30(%rsp,%r13,1)
  test   %r14,%r14
  je     L197
  lea    0x1(%r14),%eax
  test   $0xf,%al
  je     L257
L197:
  add    $0x1,%r14
  cmp    0x8(%rsp),%r14
  je     L6
L142:
  movzbl (%rbx,%r14,1),%edx
  lea    0x3(%r15),%eax
  cmp    $0x1d,%r15d
  jne    L160
  mov    $0x23,%r13d
  mov    $0x21,%edi
  mov    $0x21,%r15d
  jmp    L0
  nopl   0x0(%rax)
L257:
  mov    %rbp,%rsi
  lea    D18(%rip),%rdi
  mov    $0x5,%r15d
  call   <printf@plt>
  mov    $0x50,%edx
  mov    $0x20,%esi
  mov    %rbp,%rdi
  call   <memset@plt>
  jmp    L197
  nopl   0x0(%rax)
L79:
  movslq %r13d,%r14
  movl   $0x0,0x14(%rsp)
  mov    $0x5,%r15d
  lea    (%rbx,%r14,1),%rax
  mov    $0x3c,%r14d
  mov    %rax,0x8(%rsp)
  lea    D43(%rip),%rax
  mov    %rax,0x20(%rsp)
  jmp    L225
  xchg   %ax,%ax
L43:
  lea    0x5(%r15),%r13d
  movslq %eax,%rdi
  mov    %eax,%r15d
L140:
  add    %rbp,%rdi
  mov    %r12,%rsi
  movslq %r13d,%r13
  call   <sprintf@plt>
  movslq %r14d,%rdx
  movb   $0x20,0x30(%rsp,%r13,1)
  lea    0x1(%r14),%eax
  movb   $0x20,0x30(%rsp,%rdx,1)
  cmp    $0x4b,%r14d
  je     L11
  cmp    0x8(%rsp),%rbx
  je     L54
L144:
  mov    %eax,%r14d
L225:
  add    $0x1,%rbx
  lea    0x3(%r15),%eax
  movzbl -0x1(%rbx),%edx
  cmp    $0x1d,%r15d
  jne    L43
  mov    $0x23,%r13d
  mov    $0x21,%edi
  mov    $0x21,%r15d
  jmp    L140
  nopw   0x0(%rax,%rax,1)
L215:
  mov    %rbp,%rsi
  lea    D18(%rip),%rdi
  call   <printf@plt>
  jmp    L147
  nopl   0x0(%rax)
L40:
  mov    0x20(%rsp),%rdi
  mov    %rbp,%rsi
  add    $0x10,%r14d
  call   <printf@plt>
  mov    $0x50,%edx
  mov    $0x20,%esi
  mov    %rbp,%rdi
  call   <memset@plt>
  mov    0x28(%rsp),%rdi
  mov    %r14d,%edx
  mov    %r12,%rsi
  call   <sprintf@plt>
  add    $0x1,%eax
  cltq
  movb   $0x20,0x30(%rsp,%rax,1)
  cmp    0x18(%rsp),%rbx
  je     L147
  mov    $0x3c,%eax
  mov    $0x5,%r9d
  jmp    L129
L11:
  mov    0x20(%rsp),%rdi
  mov    %rbp,%rsi
  call   <printf@plt>
  addl   $0x10,0x14(%rsp)
  mov    $0x50,%edx
  mov    %rbp,%rdi
  mov    0x14(%rsp),%r14d
  mov    $0x20,%esi
  call   <memset@plt>
  mov    0x28(%rsp),%rdi
  mov    %r12,%rsi
  mov    %r14d,%edx
  call   <sprintf@plt>
  add    $0x1,%eax
  cltq
  movb   $0x20,0x30(%rsp,%rax,1)
  cmp    0x8(%rsp),%rbx
  je     L147
  mov    $0x5,%r15d
  mov    $0x3c,%eax
  jmp    L144
  xchg   %ax,%ax
L54:
  mov    0x20(%rsp),%rdi
  mov    %rbp,%rsi
  call   <printf@plt>
  jmp    L147
L38:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: tag: D24
type: string
name: disassemble_data
arguments: tag: D43
type: string
name: disassemble_data
arguments: tag: D18
type: string

tool: D24: %.2x

tool: D43: %.76s


tool: D18: %.60s


assistant: ```c
void dStrHex(const char *str, int len, int no_ascii) {
  const char *p = str;
  unsigned char c;
  char buff[82];
  int a = 0;
  const int bpstart = 5;
  const int cpstart = 60;
  int cpos = cpstart;
  int bpos = bpstart;
  int i, k;
  if (len <= 0)
    return;
  memset(buff, ' ', 80);
  buff[80] = '\0';
  if (no_ascii < 0) {
    for (k = 0; k < len; k++) {
      c = *p++;
      bpos += 3;
      if (bpos == (bpstart + (9 * 3)))
        bpos++;
      sprintf(&buff[bpos], "%.2x", (int)(unsigned char)c);
      buff[bpos + 2] = ' ';
      if ((k > 0) && (0 == ((k + 1) % 16))) {
        printf("%.60s\n", buff);
        bpos = bpstart;
        memset(buff, ' ', 80);
      }
    }
    if (bpos > bpstart)
      printf("%.60s\n", buff);
    return;
  }
  k = sprintf(buff + 1, "%.2x", a);
  buff[k + 1] = ' ';
  for (i = 0; i < len; i++) {
    c = *p++;
    bpos += 3;
    if (bpos == (bpstart + (9 * 3)))
      bpos++;
    sprintf(&buff[bpos], "%.2x", (int)(unsigned char)c);
    buff[bpos + 2] = ' ';
    if (no_ascii)
      buff[cpos++] = ' ';
    else {
      if ((c < ' ') || (c >= 0x7f))
        c = '.';
      buff[cpos++] = c;
    }
    if (cpos > (cpstart + 15)) {
      printf("%.76s\n", buff);
      bpos = bpstart;
      cpos = cpstart;
      a += 16;
      memset(buff, ' ', 80);
      k = sprintf(buff + 1, "%.2x", a);
      buff[k + 1] = ' ';
    }
  }
  if (cpos > cpstart)
    printf("%.76s\n", buff);
}
```