user: 请从给定的汇编指令推导出C源代码：

```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     L58
  lea    0x4f(%rsp),%eax
  mov    %rdx,%rsi
  xor    %r13d,%r13d
  xor    %r14d,%r14d
  mov    %eax,0x1c(%rsp)
  lea    D16(%rip),%r12
  jmp    L178
  nopl   0x0(%rax)
L37:
  lea    0x1(%r14),%rdi
  test   %r13d,%r13d
  jne    L164
  lea    (%r15,%r14,1),%rdx
  cmp    %rdi,0x10(%rsp)
  ja     L26
  movb   $0x0,(%rdx)
  mov    $0x1,%r13d
L164:
  mov    %rdi,%r14
  mov    %rsi,%rbx
L192:
  movzbl 0x1(%rbx),%ecx
  lea    0x1(%rbx),%rsi
  test   %cl,%cl
  je     L127
L178:
  cmp    $0x25,%cl
  jne    L37
L204:
  movsbl 0x1(%rsi),%edi
  lea    0x1(%rsi),%rbx
  cmp    $0x25,%dil
  je     L128
  lea    -0x63(%rdi),%eax
  cmp    $0x15,%al
  ja     L32
  movzbl %al,%eax
  movslq (%r12,%rax,4),%rax
  add    %r12,%rax
  notrack jmp *%rax
  nopw   0x0(%rax,%rax,1)
L26:
  mov    %cl,(%rdx)
  jmp    L164
  nopl   0x0(%rax)
L127:
  add    %r14,%r15
  mov    %r14d,%eax
L76:
  movb   $0x0,(%r15)
  mov    0x58(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L6
  add    $0x68,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L32:
  call   <print_int@plt>
  lea    D1(%rip),%rdi
  call   <print_str@plt>
  mov    0x20(%rsp),%rdi
  call   <print_str@plt>
  lea    D3(%rip),%rdi
  call   <print_str@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  nopl   0x0(%rax)
L182:
  mov    %rbp,%rdi
  call   <strlen@plt>
  lea    (%rax,%r14,1),%r11
  test   %r13d,%r13d
  jne    L100
  lea    (%r15,%r14,1),%rdi
  cmp    %r11,0x10(%rsp)
  ja     L132
  movb   $0x0,(%rdi)
  mov    $0x1,%r13d
L100:
  mov    %r11,%r14
  jmp    L192
  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    L182
  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    L182
  cs nopw 0x0(%rax,%rax,1)
  addq   $0x1,0x8(%rsp)
  mov    0x8(%rsp),%rax
  mov    (%rax),%rbp
  jmp    L182
  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    L182
  nopw   0x0(%rax,%rax,1)
L128:
  mov    $0x25,%eax
  lea    0x30(%rsp),%rbp
  mov    %ax,0x30(%rsp)
  jmp    L182
  nopl   0x0(%rax)
L132:
  mov    %rbp,%rsi
  mov    %r11,0x28(%rsp)
  call   <strcpy@plt>
  mov    0x28(%rsp),%r11
  jmp    L100
  nop
  mov    %rbx,%rsi
  jmp    L204
  nopl   0x0(%rax,%rax,1)
L58:
  xor    %eax,%eax
  jmp    L76
L6:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: tag: D1
data_type: string
name: unpack_data
arguments: tag: D3
data_type: string

tool: D1:  in 

tool: D3: : 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;
}
```