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

```asm
<fmtnum>:
  endbr64
  push   %r15
  mov    %rdi,%r10
  mov    %r9d,%r15d
  mov    %esi,%edi
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %ecx,%ebx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  test   %edx,%edx
  je     L80
  test   %r10,%r10
  js     L103
L80:
  movl   $0x0,0xc(%rsp)
L192:
  xor    %eax,%eax
  test   %edi,%edi
  jns    L232
  neg    %edi
  mov    $0x1,%eax
L232:
  test   %eax,%eax
  movslq %edi,%rdi
  lea    0xf(%rsp),%rbp
  mov    $0x1,%ecx
  lea    D14(%rip),%r9
  lea    D8(%rip),%rax
  cmove  %rax,%r9
  nop
L118:
  mov    %r10,%rax
  xor    %edx,%edx
  mov    %ecx,%r14d
  div    %rdi
  movslq %ecx,%r13
  movzbl (%r9,%rdx,1),%edx
  mov    %dl,0x0(%rbp,%rcx,1)
  mov    %r10,%rdx
  add    $0x1,%rcx
  mov    %rax,%r10
  cmp    %rdi,%rdx
  jae    L118
  movslq %r14d,%rax
  sub    %r14d,%r8d
  mov    $0x0,%r12d
  movb   $0x0,0x10(%rsp,%rax,1)
  cmovns %r8d,%r12d
  test   %ebx,%ebx
  je     L99
  mov    %r12d,%ebx
  neg    %ebx
L26:
  mov    0xc(%rsp),%eax
  test   %eax,%eax
  je     L193
  mov    $0x2d,%edi
  xor    %eax,%eax
  call   <dopr_outch@plt>
L193:
  add    %r13,%rbp
  lea    -0x1(%r14),%eax
  lea    0x10(%rsp,%r13,1),%r12
  sub    %rax,%rbp
  nopl   0x0(%rax,%rax,1)
L74:
  movsbl -0x1(%r12),%edi
  xor    %eax,%eax
  sub    $0x1,%r12
  call   <dopr_outch@plt>
  cmp    %rbp,%r12
  jne    L74
  test   %ebx,%ebx
  je     L195
  nopw   0x0(%rax,%rax,1)
L37:
  xor    %eax,%eax
  mov    $0x20,%edi
  call   <dopr_outch@plt>
  add    $0x1,%ebx
  jne    L37
L195:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L205
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L99:
  test   %r15d,%r15d
  je     L84
  test   %r8d,%r8d
  jle    L81
  mov    0xc(%rsp),%edx
  test   %edx,%edx
  jne    L105
  nopw   0x0(%rax,%rax,1)
L168:
  xor    %eax,%eax
  mov    %r15d,%edi
  call   <dopr_outch@plt>
  sub    $0x1,%r12d
  je     L193
L31:
  xor    %eax,%eax
  mov    %r15d,%edi
  call   <dopr_outch@plt>
  sub    $0x1,%r12d
  jne    L168
  jmp    L193
  nopl   0x0(%rax)
L103:
  movl   $0x2d,0xc(%rsp)
  neg    %r10
  jmp    L192
L84:
  test   %r8d,%r8d
  jle    L81
  mov    %r12d,%ebx
L34:
  xor    %eax,%eax
  mov    $0x20,%edi
  call   <dopr_outch@plt>
  sub    $0x1,%ebx
  jne    L34
  test   %r12d,%r12d
  mov    $0x1,%eax
  mov    %r12d,%ebx
  cmovg  %r12d,%eax
  sub    %eax,%ebx
  jmp    L26
  nopw   0x0(%rax,%rax,1)
L105:
  sub    $0x1,%r12d
  xor    %eax,%eax
  mov    $0x2d,%edi
  call   <dopr_outch@plt>
  test   %r12d,%r12d
  je     L193
  xor    %eax,%eax
  mov    %r15d,%edi
  call   <dopr_outch@plt>
  sub    $0x1,%r12d
  jne    L31
  jmp    L193
L205:
  call   <__stack_chk_fail@plt>
L81:
  mov    %r12d,%ebx
  jmp    L26
```

tool_calls: name: parse_data
arguments: data_label: D14
type: string
name: parse_data
arguments: data_label: D8
type: string

tool: D14: 0123456789ABCDEF

tool: D8: 0123456789abcdef

assistant: ```c
void fmtnum(value, base, dosign, ljust, len, zpad) long value;
int base, dosign, ljust, len, zpad;
{
  int signvalue = 0;
  unsigned long uvalue;
  char convert[20];
  int place = 0;
  int padlen = 0;
  int caps = 0;
  uvalue = value;
  if (dosign) {
    if (value < 0) {
      signvalue = '-';
      uvalue = -value;
    }
  }
  if (base < 0) {
    caps = 1;
    base = -base;
  }
  do {
    convert[place++] = (caps ? "0123456789ABCDEF" : "0123456789abcdef")[uvalue % (unsigned)base];
    uvalue = (uvalue / (unsigned)base);
  } while (uvalue);
  convert[place] = 0;
  padlen = len - place;
  if (padlen < 0)
    padlen = 0;
  if (ljust)
    padlen = -padlen;
  if (zpad && padlen > 0) {
    if (signvalue) {
      dopr_outch(signvalue);
      --padlen;
      signvalue = 0;
    }
    while (padlen > 0) {
      dopr_outch(zpad);
      --padlen;
    }
  }
  while (padlen > 0) {
    dopr_outch(' ');
    --padlen;
  }
  if (signvalue)
    dopr_outch(signvalue);
  while (place > 0)
    dopr_outch(convert[--place]);
  while (padlen < 0) {
    dopr_outch(' ');
    ++padlen;
  }
}
```