user: Converte this assembly snippet into its equivalent C code:

```asm
<ezxml_decode>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x68,%rsp
  mov    %rdi,-0x58(%rbp)
  mov    %rsi,-0x60(%rbp)
  mov    %edx,%eax
  mov    %al,-0x64(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  mov    -0x58(%rbp),%rax
  mov    %rax,-0x48(%rbp)
  mov    -0x58(%rbp),%rax
  mov    %rax,-0x28(%rbp)
  jmp    L524
L64:
  mov    -0x58(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x58(%rbp)
  movb   $0xa,(%rax)
  mov    -0x58(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xa,%al
  jne    L249
  mov    -0x58(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  mov    -0x58(%rbp),%rax
  lea    0x1(%rax),%rcx
  mov    -0x58(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memmove@plt>
L249:
  mov    -0x58(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xd,%al
  je     L64
  addq   $0x1,-0x58(%rbp)
L524:
  mov    -0x58(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L249
  mov    -0x48(%rbp),%rax
  mov    %rax,-0x58(%rbp)
  jmp    L398
L151:
  addq   $0x1,-0x58(%rbp)
L398:
  mov    -0x58(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L472
  mov    -0x58(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x26,%al
  je     L472
  mov    -0x58(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x25,%al
  jne    L384
  cmpb   $0x25,-0x64(%rbp)
  je     L472
L384:
  mov    -0x58(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isspace@plt>
  test   %rax,%rax
  je     L151
L472:
  mov    -0x58(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L312
  cmpb   $0x63,-0x64(%rbp)
  je     L148
  mov    -0x58(%rbp),%rax
  mov    $0x2,%edx
  lea    D13(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L148
  mov    -0x58(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  cmp    $0x78,%al
  jne    L144
  mov    -0x58(%rbp),%rax
  lea    0x3(%rax),%rcx
  lea    -0x50(%rbp),%rax
  mov    $0x10,%edx
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <strtol@plt>
  mov    %rax,-0x38(%rbp)
  jmp    L184
L144:
  mov    -0x58(%rbp),%rax
  lea    0x2(%rax),%rcx
  lea    -0x50(%rbp),%rax
  mov    $0xa,%edx
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <strtol@plt>
  mov    %rax,-0x38(%rbp)
L184:
  cmpq   $0x0,-0x38(%rbp)
  je     L225
  mov    -0x50(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x3b,%al
  je     L542
L225:
  addq   $0x1,-0x58(%rbp)
  jmp    L157
L542:
  cmpq   $0x7f,-0x38(%rbp)
  jg     L85
  mov    -0x58(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x58(%rbp)
  mov    -0x38(%rbp),%rdx
  mov    %dl,(%rax)
  jmp    L521
L85:
  movq   $0x0,-0x40(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x30(%rbp)
  jmp    L218
L433:
  addq   $0x1,-0x40(%rbp)
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdx
  shr    $0x3f,%rdx
  add    %rdx,%rax
  sar    %rax
  mov    %rax,-0x30(%rbp)
L218:
  cmpq   $0x0,-0x30(%rbp)
  jne    L433
  mov    -0x40(%rbp),%rax
  lea    -0x2(%rax),%rcx
  movabs $0x6666666666666667,%rdx
  mov    %rcx,%rax
  imul   %rdx
  mov    %rdx,%rax
  sar    %rax
  sar    $0x3f,%rcx
  mov    %rcx,%rdx
  sub    %rdx,%rax
  mov    %rax,-0x40(%rbp)
  mov    -0x40(%rbp),%rax
  mov    %eax,%edx
  mov    $0x7,%eax
  sub    %edx,%eax
  mov    $0xff,%edx
  mov    %eax,%ecx
  shl    %cl,%edx
  mov    %edx,%eax
  mov    %eax,%esi
  mov    -0x40(%rbp),%rax
  mov    %eax,%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,%edx
  mov    -0x38(%rbp),%rax
  mov    %edx,%ecx
  sar    %cl,%rax
  mov    %eax,%ecx
  mov    -0x58(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x58(%rbp)
  or     %ecx,%esi
  mov    %esi,%edx
  mov    %dl,(%rax)
  jmp    L189
L88:
  subq   $0x1,-0x40(%rbp)
  mov    -0x40(%rbp),%rax
  mov    %eax,%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,%edx
  mov    -0x38(%rbp),%rax
  mov    %edx,%ecx
  sar    %cl,%rax
  and    $0x3f,%eax
  mov    %eax,%ecx
  mov    -0x58(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x58(%rbp)
  or     $0xffffff80,%ecx
  mov    %ecx,%edx
  mov    %dl,(%rax)
L189:
  cmpq   $0x0,-0x40(%rbp)
  jne    L88
L521:
  mov    -0x58(%rbp),%rax
  mov    $0x3b,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,%ebx
  mov    -0x58(%rbp),%rax
  mov    $0x3b,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  lea    0x1(%rax),%rcx
  mov    -0x58(%rbp),%rax
  mov    %ebx,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memmove@plt>
  jmp    L157
L148:
  mov    -0x58(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x26,%al
  jne    L415
  cmpb   $0x26,-0x64(%rbp)
  je     L371
  cmpb   $0x20,-0x64(%rbp)
  je     L371
  cmpb   $0x2a,-0x64(%rbp)
  je     L371
L415:
  mov    -0x58(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x25,%al
  jne    L352
  cmpb   $0x25,-0x64(%rbp)
  jne    L352
L371:
  movq   $0x0,-0x40(%rbp)
  jmp    L16
L176:
  addq   $0x2,-0x40(%rbp)
L16:
  mov    -0x40(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L165
  mov    -0x40(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  mov    -0x40(%rbp),%rax
  lea    0x0(,%rax,8),%rcx
  mov    -0x60(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%rax
  mov    -0x58(%rbp),%rcx
  add    $0x1,%rcx
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L176
L165:
  mov    -0x40(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x40(%rbp)
  lea    0x0(,%rax,8),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L377
  mov    -0x40(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cltq
  mov    %rax,-0x38(%rbp)
  mov    -0x38(%rbp),%rax
  lea    -0x1(%rax),%rbx
  mov    -0x58(%rbp),%rax
  mov    $0x3b,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  mov    %rax,-0x50(%rbp)
  mov    -0x50(%rbp),%rax
  sub    -0x58(%rbp),%rax
  cmp    %rax,%rbx
  jle    L43
  mov    -0x58(%rbp),%rax
  sub    -0x48(%rbp),%rax
  mov    %rax,-0x30(%rbp)
  mov    -0x30(%rbp),%rdx
  mov    -0x38(%rbp),%rax
  lea    (%rdx,%rax,1),%rbx
  mov    -0x50(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cltq
  add    %rbx,%rax
  mov    %rax,-0x20(%rbp)
  mov    -0x48(%rbp),%rax
  cmp    -0x28(%rbp),%rax
  jne    L282
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %eax,%edx
  mov    -0x48(%rbp),%rax
  mov    %rax,%rsi
  mov    %edx,%edi
  call   <strcpy@plt>
  jmp    L130
L282:
  mov    -0x20(%rbp),%rdx
  mov    -0x48(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <realloc@plt>
L130:
  mov    %rax,-0x48(%rbp)
  mov    -0x30(%rbp),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x58(%rbp)
  mov    -0x58(%rbp),%rax
  mov    $0x3b,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  mov    %rax,-0x50(%rbp)
L43:
  mov    -0x50(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  mov    -0x50(%rbp),%rax
  lea    0x1(%rax),%rcx
  mov    -0x38(%rbp),%rsi
  mov    -0x58(%rbp),%rax
  add    %rsi,%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memmove@plt>
  mov    -0x40(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rcx
  mov    -0x38(%rbp),%rdx
  mov    -0x58(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncpy@plt>
  jmp    L157
L377:
  addq   $0x1,-0x58(%rbp)
  jmp    L157
L352:
  cmpb   $0x20,-0x64(%rbp)
  je     L528
  cmpb   $0x2a,-0x64(%rbp)
  jne    L501
L528:
  mov    -0x58(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isspace@plt>
  test   %rax,%rax
  je     L501
  mov    -0x58(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x58(%rbp)
  movb   $0x20,(%rax)
  jmp    L157
L501:
  addq   $0x1,-0x58(%rbp)
L157:
  jmp    L398
L312:
  nop
  cmpb   $0x2a,-0x64(%rbp)
  jne    L359
  mov    -0x48(%rbp),%rax
  mov    %rax,-0x58(%rbp)
  jmp    L432
L338:
  mov    -0x58(%rbp),%rax
  lea    D18(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strspn@plt>
  mov    %rax,-0x20(%rbp)
  cmpq   $0x0,-0x20(%rbp)
  je     L414
  mov    -0x20(%rbp),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  lea    0x1(%rax),%edx
  mov    -0x20(%rbp),%rcx
  mov    -0x58(%rbp),%rax
  add    %rax,%rcx
  mov    -0x58(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memmove@plt>
  jmp    L414
L120:
  addq   $0x1,-0x58(%rbp)
L414:
  mov    -0x58(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L131
  mov    -0x58(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  jne    L120
L131:
  addq   $0x1,-0x58(%rbp)
L432:
  mov    -0x58(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L338
  subq   $0x1,-0x58(%rbp)
  mov    -0x58(%rbp),%rax
  cmp    -0x48(%rbp),%rax
  jb     L359
  mov    -0x58(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  jne    L359
  mov    -0x58(%rbp),%rax
  movb   $0x0,(%rax)
L359:
  mov    -0x48(%rbp),%rax
  mov    -0x18(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L493
  call   <__stack_chk_fail@plt>
L493:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D13
data_type: string
name: extract_symbolic_data
arguments: data_tag: D18
data_type: string

tool: D13: &#

tool: D18:  

assistant: ```c
char *ezxml_decode(char *s, char **ent, char t) {
  char *e, *r = s, *m = s;
  long b, c, d, l;
  for (; *s; s++) {
    while (*s == '\r') {
      *(s++) = '\n';
      if (*s == '\n')
        memmove(s, (s + 1), strlen(s));
    }
  }
  for (s = r;;) {
    while (*s && *s != '&' && (*s != '%' || t != '%') && !isspace(*s))
      s++;
    if (!*s)
      break;
    else if (t != 'c' && !strncmp(s, "&#", 2)) {
      if (s[2] == 'x')
        c = strtol(s + 3, &e, 16);
      else
        c = strtol(s + 2, &e, 10);
      if (!c || *e != ';') {
        s++;
        continue;
      }
      if (c < 0x80)
        *(s++) = c;
      else {
        for (b = 0, d = c; d; d /= 2)
          b++;
        b = (b - 2) / 5;
        *(s++) = (0xFF << (7 - b)) | (c >> (6 * b));
        while (b)
          *(s++) = 0x80 | ((c >> (6 * --b)) & 0x3F);
      }
      memmove(s, strchr(s, ';') + 1, strlen(strchr(s, ';')));
    } else if ((*s == '&' && (t == '&' || t == ' ' || t == '*')) || (*s == '%' && t == '%')) {
      for (b = 0; ent[b] && strncmp(s + 1, ent[b], strlen(ent[b])); b += 2)
        ;
      if (ent[b++]) {
        if ((c = strlen(ent[b])) - 1 > (e = strchr(s, ';')) - s) {
          l = (d = (s - r)) + c + strlen(e);
          r = (r == m) ? strcpy(malloc(l), r) : realloc(r, l);
          e = strchr((s = r + d), ';');
        }
        memmove(s + c, e + 1, strlen(e));
        strncpy(s, ent[b], c);
      } else
        s++;
    } else if ((t == ' ' || t == '*') && isspace(*s))
      *(s++) = ' ';
    else
      s++;
  }
  if (t == '*') {
    for (s = r; *s; s++) {
      if ((l = strspn(s, " ")))
        memmove(s, s + l, strlen(s + l) + 1);
      while (*s && *s != ' ')
        s++;
    }
    if (--s >= r && *s == ' ')
      *s = '\0';
  }
  return r;
}
```