user: What is the c source code of the assembly code below?

```asm
<vsnprintf>:
  endbr64
  push   %r15
  mov    %rdi,%r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x68,%rsp
  mov    %rcx,0x8(%rsp)
  movzbl (%rdx),%ecx
  mov    %rsi,0x10(%rsp)
  mov    %rdx,0x20(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x58(%rsp)
  xor    %eax,%eax
  test   %cl,%cl
  je     L163
  lea    0x4f(%rsp),%eax
  mov    %rdx,%rsi
  xor    %r13d,%r13d
  xor    %r14d,%r14d
  mov    %eax,0x1c(%rsp)
  lea    D6(%rip),%r12
  jmp    L105
  nopl   0x0(%rax)
L121:
  lea    0x1(%r14),%rdi
  test   %r13d,%r13d
  jne    L7
  lea    (%r15,%r14,1),%rdx
  cmp    %rdi,0x10(%rsp)
  ja     L135
  movb   $0x0,(%rdx)
  mov    $0x1,%r13d
L7:
  mov    %rdi,%r14
  mov    %rsi,%rbx
L197:
  movzbl 0x1(%rbx),%ecx
  lea    0x1(%rbx),%rsi
  test   %cl,%cl
  je     L130
L105:
  cmp    $0x25,%cl
  jne    L121
L3:
  movsbl 0x1(%rsi),%edi
  lea    0x1(%rsi),%rbx
  cmp    $0x25,%dil
  je     L16
  lea    -0x63(%rdi),%eax
  cmp    $0x15,%al
  ja     L164
  movzbl %al,%eax
  movslq (%r12,%rax,4),%rax
  add    %r12,%rax
  notrack jmp *%rax
  nopw   0x0(%rax,%rax,1)
L135:
  mov    %cl,(%rdx)
  jmp    L7
  nopl   0x0(%rax)
L130:
  add    %r14,%r15
  mov    %r14d,%eax
L168:
  movb   $0x0,(%r15)
  mov    0x58(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L142
  add    $0x68,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L164:
  call   <print_int@plt>
  lea    D25(%rip),%rdi
  call   <print_str@plt>
  mov    0x20(%rsp),%rdi
  call   <print_str@plt>
  lea    D11(%rip),%rdi
  call   <print_str@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  nopl   0x0(%rax)
L116:
  mov    %rbp,%rdi
  call   <strlen@plt>
  lea    (%rax,%r14,1),%r11
  test   %r13d,%r13d
  jne    L80
  lea    (%r15,%r14,1),%rdi
  cmp    %r11,0x10(%rsp)
  ja     L58
  movb   $0x0,(%rdi)
  mov    $0x1,%r13d
L80:
  mov    %r11,%r14
  jmp    L197
  nopl   0x0(%rax)
  addq   $0x1,0x8(%rsp)
  mov    0x8(%rsp),%rax
  mov    0x1c(%rsp),%esi
  mov    (%rax),%rdi
  call   <stringify_int@plt>
  mov    %rax,%rbp
  jmp    L116
  nopl   0x0(%rax)
  addq   $0x1,0x8(%rsp)
  mov    0x8(%rsp),%rax
  lea    0x30(%rsp),%rbp
  movb   $0x0,0x31(%rsp)
  movzbl (%rax),%eax
  mov    %al,0x30(%rsp)
  jmp    L116
  cs nopw 0x0(%rax,%rax,1)
  addq   $0x1,0x8(%rsp)
  mov    0x8(%rsp),%rax
  mov    (%rax),%rbp
  jmp    L116
  nopl   0x0(%rax,%rax,1)
  addq   $0x1,0x8(%rsp)
  mov    0x8(%rsp),%rax
  mov    0x1c(%rsp),%esi
  mov    (%rax),%rdi
  call   <stringify_hex@plt>
  mov    %rax,%rbp
  jmp    L116
  nopw   0x0(%rax,%rax,1)
L16:
  mov    $0x25,%eax
  lea    0x30(%rsp),%rbp
  mov    %ax,0x30(%rsp)
  jmp    L116
  nopl   0x0(%rax)
L58:
  mov    %rbp,%rsi
  mov    %r11,0x28(%rsp)
  call   <strcpy@plt>
  mov    0x28(%rsp),%r11
  jmp    L80
  nop
  mov    %rbx,%rsi
  jmp    L3
  nopl   0x0(%rax,%rax,1)
L163:
  xor    %eax,%eax
  jmp    L168
L142:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: label: D25
type_infered: string
name: retrieve_data
arguments: label: D11
type_infered: string

tool: D25:  in 

tool: D11: : unknown format!


assistant: ```c
int vsnprintf(char *buf, size_t size, const char *fmt, va_list ap) {
  const char *inp;
  size_t off = 0;
  int is_overlow = 0;
  for (inp = fmt; *inp; inp++) {
    if (*inp != '%') {
      if (!is_overlow) {
        if (off + 1 >= size) {
          is_overlow = 1;
          buf[off] = 0;
        } else {
          buf[off] = *inp;
        }
      }
      off++;
      continue;
    }
    char cur_buf[32];
    char *cur_p;
  retry:
    switch (*++inp) {
    case 'l':
      goto retry;
    case 'd':
    case 'u':
      cur_p = stringify_int(*(long *)++ap, cur_buf + sizeof(cur_buf) - 1);
      break;
    case 'x':
      cur_p = stringify_hex(*(long *)++ap, cur_buf + sizeof(cur_buf) - 1);
      break;
    case 's':
      cur_p = *(char **)++ap;
      break;
    case 'c':
      cur_buf[0] = *(char *)++ap;
      cur_buf[1] = 0;
      cur_p = cur_buf;
      break;
    case '%':
      cur_buf[0] = '%';
      cur_buf[1] = 0;
      cur_p = cur_buf;
      break;
    default:
      print_int(*inp);
      print_str(" in ");
      print_str(fmt);
      print_str(": unknown format!\n");
      exit(1);
    }
    size_t len = strlen(cur_p);
    if (!is_overlow) {
      if (off + len >= size) {
        is_overlow = 1;
        buf[off] = 0;
      } else {
        strcpy(buf + off, cur_p);
      }
    }
    off += len;
  }
  buf[off] = 0;
  return off;
}
```