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

```asm
<rxml_decode_string>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  movzbl (%rdi),%eax
  test   %al,%al
  je     L67
  lea    0x1(%rdi),%rbp
  lea    D59(%rip),%r13
  lea    D44(%rip),%r14
  lea    D48(%rip),%r15
  jmp    L111
L63:
  mov    %rbx,%rdi
  call   <strlen@plt>
  mov    %rax,%r12
  cmp    $0x3,%eax
  jg     L259
L142:
  cmp    $0x4,%r12d
  jg     L31
L202:
  cmp    $0x5,%r12d
  jg     L69
L173:
  lea    0x4(%rsp),%rdx
  lea    0x2(%rbx),%rdi
  mov    %r13,%rsi
  call   <sscanf@plt>
  test   %eax,%eax
  je     L12
  mov    %rbp,%rdx
  mov    0x4(%rsp),%eax
  mov    %al,-0x1(%rbp)
  cmpb   $0x3b,0x3(%rbx)
  je     L87
  cmpb   $0x3b,0x4(%rbx)
  je     L60
  cmpb   $0x3b,0x5(%rbx)
  jne    L251
  add    $0x6,%rbx
  jmp    L219
L259:
  mov    $0x4,%edx
  lea    D58(%rip),%rsi
  mov    %rbx,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L113
  mov    %rbp,%rdx
  movb   $0x3e,-0x1(%rbp)
  add    $0x4,%rbx
L219:
  movzbl (%rbx),%eax
  add    $0x1,%rbp
  test   %al,%al
  je     L36
L111:
  cmp    $0x26,%al
  je     L63
  add    $0x1,%rbx
  mov    %rbp,%rdx
  mov    %al,-0x1(%rbp)
  jmp    L219
L31:
  mov    $0x5,%edx
  mov    %r15,%rsi
  mov    %rbx,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L202
  mov    %rbp,%rdx
  movb   $0x26,-0x1(%rbp)
  add    $0x5,%rbx
  jmp    L219
L69:
  mov    $0x6,%edx
  lea    D3(%rip),%rsi
  mov    %rbx,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L93
  mov    %rbp,%rdx
  movb   $0x22,-0x1(%rbp)
  add    $0x6,%rbx
  jmp    L219
L87:
  add    $0x4,%rbx
  jmp    L219
L60:
  add    $0x5,%rbx
  jmp    L219
L67:
  mov    %rdi,%rdx
L36:
  movb   $0x0,(%rdx)
  mov    $0x1,%eax
L12:
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L254
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L251:
  mov    $0x0,%eax
  jmp    L12
L93:
  mov    $0x6,%edx
  mov    %r14,%rsi
  mov    %rbx,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L173
  mov    %rbp,%rdx
  movb   $0x27,-0x1(%rbp)
  add    $0x6,%rbx
  jmp    L219
L113:
  mov    $0x4,%edx
  lea    D33(%rip),%rsi
  mov    %rbx,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L142
  mov    %rbp,%rdx
  movb   $0x3c,-0x1(%rbp)
  add    $0x4,%rbx
  jmp    L219
L254:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D59
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D44
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D48
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D58
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D3
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D33
type_guessed: string

tool: D59: %d;

tool: D44: &apos;

tool: D48: &amp;

tool: D58: &gt;

tool: D3: &quot;

tool: D33: &lt;

assistant: ```c
int rxml_decode_string(char *string) {
  char *src, *dst;
  int len;
  int cval;
  src = dst = string;
  while (*src) {
    if ((*src) == '&') {
      len = (int)strlen(src);
      if ((len > 3) && (strncmp(src, "&gt;", 4) == 0)) {
        *dst++ = '>';
        src += 4;
      } else if ((len > 3) && (strncmp(src, "&lt;", 4) == 0)) {
        *dst++ = '<';
        src += 4;
      } else if ((len > 4) && (strncmp(src, "&amp;", 5) == 0)) {
        *dst++ = '&';
        src += 5;
      } else if ((len > 5) && (strncmp(src, "&quot;", 6) == 0)) {
        *dst++ = '"';
        src += 6;
      } else if ((len > 5) && (strncmp(src, "&apos;", 6) == 0)) {
        *dst++ = '\'';
        src += 6;
      } else {
        if (!sscanf((char *)&src[2], "%d;", &cval))
          return 0;
        *dst++ = cval;
        if (src[3] == ';') {
          src += 4;
        } else if (src[4] == ';') {
          src += 5;
        } else if (src[5] == ';') {
          src += 6;
        } else {
          return 0;
        }
      }
    } else {
      *dst++ = *src++;
    }
  }
  *dst = '\0';
  return 1;
}
```