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

```asm
<htmlspecialchars2>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  jmp    L12
L94:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  cmp    $0x3e,%eax
  je     L108
  cmp    $0x3e,%eax
  jg     L111
  cmp    $0x3c,%eax
  je     L33
  cmp    $0x3c,%eax
  jg     L111
  cmp    $0x22,%eax
  je     L93
  cmp    $0x26,%eax
  jne    L111
  mov    -0x1c(%rbp),%edx
  mov    -0x8(%rbp),%rax
  sub    -0x18(%rbp),%rax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rcx
  mov    -0x8(%rbp),%rax
  add    $0x5,%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memmove@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x5,%edx
  lea    D34(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  addq   $0x5,-0x8(%rbp)
  addl   $0x5,-0x1c(%rbp)
  jmp    L12
L33:
  mov    -0x1c(%rbp),%edx
  mov    -0x8(%rbp),%rax
  sub    -0x18(%rbp),%rax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rcx
  mov    -0x8(%rbp),%rax
  add    $0x4,%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memmove@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x4,%edx
  lea    D6(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  addq   $0x4,-0x8(%rbp)
  addl   $0x4,-0x1c(%rbp)
  jmp    L12
L108:
  mov    -0x1c(%rbp),%edx
  mov    -0x8(%rbp),%rax
  sub    -0x18(%rbp),%rax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rcx
  mov    -0x8(%rbp),%rax
  add    $0x4,%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memmove@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x4,%edx
  lea    D24(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  addq   $0x4,-0x8(%rbp)
  addl   $0x4,-0x1c(%rbp)
  jmp    L12
L93:
  mov    -0x1c(%rbp),%edx
  mov    -0x8(%rbp),%rax
  sub    -0x18(%rbp),%rax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rcx
  mov    -0x8(%rbp),%rax
  add    $0x6,%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memmove@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x6,%edx
  lea    D5(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  addq   $0x6,-0x8(%rbp)
  addl   $0x6,-0x1c(%rbp)
  jmp    L12
L111:
  addq   $0x1,-0x8(%rbp)
  nop
L12:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L94
  mov    -0x8(%rbp),%rax
  sub    -0x18(%rbp),%rax
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: label: D34
datatype: string
name: disassemble_data
arguments: label: D6
datatype: string
name: disassemble_data
arguments: label: D24
datatype: string
name: disassemble_data
arguments: label: D5
datatype: string

tool: D34: &amp;

tool: D6: &lt;

tool: D24: &gt;

tool: D5: &quot;

assistant: ```c
int htmlspecialchars2(char *in, int len) {
  char *p = in;
  while (*p) {
    switch (*p) {
    case '&':
      memmove(p + 5, p + 1, len - (p - in));
      memcpy(p, "&amp;", 5);
      p += 5;
      len += 5;
      break;
      ;
    case '<':
      memmove(p + 4, p + 1, len - (p - in));
      memcpy(p, "&lt;", 4);
      p += 4;
      len += 4;
      break;
      ;
    case '>':
      memmove(p + 4, p + 1, len - (p - in));
      memcpy(p, "&gt;", 4);
      p += 4;
      len += 4;
      break;
      ;
    case '"':
      memmove(p + 6, p + 1, len - (p - in));
      memcpy(p, "&quot;", 6);
      p += 6;
      len += 6;
      break;
      ;
    default:
      p++;
      break;
    }
  }
  return p - in;
}
```