user: Converte this assembly snippet into its equivalent C code:

```asm
<print>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0xa8,%rsp
  movslq (%rsi),%r11
  mov    %fs:0x28,%rax
  mov    %rax,0x98(%rsp)
  xor    %eax,%eax
  movzbl (%r11),%eax
  test   %al,%al
  je     L243
  lea    0x40(%rsp),%rdi
  lea    0x3e(%rsp),%rdx
  xor    %ebx,%ebx
  xor    %r12d,%r12d
  mov    %rdi,0x8(%rsp)
  lea    0x4(%rsi),%r13
  mov    %rdx,0x10(%rsp)
  nopw   0x0(%rax,%rax,1)
L210:
  cmp    $0x25,%al
  jne    L258
  movsbl 0x1(%r11),%esi
  test   %sil,%sil
  je     L248
  lea    0x1(%r11),%r14
  cmp    $0x25,%sil
  je     L206
  xor    %r9d,%r9d
  cmp    $0x2d,%sil
  jne    L166
  movsbl 0x2(%r11),%esi
  lea    0x2(%r11),%r14
  mov    $0x1,%r9d
  jmp    L166
  xchg   %ax,%ax
L38:
  movsbl 0x1(%r14),%esi
  add    $0x1,%r14
  or     $0x2,%r9d
L166:
  cmp    $0x30,%sil
  je     L38
  lea    -0x30(%rsi),%eax
  cmp    $0x9,%al
  jbe    L76
  cmp    $0x2e,%sil
  je     L76
  xor    %r8d,%r8d
  lea    0x1(%r14),%r11
L274:
  cmp    $0x6c,%sil
  jne    L97
  movzbl 0x1(%r14),%esi
  mov    %r11,%r14
  add    $0x1,%r11
L97:
  sub    $0x58,%esi
  cmp    $0x20,%sil
  ja     L273
  lea    D3(%rip),%rcx
  movzbl %sil,%esi
  movslq (%rcx,%rsi,4),%rax
  add    %rcx,%rax
  notrack jmp *%rax
  nopl   0x0(%rax,%rax,1)
L258:
  movsbl (%r11),%esi
  mov    %r11,%r14
L206:
  mov    %rbp,%rdi
  add    $0x1,%r12d
  call   <printchar@plt>
  lea    0x1(%r14),%r11
L184:
  movzbl 0x1(%r14),%eax
  test   %al,%al
  jne    L210
L248:
  test   %rbp,%rbp
  je     L188
  mov    0x0(%rbp),%rax
  movb   $0x0,(%rax)
L188:
  mov    0x98(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L171
  add    $0xa8,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L76:
  xor    %edx,%edx
  xor    %r8d,%r8d
  jmp    L153
  nop
L103:
  lea    -0x30(%rsi),%eax
  cmp    $0x9,%al
  ja     L274
  test   %edx,%edx
  je     L80
  lea    (%rbx,%rbx,4),%eax
  lea    -0x30(%rsi,%rax,2),%ebx
L190:
  movsbl (%r11),%esi
  mov    %r11,%r14
L153:
  lea    0x1(%r14),%r11
  cmp    $0x2e,%sil
  jne    L103
  xor    %ebx,%ebx
  mov    $0x1,%edx
  jmp    L190
L80:
  lea    (%r8,%r8,4),%ecx
  movsbl %al,%eax
  lea    (%rax,%rcx,2),%r8d
  jmp    L190
  nopl   (%rax)
L273:
  mov    $0x25,%esi
  mov    %rbp,%rdi
  mov    %r11,0x18(%rsp)
  call   <printchar@plt>
  movsbl (%r14),%esi
  mov    %rbp,%rdi
  call   <printchar@plt>
  mov    0x18(%rsp),%r11
  jmp    L184
  mov    %r11,0x18(%rsp)
  sub    $0x8,%rsp
  lea    0x4(%r13),%r15
  xor    %ecx,%ecx
  push   $0x61
  mov    $0x10,%edx
L289:
  mov    0x0(%r13),%esi
  mov    %rbp,%rdi
  mov    %r15,%r13
  call   <printi@plt>
  add    %eax,%r12d
  pop    %rax
  pop    %rdx
  mov    0x18(%rsp),%r11
  jmp    L184
  mov    %r11,0x18(%rsp)
  sub    $0x8,%rsp
  lea    0x4(%r13),%r15
  xor    %ecx,%ecx
  push   $0x61
L50:
  mov    $0xa,%edx
  jmp    L289
  mov    0x0(%r13),%rsi
  mov    %r11,0x18(%rsp)
  lea    0x4(%r13),%r15
  mov    %r9d,%ecx
  lea    D6(%rip),%rax
  mov    %r8d,%edx
  test   %rsi,%rsi
  cmove  %rax,%rsi
L66:
  mov    %rbp,%rdi
  mov    %r15,%r13
  call   <prints@plt>
  mov    0x18(%rsp),%r11
  add    %eax,%r12d
  jmp    L184
  movsd  0x0(%r13),%xmm0
  lea    0x8(%r13),%r15
  mov    0x8(%rsp),%r13
  mov    %ebx,%esi
  mov    %r11,0x28(%rsp)
  mov    %r13,%rdi
  mov    %r9d,0x24(%rsp)
  mov    %r8d,0x18(%rsp)
  call   <dbl2stri@plt>
  mov    0x24(%rsp),%ecx
  mov    0x18(%rsp),%edx
  mov    %r13,%rsi
  mov    %rbp,%rdi
  mov    %r15,%r13
  call   <prints@plt>
  mov    0x28(%rsp),%r11
  add    %eax,%r12d
  jmp    L184
  mov    %r11,0x18(%rsp)
  sub    $0x8,%rsp
  lea    0x4(%r13),%r15
  mov    $0x1,%ecx
  push   $0x61
  jmp    L50
  mov    0x0(%r13),%eax
  mov    %r11,0x18(%rsp)
  lea    0x4(%r13),%r15
  mov    %r9d,%ecx
  movb   $0x0,0x3f(%rsp)
  mov    0x10(%rsp),%rsi
  mov    %r8d,%edx
  mov    %al,0x3e(%rsp)
  jmp    L66
  mov    %r11,0x18(%rsp)
  sub    $0x8,%rsp
  lea    0x4(%r13),%r15
  xor    %ecx,%ecx
  push   $0x41
  mov    $0x10,%edx
  jmp    L289
L243:
  xor    %r12d,%r12d
  jmp    L248
L171:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: label: D6
type_guessed: string

tool: D6: (null)

assistant: ```c
int print(char **out, int *varg) {
  register int width, pad;
  register int pc = 0;
  register char *format = (char *)(*varg++);
  register int post_decimal;
  register unsigned dec_width = 0;
  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;
      }
      post_decimal = 0;
      if (*format == '.' || (*format >= '0' && *format <= '9')) {
        while (1) {
          if (*format == '.') {
            post_decimal = 1;
            dec_width = 0;
            format++;
          } else if ((*format >= '0' && *format <= '9')) {
            if (post_decimal) {
              dec_width *= 10;
              dec_width += *format - '0';
            } else {
              width *= 10;
              width += *format - '0';
            }
            format++;
          } else {
            break;
          }
        }
      }
      if (*format == 'l')
        ++format;
      switch (*format) {
      case 's': {
        char *s = *((char **)varg++);
        pc += prints(out, s ? s : "(null)", width, pad);
      } break;
      case 'd':
        pc += printi(out, *varg++, 10, 1, width, pad, 'a');
        break;
      case 'x':
        pc += printi(out, *varg++, 16, 0, width, pad, 'a');
        break;
      case 'X':
        pc += printi(out, *varg++, 16, 0, width, pad, 'A');
        break;
      case 'u':
        pc += printi(out, *varg++, 10, 0, width, pad, 'a');
        break;
      case 'c':
        scr[0] = *varg++;
        scr[1] = '\0';
        pc += prints(out, scr, width, pad);
        break;
      case 'f': {
        double *dblptr = (double *)varg;
        double dbl = *dblptr++;
        varg = (int *)dblptr;
        char bfr[81];
        dbl2stri(bfr, dbl, dec_width);
        pc += prints(out, bfr, width, pad);
      } break;
      default:
        printchar(out, '%');
        printchar(out, *format);
        break;
      }
    } else {
    out:
      printchar(out, *format);
      ++pc;
    }
  }
  if (out)
    **out = '\0';
  return pc;
}
```