user: 请从给定的汇编指令推导出C源代码:

```asm
<svg_quotetext>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%r12
  call   <strlen@plt>
  mov    %eax,%ebp
  lea    0x1(%rax),%edi
  call   <malloc@plt>
  mov    %rax,%rdi
  test   %rax,%rax
  je     L24
  movzbl (%r12),%eax
  test   %al,%al
  je     L86
  add    $0x1,%r12
  mov    $0x0,%ebx
  jmp    L49
L51:
  lea    0x4(%rbp),%r13d
  lea    0x5(%rbp),%esi
  call   <realloc@plt>
  mov    %rax,%rdi
  test   %rax,%rax
  je     L24
  movslq %ebx,%rax
  movb   $0x26,(%rdi,%rax,1)
  lea    0x1(%rbx),%eax
  cltq
  movb   $0x61,(%rdi,%rax,1)
  lea    0x2(%rbx),%eax
  cltq
  movb   $0x6d,(%rdi,%rax,1)
  lea    0x4(%rbx),%eax
  lea    0x3(%rbx),%edx
  movslq %edx,%rdx
  movb   $0x70,(%rdi,%rdx,1)
  add    $0x5,%ebx
  cltq
  movb   $0x3b,(%rdi,%rax,1)
  mov    %r13d,%ebp
L118:
  add    $0x1,%r12
  movzbl -0x1(%r12),%eax
  test   %al,%al
  je     L44
L49:
  cmp    $0x3c,%al
  je     L77
  cmp    $0x3e,%al
  je     L83
  cmp    $0x26,%al
  je     L51
  movslq %ebx,%rdx
  mov    %al,(%rdi,%rdx,1)
  lea    0x1(%rbx),%ebx
  jmp    L118
L77:
  lea    0x3(%rbp),%r13d
  lea    0x4(%rbp),%esi
  call   <realloc@plt>
  mov    %rax,%rdi
  test   %rax,%rax
  je     L24
  movslq %ebx,%rax
  movb   $0x26,(%rdi,%rax,1)
  lea    0x1(%rbx),%eax
  cltq
  movb   $0x6c,(%rdi,%rax,1)
  lea    0x3(%rbx),%eax
  lea    0x2(%rbx),%edx
  movslq %edx,%rdx
  movb   $0x74,(%rdi,%rdx,1)
  add    $0x4,%ebx
  cltq
  movb   $0x3b,(%rdi,%rax,1)
  mov    %r13d,%ebp
  jmp    L118
L83:
  lea    0x3(%rbp),%r13d
  lea    0x4(%rbp),%esi
  call   <realloc@plt>
  mov    %rax,%rdi
  test   %rax,%rax
  je     L24
  movslq %ebx,%rax
  movb   $0x26,(%rdi,%rax,1)
  lea    0x1(%rbx),%eax
  cltq
  movb   $0x67,(%rdi,%rax,1)
  lea    0x3(%rbx),%eax
  lea    0x2(%rbx),%edx
  movslq %edx,%rdx
  movb   $0x74,(%rdi,%rdx,1)
  add    $0x4,%ebx
  cltq
  movb   $0x3b,(%rdi,%rax,1)
  mov    %r13d,%ebp
  jmp    L118
L86:
  mov    $0x0,%ebx
L44:
  movslq %ebx,%rbx
  movb   $0x0,(%rdi,%rbx,1)
L24:
  mov    %rdi,%rax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

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;
}
```