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

```asm
<format>:
  endbr64
  push   %r15
  xor    %eax,%eax
  push   %r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  mov    %edx,%r12d
  mov    %ecx,%edx
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  lea    D1(%rip),%rsi
  mov    %rbx,%rdi
  lea    0x7(%rbx),%rbp
  sub    $0x18,%rsp
  call   <sprintf@plt>
  test   %r12d,%r12d
  jle    L8
  movzbl 0x0(%r13),%edx
  mov    %rbp,%rdi
  movslq %r12d,%r14
  xor    %eax,%eax
  lea    D25(%rip),%r15
  lea    0xa(%rbx),%rbp
  mov    $0x1,%ebx
  mov    %r15,%rsi
  call   <sprintf@plt>
  lea    0x0(%r13,%r14,1),%rax
  lea    0x1(%r13),%r14
  mov    %rax,0x8(%rsp)
  sub    %r14d,%ebx
  cmp    $0x1,%r12d
  jne    L139
  jmp    L8
  nopl   0x0(%rax)
L34:
  mov    %rdx,%rbp
  add    $0x1,%r14
  cmp    %r14,0x8(%rsp)
  je     L61
L139:
  movzbl (%r14),%edx
  mov    %r15,%rsi
  mov    %rbp,%rdi
  xor    %eax,%eax
  call   <sprintf@plt>
  lea    (%rbx,%r14,1),%eax
  lea    0x3(%rbp),%rdx
  cmp    $0x7,%eax
  jne    L34
  mov    $0x20,%edi
  add    $0x4,%rbp
  add    $0x1,%r14
  mov    %di,(%rdx)
  cmp    %r14,0x8(%rsp)
  jne    L139
  nopl   0x0(%rax,%rax,1)
L61:
  cmp    $0xf,%r12d
  jg     L30
L8:
  mov    %r12d,%eax
  jmp    L62
  nopw   0x0(%rax,%rax,1)
L56:
  cmp    $0xf,%eax
  jg     L19
L168:
  mov    %rdx,%rbp
L62:
  add    $0x1,%eax
  movl   $0x202020,0x0(%rbp)
  lea    0x3(%rbp),%rdx
  cmp    $0x8,%eax
  jne    L56
  mov    $0x20,%esi
  lea    0x4(%rbp),%rdx
  mov    %si,0x3(%rbp)
  jmp    L168
  nopw   0x0(%rax,%rax,1)
L19:
  mov    $0x2020,%ecx
  movb   $0x0,0x2(%rdx)
  add    $0x5,%rbp
  mov    %cx,(%rdx)
  test   %r12d,%r12d
  jle    L159
L63:
  xor    %ebx,%ebx
  lea    D11(%rip),%r14
  jmp    L132
L80:
  mov    $0x2e,%edx
  add    $0x1,%rbx
  mov    %dx,(%rdi)
  cmp    %ebx,%r12d
  jle    L159
L132:
  movsbl 0x0(%r13,%rbx,1),%edx
  lea    0x0(%rbp,%rbx,1),%rdi
  lea    -0x20(%rdx),%eax
  cmp    $0x5e,%al
  ja     L80
  mov    %r14,%rsi
  xor    %eax,%eax
  add    $0x1,%rbx
  call   <sprintf@plt>
  cmp    %ebx,%r12d
  jg     L132
L159:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L30:
  mov    $0x2020,%eax
  movb   $0x0,0x2(%rbp)
  add    $0x2,%rbp
  mov    %ax,-0x2(%rbp)
  jmp    L63
```

tool_calls: name: retrieve_data
arguments: data_tag: D1
data_type: string
name: retrieve_data
arguments: data_tag: D25
data_type: string
name: retrieve_data
arguments: data_tag: D11
data_type: string

tool: D1: %.6X 

tool: D25: %.2X 

tool: D11: %c

assistant: ```c
void format(const char *inbuf, char *outbuf, int count, int start) {
  int i;
  const char *pIn = inbuf;
  sprintf(outbuf, "%.6X ", (unsigned int)start);
  outbuf += 7;
  for (i = 0; i < count; i++, pIn++) {
    sprintf(outbuf, "%.2X ", (unsigned char)*pIn);
    outbuf += 3;
    if (i == 7) {
      sprintf(outbuf++, " ");
    }
  }
  for (i = count; i < 16; i++) {
    sprintf(outbuf, "   ");
    outbuf += 3;
    if (i == 7) {
      sprintf(outbuf++, " ");
    }
  }
  sprintf(outbuf, "  ");
  outbuf += 2;
  pIn = inbuf;
  for (i = 0; i < count; i++, pIn++) {
    if (*pIn < 32 || *pIn > 126) {
      sprintf(outbuf++, ".");
    } else {
      sprintf(outbuf++, "%c", *pIn);
    }
  }
}
```