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

```asm
<fmtstr>:
  endbr64
  push   %r15
  mov    %rcx,%r15
  push   %r14
  mov    %rdx,%r14
  push   %r13
  mov    %rsi,%r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %r8,0x8(%rsp)
  mov    0x60(%rsp),%ecx
  test   %r8,%r8
  je     L73
  cmpb   $0x0,(%r8)
  je     L44
L59:
  mov    $0x1,%eax
  nop
L77:
  mov    0x8(%rsp),%rsi
  mov    %eax,%edx
  add    $0x1,%rax
  cmpb   $0x0,-0x1(%rsi,%rax,1)
  jne    L77
  sub    %edx,%ecx
  mov    $0x0,%ebx
  cmovns %ecx,%ebx
  and    $0x1,%r9d
  je     L160
  movsbl (%rsi),%r8d
  neg    %ebx
  test   %r8b,%r8b
  je     L239
  xor    %ebp,%ebp
L29:
  cmp    0x68(%rsp),%ebp
  jge    L14
  mov    0x68(%rsp),%eax
  mov    0x8(%rsp),%r9
  sub    $0x1,%eax
  sub    %ebp,%eax
  lea    0x1(%r9,%rax,1),%rax
  mov    %rax,0x18(%rsp)
  jmp    L222
  nopl   0x0(%rax,%rax,1)
L190:
  cmp    0x18(%rsp),%r9
  je     L14
L222:
  add    $0x1,%r9
  mov    %r15,%rcx
  mov    %r14,%rdx
  mov    %r13,%rsi
  mov    %r12,%rdi
  mov    %r9,0x10(%rsp)
  call   <doapr_outch@plt>
  mov    0x10(%rsp),%r9
  mov    %r9d,%eax
  movsbl (%r9),%r8d
  sub    0x8(%rsp),%eax
  add    %ebp,%eax
  mov    %eax,0x10(%rsp)
  test   %r8b,%r8b
  jne    L190
L45:
  test   %ebx,%ebx
  jns    L14
  mov    0x10(%rsp),%eax
  cmp    %eax,0x68(%rsp)
  jle    L14
  mov    %ebx,%ebp
  jmp    L183
  xchg   %ax,%ax
L63:
  cmp    %eax,0x68(%rsp)
  jle    L14
L183:
  mov    $0x20,%r8d
  mov    %r15,%rcx
  mov    %r14,%rdx
  mov    %r13,%rsi
  mov    %r12,%rdi
  add    $0x1,%ebp
  call   <doapr_outch@plt>
  mov    0x10(%rsp),%eax
  add    %ebp,%eax
  sub    %ebx,%eax
  test   %ebp,%ebp
  js     L63
L14:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L44:
  xor    %ebx,%ebx
  test   %ecx,%ecx
  cmovns %ecx,%ebx
  and    $0x1,%r9d
  jne    L174
  nopl   (%rax)
L160:
  mov    0x68(%rsp),%eax
  test   %eax,%eax
  jle    L184
  xor    %ebp,%ebp
  test   %ecx,%ecx
  jle    L184
  xchg   %ax,%ax
L121:
  mov    $0x20,%r8d
  mov    %r15,%rcx
  mov    %r14,%rdx
  mov    %r13,%rsi
  mov    %r12,%rdi
  sub    $0x1,%ebx
  add    $0x1,%ebp
  call   <doapr_outch@plt>
  test   %ebx,%ebx
  jle    L212
  cmp    %ebp,0x68(%rsp)
  jg     L121
L212:
  mov    0x8(%rsp),%rax
  movsbl (%rax),%r8d
  test   %r8b,%r8b
  jne    L29
  jmp    L14
  nopl   0x0(%rax,%rax,1)
L73:
  lea    D8(%rip),%rax
  mov    %rax,0x8(%rsp)
  jmp    L59
L174:
  neg    %ebx
L239:
  movl   $0x0,0x10(%rsp)
  jmp    L45
L184:
  xor    %ebp,%ebp
  jmp    L212
```

tool_calls: name: read_data
arguments: tag: D8
data_type: string

tool: D8: <NULL>

assistant: ```c
void fmtstr(char **sbuffer, char **buffer, size_t *currlen, size_t *maxlen, const char *value, int flags, int min, int max) {
  int padlen, strln;
  int cnt = 0;
  if (value == 0)
    value = "<NULL>";
  for (strln = 0; value[strln]; ++strln)
    ;
  padlen = min - strln;
  if (padlen < 0)
    padlen = 0;
  if (flags & (1 << 0))
    padlen = -padlen;
  while ((padlen > 0) && (cnt < max)) {
    doapr_outch(sbuffer, buffer, currlen, maxlen, ' ');
    --padlen;
    ++cnt;
  }
  while (*value && (cnt < max)) {
    doapr_outch(sbuffer, buffer, currlen, maxlen, *value++);
    ++cnt;
  }
  while ((padlen < 0) && (cnt < max)) {
    doapr_outch(sbuffer, buffer, currlen, maxlen, ' ');
    ++padlen;
    ++cnt;
  }
}
```