user: What would the C source look like for the assembly code provided here:

```asm
<fmtint>:
  endbr64
  push   %r15
  mov    %rdi,%r15
  push   %r14
  push   %r13
  mov    %rdx,%r13
  push   %r12
  push   %rbp
  mov    %rsi,%rbp
  mov    %rcx,%rsi
  push   %rbx
  mov    %r9d,%ebx
  sub    $0x48,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  mov    0x80(%rsp),%r14d
  mov    0x88(%rsp),%edi
  test   %r14d,%r14d
  cmovs  %eax,%r14d
  test   $0x40,%dil
  jne    L224
  test   %rcx,%rcx
  js     L71
  test   $0x2,%dil
  je     L69
  movl   $0x2b,0x18(%rsp)
  mov    $0x1,%r11d
  jmp    L120
L224:
  movl   $0x0,0x18(%rsp)
  xor    %r11d,%r11d
L120:
  lea    0x1f(%rsp),%r12
  test   $0x20,%dil
  mov    %r8d,%r8d
  mov    $0x1,%ecx
  lea    D3(%rip),%r9
  lea    D11(%rip),%rax
  mov    %r12,0x8(%rsp)
  cmove  %rax,%r9
  nopl   0x0(%rax,%rax,1)
L239:
  mov    %rsi,%rax
  xor    %edx,%edx
  mov    %ecx,%r10d
  div    %r8
  movzbl (%r9,%rdx,1),%edx
  mov    %dl,(%r12,%rcx,1)
  mov    %rsi,%rdx
  mov    %rax,%rsi
  cmp    %r8,%rdx
  setae  %dl
  cmp    $0x17,%ecx
  setbe  %al
  add    $0x1,%rcx
  test   %al,%dl
  jne    L239
  cmp    $0x18,%r10d
  mov    $0x17,%eax
  mov    $0x0,%esi
  mov    %edi,%r12d
  cmove  %eax,%r10d
  movslq %r10d,%rax
  cmp    %r10d,%r14d
  mov    %rax,0x10(%rsp)
  movb   $0x0,0x20(%rsp,%rax,1)
  mov    %r10d,%eax
  cmovge %r14d,%eax
  sub    %eax,%ebx
  mov    %ebx,%eax
  sub    %r11d,%eax
  sub    %r10d,%r14d
  cmovns %r14d,%esi
  xor    %ebx,%ebx
  test   %eax,%eax
  cmovns %eax,%ebx
  and    $0x1,%r12d
  and    $0x10,%edi
  mov    %esi,0x4(%rsp)
  je     L90
  cmp    %ebx,%esi
  cmovge %esi,%ebx
  mov    %ebx,0x4(%rsp)
  xor    %ebx,%ebx
  test   %r12d,%r12d
  je     L237
L22:
  xor    %r8d,%r8d
  xor    %r12d,%r12d
L208:
  mov    0x18(%rsp),%eax
  test   %eax,%eax
  jne    L161
L203:
  mov    0x4(%rsp),%r14d
  test   %r14d,%r14d
  jne    L167
L83:
  mov    0x10(%rsp),%r14
  mov    %ebx,0x4(%rsp)
  mov    %r14,%rbx
  mov    0x8(%rsp),%r14
  nopl   (%rax)
L85:
  movsbl (%r14,%rbx,1),%ecx
  mov    %r13,%rdx
  mov    %rbp,%rsi
  mov    %r15,%rdi
  sub    $0x1,%rbx
  call   <dopr_outch@plt>
  add    %eax,%r12d
  test   %ebx,%ebx
  jne    L85
  mov    0x4(%rsp),%ebx
  test   %ebx,%ebx
  je     L159
  cs nopw 0x0(%rax,%rax,1)
L189:
  mov    $0x20,%ecx
  mov    %r13,%rdx
  mov    %rbp,%rsi
  mov    %r15,%rdi
  call   <dopr_outch@plt>
  add    %eax,%r12d
  add    $0x1,%ebx
  jne    L189
L159:
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L199
  add    $0x48,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L167:
  mov    $0x30,%ecx
  mov    %r13,%rdx
  mov    %rbp,%rsi
  mov    %r15,%rdi
  call   <dopr_outch@plt>
  add    %eax,%r12d
  sub    $0x1,%r14d
  jne    L167
  jmp    L83
  nopl   0x0(%rax)
L90:
  test   %r12d,%r12d
  jne    L169
  test   %eax,%eax
  jle    L237
  mov    %ebx,%r14d
  nopl   0x0(%rax)
L168:
  mov    $0x20,%ecx
  mov    %r13,%rdx
  mov    %rbp,%rsi
  mov    %r15,%rdi
  call   <dopr_outch@plt>
  lea    (%r12,%rax,1),%r8d
  mov    %r8d,%r12d
  sub    $0x1,%r14d
  jne    L168
  test   %ebx,%ebx
  mov    $0x1,%eax
  cmovg  %ebx,%eax
  sub    %eax,%ebx
  mov    0x18(%rsp),%eax
  test   %eax,%eax
  je     L203
L161:
  mov    0x18(%rsp),%ecx
  mov    %r13,%rdx
  mov    %rbp,%rsi
  mov    %r15,%rdi
  mov    %r8d,0x1c(%rsp)
  call   <dopr_outch@plt>
  mov    0x1c(%rsp),%r8d
  lea    (%r8,%rax,1),%r12d
  jmp    L203
  nopl   (%rax)
L237:
  xor    %r8d,%r8d
  jmp    L208
  nopl   0x0(%rax,%rax,1)
L169:
  neg    %ebx
  jmp    L22
  nopw   0x0(%rax,%rax,1)
L71:
  movl   $0x2d,0x18(%rsp)
  neg    %rsi
  mov    $0x1,%r11d
  jmp    L120
  cs nopw 0x0(%rax,%rax,1)
L69:
  lea    0x0(,%rdi,8),%eax
  and    $0x20,%eax
  setne  %r11b
  mov    %eax,0x18(%rsp)
  movzbl %r11b,%r11d
  jmp    L120
L199:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_label: D3
type_guessed: string
name: parse_data
arguments: data_label: D11
type_guessed: string

tool: D3: 0123456789ABCDEF

tool: D11: 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];
  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 - ((max >= place) ? 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;
}
```