user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<appendText>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %edx,%eax
  mov    %al,-0x34(%rbp)
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x10(%rbp)
  cmpq   $0x0,-0x28(%rbp)
  je     L121
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  jmp    L64
L121:
  mov    $0x0,%eax
L64:
  mov    %eax,-0xc(%rbp)
  mov    -0x10(%rbp),%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  add    $0x1,%eax
  mov    %eax,-0x18(%rbp)
  cmpb   $0x0,-0x34(%rbp)
  je     L58
  addl   $0x2,-0x18(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L76
L107:
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    %al,-0x34(%rbp)
  jne    L16
  addl   $0x1,-0x18(%rbp)
L16:
  addl   $0x1,-0x14(%rbp)
L76:
  mov    -0x14(%rbp),%eax
  cmp    -0x10(%rbp),%eax
  jl     L107
L58:
  mov    -0x18(%rbp),%edx
  mov    -0x28(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <realloc@plt>
  mov    %rax,-0x28(%rbp)
  cmpq   $0x0,-0x28(%rbp)
  jne    L9
  mov    $0x0,%eax
  jmp    L128
L9:
  cmpb   $0x0,-0x34(%rbp)
  je     L67
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  movzbl -0x34(%rbp),%edx
  mov    %dl,(%rax)
  movl   $0x0,-0x14(%rbp)
  jmp    L14
L49:
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x30(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  movzbl (%rcx),%edx
  mov    %dl,(%rax)
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    %al,-0x34(%rbp)
  jne    L51
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  movzbl -0x34(%rbp),%edx
  mov    %dl,(%rax)
L51:
  addl   $0x1,-0x14(%rbp)
L14:
  mov    -0x14(%rbp),%eax
  cmp    -0x10(%rbp),%eax
  jl     L49
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  movzbl -0x34(%rbp),%edx
  mov    %dl,(%rax)
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  movb   $0x0,(%rax)
  mov    -0x8(%rbp),%rax
  sub    -0x28(%rbp),%rax
  mov    %rax,%rdx
  mov    -0x18(%rbp),%eax
  cltq
  cmp    %rax,%rdx
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  jmp    L0
L67:
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x10(%rbp),%edx
  mov    -0x30(%rbp),%rax
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <memcpy@plt>
  mov    -0x18(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
L0:
  mov    -0x28(%rbp),%rax
L128:
  leave
  ret
```

assistant: ```c
char *appendText(char *zIn, char const *zAppend, char quote) {
  int len;
  int i;
  int nAppend = strlen(zAppend);
  int nIn = (zIn ? strlen(zIn) : 0);
  len = nAppend + nIn + 1;
  if (quote) {
    len += 2;
    for (i = 0; i < nAppend; i++) {
      if (zAppend[i] == quote)
        len++;
    }
  }
  zIn = (char *)realloc(zIn, len);
  if (!zIn) {
    return 0;
  }
  if (quote) {
    char *zCsr = &zIn[nIn];
    *zCsr++ = quote;
    for (i = 0; i < nAppend; i++) {
      *zCsr++ = zAppend[i];
      if (zAppend[i] == quote)
        *zCsr++ = quote;
    }
    *zCsr++ = quote;
    *zCsr++ = '\0';
    assert((zCsr - zIn) == len);
  } else {
    memcpy(&zIn[nIn], zAppend, nAppend);
    zIn[len - 1] = '\0';
  }
  return zIn;
}
```