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

```asm
<html_escape_str>:
  endbr64
  mov    %rsi,%rcx
  mov    %rdx,%r8
  test   %rdx,%rdx
  je     L176
  xor    %eax,%eax
  lea    D2(%rip),%r10
  lea    D11(%rip),%r9
  nopl   0x0(%rax,%rax,1)
L180:
  movzbl (%rcx),%edx
  add    $0x1,%rcx
  mov    %rdx,%rsi
  movzbl (%r10,%rdx,1),%edx
  cmp    $0x3e,%dl
  jg     L99
  cmp    $0x25,%dl
  jle    L81
  sub    $0x26,%edx
  cmp    $0x18,%dl
  ja     L81
  movzbl %dl,%edx
  movslq (%r9,%rdx,4),%rdx
  add    %r9,%rdx
  notrack jmp *%rdx
  nopw   0x0(%rax,%rax,1)
  movb   $0x3f,(%rdi)
  add    $0x1,%rax
  add    $0x1,%rdi
  nopl   0x0(%rax,%rax,1)
L81:
  cmp    %rax,%r8
  ja     L180
L190:
  movb   $0x0,(%rdi)
  ret
  nopl   0x0(%rax)
  lea    0x4(%rax),%rdx
  cmp    %r8,%rdx
  ja     L190
  mov    %rdx,%rax
  movl   $0x3b746726,(%rdi)
  add    $0x4,%rdi
  cmp    %rax,%r8
  ja     L180
  jmp    L190
  nopl   (%rax)
  lea    0x4(%rax),%rdx
  cmp    %r8,%rdx
  ja     L190
  mov    %rdx,%rax
  movl   $0x3b746c26,(%rdi)
  add    $0x4,%rdi
  cmp    %rax,%r8
  ja     L180
  jmp    L190
  nopl   0x0(%rax)
  add    $0x1,%rax
  mov    %sil,(%rdi)
  add    $0x1,%rdi
  cmp    %rax,%r8
  ja     L180
  jmp    L190
  xchg   %ax,%ax
  lea    0x5(%rax),%rdx
  cmp    %r8,%rdx
  ja     L190
  mov    %rdx,%rax
  movl   $0x706d6126,(%rdi)
  add    $0x5,%rdi
  movb   $0x3b,-0x1(%rdi)
  cmp    %rax,%r8
  ja     L180
  jmp    L190
  nopl   0x0(%rax,%rax,1)
L99:
  cmp    $0x5a,%dl
  je     L190
  cmp    $0x71,%dl
  jne    L81
  lea    0x6(%rax),%rdx
  cmp    %r8,%rdx
  ja     L190
  mov    $0x3b74,%eax
  movl   $0x6f757126,(%rdi)
  add    $0x6,%rdi
  mov    %ax,-0x2(%rdi)
  mov    %rdx,%rax
  cmp    %rax,%r8
  ja     L180
  jmp    L190
L176:
  xor    %eax,%eax
  jmp    L190
```

tool_calls: name: read_data
arguments: data_label: D2
type_infered: string

tool: D2: Z-------------------------------**q***&*********************<*>****************************************************************---------------------------------************************************************************************************************

assistant: ```c
int html_escape_str(char *dst, const char *src, size_t n) {
  unsigned char c;
  size_t i;
  const char *codes = "Z-------------------------------"
                      "**q***&*********************<*>*"
                      "********************************"
                      "*******************************-"
                      "--------------------------------"
                      "********************************"
                      "********************************"
                      "********************************";
  for (i = 0; i < n;) {
    c = (unsigned char)*(src++);
    switch (codes[c]) {
    case 'Z':
      goto leave;
    case '*':
      i++;
      *(dst++) = c;
      break;
    case '-':
      i++;
      *(dst++) = '?';
      break;
    case '&':
      if (i + 5 > n)
        goto leave;
      i += 5;
      *(dst++) = '&';
      *(dst++) = 'a';
      *(dst++) = 'm';
      *(dst++) = 'p';
      *(dst++) = ';';
      break;
    case '<':
      if (i + 4 > n)
        goto leave;
      i += 4;
      *(dst++) = '&';
      *(dst++) = 'l';
      *(dst++) = 't';
      *(dst++) = ';';
      break;
    case '>':
      if (i + 4 > n)
        goto leave;
      i += 4;
      *(dst++) = '&';
      *(dst++) = 'g';
      *(dst++) = 't';
      *(dst++) = ';';
      break;
    case 'q':
      if (i + 6 > n)
        goto leave;
      i += 6;
      *(dst++) = '&';
      *(dst++) = 'q';
      *(dst++) = 'u';
      *(dst++) = 'o';
      *(dst++) = 't';
      *(dst++) = ';';
      break;
    }
  }
leave:
  *(dst++) = '\0';
  return i;
}
```