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

```asm
<ddump>:
  endbr64
  push   %r15
  xor    %eax,%eax
  push   %r14
  mov    %esi,%r14d
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  lea    D51(%rip),%rdi
  sub    $0x18,%rsp
  mov    %esi,0x8(%rsp)
  call   <dprintf@plt>
  test   %r14d,%r14d
  jle    L107
  mov    %r14d,%eax
  movl   $0x0,(%rsp)
  sub    $0x1,%eax
  mov    %r14d,0x4(%rsp)
  lea    D59(%rip),%r14
  and    $0xfffffff0,%eax
  add    $0x10,%eax
  mov    %eax,0xc(%rsp)
  cs nopw 0x0(%rax,%rax,1)
L46:
  mov    %ebx,%esi
  lea    D55(%rip),%rdi
  xor    %eax,%eax
  xor    %r12d,%r12d
  call   <dprintf@plt>
  mov    $0x10,%ebp
  addl   $0x10,(%rsp)
  mov    (%rsp),%eax
  cmp    0x8(%rsp),%eax
  jge    L78
L103:
  xor    %r15d,%r15d
  lea    D66(%rip),%r13
  nopl   0x0(%rax,%rax,1)
L144:
  movzbl (%rbx,%r15,1),%esi
  mov    %r13,%rdi
  xor    %eax,%eax
  add    $0x1,%r15
  call   <dprintf@plt>
  cmp    %r15d,%ebp
  jg     L144
  test   %r12d,%r12d
  jle    L51
L7:
  xor    %r13d,%r13d
  nopl   0x0(%rax)
L67:
  mov    %r14,%rdi
  xor    %eax,%eax
  add    $0x1,%r13d
  call   <dprintf@plt>
  cmp    %r13d,%r12d
  jg     L67
  xor    %eax,%eax
  lea    D58(%rip),%rdi
  call   <dprintf@plt>
  test   %ebp,%ebp
  jle    L139
L61:
  lea    -0x1(%rbp),%eax
  mov    %rbx,%r12
  lea    0x1(%rbx,%rax,1),%rbp
  jmp    L114
  nopw   0x0(%rax,%rax,1)
L26:
  lea    D68(%rip),%rdi
  xor    %eax,%eax
  add    $0x1,%r12
  call   <dprintf@plt>
  cmp    %r12,%rbp
  je     L139
L114:
  movzbl (%r12),%esi
  lea    -0x20(%rsi),%eax
  cmp    $0x5e,%al
  jbe    L26
  lea    D72(%rip),%rdi
  xor    %eax,%eax
  add    $0x1,%r12
  call   <dprintf@plt>
  cmp    %r12,%rbp
  jne    L114
L139:
  lea    D93(%rip),%rdi
  xor    %eax,%eax
  add    $0x10,%rbx
  call   <dprintf@plt>
  subl   $0x10,0x4(%rsp)
  mov    0xc(%rsp),%ecx
  cmp    %ecx,(%rsp)
  jne    L46
L107:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L78:
  mov    0x4(%rsp),%eax
  mov    $0x10,%r12d
  mov    %eax,%ebp
  sub    %eax,%r12d
  test   %eax,%eax
  jg     L103
  test   %r12d,%r12d
  jg     L7
  lea    D58(%rip),%rdi
  xor    %eax,%eax
  call   <dprintf@plt>
  jmp    L139
  nopl   0x0(%rax,%rax,1)
L51:
  lea    D58(%rip),%rdi
  xor    %eax,%eax
  call   <dprintf@plt>
  jmp    L61
```

tool_calls: name: read_data
arguments: data_tag: D51
type: string
name: read_data
arguments: data_tag: D59
type: string
name: read_data
arguments: data_tag: D55
type: string
name: read_data
arguments: data_tag: D66
type: string
name: read_data
arguments: data_tag: D58
type: string
name: read_data
arguments: data_tag: D68
type: string
name: read_data
arguments: data_tag: D72
type: string
name: read_data
arguments: data_tag: D93
type: string

tool: D51:  [Addr]   .0 .1 .2 .3 .4 .5 .6 .7 .8 .9 .A .B .C .D .E .F


tool: D59:    

tool: D55: %08X: 

tool: D66: %02x 

tool: D58:     

tool: D68: %c

tool: D72: .

tool: D93: 


assistant: ```c
void ddump(unsigned char *pData, int len) {
  unsigned char *sbuf = pData;
  int length = len;
  int i = 0, j, offset;
  dprintf(" [Addr]   .0 .1 .2 .3 .4 .5 .6 .7 .8 .9 .A .B .C .D .E .F\r\n");
  while (i < length) {
    dprintf("%08X: ", (int)(sbuf + i));
    if (i + 16 < length)
      offset = 16;
    else
      offset = length - i;
    for (j = 0; j < offset; j++)
      dprintf("%02x ", sbuf[i + j]);
    for (j = 0; j < 16 - offset; j++)
      dprintf("   ");
    dprintf("    ");
    for (j = 0; j < offset; j++) {
      if (' ' <= sbuf[i + j] && sbuf[i + j] <= '~')
        dprintf("%c", sbuf[i + j]);
      else
        dprintf(".");
    }
    dprintf("\n\r");
    i += 16;
  }
}
```