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

```asm
<svg_quotetext>:
  endbr64
  push   %r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  call   <strlen@plt>
  lea    0x1(%rax),%edi
  mov    %eax,%ebp
  call   <malloc@plt>
  test   %rax,%rax
  je     L101
  mov    %rax,%rdi
  movzbl (%r12),%eax
  test   %al,%al
  je     L69
  add    $0x1,%r12
  xor    %ebx,%ebx
  jmp    L112
  nopl   0x0(%rax)
L67:
  cmp    $0x26,%al
  je     L18
  movslq %ebx,%rdx
  add    $0x1,%ebx
  mov    %al,(%rdi,%rdx,1)
L42:
  movzbl (%r12),%eax
  add    $0x1,%r12
  test   %al,%al
  je     L32
L112:
  cmp    $0x3c,%al
  je     L21
  cmp    $0x3e,%al
  jne    L67
  lea    0x4(%rbp),%esi
  lea    0x3(%rbp),%r13d
  call   <realloc@plt>
  mov    %rax,%rdi
  test   %rax,%rax
  je     L101
  movslq %ebx,%rax
  movb   $0x26,(%rdi,%rax,1)
  lea    0x1(%rbx),%eax
  cltq
  movb   $0x67,(%rdi,%rax,1)
L98:
  lea    0x3(%rbx),%eax
  lea    0x2(%rbx),%edx
  add    $0x1,%r12
  add    $0x4,%ebx
  cltq
  movslq %edx,%rdx
  mov    %r13d,%ebp
  movb   $0x74,(%rdi,%rdx,1)
  movb   $0x3b,(%rdi,%rax,1)
  movzbl -0x1(%r12),%eax
  test   %al,%al
  jne    L112
L32:
  movslq %ebx,%rbx
  add    %rdi,%rbx
L33:
  movb   $0x0,(%rbx)
  add    $0x8,%rsp
  mov    %rdi,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L21:
  lea    0x4(%rbp),%esi
  lea    0x3(%rbp),%r13d
  call   <realloc@plt>
  mov    %rax,%rdi
  test   %rax,%rax
  je     L101
  movslq %ebx,%rax
  movb   $0x26,(%rdi,%rax,1)
  lea    0x1(%rbx),%eax
  cltq
  movb   $0x6c,(%rdi,%rax,1)
  jmp    L98
  xchg   %ax,%ax
L18:
  lea    0x5(%rbp),%esi
  lea    0x4(%rbp),%r13d
  call   <realloc@plt>
  mov    %rax,%rdi
  test   %rax,%rax
  je     L101
  movslq %ebx,%rax
  lea    0x3(%rbx),%edx
  mov    %r13d,%ebp
  movb   $0x26,(%rdi,%rax,1)
  lea    0x1(%rbx),%eax
  movslq %edx,%rdx
  cltq
  movb   $0x61,(%rdi,%rax,1)
  lea    0x2(%rbx),%eax
  cltq
  movb   $0x6d,(%rdi,%rax,1)
  lea    0x4(%rbx),%eax
  add    $0x5,%ebx
  cltq
  movb   $0x70,(%rdi,%rdx,1)
  movb   $0x3b,(%rdi,%rax,1)
  jmp    L42
  nopl   0x0(%rax,%rax,1)
L101:
  add    $0x8,%rsp
  xor    %edi,%edi
  pop    %rbx
  mov    %rdi,%rax
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L69:
  mov    %rdi,%rbx
  jmp    L33
```

assistant: ```c
char *svg_quotetext(const char *text) {
  int lengthK = (int)strlen(text);
  char *result = malloc(lengthK + 1);
  if (NULL == result) {
    return NULL;
  }
  int i = 0;
  int k = 0;
  char c;
  for (; '\0' != (c = text[i]); i++) {
    switch (c) {
    case '&':
      lengthK += 4;
      result = realloc(result, lengthK + 1);
      if (NULL == result) {
        return NULL;
      }
      result[k++] = '&';
      result[k++] = 'a';
      result[k++] = 'm';
      result[k++] = 'p';
      result[k++] = ';';
      break;
    case '<':
      lengthK += 3;
      result = realloc(result, lengthK + 1);
      if (NULL == result) {
        return NULL;
      }
      result[k++] = '&';
      result[k++] = 'l';
      result[k++] = 't';
      result[k++] = ';';
      break;
    case '>':
      lengthK += 3;
      result = realloc(result, lengthK + 1);
      if (NULL == result) {
        return NULL;
      }
      result[k++] = '&';
      result[k++] = 'g';
      result[k++] = 't';
      result[k++] = ';';
      break;
    default:
      result[k++] = c;
      break;
    }
  }
  result[k++] = '\0';
  return result;
}
```