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

```asm
<zipc_xml_unescape>:
  endbr64
  push   %r15
  mov    $0x26,%esi
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  call   <strchr@plt>
  test   %rax,%rax
  je     L257
  mov    %rax,%rbx
  movzbl (%rax),%eax
  mov    %rbx,%r15
  test   %al,%al
  je     L240
  lea    D0(%rip),%rbp
  lea    D47(%rip),%r12
  lea    D42(%rip),%r13
  jmp    L118
  nopl   0x0(%rax)
L62:
  movzbl (%rbx),%eax
  add    $0x1,%r15
  mov    %r14,%rbx
  mov    %al,-0x1(%r15)
L2:
  movzbl (%rbx),%eax
  test   %al,%al
  je     L240
L118:
  lea    0x1(%rbx),%r14
  cmp    $0x26,%al
  jne    L62
  mov    $0x3b,%esi
  mov    %r14,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  je     L62
  mov    $0x4,%edx
  mov    %rbp,%rsi
  mov    %r14,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L156
  add    $0x5,%rbx
  movb   $0x26,(%r15)
  add    $0x1,%r15
  movzbl (%rbx),%eax
  test   %al,%al
  jne    L118
  cs nopw 0x0(%rax,%rax,1)
L240:
  movb   $0x0,(%r15)
L257:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L156:
  mov    $0x3,%edx
  mov    %r12,%rsi
  mov    %r14,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L234
  movb   $0x3c,(%r15)
  add    $0x4,%rbx
  add    $0x1,%r15
  jmp    L2
  nopl   (%rax)
L234:
  mov    $0x3,%edx
  mov    %r13,%rsi
  mov    %r14,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L245
  movb   $0x3e,(%r15)
  add    $0x4,%rbx
  add    $0x1,%r15
  jmp    L2
L245:
  mov    $0x5,%edx
  lea    D49(%rip),%rsi
  mov    %r14,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L68
  movb   $0x22,(%r15)
  add    $0x6,%rbx
  add    $0x1,%r15
  jmp    L2
L68:
  mov    $0x5,%edx
  lea    D30(%rip),%rsi
  mov    %r14,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L66
  movb   $0x27,(%r15)
  add    $0x6,%rbx
  add    $0x1,%r15
  jmp    L2
L66:
  cmpb   $0x23,0x1(%rbx)
  je     L123
  movb   $0x26,(%r15)
  mov    %r14,%rbx
  add    $0x1,%r15
  jmp    L2
L123:
  cmpb   $0x78,0x2(%rbx)
  lea    0x2(%rbx),%r14
  je     L169
  mov    $0xa,%edx
  xor    %esi,%esi
  mov    %r14,%rdi
  call   <strtol@plt>
L32:
  cmp    $0x7f,%eax
  jg     L265
  mov    %al,(%r15)
  add    $0x1,%r15
L180:
  mov    $0x3b,%esi
  mov    %r14,%rdi
  call   <strchr@plt>
  lea    0x1(%rax),%rbx
  jmp    L2
L169:
  mov    $0x10,%edx
  xor    %esi,%esi
  mov    %r14,%rdi
  call   <strtol@plt>
  jmp    L32
L265:
  mov    %eax,%esi
  mov    %eax,%edx
  and    $0x3f,%esi
  sar    $0x6,%edx
  or     $0xffffff80,%esi
  cmp    $0x7ff,%eax
  jg     L139
  or     $0xffffffc0,%edx
  mov    %sil,0x1(%r15)
  add    $0x2,%r15
  mov    %dl,-0x2(%r15)
  jmp    L180
L139:
  mov    %eax,%ecx
  and    $0x3f,%edx
  sar    $0xc,%ecx
  or     $0xffffff80,%edx
  cmp    $0xffff,%eax
  jg     L128
  or     $0xffffffe0,%ecx
  mov    %dl,0x1(%r15)
  add    $0x3,%r15
  mov    %cl,-0x3(%r15)
  mov    %sil,-0x1(%r15)
  jmp    L180
L128:
  sar    $0x12,%eax
  mov    %dl,0x2(%r15)
  add    $0x4,%r15
  or     $0xfffffff0,%eax
  mov    %sil,-0x1(%r15)
  mov    %al,-0x4(%r15)
  mov    %ecx,%eax
  and    $0x3f,%eax
  or     $0xffffff80,%eax
  mov    %al,-0x3(%r15)
  jmp    L180
```

tool_calls: name: unpack_data
arguments: label: D0
datatype: string
name: unpack_data
arguments: label: D47
datatype: string
name: unpack_data
arguments: label: D42
datatype: string
name: unpack_data
arguments: label: D49
datatype: string
name: unpack_data
arguments: label: D30
datatype: string

tool: D0: amp;

tool: D47: lt;

tool: D42: gt;

tool: D49: quot;

tool: D30: apos;

assistant: ```c
void zipc_xml_unescape(char *buffer) {
  char *inptr, *outptr;
  if ((inptr = strchr(buffer, '&')) == NULL)
    return;
  for (outptr = inptr; *inptr;) {
    if (*inptr == '&' && strchr(inptr + 1, ';')) {
      inptr++;
      if (!strncmp(inptr, "amp;", 4)) {
        inptr += 4;
        *outptr++ = '&';
      } else if (!strncmp(inptr, "lt;", 3)) {
        inptr += 3;
        *outptr++ = '<';
      } else if (!strncmp(inptr, "gt;", 3)) {
        inptr += 3;
        *outptr++ = '>';
      } else if (!strncmp(inptr, "quot;", 5)) {
        inptr += 5;
        *outptr++ = '\"';
      } else if (!strncmp(inptr, "apos;", 5)) {
        inptr += 5;
        *outptr++ = '\'';
      } else if (*inptr == '#') {
        int ch;
        inptr++;
        if (*inptr == 'x')
          ch = (int)strtol(inptr, NULL, 16);
        else
          ch = (int)strtol(inptr, NULL, 10);
        if (ch < 0x80) {
          *outptr++ = ch;
        } else if (ch < 0x800) {
          *outptr++ = 0xc0 | (ch >> 6);
          *outptr++ = 0x80 | (ch & 0x3f);
        } else if (ch < 0x10000) {
          *outptr++ = 0xe0 | (ch >> 12);
          *outptr++ = 0x80 | ((ch >> 6) & 0x3f);
          *outptr++ = 0x80 | (ch & 0x3f);
        } else {
          *outptr++ = 0xf0 | (ch >> 18);
          *outptr++ = 0x80 | ((ch >> 12) & 0x3f);
          *outptr++ = 0x80 | ((ch >> 6) & 0x3f);
          *outptr++ = 0x80 | (ch & 0x3f);
        }
        inptr = strchr(inptr, ';') + 1;
      } else {
        *outptr++ = '&';
      }
    } else {
      *outptr++ = *inptr++;
    }
  }
  *outptr = '\0';
}
```