user: Translate the below assembly code into C programming language:

```asm
<mangle_htmlescape>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x1c(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  jmp    L28
L182:
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0x1d(%rbp)
  movsbl -0x1d(%rbp),%eax
  cmp    $0x3e,%eax
  je     L228
  cmp    $0x3e,%eax
  jg     L230
  cmp    $0x3c,%eax
  je     L228
  cmp    $0x3c,%eax
  jg     L230
  cmp    $0x22,%eax
  je     L37
  cmp    $0x26,%eax
  je     L258
  jmp    L230
L228:
  addl   $0x3,-0x1c(%rbp)
  jmp    L230
L258:
  addl   $0x4,-0x1c(%rbp)
  jmp    L230
L37:
  addl   $0x5,-0x1c(%rbp)
  nop
L230:
  addq   $0x1,-0x10(%rbp)
L28:
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L182
  mov    -0x1c(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  jne    L226
  mov    $0x0,%eax
  jmp    L227
L226:
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  jmp    L247
L22:
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0x1e(%rbp)
  movzbl -0x1e(%rbp),%eax
  cmp    $0x3e,%eax
  je     L221
  cmp    $0x3e,%eax
  jg     L246
  cmp    $0x3c,%eax
  je     L254
  cmp    $0x3c,%eax
  jg     L246
  cmp    $0x22,%eax
  je     L223
  cmp    $0x26,%eax
  je     L200
  jmp    L246
L254:
  mov    -0x18(%rbp),%rax
  lea    D20(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  addq   $0x3,-0x18(%rbp)
  jmp    L198
L221:
  mov    -0x18(%rbp),%rax
  lea    D9(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  addq   $0x3,-0x18(%rbp)
  jmp    L198
L200:
  mov    -0x18(%rbp),%rax
  lea    D33(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  addq   $0x4,-0x18(%rbp)
  jmp    L198
L223:
  mov    -0x18(%rbp),%rax
  lea    D6(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  addq   $0x5,-0x18(%rbp)
  jmp    L198
L246:
  movzbl -0x1e(%rbp),%edx
  mov    -0x18(%rbp),%rax
  mov    %dl,(%rax)
  nop
L198:
  addq   $0x1,-0x10(%rbp)
  addq   $0x1,-0x18(%rbp)
L247:
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L22
  mov    -0x18(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x8(%rbp),%rax
L227:
  leave
  ret
```

tool_calls: name: parse_data
arguments: tag: D20
type_guessed: string
name: parse_data
arguments: tag: D9
type_guessed: string
name: parse_data
arguments: tag: D33
type_guessed: string
name: parse_data
arguments: tag: D6
type_guessed: string

tool: D20: &lt;

tool: D9: &gt;

tool: D33: &amp;

tool: D6: &quot;

assistant: ```c
char *mangle_htmlescape(const char *in) {
  char *out, *tmp;
  int outlen;
  const char *s;
  outlen = strlen(in);
  for (s = in; *s; s++) {
    char c = *s;
    switch (c) {
    case '<':
    case '>':
      outlen += 3;
      break;
    case '&':
      outlen += 4;
      break;
    case '"':
      outlen += 5;
      break;
    }
  }
  out = malloc(outlen + 1);
  if (!out)
    return NULL;
  for (s = in, tmp = out; *s; s++, tmp++) {
    unsigned char c = *s;
    switch (c) {
    case '<':
      strcpy(tmp, "&lt;");
      tmp += 3;
      break;
    case '>':
      strcpy(tmp, "&gt;");
      tmp += 3;
      break;
    case '&':
      strcpy(tmp, "&amp;");
      tmp += 4;
      break;
    case '"':
      strcpy(tmp, "&quot;");
      tmp += 5;
      break;
    default:
      *tmp = c;
      break;
    }
  }
  *tmp = '\0';
  return out;
}
```