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

```asm
<xmlq>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xc68,%rsp
  mov    %rdi,0x8(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0xc58(%rsp)
  xor    %eax,%eax
  test   %rdi,%rdi
  je     L138
  mov    %rdx,%r15
  test   %rdx,%rdx
  je     L138
  mov    %rcx,%rbp
  test   %rcx,%rcx
  je     L138
  test   %r8d,%r8d
  je     L138
  movb   $0x0,(%rcx)
  mov    %rdx,%rdi
  mov    %esi,%r13d
  call   <strlen@plt>
  cmp    $0x3ff,%eax
  jg     L138
  mov    0x8(%rsp),%r14
  jmp    L91
  nopw   0x0(%rax,%rax,1)
L89:
  add    $0x1,%r14
L91:
  movsbl (%r14),%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L89
  cmpb   $0x3c,(%r14)
  jne    L138
  lea    0x20(%rsp),%r12
  mov    %r15,%rcx
  mov    $0x40a,%esi
  lea    D11(%rip),%rdx
  mov    %r12,%rdi
  call   <snprintf@plt>
  lea    0x430(%rsp),%rax
  mov    %r15,%rcx
  lea    D20(%rip),%rdx
  mov    $0x40a,%esi
  mov    %rax,%rdi
  mov    %rax,0x10(%rsp)
  call   <snprintf@plt>
  lea    0x840(%rsp),%rdi
  mov    %r15,%rcx
  lea    D27(%rip),%rdx
  mov    $0x40a,%esi
  mov    %rdi,0x18(%rsp)
  call   <snprintf@plt>
  test   %r13d,%r13d
  js     L358
  xor    %ebx,%ebx
  jmp    L240
  nopw   0x0(%rax,%rax,1)
L421:
  mov    %r12,%rdi
  add    $0x1,%ebx
  call   <strlen@plt>
  cltq
  add    %rax,%r15
  lea    0x1(%r15),%r14
  cmp    %ebx,%r13d
  jl     L192
L240:
  mov    %r12,%rsi
  mov    %r14,%rdi
  call   <strstr@plt>
  mov    %rax,%r15
  test   %rax,%rax
  jne    L421
  mov    0x10(%rsp),%rsi
  mov    %r14,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  jne    L48
  jmp    L138
L290:
  add    $0x1,%rax
L48:
  cmpb   $0x3e,(%rax)
  jne    L290
  lea    0x1(%rax),%r15
  add    $0x1,%ebx
  lea    0x1(%r15),%r14
  cmp    %ebx,%r13d
  jge    L240
L192:
  mov    0x18(%rsp),%rsi
  mov    %r15,%rdi
  call   <strstr@plt>
  mov    %rax,%r12
  test   %rax,%rax
  jne    L225
  mov    0x8(%rsp),%rbx
  mov    %rbx,%rdi
  call   <strlen@plt>
  movslq %eax,%r12
  add    %rbx,%r12
  jmp    L225
  nopl   0x0(%rax,%rax,1)
L138:
  xor    %eax,%eax
L4:
  mov    0xc58(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L32
  add    $0xc68,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L20:
  add    $0x1,%r15
L225:
  movsbl (%r15),%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L20
  cmp    %r12,%r15
  je     L133
  mov    %r12,%rbx
  lea    0x1(%r15),%rsi
  mov    %rbp,%rcx
  sub    %r15,%rbx
  sub    %rsi,%rcx
  lea    -0x1(%rbx),%rax
  cmp    $0xe,%rcx
  jbe    L120
  cmp    $0x6,%rax
  jbe    L120
  cmp    $0xe,%rax
  jbe    L38
  mov    %rbx,%rcx
  xor    %eax,%eax
  and    $0xfffffffffffffff0,%rcx
  xchg   %ax,%ax
L203:
  movdqu (%r15,%rax,1),%xmm0
  movups %xmm0,0x0(%rbp,%rax,1)
  add    $0x10,%rax
  cmp    %rcx,%rax
  jne    L203
  mov    %rbx,%rsi
  and    $0xfffffffffffffff0,%rsi
  lea    0x0(%rbp,%rsi,1),%rcx
  lea    (%r15,%rsi,1),%rax
  cmp    %rsi,%rbx
  je     L17
  mov    %rbx,%rdi
  sub    %rsi,%rdi
  lea    -0x1(%rdi),%r8
  cmp    $0x6,%r8
  jbe    L409
L232:
  mov    (%r15,%rsi,1),%rdx
  mov    %rdx,0x0(%rbp,%rsi,1)
  mov    %rdi,%rdx
  and    $0xfffffffffffffff8,%rdx
  add    %rdx,%rcx
  add    %rdx,%rax
  cmp    %rdx,%rdi
  je     L17
L409:
  movzbl (%rax),%edx
  mov    %dl,(%rcx)
  lea    0x1(%rax),%rdx
  cmp    %rdx,%r12
  je     L17
  movzbl 0x1(%rax),%edx
  mov    %dl,0x1(%rcx)
  lea    0x2(%rax),%rdx
  cmp    %rdx,%r12
  je     L17
  movzbl 0x2(%rax),%edx
  mov    %dl,0x2(%rcx)
  lea    0x3(%rax),%rdx
  cmp    %rdx,%r12
  je     L17
  movzbl 0x3(%rax),%edx
  mov    %dl,0x3(%rcx)
  lea    0x4(%rax),%rdx
  cmp    %rdx,%r12
  je     L17
  movzbl 0x4(%rax),%edx
  mov    %dl,0x4(%rcx)
  lea    0x5(%rax),%rdx
  cmp    %rdx,%r12
  je     L17
  movzbl 0x5(%rax),%edx
  mov    %dl,0x5(%rcx)
  lea    0x6(%rax),%rdx
  cmp    %rdx,%r12
  je     L17
  movzbl 0x6(%rax),%eax
  mov    %al,0x6(%rcx)
L17:
  add    %rbp,%rbx
  cmp    %rbx,%rbp
  jne    L59
  jmp    L1
  nopw   0x0(%rax,%rax,1)
L352:
  sub    $0x1,%rbx
  cmp    %rbx,%rbp
  je     L1
L59:
  movsbl -0x1(%rbx),%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L352
L1:
  movb   $0x0,(%rbx)
  mov    %rbp,%rax
  jmp    L4
L133:
  mov    %rbp,%rbx
  jmp    L1
L120:
  xor    %eax,%eax
  nopl   0x0(%rax)
L277:
  movzbl (%r15,%rax,1),%ecx
  mov    %cl,0x0(%rbp,%rax,1)
  add    $0x1,%rax
  cmp    %rax,%rbx
  jne    L277
  jmp    L17
L38:
  mov    %rbx,%rdi
  mov    %r15,%rax
  mov    %rbp,%rcx
  xor    %esi,%esi
  jmp    L232
L358:
  xor    %r15d,%r15d
  jmp    L192
L32:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: tag: D11
datatype: string
name: unpack_data
arguments: tag: D20
datatype: string
name: unpack_data
arguments: tag: D27
datatype: string

tool: D11: <%s>

tool: D20: <%s 

tool: D27: </%s>

assistant: ```c
const char *xmlq(const char *s, int idx, const char *name, char *dstbuf, int dstlen) {
  const char *save_s = s;
  if (!s || !name || !dstbuf || !dstlen)
    return NULL;
  *dstbuf = 0;
  if (strlen(name) >= 1024)
    return NULL;
  char tmpbuf1[1024 + 10], tmpbuf2[1024 + 10], tmpbuf3[1024 + 10];
  char *dst = dstbuf;
  int i = 0;
  while (isspace(*s))
    s++;
  if (*s != '<')
    return NULL;
  snprintf(tmpbuf1, sizeof(tmpbuf1), "<%s>", name);
  snprintf(tmpbuf2, sizeof(tmpbuf2), "<%s ", name);
  snprintf(tmpbuf3, sizeof(tmpbuf3), "</%s>", name);
  const char *ptr = NULL, *ptr3;
  while (i++ <= idx) {
    ptr = strstr(s, tmpbuf1);
    if (!ptr) {
      ptr = strstr(s, tmpbuf2);
      if (!ptr)
        return NULL;
      while (*ptr != '>')
        ptr++;
      ptr++;
    } else
      ptr += strlen(tmpbuf1);
    s = ptr + 1;
  }
  ptr3 = strstr(ptr, tmpbuf3);
  if (!ptr3)
    ptr3 = save_s + strlen(save_s);
  while (isspace(*ptr))
    ptr++;
  while (ptr != ptr3)
    *dst++ = *ptr++;
  while ((dst != dstbuf) && isspace(dst[-1]))
    dst--;
  *dst = 0;
  return dstbuf;
}
```