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    L477
L200:
  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    L285
  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>
L285:
  mov    -0x58(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xd,%al
  je     L200
  addq   $0x1,-0x58(%rbp)
L477:
  mov    -0x58(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L285
  mov    -0x48(%rbp),%rax
  mov    %rax,-0x58(%rbp)
  jmp    L85
L523:
  addq   $0x1,-0x58(%rbp)
L85:
  mov    -0x58(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L236
  mov    -0x58(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x26,%al
  je     L236
  mov    -0x58(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x25,%al
  jne    L238
  cmpb   $0x25,-0x64(%rbp)
  je     L236
L238:
  mov    -0x58(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isspace@plt>
  test   %rax,%rax
  je     L523
L236:
  mov    -0x58(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L75
  cmpb   $0x63,-0x64(%rbp)
  je     L70
  mov    -0x58(%rbp),%rax
  mov    $0x2,%edx
  lea    D0(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L70
  mov    -0x58(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  cmp    $0x78,%al
  jne    L51
  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    L330
L51:
  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)
L330:
  cmpq   $0x0,-0x38(%rbp)
  je     L140
  mov    -0x50(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x3b,%al
  je     L152
L140:
  addq   $0x1,-0x58(%rbp)
  jmp    L29
L152:
  cmpq   $0x7f,-0x38(%rbp)
  jg     L56
  mov    -0x58(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x58(%rbp)
  mov    -0x38(%rbp),%rdx
  mov    %dl,(%rax)
  jmp    L538
L56:
  movq   $0x0,-0x40(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x30(%rbp)
  jmp    L398
L244:
  addq   $0x1,-0x40(%rbp)
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdx
  shr    $0x3f,%rdx
  add    %rdx,%rax
  sar    %rax
  mov    %rax,-0x30(%rbp)
L398:
  cmpq   $0x0,-0x30(%rbp)
  jne    L244
  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    L276
L15:
  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)
L276:
  cmpq   $0x0,-0x40(%rbp)
  jne    L15
L538:
  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    L29
L70:
  mov    -0x58(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x26,%al
  jne    L381
  cmpb   $0x26,-0x64(%rbp)
  je     L448
  cmpb   $0x20,-0x64(%rbp)
  je     L448
  cmpb   $0x2a,-0x64(%rbp)
  je     L448
L381:
  mov    -0x58(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x25,%al
  jne    L177
  cmpb   $0x25,-0x64(%rbp)
  jne    L177
L448:
  movq   $0x0,-0x40(%rbp)
  jmp    L359
L426:
  addq   $0x2,-0x40(%rbp)
L359:
  mov    -0x40(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L484
  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    L426
L484:
  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     L383
  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    L176
  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    L186
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,%rdx
  mov    -0x48(%rbp),%rax
  mov    %rax,%rsi
  mov    %rdx,%rdi
  call   <strcpy@plt>
  jmp    L242
L186:
  mov    -0x20(%rbp),%rdx
  mov    -0x48(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <realloc@plt>
L242:
  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)
L176:
  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    L29
L383:
  addq   $0x1,-0x58(%rbp)
  jmp    L29
L177:
  cmpb   $0x20,-0x64(%rbp)
  je     L240
  cmpb   $0x2a,-0x64(%rbp)
  jne    L28
L240:
  mov    -0x58(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isspace@plt>
  test   %rax,%rax
  je     L28
  mov    -0x58(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x58(%rbp)
  movb   $0x20,(%rax)
  jmp    L29
L28:
  addq   $0x1,-0x58(%rbp)
L29:
  jmp    L85
L75:
  nop
  cmpb   $0x2a,-0x64(%rbp)
  jne    L195
  mov    -0x48(%rbp),%rax
  mov    %rax,-0x58(%rbp)
  jmp    L410
L218:
  mov    -0x58(%rbp),%rax
  lea    D12(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strspn@plt>
  mov    %rax,-0x20(%rbp)
  cmpq   $0x0,-0x20(%rbp)
  je     L107
  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    L107
L182:
  addq   $0x1,-0x58(%rbp)
L107:
  mov    -0x58(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L435
  mov    -0x58(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  jne    L182
L435:
  addq   $0x1,-0x58(%rbp)
L410:
  mov    -0x58(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L218
  subq   $0x1,-0x58(%rbp)
  mov    -0x58(%rbp),%rax
  cmp    -0x48(%rbp),%rax
  jb     L195
  mov    -0x58(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  jne    L195
  mov    -0x58(%rbp),%rax
  movb   $0x0,(%rax)
L195:
  mov    -0x48(%rbp),%rax
  mov    -0x18(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L394
  call   <__stack_chk_fail@plt>
L394:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: label: D0
type_infered: string
name: disassemble_data
arguments: label: D12
type_infered: string

tool: D0: &#

tool: D12:  

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++) = (char)c;
      else {
        for (b = 0, d = c; d; d /= 2)
          b++;
        b = (b - 2) / 5;
        *(s++) = (char)((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((char *)malloc(l), r) : (char *)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;
}
```