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

```asm
<fmtint>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %rdx,%r13
  push   %r12
  mov    %r9d,%r12d
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  mov    0x70(%rsp),%r14d
  mov    0x78(%rsp),%r10d
  test   %r14d,%r14d
  cmovs  %eax,%r14d
  test   $0x40,%r10b
  jne    L75
  test   %rcx,%rcx
  js     L191
  test   $0x2,%r10b
  je     L128
  movl   $0x2b,0x8(%rsp)
  mov    $0x1,%r11d
  jmp    L5
  nopl   0x0(%rax,%rax,1)
L75:
  movl   $0x0,0x8(%rsp)
  xor    %r11d,%r11d
L5:
  test   $0x20,%r10b
  mov    %r8d,%r8d
  lea    0xf(%rsp),%r9
  mov    $0x1,%esi
  lea    D18(%rip),%rdi
  lea    D14(%rip),%rax
  cmove  %rax,%rdi
  xchg   %ax,%ax
L53:
  mov    %rcx,%rax
  xor    %edx,%edx
  mov    %esi,%r15d
  div    %r8
  movzbl (%rdi,%rdx,1),%edx
  mov    %dl,(%r9,%rsi,1)
  mov    %rcx,%rdx
  add    $0x1,%rsi
  mov    %rax,%rcx
  cmp    %r8,%rdx
  jb     L233
  cmp    $0x17,%r15d
  jbe    L53
L233:
  cmp    $0x18,%r15d
  mov    $0x17,%eax
  cmove  %eax,%r15d
  mov    %r15d,%eax
  mov    %r15d,%edx
  movb   $0x0,0x10(%rsp,%rax,1)
  mov    %r12d,%eax
  mov    %r10d,%r12d
  sub    %r11d,%eax
  cmp    %r15d,%r14d
  cmovae %r14d,%edx
  sub    %edx,%eax
  mov    $0x0,%edx
  sub    %r15d,%r14d
  mov    %edx,%esi
  mov    %edx,%edi
  cmovns %r14d,%esi
  test   %eax,%eax
  cmovns %eax,%edi
  and    $0x1,%r12d
  and    $0x10,%r10d
  mov    %esi,0x4(%rsp)
  mov    %edi,(%rsp)
  je     L51
  cmp    %edi,%esi
  movl   $0x0,(%rsp)
  cmovge %esi,%edi
  mov    %edi,0x4(%rsp)
  test   %r12d,%r12d
  je     L107
L164:
  xor    %r8d,%r8d
  xor    %r12d,%r12d
L142:
  mov    0x8(%rsp),%eax
  test   %eax,%eax
  jne    L171
L203:
  mov    0x4(%rsp),%r14d
  test   %r14d,%r14d
  jne    L150
L84:
  lea    0x10(%rsp),%r14
  sub    $0x1,%r15d
  add    %r14,%r15
  nopl   0x0(%rax)
L189:
  movsbl (%r15),%ecx
  mov    %r13,%rdx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <dopr_outch@plt>
  add    %eax,%r12d
  mov    %r15,%rax
  sub    $0x1,%r15
  cmp    %rax,%r14
  jne    L189
  mov    (%rsp),%eax
  test   %eax,%eax
  je     L92
  mov    %eax,%r14d
  nopl   0x0(%rax,%rax,1)
L182:
  mov    $0x20,%ecx
  mov    %r13,%rdx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <dopr_outch@plt>
  add    %eax,%r12d
  add    $0x1,%r14d
  jne    L182
L92:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L104
  add    $0x38,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L150:
  mov    $0x30,%ecx
  mov    %r13,%rdx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <dopr_outch@plt>
  add    %eax,%r12d
  sub    $0x1,%r14d
  jne    L150
  jmp    L84
  nopl   0x0(%rax)
L51:
  test   %r12d,%r12d
  jne    L61
  test   %eax,%eax
  jle    L107
  mov    (%rsp),%r14d
  nopl   0x0(%rax)
L119:
  mov    $0x20,%ecx
  mov    %r13,%rdx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <dopr_outch@plt>
  lea    (%r12,%rax,1),%r8d
  mov    %r8d,%r12d
  sub    $0x1,%r14d
  jne    L119
  mov    (%rsp),%edi
  mov    $0x1,%eax
  test   %edi,%edi
  cmovg  %edi,%eax
  sub    %eax,%edi
  mov    0x8(%rsp),%eax
  mov    %edi,(%rsp)
  test   %eax,%eax
  je     L203
L171:
  mov    0x8(%rsp),%ecx
  mov    %r13,%rdx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  mov    %r8d,0xc(%rsp)
  call   <dopr_outch@plt>
  mov    0xc(%rsp),%r8d
  lea    (%r8,%rax,1),%r12d
  jmp    L203
  nopl   0x0(%rax,%rax,1)
L107:
  xor    %r8d,%r8d
  jmp    L142
L61:
  negl   (%rsp)
  jmp    L164
  nopl   0x0(%rax,%rax,1)
L191:
  movl   $0x2d,0x8(%rsp)
  neg    %rcx
  mov    $0x1,%r11d
  jmp    L5
  cs nopw 0x0(%rax,%rax,1)
L128:
  lea    0x0(,%r10,8),%eax
  and    $0x20,%eax
  setne  %r11b
  mov    %eax,0x8(%rsp)
  movzbl %r11b,%r11d
  jmp    L5
L104:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: tag: D18
datatype: string
name: read_data
arguments: tag: D14
datatype: string

tool: D18: 0123456789ABCDEF

tool: D14: 0123456789abcdef

assistant: ```c
int fmtint(char *buffer, size_t *currlen, size_t maxlen, long value, int base, int min, int max, int flags) {
  int signvalue = 0;
  unsigned long uvalue;
  char convert[24];
  unsigned int place = 0;
  int spadlen = 0;
  int zpadlen = 0;
  const char *digits;
  int total = 0;
  if (max < 0)
    max = 0;
  uvalue = value;
  if (!(flags & (1 << 6))) {
    if (value < 0) {
      signvalue = '-';
      uvalue = -value;
    } else if (flags & (1 << 1))
      signvalue = '+';
    else if (flags & (1 << 2))
      signvalue = ' ';
  }
  if (flags & (1 << 5))
    digits = "0123456789ABCDEF";
  else
    digits = "0123456789abcdef";
  do {
    convert[place++] = digits[uvalue % (unsigned)base];
    uvalue = (uvalue / (unsigned)base);
  } while (uvalue && (place < sizeof(convert)));
  if (place == sizeof(convert))
    place--;
  convert[place] = 0;
  zpadlen = max - place;
  spadlen = min - (((unsigned int)max >= place) ? (unsigned int)max : place) - (signvalue ? 1 : 0);
  if (zpadlen < 0)
    zpadlen = 0;
  if (spadlen < 0)
    spadlen = 0;
  if (flags & (1 << 4)) {
    zpadlen = ((zpadlen >= spadlen) ? zpadlen : spadlen);
    spadlen = 0;
  }
  if (flags & (1 << 0))
    spadlen = -spadlen;
  while (spadlen > 0) {
    total += dopr_outch(buffer, currlen, maxlen, ' ');
    --spadlen;
  }
  if (signvalue)
    total += dopr_outch(buffer, currlen, maxlen, signvalue);
  if (zpadlen > 0) {
    while (zpadlen > 0) {
      total += dopr_outch(buffer, currlen, maxlen, '0');
      --zpadlen;
    }
  }
  while (place > 0)
    total += dopr_outch(buffer, currlen, maxlen, convert[--place]);
  while (spadlen < 0) {
    total += dopr_outch(buffer, currlen, maxlen, ' ');
    ++spadlen;
  }
  return total;
}
```