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

```asm
<print>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  movslq (%rsi),%rax
  movzbl (%rax),%edx
  test   %dl,%dl
  je     L83
  lea    0x4(%rsi),%rbp
  xor    %r12d,%r12d
  lea    0x16(%rsp),%r15
  lea    D18(%rip),%r13
  cs nopw 0x0(%rax,%rax,1)
L157:
  cmp    $0x25,%dl
  jne    L95
  movsbl 0x1(%rax),%esi
  test   %sil,%sil
  je     L120
  lea    0x1(%rax),%r14
  cmp    $0x25,%sil
  je     L36
  xor    %r9d,%r9d
  cmp    $0x2d,%sil
  jne    L76
  movzbl 0x2(%rax),%esi
  lea    0x2(%rax),%r14
  mov    $0x1,%r9d
  jmp    L76
  nopl   (%rax)
L154:
  movzbl 0x1(%r14),%esi
  add    $0x1,%r14
  or     $0x2,%r9d
L76:
  cmp    $0x30,%sil
  je     L154
  lea    -0x30(%rsi),%eax
  xor    %r8d,%r8d
  cmp    $0x9,%al
  ja     L239
  nopl   (%rax)
L12:
  sub    $0x30,%esi
  lea    (%r8,%r8,4),%eax
  add    $0x1,%r14
  movsbl %sil,%esi
  lea    (%rsi,%rax,2),%r8d
  movzbl (%r14),%esi
  lea    -0x30(%rsi),%eax
  cmp    $0x9,%al
  jbe    L12
L239:
  xor    %eax,%eax
  cmp    $0x6c,%sil
  sete   %al
  add    %rax,%r14
  movzbl (%r14),%eax
  cmp    $0x73,%al
  je     L118
  sub    $0x58,%eax
  cmp    $0x20,%al
  ja     L126
  movzbl %al,%eax
  movslq 0x0(%r13,%rax,4),%rax
  add    %r13,%rax
  notrack jmp *%rax
  nopw   0x0(%rax,%rax,1)
L95:
  movsbl (%rax),%esi
  mov    %rax,%r14
L36:
  mov    %rbx,%rdi
  add    $0x1,%r12d
  call   <printchar@plt>
L126:
  movzbl 0x1(%r14),%edx
  lea    0x1(%r14),%rax
  test   %dl,%dl
  jne    L157
L120:
  test   %rbx,%rbx
  je     L11
  mov    (%rbx),%rax
  movb   $0x0,(%rax)
L11:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L217
  add    $0x28,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L118:
  mov    0x0(%rbp),%rsi
  lea    0x4(%rbp),%rax
  mov    %r8d,%edx
  mov    %rbx,%rdi
  lea    D3(%rip),%rcx
  mov    %rax,0x8(%rsp)
  test   %rsi,%rsi
  cmove  %rcx,%rsi
  mov    %r9d,%ecx
  call   <prints@plt>
  movzbl 0x1(%r14),%edx
  mov    0x8(%rsp),%rbp
  add    %eax,%r12d
  lea    0x1(%r14),%rax
  test   %dl,%dl
  jne    L157
  jmp    L120
  nopl   0x0(%rax)
  lea    0x4(%rbp),%rax
  sub    $0x8,%rsp
  mov    %rax,0x10(%rsp)
  push   $0x61
L18:
  xor    %ecx,%ecx
  mov    $0x10,%edx
L56:
  mov    0x0(%rbp),%esi
  mov    %rbx,%rdi
  call   <printi@plt>
  add    %eax,%r12d
  pop    %rax
  lea    0x1(%r14),%rax
  pop    %rdx
  movzbl 0x1(%r14),%edx
  mov    0x8(%rsp),%rbp
  test   %dl,%dl
  jne    L157
  jmp    L120
  lea    0x4(%rbp),%rax
  sub    $0x8,%rsp
  xor    %ecx,%ecx
  mov    $0xa,%edx
  mov    %rax,0x10(%rsp)
  push   $0x61
  jmp    L56
  lea    0x4(%rbp),%rax
  sub    $0x8,%rsp
  mov    $0x1,%ecx
  mov    $0xa,%edx
  mov    %rax,0x10(%rsp)
  push   $0x61
  jmp    L56
  lea    0x4(%rbp),%rax
  mov    %r8d,%edx
  mov    %r9d,%ecx
  mov    %r15,%rsi
  mov    %rax,0x8(%rsp)
  mov    0x0(%rbp),%eax
  mov    %rbx,%rdi
  movb   $0x0,0x17(%rsp)
  mov    %al,0x16(%rsp)
  call   <prints@plt>
  movzbl 0x1(%r14),%edx
  mov    0x8(%rsp),%rbp
  add    %eax,%r12d
  lea    0x1(%r14),%rax
  test   %dl,%dl
  jne    L157
  jmp    L120
  nopl   0x0(%rax,%rax,1)
  lea    0x4(%rbp),%rax
  sub    $0x8,%rsp
  mov    %rax,0x10(%rsp)
  push   $0x41
  jmp    L18
L83:
  xor    %r12d,%r12d
  jmp    L120
L217:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: tag: D3
data_type: string

tool: D3: (null)

assistant: ```c
int print(char **out, int *varg) {
  register int width, pad;
  register int pc = 0;
  register char *format = (char *)(*varg++);
  char scr[2];
  for (; *format != 0; ++format) {
    if (*format == '%') {
      ++format;
      width = pad = 0;
      if (*format == '\0')
        break;
      if (*format == '%')
        goto out;
      if (*format == '-') {
        ++format;
        pad = 1;
      }
      while (*format == '0') {
        ++format;
        pad |= 2;
      }
      for (; *format >= '0' && *format <= '9'; ++format) {
        width *= 10;
        width += *format - '0';
      }
      if (*format == 'l')
        format++;
      if (*format == 's') {
        register char *s = *((char **)varg++);
        pc += prints(out, s ? s : "(null)", width, pad);
        continue;
      }
      if (*format == 'd') {
        pc += printi(out, *varg++, 10, 1, width, pad, 'a');
        continue;
      }
      if (*format == 'x') {
        pc += printi(out, *varg++, 16, 0, width, pad, 'a');
        continue;
      }
      if (*format == 'X') {
        pc += printi(out, *varg++, 16, 0, width, pad, 'A');
        continue;
      }
      if (*format == 'u') {
        pc += printi(out, *varg++, 10, 0, width, pad, 'a');
        continue;
      }
      if (*format == 'c') {
        scr[0] = *varg++;
        scr[1] = '\0';
        pc += prints(out, scr, width, pad);
        continue;
      }
    } else {
    out:
      printchar(out, *format);
      ++pc;
    }
  }
  if (out)
    **out = '\0';
  return pc;
}
```