user: What is the c source code of the assembly code below?

```asm
<string_xmlfixup>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  movl   $0x0,-0xc(%rbp)
  movl   $0x0,-0x10(%rbp)
  jmp    L174
L129:
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x22,%eax
  cmp    $0x1c,%eax
  ja     L60
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  lea    D40(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D40(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
  addl   $0x5,-0x10(%rbp)
  jmp    L104
  addl   $0x8,-0x10(%rbp)
  jmp    L104
  addl   $0x6,-0x10(%rbp)
  jmp    L104
  addl   $0x4,-0x10(%rbp)
  jmp    L104
  addl   $0x4,-0x10(%rbp)
  jmp    L104
L60:
  addl   $0x1,-0x10(%rbp)
  nop
L104:
  addl   $0x1,-0xc(%rbp)
L174:
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L129
  mov    -0x10(%rbp),%eax
  cmp    -0xc(%rbp),%eax
  jne    L82
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <string_dup@plt>
  jmp    L116
L82:
  mov    -0x10(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,%edi
  call   <smalloc@plt>
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0xc(%rbp)
  movl   $0x0,-0x10(%rbp)
  jmp    L155
L172:
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x22,%eax
  cmp    $0x1c,%eax
  ja     L170
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  lea    D87(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D87(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    $0x5,%edx
  lea    D3(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncpy@plt>
  addl   $0x5,-0x10(%rbp)
  jmp    L48
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    $0x8,%edx
  lea    D10(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncpy@plt>
  addl   $0x8,-0x10(%rbp)
  jmp    L48
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    $0x6,%edx
  lea    D82(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncpy@plt>
  addl   $0x6,-0x10(%rbp)
  jmp    L48
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    $0x4,%edx
  lea    D34(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncpy@plt>
  addl   $0x4,-0x10(%rbp)
  jmp    L48
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    $0x4,%edx
  lea    D45(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncpy@plt>
  addl   $0x4,-0x10(%rbp)
  jmp    L48
L170:
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    -0x10(%rbp),%edx
  movslq %edx,%rcx
  mov    -0x8(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  addl   $0x1,-0x10(%rbp)
  nop
L48:
  addl   $0x1,-0xc(%rbp)
L155:
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L172
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x8(%rbp),%rax
L116:
  leave
  ret
```

tool_calls: name: parse_data
arguments: label: D3
type_guessed: string
name: parse_data
arguments: label: D10
type_guessed: string
name: parse_data
arguments: label: D82
type_guessed: string
name: parse_data
arguments: label: D34
type_guessed: string
name: parse_data
arguments: label: D45
type_guessed: string

tool: D3: &amp;

tool: D10: &dquote;

tool: D82: &apos;

tool: D34: &lt;

tool: D45: &gt;

assistant: ```c
char *string_xmlfixup(const char *str, int cdata) {
  int ich, i;
  char *nstr;
  for (i = 0, ich = 0; str[i]; i++) {
    switch (str[i]) {
    case '&':
      ich += 5;
      break;
    case '\"':
      ich += 8;
      break;
    case '\'':
      ich += 6;
      break;
    case '<':
      ich += 4;
      break;
    case '>':
      ich += 4;
      break;
    default:
      ich++;
      break;
    }
  }
  if (ich == i) {
    return string_dup(str);
  }
  nstr = (char *)smalloc(ich + 1);
  for (i = 0, ich = 0; str[i]; i++) {
    switch (str[i]) {
    case '&':
      strncpy(nstr + ich, "&amp;", 5);
      ich += 5;
      break;
    case '\"':
      strncpy(nstr + ich, "&dquote;", 8);
      ich += 8;
      break;
    case '\'':
      strncpy(nstr + ich, "&apos;", 6);
      ich += 6;
      break;
    case '<':
      strncpy(nstr + ich, "&lt;", 4);
      ich += 4;
      break;
    case '>':
      strncpy(nstr + ich, "&gt;", 4);
      ich += 4;
      break;
    default:
      nstr[ich] = str[i];
      ich++;
      break;
    }
  }
  nstr[ich] = '\0';
  return nstr;
}
```