user: 下面的汇编指令对应的C源代码是什么:

```asm
<VSprintfPatch>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,%r13
  mov    %rdx,0x8(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  movzbl (%rsi),%edi
  test   %dil,%dil
  je     L536
  mov    %rsi,%rbx
  mov    %r13,%rbp
  lea    D1(%rip),%r15
  jmp    L220
L336:
  test   %r13,%r13
  je     L441
  mov    %dil,0x0(%rbp)
  lea    0x1(%rbp),%rbp
  mov    %rbx,%r12
L161:
  lea    0x1(%r12),%rbx
  movzbl 0x1(%r12),%edi
  test   %dil,%dil
  je     L195
L220:
  cmp    $0x25,%dil
  jne    L336
  lea    0x1(%rbx),%r12
  movzbl 0x1(%rbx),%edx
  cmp    $0x73,%dl
  je     L240
  mov    0x8(%rsp),%rax
  mov    (%rax),%rsi
  mov    $0x0,%r8d
  cmp    $0xf,%rsi
  jle    L89
  lea    -0x10(%rsi),%rax
  mov    $0x4,%r8d
  cmp    $0xef,%rax
  jbe    L89
  lea    -0x100(%rsi),%rax
  mov    $0x8,%r8d
  cmp    $0xeff,%rax
  jbe    L89
  lea    -0x1000(%rsi),%rax
  mov    $0xc,%r8d
  cmp    $0xefff,%rax
  jbe    L89
  lea    -0x10000(%rsi),%rax
  mov    $0x10,%r8d
  cmp    $0xeffff,%rax
  jbe    L89
  lea    -0x100000(%rsi),%rax
  mov    $0x14,%r8d
  cmp    $0xefffff,%rax
  jbe    L89
  lea    -0x1000000(%rsi),%rax
  cmp    $0xf000000,%rax
  sbb    %r8d,%r8d
  and    $0xfffffffc,%r8d
  add    $0x1c,%r8d
L89:
  mov    %edx,%eax
  sub    $0x30,%edx
  cmp    $0x9,%dl
  jbe    L330
L38:
  movzbl (%r12),%edx
  mov    %edx,%eax
  and    $0xfffffff7,%eax
  cmp    $0x70,%al
  je     L3
  cmp    $0x50,%al
  je     L3
  cmp    $0x64,%dl
  je     L254
  cmp    $0x63,%dl
  je     L462
L145:
  mov    %dl,0x10(%rsp)
  lea    0x11(%rsp),%r14
  jmp    L280
L441:
  movsbl %dil,%edi
  call   <HalSerialPutcRtl8195a@plt>
  mov    %rbx,%r12
  jmp    L161
L240:
  mov    0x8(%rsp),%rax
  lea    0x4(%rax),%rbx
  movslq (%rax),%r14
  movzbl (%r14),%edi
  test   %dil,%dil
  jne    L290
  mov    %rbx,0x8(%rsp)
  jmp    L161
L27:
  movsbl %dil,%edi
  call   <HalSerialPutcRtl8195a@plt>
L507:
  add    $0x1,%r14
  movzbl (%r14),%edi
  test   %dil,%dil
  je     L134
L290:
  test   %r13,%r13
  je     L27
  mov    %dil,0x0(%rbp)
  lea    0x1(%rbp),%rbp
  jmp    L507
L134:
  mov    %rbx,0x8(%rsp)
  jmp    L161
L330:
  mov    $0x0,%edx
L345:
  lea    (%rdx,%rdx,4),%edx
  movzbl %al,%eax
  lea    (%rax,%rdx,2),%ecx
  lea    -0x30(%rcx),%edx
  add    $0x1,%r12
  movzbl (%r12),%eax
  lea    -0x30(%rax),%edi
  cmp    $0x9,%dil
  jbe    L345
  lea    -0xc4(,%rcx,4),%r8d
  jmp    L38
L3:
  addq   $0x8,0x8(%rsp)
  mov    %rsi,%rax
  mov    %edx,%edi
  and    $0x20,%edi
  and    $0xffffffdf,%edx
  lea    0x10(%rsp),%r14
  cmp    $0x50,%dl
  jne    L363
  movb   $0x30,0x10(%rsp)
  mov    %edi,%edx
  or     $0x58,%edx
  mov    %dl,0x11(%rsp)
  lea    0x12(%rsp),%r14
L363:
  mov    $0x0,%edx
  test   %rsi,%rsi
  je     L244
L350:
  mov    %rax,%rcx
  and    $0xf,%ecx
  cmp    $0x1,%rcx
  sbb    $0xffffffff,%edx
  shr    $0x4,%rax
  jne    L350
L244:
  lea    -0x4(,%rdx,4),%ecx
  cmp    %r8d,%ecx
  cmovl  %r8d,%ecx
  test   %ecx,%ecx
  js     L296
  mov    %r14,%rdx
  mov    %ecx,%r9d
  mov    %ecx,%r8d
  or     $0xfffffffc,%r8d
L503:
  mov    %rsi,%rax
  sar    %cl,%rax
  and    $0xf,%eax
  mov    %edi,%ebx
  or     (%r15,%rax,1),%bl
  mov    %bl,(%rdx)
  sub    $0x4,%ecx
  add    $0x1,%rdx
  cmp    %r8d,%ecx
  jne    L503
  shr    $0x2,%r9d
  lea    0x1(%r9),%eax
  mov    %eax,%eax
  add    %rax,%r14
L296:
  lea    0x10(%rsp),%rax
  cmp    %rax,%r14
  jbe    L161
L280:
  lea    0x10(%rsp),%rbx
  jmp    L259
L254:
  mov    0x8(%rsp),%rax
  lea    0x4(%rax),%rdi
  mov    (%rax),%ecx
  mov    $0x0,%r9d
  lea    0x10(%rsp),%rsi
  test   %ecx,%ecx
  js     L401
L144:
  mov    %rsi,%r14
L423:
  add    $0x1,%r14
  movslq %ecx,%rax
  imul   $0x66666667,%rax,%rax
  sar    $0x22,%rax
  mov    %ecx,%edx
  sar    $0x1f,%edx
  sub    %edx,%eax
  lea    (%rax,%rax,4),%edx
  add    %edx,%edx
  sub    %edx,%ecx
  add    $0x30,%ecx
  mov    %cl,-0x1(%r14)
  mov    %eax,%ecx
  lea    (%r9,%r14,1),%edx
  sub    %esi,%edx
  test   %eax,%eax
  jne    L423
  test   %r8d,%r8d
  js     L356
  shr    $0x2,%r8d
  mov    %edx,%ecx
  sub    %r8d,%ecx
  jmp    L335
L401:
  movb   $0x2d,0x10(%rsp)
  neg    %ecx
  mov    $0x1,%r9d
  lea    0x11(%rsp),%rsi
  jmp    L144
L528:
  lea    -0x1(%rdx),%eax
  cmp    %ecx,%edx
  je     L356
  mov    %eax,%edx
L335:
  test   %edx,%edx
  jg     L528
  movb   $0x30,(%r14)
  lea    0x1(%r14),%r14
  jmp    L528
L356:
  lea    -0x1(%r14),%rax
  cmp    %rax,%rsi
  jae    L126
L118:
  movzbl (%rax),%edx
  movzbl (%rsi),%ecx
  mov    %cl,(%rax)
  add    $0x1,%rsi
  mov    %dl,-0x1(%rsi)
  sub    $0x1,%rax
  cmp    %rsi,%rax
  ja     L118
  mov    %rdi,0x8(%rsp)
  jmp    L296
L462:
  mov    0x8(%rsp),%rax
  movzbl (%rax),%edx
  lea    0x4(%rax),%rax
  mov    %rax,0x8(%rsp)
  jmp    L145
L126:
  mov    %rdi,0x8(%rsp)
  jmp    L296
L374:
  movsbl (%rbx),%edi
  call   <HalSerialPutcRtl8195a@plt>
  jmp    L420
L160:
  add    $0x1,%rbx
  cmp    %rbx,%r14
  jbe    L161
L259:
  test   %r13,%r13
  je     L374
  movzbl (%rbx),%eax
  mov    %al,0x0(%rbp)
  lea    0x1(%rbp),%rbp
L420:
  cmpb   $0xa,(%rbx)
  jne    L160
  mov    $0xd,%edi
  call   <HalSerialPutcRtl8195a@plt>
  jmp    L160
L536:
  mov    %r13,%rbp
L195:
  test   %r13,%r13
  je     L278
  movb   $0x0,0x0(%rbp)
L278:
  mov    %ebp,%eax
  sub    %r13d,%eax
  mov    0x28(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L312
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L312:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: tag: D1
type_guessed: string

tool: D1: 0123456789ABCDEF

assistant: ```c
int VSprintfPatch(char *buf, const char *fmt, const int *dp) {
  char *p, *s;
  s = buf;
  for (; *fmt != '\0'; ++fmt) {
    if (*fmt != '%') {
      if (buf) {
        *s++ = *fmt;
      } else {
        HalSerialPutcRtl8195a(*fmt);
      }
      continue;
    }
    if (*++fmt == 's') {
      for (p = (char *)*dp++; *p != '\0'; p++) {
        if (buf) {
          *s++ = *p;
        } else {
          HalSerialPutcRtl8195a(*p);
        }
      }
    } else {
      char tmp[20], *q = tmp;
      int alt = 0;
      int shift = 0;
      const long *lpforchk = (const long *)dp;
      if ((*lpforchk) < 0x10) {
        shift = 0;
      } else if (((*lpforchk) >= 0x10) && ((*lpforchk) < 0x100)) {
        shift = 4;
      } else if (((*lpforchk) >= 0x100) && ((*lpforchk) < 0x1000)) {
        shift = 8;
      } else if (((*lpforchk) >= 0x1000) && ((*lpforchk) < 0x10000)) {
        shift = 12;
      } else if (((*lpforchk) >= 0x10000) && ((*lpforchk) < 0x100000)) {
        shift = 16;
      } else if (((*lpforchk) >= 0x100000) && ((*lpforchk) < 0x1000000)) {
        shift = 20;
      } else if (((*lpforchk) >= 0x1000000) && ((*lpforchk) < 0x10000000)) {
        shift = 24;
      } else if ((*lpforchk) >= 0x10000000) {
        shift = 28;
      } else {
        shift = 28;
      }
      if ((*fmt >= '0') && (*fmt <= '9')) {
        int width;
        unsigned char fch = *fmt;
        for (width = 0; (fch >= '0') && (fch <= '9'); fch = *++fmt) {
          width = width * 10 + fch - '0';
        }
        shift = (width - 1) * 4;
      }
      if ((*fmt == 'x') || (*fmt == 'X') || (*fmt == 'p') || (*fmt == 'P')) {
        const long *lp = (const long *)dp;
        long h = *lp++;
        int hex_count = 0;
        unsigned long h_back = h;
        int ncase = (*fmt & 0x20);
        dp = (const int *)lp;
        if ((*fmt == 'p') || (*fmt == 'P'))
          alt = 1;
        if (alt) {
          *q++ = '0';
          *q++ = 'X' | ncase;
        }
        while (h_back) {
          hex_count += (h_back & 0xF) ? 1 : 0;
          h_back = h_back >> 4;
        }
        if (shift < (hex_count - 1) * 4)
          shift = (hex_count - 1) * 4;
        for (; shift >= 0; shift -= 4) {
          *q++ = "0123456789ABCDEF"[(h >> shift) & 0xF] | ncase;
        }
      } else if (*fmt == 'd') {
        int i = *dp++;
        char *r;
        int digit_space = 0;
        if (i < 0) {
          *q++ = '-';
          i = -i;
          digit_space++;
        }
        p = q;
        do {
          *q++ = '0' + (i % 10);
          i /= 10;
          digit_space++;
        } while (i);
        for (; shift >= 0; shift -= 4) {
          if (digit_space-- > 0) {
            ;
          } else {
            *q++ = '0';
          }
        }
        r = q;
        while (--r > p) {
          i = *r;
          *r = *p;
          *p++ = i;
        }
      } else if (*fmt == 'c')
        *q++ = *dp++;
      else
        *q++ = *fmt;
      for (p = tmp; p < q; ++p) {
        if (buf) {
          *s++ = *p;
        } else {
          HalSerialPutcRtl8195a(*p);
        }
        if ((*p) == '\n') {
          HalSerialPutcRtl8195a('\r');
        }
      }
    }
  }
  if (buf)
    *s = '\0';
  return (s - buf);
}
```