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

```asm
<string_printable>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x430,%rsp
  mov    %rdi,-0x428(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    $0x400,%edx
  mov    $0x0,%esi
  lea    D28(%rip),%rax
  mov    %rax,%rdi
  call   <memset@plt>
  lea    D28(%rip),%rax
  mov    %rax,-0x418(%rbp)
  jmp    L134
L37:
  mov    -0x428(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x1f,%al
  jle    L158
  mov    -0x428(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x7f,%al
  je     L158
  mov    -0x418(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x418(%rbp)
  mov    -0x428(%rbp),%rdx
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
  jmp    L110
L158:
  mov    -0x428(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x5c,%al
  jne    L141
  mov    -0x418(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x418(%rbp)
  movb   $0x5c,(%rax)
  mov    -0x418(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x418(%rbp)
  movb   $0x5c,(%rax)
  jmp    L110
L141:
  mov    -0x428(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x7,%al
  jne    L38
  mov    -0x418(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x418(%rbp)
  movb   $0x5c,(%rax)
  mov    -0x418(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x418(%rbp)
  movb   $0x61,(%rax)
  jmp    L110
L38:
  mov    -0x428(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x8,%al
  jne    L132
  mov    -0x418(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x418(%rbp)
  movb   $0x5c,(%rax)
  mov    -0x418(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x418(%rbp)
  movb   $0x62,(%rax)
  jmp    L110
L132:
  mov    -0x428(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xa,%al
  jne    L81
  mov    -0x418(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x418(%rbp)
  movb   $0x5c,(%rax)
  mov    -0x418(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x418(%rbp)
  movb   $0x6e,(%rax)
  jmp    L110
L81:
  mov    -0x428(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xd,%al
  jne    L135
  mov    -0x418(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x418(%rbp)
  movb   $0x5c,(%rax)
  mov    -0x418(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x418(%rbp)
  movb   $0x72,(%rax)
  jmp    L110
L135:
  mov    -0x428(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%edx
  lea    -0x410(%rbp),%rax
  mov    %edx,%ecx
  lea    D23(%rip),%rdx
  mov    $0x400,%esi
  mov    %rax,%rdi
  call   <snprintf@plt>
  lea    -0x410(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  lea    -0x410(%rbp),%rcx
  mov    -0x418(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncat@plt>
  lea    -0x410(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cltq
  add    %rax,-0x418(%rbp)
L110:
  addq   $0x1,-0x428(%rbp)
L134:
  mov    -0x428(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L37
  lea    D28(%rip),%rax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L139
  call   <__stack_chk_fail@plt>
L139:
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: data_tag: D23
datatype: string

tool: D23: \%03o

assistant: ```c
char *string_printable(char *in) {
  static char out[1024];
  char octal[1024];
  char *ret;
  memset(out, '\0', 1024);
  ret = out;
  while (*in) {
    if (*in >= 32 && *in != 127) {
      *ret++ = *in;
    } else if (*in == '\\') {
      *ret++ = '\\';
      *ret++ = '\\';
    } else if (*in == '\a') {
      *ret++ = '\\';
      *ret++ = 'a';
    } else if (*in == '\b') {
      *ret++ = '\\';
      *ret++ = 'b';
    } else if (*in == '\n') {
      *ret++ = '\\';
      *ret++ = 'n';
    } else if (*in == '\r') {
      *ret++ = '\\';
      *ret++ = 'r';
    } else {
      snprintf(octal, 1024, "\\%03o", (unsigned char)*in);
      strncat(ret, octal, strlen(octal));
      ret += strlen(octal);
    }
    in++;
  }
  return out;
}
```