user: What is the c source code of the assembly code below:

```asm
<printhex>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rsi,0x8(%rsp)
  test   %rdx,%rdx
  je     L195
  mov    %rdi,%rbx
  mov    %rdx,%r12
  lea    D8(%rip),%r15
  jmp    L58
L110:
  lea    D16(%rip),%rcx
  mov    0x8(%rsp),%edx
  lea    D54(%rip),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  test   %r12,%r12
  je     L104
  movb   $0x1,0x17(%rsp)
  jmp    L82
L104:
  mov    %r12,%r13
  mov    0x8(%rsp),%r14
  movb   $0x0,0x17(%rsp)
  mov    $0x8,%ebp
  jmp    L108
L33:
  mov    %r12,0x18(%rsp)
  mov    %r14,%r12
L10:
  add    $0x1,%r12
  movzbl -0x1(%r12),%edx
  lea    D62(%rip),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  sub    $0x1,%ebp
  mov    %r13,%rax
  sub    %r12,%rax
  add    %r14,%rax
  je     L56
  test   %ebp,%ebp
  jne    L10
L56:
  mov    0x18(%rsp),%r12
  test   %ebp,%ebp
  jne    L88
  jmp    L198
L153:
  mov    %rbx,%rsi
  mov    $0xa,%edi
  call   <fputc@plt>
  test   %r12,%r12
  je     L195
  mov    %rbp,0x8(%rsp)
L58:
  cmp    $0x1,%r12
  jbe    L110
  mov    $0x10,%eax
  cmp    %rax,%r12
  cmovbe %r12,%rax
  mov    0x8(%rsp),%rsi
  mov    %esi,%edx
  lea    -0x1(%rdx,%rax,1),%rcx
  mov    %esi,%edx
  lea    D7(%rip),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  test   %r12,%r12
  setne  0x17(%rsp)
L82:
  mov    %r12,%r13
  mov    0x8(%rsp),%r14
  mov    $0x8,%ebp
L152:
  add    $0x1,%r14
  movzbl -0x1(%r14),%edx
  lea    D62(%rip),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  sub    $0x1,%r13
  sub    $0x1,%ebp
  je     L96
  test   %r13,%r13
  jne    L152
L96:
  test   %ebp,%ebp
  je     L112
L108:
  mov    %rbx,%rcx
  mov    $0x3,%edx
  mov    $0x1,%esi
  mov    %r15,%rdi
  call   <fwrite@plt>
  sub    $0x1,%ebp
  jne    L108
L112:
  mov    %rbx,%rsi
  mov    $0x20,%edi
  call   <fputc@plt>
  mov    $0x8,%ebp
  test   %r13,%r13
  jne    L33
L88:
  mov    %rbx,%rcx
  mov    $0x3,%edx
  mov    $0x1,%esi
  mov    %r15,%rdi
  call   <fwrite@plt>
  sub    $0x1,%ebp
  jne    L88
L198:
  mov    %rbx,%rcx
  mov    $0x2,%edx
  mov    $0x1,%esi
  lea    D66(%rip),%rdi
  call   <fwrite@plt>
  cmpb   $0x0,0x17(%rsp)
  je     L179
  mov    0x8(%rsp),%r14
  mov    %r14,%rbp
  mov    $0x2e,%r13d
L181:
  add    $0x1,%rbp
  movzbl -0x1(%rbp),%edi
  cmp    $0x1f,%dil
  cmovle %r13d,%edi
  movsbl %dil,%edi
  mov    %rbx,%rsi
  call   <fputc@plt>
  sub    $0x1,%r12
  mov    %r14d,%eax
  sub    %ebp,%eax
  cmp    $0xfffffff0,%eax
  je     L153
  test   %r12,%r12
  jne    L181
  jmp    L153
L179:
  mov    %rbx,%rsi
  mov    $0xa,%edi
  call   <fputc@plt>
L195:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: parse_data
arguments: data_tag: D8
data_type: string
name: parse_data
arguments: data_tag: D16
data_type: string
name: parse_data
arguments: data_tag: D54
data_type: string
name: parse_data
arguments: data_tag: D62
data_type: string
name: parse_data
arguments: data_tag: D7
data_type: string
name: parse_data
arguments: data_tag: D66
data_type: string

tool: D8:    

tool: 

tool: D54: %08X %8.8s 

tool: D62:  %02X

tool: D7: %08X-%08X 

tool: D66:   

assistant: ```c
void printhex(FILE *output, const char *buf, size_t size) {
  int i;
  char *ptr;
  char c;
  size_t tmp;
  while (size) {
    if (size > 1) {
      fprintf(output, "%08X-%08X ", (unsigned int)buf, (unsigned int)buf + (size > 15 ? 15 : size - 1));
    } else
      fprintf(output, "%08X %8.8s ", (unsigned int)buf, "");
    ptr = (char *)buf;
    tmp = size;
    for (i = 8; i && tmp; i--, tmp--)
      fprintf(output, " %02X", (unsigned char)*ptr++);
    for (; i; i--)
      fprintf(output, "   ");
    fprintf(output, " ");
    if (tmp) {
      for (i = 8; i && tmp; i--, tmp--)
        fprintf(output, " %02X", (unsigned char)*ptr++);
    } else
      i = 8;
    for (; i; i--)
      fprintf(output, "   ");
    fprintf(output, "  ");
    for (i = 16; i && size; i--, size--) {
      c = *buf++;
      fprintf(output, "%c", c < 32 ? '.' : c);
    }
    fprintf(output, "\n");
  }
}
```