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

```asm
<vfmsg>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %rcx,-0x40(%rbp)
  mov    %r8d,-0x44(%rbp)
  movl   $0x0,-0x1c(%rbp)
  movl   $0x0,-0x18(%rbp)
  movl   $0x0,-0x14(%rbp)
  cmpq   $0x0,-0x30(%rbp)
  je     L66
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x1c(%rbp)
L66:
  cmpq   $0x0,-0x40(%rbp)
  je     L51
  mov    -0x40(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x18(%rbp)
L51:
  cmpq   $0x0,-0x38(%rbp)
  je     L129
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x14(%rbp)
L129:
  mov    -0x1c(%rbp),%eax
  lea    (%rax,%rax,1),%edx
  mov    -0x18(%rbp),%eax
  add    %edx,%eax
  lea    0x2(%rax),%edx
  mov    -0x14(%rbp),%eax
  add    %eax,%eax
  add    %edx,%eax
  add    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  je     L149
  mov    -0x8(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  cmpl   $0x0,-0x1c(%rbp)
  je     L148
  jmp    L44
L14:
  mov    -0x30(%rbp),%rdx
  lea    0x1(%rdx),%rax
  mov    %rax,-0x30(%rbp)
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rcx
  mov    %rcx,-0x10(%rbp)
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
  movzbl (%rax),%eax
  cmp    $0x25,%al
  jne    L44
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x25,(%rax)
L44:
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L14
L148:
  cmpl   $0x0,-0x18(%rbp)
  je     L22
  mov    -0x40(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  mov    -0x18(%rbp),%eax
  cltq
  add    %rax,-0x10(%rbp)
L22:
  cmpl   $0x0,-0x14(%rbp)
  je     L53
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x3a,(%rax)
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x20,(%rax)
  jmp    L89
L140:
  mov    -0x38(%rbp),%rdx
  lea    0x1(%rdx),%rax
  mov    %rax,-0x38(%rbp)
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rcx
  mov    %rcx,-0x10(%rbp)
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
  movzbl (%rax),%eax
  cmp    $0x25,%al
  jne    L89
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x25,(%rax)
L89:
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L140
L53:
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0xa,(%rax)
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x0,(%rax)
  mov    -0x8(%rbp),%rax
  mov    %rax,-0x40(%rbp)
  jmp    L115
L149:
  nop
L115:
  mov    -0x44(%rbp),%edx
  mov    -0x40(%rbp),%rcx
  mov    -0x28(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <vfprintf@plt>
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <fflush@plt>
  cmpq   $0x0,-0x8(%rbp)
  je     L59
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
L59:
  nop
  leave
  ret
```

assistant: ```c
void vfmsg(FILE *f, const char *pre, const char *suf, const char *fmt, va_list ap) {
  int prelen = 0, fmtlen = 0, suflen = 0;
  if (pre)
    prelen = strlen(pre);
  if (fmt)
    fmtlen = strlen(fmt);
  if (suf)
    suflen = strlen(suf);
  char *newfmt = malloc(prelen * 2 + fmtlen + 2 + suflen * 2 + 2);
  if (!newfmt)
    goto finish;
  char *newfmt_end = newfmt;
  if (prelen)
    while (*pre)
      if ((*newfmt_end++ = *pre++) == '%')
        *newfmt_end++ = '%';
  if (fmtlen) {
    strcpy(newfmt_end, fmt);
    newfmt_end += fmtlen;
  }
  if (suflen) {
    *newfmt_end++ = ':';
    *newfmt_end++ = ' ';
    while (*suf)
      if ((*newfmt_end++ = *suf++) == '%')
        *newfmt_end++ = '%';
  }
  *newfmt_end++ = '\n';
  *newfmt_end++ = '\0';
  fmt = newfmt;
finish:
  vfprintf(f, fmt, ap);
  fflush(f);
  if (newfmt)
    free(newfmt);
}
```