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

```asm
<printText>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,(%rsp)
  mov    %esi,%ebx
  mov    %rdx,0x8(%rsp)
  mov    %ecx,%r15d
  mov    $0x10,%r13d
  sub    %ecx,%r13d
  test   %r13d,%r13d
  jle    L63
  mov    %rdi,%rbp
  mov    $0x0,%r12d
  lea    D10(%rip),%r14
L58:
  mov    %r14,%rdx
  mov    %ebx,%esi
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
  lea    -0x1(%rbx),%edx
  cmp    %ebx,%eax
  cmovge %edx,%eax
  movslq %eax,%rdx
  add    %rdx,%rbp
  sub    %eax,%ebx
  add    $0x1,%r12d
  cmp    %r13d,%r12d
  jne    L58
L27:
  lea    D9(%rip),%rdx
  mov    %ebx,%esi
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
  lea    -0x1(%rbx),%edx
  cmp    %ebx,%eax
  cmovge %edx,%eax
  movslq %eax,%r12
  add    %rbp,%r12
  sub    %eax,%ebx
  test   %r15d,%r15d
  jle    L9
  mov    0x8(%rsp),%rsi
  mov    %rsi,%rbp
  lea    -0x1(%r15),%eax
  lea    0x1(%rsi,%rax,1),%r13
  lea    D14(%rip),%r15
  lea    D12(%rip),%r14
  jmp    L0
L63:
  mov    (%rsp),%rbp
  jmp    L27
L70:
  mov    %r15,%rdx
  mov    %ebx,%esi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
L42:
  lea    -0x1(%rbx),%edx
  cmp    %ebx,%eax
  cmovge %edx,%eax
  movslq %eax,%rdx
  add    %rdx,%r12
  sub    %eax,%ebx
  add    $0x1,%rbp
  cmp    %r13,%rbp
  je     L9
L0:
  movzbl 0x0(%rbp),%ecx
  lea    -0x20(%rcx),%eax
  cmp    $0x5e,%al
  ja     L70
  movzbl %cl,%ecx
  mov    %r14,%rdx
  mov    %ebx,%esi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
  jmp    L42
L9:
  lea    D0(%rip),%rdx
  mov    %ebx,%esi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
  lea    -0x1(%rbx),%edx
  cmp    %ebx,%eax
  cmovge %edx,%eax
  lea    (%rax,%r12,1),%eax
  sub    (%rsp),%eax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: retrieve_data
arguments: data_tag: D10
type_infered: string
name: retrieve_data
arguments: data_tag: D9
type_infered: string
name: retrieve_data
arguments: data_tag: D14
type_infered: string
name: retrieve_data
arguments: data_tag: D12
type_infered: string
name: retrieve_data
arguments: data_tag: D0
type_infered: string

tool: D10:    

tool: D9:    |

tool: D14: .

tool: D12: %c

tool: D0: |


assistant: ```c
int printText(char *outBuf, int outLen, unsigned char *message, int length) {
  char *startOutBuf = outBuf;
  int len;
  int i;
  for (i = 0; i < 16 - length; ++i) {
    len = snprintf(outBuf, outLen, "   ");
    if (len > outLen - 1)
      len = outLen - 1;
    outBuf += len;
    outLen -= len;
  }
  len = snprintf(outBuf, outLen, "   |");
  if (len > outLen - 1)
    len = outLen - 1;
  outBuf += len;
  outLen -= len;
  for (i = 0; i < length; ++i) {
    unsigned char ch = message[i];
    if (ch >= 32 && ch <= 126) {
      len = snprintf(outBuf, outLen, "%c", ch);
    } else {
      len = snprintf(outBuf, outLen, ".");
    }
    if (len > outLen - 1)
      len = outLen - 1;
    outBuf += len;
    outLen -= len;
  }
  len = snprintf(outBuf, outLen, "|\n");
  if (len > outLen - 1)
    len = outLen - 1;
  outBuf += len;
  outLen -= len;
  return outBuf - startOutBuf;
}
```